php-windows Digest 17 Nov 2005 19:07:22 -0000 Issue 2828
Topics (messages 26502 through 26511):
Re: Double quotes and HTML
26502 by: Luis Moreira
26503 by: trystano.aol.com
Apache on Win2k errors
26504 by: Alf Stockton
26506 by: Bob Stout
Re: Command mode question
26505 by: TonyY
any fairly large production sites on IIS/PHP out there?
26507 by: Travis Raybold
PHP retrieve Client machine name
26508 by: Alf Stockton
Manipulating images
26509 by: Marcos R. Cardoso
26510 by: Paul Menard
Printing in windows
26511 by: Fernando Ocampo Ramón
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 ---
There is nothing wrong with escaping the quotes.
Your problem is a bad syntax.
You need to "execute" the $_POST command, not print it.
Try this
if (isset($_POST["user_id"]))
echo "<br><input type='text' name='user_id' size='40' maxlength='15'
value='{$_POST['user_id']}'>";
else
echo "<br><input type='text' name='user_id' size='40'
maxlength='15'>";
Luis
-----Original Message-----
From: Wayne Khan [mailto:[EMAIL PROTECTED]
Sent: quinta-feira, 17 de Novembro de 2005 06:59
To: [email protected]
Subject: [PHP-WIN] Double quotes and HTML
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
Precedence: bulk
Delivered-to: mailing list [email protected]
Delivered-to: [EMAIL PROTECTED]
Delivered-to: [EMAIL PROTECTED]
Thread-index: AcXrRGdMNZ3jMfuSReKEZUx0+urWLA==
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
X-Host-Fingerprint: 216.92.131.4 lists.php.net
X-Host-Fingerprint: 165.21.6.24 smtp14.singnet.com.sg Linux 2.4/2.6
List-Post: <mailto:[email protected]>
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
Hi all,
I'm rather new to PHP... Am taking a maximal PHP, minimal HTML approach;
came from a C/Java background.
I'm use a staged (e.g. stage1, stage2) forms page for the creation of new
user accounts, so I'm getting variables out of $_POST if there are any.
Problem is... I'm getting a weird parse error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in ...
My code is as follows:
1 if (isset($_POST["user_id"]))
2 echo "<br><input type='text' name='user_id' size='40'
maxlength='15' value='$_POST[\"user_id\"]'>";
3 else
4 echo "<br><input type='text' name='user_id' size='40'
maxlength='15'>";
I know it has something to do with line 2, because HTML does not support the
use of slashes to escape double quotes. I guess the solution would be to
simply declare an additional variable and refer to it in the if..else part.
1 $user_id = $_POST["user_id"];
2
3 if (isset($_POST["user_id"]))
4 echo "<br><input type='text' name='user_id' size='40'
maxlength='15' value='$user_id'>";
5 else
6 echo "<br><input type='text' name='user_id' size='40'
maxlength='15'>";
But it just seems so... Inelegant. Is there anyway I can just refer to
$_POST variables directly, instead of having to declare a new variable?
Thanks a lot! =)
--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Try the following...
<?php
if (isset($_POST["user_id"]))
echo "<br><input type='text' name='user_id' size='40' maxlength='15'
value='".$_POST["user_id"]."'>";
else
echo "<br><input type='text' name='user_id' size='40' maxlength='15'>";
?>
... you just need to come out of the string and back into PHP code. You can do
it within the string but I prefer to separate my PHP from strings so that I
know where the logic is.
Tryst
--- End Message ---
--- Begin Message ---
When I look in the Apache log file I find the following occurring over
and over.
[Wed Nov 16 21:40:51 2005] [notice] Parent: child process exited with
status 1 -- Restarting.
[Wed Nov 16 21:40:51 2005] [notice] Apache/2.0.53 (Win32) PHP/5.0.3
configured -- resuming normal operations
[Wed Nov 16 21:40:51 2005] [notice] Server built: Feb 10 2005 06:11:34
[Wed Nov 16 21:40:51 2005] [notice] Parent: Created child process 30064
[Wed Nov 16 21:40:51 2005] [notice] Child 30064: Child process is running
[Wed Nov 16 21:40:51 2005] [notice] Child 30064: Acquired the start mutex.
[Wed Nov 16 21:40:51 2005] [notice] Child 30064: Starting 250 worker
threads.
FATAL: erealloc(): Unable to allocate 517632 bytes
I am especially concerned about the erealloc() failure.
What have I done wrong?
Does the Restarting, in the 1st message above mean Apache is restarting
or the child process is restarting ?
--
Regards,
Alf Stockton www.stockton.co.za
Linux 2.6.12-9-386
You are a bundle of energy, always on the go.
My email disclaimer is available at www.stockton.co.za/disclaimer.html
--- End Message ---
--- Begin Message ---
Alf Stockton wrote:
> When I look in the Apache log file I find the following occurring over
> and over.
>
> [Wed Nov 16 21:40:51 2005] [notice] Parent: child process exited with
> status 1 -- Restarting.
> [Wed Nov 16 21:40:51 2005] [notice] Apache/2.0.53 (Win32) PHP/5.0.3
> configured -- resuming normal operations
> [Wed Nov 16 21:40:51 2005] [notice] Server built: Feb 10 2005 06:11:34
> [Wed Nov 16 21:40:51 2005] [notice] Parent: Created child process 30064
> [Wed Nov 16 21:40:51 2005] [notice] Child 30064: Child process is running
> [Wed Nov 16 21:40:51 2005] [notice] Child 30064: Acquired the start
> mutex.
> [Wed Nov 16 21:40:51 2005] [notice] Child 30064: Starting 250 worker
> threads.
> FATAL: erealloc(): Unable to allocate 517632 bytes
>
> I am especially concerned about the erealloc() failure.
>
> What have I done wrong?
> Does the Restarting, in the 1st message above mean Apache is restarting
> or the child process is restarting ?
One reason I use BadBlue <http://www.badblue.com/> as my PC web server
is that it's proven reliable and fiddle-free. It's not free like Apache,
but I appreciate not having to tweak with my tools before I can get to
work. (I still use Apache on my Linux server, but then it's better
supported there.) And, in a nod to topicality, BadBlue supports PHP
quite well. The reason I got it in the first place was to do offline web
site development. I do most routine maintenance and testing on my PC,
then upload the files to my Linux server.
--
Bob Stout <[EMAIL PROTECTED]> - The rules of life:
"Either lead, follow, or get out of the way."
"It's easier to get forgiveness than permission."
"90% of everything is garbage."
"Never attribute to malice what can be adequately explained by
stupidity."
--- End Message ---
--- Begin Message ---
Marc,
That's correct, thanks for the help.
I was not able to remember I was using cmd.exe before, and now trapped by
command.com.
It's great to see things working again.
Tony
Marc Ferguson <[EMAIL PROTECTED]> wrote: Hi Tony,
I tried cd \Program Files and cd "\Program files" and they worked. Try it
without the quotation marks.
Marc F.
"TonyY" wrote in message
news:[EMAIL PROTECTED]
> Hi, I have a sample question (I know I did before):
> I can nolonger use the command [>cd "\Program Files\Apache
> Group\Apache2\bin" to change the directory from the Command prompt????
> I got: Parameter format not correct - "\Program
> What I should do?
> Thanks,
> Tony
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
--- End Message ---
--- Begin Message ---
i am trying to switch our application over to PHP (currently ASP).
unfortunately, due to the complexity of both the code and the site setup
(hundreds of sites using the same code) it needs to be a sectional
replacement. given that and the lack of in house support for linux/unix,
the only realistic option is to run PHP and ASP side by side on the same
windows box.
recent testing on windows IIS/PHP has not instilled me with a lot of
confidence, seeing it use tons more resources than i would expect and
crashing periodically.
are there any fairly large sites out there using PHP on IIS? (we get
~500k hits/day, on reasonably complex pages, and are set up with two
load balanced web servers connecting to an array of database servers.) i
would love to get input from anyone running a similarly sized or larger
site on what they do to accomodate PHP in windows. Zend? FastCGI? others?
thanks in advance,
--travis
smime.p7s
Description: S/MIME Cryptographic Signature
--- End Message ---
--- Begin Message ---
In a PHP 5.0 program running under Windows 2000 with Apache 2 I need to
retrieve either the client machine name or the client machine IP.
Is this possible ?
--
Regards,
Alf Stockton www.stockton.co.za
Linux 2.6.12-9-386
Q: How can you tell when a salesman is lying?
A: When his lips move.
My email disclaimer is available at www.stockton.co.za/disclaimer.html
--- End Message ---
--- Begin Message ---
Hello,
we use here a script to convert our users' photos into thumbnails using
the functions imagecreatefromjpeg(), imagejpeg() and others. Later we
found out that we could simply use a tag like the one below, since the
photos are thumbnails nowadays.
"<"img src="<"?=$code.'-'.$digit?">".jpg width=80 /">"
But using a tag like that has become a new problem, because the web
server stops working properly after some time (some DLLs errors, Apache
stops continuously and then stops permanently, having to restart the web
server). We suspected that the problem was in the fact that some users
hadn't taken the photo previously and the accumulation of the error
"file not found" was generating this problem, so we used the is_file()
function, but the problem continued. When PHP 4.4.1 was released the
"corrupt jpeg" bug #34704 was fixed, so we installed it, but the problem
continued.
We actually don't what could be freezing the Apache, so we are still
using the "resize" script, which is useless and takes memory and CPU
usage from the webserver.
Our current scenario is:
Windows 2003
Apache 2.0.54
PHP 4.4.1
Sun Chili!Soft ASP 3.6.2
Any help would be appreciated,
Marcos R. Cardoso
FURB
Brazil
--- End Message ---
--- Begin Message ---
Well first of all the HTML image tag you provided '<img...>' really have no
play in processing for
PHP or Apache. This is pass-through code. In other words you are parsing this
via PHP to build the
filename for the img src= attribute but the fact the file does not actually
exist is not a concern
of PHP nor Apache. Only the user's browser cares even a little.
Also, if your image is large say 600x400 and you limit the size via width=80 or
height=80 in the
<img> tag, you are still forcing Apache to deliver the full sized image. The
width and height are
only to control display proportions.
As a suggestion why not install ImageMagick to convert your images to thumbs or
whatever.
http://www.imagemagick.org/script/index.php
--- "Marcos R. Cardoso" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> we use here a script to convert our users' photos into thumbnails using
> the functions imagecreatefromjpeg(), imagejpeg() and others. Later we
> found out that we could simply use a tag like the one below, since the
> photos are thumbnails nowadays.
> "<"img src="<"?=$code.'-'.$digit?">".jpg width=80 /">"
>
> But using a tag like that has become a new problem, because the web
> server stops working properly after some time (some DLLs errors, Apache
> stops continuously and then stops permanently, having to restart the web
> server). We suspected that the problem was in the fact that some users
> hadn't taken the photo previously and the accumulation of the error
> "file not found" was generating this problem, so we used the is_file()
> function, but the problem continued. When PHP 4.4.1 was released the
> "corrupt jpeg" bug #34704 was fixed, so we installed it, but the problem
> continued.
>
> We actually don't what could be freezing the Apache, so we are still
> using the "resize" script, which is useless and takes memory and CPU
> usage from the webserver.
>
> Our current scenario is:
> Windows 2003
> Apache 2.0.54
> PHP 4.4.1
> Sun Chili!Soft ASP 3.6.2
>
> Any help would be appreciated,
> Marcos R. Cardoso
> FURB
> Brazil
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Greetings from Mexico.
I wrote an script to pull some data from a database and created a report to
be printed directly by php. All went fine until i noticed that after the
actual printing there is an extra blank page. I've tried on a Epson FX980
and several HP LaserJet Printers with the same result. Checking the spooler
i see 2 jobs for every report i send to the printer.
Even if a send a single line using the script below i got 2 pages.
$text = 'Hello printer... How do you do?';
$handle = printer_open( ); // Blank means default windows printer
printer_start_doc($handle, "My Document");
printer_start_page($handle);
printer_write( $text );
printer_end_page($handle);
printer_end_doc($handle);
printer_close($handle);
what i'm doing wrong?
Fernando Ocampo
--- End Message ---