Jump to content

PHP Form


ItsWesYo

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.
Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.