Hi all,
Im reposting this question to the database forum as I think it may be a more appropriate place for it. . .
Im having some trouble with the following code. It seems to work fine with php4 but not php5. When the code runs on php5, instead of the values of the variables getting stored in the database, Im getting the variable name stored instead. Can anyone tell me what's going on? Also I should point out that the system that ran the code fine was winxp, apache2x, php4.4.3 and mysql versions 4.1 and 5. The system im having trouble getting it to work on is a fedora core 4 server, apache 2x, php5 and mysql ver4.1.
Thanks
Jeremy
<?php
// include the configuration script
include("../admin/config.php");
// connect to the database
include("connection.php");
// $comment_id = $_REQUEST['comment_id']; // not used
$comment_name = $_REQUEST['comment_name'];
$comment_email = $_REQUEST['comment_email'];
$comment_url = $_REQUEST['comment_url'];
// $comment_date = $_REQUEST['comment_date']; // not used
$comment_related_entry = $_REQUEST['comment_related_entry'];
$comment_text = $_REQUEST['comment_text'];
$serv_remote = $_SERVER['REMOTE_ADDR'];
$comment_ip_address = gethostbyaddr($serv_remote);
$comment_hostname = gethostbyname($serv_remote);
$query = "
INSERT INTO
blog_comments
(
comment_date,
comment_name,
comment_email,
comment_url,
comment_text,
comment_related_entry
)
values
(
NOW(),
'$comment_name',
'$comment_email',
'$comment_url',
'$comment_text',
'$comment_related_entry'
)";
//run the query
mysql_query($query, $link) or die (mysql_error());
//close the sql connection.
mysql_close($link);
//redirect back to control panel
header("location: ../detail.php?id=$comment_related_entry");
?>