i need to get the value of the id from 1 page called image.php a insert it in to the database from another page submitComment.p hp
this is my code....
image.php....
submitComment.p hp....
everything works fine except i get this error...
Undefined variable: photoId in C:\wamp\www\fot ostor\submitCom ment.php on line 39
and the photoId in the database displays 0, i cant merge the pages togetherso it recognises the image.php's $_GET['id']; so i was wondering if i could get the value of it and transfer it some how, please help
this is my code....
image.php....
Code:
$photoId = mysql_escape_string($_GET['id']); $q = "SELECT * FROM comments WHERE photoId = '" . $photoId . "' ORDER BY date DESC LIMIT 5";
Code:
$theMessage = addslashes(strip_tags($_POST['message'])); $q = "INSERT INTO comments (photoId, date, content) VALUES ('" . $photoId . "', '" . $theDate . "', '" . $theMessage . "')"; $result = $mysqli->query($q) or die ('error could not insert into comments' . mysql_error());
Undefined variable: photoId in C:\wamp\www\fot ostor\submitCom ment.php on line 39
and the photoId in the database displays 0, i cant merge the pages togetherso it recognises the image.php's $_GET['id']; so i was wondering if i could get the value of it and transfer it some how, please help
Comment