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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conditional href 1

Status
Not open for further replies.

jenodorf

Technical User
Jan 11, 2005
36
0
0
Hi

I have the code:

<?php
if($_SESSION["cartSubtotal"] < 25) {
echo("You must order £25 or more. Go back to correct.");
exit();
}?>

This works but I want to not echo "you must etc but call another web page so if the order is less than £25 the the user is sent back to a shop page advising them of the order limit.

Can this be done?

thanks

Ian

 
Yeah, as long as you have nothing else being output to the browser you can use

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

in place of the echo statement. Of course as i said earlier, there can;t be anything being output the browser prior to the call. That includes html, and any whitespace.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top