co.ador Posted January 22, 2010 Share Posted January 22, 2010 Ok. Now, I want you to right click view html source and take a close look at the output of var dump. You need to look at the formatting and how it is indented. When an array element contains another array, the level of indentation is increased. Actually, use print_r() to see this. It's more blatant. You have yet again, changed stuff without telling anyone. You changed the name attributes in your html. I know that you've been advised in the past to use E_ALL error_reporting when developing. Your problem would have been obvious to you. The answer to that quote is [code<?php ]<div id="tresuno">Array ( [frmSearch] => Array ( [name] => [zipcode] => [state] => [food_types] => Array ( [0] => ) [submit] => Submit ) )?>[/code] you mean this? <div id="tresuno">Array the > and the Array are together that will definitly affect the output right? PS: what does the first quote means when he says about the indenting? does that has any effect on the code or he is refering to the way of how to read a var_dump();? Quote Link to comment https://forums.phpfreaks.com/topic/189426-need-help-on-interpretation/ Share on other sites More sharing options...
oni-kun Posted January 22, 2010 Share Posted January 22, 2010 <?php <div id="tresuno">Array ( [frmSearch] => Array ( [name] => [zipcode] => [state] => [food_types] => Array ( [0] => ) [submit] => Submit ) )?> Quoted for readability. Now what on earth are you talking about? It looks like your talking to yourself, or maybe it's me, it is 6am. EDIT2: <?php <div id="tresuno">Array ( Isn't it obvious? You have HTML within the PHP (if that is what you were running.) Although PHP wouldn't show that. What WAS your actual code? Quote Link to comment https://forums.phpfreaks.com/topic/189426-need-help-on-interpretation/#findComment-999877 Share on other sites More sharing options...
co.ador Posted January 22, 2010 Author Share Posted January 22, 2010 Lol Not the first quote is someone else opinion and the rest is me. the code is <?php ]if ( trim($_POST['name']) == '' & $_POST['zipcode'] =='' & $_POST['state'] =='' & $_POST['frmSearch']['food_types'][0]=='' & $_POST['frmSearch']['offerings'][0]=='') //$strZipCode == '' && $strState == '' $arrFoodTypes =='' && $arrOfferings == '') { echo '<div id="tresuno">'; var_dump($_POST); echo'<p class="tremendi">No results for your match please try again!</p> <div id="tresdo"> <a href="index3.php"><< Go Back</a> </div>';?> Now I was missing the & operaror in the if statement plus the attribute names in the form were different from the one in the if statement that fixed it. Quote Link to comment https://forums.phpfreaks.com/topic/189426-need-help-on-interpretation/#findComment-999902 Share on other sites More sharing options...
oni-kun Posted January 22, 2010 Share Posted January 22, 2010 Was gonna point that out. Good job. Boolean operators are annoying sometimes. Quote Link to comment https://forums.phpfreaks.com/topic/189426-need-help-on-interpretation/#findComment-999921 Share on other sites More sharing options...
co.ador Posted January 22, 2010 Author Share Posted January 22, 2010 the logical double operator was making real difficult for php to interpret it. i don't understand but certainly there is a difference in between both. Quote Link to comment https://forums.phpfreaks.com/topic/189426-need-help-on-interpretation/#findComment-999945 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.