jkjelle Posted November 18, 2009 Share Posted November 18, 2009 Hi, When I use a $_GET function my lay-out is gone. It seems like it doens't use default.css anymore. Can anybody help me with this problem? This is the URL: http://www.amejjaou.com/informatica/dvdonline/zoektest.php/?name=The%20Shawshank%20Redemption <?php include('config.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>DVD-ONLINE</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="default.css" rel="stylesheet" type="text/css" /> </head> <div id="menu"> <ul> <li class="first"><a href="index.php" title="">Home</a></li> <li class="first"><a href="overzicht.php" title="">Overzicht</a></li> <li class="first"><a href="zoeken.php" title="">Zoeken</a></li> <li class="first"><a href="gastenboek.php" title="">Gastenboek</a></li> <li class="first"><a href="gegevens.php" title="">Mijn gegevens</a></li> <li class="first"><a href="afmelden.php" title="">Afmelden</a></li> </ul> </div> <?php mysql_connect("localhost", "danad", "noureddine") or die(mysql_error()); mysql_select_db("inlog") or die(mysql_error()); $x=$_GET["name"]; $data = mysql_query("SELECT * FROM info where titel='$x' ") or die(mysql_error()); Print "<table border=0 cellpadding=5>"; while($info = mysql_fetch_array( $data )) { Print "<tr>"; Print " <td><h2>".$info['titel'] . "</h2></td> "; Print "<tr>"; Print " <td>".$info['afbeelding'] . "</td> "; Print "<tr>"; Print "<tr>"; Print " <td><h4>genre: </h4>" .$info['genre'] . "</td>"; Print "<tr>"; Print "<tr>"; Print " <td><h4>Jaartal: </h4>" .$info['jaar'] . "</td>"; Print "<tr>"; Print "<tr>"; Print " <td><h4>Trailer:</h4>".$info['trailer'] . "</td> "; Print "<tr>"; Print "<tr>"; Print "<td><h4> Tijdsduur: </h4>".$info['tijd'] . "</td> "; Print "<tr>"; Print "<tr>"; Print "<td><h4>Samenvatting</h4>".$info['informatie'] . "</td> "; setcookie("titel", $info['titel'], time() + 60*60); Print "</table>"; } ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
KevinM1 Posted November 18, 2009 Share Posted November 18, 2009 Hi, When I use a $_GET function my lay-out is gone. It seems like it doens't use default.css anymore. Can anybody help me with this problem? Rule #1 of PHP Freaks: Don't talk about PHP Freaks. Rule #2 of PHP Freaks: Show your code. Quote Link to comment Share on other sites More sharing options...
JustLikeIcarus Posted November 18, 2009 Share Posted November 18, 2009 Your going to need to provide your code. It sounds like there is something in the php logic thats causing your issues. $_GET itself wouldnt cause this issue. Quote Link to comment Share on other sites More sharing options...
KevinM1 Posted November 18, 2009 Share Posted November 18, 2009 Never put your real db credentials in a post. Beyond that, a couple of things: 1. You're not forming your URL correctly. It should look like: http://www.amejjaou.com/informatica/dvdonline/zoektest.php?name=The%20Shawshank%20Redemption - note that there ISN'T a '/' after '.php'. 2. You can't assume that your script will be getting data passed into it via GET, nor can you assume that data will be safe or legit. You need to filter it. if(isset($_GET['name'])) { //test to see if the data is valid. If so, access the db } else { //no value sent } 3. You don't have an opening <body> tag. 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.