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.
creating a feedback form without using global variables...
Moderator: General Moderators
-
matthewxly
- Forum Newbie
- Posts: 2
- Joined: Mon Apr 19, 2010 7:23 am
Re: creating a feedback form without using global variables.
You're mistaken.matthewxly wrote:as my server doesn't allow global variables.
Check again: what don't they allow?
-
matthewxly
- Forum Newbie
- Posts: 2
- Joined: Mon Apr 19, 2010 7:23 am
Re: creating a feedback form without using global variables.
They definitely don't allow GVs. Apparently it creates issues for them...
Re: creating a feedback form without using global variables.
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.
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.
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
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