php-general Digest 4 Nov 2007 16:46:55 -0000 Issue 5109

Topics (messages 264020 through 264024):

Re: Rendering problem (IE browser on windows + php on linux host)
        264020 by: David Christopher Zentgraf

Re: mysql_fetch_array
        264021 by: Jim Lucas
        264024 by: heavyccasey.gmail.com

Re: $_POST superglobal empty, while readfile("php://input")does return data.
        264022 by: Mackatack
        264023 by: Nathan Nobbe

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- What about comparing the pure HTML output of both servers _including headers_, for example with curl?

On 3 Nov 2007, at 23:46, Erick Paquin wrote:

Hi All,

If someone has seen this before it would greatly help me.

I have done a php site at work on my windows server. The site renders
perfectly in both Firefox & IE.

Transferred my site to my home server which is a ubuntu server.

Site renders perfect in Firefox but goes wacky in IE.

Thought this might be an apache/php config problem on my ubuntu server
so I tried to compare both my php.ini + apache config file and nothing
works so far.

Any Ideas?

Erick P.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Eduardo Vizcarra wrote:
Hi guys

After doing some changes, I believe it is partially working, what I did is the following:
  while($row=mysql_fetch_array($fotos))
  {
   $fotos_mostrar[] = $row;
  }
$primer_foto = reset($fotos_mostrar[0]); // This is to set the pointer to the first record
echo $primer_foto; // This displays the first column when doing a SELECT


if you notice you are referring to an index in your array.

You should be doing the reset on $fotos_mostrar like this

reset($fotos_mostrar);

var_dump($fotos_mostrar);

This will display the entire dataset.

also, if you read the first line just above the first example of use, you will notice that it says that reset will return the first array element or false.

The reason that you are getting the first column is because in your reset call, you are referencing the first index entry in your array.

This would return you the first index of the first index in your array.

NO, I did not just repeat myself. re-read what I wrote and think it through and it will make perfect sense.

So, try what I showed you at the beginning of my comments and you will see the results you are wanting.

However, my SELECT statement retrieves 2 columns from one table, how do I display the second column ?

Thanks
Eduardo

"Jim Lucas" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED]
Eduardo Vizcarra wrote:
I have a WHILE sentence to retrieve all records from a SELECT query in a database and am using mysql_fetch_array to store them in a matrix, the sentence is like this:
  while($row=mysql_fetch_array($fotos))
  {
   $fotos_mostrar[] = $row;
  }

$fotos contains all records found in a db table, the SELECT statement is retrieving 2 columns from a table, how do I store all records in a 2 dimention table so I can use it later ?

this WHILE sentence seems to only store the last record only

Regards
how are you checking to see the contents of the $fotos_mostrar array() ?

just after the while loop ends, do a var_dump() or print_r() on the array and view the contents.


--- End Message ---
--- Begin Message ---
Do you even need reset()? I've never used it.

On Nov 3, 2007 11:08 PM, Jim Lucas <[EMAIL PROTECTED]> wrote:
> Eduardo Vizcarra wrote:
> > Hi guys
> >
> > After doing some changes, I believe it is partially working, what I did is
> > the following:
> >   while($row=mysql_fetch_array($fotos))
> >   {
> >    $fotos_mostrar[] = $row;
> >   }
> >   $primer_foto = reset($fotos_mostrar[0]); // This is to set the pointer to
> > the first record
> > echo $primer_foto; // This displays the first column when doing a SELECT
> >
>
> if you notice you are referring to an index in your array.
>
> You should be doing the reset on $fotos_mostrar like this
>
> reset($fotos_mostrar);
>
> var_dump($fotos_mostrar);
>
> This will display the entire dataset.
>
> also, if you read the first line just above the first example of use,
> you will notice that it says that reset will return the first array
> element or false.
>
> The reason that you are getting the first column is because in your
> reset call, you are referencing the first index entry in your array.
>
> This would return you the first index of the first index in your array.
>
> NO, I did not just repeat myself.  re-read what I wrote and think it
> through and it will make perfect sense.
>
> So, try what I showed you at the beginning of my comments and you will
> see the results you are wanting.
>
>
> > However, my SELECT statement retrieves 2 columns from one table, how do I
> > display the second column ?
> >
> > Thanks
> > Eduardo
> >
> > "Jim Lucas" <[EMAIL PROTECTED]> escribió en el mensaje
> > news:[EMAIL PROTECTED]
> >> Eduardo Vizcarra wrote:
> >>> I have a WHILE sentence to retrieve all records from a SELECT query in a
> >>> database and am using mysql_fetch_array to store them in a matrix, the
> >>> sentence is like this:
> >>>   while($row=mysql_fetch_array($fotos))
> >>>   {
> >>>    $fotos_mostrar[] = $row;
> >>>   }
> >>>
> >>> $fotos contains all records found in a db table, the SELECT statement is
> >>> retrieving 2 columns from a table, how do I store all records in a 2
> >>> dimention table so I can use it later ?
> >>>
> >>> this WHILE sentence seems to only store the last record only
> >>>
> >>> Regards
> >> how are you checking to see the contents of the $fotos_mostrar array() ?
> >>
> >> just after the while loop ends, do a var_dump() or print_r() on the array
> >> and view the contents.
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Jim Lucas schreef:
Mackatack wrote:
Nathan Nobbe schreef:
On 11/3/07, Mackatack <[EMAIL PROTECTED]> wrote:
Hey all!

