PDA

View Full Version : New to php form results


mustangdesigner
02-14-2014, 05:40 PM
I design in DW in split view and have been limited to html. I have a request for a contact form that does not expose the client's email address and so I am now learning basic PHP.
I have found two of your tutorials helpful but am not quite there. I started with "Using Dreamweaver and PHP to send form results in an email" and also "PHP includes" Right now I have the form built and the the include script in place but it the form sends to a page full of the php code. I will attach that section of code. Take it ease on me--I am new at this :)
I also wondered if I created the php file correctly but in the code view the copied script is the only script there.
Here is the form script. I can also provide a link to the test site page if preferred.

<form id="Contact Form" name="Contact Form" method="post" action="sendresults.php">
<?php include("includes/menu.php"); ?>

<p>
<label for="Name">Name</label>
<input type="text" name="Name2" id="Name" />
</p>
<p>
<label for="Phone ">Phone (optional)</label>
<input type="text" name="Phone " id="Phone " />
</p>
<p>
<label for="Email2">Email</label>
<input type="text" name="Email2" id="Email2" />
</p>
<p>
<label for="Comment2">Comment</label>
<textarea name="Comment2" id="Comment2" cols="45" rows="5"></textarea>
</p>
<p>
<input type="submit" name="Submit" id="Submit" value="Submit" />
<br />
</p>
<p>&nbsp; </p>
</form>

edbr
02-15-2014, 12:11 AM
well as a form its ok but the file in your action action="sendresults.php
will be the script that handles it. if you copied it from thiis forum it should be ok, although there was a redirect issue mentioned lately

mustangdesigner
02-15-2014, 06:35 AM
I did copy it from the website but the directions were to set the action to www.yourwebsite.com/sendresults.php. When I used that I got a "no file exists" error. Where I took out the web address and linked to the file using the browse option I at least went to the page of code instead of an error. I also added " <?php include ("includes/menu.php")" based on your Using PHP site

mustangdesigner
02-15-2014, 08:34 PM
Here is a link to what is going on

http://www.kinggraphics.net/9thstreetframe.com%20copy/contact.html

edbr
02-17-2014, 12:12 AM
the action reads
action="www.9thstreetframe.com/sendresults.php">

so use
action="sendresults.php">
or the full site URL

mustangdesigner
03-04-2014, 07:30 PM
OK, gt this to work on another site. The problem may have been the test site. Thanks for your help!

jmichae3
04-02-2014, 11:11 PM
email server is probably not configured on the test server. you would also have to configure php.ini