Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Jumping to another PHP page.

General discussions related to php

Moderators: macek, egami, gesf

Postby Jay » Tue Oct 08, 2002 3:25 am

You want some javascript that'll use the onChange or similar trigger to change the document.location value which will force it to jump to another page!

In short, that's javascript, not PHP ;)
Jay
 

Postby ednark » Sat Oct 12, 2002 1:52 pm

if your php code is in the middle of executing, i.e. it has not gotten to the user yet, there is a way. You can call the header function.

read more at:
http://www.php.net/manual/en/function.header.php

you could have the user select from a form the page he or she wants to go to, the on the page that handles the form submit, you could do some logic, then have the page return the user to a specified place.


it does seem in your post however that you want to the page to respond to a users choice for a new page directly, without the need for any other logic, at which point you should use javascript:


Code: Select all
<form action="choosepage.php">
    <select name="goto">
        <option value="http://yoursite/page1.html">
    </select>

    ...
    ...

</form>


Code: Select all
<?php

$goto = $_POST['goto']

$others = $_POST[...];

... perform action on $other variables


header( "Location: $goto" );

?>
ednark
New php-forum User
New php-forum User
 
Posts: 18
Joined: Fri Oct 04, 2002 8:09 pm


Return to PHP General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.