Jump to content

Need help on interpretation


co.ador

Recommended Posts

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();?

Link to comment
https://forums.phpfreaks.com/topic/189426-need-help-on-interpretation/
Share on other sites

<?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?

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.