Results 1 to 8 of 8
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 1 Time in 1 Post
- 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
- 40
- 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;
}
?>
-
12-14-2012, 07:10 AM #4
Freshman
- Join Date
- Dec 2012
- Location
- california,united States
- Posts
- 13
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Can you please provide more details on your requirement?
Hire magento developer at http://www.creativeglance.com
-
01-09-2013, 01:51 AM #5
Freshman
- Join Date
- Dec 2012
- Posts
- 35
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
There are some more ways to do the process but for the beginners PHP is the best one. The above code is very convenient.
-
02-16-2013, 04:01 AM #6
Freshman
- Join Date
- Feb 2013
- Posts
- 20
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Yes PHP is retrun array . you may used the return array in php page=$_GET['last']
-
03-05-2013, 07:55 PM #7
Freshman
- Join Date
- Mar 2012
- Posts
- 13
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
You need to create a form with attribute method='post' or 'method=get' and a input field to enter number and then when submited use $_GET or $_POST to retrieve the number entered.
-
03-05-2013, 08:09 PM #8
Freshman
- Join Date
- Mar 2013
- Posts
- 10
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
The above code is very convenient.
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

