Code2Design.com

User login

The Layout

Programming

Graphic Design

Resources

Navigation

C2D Projects

Unsystematic Affiliates

T-Tutorials Adobe Tutorialz Adobe Tutorials Tutorials-db 

Change Language

Who's online

There are currently 0 users and 8 guests online.

Unexpected PHP Error?

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']"Position: ".$application['position'] .
   
"Current AA Name: " $application['aa_name']"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:

Quote:
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


Submitted by kab012345 on February 16, 2008 - 6:12pm.
printer friendly version

Wow, that's a lot of code to

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

Ok, thanks for that, and I shortened it.
Do you think that will work now?


Dont wanna sound rude but

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!


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br> <br /> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use BBCode tags in the text, URLs will be automatically converted to links
More information about formatting options



Like what you see?

Why not add more? C2D is looking for other Christian Web Masters who would like to help write articles for this site. If you have expericance in FLASH, CSS/HTML, PHP/MySQL, PhotoShop/GIMP, Blender, Javascript, or just General Design - our users would love to hear what you have to say. Contact Us

delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   technorati