Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
woohoo a parse error! :(
Old 05-23-2005, 11:24 AM woohoo a parse error! :(
HitRaj47's Avatar
Extreme Talker

Posts: 177
Location: GA
Trades: 0
the code:

PHP Code:
<h1>Join Us</h1>

<?php

if (isset($_POST['submit'])) {    // Form has been submitted

    
if (isset($errormsg)) {    // Error in form

?>

<p style="color: #ff0000;"><strong>Error: </strong><?php print $errormsg;?></p>

<form method="post" action="index.php?page=join">

<table>

<tr>

<td><strong>*CS: Source name:</strong></td>
<td><input type="text" name="cssname" value="<?php print $_POST['cssname'];?>" /></td>

</tr>

<tr>

<td><strong>*Real Name:</strong></td>
<td><input type="text" name="realname" value="<?php print $_POST['realname'];?>" /></td>

</tr>

<tr>

<td><strong>Xfire username (if you have it, recommended):</strong></td>
<td><input type="text" name="xfire" value="<?php print $_POST['xfire'];?>" /></td>

</tr>

<tr>

<td><strong>*Link to PCGF profile:</strong></td>
<td><input type="text" name="profile" value="<?php print $_POST['profile'];?>" /></td>

</tr>

<tr>

<td><strong>*Age:</strong></td>
<td><input type="text" name="age" value="<?php print $_POST['age'];?>" /></td>

</tr>

<tr>

<td><strong>*Why do you want to join?/What can you bring to the clan? (if applicable, e.g. a server *hint* :P)</strong></td>
<td><textarea name="reasons"><?php print $_POST['reasons'];?></textarea></td>

</tr>

<tr>
<td><strong>*E-mail:</strong></td>
<td><input type="text" name="email" value="<?php print $_POST['email'];?>" /></td>
</tr>

<tr>
<td><strong>Do you have a mic?</strong></td>
<td><select name="mic">
<option value="Yes">Yes</option>
<option value="No">No</option>
</select></td>

</tr>

</table>

<p><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset Form" /></p>

</form>

<?php

    
} else {    // no error message set

        
if (empty($_POST['cssname']) OR empty($_POST['realname']) OR empty($_POST['profile']) OR (empty($_POST['age']) OR empty($_POST['reasons']) OR empty($_POST['email'])) {    // One or more fields left blank

            
$errormsg "One or more of the required fields were left blank. Please make sure all fields marked with an * are filled in.";

        } else {    
// All fields fileld in

            
$cssname trim($_POST['cssname']);
            
$realname trim($_POST['realname']);
            
$xfire trim($_POST['xfire']);
            
$profile trim($_POST['profile']);
            
$age $_POST['age'];
            
$reasons $_POST['reasons'];
            
$email trim($_POST['email']);
            
$mic $_POST['mic'];

            
// Define mail parameters
            
$recipient "pcgf@fnar.sytes.net";
            
$subject "Application for " $cssname "(" $realname ")";
            
$body "Someone has applied to join PCGF&copy;! Below are the details that were submitted.\n\n" .
            
"CS: Source name: " $cssname "\n" .
            
"Real name: " $realname "\n" .
            
"Xfire username: " $xfire "\n" .
            
"PCGF profile: " $profile "\n" .
            
"Age: " $age "\n" .
            
"Reasons for applying:\n\n" .
            
nl2br($reasons) . "\n" .
            
"Has a mic: " $mic "\n\n" .
            
"Their e-mail address is: " $email "\n\n" .
            
" - http://fnar.sytes.net/pcgf/";

            
// Send the mail
            
mail ($recipient$subject$body"From: $email");

            
// Print thank you message
            
?>

            <p>Thank you for applying. One of the leaders, either Neoboy or HitRaj 47 will get back to you ASAP.</p>

<?php
        
}    // End IF to check for blank fields

    
}    // End IF to check for errormsg

} else {    // Form not submitted, display form

?>

<p>To join, fill in the form below. Fields marked with a * are required.</p>

<form method="post" action="index.php?page=join">

<table>

<tr>

<td><strong>*CS: Source name:</strong></td>
<td><input type="text" name="cssname" /></td>

</tr>

<tr>

<td><strong>*Real Name:</strong></td>
<td><input type="text" name="realname" /></td>

</tr>

<tr>

<td><strong>Xfire username (if you have it, recommended):</strong></td>
<td><input type="text" name="xfire" /></td>

</tr>

<tr>

<td><strong>*Link to PCGF profile:</strong></td>
<td><input type="text" name="profile" /></td>

</tr>

<tr>

<td><strong>*Age:</strong></td>
<td><input type="text" name="age" /></td>

</tr>

<tr>

<td><strong>*Why do you want to join?/What can you bring to the clan? (if applicable, e.g. a server *hint* :P)</strong></td>
<td><textarea name="reasons"></textarea></td>

</tr>

<tr>
<td><strong>*E-mail:</strong></td>
<td><input type="text" name="email" /></td>
</tr>

<tr>
<td><strong>Do you have a mic?</strong></td>
<td><select name="mic">
<option value="Yes">Yes</option>
<option value="No">No</option>
</select></td>

</tr>

</table>

<p><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset Form" /></p>

</form>

<?php

}    // End if to check if form was submitted

?>
the error:
Quote:
Parse error: syntax error, unexpected '{' in C:\webserver\hosted\pcgf\join.php on line 83
line 83 is where it says:
Quote:
if (empty($_POST['cssname']) OR empty($_POST['realname']) OR empty($_POST['profile']) OR (empty($_POST['age']) OR empty($_POST['reasons']) OR empty($_POST['email'])) { // One or more fields left blank
as far as i can tell, it looks OK
HitRaj47 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-23-2005, 11:43 AM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
Code:
OR (empty($_POST['age'])
You have an extra parenthesis here, and you did not close it before placing the curly brace. Get rid of that and it should work, I think.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 05-23-2005, 11:56 AM
HitRaj47's Avatar
Extreme Talker

Posts: 177
Location: GA
Trades: 0
thank Chroder didnt spot that
HitRaj47 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to woohoo a parse error! :(
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12366 seconds with 12 queries