Jump to content

String check on session


jimleeder123

Recommended Posts

I'm editing the Woocommerce e-mail files, and have got a session working. When it's echoed on the e-mail it appears as expected - "1 Day Health & Safety Awareness Chelmsford". However the if statement is not working. This is shown below, can anyone tell me where I'm going wrong?

if (strpos($_SESSION['ahsname'], 'safety awareness') !== false) {
	
        // This is what I want to happen, the session should (and does) contain the string shown above
	//include( get_template_directory() . '/instructions/chelmsford-hsa-ahs.html');
	echo "YES";
	
}else{
	// This should not happen but it does!
	echo "NO ";
	echo $_SESSION['ahsname'];
        // the session is echoed with the bit I'm checking for included as mentioned above
}
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.