Hi, im a little bit of a newbie, but i have a question on the below:
I imported my sql tables like this:
CREATE TABLE website123(
id integer NOT NULL AUTO_INCREMENT,
sitetitle VARCHAR(500),
google VARCHAR(500),
keywords VARCHAR(500),
txtcolor VARCHAR(500),
bgdcolor VARCHAR(500),
bgheader VARCHAR(500),
bgleft VARCHAR(500),
bgright VARCHAR(500),
bgfooter VARCHAR(500),
bgmiddle VARCHAR(500),
link VARCHAR(500),
hoverbg VARCHAR(500),
hovertext VARCHAR(500),
inhoud VARCHAR(2000),
link1 VARCHAR(500),
link2 VARCHAR(500),
rechtertekst VARCHAR(2000),
footertext VARCHAR(2000),
PRIMARY KEY(id));
The above variables are based on a former form form, which is working, the form form got linked to the below page, but nothing gets posted in my sql database, and i get no error after the click. The form is set on method=post, and the input tags from the form are included with an id and a name:
<?php
// Connecting to the MySQL server
mysql_connect("localhost", "usernamehidden", "passwordhidden") or
die("Could not connect to database (1): " . mysql_error());
mysql_select_db("database name") or die( "Could not select database" );
// Storing form values into PHP variables
$sitetitle = $_POST["sitetitle"];
$google = $_POST['google'];
$keywords = $_POST["keywords"];
$txtcolor = $_POST["txtcolor"];
$bgdcolor = $_POST["bgdcolor"];
$bgheader = $_POST["bgheader"];
$bgleft = $_POST["bgleft"];
$bgright = $_POST["bgright"];
$bgfooter = $_POST["bgfooter"];
$bgmiddle = $_POST["bgmiddle"];
$link = $_POST["link"];
$hoverbg = $_POST["hoverbg"];
$hovertext = $_POST["hovertext"];
$inhoud = $_POST["inhoud"];
$link1 = $_POST["link1"];
$link2 = $_POST["link2"];
$rechtertekst = $_POST["rechtertekst"];
$footertext = $_POST["footertext"];
// Inserting these values into the MySQL table
// we created above
$query = "insert into website123 (sitetitle, google, keywords, txtcolor, bgdcolor, bgheader, bgleft, bgright, bgfooter, bgmiddle, link, hoverbg, hovertext, inhoud, link1, link2, rechtertekst, footertext) values (’” . $sitetitle . “‘, ‘” . $google . “‘, ‘” . $keywords . “‘, ” . $txtcolor . “, ‘” . $bgdcolor . “‘, ‘” . $bgheader . “‘, ‘” . $bgleft . “‘, ‘” . $bgright . “‘, ‘” . $bgfooter . “‘, ‘” . $bgmiddle . “‘, ‘” . $link . “‘, ‘” . $hoverbg . “‘, ‘” . $hovertext . “‘, ‘” . $inhoud . “‘, ‘” . $link1 . “‘, ‘” . $link2 . “‘, ‘” . $rechtertekst . “‘, ‘” . $footertext . “‘)";
$result = mysql_query($query);
echo 'Thank you for submitting your details!';
?>
Can someone help me i am clueless, and want to prevent that i destory the script by making small adjustments until i find the problem (which happend to me a few times allready) ;-)
gr Maarten