| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Feb 2005
Posts: 578
![]() ![]() ![]() | help with serialize & unserialize Please help me to find error and fix this php file. I'm a php newbie. This is a php file allowed me to edit the database. I was able to pull it form the database, but when I submit it... the clues field got empty.. I know there's something wrong with the code, but dont know how to fix it... :'( Please help .. Thanks PHP Code: PHP Code:
__________________ Freebies and Giveaways - Printable Coupons - Hot Deals - Coupons - Deal of the Day
Last edited by abcde; 11-13-2009 at 05:24 AM.
|
| | |
| | #2 (permalink) |
| NamePros Regular Join Date: Jan 2008
Posts: 209
![]() ![]() | At first glance you have 5 fields with the name clues maybe rename each one and repost the values When your doing $_POST you are posting the name="clued" so it's trying to post all 5 even though the values are different. You may need to do a foreach or just rename them clue1, clue2 etc |
| | |
| | #3 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,963
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | In PHP, if you have an array of fields you need to add brackets like this: <input type="text" name="clues[]">
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| | |
| | #4 (permalink) |
| NamePros Member Join Date: Dec 2008
Posts: 60
![]() | Hi abcde, if (!isset($_POST["submit"])) then $id = $_REQUEST["id"] will be empty, so $result will be empty too, so you can not have value of the clues , that is why the clues field got empty when you try to submit.
__________________ Professional PHP website services: http://install-php-scripts.com
Last edited by foryounow; 01-28-2010 at 06:45 AM.
|
| | |