| | |
transfer to a new page through a select event
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2007
Posts: 46
Reputation:
Solved Threads: 1
Gud day everyone!!!
I hope you could help me with this one,
I have a select form that looks like this,
<select>
<option>AAA</option>
<option>BBB</option>
<option>CCC</option>
<option>DDD</option>
<option>EEE</option>
</select>
my question is, how to transfer to a new page if the select is change coz the page i am working right now requires that everytime the select is change it must transfer to a new page....
I am currently working with html and php right now and no javascript. I hope you could help me with this one.. I am just new to webpage...
THANK YOU IN ADVANCE... your help is highly appreciated...
I hope you could help me with this one,
I have a select form that looks like this,
<select>
<option>AAA</option>
<option>BBB</option>
<option>CCC</option>
<option>DDD</option>
<option>EEE</option>
</select>
my question is, how to transfer to a new page if the select is change coz the page i am working right now requires that everytime the select is change it must transfer to a new page....
I am currently working with html and php right now and no javascript. I hope you could help me with this one.. I am just new to webpage...
THANK YOU IN ADVANCE... your help is highly appreciated...
You will need to use something like Javascript of AJAX or something that can be run client side. PHP is a server side language that is executed on the server computer before the users web browser receives the html (which is why you never see php code when you view source of a webpage). You need a script that can run on the users computer (the client computer) to redirect them when they make a selection.
•
•
Join Date: Mar 2008
Posts: 78
Reputation:
Solved Threads: 1
Hi jk,
Like Humbug said it requires code on the persons local machine to do it.
There seems to be plenty of stuff out there to either use or experiment with.
Try this. Seems to do what you want.
http://www.web-source.net/javascript_redirect_box.htm
Like Humbug said it requires code on the persons local machine to do it.
There seems to be plenty of stuff out there to either use or experiment with.
Try this. Seems to do what you want.
http://www.web-source.net/javascript_redirect_box.htm
PHP Syntax (Toggle Plain Text)
U hav to use Java script, its simple only .Just call a function on "Onchange" that diverts page to other location . If not u should use a form with a submit button.So wen te button got submitted it will direct to oter page
•
•
Join Date: Apr 2007
Posts: 46
Reputation:
Solved Threads: 1
thanks, for the great help!!!
i have another problem with regards to onchange event of select (SELECT) form....
i have the following code like this one,
<select>
<option>red</option>
<option>green</option>
<option>blue</option>
<select>
my question is that, how can i redirect my page on same page by changing the background of the page depending on the value of the select.
If for example, i chooses the red option(RED) then after that the background color of my page will turn to the color based on the value of the option.
Thanks for any help and thanks in advanced!!!
i have another problem with regards to onchange event of select (SELECT) form....
i have the following code like this one,
<select>
<option>red</option>
<option>green</option>
<option>blue</option>
<select>
my question is that, how can i redirect my page on same page by changing the background of the page depending on the value of the select.
If for example, i chooses the red option(RED) then after that the background color of my page will turn to the color based on the value of the option.
Thanks for any help and thanks in advanced!!!
You should look into using POST or GET methods with PHP to get info on what was sent to the page ("red", "green", or "blue") and then use sessions to save this data until viewer leaves the page.
Forms in HTML are designed to be used as follows: A form has a bunch of inputs, each with a name and a value (which the user sets), and a submit button which redirects the page to where ever is specified, and the data in all of the inputs is sent as well. PHP is a good language to retrieve this data and make use of it.
I suggest looking up a few tutorials with data retrieval like this. I'm too slack to find you any links so google away.
Forms in HTML are designed to be used as follows: A form has a bunch of inputs, each with a name and a value (which the user sets), and a submit button which redirects the page to where ever is specified, and the data in all of the inputs is sent as well. PHP is a good language to retrieve this data and make use of it.
I suggest looking up a few tutorials with data retrieval like this. I'm too slack to find you any links so google away.
•
•
Join Date: Oct 2008
Posts: 4
Reputation:
Solved Threads: 0
You can do what the other posters said of course..
but what you want to do can easily be done the way you want to.
Look up redirect, there are many examples on the php manual site, but be careful, you cannot echo anything (no html ect) before the redirect in the file, or it will simply give you a blank screen and do nothing at all.
but what you want to do can easily be done the way you want to.
Look up redirect, there are many examples on the php manual site, but be careful, you cannot echo anything (no html ect) before the redirect in the file, or it will simply give you a blank screen and do nothing at all.
PHP Syntax (Toggle Plain Text)
call a function on onchange and get the changed value..and change the bgcolor by using document.bgColor=col;
•
•
Join Date: Apr 2007
Posts: 46
Reputation:
Solved Threads: 1
•
•
•
•
You should look into using POST or GET methods with PHP to get info on what was sent to the page ("red", "green", or "blue") and then use sessions to save this data until viewer leaves the page.
Forms in HTML are designed to be used as follows: A form has a bunch of inputs, each with a name and a value (which the user sets), and a submit button which redirects the page to where ever is specified, and the data in all of the inputs is sent as well. PHP is a good language to retrieve this data and make use of it.
I suggest looking up a few tutorials with data retrieval like this. I'm too slack to find you any links so google away.
thanks humbug,
i hope you can explain to me further how to use session.
THANK YOU!!!
No problem. Munaz's following idea is a very good one for what your trying to do:
If you want to go down the path of having the users selection "saved" you only need cookies (I was wrong to suggest sessions). Look them up on the net, there are plenty of tutorials out there.
If you want to go down the path of having the users selection "saved" you only need cookies (I was wrong to suggest sessions). Look them up on the net, there are plenty of tutorials out there.
Last edited by humbug; Oct 29th, 2008 at 10:33 am. Reason: Code tags make it ugly
★ "If your not having fun, your doing something wrong." - Humbug
★ Did I help you out? Did I piss you off? Add to my reputation!
★ The Gabriel Method is a great book for losing weight and keeping healthy - I know Jon Gabriel Personally.
★ Did I help you out? Did I piss you off? Add to my reputation!
★ The Gabriel Method is a great book for losing weight and keeping healthy - I know Jon Gabriel Personally.
![]() |
Similar Threads
- PostBackUrl (ASP.NET)
- Aurora, DrPmon, MHTMLRedir problems (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: Need Help Processing This Dynamic Form
- Next Thread: Chmod with a timer
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code codingproblem cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory menu methods mlm mod_rewrite multiple mysql oop parameter parse paypal pdf php problem query radio random recursion regex remote script search select send server sessions sms soap source space speed sql static structure syntax system table tutorial up-to-date update upload url validation validator variable video web wordpress xml youtube





