The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Cookie check appears to disable script

Thanks to some advice on this forum I managed to get my page correctly checking for a cookie and processing the page as intended. Unfortunately a form to email script actioned when the form is submitted doesnít work now. (it should send the value of 'email' to a specified address). The script hasnít been modified, just the PHP code that determines whether to display the login form or not.

I have included the amended logic below. Appreciate suggestions for what is the problem here.

if I use the $_SERVER approach the cookie aspect works fine but the form to email script doesn't execute.

Any further ideas?

Have a look at the HTML source code in your browser. I'm betting that when you "use the $_SERVER approach" you end up with action="" in your HTML page. It won't execute the script becuse you're not telling it where the script is!

yes it will execute the script with the action that way, but fails to recognise the cookie and related logic. ie won't display the link if a cookie is present on the users computer, still shows the form.