PDA

View Full Version : PHP Form Help!



Tomm
11-07-2005, 06:11 PM
Hi,

I am doing email form but when i submit it i get this error:

Parse error: parse error, unexpected T_VARIABLE in /home2/pixelme/public_html/form/formprossess.php on line 10

Here sorce for form.php:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="get" action="formprossess.php">
<p>Job:
<select name="job" id="job">
<option value="Pixel Artist" selected>Pixel Artist</option>
<option value="Programmer">Programmer</option>
<option value="Chat mod">Chat mod</option>
</select>
</p>
<p>Habbo Name:
<input name="habbo" type="text" id="habbo">
</p>
<p>Forum Name:
<input name="forum" type="text" id="forum">
</p>
<p>Email:
<input name="email" type="text" id="email">
</p>
<p>Why you should get this job: </p>
<p>
<textarea name="why" cols="50" rows="10" id="why"></textarea>
</p>
<p>Samples of your work (url):</p>
<p>
<textarea name="sample" id="sample"></textarea>
</p>
<p>
<input name="subject" type="hidden" id="subject" value="Job Application - Auto Form Mailer">
<input name="ip" type="hidden" id="ip" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>">
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<p>&nbsp;</p>
</body>
</html>


Heres sorce for formprosses.php:


<?php
if ($_SERVER['REQUEST_METHOD'] != 'GET'){
$job = $_POST['job'];
$habbo = $_POST['habbo'];
$forum = $_POST['forum'];
$why = $_POST['why'];
$sample = $_POST['sample'];
$email = $_POST['email']

$messig = "

Job: $job
\n
Habbo Name: $habbo
\n
Forum Username: $forum
\n
Email: $email
\n
Why Should I get the job: $why
\n
Samples Of My Work: $sample
\n

";

$subject = $_POST['subject']

mail("[email protected]", $subject, $messig);

Header("Location: thankyoupage.php");

}
else
{
echo 'ERROR';
}
?>

If any1 can help great!

Thanks,

Tomdarkness

jamie5k
11-07-2005, 06:26 PM
$messig = "

thats your prob

Leet
11-07-2005, 06:29 PM
he knows that he donno the error tho

splintercell!
11-07-2005, 06:31 PM
and I think you need to make $email = $_POST['email'] , $email = $_POST['email'];

Also in general a T_VARIABLE on line 10 means the error will be before line ten I experienced this the other day :)

Mentor
11-07-2005, 06:40 PM
$email = $_POST['email'] is missing its ; meaning that the php interpeter is not exspecting another veraible to appear as the last one hasnt be closem aka why it gives t varible errors

Leet
11-07-2005, 06:42 PM
$email = $_POST['email'] is missing its ; meaning that the php interpeter is not exspecting another veraible to appear as the last one hasnt be closem aka why it gives t varible errors

where do u put ;

splintercell!
11-07-2005, 06:43 PM
after $email = $_POST['email'] that statement so it becomes $email = $_POST['email'];
:)

Leet
11-07-2005, 06:49 PM
after $email = $_POST['email'] that statement so it becomes $email = $_POST['email'];
:)


Forum Username: $forum
\n
Email: $email = $_POST['email'];

how will that jelp if it is still having problems

splintercell!
11-07-2005, 06:52 PM
Ok lets look at this:
<?php
if ($_SERVER['REQUEST_METHOD'] != 'GET'){
$job = $_POST['job'];
$habbo = $_POST['habbo'];
$forum = $_POST['forum'];
$why = $_POST['why'];
$sample = $_POST['sample'];
$email = $_POST['email']

that creats a variable and take it from the form Ie when you name the input the name is inbeween the [] ok? Now after them is a ; to end the statement but after the
$email = $_POST['email'] there isnt one which is causing the problem so all you have to do it add ad ; after the $email = $_POST['email'] statement. OK??

Leet
11-07-2005, 06:58 PM
now it says:


Parse error: parse error, unexpected T_STRING in /home2/pixelme/public_html/form/formprossess.php on line 28

Mentor
11-07-2005, 07:07 PM
your missing a ; on this as well $subject = $_POST['subject']

should be

$subject = $_POST['subject'] ;

Leet
11-07-2005, 07:10 PM
now it says: ERROR

Mentor
11-07-2005, 07:13 PM
<?php
if ($_SERVER['REQUEST_METHOD'] != 'GET'){
$job = $_POST['job'];
$habbo = $_POST['habbo'];
$forum = $_POST['forum'];
$why = $_POST['why'];
$sample = $_POST['sample'];
$email = $_POST['email'];

$messig = "

Job: $job
\n
Habbo Name: $habbo
\n
Forum Username: $forum
\n
Email: $email
\n
Why Should I get the job: $why
\n
Samples Of My Work: $sample
\n

";

$subject = $_POST['subject'];

mail("[email protected]", $subject, $messig);

Header("Location: thankyoupage.php");

}
?>


Becuse your missing still missing bits, that should work

:Blob
11-07-2005, 07:25 PM
Opps sorry, delete post

Tomm
12-07-2005, 04:16 PM
mmm... all i get is blank page and as for email - no email

:Blob
12-07-2005, 04:21 PM
I do


myhabbo.hd-hosting.net/form/contact.html

Want to hide these adverts? Register an account for free!