Quote (carteblanche @ 30 Aug 2012 18:13)
kinda hard to help if you dont tell us what your problem is. post your code.
I am supposed to explain what is wrong with a sentence and a bit of code and I can't for the love of god figure it out... to me it all seems okay.
The sentence is:
".... meanwhile we sent the values from "N" and "T" to display.php. We did this with:
header ("location: display.php")"
This is supposed to be wrong.
Here is the code from make.php
"<?PHP
$n = $_GET['Namn'];
$t = $_GET['Meddelande'];
$sql ="INSERT INTO gästbok(Namn, Meddelande) VALUES('".$n."','".$t."')";
$db = mysql_connect("localhost", "root");
mysql_select_db("p14");
mysql_query($sql);
header ("location: display.php");
ECHO $sql;
?>
"
and here is display.php
"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" type="text/css"
<TITLE>Train Track</TITLE>
</HEAD>
<BODY>
<?PHP
$db = mysql_connect("localhost", "root");
mysql_select_db("p14");
$sql = "SELECT * FROM gästbok ORDER BY id DESC";
$resultSet = mysql_query($sql);
$numberOfRows = mysql_num_rows($resultSet);
for ($i = 0; $i < $numberOfRows; $i++)
{
$row = mysql_fetch_array($resultSet);
$n = $row["Namn"];
$t = $row["Meddelande"];
ECHO $n." ".$t."<br />" ;
}
?>
"
</BODY>
</HTML>
"
_____________________________________________
I have so far changed to sentence to:
"The data is gathered from the database in make.php and then transfered to display.php. We did this by executing:
mysql_select_db("p14");
mysql_query($sql);
header ("location: display.php");
"
is this wrong?