Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

if customer's state = alabama, show them a message on the next page


Recommended Posts

i'm sure this is ridiculously simple, but i cannot figure it out.



once a user gets past the "create_account.php" page, can i add a filter to see if their state is alabama or georgia, and if it is, display a phrase at the top of the next page?

Link to comment
Share on other sites

Add this where you want the message to display:


$query = mysql_query("SELECT entry_state FROM address_book WHERE address_book_id = '".$_SESSION['customer_default_address_id'].'" AND customers_id = '".$_SESSION['customer_id']."'");
$result = mysql_fetch_array($query);

// Check in lower case to avoid case differences
if(strtolower($result['entry_state']) == 'alabama' || strtolower($result['entry_state']) == 'al'){
echo 'Hey Your From Alabama!!';


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...