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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.