![]() |
![]() |
![]() |
|
![]() |
![]() |
BOARDSplanetluc.com discussion boardall about the planetlu.com scripts You are not logged in. AnnouncementI had to clean the boards due to massive spam. Actually i deleted everything /-one after 1st Oct 2008. It was the only way to get this spam out of the boards. So i'm sorry for all serious users who registered/posted meanwhile.
#1 17-08-2008 17:40:43
Checkboxes not returning valuesHi... Offline #3 18-08-2008 17:33:10
Re: Checkboxes not returning values
Code:<item caption="Gender" name="gender" type="checkbox" attr="{Male}{Female}" mandatory="*" error="Please choose your gender" /> Also, I originally uploaded everything with the demo xml intact which used: Code:<item caption="Interests" name="interests1" type="checkbox" attr="{Fishing}{Cars & Bikes|cars}{Music|music/sounds}{Cultures}" mandatory="*" error="Please choose at least one interest" /> <item caption="Interests 2" name="interests2" type="multiselect" attr="{Fishing}{Cars & Bikes|cars}{Music|music/sounds}{Cultures}" mandatory="*" error="Please choose at least one interest 2" /> I also realized that the multiselect isn't returning values either and it uses the same xml that came with the script. I wonder what's wrong? Offline #5 18-08-2008 19:50:16
Re: Checkboxes not returning values
Yeah I noticed that yours works fine. On MY installation I even uncommented the lines so that it would echo the values of all the fields after submitting the form and the checkbox fields and multiselect fields did not return any values. It is very strange. I'm hosting at mosso.com on a "cloud" server. That's why I had to set a global variable for document_root for the form to find the correct path in the first place. Offline #7 18-08-2008 20:48:55
Re: Checkboxes not returning values
The output of that code works as it should. Starting with Array ([nameOfField.. and it shows the value of each field until it gets to the checkbox it outputs this: [gender] => Array ..and then goes on to show the next fields with their values. Offline #9 18-08-2008 21:53:46
Re: Checkboxes not returning valuesOf course this is a fake entry testing the script: Code:Array ( [stateHarvest] => Georgia [dateHarvest] => 8-18-08 [timeHarvest] => 1pm [timeRecovery] => 2pm [name] => Somebody [address] => P.O. Box [cityStateZip] => Somewhere, GA, 301xx [phone] => 404-xxx-xxxx [email]=> jason@xxxxxxxx.com [weapon] => Gun [age] => 28 [gender] => Array [request] => Some words go here. [huntDescription] => More words go in here, but it's limited chars. [hash] => drry [Submit] => Send [do] => send [X-Mapping-caklakng] => 1C961DB03B3E3A19742448693D93B12A [PHPSESSID] => 51241fac1007c5bc5e3ab3caf712b9cb ) All field type are "line" except for "Gender" which is the only checkbox. As you can see it returns a value of "Array" which shows up blank in the email. Offline #10 18-08-2008 22:04:42Re: Checkboxes not returning valuesthis is strange, i don't get it why it doesn't loop through the nested array... Offline #11 18-08-2008 22:45:28
Re: Checkboxes not returning valuesI don't know much about php at all but would have anything to do in these lines of code from formpro.php? Code:// kill ' if magic quotes on if (get_magic_quotes_gpc() == 1){ $_REQUEST[$field[1]] = stripslashes($_REQUEST[$field[1]]); } if ($field[3] == "email"){ $message .= "mailto:".$_REQUEST[$field[1]]; $mail->From = $_REQUEST[$field[1]]; }else if ($field[2] == "checkbox" || $field[2] == "multiselect"){ $multi = ""; foreach ($_REQUEST[$field[1]] as $val){ $divider = ($multi != "") ? ", " : ""; $multi .= (isset($val) && $val != "") ? $divider.$val : ""; } $message .= $multi; }else{ $message .= $_REQUEST[$field[1]]; } } $message .= " "; } $message .= "\n "; I didn't change a thing from the original. Does everything look correct? Offline #12 18-08-2008 22:50:30Re: Checkboxes not returning valuesright! it could be a problem with the stripslashes() func - try to replace lines 200-203 in formpro.php by these lines: Code:// kill ' if magic quotes on if (get_magic_quotes_gpc() == 1 && in_array($field[2], array("checkbox", "multiselect")) === false){ $_REQUEST[$field[1]] = stripslashes($_REQUEST[$field[1]]); } any success? Offline #13 18-08-2008 23:04:00Re: Checkboxes not returning valuesor even better, replace it by: Code:// kill ' if magic quotes on if (get_magic_quotes_gpc() == 1){ if (is_array($_REQUEST[$field[1]])){ $tmp = array(); foreach ($_REQUEST[$field[1]] as $key => $val){ $tmp[$key] = stripslashes($val); } $_REQUEST[$field[1]] = $tmp; }else{ $_REQUEST[$field[1]] = stripslashes($_REQUEST[$field[1]]); } } Offline #14 18-08-2008 23:14:26
Re: Checkboxes not returning values
You're BRILLIANT! Replacing that bit of code worked! Thanks so much for spending the time to help me work this out. I really appreciate it. Offline |
|
![]() |
![]() |
![]() |
|