Register FAQ/Rules Forum Spy Search Today's Posts Mark Forums Read

Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate.

 
Go Back   Mac Forums > Special Interests > Web Design and Development
TouchArcade.com - iPhone Game Reviews and News

Reply
 
Thread Tools Search this Thread  
Old Jun 15, 2007, 03:15 PM   #1
jdl8422
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.
__________________
jdl8422 is offline   Reply With Quote
Old Jun 15, 2007, 03:21 PM   #2
timmillwood
macrumors 6502a
 
Join Date: Apr 2006
Location: Abergavenny, Wales, UK
Send a message via Skype™ to timmillwood
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
}
}
?>
__________________
Macbook Pro 17" Core 2 Duo
iPhone 8GB O2
My blog -www.millwoodonline.co.uk
timmillwood is offline   Reply With Quote
Old Jun 15, 2007, 03:30 PM   #3
jdl8422
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
__________________
jdl8422 is offline   Reply With Quote
Old Jun 15, 2007, 04:18 PM   #4
janitorC7
macrumors Demi-God
 
janitorC7's Avatar
 
Join Date: Feb 2006
Location: North Hollywood, CA
Send a message via AIM to janitorC7 Send a message via Skype™ to janitorC7
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
janitorC7 is offline   Reply With Quote
Old Jun 15, 2007, 04:51 PM   #5
jdl8422
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
__________________
jdl8422 is offline   Reply With Quote
Old Jun 15, 2007, 08:50 PM   #6
operator
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.
operator is offline   Reply With Quote
Old Jun 15, 2007, 08:59 PM   #7
CanadaRAM
Contributor
 
CanadaRAM's Avatar
 
Join Date: Oct 2004
Location: On the Left Coast - Victoria BC Canada
Quote:
Originally Posted by jdl8422 View Post
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
How you do a form is dependant on the host server the site is on. You have to work with the tools that are installed on the server.

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.
CanadaRAM is offline   Reply With Quote

Reply

Mac Forums > Special Interests > Web Design and Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:58 PM.

Mac News | Mac Rumors | iPhone Game Reviews | iPhone Apps

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2002-2009, MacRumors.com, LLC