16. februar 2004 - 09:09
Der er
5 kommentarer og 1 løsning
fejl i php kode til ændre farve
Jeg har nu et nyt problem. der er en fejl i denne php kode: <?php include('inc/sql.php'); $result = mysql_query("SELECT * FROM users WHERE id = '$id'") or die(mysql_error()); $row = mysql_fetch_array($result); <html> <head> <meta name="generator" content="Microsoft FrontPage 5.0"><body text="#000000" bgcolor="#ffffff"> <STYLE type="text/css"> <!-- BODY { scrollbar-face-color: #ffffff; scrollbar-highlight-color: #ffffff; scrollbar-3dlight-color: #ffffff; scrollbar-darkshadow-color: #ffffff; scrollbar-shadow-color: #ffffff; scrollbar-arrow-color: #000000; scrollbar-track-color: #ffffff; } --> </STYLE><script language=JavaScript> <!-- var message=""; /////////////////////////////////// function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function("return false") // --> </script><script language="JavaScript1.2"> function disableselect(e){ return false } function reEnable(){ return true } document.onselectstart=new Function ("return false") if (window.sidebar){ document.onmousedown=disableselect document.onclick=reEnable } </script><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body text="#000000" link="abcdef" vlink="abcdef" alink="abcdef" background="bg_farve.gif"><p align="center"><font face="Tahoma" size="3"> <font face="Tahoma" size="3" color="black"><b>Farve skifter</font></b></font></p> <p align="left"><font face="Tahoma" size="3"><font face="Tahoma" size="2" color="black"> if ($row[onlinetid] > 0) { echo "<a href="farve/0-timer.php">Standart hvid</a><br>"; } if ($row[onlinetid] > 360000) { echo "<font color="#FF0000"><a href="farve/100-timer.php">Rød Farve</a></font><br>"; } if ($row[onlinetid] > 1080000) { echo "<font color="#00FF00"><a href="farve/300-timer.php">Grøn Farve</a></font><br>"; } if ($row[onlinetid] > 1960000) { echo "<font color="#FF6600"><a href="farve/550-timer.php">Orange Farve</a></font><br>"; } if ($row[onlinetid] > 2340000) { echo "<font color="#663300"><a href="farve/650-timer.php">Brun Farve</a></font><br>"; } if ($row[onlinetid] > 2880000) { echo "<font color="#FF00FF"><a href="farve/800-timer.php">Pink Farve</a></font><br>"; } if ($row[onlinetid] > 3780000) { echo "<font color="#333333"><a href="farve/1050-timer.php">Grå Farve</a></font><br>"; } if ($row[onlinetid] > 5400000) { echo "<font color="#000000"><a href="farve/1500-timer.php">Sort Farve</a></font><br>"; } ?> hvis jeg prøver at komme ind på siden skriver den: Parse error: parse error in /customers/3dchatten.dk/3dchatten.dk/httpd.www/farve.php on line 7 nu har jeg kigget på din i flere timer og kan ikke finde fejlen håber i kan hjælpe mig
Annonceindlæg fra GlobalConnect
16. februar 2004 - 09:12
#1
Prøv sådan her <?php include('inc/sql.php'); $result = mysql_query("SELECT * FROM users WHERE id = '$id'") or die(mysql_error()); $row = mysql_fetch_array($result); <html> <head> <meta name="generator" content="Microsoft FrontPage 5.0"><body text="#000000" bgcolor="#ffffff"> <STYLE type="text/css"> <!-- BODY { scrollbar-face-color: #ffffff; scrollbar-highlight-color: #ffffff; scrollbar-3dlight-color: #ffffff; scrollbar-darkshadow-color: #ffffff; scrollbar-shadow-color: #ffffff; scrollbar-arrow-color: #000000; scrollbar-track-color: #ffffff; } --> </STYLE><script language=JavaScript> <!-- var message=""; /////////////////////////////////// function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function("return false") // --> </script><script language="JavaScript1.2"> function disableselect(e){ return false } function reEnable(){ return true } document.onselectstart=new Function ("return false") if (window.sidebar){ document.onmousedown=disableselect document.onclick=reEnable } </script><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body text="#000000" link="abcdef" vlink="abcdef" alink="abcdef" background="bg_farve.gif"><p align="center"><font face="Tahoma" size="3"> <font face="Tahoma" size="3" color="black"><b>Farve skifter</font></b></font></p> <p align="left"><font face="Tahoma" size="3"><font face="Tahoma" size="2" color="black"> if ($row[onlinetid] > 0) { echo "<a href=\"farve/0-timer.php\">Standart hvid</a><br>"; } if ($row[onlinetid] > 360000) { echo "<font color=\"#FF0000\"><a href=\"farve/100-timer.php\">Rød Farve</a></font><br>"; } if ($row[onlinetid] > 1080000) { echo "<font color=\"#00FF00\"><a href=\"farve/300-timer.php\">Grøn Farve</a></font><br>"; } if ($row[onlinetid] > 1960000) { echo "<font color=\"#FF6600\"><a href=\"farve/550-timer.php\">Orange Farve</a></font><br>"; } if ($row[onlinetid] > 2340000) { echo "<font color=\"#663300\"><a href=\"farve/650-timer.php\">Brun Farve</a></font><br>"; } if ($row[onlinetid] > 2880000) { echo "<font color=\"#FF00FF\"><a href=\"farve/800-timer.php\">Pink Farve</a></font><br>"; } if ($row[onlinetid] > 3780000) { echo "<font color=\"#333333\"><a href=\"farve/1050-timer.php\">Grå Farve</a></font><br>"; } if ($row[onlinetid] > 5400000) { echo "<font color=\"#000000\"><a href=\"farve/1500-timer.php\">Sort Farve</a></font><br>"; } ?>
16. februar 2004 - 09:15
#4
Hov ja, der overså jeg Sådan her <?php include('inc/sql.php'); $result = mysql_query("SELECT * FROM users WHERE id = '$id'") or die(mysql_error()); $row = mysql_fetch_array($result); ?> <html> <head> <meta name="generator" content="Microsoft FrontPage 5.0"><body text="#000000" bgcolor="#ffffff"> <STYLE type="text/css"> <!-- BODY { scrollbar-face-color: #ffffff; scrollbar-highlight-color: #ffffff; scrollbar-3dlight-color: #ffffff; scrollbar-darkshadow-color: #ffffff; scrollbar-shadow-color: #ffffff; scrollbar-arrow-color: #000000; scrollbar-track-color: #ffffff; } --> </STYLE><script language=JavaScript> <!-- var message=""; /////////////////////////////////// function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function("return false") // --> </script><script language="JavaScript1.2"> function disableselect(e){ return false } function reEnable(){ return true } document.onselectstart=new Function ("return false") if (window.sidebar){ document.onmousedown=disableselect document.onclick=reEnable } </script><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body text="#000000" link="abcdef" vlink="abcdef" alink="abcdef" background="bg_farve.gif"><p align="center"><font face="Tahoma" size="3"> <font face="Tahoma" size="3" color="black"><b>Farve skifter</font></b></font></p> <p align="left"><font face="Tahoma" size="3"><font face="Tahoma" size="2" color="black"> <?php if ($row[onlinetid] > 0) { echo "<a href=\"farve/0-timer.php\">Standart hvid</a><br>"; } if ($row[onlinetid] > 360000) { echo "<font color=\"#FF0000\"><a href=\"farve/100-timer.php\">Rød Farve</a></font><br>"; } if ($row[onlinetid] > 1080000) { echo "<font color=\"#00FF00\"><a href=\"farve/300-timer.php\">Grøn Farve</a></font><br>"; } if ($row[onlinetid] > 1960000) { echo "<font color=\"#FF6600\"><a href=\"farve/550-timer.php\">Orange Farve</a></font><br>"; } if ($row[onlinetid] > 2340000) { echo "<font color=\"#663300\"><a href=\"farve/650-timer.php\">Brun Farve</a></font><br>"; } if ($row[onlinetid] > 2880000) { echo "<font color=\"#FF00FF\"><a href=\"farve/800-timer.php\">Pink Farve</a></font><br>"; } if ($row[onlinetid] > 3780000) { echo "<font color=\"#333333\"><a href=\"farve/1050-timer.php\">Grå Farve</a></font><br>"; } if ($row[onlinetid] > 5400000) { echo "<font color=\"#000000\"><a href=\"farve/1500-timer.php\">Sort Farve</a></font><br>"; } ?>
16. februar 2004 - 09:42
#5
Måske skulle du prøve med en mere moderne version: if ($row['onlinetid'] > 0) { echo "<a href=\"farve/0-timer.php\">Standart hvid</a><br>"; } if ($row['onlinetid'] > 360000) { echo "<a style='color: #FF0000;' href=\"farve/100-timer.php\">Rød Farve</a><br>"; } if ($row['onlinetid'] > 1080000) { echo "<a style='color: #00FF00;' href=\"farve/300-timer.php\">Grøn Farve</a><br>"; } if ($row['onlinetid'] > 1960000) { echo "<a style='color: #FF6600;' href=\"farve/550-timer.php\">Orange Farve</a><br>"; } if ($row['onlinetid'] > 2340000) { echo "<a style='color: #663300;' href=\"farve/650-timer.php\">Brun Farve</a><br>"; } if ($row['onlinetid'] > 2880000) { echo "<a style='color: #FF00FF;' href=\"farve/800-timer.php\">Pink Farve</a><br>"; } if ($row['onlinetid'] > 3780000) { echo "<a style='color: #333333;' href=\"farve/1050-timer.php\">Grå Farve</a><br>"; } if ($row['onlinetid'] > 5400000) { echo "<a style='color: #000000;' href=\"farve/1500-timer.php\">Sort Farve</a><br>"; }