new page

I am new to PHP. I want to know if there is a way to migrate out of a php " if " construct
to a new page

What do you mean - migrate “if” construct to a new page? And what do you mean by page?

OK. I have a web site at
I am writing a php program which will receive data from a form inn a web page on the web site. Depending upon the value of the data received I wish to perform certain tasks within an if-else and then redirect the user to a new web page;
For instance, if the data is ‘alumni’ I want to write some values to a log file and then have the server display a new web page in the users browser. Am I making any sense?

Try using the header() function to take the user to a different page. Maybe something like below:

<?php $data = $_POST['data']; //Store data from the form in a variable if($data == "alumni") { //Value for $data was alumni //Code for writing to log file goes here header("url="); } else { //Value for $data was not alumni //Code for else case goes here header("url="); } ?>


-Tom Winchester-

Thanks Tom, I will try that .

Sponsor our Newsletter | Privacy Policy | Terms of Service