Jump to content

String check on session

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";
	// 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

Share this post

Link to post
Share on other sites

Ok you have permission to send an army after me, you were right. I swear it wasn't working yesterday. Very odd, but it works now!

Share this post

Link to post
Share on other sites

You should still alter it to handle case sensitivity!!! Read The Manual!

Share this post

Link to post
Share on other sites

Join the conversation

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

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.