php-general Digest 4 Nov 2007 04:06:13 -0000 Issue 5108
Topics (messages 264010 through 264019):
Re: Page cannot be displayed error in IE6
264010 by: Nathan Nobbe
$_POST superglobal empty, while readfile("php://input") does return data.
264011 by: Mackatack
264012 by: Nathan Nobbe
264015 by: Mackatack
264018 by: Jim Lucas
Rendering problem (IE browser on windows + php on linux host)
264013 by: Erick Paquin
264014 by: Erick Paquin
Re: Generating HTML table from MySQL table based on some criteria
264016 by: Jim Lucas
Re: mysql_fetch_array
264017 by: Jim Lucas
264019 by: Eduardo Vizcarra
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 ---
On 11/3/07, tanzeem <[EMAIL PROTECTED]> wrote:
>
>
> i have 3 php files pag1.php,page2.php,page3.php
> I posted to page2.php from page1.php
> Then again posted from page2.php to page3.php
> But when i click th back button from page3.php in IE 6.0 it displays
> a page cannot be displayed error.
> When i tried the same with Firefox it displayed the page2.php correctly.
> Can anyone suggest a solution to thsi problem
im surprised you dont get a warning in firefox as well.
when you send a request to the server via HTTP POST,
subsequent retransmission of the same request causes browsers
to generate an warning.
the reason is because HTTP POST is designed for requests that will
alerter, add, or destroy data on the server; typically in a database
these days, whereas a get request is just for viewing a resource.
think of a site where you make a purchase. on the last page of
the checkout process, your sensitive data is posted to the server,
then if you try pressing back the warning is raised by the browser.
this is so your card is not accidentally billed twice, and usually
you will see messages on the page that say dont press back or
dont send this page twice.
so if youre pages constitute a request that inovokes a change
in the data on the server, they are probly fine already. otherwise
switch the request method to get, and youll be able to use the
back button w/o warning.
-nathan
--- End Message ---
--- Begin Message ---
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...
Thanks!
-Mackatack
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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...
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
Sudheer Satyanarayana wrote:
Wolf wrote:
Sudheer,
Post the code you are using and we'll better be able to point you in
the right direction to get your code working.
Thanks Jim Lucas, Wolf and Jay Blanchard for your suggestions. Here is
the code I am using
[code]
print '<table border="1"><tr>';
$result = mysql_query("SELECT * FROM users where status=1 AND picture <>
'' ORDER BY created DESC limit 20");
while ($user_info = mysql_fetch_object($result)) {
$output .= '<td><center><a href="/user/'.$user_info->uid.'">
<img src="http://example.com/'.$user_info->picture.'" height="90"
></a>
<br />' .'<a href="/user/'.$user_info->uid.'">'. $user_info->name
.'</a></center></td>';
}
print $output;
print '</table>';
[/code]
The above code prints the pictures of last twenty users who have
uploaded their pictures. Each picture is printed in an HTML table cell.
The table has only one row.
I want to split the HTML table into 4 rows each containing 5 cells. Each
table cell should contain one user picture. How can I do this?
PS: The DB column names are slightly different than I mentioned in my
previous message.
You forgot your <tr>...</tr> html tags. This will break it up into
different rows
Wolf
---- Sudheer Satyanarayana <[EMAIL PROTECTED]> wrote:
Hello,
I have a MySQL table with four columns - userid, created_date,
username and path_to_picture. path_to_picture column contains the
path to the image files of those users who have uploaded pictures. An
example path stored in path_to_picture column is
picture/username.png. There are some users that don't have their
pictures uploaded. The column contains nothing for these usernames.
I want to generate an HTML table with 20 recent users who have
uploaded their pictures. Each row in the HTML table should contain 5
columns. Thus the HTML table would contain 4 rows.
How can I accomplish this?
I hope I have provided enough information to describe my problem. I
would be glad to provide more details if required.
I tried few permutations and combinations with ORDER BY and LIMIT
clauses to no avail. I have been scratching my head from few hours to
get this to work. Any help would be greatly appreciated.
--
With Warm Regards,
Sudheer. S
http://www.binaryvibes.co.in
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
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 ---
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
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 ---