creating a feedback form without using global variables...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
matthewxly
Forum Newbie
Posts: 2
Joined: Mon Apr 19, 2010 7:23 am

creating a feedback form without using global variables...

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: creating a feedback form without using global variables.

Post by requinix »

matthewxly wrote:as my server doesn't allow global variables.
You're mistaken.

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.

Post by matthewxly »

They definitely don't allow GVs. Apparently it creates issues for them...
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: creating a feedback form without using global variables.

Post 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.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: creating a feedback form without using global variables.

Post 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
Post Reply