Page 1 of 1
creating a feedback form without using global variables...
Posted: Mon Apr 19, 2010 7:32 am
by matthewxly
Hi, I'm trying to create a feedback form so that users of my site don't have to ope a separate e-mail program or use their web mail to get in touch with me @myemail.
I've found plenty of code around the net that supposedly does the trick using an html form on one page and a php program called "mailer.php" or similar.
I've had no success in making them work though, as my server doesn't allow global variables. Please tell me there's a way of doing this! (And if there is, telling me how would be great!)
Cheers! Matt.
Re: creating a feedback form without using global variables.
Posted: Mon Apr 19, 2010 7:42 am
by requinix
matthewxly wrote:as my server doesn't allow global variables.
You're mistaken.
Check again: what don't they allow?
Re: creating a feedback form without using global variables.
Posted: Mon Apr 19, 2010 7:53 am
by matthewxly
They definitely don't allow GVs. Apparently it creates issues for them...
Re: creating a feedback form without using global variables.
Posted: Mon Apr 19, 2010 8:23 am
by requinix
First of all, PHP doesn't have global variables in the traditional sense. The closest things are the superglobals, but disabling those would cripple almost every PHP script out there - if it were even possible. Which it isn't.
Similarly, there's no way to disable variables at the top-most scope. Similarly, if possible doing so would cripple almost every PHP script.
Are you talking about
register_globals? Because that's something completely different. It means variables in (e.g.) the URL and from POSTed forms aren't available automatically, and that you have to use the $_GET and $_POST superglobals to access them, respectively. See also:
this.
Re: creating a feedback form without using global variables.
Posted: Mon Apr 19, 2010 11:47 am
by omniuni
If you're having trouble with pre-made scripts, just write your own. With PHP you can send a mail as easy as mail(). (Quite literally, that's the function).
Just show a form, have it submit back to the same page. If the user has filled in the form, process it instead of displaying it.
http://php.net/manual/en/function.mail.php