Click to See Complete Forum and Search --> : Question about Forms


GreyFaerie
09-07-2003, 07:43 PM
I am making a form, but instead of just sending it brings up outlook express. how do i keep it from doing this?

PeOfEo
09-07-2003, 08:21 PM
Use a server side language to submit your emails instead of an html based email form because it depends on a mail client. What server side language does your host support?

GreyFaerie
09-07-2003, 09:14 PM
im not sure exactly.... i know it supports PHP (obviously :P ) but im not sure about the rest. Isnt there a way i can do it with php

GreyFaerie
09-07-2003, 10:23 PM
im not sure... i now it supports php. you can do it with that right?

pyro
09-07-2003, 11:07 PM
Sure thing, and here's the script to do it... http://www.webdevfaqs.com/php.php#mailer

GreyFaerie
09-08-2003, 12:45 AM
i really hope you guys dont think im a complete moron... but I'm basically teaching myself how to do this and i really appreicate the help

Anyway... i tried it out and now when i press submit it brings up a window asking me to save the php file i made for the form. this is exactly what i did :

1. I made the php file and copied the code in exactly as it was in the site you sent me and i named it mailer.php

2. I edited the top part of the php code like it asked like this:

$to = "GreyFaerie@playingwithfaeries.com"; #set address to send form to
$subject = "Member of the Month"; #set the subject line
$headers = "Member of the Month"; #set the from address, or any other headers
$forward = 0; # redirect? 1 : yes || 0 : no
$location = "thankyou.htm"; #set page to redirect to, if 1 is above

I didnt do anything with the thankyou.htm... i guess i figured i could do it later, I just want the submit part to work for now

3. I entered the form script in my page as follows :

<form action='mailer.php' method='post'>
<table width="408" border="0">
<tr>
<td width="238"><font color="#5ABDFF"><b>Your Neopets
Username :</b></font></td>
<td width="160"><input type='text' name='textfield3'></td>
</tr>
<tr>
<td><font color="#5ABDFF"><b>Nominee's Neopets Username:</b></font></td>
<td><input type='text' name='textfield22'></td>
</tr>
<tr> </tr>
</table>
<br>
<input type='submit' name='submit' value='Submit Form'>
</form>

what am i doing wrong? thanks

pyro
09-08-2003, 07:10 AM
It would appear that your server does not support PHP. Try a simple test:

test.php
<?PHP
echo "I have PHP";
?>What does that give you?

PeOfEo
09-08-2003, 11:14 PM
If they do not support php then you need to fig around in your hosts faq and try to find out what they support, if you can't find anything contact them. You really do need to know what your host offers.

GreyFaerie
09-08-2003, 11:41 PM
ok... i dont know what i did but i t works now :) thanks for your support! you guys were a big help