only1perky Posted November 11, 2007 Share Posted November 11, 2007 Hi, I hope you guys can help me as I've ground to a halt and am getting so annoyed now. What I have is a form that will be completed by the user containing basic details like email and tel. Now on this form the user has to select what type of account they wish to set up (basic, Promotional, Premium, Platinum and Professional) Now depending which account type is selected a category box allows a certain number of selections (Just 1 for Basic, Promotional and Premium and a selection of 3 for Platinum and Professional accounts) I currently have this form set up working fine. This is where i need help- once the form is submitted the details are displayed on a page named details_sent.php, if the user selected the basic account types the form works fine, however the accounts with multiple selections simply display "ARRAY" instead of the selection. Here is the code displaying the results in the <head>: GetSQLValueString($HTTP_POST_VARS['business'], "text"), GetSQLValueString($HTTP_POST_VARS['contact'], "text"), GetSQLValueString($HTTP_POST_VARS['utype'], "text"), GetSQLValueString($HTTP_POST_VARS['address1'], "text"), GetSQLValueString($HTTP_POST_VARS['address2'], "text"), GetSQLValueString($HTTP_POST_VARS['address3'], "text"), GetSQLValueString($HTTP_POST_VARS['city'], "text"), GetSQLValueString($HTTP_POST_VARS['county'], "text"), GetSQLValueString($HTTP_POST_VARS['postcode'], "text"), GetSQLValueString($HTTP_POST_VARS['region'], "text"), GetSQLValueString($HTTP_POST_VARS['telephone'], "text"), GetSQLValueString($HTTP_POST_VARS['fax'], "text"), GetSQLValueString($HTTP_POST_VARS['email'], "text"), GetSQLValueString($HTTP_POST_VARS['password'], "text"), GetSQLValueString($HTTP_POST_VARS['url'], "text"), GetSQLValueString($craft, "text"), GetSQLValueString($HTTP_POST_VARS['description'], "text"), GetSQLValueString($HTTP_POST_VARS['ename'], "text"), GetSQLValueString($HTTP_POST_VARS['eaddr'], "text"), GetSQLValueString($HTTP_POST_VARS['commision'], "text"), GetSQLValueString(isset($HTTP_POST_VARS['creditcard'])? "true" : "", "defined", "1", "0"), GetSQLValueString(isset($HTTP_POST_VARS['delivery'])? "true" : "", "defined","1","0"), GetSQLValueString(isset($HTTP_POST_VARS['gallery'])? "true" : "", "defined","1","0"), GetSQLValueString(isset($HTTP_POST_VARS['ecommerce'])? "true" : "", "defined","1","0"), GetSQLValueString(isset($HTTP_POST_VARS['traning'])? "true" : "", "defined", "1", "0"), GetSQLValueString($HTTP_POST_VARS['found'], "text"), "NOW()"); The line is question is: GetSQLValueString($craft, "text"), which will display the single selection but not the multiple ones. And here is the code in the <body>: <?php foreach($HTTP_POST_VARS as $key => $value){ if (!strstr($key,'hidden') &&!strstr($key,'submit') &&!strstr($key, 'MAX_FILE_SIZE') &&!strstr($value, 'NULL') &&!empty($value)){ ?> <tr> <td><div align="right" class="darktitle"><?php echo $key?>:</div></td> <td><strong><?php echo stripslashes($value)?></strong></td> </tr> <?php }}?> <?php if(!empty($_FILES['imagefilename']['name'])){?> <tr> <td class="darktitle"><div align="right">image uploaded:</div></td> <td><strong><?php echo stripslashes($_FILES['imagefilename']['name'])?></strong></td> </tr> <?php }?> Any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted November 11, 2007 Share Posted November 11, 2007 Well, GetSQLValueString() is a user defined function. I've no idea what it does. However, the problem would seem to be that it is expecting a string, but you are passing an array to it. Since you are selecting multiple things (from a drop down box i assume?) it is an array. Its a bit difficult to give help. I've no idea what your code does/is supposed to do. Quote Link to comment Share on other sites More sharing options...
jordanwb Posted November 12, 2007 Share Posted November 12, 2007 If you want to view the contents of an array quickly use: <pre> <?php print_r ($array); ?> </pre> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.