php-windows Digest 12 Feb 2003 13:19:53 -0000 Issue 1584
Topics (messages 18473 through 18482):
Re: reading lines from a file
18473 by: Per Lundberg
18475 by: Svensson, B.A.T. (HKG)
18476 by: Svensson, B.A.T. (HKG)
18477 by: Neil Smith
quotes and backslashes
18474 by: Bobo Wieland
18478 by: Per Lundberg
18480 by: Chris Kranz
PWS or IIS?
18479 by: m1nt ch3w
18481 by: Chris Kranz
Apostrophe in login causes error
18482 by: Herhuth, Ron
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 Tue, 2003-02-11 at 18:27, Svensson, B.A.T. (HKG) wrote:
> Also excuse my limited ignorant knowledge about PHP, but
> my impression about PHP is that it is runs as an instance
> of the web server or something? (Please, correct me if I
> made any fundamental mistake here!)
Yes and no. It can be run both as a SAPI module (running in Apache,
IIS, Netscape or another web server) or as a stand-alone process in what
is called CGI and CLI modes. There is even wrappers for writing Gtk+
applications with PHP using these modes (the wrapper is called PHP-GTK I
think).
I would say PHP is just as "all-round" as Perl actually, and I have
personally switched from Perl to PHP completely because I prefer PHP's
more "C-like" syntax. Maybe you should Read The Fine Manual, Anders?
:-)
> On the other hand I can imagine an performance difference
> on doing this with C/C++, which would be my natural choose
> when writing a cmd line parser.
But then again, doing the parser would be a much more time-consuming
process. And even worse, we're on the wrong mailing list for that... :)
--
Best regards,
Per Lundberg / Capio ApS
Phone: +46-18-4186040
Fax: +46-18-4186049
Web: http://www.capio.com
--- End Message ---
--- Begin Message ---
> Maybe you should Read The Fine Manual, Anders? :-)
I don't need that, because I don't use PHP. ;)
> But then again, doing the parser would be a much more time-consuming
> process. And even worse, we're on the wrong mailing list for that... :)
I guess you are quite right on that one too.
--- End Message ---
--- Begin Message ---
> Cheer up and be confident in the judgement of the
> respectively responsible. There are aspects to consider
> unmentioned and irrelevant w/resp to this NG. So I'd
> suggest to keep cool.
Basically I don't care how people implement things: as long
as I don't have to clean it up. So it not my business, but
on the other hand if you ask for my opinion... ;)
> Sven Schnitzke (another self-employed one on the edge of being fired ...)
Well,t he business need a clean up anyway, hehe. :)
//Aners
--- End Message ---
--- Begin Message ---
George - didn't you come to us with this exact problem a month or so ago ?
I think chris probably meant not readline but fgets() and / or file()
fgets() reads a specified chunk size into a string or other variable.
file() reads a file line by line (separator is the newline character: :
array file (string filename [, int use_include_path])
To be honest, if you will receive an unknown number of fields, you might be
better transforming the whole lot to XML and storing the XML en-bloc in the
database - unless you require to search on each field from the off.
You can parse the XML to fieldsets at a later date when you've established
just *what* fields are going to be sent. At least this way you can fool
around with XSL to display at least the common information in each file,
but still retain the oddities for later analysis, without having to set up
a DB with dozens of possibly redundant fields.
HTH - my 2cv err - 2c lol
Neil Smith.
At 23:59 11/02/2003 +0000, you wrote:
From: "George Pitcher" <[EMAIL PROTECTED]>
To: "Chris Kranz" <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]>
Date: Tue, 11 Feb 2003 12:25:14 -0000
Subject: RE: [PHP-WIN] reading lines from a file
Chris,
I couldn't find any readline function in the manual - did I miss it?
It isn't as simple as you say, because, to start with, I don't know how many
fields there are going to be, I don't know how I'm going to build my array
to record-level sets.
I'm not really looking for someone to provide the code (snippets accepted
though) but I would appreciate being pointed in the right direction.
Cheers
George
--- End Message ---
--- Begin Message ---
Hi!
When I have strings like 'Hello "World"' containing quotes and passes them
to another page I use: rawurlenecode(html_entity_decode($string,
ENT_QUOTES)).
And then I use rawurldecode to display them again, getting the string:
'Hello \"World\"' ...
Why, and hw do I fix it? My brain isn't in the office today...
.bobo
--- End Message ---
--- Begin Message ---
On Wed, 2003-02-12 at 09:35, Bobo Wieland wrote:
> When I have strings like 'Hello "World"' containing quotes and passes them
> to another page I use: rawurlenecode(html_entity_decode($string,
> ENT_QUOTES)).
>
> And then I use rawurldecode to display them again, getting the string:
> 'Hello \"World\"' ...
>
> Why, and hw do I fix it?
I think your problem is caused by PHP also doing its own encoding of
parameters. This is called 'magic quotes' and is well documented in the
manual if you wish to educate yourself on the subject.
I think it will work straight off if you remove the rawurlencode() or
change the setting of magic_quotes_gpc to off (but be aware that this
can be a HUGE security risk if your code is not well-written).
--
Best regards,
Per Lundberg / Capio ApS
Phone: +46-18-4186040
Fax: +46-18-4186049
Web: http://www.capio.com
--- End Message ---
--- Begin Message ---
Checkout the stripslashes() and addslashes() functions. Very cool for
stuff like this, and very easy :)
chris kranz
fatcuban.com
-----Original Message-----
From: Per Lundberg [mailto:[EMAIL PROTECTED]]
Sent: 12 February 2003 09:00
To: Bobo Wieland
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] quotes and backslashes
On Wed, 2003-02-12 at 09:35, Bobo Wieland wrote:
> When I have strings like 'Hello "World"' containing quotes and passes
them
> to another page I use: rawurlenecode(html_entity_decode($string,
> ENT_QUOTES)).
>
> And then I use rawurldecode to display them again, getting the string:
> 'Hello \"World\"' ...
>
> Why, and hw do I fix it?
I think your problem is caused by PHP also doing its own encoding of
parameters. This is called 'magic quotes' and is well documented in the
manual if you wish to educate yourself on the subject.
I think it will work straight off if you remove the rawurlencode() or
change the setting of magic_quotes_gpc to off (but be aware that this
can be a HUGE security risk if your code is not well-written).
--
Best regards,
Per Lundberg / Capio ApS
Phone: +46-18-4186040
Fax: +46-18-4186049
Web: http://www.capio.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Howdy all,
Just got Win XP Pro, and was wondering which server to go for. IIS or PWS?
Which one is more stable and stuff like that.
Thanks in advance,
/m1nt
--- End Message ---
--- Begin Message ---
I'm not 100% sure on how PWS runs on win XP, but I have used IIS, and
I'm not a big fan. I believe IBM are now running XP with IIS, alongside
2k with IIS on their webservers. Response time from the XP servers are
nearly double that of the 2k ones.
Personally, I think you should look at apache. But if this isn't an
option, I would choose IIS over PWS, simply because it's a proper web
server, much more stable, and much more able to deal with a greater
number of requests.
It is also dependant on what your going to be doing with this?
If your just gonna be running the web server once a month to try some
scripting, then maybe PWS is better, as you don't have to run it as a
service all the time, but if your gonna be doing stuff all the time,
again, IIS is a better bet.
Hope this helps...
chris kranz
fatcuban.com
-----Original Message-----
From: m1nt ch3w [mailto:[EMAIL PROTECTED]]
Sent: 12 February 2003 09:17
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] PWS or IIS?
Howdy all,
Just got Win XP Pro, and was wondering which server to go for. IIS or
PWS?
Which one is more stable and stuff like that.
Thanks in advance,
/m1nt
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I have built a typical login form where a user enters their last name as the user name
and the last four digits of their SSN as their password. The following page checks to
see if the user exists in the database and either allows access or denies access based
on the findings. This has worked fine for 500+ partners...but we have three people
whose last name is O'Conner in the database (I can't change their HR record in the DB)
and the apostrophe in their name is causing the script to fail. Without changing
settings in the ini file is there a way I can quickly make the script accept the
apostrophe in the name?
Thanks,
Ron
--- End Message ---