Basic submission of a Form to MySQL
Posted: Fri Mar 31, 2006 9:28 am
feyd | Please use
If I were to change the value of $FixedIDvalue to a number, eg: $FixedIDvalue = 1234; the value is successfully sent to my table, but not the value of the $_GET value.
Any ideas?
Richard.
feyd | Please use
Code: Select all
andCode: Select all
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]
Hi everyone,
I've got some code that submits the variables from a Form to MySQL. It works OK but there is an extra variable that needs to be sent that doesn't submit its data, a variable that was parsed from a refering file.
The variable is stored here: -
"
$FixedIDvalue = $_GET['FixedIDvalue'];
"
And here's the code: -Code: Select all
<?php
IF (!isset($_POST['submit'])) {
?>
<form action="Reviewupdate01.php" method="post">
Your Name: <input type="text" name="Name" size="20">
Your Review: <input type="text" name="Review" size="50">
<input type="submit" name="submit" value="Submit!">
</form>
<?php
}
else
{
$FixedIDvalue = $_GET['FixedIDvalue'];
$Name = $_POST['Name'];
$Review = $_POST['Review'];
mysql_db_query("vinylsur_music", "INSERT INTO `TrackReviews` (Name, Review, FixedID) VALUES ('$Name', '$Review', '$FixedIDvalue')");
}
?>Any ideas?
Richard.
feyd | Please use
Code: Select all
andCode: Select all
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]