Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,469 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,430 people online right now. Registration is fast and FREE... Join Now!




Major Errors

 
Reply to this topicStart new topic

Major Errors

RichardSA
post 2 Apr, 2005 - 04:00 PM
Post #1


New D.I.C Head

Group Icon
Joined: 16 Feb, 2005
Posts: 24



Dream Kudos: 25
My Contributions


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

CODE
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.
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 2 Apr, 2005 - 04:37 PM
Post #2


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,173



Thanked 33 times

Dream Kudos: 25
My Contributions


I'm sure we can help...can you post the errors? It'll be easier to debug if we know them.
User is offlineProfile CardPM

Go to the top of the page

DanceInstructor
post 2 Apr, 2005 - 04:46 PM
Post #3


New D.I.C Head

Group Icon
Joined: 18 Mar, 2005
Posts: 41



Dream Kudos: 25
My Contributions


It looks like you have:

if
else
else

That's not legal is it?
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 2 Apr, 2005 - 05:05 PM
Post #4


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,173



Thanked 33 times

Dream Kudos: 25
My Contributions


No, it's not...the proper syntax in php is:
CODE

if(something)
{
}
elseif(somethingelse)
{
}
else
{
}
User is offlineProfile CardPM

Go to the top of the page

RichardSA
post 2 Apr, 2005 - 06:21 PM
Post #5


New D.I.C Head

Group Icon
Joined: 16 Feb, 2005
Posts: 24



Dream Kudos: 25
My Contributions


Ah, thanks guys.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 01:52PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month