|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 6 Jan 2004 17:44:26 -0000 Issue 2515
php-general-digest-help
lists.php.net
Date: Tue Jan 06 2004 - 11:44:26 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 6 Jan 2004 17:44:26 -0000 Issue 2515
Topics (messages 173824 through 173871):
Re: fsockopen to conect to ssl sites
173824 by: Manuel Lemos
Comparison PHP to Perl
173825 by: Warren Vail
173827 by: Mike Migurski
173829 by: Al
173837 by: David T-G
173865 by: Raditha Dissanayake
173866 by: Chris Shiflett
173867 by: Tristan.Pretty.risk.sungard.com
173871 by: Brian.Goralczyk.VerizonWireless.com
generating .doc on the fly
173826 by: Naveed Ahmad
173852 by: Marek Kilimajer
173857 by: jon
Re: Cannot send session cache limiter SOLVED
173828 by: john.johnallsopp.co.uk
globals?
173830 by: Bryan Koschmann - GKT
Re: detaching and running php processes in the background
173831 by: Gary C. New
web-based and command line mcrypting and back again
173832 by: Gary C. New
173834 by: Tom Rogers
Re: failure notice] Why??
173833 by: David T-G
173861 by: Chris Shiflett
173864 by: Richard Davey
Re: Readfile, DAP and 3 questions
173835 by: Adam i Agnieszka Gasiorowski FNORD
Error/ Warning messages in log files (OS 121) and (OS 64)
173836 by: Trevor Dowling
Re: Getting results from Select Multiple HTML tag
173838 by: Ford, Mike [LSS]
Re: Strange IF(condition) behaviour
173839 by: Ford, Mike [LSS]
173847 by: Michal O¹kera
Newbie with sorting problem
173840 by: Bart Koppe
173841 by: pete M
173842 by: Jay Blanchard
173843 by: Richard Davey
str_replace to ignore commas
173844 by: Vernon
173849 by: Chris Hayes
173850 by: Vernon
173853 by: Chris Hayes
173855 by: Richard Davey
173859 by: Vernon
173862 by: Richard Davey
PHP function for length of the array???
173845 by: Scott Fletcher
173846 by: Chris Hayes
173848 by: Scott Fletcher
173856 by: Neil Freeman
Re: developing a plug-in framework
173851 by: Justin French
This is why PHP sucks
173854 by: Big Walker
eregi filter stopping valid email address, part two
173858 by: Dave G
173860 by: Ford, Mike [LSS]
173863 by: CPT John W. Holmes
173869 by: Manuel Lemos
Import data from textfile
173868 by: Pushpinder Singh
173870 by: Michal O¹kera
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hello,
On 01/03/2004 03:06 PM, Jorge Castaneda wrote:
> WHERE IS THE ERROR?
>
> The username and the password are the correct and the name of the
> variables (login and pass) also match. I tried to get data from a
> secure site but I always receive the next message instead of the page
> I request:
>
> We are connected with somesecuredomain.com
>
> HTTP/1.1 302 Found Date: Fri, 02 Jan 2004 19:21:20 GMT Server:
> Apache/1.3.27 (Unix) FrontPage/5.0.2.2623 PHP/4.3.2 mod_gzip/1.3.19.1a
> mod_accounting/1.0 mod_fastcgi/2.4.0 mod_ssl/2.8.14 OpenSSL/0.9.7b
> rus/PL30.17 X-Powered-By: PHP/4.3.2 Set-Cookie:
> biz=8a204f6cf271a7a81d3de70c0b250921; path=/ Expires: Thu, 01 Jan 1970
> 00:00:01 GMT Cache-Control: no-store, no-cache, must-revalidate,
> post-check=0, pre-check=0 Pragma: no-cache Location:
> /?error=Auth+error%2C+wrong+login+or+password.&login=myusername
> Connection: close Content-Type: text/html; charset=windows-1251
> Last-Modified: Fri, 02 Jan 2004 19:21:20 GMT
These are headers to redirect you to a login page. You are probably not
sending any session cookies that let the site reckon you as logged user.
In that case, you need to submit a login form and collect the cookies to
be used in the pages that you want to access.
You may want to try this class that can do that work of collecting
cookies and sending them back when accessing the site pages. There is an
example to do that in the same site where the class is available.
http://www.phpclasses.org/httpclient
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
I am looking for a comparison of features supported by PHP vs those
supported by Perl.
My gut tells me PHP is more robust, but we are trying to implement something
in a company that has long had a standard allowing Perl as a "sanctioned"
language, but current management does not want to fight for PHP as a new
"sanctioned" language (most managers there have never heard of PHP and the
resident Java zealots have almost established a monopoly). The kind of
thing I am looking for is SESSION support, I know it's supported by PHP, but
not sure about Perl. I don't want to have to grow my own session manager.
One alternative is mainframe COBOL, which clearly will not support what we
want to do.
What would I lose by implementing in Perl (other than my mind)?
thanks in advance,
Warren Vail
warren
vailtech.net
attached mail follows:
>I am looking for a comparison of features supported by PHP vs those
>supported by Perl.
>
>My gut tells me PHP is more robust, but we are trying to implement something
>in a company that has long had a standard allowing Perl as a "sanctioned"
>language, but current management does not want to fight for PHP as a new
>"sanctioned" language (most managers there have never heard of PHP and the
>resident Java zealots have almost established a monopoly).
PHP is designed to live in a web environment, so you'll probably find that
almost any feature needed in the typical usage of a webserver will be at
your fingertips. Your session example is a good one. So is automatic
inclusion of GET and POST variables, or access to Apache headers, or
availablity of interfaces to most databases, or projects such as PEAR that
further ease the use of high level functionality like XML parsing.
Personally,
PHP's strongest advantage for me is its transparent integration with
Apache, and the flexibility of using it in conjunction with mod_rewrite
(for example). Preliminary experiments with Java servers such as Resin
have left me with a profound sense of confusion at the litter of Servlet
and WEB-INF directories, only marginally related to the URL needed to
request them.
Perl has a strong developer community, and tons of available modules and
extensions for most imaginable purposes, but it was developed for
efficient parsing of text files and it's not necessarily intended for use
as an Apache module. I know of some very large, very busy applications
that run on mod_perl, but then again I've seen the source and it's not
pretty.
>What would I lose by implementing in Perl (other than my mind)?
Losing your mind is a pretty good argument against Perl - It's a great
laguage, but its main strength (TMTOWDTI, a.k.a. There's More Than One Way
To Do It) is also its biggest drawback. Some of the most collosal code
headaches I've ever endured were the direct result of attempting to
unravel the exertions of experienced Perl hackers, parsing through
unending stretches of punctuation, following the implied "$_".
OTOH, PHP's syntax is somewhat rooted in Perl, and it suffers from many of
the same drawbacks, though it's vastly more approachable. The other
extreme is Java, where it seems that every simple thing that would be a
one-liner in Perl has to be contorted into a senseless OOP framework in
the interest of reusability and portability.
Anyway, if you're the only person pulling for PHP and there's a crew of
Java toughs breathing down your neck, you may find that this is a losing
battle for you.
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
attached mail follows:
"Warren Vail" <warren
vailtech.net> wrote in message
news:03ac01c3d421$a7b879c0$6401a8c0
comcast.net...
> I am looking for a comparison of features supported by PHP vs those
> supported by Perl.
>
[snip]
Ah, this old chestnut.
As someone who wrote a major application in Perl, and now (mostly) uses PHP,
I can only reiterate what's been said a thousand times before: the language
you choose depends on what features you want and the type of script you'll
be writing.
You've only identified session support as a requirement, and although PHP
has native session support, Perl has similar functionality available via the
Apache::Session CPAN module. Actually, this is true for almost all extra
native functionality in PHP that Perl does not support -- it's there in
Perl, but you need to download a CPAN module for it. Another example of this
is PHP's native mail( ) support. (For the uninitiated, CPAN
[http://www.cpan.org] is a fantastic collection of standardised Perl
extensions with an easy install script that has evolved over many years).
Unfortunately the same does not apply for PHP: although it has an impressive
array of built-in functions (especially compared to Perl's paltry offering),
if a particular feature is not handled natively then you'll probably have to
write your own code to implement it. Although there *is* a CPAN equivalent
in PHP called PEAR [http://pear.php.net] that boasts a decent number of
modules (most of which are still in early development stages), PHP simply
hasn't been around long enough attract as much module development as Perl.
So in summary: list all the features you need and if PHP supports them all
(or if a few are missing and PHP's ease-of-use and other benefits outweigh
the cons) then go with PHP, otherwise take another look at Perl. For a list
of PHP's features, take a look at the documentation ... it's very
user-friendly. [http://www.php.net/manual/en/]
You'll also find a ridiculously large number of articles online comparing
PHP to Perl, just do a Google search such as:
[http://www.google.com/search?q=php+perl+comparison]
Hope it helps,
Al
attached mail follows:
Warren --
...and then Warren Vail said...
%
% I am looking for a comparison of features supported by PHP vs those
% supported by Perl.
In general, I'd say that there's nothing that one can do that the other
can't, though I'd also say that for things not native to the language
(or even for things native that someone wanted to do differently :-)
perl will have a better library of modules available.
%
% My gut tells me PHP is more robust, but we are trying to implement something
Interesting... perl is a much more mature and seasoned language than
php; why do you figure the latter to be "more robust", or perhaps how do
you define the term? [Don't get me wrong; I think that php is growing
like a weed and will, within just a few years, show that same level of
maturity, depth of functionality (very much via contributed code), and
breadth of deployment.]
% in a company that has long had a standard allowing Perl as a "sanctioned"
% language, but current management does not want to fight for PHP as a new
% "sanctioned" language (most managers there have never heard of PHP and the
% resident Java zealots have almost established a monopoly). The kind of
Bleah. Anything but Java!
% thing I am looking for is SESSION support, I know it's supported by PHP, but
% not sure about Perl. I don't want to have to grow my own session manager.
Recall that, for many years, nearly all dynamic web pages under Apache
were written in perl; after all, nobody wanted the overhread of a shell
process and nobody wanted the hassle of writing in C. I will say with
confidence that perl can do anything that php can do, including sessions
(though I'm not an expert in either language; in fact, my perl is quite
rusty since I've been doing very primarily php for a while now). There
is almost no "piece" in perl, such as the session manager you mention,
which you have to write; it's not uncommon to write a script which uses
a bunch of different modules and all you write is a bit of glue calling
one and handing to the other :-)
Does that make it right or wrong for you? Nope; not by any means. One
of the great shining points of php, IMHO, is how easy it is to write the
code and how you can turn it on and off for spitting out raw HTML (though
I must admit that I very, very rarely do so myself and even keep trying
to move to abstraction of data via templates, but that's neither here nor
there), and I agree with Mike that you can get punctuation soup pretty
quickly in perl -- though that's usually because of lazy programming, and
you can have lazy or bad programming in any language, including php.
You might talk to some of the more sane perl zealots there (yes, I'm sure
there are plenty and off the deep end, too :-) to learn a bit about perl
and cpan and more. You might find it not so bad. I definitely prefer it
for doing system scripts; I use the php CLI for one-lining test code, and
I have written php system scripts, but perl is [currently] better suited
to tasks where the web is nowhere in sight.
% One alternative is mainframe COBOL, which clearly will not support what we
% want to do.
As I said, anything but Java :-)
%
% What would I lose by implementing in Perl (other than my mind)?
Probably nothing. Meanwhile, by moving away from their standard language
for this one project, you'd be introducing a whole new ball of maintenance
that probably shouldn't be there. If you want php for one project, don't.
If you want php as a new language, you might pick some of the uglier perl
scripts they have and rewrite them in php to show how straightforward and
pretty it is.
%
% thanks in advance,
Good luck!
%
% Warren Vail
% warren
vailtech.net
HTH & HAND & Happy New Year
:-D
--
David T-G * There is too much animal courage in
(play) davidtg
justpickone.org * society and not sufficient moral courage.
(work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE/+psPGb7uCXufRwARAmG3AJ9XNETqUcsdrGstw0Y2MgHVuI/IewCgi2WW
q+wfWq7j8PMKa/SzdLWSNfs=
=raeQ
-----END PGP SIGNATURE-----
attached mail follows:
Hi,
One man's perl is another man's headache. beeng using perl for six years
and i have trouble understanding what other people wrote with it and
vice verce. not so with PHP. and what ever the module you find on CPAN
you will find an equivalent or similar in PHP as well.
And finally on java, if your collegues think java is ideal for web
applications they are zealots indeed!
all the best
Warren Vail wrote:
>I am looking for a comparison of features supported by PHP vs those
>supported by Perl.
>
>My gut tells me PHP is more robust, but we are trying to implement something
>in a company that has long had a standard allowing Perl as a "sanctioned"
>language, but current management does not want to fight for PHP as a new
>"sanctioned" language (most managers there have never heard of PHP and the
>resident Java zealots have almost established a monopoly). The kind of
>thing I am looking for is SESSION support, I know it's supported by PHP, but
>not sure about Perl. I don't want to have to grow my own session manager.
>One alternative is mainframe COBOL, which clearly will not support what we
>want to do.
>
>What would I lose by implementing in Perl (other than my mind)?
>
>thanks in advance,
>
>Warren Vail
>warren
vailtech.net
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
--- Warren Vail <warren
vailtech.net> wrote:
> I am looking for a comparison of features supported by PHP vs those
> supported by Perl.
You'll find it difficult to identify a feature in one language that's not
in the other. And, where features differ, the same solutions can probably
be achieved with either anyway
> My gut tells me PHP is more robust
This will be unpopular to say, but my gut tells me the exact opposite. I
prefer PHP, and I would not hesitate to recommend it for most Web
applications. However, Perl has been around a lot longer; it's simply more
mature and hardened than PHP.
The difference may be negligible (I certainly feel comfortable relying on
PHP), but if you're going to split hairs, I'd have to tip my hat to Perl
in the robust category.
> current management does not want to fight for PHP as a new
> "sanctioned" language (most managers there have never heard of PHP
> and the resident Java zealots have almost established a monopoly).
Java's a different story. :-)
Having to fight in order to adopt a new technology is always a pain, even
when it is an obvious choice. In this case, the choice isn't so obvious
(Perl will satisfy your needs, I'm sure), so your battle will be
difficult.
> The kind of thing I am looking for is SESSION support, I know it's
> supported by PHP, but not sure about Perl. I don't want to have to grow
> my own session manager.
The session mechanism in PHP is very simplistic (on purpose), so it's not
hard to reproduce. In fact, I hope you do more than "session_start() and
go" in PHP, else you are probably vulnerable to a number of session-based
attacks.
Perl has CPAN for those who want to use an existing session mechanism.
> What would I lose by implementing in Perl (other than my mind)?
Probably nothing, but that last statement is important. A business must
rely on its available resources, and if the developers prefer a particular
language, and all else is even for the most part, it's probably best to
let the developers use what they prefer.
As far as Apache integration goes, I don't think we can match mod_perl,
unless more people get interested in apache_hooks.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
>> "In fact, I hope you do more than "session_start() and
go" in PHP, else you are probably vulnerable to a number of session-based
attacks."
Man, that's all I do alot of the time?
What dangers are there, care to share any facts figures about that...?
I'll go away now and read up again on sessions...!
Cheers for the heads up,
Tris...
*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************
attached mail follows:
Maybe I am going to show my own ignorance here, but I think if your looking
for Server side web programming that PHP is much easier to use. Even some
of the developers here that use perl a lot more than me, will say that web
programming with perl is challenging in comparison.
My logic is JavaScript + client-side, PHP = server-side, perl =
server(scripts and automatic jobs and such). Some might disagree. I know
PHP does command line scripting, but I have never used it for that. I know
that perl does server side pages, but I just don't care for the level of
effort.
I also prefer these languages because they are OS non-specific. I have
avoided java. I am not sure what all the hoopla is about. I am sure I
could get flamed by java programmers for that statement, but I don't see why
I would want to use it.
Feel free to fill me in.
Brian Goralczyk
Verizon Wireless
-----Original Message-----
From: Chris Shiflett [mailto:shiflett
php.net]
Sent: Tuesday, January 06, 2004 11:28 AM
To: Warren Vail; php-general
lists.php.net
Subject: Re: [PHP] Comparison PHP to Perl
--- Warren Vail <warren
vailtech.net> wrote:
> I am looking for a comparison of features supported by PHP vs those
> supported by Perl.
You'll find it difficult to identify a feature in one language that's not
in the other. And, where features differ, the same solutions can probably
be achieved with either anyway
> My gut tells me PHP is more robust
This will be unpopular to say, but my gut tells me the exact opposite. I
prefer PHP, and I would not hesitate to recommend it for most Web
applications. However, Perl has been around a lot longer; it's simply more
mature and hardened than PHP.
The difference may be negligible (I certainly feel comfortable relying on
PHP), but if you're going to split hairs, I'd have to tip my hat to Perl
in the robust category.
> current management does not want to fight for PHP as a new
> "sanctioned" language (most managers there have never heard of PHP
> and the resident Java zealots have almost established a monopoly).
Java's a different story. :-)
Having to fight in order to adopt a new technology is always a pain, even
when it is an obvious choice. In this case, the choice isn't so obvious
(Perl will satisfy your needs, I'm sure), so your battle will be
difficult.
> The kind of thing I am looking for is SESSION support, I know it's
> supported by PHP, but not sure about Perl. I don't want to have to grow
> my own session manager.
The session mechanism in PHP is very simplistic (on purpose), so it's not
hard to reproduce. In fact, I hope you do more than "session_start() and
go" in PHP, else you are probably vulnerable to a number of session-based
attacks.
Perl has CPAN for those who want to use an existing session mechanism.
> What would I lose by implementing in Perl (other than my mind)?
Probably nothing, but that last statement is important. A business must
rely on its available resources, and if the developers prefer a particular
language, and all else is even for the most part, it's probably best to
let the developers use what they prefer.
As far as Apache integration goes, I don't think we can match mod_perl,
unless more people get interested in apache_hooks.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I want to save a document in .doc format on the fly but my server is running
on a linux machine. Can I still make use of COM object? Or there is some
other module which I can easily load on the fly???
somebody told me the link below butI cannot find the module from
there....... :S
http://www.45.free.net/~vitus/ice/catdoc/
attached mail follows:
Simply create a html file and give the user impression that it's in doc
format - output the right header and give it .doc extension
Naveed Ahmad wrote:
> I want to save a document in .doc format on the fly but my server is running
> on a linux machine. Can I still make use of COM object? Or there is some
> other module which I can easily load on the fly???
> somebody told me the link below butI cannot find the module from
> there....... :S
> http://www.45.free.net/~vitus/ice/catdoc/
>
attached mail follows:
Nah... You can't use COM in Linux, but you can generate an RTF pretty
easily, which will open right up in Word with no problems whatsoever.
-- jon
-------------------
jon roig
web developer
email: jon
trafficdesigns.com
phone: 888.230.7557
-----Original Message-----
From: Naveed Ahmad [mailto:naveedbs
yahoo.com]
Sent: Tuesday, January 06, 2004 12:53 AM
To: php-general
lists.php.net
Subject: [PHP] generating .doc on the fly
I want to save a document in .doc format on the fly but my server is
running on a linux machine. Can I still make use of COM object? Or there
is some other module which I can easily load on the fly??? somebody told
me the link below butI cannot find the module from there....... :S
http://www.45.free.net/~vitus/ice/catdoc/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.551 / Virus Database: 343 - Release Date: 12/11/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.551 / Virus Database: 343 - Release Date: 12/11/2003
attached mail follows:
>> from the code:
>>
>> <?php
>> include 'navigationStart3.php4';
>
> Are these indents in the code (changeAlertDetails3.php4 I think)? You
> can't have anything before the <?php.
yup, that was it <red face>, sorted, thanks everyone
J
attached mail follows:
Hi,
I was just curious, how much longer are globals going to be supported? I
had heard awhile back that they wouldn't be around for too long.
Thanks,
Bryan
attached mail follows:
In order to get this to work I had to do several things.
1. I had initially compiled my php installation as a server-side
module, but in order to execute and detach a background php process I
had to recompile my php installation as a binary installation (hint: if
you compile php as a binary and then as a server-side module you can
take advantage of both installation types--that is what I ended up doing).
2. Next you must reference the php binary with the '-f' option to
execute the desired php script. To pass variables, you must reference
them in a single quoted string prefacing each with a '&' symbol.
Finally write all signals to '/dev/null' and release it into the
background using an ending '&' symbol.
Example:
shell_exec("/usr/local/bin/php -f ./user-create.php '&uid=" . $uid .
"&vdomain=" . $vdomain . "&password=" . $password . "' > /dev/null &");
3. In the primary php script (./user-create.php) escape any shell
command variables that have been supplied by human input (security).
$u = escapeshellcmd($uid);
$d = escapeshellcmd($vdomain);
$p = escapeshellcmd($password);
4. You should put any child commands you want to spawn in the primary
script (./user-create.php) as this will help with maintaining the number
of rogue processes that you might need to deal with.
shell_exec("useradd -d /home/$d $u");
shell_exec("passwd $u && $p");
That's it!
I know it sounds a bit complicated, but after you have all the right
components functional it is quite easy.
Hope this helps all those of you who have requested it.
Respectfully,
Gary
Gary C. New wrote:
> What is the best way to detach and run a command line based php script
> in the background from a web-based php script, without the need for
> reporting?
>
> I have a web-based php script that gathers information and then passes
> it off to several functions, which execute several other php scripts.
> The problem is that the main php script does not return until all the
> processes have signaled and is taking about 30 sec to complete. There
> is no need for the child processes spawned by the main php script to
> signal. I would like to spawn and detach them to finish in the
> background; thus, dramatically reducing the load time of the main php
> script.
>
> It has been suggested to me to use the & with the shell_exec function,
> but this still requires the child processes to signal.
>
> Another suggestion was to use the pcntl_fork function, but my reading
> suggest that this is not to be used with web-based applications and does
> not compile in with mod_php (only the binary version). If I were to use
> the binary version would I even be able to detach the forked child
> processes? Doesn't pcntl_fork still require the child processes to
> signal to the parent before exiting otherwise becoming zombie processes?
>
> Any suggestions on the best way to handle this?
>
> Respectfully,
>
>
> Gary
>
attached mail follows:
I am trying to figure out how to encrypt data using the web-based php
mcrypt function and then decrypt it using the command line (cli) mcrypt
binary, and vica-versa.
I cannot seem to get the same encrypted output for the same data,
between the two methods. I've tried to ensure I am using the same
algorithms and modes for both methods by testing the mcrypt_enc_get_*
functions. I think the problem may lie in the way both methods are
being seeded.
Web-Based PHP Example:
$key = 'test';
$data[] = 'abcdefghijklmnopqrstuvwxyz';
$m = 0;
foreach ($data as $dt)
{
$td = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$CRYPT[$m] = mcrypt_generic($td, $dt);
/*
echo mcrypt_enc_get_algorithms_name($td);
echo mcrypt_enc_get_block_size($td);
echo mcrypt_enc_get_iv_size($td);
echo mcrypt_enc_get_key_size($td);
echo mcrypt_enc_get_modes_name($td);
echo mcrypt_enc_get_supported_key_sizes($td);
echo mcrypt_enc_is_block_algorithm_mode($td);
echo mcrypt_enc_is_block_algorithm($td);
echo mcrypt_enc_is_block_mode($td);
echo mcrypt_enc_self_test($td);
*/
$DECRYPT[$m] = mdecrypt_generic($td, $dt);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
echo "crypt_" . base64_encode($CRYPT[$m]) . "_<br />\n";
echo "decrypt_" . base64_decode(rtrim($DECRYPT[$m])) . "_<br />\n";
$m++;
}
Note: I believe it is the line where the $iv variable is being set that
is causing the issue and/or I cannot reproduce the same seeding using
the command line options.
Command Line Example:
echo "abcdefghijklmnopqrstuvwxyz" | mcrypt -Fb -m ecb -a tripledes |
encode-base64
echo "" | decode-base64 | mcrypt -dFb -m ecb -a tripledes
I would appreciate any comments or suggestions.
Respectfully,
Gary
attached mail follows:
Hi,
Tuesday, January 6, 2004, 8:48:17 PM, you wrote:
GCN> I am trying to figure out how to encrypt data using the web-based php
GCN> mcrypt function and then decrypt it using the command line (cli) mcrypt
GCN> binary, and vica-versa.
GCN> I cannot seem to get the same encrypted output for the same data,
GCN> between the two methods. I've tried to ensure I am using the same
GCN> algorithms and modes for both methods by testing the mcrypt_enc_get_*
GCN> functions. I think the problem may lie in the way both methods are
GCN> being seeded.
GCN> Web-Based PHP Example:
GCN> $key = 'test';
GCN> $data[] = 'abcdefghijklmnopqrstuvwxyz';
GCN> $m = 0;
GCN> foreach ($data as $dt)
GCN> {
GCN> $td = mcrypt_module_open('tripledes', '', 'ecb', '');
GCN> $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
GCN> mcrypt_generic_init($td, $key, $iv);
GCN> $CRYPT[$m] = mcrypt_generic($td, $dt);
GCN> /*
GCN> echo mcrypt_enc_get_algorithms_name($td);
GCN> echo mcrypt_enc_get_block_size($td);
GCN> echo mcrypt_enc_get_iv_size($td);
GCN> echo mcrypt_enc_get_key_size($td);
GCN> echo mcrypt_enc_get_modes_name($td);
GCN> echo mcrypt_enc_get_supported_key_sizes($td);
GCN> echo mcrypt_enc_is_block_algorithm_mode($td);
GCN> echo mcrypt_enc_is_block_algorithm($td);
GCN> echo mcrypt_enc_is_block_mode($td);
GCN> echo mcrypt_enc_self_test($td);
GCN> */
GCN> $DECRYPT[$m] = mdecrypt_generic($td, $dt);
GCN> mcrypt_generic_deinit($td);
GCN> mcrypt_module_close($td);
GCN> echo "crypt_" . base64_encode($CRYPT[$m]) . "_<br />\n";
GCN> echo "decrypt_" . base64_decode(rtrim($DECRYPT[$m])) . "_<br />\n";
GCN> $m++;
GCN> }
GCN> Note: I believe it is the line where the $iv variable is being set that
GCN> is causing the issue and/or I cannot reproduce the same seeding using
GCN> the command line options.
GCN> Command Line Example:
GCN> echo "abcdefghijklmnopqrstuvwxyz" | mcrypt -Fb -m ecb -a tripledes |
GCN> encode-base64
GCN> echo "" | decode-base64 | mcrypt -dFb -m ecb -a tripledes
GCN> I would appreciate any comments or suggestions.
GCN> Respectfully,
GCN> Gary
try setting the iv to all 0's
$iv = 0;
$iv = pack("a".mcrypt_enc_get_iv_size($td),$iv);
--
regards,
Tom
attached mail follows:
Rolf, et al --
...and then Rolf Brusletto said...
%
% Whenever I submit a message to this list, I get a bounce back saying its
% a dupe, anyone have any ideas?
I figured some pair subscriber has a loop in his .forward setup.
%
% --
% Rolf Brusletto
% rolf[at]emailfeeds[dot]com
% http://www.emailfeeds.com
HTH & HAND & HNY
:-D
--
David T-G * There is too much animal courage in
(play) davidtg
justpickone.org * society and not sufficient moral courage.
(work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE/+pajGb7uCXufRwARAiYZAKCwXSwtVujTYG2ZOtRo4b3Csp/ERwCfSSq6
gKO19C1rAo85fE82UvzXEZY=
=8ePp
-----END PGP SIGNATURE-----
attached mail follows:
--- Richard Davey <rich
launchcode.co.uk> wrote:
> Hello Rolf,
>
> Tuesday, January 6, 2004, 1:26:31 AM, you wrote:
>
> RB> Whenever I submit a message to this list, I get a bounce back saying
> RB> a dupe, anyone have any ideas?
>
> I get exactly the same - it's highly annoying and happens every time.
>
> Do you use Pair Networks by any chance? (I do and post via their SMTP
> server).
I think it happens for everyone, and Pair hosts a lot of the php.net
stuff, including handling the email, so I doubt it matters whether you use
Pair for SMTP.
I assume (I could be wrong) that they're working on the problem, but it
has been several days...
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
Hello Chris,
Tuesday, January 6, 2004, 4:13:09 PM, you wrote:
CS> I think it happens for everyone, and Pair hosts a lot of the php.net
CS> stuff, including handling the email, so I doubt it matters whether you use
CS> Pair for SMTP.
CS> I assume (I could be wrong) that they're working on the problem, but it
CS> has been several days...
No, they're not. I emailed their support team about it on the 10th of
December and they wrote back saying they didn't know why it was
happening and maybe it was a local configuration error. Now I know it
happens for everyone, it's obviously not.
--
Best regards,
Richard mailto:rich
launchcode.co.uk
attached mail follows:
Ryan A wrote:
> Opera version 6.5 and 7...
> I already had that set.....
Try asking again on news:opera.general
(if your server does not carry this newsgroup,
try news.opera.com). There are more Opera
- knowleable people there :8]. I recall that
there is a solution, I just cannot find it
right now.
--
Seks, seksiæ, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info { iWanToDie } WiNoNa ) (
http://szatanowskie-ladacznice.0-700.pl foReVeR( * )
Poznaj jej zwiewne kszta³ty... http://www.opera.com 007
attached mail follows:
(Relisted as no response from over Xmas period)
Hi,
I am having a real problem with error messages posted in the error.log file
in the Apache directory. I have been doing lots of searches to find a
solution and it seems obvious that many people are see this issue but I can
find no resolution or explanation for the entries (see below).
PHP Bug #25570 seemed to be a solution but the version of php I am using is
4.3.2 which is claimed to not exhibit the bug described in 25570.
The system is running on a Win2K box, and we are using php, sql and Apache.
Anyone out there have an idea of how to fix this issue?
Thanks
Trevor
Some system info:
System Windows NT UKRBCSR01 5.0 build 2195
Build Date May 28 2003 15:06:05
Server API Apache 2.0 Handler
Apache/2.0.47 (Win32) PHP/4.3.2
This is the more worring of the issues:
21:18:49 2003 [notice] Parent: child process exited with status
4294967295 -- Restarting.
But I am assuming that some or all of these are related.
21:19:44 2003 [warn] (OS 121)The semaphore timeout period has expired. :
winnt_accept: Asynchronous AcceptEx failed.
00:50:58 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
Error Log snipit
21:18:16 2003 [notice] Parent: Created child process 3180
21:18:16 2003 [notice] Child 3180: Child process is running
21:18:16 2003 [notice] Child 3180: Acquired the start mutex.
21:18:16 2003 [notice] Child 3180: Starting 250 worker threads.
21:18:49 2003 [notice] Parent: child process exited with status
4294967295 -- Restarting.
21:18:49 2003 [notice] Parent: Created child process 676
21:18:49 2003 [notice] Child 676: Child process is running
21:18:49 2003 [notice] Child 676: Acquired the start mutex.
21:18:49 2003 [notice] Child 676: Starting 250 worker threads.
21:19:44 2003 [warn] (OS 121)The semaphore timeout period has expired. :
winnt_accept: Asynchronous AcceptEx failed.
00:50:58 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
00:50:58 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
01:54:48 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
02:00:14 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
05:41:18 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
06:03:28 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
06:31:33 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
07:30:38 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
07:30:38 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
07:42:30 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
attached mail follows:
On 06 January 2004 04:06, Tyler Longren wrote:
> Hi,
>
> http://www.php.net/manual/en/faq.html.php#faq.html.select-multiple
>
> I read that. Doesn't work in php since the whole register_globals
> thing. Now, when I get the results from a form, they're all in a
> $_POST[] array. Example.
>
> When I have a <select name="test" MULTIPLE>
> I would have to access the values of the "test" field like this:
> count($_POST['test']);
>
> But since I have to have the [] in the name="<select name="test[]"
> MULTIPLE>" ()part, I get parse errors when trying to read it:
> ex: count($_POST['test[]']);
The array you get is $_POST['test'] -- you can use that just like any other
array, so:
$how_many = count($_POST['test']);
$first = $_POST['test'][0];
$second = $_POST['test'][1];
etc.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
On 06 January 2004 03:58, Tim L wrote:
> I'm not sure if this is intended behaviour or not, but I can
> see that is
> might be. Just thought I would bounce this to see what
> people think about
> it:
>
> <?php
> if (false)
> ?> Hello<?php
> else
> echo "Hi";
>
> echo " World\n";
> ?>
>
> This returns a parse error due to the fact there is no
> brackets around the
> first part of the if statement.
Yes, but that's only part of the story. What you seem to be neglecting here
is that the closing ?> tag also implies a semicolon, so the above is
equivalent to:
<?php
if (false) ;
echo "Hello"
else
echo "Hi";
echo " World\n";
?>
and I'm sure you can see why that is both syntactically and semantically
invalid.
It's because of this implied semicolon that any conditional or loop in which
you break out of PHP must be enclosed in braces, or use the colon syntax.
The following are valid ways of doing what you want:
<?php
if (false) {
?> Hello<?php
}
else
echo "Hi";
echo " World\n";
?>
if (false):
?> Hello <?php
else:
?> Hi <?php
endif;
echo " World\n";
?>
> It seems that because the
> next line after
> the if is not php, then it terminates the if at the closing
> of the php tag.
As I'm sure you can see now, this is becaue of the implied semicolon.
Possibly the easiest way to work out what's going on when you break in and
out of PHP is just to remember that any time you have a fragment like:
?> something <?php
This is treated like
; echo "something"
(Notice the semicolon at the beginning, and the lack of one at the end!)
>
> But if you do this:
>
> <?php
> if (false)
> ?> Hello<?php
> ?>
>
> or
>
> <?php
> if (true)
> ?> Hello<?php
> ?>
These are syntactically valid because the closing ?> tags imply the
necessary semicolons, but semantically wrong because the first one
terminates the if statement -- so the Hello will be output unconditionally
(and a following else would be syntactically invalid again!).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Hi Tim,
>
> <?php
> if (false)
> ?>Hello<?php
> ?>
>
> or
>
> <?php
> if (true)
> ?>Hello<?php
> ?>
>
at first, I'd like to point out that semicolon as a statement separator is
not required before end of the
php fragment and is supplied automatically during parsing. That's why the
if-statements initiated above
are evaluated independently of the rest of code and 'Hello' is always on
output. It is equivalent to:
<?php
if (false);
?>Hello<?php
?>
or
<?php
if (true);
?>Hello<?php
?>
> <?php
> if (false)
> ?>Hello<?php
> else
> echo "Hi";
>
> echo " World\n";
> ?>
>
For this reason the above fragment generates parse error because 'if' is
evaluated separately and then
'else' is unexpected. If You want to interlard the php control blocks (in
case of if, switch, for, etc.
statements) You must use colon syntax as following:
<?php
if (false):
?>Hello<?php
else:
echo "Hi";
endif; //this is is the end of the if statement; its required when using
colon syntax
echo " World\n";
?>
Hope it helps,
Mike
attached mail follows:
Hi all,
I'm quite a newbie ot php/mysql, so my question might be oversimple
(though i tried for hours to understand..)
I'm making an addressbook, as a try out, to see how it al works. All is
great actually, but only the sorting of the addresses seems complicated
for me..
I have a databse called 'addressen', and four fields of this db are
called 'id', 'name', 'surname' and 'address'
To display the content i use this:
<?
include( "file_that_connects_with_my_database.php");
$result = mysql_query(
"SELECT id, name, surname, address FROM addresses");
if (!$result) {
echo( "<p>Error performing query: " .
mysql_error() . "</p>");
exit();
}
while ( $row = mysql_fetch_array($result) ) {
$addressid = $row["id"];
$nametext = $row["name"];
$surnametext = $row["surname"];
$addresstext = $row["address"];
//the table
echo( "<table width='100%' border='0' cellspacing='0'
cellpadding='0'><tr><td>");
echo( $addressid. "</td><td>");
echo( $nametext. "</td><td>");
echo( $surnametext. "</td><td>");
echo( $addresstext "</td><td>");
echo( "</tr></table>");
}
?>
This scripts works, but.. my desire is now to be able to sort the
output, wich is generated by the 'while' loop, for instance on 'name',
or on 'surname' . sort(), ksort()? I couldn't understand the
explanations i found (and so declared myself as newbie :)
Can anybody help me with this? I would be delighted...
Thanks in advange!
Bart Koppe
attached mail follows:
Just add order by to the sql query instead eg
"SELECT id, name, surname, address FROM addresses order by name asc";
or descending on surname
eg
"SELECT id, name, surname, address FROM addresses order by surname desc";
hope this helps
Pete
Bart Koppe wrote:
> Hi all,
>
> I'm quite a newbie ot php/mysql, so my question might be oversimple
> (though i tried for hours to understand..)
> I'm making an addressbook, as a try out, to see how it al works. All is
> great actually, but only the sorting of the addresses seems complicated
> for me..
> I have a databse called 'addressen', and four fields of this db are
> called 'id', 'name', 'surname' and 'address'
> To display the content i use this:
>
> <?
> include( "file_that_connects_with_my_database.php");
> $result = mysql_query(
> "SELECT id, name, surname, address FROM addresses");
> if (!$result) {
> echo( "<p>Error performing query: " .
> mysql_error() . "</p>");
> exit();
> }
> while ( $row = mysql_fetch_array($result) ) {
> $addressid = $row["id"];
> $nametext = $row["name"];
> $surnametext = $row["surname"];
> $addresstext = $row["address"];
> //the table
> echo( "<table width='100%' border='0' cellspacing='0'
> cellpadding='0'><tr><td>");
> echo( $addressid. "</td><td>");
> echo( $nametext. "</td><td>");
> echo( $surnametext. "</td><td>");
> echo( $addresstext "</td><td>");
> echo( "</tr></table>");
> }
> ?>
> This scripts works, but.. my desire is now to be able to sort the
> output, wich is generated by the 'while' loop, for instance on 'name',
> or on 'surname' . sort(), ksort()? I couldn't understand the
> explanations i found (and so declared myself as newbie :)
>
> Can anybody help me with this? I would be delighted...
>
> Thanks in advange!
>
> Bart Koppe
attached mail follows:
[snip]
$result = mysql_query(
"SELECT id, name, surname, address FROM
addresses");
This scripts works, but.. my desire is now to be able to sort the
output, wich is generated by the 'while' loop, for instance on 'name',
or on 'surname' .
[/snip]
Do it in the query
"SELECT id, name, surname, address FROM addresses ORDER BY name"
"SELECT id, name, surname, address FROM addresses ORDER BY surname"
etc.
You can sort the array too, but the database in perfectly equipped to
perform the sort much more efficiently.
attached mail follows:
Hello Bart,
Tuesday, January 6, 2004, 12:40:38 PM, you wrote:
BK> This scripts works, but.. my desire is now to be able to sort the
BK> output, wich is generated by the 'while' loop, for instance on 'name',
BK> or on 'surname' . sort(), ksort()? I couldn't understand the
BK> explanations i found (and so declared myself as newbie :)
It's probably a lot easier to sort the data at the SQL level rather
than messing around with your array.
For example:
$result = mysql_query(
"SELECT id, name, surname, address FROM addresses ORDER BY name DESC");
Will list by name alphabetically (A-Z), change to "ASC" for Z-A).
You can also order by two fields at once:
$result = mysql_query(
"SELECT id, name, surname, address FROM addresses ORDER BY name DESC,
surname DESC");
Or some selective sorting:
$result = mysql_query(
"SELECT id, name, surname, address FROM addresses WHERE name LIKE 'a%'
ORDER BY name DESC");
Will list all names starting with the letter A, in alphabetical order.
--
Best regards,
Richard mailto:rich
launchcode.co.uk
attached mail follows:
I'm trying to use str_replace to ignore sertain characters from a recordset
field and it seems I am having difficulties with ignoring commas and
carriage returns. I've gotten the following but when searching for, let's
say, New York. When York is at the end of a sentence from a recordset field
it is skipped and if it has a comma like York, it is skipped. Any ideas?
Here's the code I'm using so far
//IGNORED CHARACTERS
$replacement = array("\"", "\,", ".", "!", "?");
//CREATE THE ARRAY OF WORDS
//STRIP SLASHES, IGNORE CAPS, IGNORE REPLACEMET CHARACTERS
//$keywords = form field value
$words=explode(" ", stripslashes(strtolower(str_replace($replacement, "",
$keywords))));
attached mail follows:
At 15:29 6-1-04, you wrote:
>I'm trying to use str_replace to ignore sertain characters from a recordset
>field and it seems I am having difficulties with ignoring commas and
>carriage returns. I've gotten the following but when searching for, let's
>say, New York. When York is at the end of a sentence from a recordset field
>it is skipped and if it has a comma like York, it is skipped. Any ideas?
>Here's the code I'm using so far
>
>//IGNORED CHARACTERS
>$replacement = array("\"", "\,", ".", "!", "?");
>
>//CREATE THE ARRAY OF WORDS
>//STRIP SLASHES, IGNORE CAPS, IGNORE REPLACEMET CHARACTERS
>//$keywords = form field value
>$words=explode(" ", stripslashes(strtolower(str_replace($replacement, "",
>$keywords))));
could the problem be that you explode on " " so the phrase 'New York',
having a space, is split up?
attached mail follows:
> could the problem be that you explode on " " so the phrase 'New York',
> having a space, is split up?
Could be. Some times the New is on one line and the York is on the next
line. I need for it to explode no matter what. How would I do that?
For instance the print_r for the array shows me this in one instance. None
of which is hightlighted (and should be) in other words all of these where
skipped and the New York should have been selected. I know that the comma is
causing trouble as well.
/> New [913] => York, [914] => New [915] => York
/> Dear [917] => Mr. [918] => Conlin:
attached mail follows:
At 15:58 6-1-04, you wrote:
> > could the problem be that you explode on " " so the phrase 'New York',
> > having a space, is split up?
>
>Could be. Some times the New is on one line and the York is on the next
>line. I need for it to explode no matter what. How would I do that?
>
>For instance the print_r for the array shows me this in one instance. None
>of which is hightlighted (and should be) in other words all of these where
>skipped and the New York should have been selected. I know that the comma is
>causing trouble as well.
>
>/> New [913] => York, [914] => New [915] => York
>/> Dear [917] => Mr. [918] => Conlin:
well I don't know about the highlighting.
first try to debug by doing the several steps separately,
So start with the str_replace, see if that works as expected. Actually I
wonder why you are escaping the comma "\,". Try to remove that \backslash.
Next idea: what about replacing with " " ?
attached mail follows:
Hello Vernon,
Tuesday, January 6, 2004, 2:29:31 PM, you wrote:
V> I'm trying to use str_replace to ignore sertain characters from a recordset
V> field and it seems I am having difficulties with ignoring commas and
V> carriage returns. I've gotten the following but when searching for, let's
Nowhere in your replacement array do you check for, or remove,
carriage returns.
Add this \n to it:
$replacement = array("\"", "\,", ".", "!", "?", "\n");
Your exploded array should now be correct.
--
Best regards,
Richard mailto:rich
launchcode.co.uk
attached mail follows:
> Nowhere in your replacement array do you check for, or remove,
> carriage returns.
> Add this \n to it:
> $replacement = array("\"", "\,", ".", "!", "?", "\n");
> Your exploded array should now be correct.
When I do this I get some really unexpected results. Almost everything comes
up bold.
attached mail follows:
Hello Vernon,
Tuesday, January 6, 2004, 3:56:18 PM, you wrote:
>> Nowhere in your replacement array do you check for, or remove,
>> carriage returns.
>> Add this \n to it:
>> $replacement = array("\"", "\,", ".", "!", "?", "\n");
>> Your exploded array should now be correct.
V> When I do this I get some really unexpected results. Almost everything comes
V> up bold.
Remove the back-slash before the comma in the replacement array, it
doesn't work if you have it.
Otherwise, it fulfills the criteria of removing the characters you
requested from the string, therefore the error lies elsewhere either
in the original data containing something that isn't being taken into
consideration, or the high-lighting working on different rules.
One possible issue is the fact that if you remove all comma's and
carriage returns, the following:
New York,
was here
will become exploded as:
New
Yorkwas
here
Perhaps you don't want to actually remove carriage returns at all, but
rather substitute them with spaces - like I said though, it depends on
your original data.
--
Best regards,
Richard mailto:rich
launchcode.co.uk
attached mail follows:
Hi!
Anyone know what is the php function for finding the length of the array?
I haven't found the answer at http://us3.php.net/manual/en/ref.array.php .
Thanks,
FletchSOD
attached mail follows:
At 15:44 6-1-04, you wrote:
>Hi!
>
> Anyone know what is the php function for finding the length of the array?
>I haven't found the answer at http://us3.php.net/manual/en/ref.array.php .
looking for the number of elements? -> count($arrayname)
attached mail follows:
Ah! Thanks!!!
"Chris Hayes" <chayes
antenna.nl> wrote in message
news:6.0.1.1.0.20040106154533.05cb86c0
pop4.antenna.nl...
> At 15:44 6-1-04, you wrote:
> >Hi!
> >
> > Anyone know what is the php function for finding the length of the
array?
> >I haven't found the answer at http://us3.php.net/manual/en/ref.array.php
.
> looking for the number of elements? -> count($arrayname)
attached mail follows:
Or you can use sizeof() which is an alias for count()
Scott Fletcher wrote:
> ***********************************************
> This Email Has Been Virus Swept
> ***********************************************
>
> Ah! Thanks!!!
>
> "Chris Hayes" <chayes
antenna.nl> wrote in message
> news:6.0.1.1.0.20040106154533.05cb86c0
pop4.antenna.nl...
>
>>At 15:44 6-1-04, you wrote:
>>
>>>Hi!
>>>
>>> Anyone know what is the php function for finding the length of the
>
> array?
>
>>>I haven't found the answer at http://us3.php.net/manual/en/ref.array.php
>
> .
>
>>looking for the number of elements? -> count($arrayname)
>
>
--
----------------------
www.curvedvision.com
----------------------
This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.
*** This Email Has Been Virus Checked ***
attached mail follows:
As a follow-up to my own post, I found the following resources good for
inspiration of both implementation methods and general insight:
http://gplugs.sourceforge.net/pluginman/
http://nucleuscms.org/documentation/devdocs/plugins.html
I've already written about 1000 words specifying my own ideas for an
API (much more complex and generic than these blog-centric API's), and
I'm pretty excited about where it's heading.
Thanks to Brad for his response too.
Justin French
attached mail follows:
http://www.americansubstandard.com/index.php?sub=v&word=vmail
attached mail follows:
PHP Gurus
A while ago on this list I posted a few questions about an eregi
filter for email addresses entered into a form. With the help of people
on this list, I settled on the following code which has worked fine in
the months since I started using it. The code is this:
eregi('^[a-zA-Z0-9+_.-]+
[a-zA-Z0-9-]+.[a-zA-Z.]+$', $email)
But recently, a person was unable to get their email to pass
this eregi test. The email is valid, as they are able to send email to
me. It has the following format:
xxxxxxxx
xx1.xx-xxx.ne.jp
Shouldn't this email pass? I've allowed for hyphens after the
mark. Is it that there are two many periods?
--
Yoroshiku!
Dave G
ml
autotelic.com
attached mail follows:
On 06 January 2004 15:53, Dave G wrote:
> PHP Gurus
>
> A while ago on this list I posted a few questions about an eregi
> filter for email addresses entered into a form. With the help
> of people
> on this list, I settled on the following code which has worked fine in
> the months since I started using it. The code is this:
>
> eregi('^[a-zA-Z0-9+_.-]+
[a-zA-Z0-9-]+.[a-zA-Z.]+$', $email)
>
> But recently, a person was unable to get their email to pass
> this eregi test. The email is valid, as they are able to send email to
> me. It has the following format:
>
> xxxxxxxx
xx1.xx-xxx.ne.jp
>
> Shouldn't this email pass? I've allowed for hyphens after the
> mark. Is it that there are two many periods?
No. You've only allowed for hyphens in the first element after the
sign
-- this address has them in the 2nd element.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
From: "Dave G" <ml
autotelic.com>
> A while ago on this list I posted a few questions about an eregi
> filter for email addresses entered into a form. With the help of people
> on this list, I settled on the following code which has worked fine in
> the months since I started using it. The code is this:
>
> eregi('^[a-zA-Z0-9+_.-]+
[a-zA-Z0-9-]+.[a-zA-Z.]+$', $email)
>
> But recently, a person was unable to get their email to pass
> this eregi test. The email is valid, as they are able to send email to
> me. It has the following format:
>
> xxxxxxxx
xx1.xx-xxx.ne.jp
>
> Shouldn't this email pass? I've allowed for hyphens after the
> mark. Is it that there are two many periods?
You're only allowing hyphens in the first part of the address after the
symbol, though, before the first period. Maybe your regex should be:
([a-zA-Z0-9-]+\.)+[a-zA-Z.]
Just noticed that your period is not escaped, either, so you're actually
matching any character with the one that's outside of the [ and ] character
classes.
---John Holmes...
attached mail follows:
Hello,
On 01/06/2004 01:52 PM, Dave G wrote:
> A while ago on this list I posted a few questions about an eregi
> filter for email addresses entered into a form. With the help of people
> on this list, I settled on the following code which has worked fine in
> the months since I started using it. The code is this:
>
> eregi('^[a-zA-Z0-9+_.-]+
[a-zA-Z0-9-]+.[a-zA-Z.]+$', $email)
>
> But recently, a person was unable to get their email to pass
> this eregi test. The email is valid, as they are able to send email to
> me. It has the following format:
>
> xxxxxxxx
xx1.xx-xxx.ne.jp
>
> Shouldn't this email pass? I've allowed for hyphens after the
> mark. Is it that there are two many periods?
No, your expression is really excluding many valid addresses. The RFC
specify a much larger number of valid characters. You are also only
allowing one possible dot in the domain name.
I think it is better to allow some possibly invalid sequences and then
perform a DNS/SMTP based validation. In that case you may want to try
this e-mail validation class that performs first a regular expression
based validation with a more complete expression and then performs
DNS/SMTP based validation.
http://www.phpclasses.org/emailvalidation
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
Hello All,
I am trying to import data into MySQL DB using a CSV file (using
phpMyAdmin as the DB Admin tool). I keep getting the following error.
SQL-query :
LOAD DATA LOCAL INFILE '/tmp/phpYRmG0A' INTO TABLE `contacts` FIELDS
TERMINATED BY ';' LINES TERMINATED BY '\n'(
`company` , `first_name` , `last_name` , `pri_practice` , `phone_1` ,
`city` , `state`
)
MySQL said:
Access denied for user: 'master5503
localhost' (Using password: YES)
Here is the CSV file:
Any insights will be appreciated,,,, I had this thing working before
but now I dont know why it seems to be acting up. Thanks in advance.
Pushpinder
attached mail follows:
Hi,
ensure you have FILE privilege on the db-server host.
Mike
"Pushpinder Singh" <pgarcha
adelphia.net> píse v diskusním príspevku
news:CED3FC2F-4067-11D8-9A12-000393874598
adelphia.net...
> Hello All,
>
> I am trying to import data into MySQL DB using a CSV file (using
> phpMyAdmin as the DB Admin tool). I keep getting the following error.
>
> SQL-query :
>
> LOAD DATA LOCAL INFILE '/tmp/phpYRmG0A' INTO TABLE `contacts` FIELDS
> TERMINATED BY ';' LINES TERMINATED BY '\n'(
> `company` , `first_name` , `last_name` , `pri_practice` , `phone_1` ,
> `city` , `state`
> )
>
> MySQL said:
>
> Access denied for user: 'master5503
localhost' (Using password: YES)
>
>
> Here is the CSV file:
>
----------------------------------------------------------------------------
----
>
>
>
> Any insights will be appreciated,,,, I had this thing working before
> but now I dont know why it seems to be acting up. Thanks in advance.
>
> Pushpinder
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]