Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic php? How to forward to new page?

Status
Not open for further replies.

stealth71

Programmer
Feb 22, 2005
14
0
0
US
I have a form on a php page with a form:
<form name="approve" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
I agree to the terms and conditions of this Agreement:
<input type="checkbox" name="agree" value="ON"> <input type="submit" value="Submit">
then after the form is submitted I want to check if a checkbox has been checked and forward to the next page for a user to enter their info. At the top I put:
<?php
if(isset($_POST['action']) && $_POST['action'] == 'submitted'){
if($_POST['agree']==true){
--forward to next page here--
}else{
--javascript pop up you must agree to continue--
}
}
?>

Can you please help me fill this in? It's been a while since I've PHP'd.
Thanks
 
Thanks for the reply. I wasn't looking for a free lunch I searched and couldn't find what I was looking for. But thank you.
 
i assume you want help redirecting the browser.

within the page that sleipnir214 pointed you at there is the following

Code:
header("Location: [URL unfurl="true"]http://www.example.com/");[/URL] /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

hth
Justin
 
Use If, else;

If $form = agree {new code}
else
If $form = ""; $form = "new";
If $form = new {agree code}

basically redirect the browser to different points on your page. Above code may be incorrect.

--i3iz
Technical Newbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top