I have a program and I need to post a variable to a page. On the target page I need to test to see if a variable has been posted and redirect the user if it hasn’t.
Sometimes the value of the variable needs to be the number zero (0) but when I post it, then it does the redirect. Is there I way I can make it tell the difference between the post zero and a non-posted value.
The value is posted through a standard HTML form and the number crunching is done via PHP.
Any help would be greatly appreciated.
In PHP, you can use the isset function to see if a variable is set or not.
I knew that Rabbit. I don’t know how I forgot. Thanks. I’ll sort that.
I tried that Dormlilch but it didn’t work for some reason. Are you able to give me the correct code?
I tried that Dormlilch but it didn’t work for some reason.
then what have you tried? what error messages have you got? (note that a PHP redirect does not work after you have printed/echoed something out (and that emits a notice).
Thanks I’ll sort that out.
I’ve just fixed it with isset andit works so much like a charm I just had to thank you. Brilliant Rabbit.
I’ll try your suggestion next Dormilich.