Can anyone tell me what's wrong with this code?
I'm trying to make a custom page for a forum software called AEF. Here is the clan_theme.php file.
<?php
if(isset($_POST['position'] && $_POST['name'] && $_POST['aa_name'] && $_POST['honor'] && $_POST['age'] && $_POST['contact']
&& $_POST['games'] && $_POST['describe'] && $_POST['member'])){
echo '<tr>
<td class="ucpflc" align="left" colspan="2">
<center><b>Your clan application has been dispatched to the Officers with the information you have entered.<b></center>
</td>
</tr>';
$subject='Clan Application FOR: '. $_REQUEST['position'];
$application = array('Name' => $_REQUEST['name'],
'AA Name' => $_REQUEST['aa_name'],
'Honor' => $_REQUEST['honor'],
'Age' => $_REQUEST['age'],
'Contact Email' => $_REQUEST['contact'],
'Other Games Played' => $_REQUEST['games'],
'Desciption' => $_REQUEST['descibe'],
'Reffering Member' => $_REQUEST['member']);
$from="From: ".$user['username'];
mail($adminmail,$subject, "Requested Name: ".$application['Name']n . "Position: ".$application['position'] .
"Current AA Name: " . $application['aa_name']n "Age: ".$application['age'] .,$from);
}
?>I used \n after each variable I called in the array in the email body.
I always an error similar to this:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\VertrigoServ\www\clan.php on line 40
Wow, that's a lot of code to dig through. Can you paste something smaller like line 39-42 so that I can see what is there?
also, you can change this part of the code:
<?php
$subject="Clan Application FOR: ".$_REQUEST['position'];
$application = array("Name" => "$_REQUEST['name']",
"AA Name" => "$_REQUEST['aa_name']",
"Honor" => "$_REQUEST['honor']",
"Age" => "$_REQUEST['age']",
"Contact Email" => "$_REQUEST['contact']",
"Other Games Played" => "$_REQUEST['games']",
"Desciption" => "$_REQUEST['descibe']",
"Reffering Member" => "$_REQUEST['member']");
//Can be changed to this:
$subject='Clan Application FOR: '. $_REQUEST['position'];
$application = array('Name' => $_REQUEST['name'],
'AA Name' => $_REQUEST['aa_name'],
'Honor' => $_REQUEST['honor'],
'Age' => $_REQUEST['age'],
'Contact Email' => $_REQUEST['contact'],
'Other Games Played' => $_REQUEST['games'],
'Desciption' => $_REQUEST['descibe'],
'Reffering Member' => $_REQUEST['member']);
?>You shouldn't enclose arrays like $_REQUEST inside "quotes".
Ok, thanks for that, and I shortened it.
Do you think that will work now?
Dont wanna sound rude but instead of asking why dont you try it.
Also you can over ride your php configureation settings and show erros by doing:
<?php
// Place at beginning of code
// Error Handling
ini_set ('display_errors',1);
error_reporting (E_ALL & ~E_NOTICE);
?>Also its easy to fix errors if you post what you have. As well the different error types will usually dictat what to do in order to fix the errors. Good luck!