Hi there,
I am posting this message again sice my previous post
was vague.
I have recently configured a server which runs redhat
7.2. I followed the installation procedures to install
mysql database and PHP on the same server and they
seem to run properly.
My aim is to load data into a mysql database and view
the same data using web page.
Before I implement my own project i stolen the
following code from the web and tried to customize it
on my server. (section of the code customized code is
the following)
------------------------------------------------------
////////////////////////////////
if (($REQUEST_METHOD=='POST')) {
////////////////////////////////
// This loop removed "dangerous" characters from the
posted data
// and puts backslashes in front of characters that
might cause
// problems in the database.
////////////////////////////////
for(reset($HTTP_POST_VARS);
$key=key($HTTP_POST_VARS);
next($HTTP_POST_VARS)) {
$this = addslashes($HTTP_POST_VARS[$key]);
$this = strtr($this, ">", " ");
$this = strtr($this, "<", " ");
$this = strtr($this, "|", " ");
$$key = $this;
}
////////////////////////////////
// This will catch if someone is trying to submit a
blank
// or incomplete form.
////////////////////////////////
if ($name && $email && $message ) {
////////////////////////////////
// This is the meat of the query that updates the
guests table
////////////////////////////////
$query = "INSERT INTO guests ";
$query .= "(guest_id, guest_name, ";
$query .= "guest_email, guest_time, guest_message)
";
$query .=
"values(0000,'$name','$email',NULL,'$message')";
mysql_pconnect("","bereket","iloveumom")
or die("Unable to connect to SQL
server");
mysql_select_db("employee") or die("Unable to
select database");
mysql_query($query) or die("Insert Failed!");
} else {
////////////////////////////////
// If they didn't include all the required fields
set a variable
// and keep going.
////////////////////////////////
$notall = 1;
}
}
-----------------------------------------------------
Result: Everything seems fine. Except when you fill
the form and click submmit, it doesn't update the
database. But if i connect to mysql maually and add
some records, you can automatically see the new data
posted on the web, which is what I wanted.
problem: It is not updating the database from the web
form.
YOUR HELP IS APPRICIATED,
Cheers,
Aron
__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]