?

Log in

No account? Create an account

July 21st, 2005

Continue shopping button in PHP

I can't believe how easy it is to create a Continue Shopping button!

session_start();

// If referrer is not itself, make session variable the referrer.
if ( strpos( $_SERVER["HTTP_REFERER"], 'cart.php' ) === false )
{ $_SESSION[continueShopping] = $_SERVER[HTTP_REFERER]; }

 if ( $_SESSION[continueShopping] ) {
    print "<a href='{$_SESSION[continueShopping]}'>Continue Shopping</a>\n";
}

It's that easy!

Latest Month

November 2016
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
27282930   
Powered by LiveJournal.com
Designed by Tiffany Chow