Hei!
Seuraava php-koodi toimii unix-koneella, mutta ei Nt-koneella (jossa php-tulkki). Nt-koneella ei avaudu alavalikot. Miten voisi korjata?
<html> <head> <title>php expanding navigation demo</title> <style type="text/css"> a{font:normal 9pt verdana;color:red;} </style> </head> <body> // If there is no content variable, // assign the value "main.html" to // the variable. <table width="799" border="0"> <tr> <td width="147"> <a href="demo.php?link1=1">Link 1</a><br> <? if($link1){?> <p> <a href="demo.php?link1=1">Sub Link 1 A</a><br> <a href="demo.php?link1=1">Sub Link 1 B</a><br> <a href="demo.php?link1=1">Sub Link 1 C</a><br> <a href="demo.php?link1=1">Sub Link 1 D</a><br> <a href="demo.php?link1=1">Sub Link 1 E</a><br> <?php}?></p> </td> <td width="638" rowspan="8" valign="top"> <p> </p> <p> </td></tr> <tr><td bgcolor="#c0c0c0" align="right" width="147" height="100"> </td></tr> <tr><td width="147"> <a href="demo.php?link2=1">Link 2</a><br> <? if($link2){?> </td></tr> <tr><td bgcolor="#c0c0c0" align="right" width="147"><a href="demo.php?link2=1">Sub Link 2 A</a><br> <a href="demo.php?link2=1">Sub Link 2 B</a><br> <a href="demo.php?link2=1">Sub Link 2 C</a><br> <a href="demo.php?link2=1">Sub Link 2 D</a><br> <a href="demo.php?link2=1">Sub Link 2 E</a><br> <?php}?> </td></tr> <tr><td width="147"> <a href="demo.php?link3=1">Link 3</a><br> <? if($link3){?> </td></tr> <tr><td bgcolor="#c0c0c0" align="right" width="147"><a href="demo.php?link3=1">Sub Link 3 A</a><br> <a href="demo.php?link3=1">Sub Link 3 B</a><br> <a href="demo.php?link3=1">Sub Link 3 C</a><br> <a href="demo.php?link3=1">Sub Link 3 D</a><br> <a href="demo.php?link3=1">Sub Link 3 E</a><br> <?php}?> </td></tr> <tr><td width="147"> <a href="demo.php?link4=1">Link 4</a><br> <? if($link4){?> </td></tr> <tr><td bgcolor="#c0c0c0" align="right" width="147"><a href="demo.php?link4=1">Sub Link 4 A</a><br> <a href="demo.php?link4=1">Sub Link 4 B</a><br> <a href="demo.php?link4=1">Sub Link 4 C</a><br> <a href="demo.php?link4=1">Sub Link 4 D</a><br> <a href="demo.php?link4=1">Sub Link 4 E</a><br> <?php}?> </td> </tr> </table> </body> </html>
Kyllä mulla ainakin toimi himakoneella. Mulla on register_globals = on. Tuohan ei ilman sitä toimi.
Laita
<? if($_GET['link1']){?>
, niin toimii, jos vika on siinä.
Kiitos, toimii
Aihe on jo aika vanha, joten et voi enää vastata siihen.