Jump to content

Archived

This topic is now archived and is closed to further replies.

ItsWesYo

PHP Form

Recommended Posts

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]
<?php
include ("http://wes.hypreed.com/header.php");
$page = $_REQUEST['action'];

if($page == "sent"){
echo ( "

<center>

<br><br>

<?php

if(isset($_POST['submit'])) {

$to = "affiliate@wes.hypreed.com";
$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.

Share this post


Link to post
Share on other sites
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 = "affiliate@wes.hypreed.com";
    $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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.