NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP REDIRECT

PaulCheung paulcheung at tiscali.co.uk
Wed Sep 5 06:26:02 EDT 2007


Can anybody help? I am using "MAINMENU" built in HTML forms to get to get me 
to where I want to be (Add, Update or Print record) and of course, I cannot 
update or print a record that does not exist yet. Here is a snippet of the 
coding.
<?PHP session_start(); PHP?>
<HTML>
    HTML coding
    more HTML coding

<?PHP>
    PHP coding
    more PHP coding
.
$q="Select SQL_CALC_FOUND_ROWS * FROM test_table
WHERE customer = $customer ORDER BY invoices LIMIT $cps, $rpp";
.
    PHP coding
    more PHP coding
    more coding
.
if ($number_of_records == 0)
    {$link = "http://localhost/mainmenu.php";}

I have also tried
header('Location: http://localhost/mainmenu.php);
With this PHP gets really ticked-off giving me a long error message and 
points to a line which contains the following coding.
<script language="JavaScript" type="text/javascript"> As to why, I haven't a 
clue.

On invalid operation I want to exit (with all the usual user error messages) 
and return back to the mainmenu, For this test I am using 99999990 as the 
dummy customer

Paul








More information about the talk mailing list