Posted: Sun Mar 19, 2006 11:43 pm
Your on the right track. It looks like your form is returning a multidimensional array. Try removing the [] from the entries field in the form and test it again.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
if(isset($_POST['submit'])) {
$Entries = $_POST['entries'];
$Count = count($Entries);
while ($Count >= 0) {
$Count--;
echo $Entries[$Count];
}
$story=$_POST['story'];
//Inset everything into the database
$compentry=mysql_query("INSERT INTO tblCompetitionSubmissions (compUserID, compStory, compEntries, compEntryDate) VALUES ('$userid', '$story', '$comps', NOW())");
//Check whether or not the inset worked:
if($compentry) {
//If it worked, echo a success
echo "<div class=\"information\"><h4>Success!</h4><p>Thankyou, your submission has been received. We will let you know if you win!</p></div>";
} else {
//If it failed, show the error:
echo "<div class=\"phpoutput\"><h4>Error</h4><p>Sorry, your submission could not be sent at this time. Please try again later, or <a href=\"mailto:online@reakt.com.au\">email Chris</a> to report your problems.</p></div>";
}
}