Results 1 to 3 of 3
Thread: return an array
-
09-30-2011, 06:05 AM #1
Junior
- Join Date
- Mar 2011
- Posts
- 196
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
return an array
I want to be able to enter a number into a textbox on my page, click ok or press enter and then depending on what the number is, open a new page. Basically each number points to a specific page that I assign. How do I do this? Thanks for any help.
-
04-12-2012, 05:31 AM #2
Sophomore
- Join Date
- Mar 2012
- Posts
- 144
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
yes,you may used the return array in php.. you may get the array valur throught $_post['variable name'];
-
04-12-2012, 09:12 PM #3
Freshman
- Join Date
- Apr 2010
- Posts
- 38
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
Use PHP switch statement.
PHP Code:<?php
//$url is the array holding URLs.
//$i is the number which determine url.
switch ($i) {
case 0:
header("Location: $url[0]");
break;
case 1:
header("Location: $url[1]");
break;
case 2:
header("Location: $url[2]");
break;
}
?>
Similar Threads
-
Return to the top?
By bgjyd834 in forum Search Engine OptimizationReplies: 0Last Post: 09-23-2011, 05:26 AM -
.innerHTML does not return TR and TD tags in FF
By sunshine in forum JavaScript & AJAXReplies: 0Last Post: 01-04-2010, 11:24 AM -
MM's Return Back
By MoneyMonsta in forum IntroductionsReplies: 10Last Post: 12-10-2009, 07:56 PM -
Return the length of a string
By krates98 in forum JavaScript & AJAXReplies: 2Last Post: 07-15-2009, 05:19 AM -
Return visitors
By Rajshree in forum Search Engine OptimizationReplies: 24Last Post: 11-29-2008, 03:23 AM


Reply With Quote

