ItsWesYo Posted August 25, 2006 Share Posted August 25, 2006 I probably did the coding wrong anyway, but an error shows up saying "Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/wes/public_html/apply1.php on line 14".Line 14 says:if(isset($_POST['submit'])) {[b]apply.php[/b][code]<?phpinclude ("http://wes.hypreed.com/header.php");$page = $_REQUEST['action'];if($page == "sent"){echo ( "<center><br><br><?phpif(isset($_POST['submit'])) {$to = "[email protected]";$subject = "Affiliate Application";$name = $_POST['name'];$email = $_POST['email'];$url = $_POST['website'];$message = $_POST['message'];$body = "Name: $name\n\nEmail: $email\n\nWebsite: $url\n\nMessage: $message";echo "Thanks! Your affiliate application will be reviewed.<br>Allow at least a day for a response.";mail($to, $subject, $body);} else {echo "Uh oh! Seems like an error.";}</center>?>" );die();}else {echo ( "<center><b>Fill out all the fields below to apply.</b><br><br><table><tr><td><form method='POST' action='?action=sent'><b>Polairia Username:</b><br><input type='text' name='name' size='25'><br><br><b>Email address:</b><br><input type='text' name='email' size='25'><br><br><b>Website URL:</b><br><input type='text' name='website' size='25'><br><br><b>Any other info needed?</b><br><textarea name='message' rows='5' cols='30'></textarea> <br><br><input type='submit' value='Apply' name='submit'></form></td></tr></table></center>");die();}?>[/code]I rather have this format instead of using "include ("sent.php");" so i won't have a lot of pages. Link to comment https://forums.phpfreaks.com/topic/18621-php-form/ Share on other sites More sharing options...
trq Posted August 25, 2006 Share Posted August 25, 2006 I dont know where your logic is going but it seems your trying to echo php code, try this instead....[code=php:0]<?php include ("http://wes.hypreed.com/header.php"); if (isset($_POST['submit'])) { echo "<center><br><br>"; $to = "[email protected]"; $subject = "Affiliate Application"; $name = $_POST['name']; $email = $_POST['email']; $url = $_POST['website']; $message = $_POST['message']; $body = "Name: $namennEmail: $emailnnWebsite: $urlnnMessage: $message"; echo "Thanks! Your affiliate application will be reviewed.<br>Allow at least a day for a response."; mail($to, $subject, $body); echo "</centre>"; } else {?><center><b>Fill out all the fields below to apply.</b><br><br><table><tr><td><form><b>Polairia Username:</b><br><input type='text' name='name' size='25'><br><br><b>Email address:</b><br><input type='text' name='email' size='25'><br><br><b>Website URL:</b><br><input type='text' name='website' size='25'><br><br><b>Any other info needed?</b><br><textarea name='message' rows='5' cols='30'></textarea> <br><br><input type='submit' value='Apply' name='submit'></form></td></tr></table></center><?php}?>[/code] Link to comment https://forums.phpfreaks.com/topic/18621-php-form/#findComment-80223 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.