Jump to content

I need some form help..


CrazeD

Recommended Posts

Hi, new here.

I'm also very new to PHP, I know a little but not very much.

So, I'm stuck here. I run a gaming clan for Battlefield 2, and I'm trying to make a recruit form so people can sign up for the clan.

I got the form part down easy, it's the process part that I'm stuck on. Well actually I got it to work, but I'm picky and not satisfied.

There are a few required fields, and if they aren't filled in it gives you an error before continuing. I have a Terms and Conditions that members have to read and accept before continuing. I went to single this out from the rest of the required fields. Normally if a field isn't completed, it will say, "You did not enter one or more of the required fields. Please go back and try again.".

Now, if the Terms and Conditions aren't accepted, I want it to say, "You must accept our Terms and Conditions before continuing, please go back and try again."

This is what happens:
Parse error: syntax error, unexpected ';' in /home/*****/public_html/axe/recruit/process.php on line 23

Line 23: [code]$acceptErrors=1;[/code]

The whole code:
[code]
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
$acceptErrors=0;
$acceptError="You must accept our Terms and Conditions before you may continue. Please go back and try again.";
pt_register('POST','gamername');
pt_register('POST','xfirename');
pt_register('POST','age');
pt_register('POST','email');
pt_register('POST','doyouhaveamicrophone');
pt_register('POST','favoritekit');
pt_register('POST','howoftencanyouplay');
pt_register('POST','howyouheardaboutus');
pt_register('POST','canyoudonate');
pt_register('POST','otherinfo');
pt_register('POST','Accepted');
if($gamername=="" || $xfirename=="" || $age=="" || $email=="" || $doyouhaveamicrophone=="no" || $howoftencanyouplay=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($Accepted=="" )(
$acceptErrors=1;
)
if($errors==1) echo $error;
elseif($acceptErrors=1) echo $acceptError;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Gamername: ".$gamername."
X-Fire name: ".$xfirename."
Age: ".$age."
e-Mail: ".$email."
Do you have a microphone: ".$doyouhaveamicrophone."
Favorite weapon: ".$favoritekit."
How often can you play: ".howoftencanyouplay."
How you heard about us: ".howyouheardaboutus."
Can you donate: ".$canyoudonate."
Other info: ".$otherinfo."
Do you accept terms and conditions: ".Accepted."
";
$message = stripslashes($message);
mail("crazed@clanafterdeath.com","Recruit Application",$message,"From: a[X]e ");

header("Refresh: 0;url=http://clanafterdeath.com/axe");
?>
[/code]

Everything worked until I made the following changes:

[code]
$acceptErrors=0;
$acceptError="You must accept our Terms and Conditions before you may continue. Please go back and try again.";

if($Accepted=="" )(
$acceptErrors=1;
)
if($errors==1) echo $error;
elseif($acceptErrors=1) echo $acceptError;
[/code]

Can anyone tell me what I did wrong?

Remember, I'm an extreme newbie...go easy.  ;D

Thanks.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.