Total members 9952 | Gratitudes |It is currently Sat Feb 11, 2012 2:53 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 3 posts ] 
Author Question
 Question subject: Beginner needs help- simple 'mail_to' contact form in PHP
PostPosted: Tue Feb 17, 2009 11:25 pm 
Offline
Newbie
User avatar

Joined: Sun Feb 15, 2009 5:27 pm
Posts: 2
Has thanked: 0 time
Have thanks: 0 time

Hi all! ... I used TrendyFlash Site Builder to create a site, which generated a 'contact.php' file that I need to modify.
Basically it calls for the user to send a comment with a name, email id, subject and message. I need it to send those details to an external email id that I specify. Here's the script as generated by the software in that 'contact.php' file :

<!-- script starts here-->
<?

$contactfield1=$HTTP_GET_VARS["contactfield1"]
$contactfield2=$HTTP_GET_VARS["contactfield2"]
$contactfield3=$HTTP_GET_VARS["contactfield3"]
$contactfield4=$HTTP_GET_VARS["contactfield4"]

$email_from = "you@yourdomain.com";
$email_subject = "" ;
//$email_txt = "";
$email_to = "info@yourdomain.com";

$email_message = "field1: $contactfield1\n
field2 :$contactfield2 \n
field3 :$contactfield3 \n
field4 : $contactfield4 \n

";

mail($email_to, $email_subject, $email_message,$email_from);

?>

<!--script ends here-->

OK ... i went through some sample contact form scripts online and modified it like this :

<?php

// I should think the following 4 lines correspond to the 4 fields indicated in the screenshot attached at the end
// of this message

$contactfield1=$_POST["name"]
$contactfield2=$_POST["email_from"]
$contactfield3=$_POST["subject"]
$contactfield4=$_POST["comment"]

$email_from = "";
$subject = "" ;
//$email_txt = "";
$email_to = "my email id here";

$message = "field1: $contactfield1\n
field2 :$contactfield2 \n
field3 :$contactfield3 \n
field4 : $contactfield4 \n

";

mail($email_to, $subject, $message,$email_from);

?>

So is this right ? I uploaded it to test it, but it doesn't seem to work as I'm not getting anything in my email box.
If I can only get this script right, I can apply it to all future sites that I create using this software. So I just need to get it right once. This software isn't designed for scripting- PHP or otherwise, so it needs the user to know PHP if he wishes to go by that route (else I'd have to only publish the site to CD). Also if it requires any proper formatting (as some lines in the script seem to me to be out of place), then provide that too.

Any takers?

Regards,

C.

PS. In case yor interested, you can view the site as I created it at this link --> http://visitmyspace.sitegoz.com/
(just need that damn script to work!) :)


Attachments:
File comment: screenshot
contact.jpg
contact.jpg [ 203.6 KiB | Viewed 1158 times ]
TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Beginner needs help- simple 'mail_to' contact form in PHP
PostPosted: Sun Sep 06, 2009 3:23 pm 
Offline
Newbie
User avatar

Joined: Sun Sep 06, 2009 3:16 pm
Posts: 1
Has thanked: 0 time
Have thanks: 0 time
usefull contactform


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Beginner needs help- simple 'mail_to' contact form in PHP
PostPosted: Sat Sep 12, 2009 1:07 am 
Offline
Newbie
User avatar

Joined: Sun Feb 15, 2009 5:27 pm
Posts: 2
Has thanked: 0 time
Have thanks: 0 time
yeah ... but it doesn't work for me as it's supposed to :(


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 3 posts ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 getting gst, pst total to diplay in my javascript form  Scripting Language  Anonymous  0
 coding a simple packet sniffer  C-C++  abhay  2
 How to make PHP form data saved into txt file  PHP  Radu  6
 php User Registration Form  PHP Tutorials  msi_333  2
 complete registration form with validation  PHP examples  msi_333  0

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team