View Full Version : More HTML tricks...
Raptisoft
01-25-2004, 09:22 AM
Hi all,
Getting ready to release, I want a way for the customer to send me feedback. However, I do not want this to be done in a way that allows web robots to pick up an e-mail address from the site.
Does anyone know if it's possible to make an HTML form that the customer fills out... that the server then e-mails to a set address?
Thanks!
Lizardsoft
01-25-2004, 10:18 AM
Assuming you have PHP capability on your server (no excuse not to) then it's very easy. www.zend.com look for php form mail scripts, but be picky about which one you choose. Some are a lot more flexible and secure than others. There's also plenty of other sites that have free PHP form mail scripts, but zend is the one off the top of my head.
ferret
01-25-2004, 09:20 PM
I have not used this script, but it appears to do what you are asking. I intend to use it for future projects, but right now my main company email adress is so "out there" that it's way too late to bother trying to hide it.
http://www.thesitewizard.com/wizards/feedbackform.shtml
I believe that the site above is by the same person who made this site below -- which has all sorts of listings of free programming tools, compilers, etc.
http://thefreecountry.com/
Larry Hastings
01-26-2004, 09:17 AM
Of course it's possible. It is simplicity itself.
I suggest you do it in a scripting language, run as a "CGI" program. I like Python a lot for this, but PHP, Java, and even Perl are valid choices.
I had hoped to find you an example Python CGI script, but sadly I couldn't find any when I did my web search. But I did find a Python-based example for a "tell a friend" web page, which is pretty darn close and should be easy to adapt.
http://www.developersdomain.com/python/articles/tellafriend.htm
Hope that helps!
Punchey
01-27-2004, 06:52 AM
I use the following PHP function to send mails like so:
mail(<email address>, <subject line>, <email body text>, <from address>);
Note, the "From" argument should be something like:
"From: Somebody <somebody@someplace.com>"
If you need any more details, you know where to reach me.
Raptisoft
01-30-2004, 11:24 AM
Hi everyone, I hope you have a moment to help me out with something...
I used some of Punchey's code on my server. However, any attempt to browse to a .php extension on my server gives a 404. I have consulted the tech support for my hosts, but they say that php is enabled, etc, and that it must be something else I'm doing wrong.
Well, I have a simple html form that invokes a .php file. Any attempt to access the php file gives me a 404-- including typing it in the browser window, or getting to it through a form (try it: http://www.raptisoft.com/test/feedback.htm) ...
Anyone know enough about servers to give me something that I can then pass on to the tech support people? They don't seem to be very tech-supporty, and I'm out of my environment, so I can't tell them "do this, and this, and we'll be fine."
BTW, rest assured that the feedback.php is there.
Thanks!
Punchey
01-30-2004, 11:35 AM
I think the problem is that I goofed and didn't put quotes around the "action" parameter. Change it to:
action="feedback.php"
and see if it works. In HTML, almost all parameters have to have quotes around them.
Raptisoft
01-30-2004, 11:47 AM
I did try that, earlier... still no good. I think the problem is on my server's end. Anything with a php extension comes up as a 404, even when browsing directly.
However, I seem unable to make any headway with the tech support people... they just tell me that they look at the server list, and php is a valid extension, therefore that's not the problem.
But, if you try to get to: http://www.raptisoft.com/test/quickie.php ... the content of that file is simply:
<HTML>
<BODY>
Well, it finally works!
</BODY>
</HTML>
...and that too is nada.
I'm almost *positive* that it's some sort of server setting that's screwed up. I just need some tips so I can go back to the tech support people and not be the dumb yokel who doesn't know anything about web servers, so they can blow me off.
Lizardsoft
01-30-2004, 11:52 AM
This really is something your host should be helping you with. If you name quickie quickie.html, does that work? What is your server configuration like? Windows/Linux? What control panel software?
Raptisoft
01-30-2004, 12:06 PM
If I change it to quickie.html, yes, it works. The support people tell me that php on other sites on the same box are working fine, too, therefore, it's something I'm doing.
It's a windows server... that is all I know. It's the "latest one" whatever that is.
I'm currently attempting an ASPEmail solution.
Red Marble Games
01-30-2004, 12:17 PM
http://www.raptisoft.com/test/feedback.htm is working for me, as of 1/30/04 at 4:09 EST ...
Raptisoft
01-30-2004, 12:18 PM
Does it work even if you click submit?
I'm done fighting with it, tho... I very quickly managed to implement a form using ASP *whew*.
Red Marble Games
01-30-2004, 12:33 PM
Oops, I guess that was pretty stupid of me. No, I'm getting a 404 too when I click the button.
Punchey
01-30-2004, 12:37 PM
Is the PHP file CHMODed to 755? (Sorry, I got it wrong in my e-mail when I said "757".) You shouldn't have to set those attributes, but it's worth a try. I think some server setups will require all scripts to be 755.
Raptisoft
01-30-2004, 01:34 PM
CHMOD? Is that Lovecraft? ;)
I'm not sure what it means to CHMOD a file. Remember, I'm just a C++ guy. I go into web kicking and screaming. And screaming.
Lizardsoft
01-30-2004, 01:48 PM
Punchey has a good point, although the error you should be getting then should be a server misconfiguration instead of a 404. CHMOD means to change a file's permissions. How this is done varies between FTP client, but generally you can right-click a file in ftp and get an option like "chmod" or "Change Permissions". 755 is the octal form of the permission, and most ftp clients will allow you to type it in like this. However if you're ftp client doesn't allow this, the permission 755 translates to:
User: Read/Write/Execute
Group: Read/Execute
Public: Read/Execute
Punchey
01-30-2004, 07:34 PM
It is also often referred to as "attributes". If you can't find anything that says "CHMOD", look for something where you can set either the "attributes" or "permissions" of the file. Set it to 755, or if it doesn't show the octal equivelant, use the permissions Lizardsoft posted. Hope that helps... although Lizardsoft is right, you shouldn't be getting a 404 if that's the problem, but if your host has something screwed up, you never know...