Click to See Complete Forum and Search --> : Contact Form in DW- Please Help


textrail
07-27-2006, 02:54 PM
Hi all,

Thanks for checking into this post.

I have a site hosted on a windows platform. I need a simple contact form and I'm using DW to put the site together.

My hosting company, godaddy.com, says I should put this in my form.

<form action="gdform.asp" method="post">

The gdform.asp (says their tech support) is a script they have that will relay the email to my email address.

It doesn't work. From my below level understanding of asp, it loads the page gdform.asp. I can't see how its sending my form info anywhere.

Can someone enlighten me in human terms? Not tech support terms?

And if anyone has a basic form that works I'd be delighted to see how one is really coded.

Thx!

Wiz Creations
07-27-2006, 03:25 PM
I don't know anything about asp, but if your server supports php, I can help you. Let me know what you need in the form (i.e. name, email, message, etc) and I'll help you... if you want.

textrail
07-27-2006, 04:22 PM
I'd love the help.

I just need a form with name, email, phone, comments.

I requested they move me to linux which will support the php so it should work!

thx

Wiz Creations
07-27-2006, 04:38 PM
Put these in this order, and all together. I've separated it by language, but it's just one continuous code. Save the page with a .php extension. You can put pagename.php in the action="" if you want. The server will send you an email in this format:NAME: [Name Entered] EMAIL: [Email Entered] Phone: [Number Entered]
----------------------
MESSAGE:

[Message Entered]

<?php
if (isset($_POST['submit'])) {
mail("your email here","email subject here","NAME: ".$_POST['fname']." EMAIL: ".$_POST['email']." Phone: .$_POST['number']."\n----------------------\n MESSAGE:\n\n".$_POST['message']);
echo "Put text here to be displayed after clicking submit\n";
} else {
?>
<form action="" method="post">
<table align="center" width="300" cellspacing="5" border="0">
<tr><td align="center">Your Name:<br /><input name="fname" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Email Address:<br /><input name="email" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Phone Number:<br /><input name="number" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Message:<br /><textarea name="message" rows="8" cols="40"></textarea></td></tr>
<tr><td height="26" align="center"><input type="submit" name="submit" value="Submit" />&nbsp;&nbsp;<input type="reset" value="Reset" /></td></tr>
</table>
</form>
<?php } ?>

Let me know if you need anything else.

textrail
07-27-2006, 04:50 PM
thx! they want 72 hrs to migrate the site so I'll update once I've been able to try it out.

Wiz Creations
07-27-2006, 05:23 PM
Okay. I have instant notification on this thread. Just post here when you get it.

textrail
08-03-2006, 02:53 PM
Hey wiz,

Thanks for the help. Can you take a look at this? It's finding an error somewhere around the code for the phone or message area. I did not change the confirmation text yet since DW alerted on an error.

Page: http://www.aaa-tech.net/contact.php

Error shown: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/a/a/a/aaaseth/html/contact.php on line 187

Sorry but I have no idea what that parse error means.

Here's the code. I made sure the only change I made was the email and the subject. I didn't touch any of the other code.

<?php
if (isset($_POST['submit'])) {
mail("laura@texastrailwebdesign.com","Email From AAA Tech Website","NAME: ".$_POST['fname']." EMAIL: ".$_POST['email']." Phone: .$_POST['number']."n----------------------n MESSAGE:nn".$_POST['message']);
echo "Put text here to be displayed after clicking submitn";
} else {
?>
<form action="contact.php" method="post">
<table align="center" width="300" cellspacing="5" border="0">
<tr><td align="center">Your Name:<br /><input name="fname" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Email Address:<br /><input name="email" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Phone Number:<br /><input name="number" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Message:<br /><textarea name="message" rows="8" cols="40"></textarea></td></tr>
<tr><td height="26" align="center"><input type="submit" name="submit" value="Submit" />&nbsp;&nbsp;<input type="reset" value="Reset" /></td></tr>
</table>
</form>
<?php } ?>

thx

Wiz Creations
08-04-2006, 04:37 PM
I'm on vacation right now, but I'll look at it when I get back home (Aug 10th). If you didn't change anything, then it obviously was something I did.

Wiz Creations
08-09-2006, 08:16 PM
I left out some quotes and slashes.
<?php
if (isset($_POST['submit'])) {
mail("your email here","email subject here","NAME: ".$_POST['fname']." EMAIL: ".$_POST['email']." Phone: ".$_POST['number']."\n----------------------\n MESSAGE:\n\n".$_POST['message']);
echo "Put text here to be displayed after clicking submit\n";
} else {
?>

<form action="" method="post">
<table align="center" width="300" cellspacing="5" border="0">
<tr><td align="center">Your Name:<br /><input name="fname" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Email Address:<br /><input name="email" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Phone Number:<br /><input name="number" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Message:<br /><textarea name="message" rows="8" cols="40"></textarea></td></tr>
<tr><td height="26" align="center"><input type="submit" name="submit" value="Submit" />
&nbsp;&nbsp;<input type="reset" value="Reset" /></td></tr>
</table>
</form>

<?php } ?>

textrail
08-12-2006, 10:06 AM
wiz- It worked beautifully.

Thanks

Wiz Creations
08-12-2006, 06:26 PM
Great!

kekei18
09-10-2006, 03:46 PM
Okay thanks. I will try this now and get back with you later on how it turned out

webstart
09-13-2006, 10:30 PM
ok I am missing something :( I have tried the above mentioned conde for a form but when I hit the send button I get an error?

Is it possible to get an idiot proof code? :o

Wiz Creations
09-13-2006, 11:32 PM
Could you post the code you used?

webstart
09-13-2006, 11:35 PM
Could you post the code you used?


<?php
if (isset($_POST['submit'])) {
mail("your email here","email subject here","NAME: ".$_POST['fname']." EMAIL: ".$_POST['email']." Phone: ".$_POST['number']."\n----------------------\n MESSAGE:\n\n".$_POST['message']);
echo "Put text here to be displayed after clicking submit\n";
} else {
?>

<form action="" method="post">
<table align="center" width="300" cellspacing="5" border="0">
<tr><td align="center">Your Name:<br /><input name="fname" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Email Address:<br /><input name="email" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Phone Number:<br /><input name="number" type="text" value="" size="35" /></td></tr>
<tr><td align="center">Your Message:<br /><textarea name="message" rows="8" cols="40"></textarea></td></tr>
<tr><td height="26" align="center"><input type="submit" name="submit" value="Submit" />
&nbsp;&nbsp;<input type="reset" value="Reset" /></td></tr>
</table>
</form>

<?php } ?>