wont insert data into sql database
Posted: Mon Sep 04, 2006 9:57 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
om im working on a clients site and this script works perfectly fine on my webserver, but on his webserver. it will not add none of the data to the database. I receive no errors. any suggestions?Code: Select all
<?php
if ( strlen($_POST['site_name']) > 0
&& strlen($_POST['site_url']) > 0
&& strlen($_POST['email']) > 0 )
{
$site_name = strip_tags($_POST['site_name']);
$site_name = htmlspecialchars($site_name);
$site_url = strip_tags($_POST['site_url']);
$site_url = htmlspecialchars($site_url);
$email = strip_tags($_POST['email']);
$email = htmlspecialchars($email);
require_once 'sql_config.php';
mysql_query ("INSERT INTO Sites(site_name, site_url, email ) VALUES ('$site_name', '$site_url','$email')") or die(mysql_error());
$result = mysql_query( "SELECT * FROM Sites WHERE site_url='$site_url'" );//
$row=mysql_fetch_array($result); //Store Record Of Data in $row
$message = "You must link our site with the following http://www.styleikon.com/?id=" . $row['id'];
echo $message;
$from1="From: info@styleikon.com\r\nX-Priority: 1 (Highest)";
mail ($email,$from1, $message) or print "Could not send mail";
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]