4 Replies - 1162 Views - Last Post: 02 April 2005 - 07:21 PM Rate Topic: -----

#1 RichardSA  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 16-February 05

Major Errors

Posted 02 April 2005 - 05:00 PM

This following code is playing up, there are MANY errors, but i cant see any of them. Here lines 80-115

if ($_POST['vote'] != 1, 2, 3, 4, 5) {
echo "Thats a no go polly...";
} else {
$newrateing = $output['rating'] + $_POST['vote'];
$newpeople = $output['voters'] + 1;
$votesystem1 = "UPDATE downloads_db SET rating={$newrateing} WHERE id={$fid}";
$votesystem2 = "UPDATE downloads_db SET voters={$newpeople} WHERE id={$fid}";
mysql_query($votesystem1);
mysql_query($votesystem2);
$handle = fopen("data/ratings_ip_list.txt", 'a');
$filestring = "[{$fid} {$_SERVER['REMOTE_ADDR']}]
ip=\"$_SERVER['REMOTE_ADDR']\"
id=\"{$fid}\"

";
fwrite($handle, $filestring);
?>
	<table width="725" border="2" align="center" cellpadding="2" cellspacing="1" bgcolor="#C0E7FF">
      <tr>
        <td width="569" align="left" valign="top" background="images/dl_bg.jpg">Your Vote has been counted, click continue to return to the download </td>
        <td width="137" align="right" valign="middle" background="images/dl_bg.jpg"><form action="" method="post"><input type="hidden" name="used" value="true"><input name="Continue" type="submit" value="Continue">
        </form> </td>
      </tr>
    </table> 
<?
} else {
	?>
	<table border="2" align="center" cellpadding="2" cellspacing="1" width="725" bgcolor="#C0E7FF">
  <tr>
 	 <td align="left" valign="top" background="images/dl_bg.jpg">
    <? echo $output['name']; ?>
 	 </td>
 	 <td align="right" valign="middle" background="images/dl_bg.jpg">
    <img src="images/f_icons/<? echo $output['f_icon']; ?>" alt="<? echo $output['f_type']; ?>">
 	 </td>
  </tr>
  <tr>



Please can you help me.

Is This A Good Question/Topic? 0
  • +

Replies To: Major Errors

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Major Errors

Posted 02 April 2005 - 05:37 PM

I'm sure we can help...can you post the errors? It'll be easier to debug if we know them.
Was This Post Helpful? 0
  • +
  • -

#3 DanceInstructor  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 18-March 05

Re: Major Errors

Posted 02 April 2005 - 05:46 PM

It looks like you have:

if
else
else

That's not legal is it?
Was This Post Helpful? 0
  • +
  • -

#4 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Major Errors

Posted 02 April 2005 - 06:05 PM

No, it's not...the proper syntax in php is:
if(something)
{
}
elseif(somethingelse)
{
}
else
{
}


Was This Post Helpful? 0
  • +
  • -

#5 RichardSA  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 16-February 05

Re: Major Errors

Posted 02 April 2005 - 07:21 PM

Ah, thanks guys.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1