php-windows Digest 29 Apr 2005 03:03:30 -0000 Issue 2651
Topics (messages 25930 through 25934):
Re: echo delayed?
25930 by: Wu, Jin Yong
Re: Newcomer
25931 by: michael
25932 by: Jason Barnett
Page Not Found after sending form through POST method, Get Method works
25933 by: mickbw
Combinig 2 Variables into 1
25934 by: Maxwell Brodie
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 ---
It seems that PHP has his own output buffer by default.
If you want to flush output immediately, you should use flush();
http://us3.php.net/manual/en/function.flush.php
Attention: you should use ob_end_flush() before flush() at first.
ob_implicit_flush() will be also all right.
http://us3.php.net/manual/en/function.ob-implicit-flush.php
Read carefully,especially the comments.
Regards,
Yong
-----Original Message-----
From: Irvin Piraman [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 28, 2005 14:57 PM
To: [email protected]
Subject: [PHP-WIN] echo delayed?
Hi all!
I have the following script:
# date/time stamp
$dt_stamp = date("Ymd.H.i.s");
# the directories
$basedir = str_replace("/","\\",dirname($_SERVER['SCRIPT_FILENAME']));
$shotdir = $basedir."\\sat.shots\\";
echo "downloading satellite snapshots...";
# load the images
$satloc = file_get_contents($basedir."\satloc.txt");
$images = explode("\n",$satloc);
for ( $i=0; $i <= count($images); $i++ )
{
$i_name = trim(basename($images[$i]));
$i_type = trim(strtolower(substr($i_name, -3)));
switch ($i_type) {
case "jpg" :
$img = loadjpeg(trim($images[$i]));
imagejpeg($img,$shotdir.$dt_stamp."-".$i_name);
break;
case "gif" :
$img = loadgif(trim($images[$i]));
imagegif($img,$shotdir.$dt_stamp."-".$i_name);
break;
}
}
echo " done.";
The script above works perfectly, well almost...
The problem is that when I run it, I don't see the message "downloading
satellite snapshots..." that I expect
to show on the browser before the images are acquired. Instead I get
"downloading satellite snapshots... done."
after the script finish execution.
Is this echo delay normal?
TIA
--
Irvin
--- End Message ---
--- Begin Message ---
Jason, I think your last answer is misleading, PHP does not by default
produce markup unless you choose to output or produce markup with PHP. You
can use PHP to return raw data, manipulate data in a data store etc. etc.
without producing any markup at all. Infact it is not good web development
practice to have PHP produce / generate much or any markup at all (unless
you are working on a small website that will not change much).
O'Reilly.com has some excellent tutorials, again Zend also has some great
beginner and advanced tutorials.
Jason Barnett writes:
Barry Fawthrop wrote:
Hi All
As a newcomer to the list and PHP, I was wondering:
I have been programming for 8 years now, in C and mostly in Delphi /
Pascal.
I am used to the C constraint and syntax, which it appears that PHP
follows.
Pretty much. There are very, very few cases where C function !== PHP
function. Oh, and all PHP variables are structs with multiple
"equivalent" properties for string, float, etc.
1) Are there any good tutorials, that will take a programmer (like
myself) and
expose them to the PHP specifics? So far I have come across PHP tutorials
but for novices who don't know programming.
php.net manual is the best way to go. Zend.com has some advanced
tutorials (and they pretty much support PHP as well). Either that or ask
your question here on the list.
2) I have developed many ISAPI apps using Delphi, which are web based
apps
How secure is your code when a .php file is called via a web browser? Can
visitors see your code or is it all hidden for them and they just see the
HTML
results?
<?php
/** Code that is in between here is not usually visible to web browsers.
Rather this is used to generate HTML markup, or XML, or whatever. The
exception to this is if your server is configured to show the source with
(for example) .phps files, but by default .php files produce markup only.
*/
phpinfo();
/** The above command will dump your system information */
?>
Thanks in advance
Barry
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Please do not CC me, just write to the list. I will usually see responses.
Michael wrote:
Jason, I think your last answer is misleading, PHP does not by default
produce markup unless you choose to output or produce markup with PHP.
You can use PHP to return raw data, manipulate data in a data store etc.
etc. without producing any markup at all. Infact it is not good web
Very true.
development practice to have PHP produce / generate much or any markup
at all (unless you are working on a small website that will not change
much).
Not quite sure I agree with this statement though; perhaps you can
explain better what you mean. There are a lot of times that I use PHP
to filter out HTML markup so that I can make sure some fool hasn't
managed to stick some evil Javascript in to my database. Or I use PHP
to generate an XML tree for <insert many good reasons here>.
--- End Message ---
--- Begin Message ---
To illustrate the problem I'm having, I created a very simple form
called TestForm.php .
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test Form</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table>
<tr><td>Name</td><td><input type="text" name="name0"/></td></tr>
<tr><td>Age</td><td><input type="text" name="age0"/></td></tr>
</table>
<input type="submit" name="SubmitMe" value="Submitted" />
</form>
</body>
</html>
I first set the method for the form to GET and the page loaded again
after the submit.
When I changed the method back to POST, I received a Page Not Found
error page.
I created another page testform3.php to display the Form Values after
submit. I changed the action on the form to testform3.php.
I am frustrated.
Once again the particulars of this server.
Windows 2k Server SP4
IIS 5
PHP 5.04
MySQL 4.1.11
--- End Message ---
--- Begin Message ---
Hello,
Could someone help me out here, I am tryimg to make two variables into one
for example:
$to = 'server';
$subject = test;
$message = $variable1, $variable2;
$headers = 'From: webmaster@' . $_SERVER['SERVER_NAME'] . "\r\n" .
'Reply-To: webmaster@' . $_SERVER['SERVER_NAME'] . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
My problem is that I need to get "variable1" and "variable2" into one
variable "message", so that it will work with PHP's mail functions.
Thank You!
--- End Message ---