tml Posted October 17, 2008 Share Posted October 17, 2008 my problem is, i cant put my div into my script without break it and then rest wont work... <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>vores hjemmeside</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div id="side"> <div id="hoved"><img src="billed/banner.jpg"> </div> <div id="links"> <center> <a href="index.php">Forside</a> <a href="index.php?side=os">os</a> <a href="index.php?side=kira">kira</a> <a href="index.php?side=billeder">billeder</a> </center> </div> <div id="indhold"> <?php if ($_GET['side'] == os) { echo "os"; //indhold af side 1 } elseif ($_GET['side'] == kira) { //indhold af side 2 } elseif ($_GET['side'] == billeder) { // here are the problem when i try inset this div <div id="billedmenu"> <a href="index.php?side=kira">kira</a> </div> <div id="billedindhold" class="clear"> mysql_connect("localhost", "xx", "xx") or die(mysql_error()); mysql_select_db("xx") or die(mysql_error()); $query = mysql_query("SELECT * FROM billed ORDER BY id DESC"); while($row = mysql_fetch_assoc($query)) { echo "<a href='{$row["sti"]}'><img src='{$row["lille"]}' class='foto' border='0' /></a>"; } </div> } else echo "hej"; //forside ?> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
Jibberish Posted October 17, 2008 Share Posted October 17, 2008 echo the divs out. or just end your code with ?> before the div and start it again <?php after it Quote Link to comment Share on other sites More sharing options...
rhodesa Posted October 17, 2008 Share Posted October 17, 2008 echo the divs out. or just end your code with ?> before the div and start it again <?php after it <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>vores hjemmeside</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div id="side"> <div id="hoved"><img src="billed/banner.jpg"> </div> <div id="links"> <center> <a href="index.php">Forside</a> <a href="index.php?side=os">os</a> <a href="index.php?side=kira">kira</a> <a href="index.php?side=billeder">billeder</a> </center> </div> <div id="indhold"> <?php if ($_GET['side'] == os) { echo "os"; //indhold af side 1 } elseif ($_GET['side'] == kira) { //indhold af side 2 } elseif ($_GET['side'] == billeder) { //If you have several lines, it's usually easier to pause/resume PHP ?> <div id="billedmenu"> <a href="index.php?side=kira">kira</a> </div> <div id="billedindhold" class="clear"> <?php mysql_connect("localhost", "xx", "xx") or die(mysql_error()); mysql_select_db("xx") or die(mysql_error()); $query = mysql_query("SELECT * FROM billed ORDER BY id DESC"); while($row = mysql_fetch_assoc($query)) { echo "<a href='{$row["sti"]}'><img src='{$row["lille"]}' class='foto' border='0' /></a>"; } //For one line, just use echo echo '</div>'; } else echo "hej"; //forside ?> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.