NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page PHP Feedback form?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 06-27-2004, 06:13 AM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Jun 2004
Location: United Kingdom
Posts: 2,725
will7 has much to be proud ofwill7 has much to be proud ofwill7 has much to be proud ofwill7 has much to be proud ofwill7 has much to be proud ofwill7 has much to be proud ofwill7 has much to be proud ofwill7 has much to be proud of
 



PHP Feedback form?


I have written out some code for a PHP contact form. On my 'contact us' page, I have given the form the action: sendmail.php (yes, the file is called sendmail.php ). Here is the code I used:

PHP Code:
<?php
$to
="lavastream_customerservice@msn.com";
$subj="Lavastream General Enquiry";
$msg="Name: ".$_POST['name']." \r \n E-Mail: ".$_POST['email']." \r \n Message: ".$_POST['msg']." \r \n";
????: NamePros.com http://www.namepros.com/programming/36149-php-feedback-form.html
$header="From: ".$_POST['email']."; 

if(mail(
$to$subj$msg$header))

header("
Locationthanks.htm");
}
else
{
header("
Locationnotsent.htm");
}
?>
Then, when I use localhost (which has PHP enabled) and try to send an email using the form, I get this error:

Parse error: parse error, unexpected T_STRING in C:\Abyss Web Server\htdocs\lavastream\sendmail.php on line 9

Why? I need help!! I can't see any problems on line 9 or anywhere else. Can any of you?
will7 is offline  
Old 06-29-2004, 05:59 PM   #2 (permalink)
Account Closed
 
BoRiCuA's Avatar
Join Date: Apr 2004
Location: Connecticut
Posts: 586
BoRiCuA is just really niceBoRiCuA is just really niceBoRiCuA is just really niceBoRiCuA is just really nice
 



Name this "feedback.php":

PHP Code:

<?php


// ************* MODIFY THE NEXT THREE LINES *****************************
$title "Site Title"// <--- PUT THE TITLE OF YOUR HOME PAGE BETWEEN THE "" MARKS
$home "http://www.yourdomain.ext"// <--- PUT YOUR URL BETWEEN THE "" MARKS
$mailto "e-mail@domain.ext"// <--- PUT YOUR E-MAIL ADDRESS BETWEEN THE "" MARKS
// ********************* MODIFY NO MORE ********************************


// Thanks for the feedback etc.
header("Location: [url]http://www.domain.ext/ty.php[/url]"); 

// Scrape off the slashes before processing
$umsg stripslashes($umsg);


// Here is where we grab and process the form and variables from mailform.php
// and e-mail the results to the value of "$mailto"


$mailfrom "From: $uemail";
????: NamePros.com http://www.namepros.com/showthread.php?t=36149
$subject"$usubj";
$body "* * * * * BEGIN FEEDBACK * * * * *\n\nSent from IP: $REMOTE_ADDR\nName: $uname\nEMail: $uemail\nSite: $uphone\nSubject: $usubj\nMessange: $umsg\n\n* * * * * END FEEDBACK * * * * *";

mail ($mailto$subject$body$mailfrom);

?>

Name this "mailform.php":

Quote:

<FORM ACTION="feedback.php" METHOD="POST" onSubmit= "return submitIt(this)">
<input type="hidden" name="REMOTE_ADDR" value="<? echo $REMOTE_ADDR;?>">
<table border=0 width="300">
<tr>
<td><font face="Arial">Name:</font></td><td><input name="uname" type="text" rows=1 value="<?php echo $uname;?>" size="37"></td>
????: NamePros.com http://www.namepros.com/showthread.php?t=36149
</tr>
<tr>
<td><font face="Arial">Email:</font></td><td><input type=text name="uemail" rows=1 value="<?php echo $uemail;?>" size="37"></td>
</tr>
<tr>
<td><font face="Arial">Site:</font></td><td><input type=text name="uphone" rows=1 value="<?php echo $uphone;?>" size="37"></td>
</tr>
<tr>
<td><font face="Arial">Subject:</font></td><td><select name="usubj" value="<?php echo $usubj;?>" size="1">
<OPTION>-Choose-
<OPTION>Suggestion
<OPTION>Comment
<OPTION>Question
<OPTION>Broken Link
<OPTION>Affiliate
<OPTION>Other
</SELECT>
</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>Message:</td>
<td><textarea name="umsg" rows=7 cols=26 value="<?php echo $umsg;?>" size="800"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<p><input type="submit" value="Submit" name="Send">&nbsp;&nbsp;&nbsp;
<input type="reset" value="Reset" name="Reset"></td></tr></table></p>
</form>
Last edited by BoRiCuA; 07-03-2004 at 01:41 PM.
BoRiCuA is offline  
Old 06-29-2004, 06:04 PM   #3 (permalink)
Senior Member
 
iDeviseFlash's Avatar
Join Date: Jun 2004
Posts: 1,030
iDeviseFlash will become famous soon enoughiDeviseFlash will become famous soon enough
 



darn, ya beat me to it...
__________________
~*~* SIG FOR SALE *~*~
Click here...
iDeviseFlash is offline  
Old 06-29-2004, 06:19 PM   #4 (permalink)
Senior Member
Join Date: Apr 2004
Posts: 1,189
e39m5 is a jewel in the roughe39m5 is a jewel in the roughe39m5 is a jewel in the rough
 



Thanks for that code boricua, i was lookin for one
e39m5 is offline  
Old 07-01-2004, 02:50 PM   #5 (permalink)
Account Closed
 
BoRiCuA's Avatar
Join Date: Apr 2004
Location: Connecticut
Posts: 586
BoRiCuA is just really niceBoRiCuA is just really niceBoRiCuA is just really niceBoRiCuA is just really nice
 



Can't see my quickness iDeviseFlash

NP e39
BoRiCuA is offline  
Old 07-01-2004, 03:54 PM   #6 (permalink)
Senior Member
 
iDeviseFlash's Avatar
Join Date: Jun 2004
Posts: 1,030
iDeviseFlash will become famous soon enoughiDeviseFlash will become famous soon enough
 



hehe, ill get you next time
__________________
~*~* SIG FOR SALE *~*~
Click here...
iDeviseFlash is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:24 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger