Sorry about that....
The variables are comming from a form on a web page. Ive posted the entire script below.
In the place of an actual comment, what is getting submitted to the database is the text: comment_text.
As mentioned, this script works fine with php 4.4.3, but not with php5.
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");
?>