Im trying to submit a very basic form to phpinfo():

<form action='?' method='POST'>
        <input type='hidden' name='foo' value='bar' />
        <input type='submit' />
</form>
<?php
        error_reporting(E_ALL);
        echo 'var_dump: ';
        var_dump($_POST);
        echo '<br>readfile: ';
        readfile("php://input")

        phpinfo();
?>

When i use the button to submit the form and it loads the new page I get:

var_dump: array(0) { }
readfile: foo=bar

I would expect the $_POST var to be filled cause the readfile does work.
Also, get requests, cookies and sessions do work... all cept for the
POST data. I couldn't find any errors in the apache error_log.

I think it's not browser related because I tested it another server and
it did work using FF and IE7.

Im using PHP Version 5.2.4_p20070914-pl2-gentoo, with suhosin and the
ZendOptimizer on Linux AMD64. I've also set the max_post and max_upload
to 1024M for testing... Nothing works... :(

Does anyone have a direction for me? Been using php for years but have
never seen anything like this...


is this a new box?
have you tried w/o suhosin and / or zend optimizer?
did the other box you tested on have suhosin?

-nathan


Yes, this is a new box, but i did try without suhosin and the ZendOptimizer. No dice.

-Mackatack

What about checking to see if Apache has the the POST option disabled.

Make sure the apache is allowing posts to the domain/directory/file/etc...

I have not defined any <limit> tags in my httpd.conf and by default apache should accept all request methods. I've stripped my apache config down to:

Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
        ServerName my.server.com
        DocumentRoot "/var/www/
        <Directory "/var/www/">
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

Also, im guessing it's not apache related because the readfile() function does return the form data. Any other thoughts?

-Mackatack

--- End Message ---
--- Begin Message ---
On 11/4/07, Mackatack <[EMAIL PROTECTED]> wrote:
>
> I have not defined any <limit> tags in my httpd.conf and by default
> apache should accept all request methods. I've stripped my apache config
> down to:
>
> Listen 80
> NameVirtualHost *:80
> <VirtualHost *:80>
>          ServerName my.server.com
>          DocumentRoot "/var/www/
>          <Directory "/var/www/">
>                  AllowOverride All
>                  Order allow,deny
>                  Allow from all
>          </Directory>
> </VirtualHost>
>
> Also, im guessing it's not apache related because the readfile()
> function does return the form data. Any other thoughts?
>

what happens when you change the request method to get?

also, just curious, when you disable zend optimizer and suhosin,
how exactly are you doing that?  my feeling is that you may have
to unmerge them and completely recompile php.

have you looked in the php error logs?
i would enable NOTICE and STRICT for testing,
error_reporting  =  E_ALL | E_STRICT
perhaps something will turn up there.

have you hopped on the irc channel for gentoo-php?
irc://irc.freenode.net/gentoo-php
it takes a while to get a response sometimes, but this group knows
the most about php on gentoo.

-nathan

--- End Message ---

Reply via email to