Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, does anyone know what's wrong w

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, does anyone know what's wrong with the following statement, basically a fills out a form and they select whether they wish to remain anonymous or not, if they select tobe anonymous then if runs the bottom part of the script if they don't then it runs the top bit. I keep getting the error message "Parse error: parse error in /home/virtual/newfound/home/httpd/html/banddatabase/submittab2.php on line 55" but I can't see the prob.

I'd be greatful if you could help, cheers

<?
require(&quot;config.inc.php&quot;);
require (&quot;includes/style.php&quot;);

if(empty($band_id) OR empty($songname) OR empty($filetype) OR empty($tab))
{
echo '<font face=&quot;Verdana&quot; size=&quot;2&quot;>You did not fill in all the
fields. Click <a href=&quot;javascript:history.go(-1)&quot;>here</a> to go back and
make corrections</font>';
exit;
}
else {

$db = mysql_connect($host,$login,$pass);
mysql_select_db($base,$db);

if($anonymous != &quot;yes&quot;) {
$password = md5($password);
$query = &quot;SELECT * FROM xmb_nfp_members WHERE username='$username'&quot;;
$req = mysql_query($query);
while($member = mysql_fetch_array($req))

if(!$member[username]) {
echo &quot;Wrong Username&quot;;
exit;
}

if($password != $member[password]) {
echo &quot;Password Incorrect&quot;;
exit;
}

$user_id = $member['uid'];
$result_id = mysql_query(&quot;SELECT directory from bands_tbl where id = '$band_id'&quot;,$db);
$banddir = mysql_result($result_id,&quot;directory&quot;);
$sql = &quot;INSERT INTO requesttab_tbl VALUES('','$user_id','$band_id','$banddir','$songname','$filetype','$tab')&quot;;
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
{
echo '<font face=&quot;Verdana&quot; size=&quot;2&quot;>Your request has been received and we will check the information as soon as possible.</font>';
exit;
}
}
else {
$result_id = mysql_query(&quot;SELECT directory from bands_tbl where id = '$band_id'&quot;,$db);
$bandname = mysql_result($result_id,&quot;directory&quot;);
$sql2 = &quot;INSERT INTO requesttab_tbl VALUES('','0','$band_id','$bandname','$songname','$filetype','$tab')&quot;;
mysql_query($sql2) or die('Erreur SQL !'.$sql2.'<br>'.mysql_error());
{
echo '<font face=&quot;Verdana&quot; size=&quot;2&quot;>Your request has been received and we will check the information as soon as possible.</font>';
exit;
}
}

mysql_close($db);
?>
 
add another brace:

mysql_close($db);
}
?> ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
add another } before the very last ?> like

}
?> ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top