|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
macrumors 6502
Join Date: Jul 2006
Location: Louisiana
|
Contact Form in HTML Site
I am designing a site in dreamweaver using HTML. I have all the pages done except a contact page. I know how to insert a form and get it the way I want it to look. My problem is function. I know there has to a script, like PHP, but I am not sure if I need anything else. Like a service to send the email. Please Help.
__________________
|
|
|
|
|
|
#2 |
|
macrumors 6502a
|
Try something like
Code:
<?php
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<p align=\"center\">You need to enter a valid e-mail address<br><a href=\"index.php\">Click here</a> to go back</p>\n";
}
else
{
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<p align=\"center\">Please fill in the form<br><a href=\"index.php\">Click here</a> to go back</p>\n";
}
else
{
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = "Sent on: $todayis [GMT] \n
Regarding: $attn \n
Enquiry: $notes \n
From: $visitor ($visitormail)\n
Browser Info: $httpagent \n
";
$from = "From: $visitormail\r\n";
mail("YOUR EMAIL ADDRESS", $subject, $message, $from);
if($cc == "yes") {
mail($visitormail, $subject, $message, "From:YOUR EMAIL ADDRESS\r\n");
$copy = "This has been copied to $visitormail";
}
?>
</p>
</div>
<p align="center"><b>
Thank you for you email, we will try to reply to the address <?php echo $visitormail ?> asap. </b>
<?php
}
}
?>
|
|
|
|
|
|
#3 |
|
Thread Starter
macrumors 6502
Join Date: Jul 2006
Location: Louisiana
|
ok, so i make a page with the PHP and save it but does it have to be named anything special. Also how does the script interact with the form. Im sorry if I do not know what i am talking about, I am pretty new to PHP and scripts
__________________
|
|
|
|
|
|
#4 |
|
macrumors Demi-God
|
no offense but I don't think that you have the experience to do this.
if you trust me with information I would be more than happy to do it for you as it would only take me a few min. But just as easy would be using a web service such as My Contact Form. Which is step by step and does it for you, and then gives a snippet of code that you paste right into DW. Janitorc7
__________________
15" MacBookPro, 2.4 GHz, 2GB RAM, 500GB HD; 160 GB iPod Classic; 32 GB 3G S⃣ "The products suck! There's no sex in them anymore!" steve jobs
|
|
|
|
|
|
#5 |
|
Thread Starter
macrumors 6502
Join Date: Jul 2006
Location: Louisiana
|
I wanted to know how to do it so I can do it on furture projects. I found a tutorial on how to do it and it did work. The only problem is when I put it on the table for existing site it doesnt work anymore. That is why i came here in the first place
__________________
|
|
|
|
|
|
#6 |
|
macrumors regular
Join Date: Oct 2006
Location: Canada
|
THe logic behind most of these forms is simple. WHen the page loads, there is usually an "if" statement asking if the form has been submitted ... if so, then it process the form, and spits out a thank you message or something similar. If not, it will display the form. These are usually 'multipurpose' pages. It's sort of like have 2 pages built into the 1 file. Hope I didn't confuse you - I'm just trying to help you understand the logic.
|
|
|
|
|
|
#7 | |
|
Contributor
Join Date: Oct 2004
Location: On the Left Coast - Victoria BC Canada
|
Quote:
What did your website host say when you called them?
__________________
Expert
Ex = former, no longer. Spurt = a leak, esp. when caused by water pressure. Expert = a has-been drip under pressure. |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|