Noob Needs help on first attempt
Posted: Mon May 15, 2006 9:58 am
Hi fellas....complete noob to PHP
trying to get a demo request form built for my company....have found code on w3school site
but i am getting an error that i cant understand....
error:
Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in /homepages/13/d142595334/htdocs/NewSite/test.php on line 24
Now i had this form working....it was sending me the emails quite happily.....but as soon as i incorporate the code into a table for layout purposes.....it goes mental.....probably very easy for non noobs but i cant spot it....or understand what the problem could be....any help greatly appreciated
or better yet....if someone could correct my code where i've fecked it up....so that i can see exactly where and how i went wrong.....that would be superb
code:
trying to get a demo request form built for my company....have found code on w3school site
but i am getting an error that i cant understand....
error:
Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in /homepages/13/d142595334/htdocs/NewSite/test.php on line 24
Now i had this form working....it was sending me the emails quite happily.....but as soon as i incorporate the code into a table for layout purposes.....it goes mental.....probably very easy for non noobs but i cant spot it....or understand what the problem could be....any help greatly appreciated
or better yet....if someone could correct my code where i've fecked it up....so that i can see exactly where and how i went wrong.....that would be superb
code:
Code: Select all
<?php
if (isset($_REQUEST['email']))
{
$clientname = $_REQUEST['clientname'] ;
$position = $_REQUEST['position'] ;
$company = $_REQUEST['company'] ;
$postcode = $_REQUEST['postcode'] ;
$tel = $_REQUEST['tel'] ;
$email = $_REQUEST['email'] ;
$subject = "Demo Request" ;
$more = $_REQUEST['more'] ;
$message = " Name: $clientname\n Position: $position\n Company: $company\n Postcode: $postcode\n Tel: $tel\n Message: $more\n";
mail( "me@mydomain.com", "Subject: $subject", $message, "From: $email" );
echo "Thank you for using our mail form";
}
else
{
echo "<form method='post' action='test.php'>
<table border="0" width="36%" id="table1" cellspacing="0" cellpadding="2">
<tr>
<td width="132"><b>Name</b></td>
<td> <input name='clientname' type='text' /></td>
</tr>
<tr>
<td width="132"><b>Position</b></td>
<td> <input name='position' type='text' /></td>
</tr>
<tr>
<td width="132"><b>Company</b></td>
<td><input name='company' type='text' /></td>
</tr>
<tr>
<td width="132"><b>Address L1</b></td>
<td> </td>
</tr>
<tr>
<td width="132"><b>Address L2</b></td>
<td> </td>
</tr>
<tr>
<td width="132"><b>Town</b></td>
<td> </td>
</tr>
<tr>
<td width="132"><b>City</b></td>
<td> </td>
</tr>
<tr>
<td width="132"><b>Postcode</b></td>
<td><input name='postcode' type='text' /></td>
</tr>
<tr>
<td width="132"><b>Country</b></td>
<td> </td>
</tr>
<tr>
<td width="132"><b>Email</b></td>
<td><input name='email' type='text' /></td>
</tr>
<tr>
<td width="132"><b>Tel</b></td>
<td><input name='tel' type='text' /></td>
</tr>
<tr>
<td width="132"><b>Fax</b></td>
<td> </td>
</tr>
<tr>
<td width="132"><b>Requested Date</b></td>
<td> </td>
</tr>
<tr>
<td width="132"><b>Requested Time</b></td>
<td> </td>
</tr>
<tr>
<td width="132"><b>Message</b></td>
<td><textarea name='more' rows='15' cols='40'></textarea></td>
</tr>
<tr>
<td width="132"> </td>
<td><input type='submit' /></td>
</tr>
</table>
</form>";
}
?>