Go Back   I-Mockery Forum > I-Mockery Miscellaneous Forums > Questions, Suggestions, and Tech Support
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #14  
Chojin Chojin is offline
was never good
Chojin's Avatar
Join Date: Apr 1999
Chojin won the popularity contestChojin won the popularity contestChojin won the popularity contestChojin won the popularity contestChojin won the popularity contestChojin won the popularity contestChojin won the popularity contestChojin won the popularity contestChojin won the popularity contest
Old Jan 20th, 2007, 04:06 PM       
Okay I'm starting to get a better hang of PHP and MySQL.

I now have a lil form that I made where I fill out information:



And it outputs to an archive file:



Most of these don't have 'description' information, so that's why that's missing. But the error there is from when I try to output the 'Favorite' information. On the input form, the favorite is defined like so:

Code:
<label for="favorite">Favorite Kitty?</label></td><td><input type="checkbox" value="favorite" name="favorite[]" id="favorite" />
and previous to that in the same file, (excerpted)

Code:
$favorite = htmlspecialchars(strip_tags($_POST['favorite']));
...
$sql = "INSERT INTO wiikitty_archive (timestamp,catname,location,catfilename,favorite,description) VALUES ('$timestamp','$catname','$location','$catfilename','$favorite','$description')";
and finally in the result file:

Code:
<?php foreach ($favorite as $f) {echo $f;} ?>
and that produces the above error. When I change that last bit of code to:

Code:
<?php echo $favorite; ?>
then I get this:



Where it just says 'Array' on the favorited WiiKitties. ("First submitted WiiKitty" is the description info)

So, how do I make it show the checkbox information?

Also, due to an oversight on my part, it wasn't adding the favorite information until that cat in the upper left. How would I go into the database manually to add that? Or to fix anything, really? I have phpMyadmin.
Reply With Quote
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

   


All times are GMT -4. The time now is 12:36 AM.


© 2008 I-Mockery.com
Powered by: vBulletin
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.