php-general Digest 15 Jan 2001 14:44:12 -0000 Issue 456

Topics (messages 34540 through 34625):

Freaking difficul thing to do (at least for me)
        34540 by: Romulo Roberto Pereira

Ooops - I forgot the question... Freaking difficul thing to do (at least for me)
        34541 by: Romulo Roberto Pereira

Re: load balancing with php/apache?
        34542 by: Michael Kimsal
        34578 by: php3.developersdesk.com
        34602 by: Tim Parkin

Re: logging page views, which method is better????
        34543 by: Michael Kimsal
        34546 by: Josh G
        34586 by: php3.developersdesk.com
        34597 by: Jason Brooke

Re: Use <?= instead of <%=
        34544 by: Toby Butzon

Re:[PHP] logging page views, which method is better????
        34545 by: George Schlossnagle

transforming an HTML Comment in a HTML TAG
        34547 by: Romulo Roberto Pereira
        34549 by: Jason Murray
        34551 by: Toby Butzon
        34552 by: Romulo Roberto Pereira
        34553 by: Jason Murray
        34554 by: Romulo Roberto Pereira
        34555 by: Jason Murray

Re: [PHP-DEV] cookies and sessions   security
        34548 by: Toby Butzon
        34550 by: Jason Murray

Re: PHP vs JSP
        34556 by: Cal Evans
        34557 by: Joe Stump

tie string value together
        34558 by: Jacky.lilst
        34559 by: Jason Murray
        34563 by: Philip Olson
        34575 by: Brian Clark
        34595 by: Iván Sánchez Ortega \"MR\"

Re: PHP Schedule
        34560 by: Paul Mullen

call time pass by reference - help
        34561 by: Matt Friedman
        34577 by: php3.developersdesk.com

date comparison
        34562 by: Jacky.lilst
        34564 by: Jason Murray
        34566 by: Jacky.lilst

REGEX
        34565 by: Romulo Roberto Pereira
        34576 by: Rasmus Lerdorf

Re: [phplib] Call Time Pass By Reference PROBLEM.
        34567 by: Matt Friedman
        34587 by: Ignatius Teo

Parse Error
        34568 by: Wade Halsey

date comparison II
        34569 by: Jacky.lilst
        34572 by: Jason Murray

I once saw a site where php codes, algorithms specially, where posted.
        34570 by: bbt.teamyehey.com
        34571 by: Jason Murray
        34573 by: Romulo Roberto Pereira

Re: SMs
        34574 by: Alain Fontaine
        34607 by: tarique.sanisoft.com

Display who is onlin
        34579 by: TOM
        34621 by: Toby Butzon

regular expression
        34580 by: Fai
        34604 by: Christian Reiniger

hello
        34581 by: SuiteNet Operations Manager
        34592 by: Brian Clark
        34598 by: Philip Olson
        34600 by: Maxim Maletsky
        34611 by: Kevin Cawthorne

Re: mixing HTML and PHP code
        34582 by: Kristofer Widholm
        34594 by: Iván Sánchez Ortega \"MR\"

Re: Another q, this time eregi_replace
        34583 by: Kristofer Widholm

Re: Searching a MySQL database?
        34584 by: Kristofer Widholm

>From $25 to Half a Million, As Seen on TV
        34585 by: successfulmillionaire.yahoo.com

Re: :: MySql and PHP Book
        34588 by: Kristofer Widholm

Upgrade PHP3 to PHP4
        34589 by: TOM
        34593 by: Brian Clark

__FILE__,$PATH_INFO,$PATH_TRANSLATED
        34590 by: petr.juza.worldonline.cz
        34596 by: Rasmus Lerdorf

Date data type problem
        34591 by: Jacky.lilst

Re: Problem with Exec()
        34599 by: Jon Haworth

Re: variable size limit?
        34601 by: Andrew Threlfall

Perl-like DBI and generic SQL
        34603 by: Dean Hall
        34623 by: Michael Kimsal

Modifying arrays
        34605 by: Catalin Borcea
        34620 by: bard

How does PHP handle %20 (blank spaces)
        34606 by: Nyon
        34615 by: Alejandro Garín

Session cookies appearing where there is no session
        34608 by: CC Zona
        34610 by: CC Zona

Re: Templates
        34609 by: Paul K Egell-Johnsen

Regex for telephone number
        34612 by: Vikram Vaswani
        34616 by: Angus Mann
        34618 by: Spallek, Heiko

[EMAIL PROTECTED]
        34613 by: Kevin Cawthorne

Re: Sessions
        34614 by: Hardy Merrill

imap ssl
        34617 by: elacroix.ifrance.com

Missing function virtual () ???
        34619 by: Frank Gadegast

Apache 1.3.14 - PHP-404 - GD-1.3.8 problems
        34622 by: Kees Hoekzema

Unknown number of fields
        34624 by: Shimon Dekel
        34625 by: Joe Stump

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]


----------------------------------------------------------------------


Hey Folks!

I have the following situation:

I store in a MySQL table part of the HTML code that is used to mount
dinamically the pages of a web site. The file looks something like this:

<?
...
Database stuff
...
include header.inc;

PRINT THE CONTENT OF THE QUERY IN THE DATABASE (that is essentially HTML
tags and text)

include footer.inc;
?>

Before I enter any data in the database I put HTML comments like this: <!--
TEXT --> before and after any text that appear as a result of the HTML
formatting in the browser, like this:

...
<div align=left class=bodytext><!-- TEXT -->This is a bogus text used in
this example in this boring example.<!-- TEXT --></div>
...

My idea was to create a parser later that would get this result from the
database and, in an administration module that I create, let the user modify
the text from the page without touching the HTML code. So let's say:

<!-- TEXT -->
Our companies operate under a very simple set of rules:
<!-- TEXT -->
<ul type="circle" compact>
<li class="white">
<!-- TEXT -->
We try always to offer superior products at competitive prices
<!-- TEXT -->
</li>
<li class="white">
<!-- TEXT -->
We work to develop proprietary technologies that will give us a competitive
advantage
<!-- TEXT -->
</li>
<li class="white">
<!-- TEXT -->
We engage in new enterprises in a controlled and conservative manner
<!-- TEXT -->
</li>
<li class="white">
<!-- TEXT -->
We are committed to our employee&rsquo;s well being and professional
development
<!-- TEXT -->
</li>
</ul>

Would appear in the browser like this:

Our companies operate under a very simple set of rules:

  o  We try always to offer superior products at competitive prices
  o  We work to develop proprietary technologies that will give us a
competitive advantage
  o  We engage in new enterprises in a controlled and conservative manner
  o  We are committed to our employee&rsquo;s well being and professional
development

But in the administration module all the text surrounded by the <!--
TEXT --> tag like this:

<!-- TEXT -->
We are committed to our employee&rsquo;s well being and professional
development
<!-- TEXT -->

would become something like this:

<!-- TEXT -->
We are committed to our employee&rsquo;s well being and professional
development
&nbsp;<a href="edittext.php?pageid=X"><img src="images/edit_buttom.gif"></a>
<!-- TEXT -->

where the edit_buttom.gif would appear beside of each text that could be
edited in that page.

Any ideas?

Thank you in advance,

Rom





Hey Folks!

I have the following situation:

I store in a MySQL table part of the HTML code that is used to mount
dinamically the pages of a web site. The file looks something like this:

<?
...
Database stuff
...
include header.inc;

PRINT THE CONTENT OF THE QUERY IN THE DATABASE (that is essentially HTML
tags and text)

include footer.inc;
?>

Before I enter any data in the database I put HTML comments like this: <!--
TEXT --> before and after any text that appear as a result of the HTML
formatting in the browser, like this:

...
<div align=left class=bodytext><!-- TEXT -->This is a bogus text used in
this example in this boring example.<!-- TEXT --></div>
...

My idea was to create a parser later that would get this result from the
database and, in an administration module that I create, let the user modify
the text from the page without touching the HTML code. So let's say:

<!-- TEXT -->
Our companies operate under a very simple set of rules:
<!-- TEXT -->
<ul type="circle" compact>
<li class="white">
<!-- TEXT -->
We try always to offer superior products at competitive prices
<!-- TEXT -->
</li>
<li class="white">
<!-- TEXT -->
We work to develop proprietary technologies that will give us a competitive
advantage
<!-- TEXT -->
</li>
<li class="white">
<!-- TEXT -->
We engage in new enterprises in a controlled and conservative manner
<!-- TEXT -->
</li>
<li class="white">
<!-- TEXT -->
We are committed to our employee&rsquo;s well being and professional
development
<!-- TEXT -->
</li>
</ul>

Would appear in the browser like this:

Our companies operate under a very simple set of rules:

  o  We try always to offer superior products at competitive prices
  o  We work to develop proprietary technologies that will give us a
competitive advantage
  o  We engage in new enterprises in a controlled and conservative manner
  o  We are committed to our employee&rsquo;s well being and professional
development

But in the administration module all the text surrounded by the <!--
TEXT --> tag like this:

<!-- TEXT -->
We are committed to our employee&rsquo;s well being and professional
development
<!-- TEXT -->

would become something like this:

<!-- TEXT -->
We are committed to our employee&rsquo;s well being and professional
development
&nbsp;<a href="edittext.php?pageid=X"><img src="images/edit_buttom.gif"></a>
<!-- TEXT -->

where the edit_buttom.gif would appear beside of each text that could be
edited in that page.

My question is how I can do that after I get the data from the database? I
mean how I can make this admin module to work?


Thank you in advance,

Rom





Wasn't directed quite at me, but I'll chime in nonetheless....

We used LocalDirector for awhile, with it's 'sticky bit' functionality,
and it basically didn't work with AOL.  I just looked at the
coyote product and they claim it works with 'large ISP' proxies - maybe a veiled
reference to AOL directly (why not just say AOL?).

Do you have any more info on HOW they do this?  The
only thing I can think of is that they code it recognize particular IP blocks
known to be proxies for AOL/mindspring/etc and route ALL traffic from these to a
particular box, which doesn't seem terribly balanced.  OR... they drop a separate
'cookie' or similar header data piece between the server and the client and track
that.

Either way, it seems a bit expensive, although cheaper than LD, last time I
checked.

Personally, we do the 'stateless' model with session data in a database - works
fine.  Your coyote solution is still stateless, but the session data is kept local
to the webserver.

Problem I see with that is that if you need to take a particular machine offline,
hundreds of people could lose their session data.  Same can be said of taking the
database offline, but taking a db offline will probably affect the whole site
anyway.  Part of the benefit of an intelligent load balancer is that you can
remove/take down machines for maintenance/upgrades without worrying about the
impact on the visitors.

Am I missing something?


Alex Black wrote:

> what?
>
> you use an utterly completely stateless model?
>
> craziness!
>
> so you set cookies, and store the sig in the db?
>
> agh! :)
>
> I'm using this box from "coyote systems" called, wait for it:
>
> "THE EQUALIZER"
>
> which is a really obnoxious name, but it sticks clients with a particular
> server intelligently, so we can be ever-so-slightly-lazy about that.
>
> do you _like_ that system? (that isn't a challenge, it's real interest)
>
> _a
>
> --
> Alex Black, Head Monkey
> [EMAIL PROTECTED]
>
> The Turing Studio, Inc.
> http://www.turingstudio.com
>
> vox+510.666.0074
> fax+510.666.0093
>
> Saul Zaentz Film Center
> 2600 Tenth St Suite 433
> Berkeley, CA 94710-2522
>





Addressed to: Alex Black <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from Alex Black <[EMAIL PROTECTED]> Sun, 14 Jan 2001 17:16:50 
-0800
>
> > Whoever said NFS is slow hasn't used a NetApp
>

OK, I'll bite.  What is NetApp?   Network Appliance?


Is this a cache technology, or will it help if I want to transfer 1GB
of data with no duplication?  Once upon a time I was considering using
NFS for backing up my web servers.  Then I found it would take over 150
hours per backup over my 56K Frame Relay link.  I've got it down to
about 46 hours with tar.gz and ftp.  It takes most of my sleep time
during the week.






Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com




A NetApp (Network Appliance) is a big RAID that uses multiple scsi drives to
create a single transparent volume which, with CIFS (transparent filesystem)
can be used by any OS. They are v fast, use NVRAM buffering and can go up to
post terabyte storage capacity without worries. 

Oh and they start at 60k pounds sterling

But they are great. Network Attatched Storage at its best (gigabit fibre
too)

Tim Parkin
Didio Communications

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 15, 2001 08:39
To: Alex Black; [EMAIL PROTECTED]
Subject: Re: [PHP] load balancing with php/apache?


Addressed to: Alex Black <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from Alex Black <[EMAIL PROTECTED]> Sun, 14 Jan 2001
17:16:50 -0800
>   
> > Whoever said NFS is slow hasn't used a NetApp
>   

OK, I'll bite.  What is NetApp?   Network Appliance?


Is this a cache technology, or will it help if I want to transfer 1GB
of data with no duplication?  Once upon a time I was considering using
NFS for backing up my web servers.  Then I found it would take over 150
hours per backup over my 56K Frame Relay link.  I've got it down to
about 46 hours with tar.gz and ftp.  It takes most of my sleep time
during the week.






Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Use a separate DB for something like this - have a data database, and a 'logging'
database.  We're setting up something similar - currently we have 2 databases for
separate things, and will probably merge the first two datasets back into the main
database, and turn the second one into a logger.



Alex Black wrote:

> the problem with that is as soon as you run a load-baanced installation,
> collecting apache logs start to be a pain in the a$$ :)
>
> I have given some thought to the logging thing, but am still undecided re:
> letting apache do its thing, and writing scripts to aggregate the logs, or
> turning off apache logging and going to the DB.
>
> problem is this puts an annoying amount of stress on the production DB, so
> there you have it, the dilemma :)
>
> -a
>
> --
> Alex Black, Head Monkey
> [EMAIL PROTECTED]
>
> The Turing Studio, Inc.
> http://www.turingstudio.com
>
> vox+510.666.0074
> fax+510.666.0093
>
> Saul Zaentz Film Center
> 2600 Tenth St Suite 433
> Berkeley, CA 94710-2522
>
> > From: [EMAIL PROTECTED]
> > Newsgroups: php.general
> > Date: 14 Jan 2001 01:58:33 -0800
> > Subject: Re: [PHP] logging page views, which method is better????
> >
> > Addressed to: "Dallas Kropka" <[EMAIL PROTECTED]>
> > [EMAIL PROTECTED]
> >
> > ** Reply to note from "Dallas Kropka" <[EMAIL PROTECTED]> Sun, 14 Jan 2001
> > 00:57:10 -0600
> >>
> >>
> >> I have a large site, with several hundred pages.... its a product
> >> listing and shopping cart.... and I want to log my page views.... I
> >> receive an average of 3000 hits per minute.
> >>
> >> Is it better (faster) to log my views to a database table? or to a
> >> flat file?
> >
> >
> > No need to re-invent the wheel, all accesses are already being logged.
> >
> >
> > If you are using Apache, take a look at the access log.  Every hit to
> > the server is already logged there.  I am not sure what the default
> > location for the file is, but you can find it with
> >
> > locate access_log
> >
> > or by looking for the string  Log  in your httpd.conf file.  I believe
> > it may appear under either the AccessLog or CustomLog keywords.
> >
> > You might want to look at Webalizer, or a couple of other programs to
> > analyze the contents.
> >
> > http://www.mrunix.net/webalizer/
> >
> > There are others, but this is the one I use.
> >
> >
> >





Another technique is use a quick-and dirty save of one line to a text
file, and have a cron script or somehting similar simply run every
day or every few hours that reads from your home-made log into a
db table, and then empties the file.

Gfunk

       My name was Brian McGee,
       I stayed up listening to Queen,
       When I was seventeen.

http://www.gfunk007.com/






Addressed to: Alex Black <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from Alex Black <[EMAIL PROTECTED]> Sun, 14 Jan 2001 17:06:39 
-0800
>
> the problem with that is as soon as you run a load-baanced
> installation, collecting apache logs start to be a pain in the a$$ :)
>


I am pretty sure you can just run webalizer on the logfiles from each
of your servers and obtain a combined logfile.  I think it might be as
easy as not using incremental mode.  I think I remember seeing
something about this being covered somewhere in the Webalizer docs. It
might also be a matter of using incremental mode.  I don't remember.
You will have to take care not to feed the same file twice.  It has
been a long time since I setup my Webalizer, but I have asked the autor
for clarification.  I will forward the response when I get it.


Another feature I like, you can turn off hostname lookups in Apache and
have Webalizer do them when it analyzes the logs.  It also caches
those DNS lookups as it runs.  This dresticly reduces the number of
DNS requests, and there is no cost at all on the people hitting the
web site(s).


> I have given some thought to the logging thing, but am still
> undecided re: letting apache do its thing, and writing scripts to
> aggregate the logs, or turning off apache logging and going to the
> DB.
>
> problem is this puts an annoying amount of stress on the production
> DB, so there you have it, the dilemma :)

IMHO, the best solution will minimize the delay added to visitiors to
the site.  If it takes too much processing power you can always analyze
the web files on a separate machine so visitiors never are
inconvienenced.  I just run Webalizer at night when my hit counts are
low.



Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com




I take advantage of a handy feature of apache that allows log data to be
piped to another program instead of written to a file - and pipe it's log
data directly to stdin of a small C program which does a tiny bit of parsing
before putting it into mysql.

Before I did it in C, I was just using a Php script - which, incidentally,
was fine - I only redid it in C in the interests of saving a bit of cpu and
memory on the heavily worked servers it's being utilised on.

The beauty of this is that your data is always up to date, you can log any
number of servers to the one central database via tcp (or multiple databases
if you prefer) and you don't have to manage (potentially) unwieldy logfiles.
Also, if at a later date you wanted to go back to using a regular text-file
parser for your stats, there'd be nothing stopping you from dumping out the
database contents back into the Apache log format again.

So far the only negative I can see is that if mysql is down, you lose your
log data for the duration of the downtime. Not a big negative to me, since I
like to make sure mysql is running at least as often as the webserver is.

jason



> the problem with that is as soon as you run a load-baanced installation,
> collecting apache logs start to be a pain in the a$$ :)
>
> I have given some thought to the logging thing, but am still undecided re:
> letting apache do its thing, and writing scripts to aggregate the logs, or
> turning off apache logging and going to the DB.
>
> problem is this puts an annoying amount of stress on the production DB, so
> there you have it, the dilemma :)
>
> -a








I like this one and I think I'll comment on it...

> > can people give me opinions as to why <?= is so bad?
>
>   a. PHP4 specific
>   b. Many do not know what it is / what it does
>   c. Will not work when short_tags are disabled
>   d. Does not follow PEAR standards (ed. guess)
>   e. Looks funny / weird / out of place (opinion)
>

a. You ought to be using an up-to-date version anyway...
b. Many should learn what it is / what it does ;)
c. You can enable short tags; conflicts / reasons not to are rare
d. PEAR is for distributing code, in which case a & c matter & the short
tags should not be used
e. Looks no funnier than <? echo $myVar ?> or <? getMyVar() ?> (IMHO of
course ;) )


>
> On Sun, 14 Jan 2001, Alex Black wrote:
>
> > can people give me opinions as to why <?= is so bad?
> >
> > me = love : <?=
> >

Don't mean to bring this into some kind of unending debate like so many
things seem to get, but I have to agree with Alex. There are a very large
number of applications where using <?= is completely acceptable. I think we
tend to lose sight of that when we start talking about huge web apps...
we're not all building huge web apps... and in fact, a lot of us benefit
from the quick coding time of being able to insert variables with <?=.

My .02 :)

--Toby





For a good distributed logging solution, check out mod_log_spread
(http://www.backhand.org/mod_log_spread/).  It's an apache module that
handles distributed logging by writing logs to reliable multicast
groups.  Additionally, because it multicasts data, additional clients
and log writers can be added on the fly without any additional overhead
or configuration.  It is also provides good handling of mod_vhost_alias
logs.

George

-- 
$_ = 'George Schlossnagle';
s#.#(ord$')-(ord$&)+((index($_,$')-$&)?1002:0)#ego;s#-#((substr($],4,1)-6)?67:$-[0])#eog;$:=$_;print
join('',(map chr$_,reverse
map{substr($:,(3*$_),3)+(11,-109,-14,94,-894,-28,-61,-202,-417,83,-20,-678,53,96,4,-494,82,-869,-826,24,16,-684,-450,-27)[$_]}(0...length($_)/3)),chr(length($_)/2+ord$/),$/);





Hey Folks!

I am bringing from the database HTML source like this:

<li class="white">
<!-- TEXT -->
We are committed to our employee&rsquo;s well being and professional
development
<!-- TEXT -->
</li>

I would like to make this:


<li class="white">
<!-- TEXT -->
We are committed to our employee&rsquo;s well being and professional
development
&nbsp;<a href="edittext.php?pageid=X"><img src="images/edit_buttom.gif"></a>
<!-- TEXT -->
</li>

So, before the end HTML comment I would like to add an image. How do I do that?

Thank you,

Rom




> So, before the end HTML comment I would like to add an image. 
> How do I do that?

The first thing I suggest you do is use a comment for starting and a
comment for ending - this makes it all a LOT easier to parse.

Start: <!-- TEXT STARTS -->
End:   <!-- TEXT ENDS -->

Then, you get your complete text into $buffer and just:

<?
   $endtag = "<!-- TEXT ENDS -->";
   $imgtag = "&nbsp;<a href='edittext.php?pageid=X'>"
            ."<img src='images/edit_buttom.gif'></a>";
   $output = ereg_replace($endtag, $imgtag.$endtag, $buffer);
?>

... or something similar. Not sure if < or > or ! play havoc with a
regex or not...

If you can't change your start and end comments to be unique, then 
you'll have to just do the ereg_replace on every second one.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!




I think the ! might have an effect on the regexp interpretter... it's easy
enough to escape it (\!) though.

--Toby

----- Original Message -----
From: "Jason Murray" <[EMAIL PROTECTED]>
To: "'Romulo Roberto Pereira'" <[EMAIL PROTECTED]>; "php-general"
<[EMAIL PROTECTED]>
Sent: Sunday, January 14, 2001 10:24 PM
Subject: RE: [PHP] transforming an HTML Comment in a HTML TAG


> > So, before the end HTML comment I would like to add an image.
> > How do I do that?
>
> The first thing I suggest you do is use a comment for starting and a
> comment for ending - this makes it all a LOT easier to parse.
>
> Start: <!-- TEXT STARTS -->
> End:   <!-- TEXT ENDS -->
>
> Then, you get your complete text into $buffer and just:
>
> <?
>    $endtag = "<!-- TEXT ENDS -->";
>    $imgtag = "&nbsp;<a href='edittext.php?pageid=X'>"
>             ."<img src='images/edit_buttom.gif'></a>";
>    $output = ereg_replace($endtag, $imgtag.$endtag, $buffer);
> ?>
>
> ... or something similar. Not sure if < or > or ! play havoc with a
> regex or not...
>
> If you can't change your start and end comments to be unique, then
> you'll have to just do the ereg_replace on every second one.
>
> Jason
>
> --
> Jason Murray
> [EMAIL PROTECTED]
> Web Design Team, Melbourne IT
> Fetch the comfy chair!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





This is a nice idea but would not be more efficient if I substitute the
entire block like this:

this is what I have in the database:

<!-- TEXT -->ANY TEXT<!-- TEXT -->

this is what I want:

<!-- TEXT -->ANY TEXT&nbsp;<a href="edittext.php?pageid=X"><img
src="images/edit_buttom.gif"></a><!-- TEXT -->


what youl be a REGEX to substitute that block for this one above?

Thank you,

Rom

> Then, you get your complete text into $buffer and just:
>
> <?
>    $endtag = "<!-- TEXT ENDS -->";
>    $imgtag = "&nbsp;<a href='edittext.php?pageid=X'>"
>             ."<img src='images/edit_buttom.gif'></a>";
>    $output = ereg_replace($endtag, $imgtag.$endtag, $buffer);
> ?>
>
> Jason Murray






> This is a nice idea but would not be more efficient if I 
> substitute the entire block like this:

Not sure - it may be slightly slower to search for a larger block. I
am Jack's complete lack of clue on this matter (Rasmus?).

Either way, it should be easy enough to change that code I gave you
to do that?

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!




> Either way, it should be easy enough to change that code I gave you
> to do that?

I know what you mean, but I have more than 200 rows already with these <!--
TEXT --> surrounding my texts and to modify manually would take ours... I
didn't think in that before...

How would be a REGEX to recognize the <!-- TEXT --> tag and ANY TEXT below?

<!-- TEXT -->ANY TEXT<!-- TEXT -->

because if I could recognize the entire block and make it a string, it would
be possible to use $ in REGEX to exchange only the end of the string. What
do you think?

Thank you





> I know what you mean, but I have more than 200 rows already 
> with these <!-- TEXT --> surrounding my texts and to modify manually 
> would take ours... I didn't think in that before...

Only 200? Why not just do a global search and replace? Or write a
script to do it for you. It'll save you a headache when you get to 
2000. Or 20000.

> How would be a REGEX to recognize the <!-- TEXT --> tag and 
> ANY TEXT below?

Love to help you, but I've already stretched the limit of my regex
knowledge, sorry.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!




Please note:
The php-dev list is for developers of PHP (who create/maintain PHP, which
is written in C); questions about programming in PHP should be addressed to
[EMAIL PROTECTED] For more information, please see
php.net/support.php.

---shifted to php-general from php-dev---
> I would like to ask if it is secure to use php sessions   when dealing
with form passwords,i.e.,  submitting and validating passwords online?
>
> Any idea solutions how can I make the processing of passwords secure?

Just a couple of ideas....
1) Never set a cookie containing a password (I suppose you could MD5 encode
it and do it...)
2) Passwords aren't secure in a basic autorization environment, nor are
they secure if they're sent with an HTML form unless you're on an SSL
connection

Poor security: log in with a form or basic authentication; set cookie on
client with username/password combo (vulnerable to network sniffers,
anybody with access to browser's cookie file)
Decent security: log in with form or basic authentication; set cookie with
session id number and store user information in session database (or
session file or in session memory or however your sessions are handled...)
(vulnerable to sniffers)
Good security: perform auth over a secure connection, set cookie with
session id number and store user information (including ip address) in
session database (and check ip address for a match before allowing any
activity with the session)... (vulnerable to somebody copying a sniffed
session id and spoofing the ip address to trick the remote site)
Very good: keep the thing on a secure connection all the time, set a
session id cookie and keep all user info (possibly including remote ip) in
the server's session db... (vulnerable to nothing I can think of at the
moment...)

There are probably more things you could do I haven't thought of... but
this oughta be a decent start ;)

--Toby





> Very good: keep the thing on a secure connection all the time, set a
> session id cookie and keep all user info (possibly including remote ip) 
> in the server's session db... (vulnerable to nothing I can think 
> of at the moment...)
> 
> There are probably more things you could do I haven't thought 
> of... but this oughta be a decent start ;)

Suggestion, don't send session IDs as cookies, since they may be
sequential and guessable. Instead, grab an MD5 of the session ID, the
remote IP address, and the current time. Throw as much entropy in there
as you can, send the MD5 sum as the cookie value, and store it in
the session table in the database.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!




Actually, I understand what he's trying to say, even if I don't agree with
him. The main problem people have had with load balancing is sessions.  If a
particular scripting language *cough*ASP stores session information in
memory then the load balancing system has to always send the session from a
given user to the same server. (during that session)

IMHO, the easiest way to do this (without writing your own session handling
scheme and then telling people about it but not divulging details!)  ;) is
to store the session info in a database.  Using a central database for all
sessions, any server can get to the session info for any user.

I've just finished leading a team on a large scale JSP application.  While
it is slower to develop in (Java has a high learning curve, IMHO) The
servlet engine we are using, JRun is fairly fast.  Our bottle neck right now
seems to be a poorly tuned Oracle database.

My $0.02,
Cal
http://www.calevans.com


-----Original Message-----
From: Alex Black [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 14, 2001 7:02 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP vs JSP


http://www.zdnet.com/enterprise/stories/linux/0,12249,2646052,00.html

gah:

"Also, any organization doing clustering or failover with PHP is in largely
uncharted waters. "

what _bull_!

what does loadbalancing and clustering have to do with any scripting
language? this guy is obviously one of those dilettantes that things CFML is
the holy grail :P

anyway, that article is wrong, _except_ the part about JSP:
-slow
-extremely time consuming
-friggin annoying :)

I've worked on a couple of projects with JSP, and decided to use PHP to
build binarycloud. 'nuff said :)

_alex



--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] (Donald Goodwill)
> Newsgroups: php.general
> Date: 14 Jan 2001 15:13:12 -0800
> Subject: Re: [PHP] PHP vs JSP
>
> There is an interesting ZD Net comparison of several
> scripting languages at
> http://www.zdnet.com/enterprise/stories/linux/0,12249,2646052,00.html
> Some time ago I did the comparison of JSP to PHP and
> JSP turned out to be much, much slower.
>
> Now I'm just learning CodeCharge generator and so far
> it seems really helpful. I even started redoing one
> project from scratch using it. Maybe surprise your
> client and create both PHP and JSP versions...
>
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: PHP list <[EMAIL PROTECTED]>
> Sent: Sunday, January 14, 2001 7:35 PM
> Subject: [PHP] PHP vs JSP
>
>
>> Hi all
>>
>> I'm busy working on a contract .. and we need to do
> some web based
> stuff
> .. but the client is intent on using jsp and not PHP.
>> Is there somewhere where I can get good comparists
> between the two
> pro and
> cons etc etc ..
>>
>> I would much rather use PHP  then JSP for the
> development
>>
>> Thanks
>> Henti Smith
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






This has been covered extensively in the archives - just an FYI.

--Joe

On Sun, Jan 14, 2001 at 10:10:56PM -0600, Cal Evans wrote:
> Actually, I understand what he's trying to say, even if I don't agree with
> him. The main problem people have had with load balancing is sessions.  If a
> particular scripting language *cough*ASP stores session information in
> memory then the load balancing system has to always send the session from a
> given user to the same server. (during that session)
> 
> IMHO, the easiest way to do this (without writing your own session handling
> scheme and then telling people about it but not divulging details!)  ;) is
> to store the session info in a database.  Using a central database for all
> sessions, any server can get to the session info for any user.
> 
> I've just finished leading a team on a large scale JSP application.  While
> it is slower to develop in (Java has a high learning curve, IMHO) The
> servlet engine we are using, JRun is fairly fast.  Our bottle neck right now
> seems to be a poorly tuned Oracle database.
> 
> My $0.02,
> Cal
> http://www.calevans.com
> 
> 
> -----Original Message-----
> From: Alex Black [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 14, 2001 7:02 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP vs JSP
> 
> 
> http://www.zdnet.com/enterprise/stories/linux/0,12249,2646052,00.html
> 
> gah:
> 
> "Also, any organization doing clustering or failover with PHP is in largely
> uncharted waters. "
> 
> what _bull_!
> 
> what does loadbalancing and clustering have to do with any scripting
> language? this guy is obviously one of those dilettantes that things CFML is
> the holy grail :P
> 
> anyway, that article is wrong, _except_ the part about JSP:
> -slow
> -extremely time consuming
> -friggin annoying :)
> 
> I've worked on a couple of projects with JSP, and decided to use PHP to
> build binarycloud. 'nuff said :)
> 
> _alex
> 
> 
> 
> --
> Alex Black, Head Monkey
> [EMAIL PROTECTED]
> 
> The Turing Studio, Inc.
> http://www.turingstudio.com
> 
> vox+510.666.0074
> fax+510.666.0093
> 
> Saul Zaentz Film Center
> 2600 Tenth St Suite 433
> Berkeley, CA 94710-2522
> 
> 
> 
> 
> > From: [EMAIL PROTECTED] (Donald Goodwill)
> > Newsgroups: php.general
> > Date: 14 Jan 2001 15:13:12 -0800
> > Subject: Re: [PHP] PHP vs JSP
> >
> > There is an interesting ZD Net comparison of several
> > scripting languages at
> > http://www.zdnet.com/enterprise/stories/linux/0,12249,2646052,00.html
> > Some time ago I did the comparison of JSP to PHP and
> > JSP turned out to be much, much slower.
> >
> > Now I'm just learning CodeCharge generator and so far
> > it seems really helpful. I even started redoing one
> > project from scratch using it. Maybe surprise your
> > client and create both PHP and JSP versions...
> >
> >
> > ----- Original Message -----
> > From: <[EMAIL PROTECTED]>
> > To: PHP list <[EMAIL PROTECTED]>
> > Sent: Sunday, January 14, 2001 7:35 PM
> > Subject: [PHP] PHP vs JSP
> >
> >
> >> Hi all
> >>
> >> I'm busy working on a contract .. and we need to do
> > some web based
> > stuff
> > .. but the client is intent on using jsp and not PHP.
> >> Is there somewhere where I can get good comparists
> > between the two
> > pro and
> > cons etc etc ..
> >>
> >> I would much rather use PHP  then JSP for the
> > development
> >>
> >> Thanks
> >> Henti Smith
> >>
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email at your own domain with Yahoo! Mail.
> > http://personal.mail.yahoo.com/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

Joe Stump, PHP Hacker
[EMAIL PROTECTED]
http://www.miester.org/





hi all,
This may sound too easy to ask but I want ot make sure if I'm correct. I
have a form with date, month and year select fields in it. When I submit, i
want to tie those three fields value together and insert into a field in
table which has date data type. Is it correct to tie those three value like
below?

$Birthdate = $year&$month&&day;

And I will insert value in $Birthdate into table.

cheers
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"





> This may sound too easy to ask but I want ot make sure if I'm correct. I
> have a form with date, month and year select fields in it. When I submit,
i
> want to tie those three fields value together and insert into a field in
> table which has date data type. Is it correct to tie those three value
like
> below?
> 
> $Birthdate = $year&$month&&day;
> 
> And I will insert value in $Birthdate into table.

Not quite. right idea, wrong syntax. 

You're just doing a simple string concatenation, so what you actually
want is this:

$Birthdate = $year . $month . $day;

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!




Also, a great tutorial on strings is (print this out)    :

    Using Strings                                        :
    ------------------------------------------------------
    http://www.zend.com/zend/tut/using-strings.php
    by Nathan Wallace

As well as the manual entry :

    PHP Manual -> Strings                                :
    ------------------------------------------------------
    http://www.php.net/manual/en/language.types.string.php
    by An unknown friend

The above information will prove helpful.  Keyword here is, 
as mentioned and demonstrated by Jason, Concatenation.


Regards,


Philip Olson
http://www.cornado.com/
                                         be outside the box.
                          


On Mon, 15 Jan 2001, Jason Murray wrote:

> > This may sound too easy to ask but I want ot make sure if I'm correct. I
> > have a form with date, month and year select fields in it. When I submit,
> i
> > want to tie those three fields value together and insert into a field in
> > table which has date data type. Is it correct to tie those three value
> like
> > below?
> > 
> > $Birthdate = $year&$month&&day;
> > 
> > And I will insert value in $Birthdate into table.
> 
> Not quite. right idea, wrong syntax. 
> 
> You're just doing a simple string concatenation, so what you actually
> want is this:
> 
> $Birthdate = $year . $month . $day;
> 
> Jason
> 
> -- 
> Jason Murray
> [EMAIL PROTECTED]
> Web Design Team, Melbourne IT
> Fetch the comfy chair!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 






Hello Jacky, 

(Jl == "Jacky@lilst") [EMAIL PROTECTED] writes:

Jl> This may sound too easy to ask but I want ot make sure if I'm
Jl> correct. I have a form with date, month and year select fields in
Jl> it. When I submit, i want to tie those three fields value together
Jl> and insert into a field in table which has date data type. Is it
Jl> correct to tie those three value like below?

Jl> $Birthdate = $year&$month&&day;

Not quite; you want the concatenation operator:

$Birthdate = $year . $month . $day; /* assuming &&day was a typo */

This will also work:

$Birthdate = "$year$month$day";

And so will this:

$Birthdate = "${year}${month}${day}";


Jl> And I will insert value in $Birthdate into table.

Jl> cheers
Jl> Jack

-Brian






"Brian Clark" ...
>
> Not quite; you want the concatenation operator:
>
> $Birthdate = $year . $month . $day; /* assuming &&day was a typo */
>
> This will also work:
>
> $Birthdate = "$year$month$day";

As i know, databases use a 00/00/0000 date format, so the thing you may do
is

$birthdate = $day . "/" . $month . "/" . $year;
or
$birthdate = "$day/$month/$year";

But you should refer to your database's documentation, i'm not sure it's
always true.







>> For example: the week number is 26, and I have to know which 
>> was its first day (the date, not the day of the week), say 06/21/2001, 
>> monday.
>
>If the week number is 26, then thats 26 x 7 = 182 days into the year.

That would give him the number of days into the year the last day of week 
26 falls. To find the first day of week 26, the equation changes to:

(26*7)-6 = 176 days into the year. So that

first_day = ((week_number * 7) - 6)





There are a number of methods in the session class of phplib.

With phplib and php4.0.4 I am seeing the following warnings:
Warning: Call-time pass-by-reference has been deprecated - argument passed
by value; If you would like to pass it by reference, modify the declaration
of [runtime function name](). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true in
your INI file. However, future versions may not support this any longer. in
/adm/vhosts/theparentreport.com/www/phplib/session.inc on line 273

Warning: Call-time pass-by-reference has been deprecated - argument passed
by value; If you would like to pass it by reference, modify the declaration
of [runtime function name](). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true in
your INI file. However, future versions may not support this any longer. in
/adm/vhosts/theparentreport.com/www/phplib/session.inc on line 304

Warning: Call-time pass-by-reference has been deprecated - argument passed
by value; If you would like to pass it by reference, modify the declaration
of [runtime function name](). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true in
your INI file. However, future versions may not support this any longer. in
/adm/vhosts/theparentreport.com/www/phplib/session.inc on line 305

Warning: Call-time pass-by-reference has been deprecated - argument passed
by value; If you would like to pass it by reference, modify the declaration
of [runtime function name](). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true in
your INI file. However, future versions may not support this any longer. in
/adm/vhosts/theparentreport.com/www/phplib/session.inc on line 311

What should I do to fix this???


Matt Friedman





Addressed to: "Matt Friedman" <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from "Matt Friedman" <[EMAIL PROTECTED]> Sun, 14 Jan 2001 
21:21:32 -0800
>
> There are a number of methods in the session class of phplib.
>
> With phplib and php4.0.4 I am seeing the following warnings: Warning:
> Call-time pass-by-reference has been deprecated - argument passed by
> value; If you would like to pass it by reference, modify the
> declaration of [runtime function name](). If you would like to enable
> call-time pass-by-reference, you can set
> allow_call_time_pass_reference to true in your INI file. However,
> future versions may not support this any longer. in
> /adm/vhosts/theparentreport.com/www/phplib/session.inc on line 273


In the existing code things are passed by reference where the calls are
made.  The places you see these warnings.  This style is going out of
style, in favor of one where you define passing by reference in the
function definition.

What to do:

Change the function calls from:


   function_whatever( &$var1, &$var2 );


to

   function_whatever( $var1, $var2 );


and change the finction definitions from:

   function function_whatever( $var1, $var2 ) {


to:

   function function_whatever( &$var1, &$var2 ) {


For now, since these are just warnings you could just turn down error
reporting, or enable allow_call_time_pass_reference as shown in the
warning, but you should seriously consider fixing the problem by
changing the code. Someday soon PHP will no longer allow the old syntax
at all.


For more information see:

   http://www.php.net/manual/en/html/language.references.html

and:

   http://www.php.net/manual/en/html/features.error-handling.html




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com




Greeting all,
Just now I asked about to tie string values together and would like to thank
Jason for that. Anyway one more thing, after I have tied string values
together and assigned that to a virables. can I used the value from that
variables to compare with another date value? Say another date value I will
use is also retrieved from a field in table which is in Date data type as
well. So it will be like


$query = "select myBirthdate from date where userId='1' ";
$dateResult =mysql_query($query);
$myBirthDate = (mysql_result($dateResult,0,"myBirthdate"));

$thisBirthdate = "$year"."$month"."$day";

if ($thisBirthdate < $myBirthdate) {
do something
} else {
 do some other thing
}

Is it the correct way to do that?
cheers
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"





> can I used the value from that variables to compare with another 
> date value? Say another date value I will use is also retrieved 
> from a field in table which is in Date data type as well.

When you get into this stuff, it all starts getting a lot more complicated.

If you want to compare two fields, make sure they're in the same format.

Basically, make sure you use four digit years and two digit months and
days to create your birthday fields, so they look like (for example, with
today's date, 20010115 instead of 2001115 - that second one could really 
be anything).

If you're sure you're storing the birthdays properly, you can then cut
the strings up when you pull them out of the database, the first 4 chars
are the year, the next two make the month (regardless of the actual month,
this way it'll be "01" not "1"), then the day. 

Do that for both of the dates.

Now, you can use the mktime() command to turn them into unix tiumestamps.

$unixtimeme   = mktime(myhour, myminute, mysecond, mymonth, myday, myyear);
$unixtimethem = mktime(theirhour, theirminute, theirsecond, theirmonth,
theirday, theiryear);

Now, a unix timestamp is the number of seconds from 00:00:01, Jan 1, 1970.

You can figure out the difference in seconds between the two timestamps.

Divide it by (24*3600), which is the number of seconds in a day, and there
you have the number of days between the dates.

Incidentally, if you want to find the number of days between your birthDAYS,
then you'll want to substitute in a specific year in the mktime() statements
above, as you'll otherwise end up with the number of days between your exact
DATES of birth.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!




all right, now I have both date values in the same format (yyyy/mm/dd), say
$Date1 = 20010115 and $Date2 =20010120. If what I want is to find out if
$Date1 come before $Date2, can I just use this sniplet below?

if ($Date1 < $Date2) {
...........
} else {
.......
}

Do I still need to use mktime() for this purpose?
cheers
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
----- Original Message -----
From: Jason Murray <[EMAIL PROTECTED]>
To: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, January 14, 2001 11:37 PM
Subject: RE: [PHP] date comparison


> > can I used the value from that variables to compare with another
> > date value? Say another date value I will use is also retrieved
> > from a field in table which is in Date data type as well.
>
> When you get into this stuff, it all starts getting a lot more
complicated.
>
> If you want to compare two fields, make sure they're in the same format.
>
> Basically, make sure you use four digit years and two digit months and
> days to create your birthday fields, so they look like (for example, with
> today's date, 20010115 instead of 2001115 - that second one could really
> be anything).
>
> If you're sure you're storing the birthdays properly, you can then cut
> the strings up when you pull them out of the database, the first 4 chars
> are the year, the next two make the month (regardless of the actual month,
> this way it'll be "01" not "1"), then the day.
>
> Do that for both of the dates.
>
> Now, you can use the mktime() command to turn them into unix tiumestamps.
>
> $unixtimeme   = mktime(myhour, myminute, mysecond, mymonth, myday,
myyear);
> $unixtimethem = mktime(theirhour, theirminute, theirsecond, theirmonth,
> theirday, theiryear);
>
> Now, a unix timestamp is the number of seconds from 00:00:01, Jan 1, 1970.
>
> You can figure out the difference in seconds between the two timestamps.
>
> Divide it by (24*3600), which is the number of seconds in a day, and there
> you have the number of days between the dates.
>
> Incidentally, if you want to find the number of days between your
birthDAYS,
> then you'll want to substitute in a specific year in the mktime()
statements
> above, as you'll otherwise end up with the number of days between your
exact
> DATES of birth.
>
> Jason
>
> --
> Jason Murray
> [EMAIL PROTECTED]
> Web Design Team, Melbourne IT
> Fetch the comfy chair!
>





Hey people!

What is wrong with this code?

 $buffer = split("([0-9] -->)",$pagedata);
 $x = count ($buffer);
 echo $x;
 for ($i=0;$i<$x;$i++) {
   ereg("([0-9] -->)", $buffer[$i], $text);
  ereg_replace (" -->","", $text[1]);
  echo $text[1];
 }

Since $pagedata has 8 appearences of the REGEX I am looking for and it is
only printing the first one...

Help! ;-)

Thank you,

Rom





First, the ()'s in the split regex makes no sense.  Split has no registers
to save stuff to.

Second, that is a rather clunky way to loop through an array.

Third, since the regex in split defines the delimiter to use to split the
string on, the actual "1 -->" part of the data is gone.  Why are you
checking for it via an ereg() call in the loop?

As far as I can tell, you simply want this:

 $buffer = split("[0-9] -->",$pagedata);
 foreach($buffer as $val) echo "$val<br>\n";

But then again, I don't really know what you are trying to do here.

-Rasmus

On Mon, 15 Jan 2001, Romulo Roberto Pereira wrote:

> Hey people!
>
> What is wrong with this code?
>
>  $buffer = split("([0-9] -->)",$pagedata);
>  $x = count ($buffer);
>  echo $x;
>  for ($i=0;$i<$x;$i++) {
>    ereg("([0-9] -->)", $buffer[$i], $text);
>   ereg_replace (" -->","", $text[1]);
>   echo $text[1];
>  }
>
> Since $pagedata has 8 appearences of the REGEX I am looking for and it is
> only printing the first one...
>
> Help! ;-)
>
> Thank you,
>
> Rom
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Ok, but the warning says that call time pass by reference is deprecated. 

Will there be an update at some point to address this in phplib?

Matt Friedman
Spry New Media
http://www.sprynewmedia.com
Lead Programmer/Partner
email: [EMAIL PROTECTED]
phone: 250 744 3655
fax: 250 370 0436


----- Original Message ----- 
From: "nathan r. hruby" <[EMAIL PROTECTED]>
To: "Matt Friedman" <[EMAIL PROTECTED]>
Sent: Sunday, January 14, 2001 9:20 PM
Subject: Re: [phplib] Call Time Pass By Reference PROBLEM.


> On 1/15/01 12:19 AM, "Matt Friedman" <[EMAIL PROTECTED]> wrote:
> 
> > I just set up phplib on a server with php4.0.4 running.
> > I'm getting all these warnings from the session class.
> > 
> > Can I just add an "@" to the argument call in the function???
> > 
> > Any word on how to fix this or update the class, please let me know.
> > 
> 
> In php.ini set allow_call_time_pass_reference = true
> 
> -n
> 
> ........
> nathan hruby
> Webmaster: UGA Department of Drama and Theatre
> Project Maintainer: phpSlash, Carousel
> [EMAIL PROTECTED]
> ........
> 
> 
> 





Hi,

I got around this by changing the following two functions below. Basically
you can remove the call by reference construct &$str by resetting $str to
its returned value:

  function serialize($prefix, $str) {
    static $t,$l,$k;

    ## Determine the type of $$prefix
    eval("\$t = gettype(\$$prefix);");
    switch ( $t ) {

      case "array":
        ## $$prefix is an array. Enumerate the elements and serialize them.
        eval("reset(\$$prefix); \$l = gettype(list(\$k)=each(\$$prefix));");
        $str .= "\$$prefix = array(); ";
        while ( "array" == $l ) {
          ## Structural recursion
          $str = $this->serialize($prefix."['".ereg_replace("([\\'])",
"\\\\1", $k)."']", $str);
          eval("\$l = gettype(list(\$k)=each(\$$prefix));");
        }

      break;
      case "object":
        ## $$prefix is an object. Enumerate the slots and serialize them.
        eval("\$k = \$${prefix}->classname; \$l =
reset(\$${prefix}->persistent_slots);");
        $str.="\$$prefix = new $k; ";
        while ( $l ) {
          ## Structural recursion.
          $str = $this->serialize($prefix."->".$l,$str);
          eval("\$l = next(\$${prefix}->persistent_slots);");
        }

      break;
      default:
        ## $$prefix is an atom. Extract it to $l, then generate code.
        eval("\$l = \$$prefix;");
        $str.="\$$prefix = '".ereg_replace("([\\'])", "\\\\1", $l)."'; ";


      break;
    }
                return $str;
  }

  ## freeze():
  ##
  ## freezes all registered things ( scalar variables, arrays, objects )
into
  ## a database table

  function freeze() {
    $str="";

    $str = $this->serialize("this->in",$str);
    $str = $this->serialize("this->pt",$str);

    reset($this->pt);
    while ( list($thing) = each($this->pt) ) {
      $thing=trim($thing);
      if ( $thing ) {
        $str = $this->serialize("GLOBALS['".$thing."']",$str);
      }
    }

    $r = $this->that->ac_store($this->id, $this->name, $str);
    $this->release_lock();
    if(!$r) $this->that->ac_halt("Session: freeze() failed.");
  }

Ignatius
> -----Original Message-----
> From: Matt Friedman [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 15 January 2001 17:20
> To: nathan r. hruby; PHPLIB Mailing List; php general
> Subject: Re: [phplib] Call Time Pass By Reference PROBLEM.
>
>
> Ok, but the warning says that call time pass by reference is deprecated.
>
> Will there be an update at some point to address this in phplib?
>
> Matt Friedman
> Spry New Media
> http://www.sprynewmedia.com
> Lead Programmer/Partner
> email: [EMAIL PROTECTED]
> phone: 250 744 3655
> fax: 250 370 0436
>
>
> ----- Original Message -----
> From: "nathan r. hruby" <[EMAIL PROTECTED]>
> To: "Matt Friedman" <[EMAIL PROTECTED]>
> Sent: Sunday, January 14, 2001 9:20 PM
> Subject: Re: [phplib] Call Time Pass By Reference PROBLEM.
>
>
> > On 1/15/01 12:19 AM, "Matt Friedman" <[EMAIL PROTECTED]> wrote:
> >
> > > I just set up phplib on a server with php4.0.4 running.
> > > I'm getting all these warnings from the session class.
> > >
> > > Can I just add an "@" to the argument call in the function???
> > >
> > > Any word on how to fix this or update the class, please let me know.
> > >
> >
> > In php.ini set allow_call_time_pass_reference = true
> >
> > -n
> >
> > ........
> > nathan hruby
> > Webmaster: UGA Department of Drama and Theatre
> > Project Maintainer: phpSlash, Carousel
> > [EMAIL PROTECTED]
> > ........
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>





Hi

Im getting a parse error with this:

$sqlCheckLogin = sqlExecute( "Select * from Sky where SkyUName = 
'".$HTTP_POST_VARS['UserName']."'
                              AND SkyPasswd = '".($HTTP_POST_VARS['Password'])."'" ) ;

Help!!!!




Hi people,
may be I did not make my question clear about what I try to do. Basically if I have 2 
date values in the same format like yyyy-mm-dd, can I use both values to find out if 
one come before another and then display message or something? Say I have $date1 = 
20010115 and $date2 = 20010120 ( which of course we can easily tell that $date1 come 
before $date2). Can I use the sniplet below:

if ($date1 < $date2) {
......
}else{
.....
}
 
Or do I need mktime() command to convert $date1 and $date2 like 

if (mktime($date1) < mktime9$date2)) {
.....
}else{
....
}

cheers
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"




> may be I did not make my question clear about what I try to 
> do. Basically if I have 2 date values in the same format like 
> yyyy-mm-dd, can I use both values to find out if one come 
> before another and then display message or something? Say I 
> have $date1 = 20010115 and $date2 = 20010120 ( which of 
> course we can easily tell that $date1 come before $date2). 
> Can I use the sniplet below:

Yep, you can use a simple > conversion in that case as long as its
YMD :)

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!




It has px...something...i cannot remember the exact site.

could someone point me to that site? 

thank you.

bernie






> It has px...something...i cannot remember the exact site.
> 
> could someone point me to that site? 

http://px.sklar.com

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!




I think that is what you are looking for...

http://px.sklar.com/

anyway in php.net they have a bunch of them in the links section.

Have fun!

Rom
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 15, 2001 1:23 AM
Subject: [PHP] I once saw a site where php codes, algorithms specially,
where posted.


> It has px...something...i cannot remember the exact site.
>
> could someone point me to that site?
>
> thank you.
>
> bernie
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





Hi,

This "special server" is usually called an SMSC - SMS Center, run by your
mobile operator. These SMSC's are pretty powerful in the way that you can
access them through TCP (VPN for sure, and sometimes even HTTP), or through
a direct link connexion. You'd need to talk to your mobile operator to get
an access to it, though. Most offer that as a (paying) service to companies
whow ould like to easily send out mass SMS's to their employees, truck
drivers, agents, etc.

Complete specification for a pretty much used SMSC can be found on the NOKIA
site, in the developer's section.

Now I'm glad I had something to contribute to this list ;)

""Bastian"" <[EMAIL PROTECTED]> a écrit dans le message news:
93s5n7$sh7$[EMAIL PROTECTED]
> Hello!
>
> A requirement is a special server that sends them, but such a server costs
> money, every message costs some.
> Another way is to send the messages to the mailaddress. I only know it
from
> Germany: [EMAIL PROTECTED]
>
> Bastian
>
>
> --
>
>
>
>
>
>
> ********//End of message********
> "Dhaval Desai" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > HI!
> >
> > I am trying to build a SMS(Short message service)
> > mesaging system..can anybody tell me what are the
> > requirements for this...
> >
> > Thanx a lot!
> > Dhaval Desai
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email at your own domain with Yahoo! Mail.
> > http://personal.mail.yahoo.com/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






On Sat, 13 Jan 2001, Dhaval Desai wrote:
Hi Dhaval,

> I am trying to build a SMS(Short message service)
It is really very simple as long as you have a tie up with SMSC (usually a
mobile phone service operator) 

Then all you have to do is (in most cases) send a specially formatted
email to the SMSC the email address is usually
[EMAIL PROTECTED] 

> mesaging system..can anybody tell me what are the
> requirements for this...
For developement purposes visit http://www.gnokii.org 

Cheers
Tarique

-- 
=========================================
       B2B Application Providers
        http://www.sanisoft.com
 Vortal for Nagpur http://nagpurcity.net
=========================================





Is it possible to find out who is logged in a site and display their name in
PHP?

--
best wishes,
enethk






This has been discussed before; you should probably check the archives (see
php.net/support.php for list of archives; one archive can be found at
marc.theaimsgroup.com).

--Toby

----- Original Message -----
From: "TOM" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 15, 2001 2:36 AM
Subject: [PHP] Display who is onlin


> Is it possible to find out who is logged in a site and display their name
in
> PHP?






^.+@.+\\..+$  This regular expression can check if the email address is
valid. But it cannot validate the email address with two "@", does anybody
know how to enhance this regular expression to be able to validate the email
address with two "@".






On Monday 15 January 2001 09:03, Fai wrote:
> ^.+@.+\\..+$  This regular expression can check if the email address is
> valid. But it cannot validate the email address with two "@", does

I use this code:

/*
 * Check whether the supplied string is a
 * (syntactically) valid email address
 * Only does a very rough check. Checking for complete
 * validity is nearly impossible.
 */
function pbIsMailAddress ($Address)
{
        // strip comments
        while (preg_match ('/\([^()]*\)/', $Address))
                $Address = preg_replace ('/\([^()]*\)/', '', $Address);

        // strip leading/trailing whitespace
        $Address = trim ($Address);

        // check for basic form
        return preg_match ('/^[^@]+@[\w-]+(\.[\w-]+)+$/', $Address);
}

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Software is like sex: the best is for free" -- Linux Torvalds




I was wondering what Im sure a well knowledged php expert like your self
would recommend a hands on php crash course. The best way for me to jump
right in to understanding php and getting started making my first data
base.
with php3 and mysql. I understand that is how you have to do it.
See Im running a apache server that my father started.
And up to this point have been working with basic cgi stuff and dealing
with  tech support and  minor web design.
But I need to get into data base stuff and the only way Im going to be
able to make something like a shopping cart or anything of that nature
is to learn.
My father knew allot of this stuff but Un fortunately he past away and
Im stuck. So any suggestions would be great and can I count on you to
answer any questions I might have. I have been going to the php.net
site. And are starting there.
Thank you and god Bless.

Ps. Any books you think would be my best start.
Im pretty good at picking things up but I have never messed with
php3 either.
I also Know about php4 but I have users I guess up till now are using
php3 will this change what the are doing and continuing to do. I mean do
they have learn and change everything to or is it I except everything
till now and then more of what php4 offers too. Im not sure how that
works.
I do not want to change anything on the server UN LESS IM VERY VERY
SURE<<<
Ok well I thank you so much. 

-- 
Regards
Herb McDonald





Hello Herb,

(SOM == "SuiteNet Operations Manager") [EMAIL PROTECTED] writes:

SOM> I was wondering what Im sure a well knowledged php expert like
SOM> your self would recommend a hands on php crash course. The best
SOM> way for me to jump right in to understanding php and getting
SOM> started making my first data base.

These are a good start, then move on to some of the other sites on the
links page.

http://www.php.net/manual/en/html/introduction.html
http://www.php.net/tut.php
http://www.php.net/links.php


SOM> Ps. Any books you think would be my best start.

http://www.php.net/books.php

SOM> I also Know about php4 but I have users I guess up till now are
SOM> using php3 will this change what the are doing and continuing to
SOM> do. I mean do they have learn and change everything to or is it I
SOM> except everything till now and then more of what php4 offers too.
SOM> Im not sure how that works.

Most of it is the same, but there are small differences. Be sure you
read this:

http://www.php.net/version4/migration.php

I would also suggest that you notify your users and give them a chance
to respond if they wish.

SOM> I do not want to change anything on the server UN LESS IM VERY
SOM> VERY SURE<<<

Agreed.

SOM> Ok well I thank you so much.

Hope I helped, and best of luck.

-Brian






Hi Herb,

PHP is wonderful.  Regarding any upgrade issues, check out :

    http://www.php.net/FAQ.php#11
    http://www.php.net/version4/migration.php
    http://www.opendeveloper.org/PHP/HowTo/Upgrading_From_PHP3_to_PHP4/

AFAIK, it *won't* cause problems upgrading.  Do be sure to parse the
current extension though (i.e. be sure to keep .php3 within httpd.conf)
For information on all this check out :

    http://www.e-gineer.com/instructions/
    http://www.php.net/manual/en/install.unix.php

Doing it at 3am is suggested and giving users some warning just in case 
:-)  Regarding learning php, there are some main sites to consider for
learing :

    http://www.devshed.com/
    http://www.phpbuilder.com/
    http://www.zend.com/
    http://php.faqts.com/

There are others (and others).  Like for instance :

    http://php.faqts.com/
    http://www.thickbook.com/
    http://www.weberdev.com/
    http://www.google.com/
    http://www.google.com/
    http://www.google.com/

Regarding books, the wrox books are popular, check them out.  The php
site lists books and by purchasing there money goes to PHP effort, list 
is here :

    http://www.php.net/books.php

And you will need to know SQL, here is a basic tutorial :

    http://www.sqlcourse.com/

And if you want to know my favorite php tutorial that I wish all php users
would consider and print out it is as follows :

    http://www.zend.com/zend/tut/using-strings.php

And remember, practise makes perfect this is so very true.  Nobody is
perfect and we've all written crappy code in the past (and present) so
it's okay.  And, nobody memorizes the manual, keep this in mind.  It's a
reference/tool.  It is very valuable and contains many useful friendly
examples.  At least skimming through it and working the examples through
(if not code, at least in head and say to self "ahhhhh, that makes sense")
it is important as in the future when one wants to do something the brain
will think "hmm, I've read about this once before" and thus one searches
the manual and finds.  Also, searching the mailing list is very important,
use one or two specific words that are sure to exist in question.  It is
okay to ask questions but odds are someone else has asked a similar
question in past,  an archive is found here (google also keeps this
archive!!!):

    http://marc.theaimsgroup.com/?l=php-general

It is very useful to add this and php site to browser "command line" and
instruction on this can be found here :

    http://www.php.net/tips.php

That's what comes to mind at this point, hopefully this rambling email
makes sense.  Just remember, start small.   Build an addressbook.  After
that, add features to it like make sure user inputs real data (not blank
(empty), is x characters in length (strlen) or is an email address (ereg). 
Then make users name in addressbook apear with First Letter Capitalized
(ucwords) and so on, so forth.  Also, be sure to research, it is very
useful to do. If one wants to do something odds are there is a function to
do it or a function was created to help do it.  For scripts, look here :

    http://www.hotscripts.com/
    http://px.sklar.com/
    http://www.freshmeat.net/
    http://www.sourceforge.net/

And through all that all will be good.  This now concludes this post,  
good luck!


Philip


--
Philip Olson
http://www.cornado.com/

On Mon, 15 Jan 2001, SuiteNet Operations Manager wrote:

> I was wondering what Im sure a well knowledged php expert like your self
> would recommend a hands on php crash course. The best way for me to jump
> right in to understanding php and getting started making my first data
> base.
> with php3 and mysql. I understand that is how you have to do it.
> See Im running a apache server that my father started.
> And up to this point have been working with basic cgi stuff and dealing
> with  tech support and  minor web design.
> But I need to get into data base stuff and the only way Im going to be
> able to make something like a shopping cart or anything of that nature
> is to learn.
> My father knew allot of this stuff but Un fortunately he past away and
> Im stuck. So any suggestions would be great and can I count on you to
> answer any questions I might have. I have been going to the php.net
> site. And are starting there.
> Thank you and god Bless.
> 
> Ps. Any books you think would be my best start.
> Im pretty good at picking things up but I have never messed with
> php3 either.
> I also Know about php4 but I have users I guess up till now are using
> php3 will this change what the are doing and continuing to do. I mean do
> they have learn and change everything to or is it I except everything
> till now and then more of what php4 offers too. Im not sure how that
> works.
> I do not want to change anything on the server UN LESS IM VERY VERY
> SURE<<<
> Ok well I thank you so much. 
> 
> -- 
> Regards
> Herb McDonald
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 






Actually it does..

I've seen it so many times on this list...  subjects like: HEEELLPPP!!
Upgrating problems....!!!!

I just think it is time to do it. First or Later you should upgrade your
PHP....

so, do it now and listen to these few complains you'll receive....

Cheers...

-----Original Message-----
From: Philip Olson [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 15, 2001 6:22 PM
To: SuiteNet Operations Manager
Cc: php-general
Subject: Re: [PHP] hello


Hi Herb,

PHP is wonderful.  Regarding any upgrade issues, check out :

    http://www.php.net/FAQ.php#11
    http://www.php.net/version4/migration.php
    http://www.opendeveloper.org/PHP/HowTo/Upgrading_From_PHP3_to_PHP4/

AFAIK, it *won't* cause problems upgrading.  Do be sure to parse the
current extension though (i.e. be sure to keep .php3 within httpd.conf)
For information on all this check out :

    http://www.e-gineer.com/instructions/
    http://www.php.net/manual/en/install.unix.php

Doing it at 3am is suggested and giving users some warning just in case 
:-)  Regarding learning php, there are some main sites to consider for
learing :

    http://www.devshed.com/
    http://www.phpbuilder.com/
    http://www.zend.com/
    http://php.faqts.com/

There are others (and others).  Like for instance :

    http://php.faqts.com/
    http://www.thickbook.com/
    http://www.weberdev.com/
    http://www.google.com/
    http://www.google.com/
    http://www.google.com/

Regarding books, the wrox books are popular, check them out.  The php
site lists books and by purchasing there money goes to PHP effort, list 
is here :

    http://www.php.net/books.php

And you will need to know SQL, here is a basic tutorial :

    http://www.sqlcourse.com/

And if you want to know my favorite php tutorial that I wish all php users
would consider and print out it is as follows :

    http://www.zend.com/zend/tut/using-strings.php

And remember, practise makes perfect this is so very true.  Nobody is
perfect and we've all written crappy code in the past (and present) so
it's okay.  And, nobody memorizes the manual, keep this in mind.  It's a
reference/tool.  It is very valuable and contains many useful friendly
examples.  At least skimming through it and working the examples through
(if not code, at least in head and say to self "ahhhhh, that makes sense")
it is important as in the future when one wants to do something the brain
will think "hmm, I've read about this once before" and thus one searches
the manual and finds.  Also, searching the mailing list is very important,
use one or two specific words that are sure to exist in question.  It is
okay to ask questions but odds are someone else has asked a similar
question in past,  an archive is found here (google also keeps this
archive!!!):

    http://marc.theaimsgroup.com/?l=php-general

It is very useful to add this and php site to browser "command line" and
instruction on this can be found here :

    http://www.php.net/tips.php

That's what comes to mind at this point, hopefully this rambling email
makes sense.  Just remember, start small.   Build an addressbook.  After
that, add features to it like make sure user inputs real data (not blank
(empty), is x characters in length (strlen) or is an email address (ereg). 
Then make users name in addressbook apear with First Letter Capitalized
(ucwords) and so on, so forth.  Also, be sure to research, it is very
useful to do. If one wants to do something odds are there is a function to
do it or a function was created to help do it.  For scripts, look here :

    http://www.hotscripts.com/
    http://px.sklar.com/
    http://www.freshmeat.net/
    http://www.sourceforge.net/

And through all that all will be good.  This now concludes this post,  
good luck!


Philip


--
Philip Olson
http://www.cornado.com/

On Mon, 15 Jan 2001, SuiteNet Operations Manager wrote:

> I was wondering what Im sure a well knowledged php expert like your self
> would recommend a hands on php crash course. The best way for me to jump
> right in to understanding php and getting started making my first data
> base.
> with php3 and mysql. I understand that is how you have to do it.
> See Im running a apache server that my father started.
> And up to this point have been working with basic cgi stuff and dealing
> with  tech support and  minor web design.
> But I need to get into data base stuff and the only way Im going to be
> able to make something like a shopping cart or anything of that nature
> is to learn.
> My father knew allot of this stuff but Un fortunately he past away and
> Im stuck. So any suggestions would be great and can I count on you to
> answer any questions I might have. I have been going to the php.net
> site. And are starting there.
> Thank you and god Bless.
> 
> Ps. Any books you think would be my best start.
> Im pretty good at picking things up but I have never messed with
> php3 either.
> I also Know about php4 but I have users I guess up till now are using
> php3 will this change what the are doing and continuing to do. I mean do
> they have learn and change everything to or is it I except everything
> till now and then more of what php4 offers too. Im not sure how that
> works.
> I do not want to change anything on the server UN LESS IM VERY VERY
> SURE<<<
> Ok well I thank you so much. 
> 
> -- 
> Regards
> Herb McDonald
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




subscribe




>  >>
>  >> what are you doing making a connection to a database on the same page you
>  >> spit out the results from?
>  >

As long as the password and username are on an include not available 
in the http doc tree, I would assume you can use that included 
function to connect as much as you want on a page you're spitting out 
results from.

Or am I missing something?

Kristofer
-- 
______________________________________

Kristofer Widholm
Web Pharmacy
[EMAIL PROTECTED]
191 Grand Street, Brooklyn  NY  11211
718.599.4893
______________________________________




"Alex Black" ...
> the horse is back from the dead!

huh?

> > And aside from that, i don't have a one and only common_head.php ... i
have
> > a separate plain common head, in plain HTML... the real common_head.php
> > should look like (definitively not real PHP sintax):
>
> right, and though this is not directly related to templating:
>
> I thik you would benefit greatly by introducing some system design (i.e.
> separate "layers" doing separate tasks)

Why? If nested tables can do the work, i won't bother learning how layers
work...

> I don't like to do database connections when I've already output markup,
> what if something goes wrong, or I want to do a redirect, etc?

If something goes wrong -> It's the DBA fault. :-)

> I like to access functions in "DB Object" files - those functions return
> results in arrays which I can pass into markup.
>
> Makes the code a _helluvuh_ lot more maintainable.

I'm pretty comfortable programming directly with OCIwhatever() functions
directly in the main code, that's it.

In other words, i don't need to make my code more maintainable because i'm
comfortable with maintaining it right now.

> True, but why not just bitch at macromedia until they include support for
> PHP in ultradev?

(Well, i haven't purchased dreamweaver either)

> (plegh, visual authoring tools: a necessary evil)

Why, when you have notepad.exe and a couple of browsers to test that the
pages work properly?








Here's what you wrote, 01-01-14:

>I'd like to be able to trim out some html tags, but only certain ones.  I've
>used eregi_replace before and have some replacements running on some
>scripts...

For this, I'd use strip_tags().

Example: strip_tags($contents, "<b>,<i>,<a>,<em>,<cite>")

Will remove all tags from a user submission except Bold, Italics, 
Anchor tags, Emphasis, and Cite.

Kristofer

ps. Strip Tags is not available in PHP prior to 3.018 in the CGI 
version. I know it's available in the 3.015 version of the Apache 
module.
-- 
______________________________________

Kristofer Widholm
Web Pharmacy
[EMAIL PROTECTED]
191 Grand Street, Brooklyn  NY  11211
718.599.4893
______________________________________




>I remember seeing someone post something like this:
>
>$sql = " SELECT * FROM table_name
>         WHERE towns LIKE \"$town\" ";
>
>so if the search word is not EXACTLY like a row in the database, it may
>return results to partial words.

I think you mean
$sql = "SELECT * FROM table_name WHERE towns LIKE \"%$town%\" ";

The % is more fuzzy. Look it up in the MySQL manual for more details 
on %. <http://www.mysql.com/doc/>

Kristofer
-- 
______________________________________

Kristofer Widholm
Web Pharmacy
[EMAIL PROTECTED]
191 Grand Street, Brooklyn  NY  11211
718.599.4893
______________________________________




Dear Friends & Future Millionaire:=20

AS SEEN ON NATIONAL TV:=20
Making over half million dollars every 4 to 5 months from your home for=20
an investment of only $25 U.S. Dollars expense one time=20
THANK'S TO THE COMPUTER AGE AND THE INTERNET !=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=20
BE A MILLIONAIRE LIKE OTHERS WITHIN A YEAR!!!=20
Before you say ''Bull'', please read the following. This is the letter you=20
have been hearing about on the news lately. Due to the popularity of=20
this letter on the Internet, a national weekly news program recently devote=
d=20
an entire show to the investigation of this program described below, to see=
=20
if it really can make people money. The show also investigated whether or=20
not the program was legal.=20
Their findings proved once and for all that there are ''absolutely NO Laws=20
prohibiting the participation in the program and if people can -follow the=20
simple instructions, they are bound to make some mega bucks with only=20
$25 out of pocket cost''. DUE TO THE RECENT INCREASE OF=20
POPULARITY & RESPECT THIS PROGRAM HAS ATTAINED,=20
IT IS CURRENTLY WORKING BETTER THAN EVER.=20
This is what one had to say: ''Thanks to this profitable opportunity. I=20
was approached many times before but each time I passed on it. I am=20
so gladI finally joined just to see what one could expect in return for the=
=20
minimal effort and money required. To my astonishment, I received total $=20
610,470.00 in 21 weeks, with money still coming in."=20
Pam Hedland, Fort Lee, New Jersey.=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=20
Here is another testimonial: "This program has been around for a long=20
time but I never believed in it. But one day when I received this again=20
in the mail I decided to gamble my $25 on it. I followed the simple=20
instructions and walaa ..... 3 weeks later the money started to come in.=20
First month I only made $240.00 but the next 2 months after that I made=20
a total of $290,000.00. So far, in the past 8 months by re-entering the=20
program, I have made over $710,000.00 and I am playing it again. The=20
key to success in this program is to follow the simple steps and NOT change=
=20
anything.'' More testimonials later but first,=20
=3D=3D=3D=3D=3D PRINT THIS NOW FOR YOUR FUTUREREFERENCE =3D=3D=3D=3D=3D=3D=20
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=20
If you would like to make at least $500,000 every 4 to 5 months easily and=20
comfortably, please read the following...THEN READ IT AGAIN and AGAIN!!!=20
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=20
FOLLOW THE SIMPLE INSTRUCTION BELOW AND YOUR FINANCIAL=20
DREAMS WILL COME TRUE, GUARANTEED! INSTRUCTIONS:=20
=3D=3D=3D=3D=3DOrder all 5 reports shown on the list below =3D=3D=3D=3D=3D=20
For each report, send $5 CASH, THE NAME & NUMBER OF THE REPORT=20
YOU ARE ORDERING and YOUR E-MAIL ADDRESS to the person whose=20
name appears ON THAT LIST next to the report. MAKE SURE YOUR RETURN=20
ADDRESS IS ON YOUR ENVELOPE TOP LEFT CORNER in case of any mail=20
problems.=20
=3D=3D=3D When you place your order, make sure you order each of the 5 repo=
rts.=20
You will need all 5 reports so that you can save them on your computer=20
and resell them. YOUR TOTAL COST $5 X 5=3D$25.00.=20
Within a few days you will receive, vie e-mail, each of the 5 reports from=20
these 5 different individuals. Save them on your computer so they will be=20
accessible for you to send to the 1,000's of people who will order them=20
from you. Also make a floppy of these reports and keep it on your desk in=20
case something happen to your computer.=20
IMPORTANT - DO NOT alter the names of the people who are listed next=20
to each report, or their sequence on the list, in any way other than what i=
s=20
instructed below in step '' 1 through 6 '' or you will loose out on majorit=
y=20
of your profits. Once you understand the way this works, you will also see=20
how it does not work if you change it. Remember, this method has been=20
tested, and if you alter, it will NOT work !!! People have tried to put the=
ir=20
friends/relatives names on all five thinking they could get all the money. =
But=20
it does not work this way. Believe us, we all have tried to be greedy and t=
hen=20
nothing happened. So Do Not try to change anything other than what is=20
instructed. Because if you do, it will not work for you.=20
Remember, honesty reaps the reward!!!=20
1.... After you have ordered all 5 reports, take this advertisement and=20
REMOVE the name & address of the person in REPORT # 5. This person=20
has made it through the cycle and is no doubt counting their fortune.=20
2.... Move the name & address in REPORT # 4 down TO REPORT # 5.=20
3.... Move the name & address in REPORT # 3 down TO REPORT # 4.=20
4.... Move the name & address in REPORT # 2 down TO REPORT # 3.=20
5.... Move the name & address in REPORT # 1 down TO REPORT # 2=20
6.... Insert YOUR name & address in the REPORT # 1 Position. PLEASE MAKE=20
SURE you copy every name & address ACCURATELY!=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=20
**** Take this entire letter, with the modified list of names, and save it =
on=20
your=20
computer. DO NOT MAKE ANY OTHER CHANGES.=20
Save this on a disk as well just in case if you loose any data. To assist y=
ou=20
with=20
marketing your business on the internet, the 5 reports you purchase will pr=
ovide=20
you with invaluable marketing information which includes how to send bulk=20
e-mails legally, where to find thousands of free classified ads and much mo=
re.=20
There are 2 Primary methods to get this venture going:=20
METHOD # 1: BY SENDING BULK E-MAIL LEGALLY=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=20
Let's say that you decide to start small, just to see how it goes, and we w=
ill=20
assume You and those involved send out only 5,000 e-mails each. Let's=20
also assume that the mailing receive only a 0.2% response (the response=20
could be much better but lets just say it is only 0.2%. Also many people=20
will send out hundreds of thousands e-mails instead of only 5,000 each).=20
Continuing with this example, you send out only 5,000 e-mails. With a 0.2%=20
response, that is only 10 orders for report # 1. Those 10 people responded=20
by sending out 5,000 e-mail each for a total of 50,000. Out of those 50,000=
=20
e-mails only 0.2% responded with orders. That's=3D100 people responded and=20
ordered Report # 2.=20
Those 100 people mail out 5,000 e-mails each for a total of 500,000 e-mails=
.=20
The 0.2% response to that is 1000 orders for Report # 3.=20
Those 1000 people send out 5,000 e-mails each for a total of 5 million e-ma=
ils=20
sent out. The 0.2% response to that is 10,000 orders for Report # 4.=20
Those 10,000 people send out 5,000 e-mails each for a total of 50,000,000=20
(50 million) e-mails. The 0.2% response to that is 100,000 orders for Repor=
t=20
# 5 THAT'S 100,000 ORDERS TIMES $5 EACH=3D$500,000.00 (half million).=20
Your total income in this example is: 1..... $50 + 2..... $500 + 3..... $5,=
000=20
+ 4=20
.... $50,000 + 5..... $500,000 ........ Grand Total=3D$555,550.00=20
NUMBERS DO NOT LIE. GET A PENCIL & PAPER AND FIGUREOUT=20
THE WORST POSSIBLE RESPONSES AND NO MATTER HOW YOU=20
CALCULATE IT, YOU WILL STILL MAKE A LOT OF MONEY !=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=20
REMEMBER FRIEND, THIS IS ASSUMING ONLY 10 PEOPLE=20
ORDERING OUT OF 5,000 YOU MAILED TO.=20
Dare to think for a moment what would happen if everyone or half or even=20
one 4th of those people mailed 100,000e-mails each or more? There are=20
over 150 million people on the Internet worldwide and counting. Believe me,=
=20
many people will do just that, and more!=20
METHOD # 2 : BY PLACING FREE ADS ON THE INTERNET=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=20
Advertising on the net is very very inexpensive and there are hundreds=20
of FREE places to advertise. Placing a lot of free ads on the Internet will=
=20
easily get a larger response. We strongly suggest you start with Method # 1=
=20
and dd METHOD # 2 as you go along. For every $5 you receive, all you=20
must do is e-mail them the Report they ordered. That's it. Always provide=20
same day service on all orders.=20
This will guarantee that the e-mail they send out, with your name and=20
address on it, will be prompt because they can not advertise until they=20
receivethe report.=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D AVAILABLE REPORTS =3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
ORDER EACH REPORT BY ITS NUMBER & NAME ONLY. Notes:=20
Always send $5 cash (U.S. CURRENCY) for each Report. Checks NOT=20
accepted. Make sure the cash is concealed by wrapping it in at least 2 shee=
ts=20
of paper. On one of those sheets of paper, Write the NUMBER & the NAME=20
of the Report you are ordering, YOUR E-MAIL ADDRESS and your name=20
and postal address.=20
PLACE YOUR ORDER FOR THESE REPORTS NOW :=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=20
REPORT
# 1: The Insider's Guide to Advertising for Free on the Net
Order Report #1 from:

S. Chen
3433 Park Square, #1
Tampa, FL 33613
USA
________________________________________________________

REPORT # 2: The Insider's Guide to Sending Bulk e-mail on the Net
Order Report # 2 from:

J.R.
2107 Danforth Ave.
Box # 166
Toronto, ON M4C 1K1
Canada=20
_________________________________________________________________
REPORT # 3: Secret to Multilevel marketing on the net
Order Report # 3 from :

Aaron Joseph
P.O. BOX 21155
Columbia Heights, MN 55421
USA
____________________________________________________________=20
REPORT # 4: "How to Become a Millionaire Utilizing MLM & the Net"=20
Order Report # 4 from:

C.J. Kalata
P.O. Box 130157
Roseville, MN 55113-0002
USA
____________________________________________________________=20
REPORT #5: "How to Send Out 0ne Million e-mails for Free"=20
Order Report # 5 from:=20

R. B.
Box. 21115,=20
Grande Prairie=20
Alberta, T8V-6W7
Canada
____________________________________________________________=20
$$$$$$$$$ YOUR SUCCESS GUIDELINES $$$$$$$$$$$=20
Follow these guidelines to guarantee your success:=20
=3D=3D=3D If you do not receive at least 10 orders for Report #1 within 2=20
weeks, continue sending e-mails until you do.=20
=3D=3D=3D After you have received 10 orders, 2 to 3 weeks after that you=20
should receive 100 orders or more for REPORT # 2. If you did not,=20
continue advertising or sending e-mails until you do.=20
=3D=3D=3D Once you have received 100 or more orders for Report # 2, YOU=20
CAN RELAX, because the system is already working for you, and the=20
cash will continue to roll in ! THIS IS IMPORTANT TO REMEMBER:=20
Every time your name is moved down on the list, you are placed in front=20
of a Different report.=20
You can KEEP TRACK of your PROGRESS by watching which report=20
people are ordering from you. IF YOU WANT TO GENERATE MORE=20
INCOME SEND ANOTHER BATCH OF E-MAILS AND START=20
THE WHOLE PROCESS AGAIN.=20
There is NO LIMIT to the income you can generate from this business !!!=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=20
FOLLOWING IS A NOTE FROM THE ORIGINATOR OF THIS=20
PROGRAM: You have just received information that can give you=20
financial freedom for the rest of your life, with NO RISK and JUST=20
A LITTLE BIT OF EFFORT. You can make more money in the next=20
few weeks and months than you have ever imagined. Follow the program=20
EXACTLY AS INSTRUCTED. Do Not change it in any way. It works=20
exceedingly well as it is now.=20
Remember to e-mail a copy of this exciting report after you have put=20
your name and address in Report #1 and moved others to #2 ...........# 5=20
as instructed above. One of the people you send this to may send out=20
100,000 or more e-mails and your name will be on every one of them.=20
Remember though, the more you send out the more potential customers=20
you will reach.=20
So my friend, I have given you the ideas, information, materials and=20
opportunity to become financially independent. IT IS UP TO YOU NOW !=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D MORE TESTIMONIALS =3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
"My name is Mitchell. My wife, Jody and I live in Chicago. I am an=20
accountant with a major U.S. Corporation and I make pretty good money.=20
When I received this program I grumbled to Jodyaboutreceiving ''junk=20
mail''. I made fun of the whole thing,spoutingmy knowledge of the populatio=
n=20
and percentages involved. I ''knew'' it wouldn't work. Jody totally ignored=
=20
my supposed intelligence and few days later she jumped in with both feet. I=
=20
made merciless fun of her, and was ready to lay the old ''I told you so'' o=
n=20
her when the thing didn't work. Well, the laugh was on me! Within 3 weeks=20
she had received 50 responses. Within the next 45 days she had received=20
total $ 147,200.00 ........... all cash! I was shocked. I have joined Jody=20
in her ''hobby''.=20
Mitchell Wolf M.D., Chicago, Illinois=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=20
''Not being the gambling type, it took me several weeks to make up my=20
mind to participate in this plan. But conservative that I am, I decided tha=
t=20
the initial investment was so little that there was just no way that I=20
wouldn't get enough orders to at least get my money back''. '' I was=20
surprised when I found my medium size post office box crammed with=20
orders. I made $319,210.00in the first 12 weeks. The nice thing about=20
this deal is that it does not matter where people live. There simply isn't =
a=20
better investment with a faster return and so big."=20
Dan Sondstrom, Alberta, Canada=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=20
''I had received this program before. I deleted it, but later I wondered=20
if I should have given it a try. Of course, I had no idea who to contact to=
=20
get another copy, so I had to wait until I was e-mailed again by someone=20
else.........11 months passed then it luckily came again...... I did not=20
delete this one! I made more than $490,000 on my first try and all the=20
money came within 22 weeks."=20
Susan De Suza, New York, N.Y.=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=20
''It really is a great opportunity to make relatively easy money with=20
little cost to you. I followed the simple instructions carefully and=20
within 10 days the money started to come in. My first month I made=20
$20,560.00 and by the end of third month my total cash count was=20
$362,840.00. Life is beautiful, Thanx to internet.".=20
Fred Dellaca, Westport, New Zealand=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=20
ORDER YOUR REPORTS TODAY AND GET STARTED ON=20
'YOUR' ROAD TO FINANCIAL FREEDOM !=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=20
If you have any questions of the legality of this program, contact the=20
Office of Associate Director for Marketing Practices, Federal Trade=20
Commission, Bureau of Consumer Protection, Washington, D.C.=20



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com





Here's what you wrote, 01-01-11:

>       I was looking for a good book that teaches you how to use PHP (mainly 3)
>with MySql. I went to Amazon.com and found "MySql" by Paul Dubois, which was
>supposed to be THE book for mySql programming. However, after reading some
>of the customer reviews, it said that it was "light" in the PHP section.
>Also the fact that the book was published in 1999 made me a little uneasy.
>What are some books that you have used to learn MySql with php?

The book definitely is THE book for MySQL programming. PHP is 
discussed as one of several APIs for interacting with MySQL. Nothing 
more, nothing less.

This book is by far and away the best technical manual I have ever 
read. It was a joy to read, and even though his section on PHP was 
less than exhaustive, I learned more about good PHP programming in 
that section than I did in the two other PHP only books I bought.

I think, given the complexity of database design (if you want to do 
it right), that it's worth it to really study MySQL in and of itself.

Kristofer
-- 
______________________________________

Kristofer Widholm
Web Pharmacy
[EMAIL PROTECTED]
191 Grand Street, Brooklyn  NY  11211
718.599.4893
______________________________________




I would like to upgrade PHP3 to PHP4 on my Turbo Linux, does anyone has
experience on this?

--
best wishes,
enethk







Hello TOM, 

(T == "TOM") [EMAIL PROTECTED] writes:

T> I would like to upgrade PHP3 to PHP4 on my Turbo Linux, does anyone
T> has experience on this?

Not specifically on Turbo Linux, but this may shed some light on the
subject:

http://www.php.net/version4/migration.php

T> enethk

-Brian






Hi,
please, would anybody be so kind and tell me what differences are
amoung __FILE__, $PATH_INFO and $PATH_TRANSLATED? And in which cases 
they will have other values?

Thanks.
Regards, PETER

-------------------------------------------------
Tento e-mail byl odeslán ze serveru www.worldmail.cz




__FILE__ is the filename of the current file being parsed.  This can
change around as the php script includes other files.  It is mostly used
for printing out information on where an error occurred.

$PATH_INFO is the part of the URI after the script.  ie.
www.php.net/test.php/whatever/blah
In this case $PATH_INFO would be /whatever/blah

$PATH_TRANSLATED is $PATH_INFO translated to an absolute file path on the
file system.  So something like /var/web/whatever/blah for the above
example.

-Rasmus

On Mon, 15 Jan 2001 [EMAIL PROTECTED] wrote:

> Hi,
> please, would anybody be so kind and tell me what differences are
> amoung __FILE__, $PATH_INFO and $PATH_TRANSLATED? And in which cases
> they will have other values?
>
> Thanks.
> Regards, PETER
>
> -------------------------------------------------
> Tento e-mail byl odeslán ze serveru www.worldmail.cz
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hi people,
I have tried to compare 2 date values to see if one come before another using the 
sniplet below:

if ($date1 < $date2) {
do something
}else{
.......
}

while $date1 is in "yyyymmdd" format but $date2 is in "yyyy-mm-dd" formate because I 
get value of $date2 from a "date" data type field from a table. 
Can I use this "yyyy-mm-dd" to compare with value from another date variabile in the 
"yyyymmdd" format?  If not possible, How do I make both of them to be in the same 
format?
cheers
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"




| 
| It should also be noted that the system interaction functions (namely,
| passthru(), exec(), system() and popen()) are 
| broken/incorrectly implemented,
| actually, its windows that's incorrectly implemented, but be 
| that as it may, the
| functions do not work with windows).

Well, I guess that clears that up... cheers Mr. Gates

| 
| To the original poster:
| 

Hello....

|       Use PHP's built-in mail() function instead, don't fork 
| out to sendmail,
| actually, better yet, use linux :-).

I spotted the mail() function about ten minutes after I posted... (and I
would be on a linux box if I could persuade my boss)

Cheers
Jon







> I'm generating a page of HTML by reading an entire page of HTML source
into
> a variable, and then doing various functions and str_replace on the
> variable.
>
> However when I finialy write this out to a file the variable containing
the
> HTML source is truncated, at about 5800-ish bytes.
>
> Is there a limit of the amount of data a variable can store? Or is there a
> better way to manipulate the text in file?
>

It seems that when I did my fread, I was using the wrong filename in the
filesize function. Therefore The file was being read into the variable and
getting truncated at the incorrect limit.

--
Andrew





I read once on this list that PHP supports a DBI-like database access object (such as 
the one in Perl). Is this true? Does anyone know where I can find documentation for 
it? I can't seem to find it in the manual.

Also, how do you all handle generic SQL for multiple DBMSs? I'd like (ideally) to 
write SQL that is DBMS-independent, although that's probably not possible. I'm very 
familiar with mysql and not much else; as far as I'm aware, mysql is the primary DBMS 
that has problems with standard SQL (like nested queries and such). Does anyone even 
worry about this?

I'm writing a little piece of software that I'd like to be as extensible as possible 
and as usable as possible for people using any DBMS, including mysql.

Anyway, if I can't find a generic built-in database interface in PHP, it'll all be 
moot. I'd really rather not use phplib; I'd like to use an interface built in to the 
interpreter rather than something that's interpreted on every page access.

Thanks for the help.
Dean.






Dean Hall wrote:

> I read once on this list that PHP supports a DBI-like database access object (such 
>as the one in Perl). Is this true? Does anyone know where I can find documentation 
>for it? I can't seem to find it in the manual.
>
> Also, how do you all handle generic SQL for multiple DBMSs? I'd like (ideally) to 
>write SQL that is DBMS-independent, although that's probably not possible. I'm very 
>familiar with mysql and not much else; as far as I'm aware, mysql is the primary DBMS 
>that has problems with standard SQL (like nested queries and such). Does anyone even 
>worry about this?
>
> I'm writing a little piece of software that I'd like to be as extensible as possible 
>and as usable as possible for people using any DBMS, including mysql.
>
> Anyway, if I can't find a generic built-in database interface in PHP, it'll all be 
>moot. I'd really rather not use phplib; I'd like to use an interface built in to the 
>interpreter rather than something that's interpreted on every page access.
>

You won't find one.  The 'benefit' of PHP is that is, for the most part, uses native 
db drivers for access to each db.  Should be a bit faster and allows access to the 
specific features of each db.

There is a PEAR repository which offers something similar to DBI, afaik, but it's not 
widely discussed, from what I can see.  PEAR is a set of files that comes with a 
distribution, and there is a README.  People on shared host environments may be out of 
luck here, though, with respect to a README (d/l the file and read it manualyl I 
guess).

"metabase" from manuel lemos purports to be a single interface to multiple dbs - write 
one SQL statement and it'd do the necessary translation on the SQL to be specific to 
whatever db you are using.  Haven't used it, but heard nice things about it.  But, it 
violates your 'not interpreted' clause.

Good luck.




>
> Thanks for the help.
> Dean.





How do I modify the value of the current element of an array?

-- Catalin Borcea --
                      \\\|///
                     \\ - - //
                   ( @ @ )
 -----oOOO----(_)----OOOo----







try this one.. seems to easy though. Maybe I'm missing something??

<?
/* throw a few values into an array */
 
$my_arr[1]= "ichi";
$my_arr[2]= "ni";
$my_arr[3]= "san";
$my_arr[4]= "shi";
$my_arr[5]= "go";
 
/* set a variable equal to the current value in the array using pos() */
$curr_val = pos($my_arr);
 
/* set another variable equal to the current key in the array using key() */
$curr_key = key($my_arr);
 
/* for debug's sake, print the variables out */
print($curr_val."\n"); /* returns "ichi" */
print($curr_key."\n"); /* returns "1" */
 
/* now, use that key variable to change the current value */
 
$my_arr[$curr_key] = "one";
 
/* now, reprint the key directly from the array to show it's changed */
print($my_arr[$curr_key]."\n");
?>

Cheers,

Brad

On Mon, 15 Jan 2001, Catalin Borcea wrote:

> How do I modify the value of the current element of an array?
> 
> -- Catalin Borcea --
>                       \\\|///
>                      \\ - - //
>                    ( @ @ )
>  -----oOOO----(_)----OOOo----
> 
> 
> 
> 
> 





Hi,

I wrote a script that does searching against a MySQL database.
The resultant page displays 10 records at a time while there is the 
Prev...Next Page at the bottom of the page.

There is no problem if the search string is say, "ABC". However, it will
give a problem
if the string is "Mr ABC". I display this string at every page so that
users know
what they searched for. 
For example:
You search for: $searchstring

I believe it something to do with blank spaces. 
Help??

Nyon






> There is no problem if the search string is say, "ABC". However, it will
> give a problem
> if the string is "Mr ABC". I display this string at every page so that
> users know
> what they searched for. 
> For example:
> You search for: $searchstring
> 

Try urlencode/urldecode. 

regards






This must sound pretty far-fetched, but as far as I can tell, my site is 
attempting to set a session cookie from any and all PHP pages, even when 
the page has no calls to session_* functions and where there were also no 
previous visits to pages with such calls.  Where is the setting that is 
initializing these unneccessary sessions and sending the cookies?  I looked 
for something in php.ini or phpinfo() to explain it, but came up empty.  
Below are excerpts from a phpinfo() dump.  

I wondered about that "session.use_trans_sid", but there's no reference to 
it in my php.ini file (yes, I checked that phpinfo says I'm looking at the 
correct one) and I also cannot find anything about it in the PHP.net online 
docs.  What does that setting do, and where is it configured?

TIA

--------begin excerpts from phpinfo()------------

Directive   Local Value Master Value
assert.active  1  1
assert.bail 0  0
assert.callback   no value no value
assert.quiet_eval 0  0
assert.warning 1  1
safe_mode_allowed_env_vars PHP_  PHP_
safe_mode_protected_env_vars  LD_LIBRARY_PATH   LD_LIBRARY_PATH
session.use_trans_sid   1  1

session
Session Support   enabled
Directive   Local Value Master Value
session.auto_start   On On
session.cache_expire 60 60
session.cache_limiter   nocache  nocache
session.cookie_domain   no value no value
session.cookie_lifetime 0  0
session.cookie_path  /  /
session.entropy_file no value no value
session.entropy_length  0  0
session.gc_maxlifetime  1800  1800
session.gc_probability  1  1
session.name   SID   SID
session.referer_check   no value no value
session.save_handler files files
session.save_path /tmp  /tmp
session.serialize_handler  php   php
session.use_cookies  On On

<snip>

HTTP Response Headers
Set-Cookie  SID=0c6a1e4a46c8d9d840ac865d4a9d8e6f; path=/
Expires  Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control  no-store, no-cache, must-revalidate, post-check=0, 
pre-check=0
Pragma   no-cache

<snip>

-- 
CC




(responding to myself)

In article <93uoh9$613$[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
(CC Zona) wrote:

> This must sound pretty far-fetched, but as far as I can tell, my site is 
> attempting to set a session cookie from any and all PHP pages, even when 
> the page has no calls to session_* functions and where there were also no 
> previous visits to pages with such calls.  Where is the setting that is 
> initializing these unneccessary sessions and sending the cookies?  I looked 
> for something in php.ini or phpinfo() to explain it, but came up empty.  

It looks like I've finally figured out the answer to this part of my 
question (it's always five minutes after you finally break down and ask for 
help, isn't it? <sigh>).  Apparently session.auto_start=1 was the culprit.

I'm still hoping someone can help me with the other question, though:

> I wondered about that "session.use_trans_sid", but there's no reference to 
> it in my php.ini file (yes, I checked that phpinfo says I'm looking at the 
> correct one) and I also cannot find anything about it in the PHP.net online 
> docs.  What does that setting do, and where is it configured?
<snip>
> session.use_trans_sid   1  1

Thanks again.

-- 
CC




andrew wrote:
> 
> Sure,
> 
> My understanding of templating engines
>     1.array or item is assigned to a variable
>     2.php placeholders in a html page match in name to above variable.
>     3.a parser separate from php subsitutes the variable values set in (1)
> into (2)
> 
> I've seen plenty of examples where there is a file containing lists of
> variable to item assignment, and thase files are passed to a one of a few
> template pages for layout.
> 
> There must be a way to pass the result set of an SQL query into the set of
> placeholders - the end result would be that you could call whole sites via
> simple queries. All you have to pass in would be the SQL parameter.
> 
> i.e. Table named 'Pvalues'
> 
> Pvalues                 Sample Row
> ----                    ------
> page_id                 contactus.html
> page_name               Contact Us
> page_title              Contact US
> header_text             Please send an email
> body_text               [EMAIL PROTECTED]
> footer_text             thanks!

Check out http://www.scripps.edu/~jesusmc/cachedtpl/CachedTemplate.html
by Jesus M Castagnetto. His class solves the problem with caching
templates for all the template classes he has found.

One of those he found was a class called XTemplates, that class have
some very good functions, you could write this in your templae page:

{Pvalues.page_id}

and in the php page you could assign the result set directly to Pvalues,
and all items called Pvalues.something would be filled out with the
column of the same name.

The only drawback of XTemplates is that it adds some extra spaces to the
output, which on large pages might amount to quite a bit, but since
you're complentating working something like this out, you might instead
rewrite this class to remove that bit of a problem. (I haven't had the
time to track the bug down myself.)

Some timings I've made have shown that XTemplates on a large result set
seems to be only 10% slower than the templates which comes with PHPLib,
which is pretty good.

Finally it is much easier to use and initalize than any template engine
I've tried.
-- 
Paul K Egell-Johnsen
Developer/PR Manager
zez.org: about code
http://zez.org/




Hi!

Can someone help me out with a regex to validate a phone number?

Thanks

Vikram




At 17:55 15/01/01 +0500, Vikram Vaswani wrote:
>Hi!
>
>Can someone help me out with a regex to validate a phone number?

We'd need to know what format of telephone numbers you're looking to 
validate, first.

Angus.





Hi!

> Can someone help me out with a regex to validate a phone number?
Read the examples at:
http://www.php.net/manual/en/function.ereg-replace.php


Der Heiko
Buchtipp: http://www.aufbruch.com/
Heiko und Gisela Spallek:
Aufbruch ins Land der unbegrenzten Moeglichkeiten.
Studieren, Arbeiten und Leben in den USA: Tips fuer Neuankoemmlinge
2. erweiterte und ueberarbeitete Auflage: ISBN: 3-934407-01-3






subscribe




Randy Johnson [[EMAIL PROTECTED]] wrote:
> Hello,
> 
> I was going to use sessions to save a logged in variable so if the user
> logged in with a username and password I checked for the session variable
> and if it existed then I could continue.
> 
> Is there a way for the loggedin session variable to automatically be
> destroyed after 5 minutes for example?  If not what would be another way I
> could implement the above.

Look at your php.ini configuration - specifically

  session.gc_probability
  session.gc_maxlifetime

they will help you manage sessions and give a lifetime to
each session.

You can also use a scheduled(cron on *nix) job to remove sessions
older than ??? minutes.

HTH.

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com

> 
> 
> thanks,
> 
> Randy
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




Is there any IMAP PHP functions using ssl ??
Do I have to just switch the port 143->993 to use ssl
or do I have to use specific functions implemented in
PHP 4 ?? 

 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif







Hi,

compiled PHP3/PHP4 as external CGI under Apache.

Calling
<?php
virtual("test.html");
?>

results in a
Fatal error: Call to undefined function: virtual() in "local-path" on
line 4

Does this funktion need to be activated ?
Does is not work in a CGI-PHP ?

MfG, Frank Gadegast
--
PHADE Software - PowerWeb                       http://www.powerweb.de
Inh. Dipl.-Inform. Frank Gadegast             mailto:[EMAIL PROTECTED]
Otto-Nagel-Str. 1a                                fon: +49 331 2370780
14467 Potsdam, Germany                            fax: +49 331 2370781
======================================================================
  PowerWeb =          Deutschlands Pauschal-Webhoster mit freiem
  Platz im Netz     Speicherplatz UND freiem Uebertragungsvolumen.




Hi all,

I've some strange problems.
First i tried to update PHP-403pl1 with PHP-404.
PHP was running smoothly on my Apache-1.3.14 but after the upgrade
(no compile errors, ./configure okay and no errors at all when compiling
PHP-404)
i wanted to restart Apache..
it said something like: crc32; undefined reference.
and, the /www/libexec/php4lib.so gave a seg. fault when I tried to run it.

So, i compiled apache & PHP from fresh .tar.gz, but this time, not as DSO,
but static.
This time, PHP isn't giving any troubles at all, but the compilation of
apache gives some errors
when trying to compile the PHP4 module... here are they:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
gcc  -DLINUX=2 -I/root/source/php-4.0.4 -I/root/source/php-4.0.4/main -I/roo
t/source/php-4.0.4/main -I/root/source/php-4.0.4/Zend -I/root/source/php-4.0
.4/Zend -I/root/source/php-4.0.4/TSRM -I/root/source/php-4.0.4/TSRM -I/root/
source/php-4.0.4 -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED `./apaci`
\
      -o httpd buildmark.o modules.o modules/standard/libstandard.a
modules/php4/libphp4.a main/libmain.a ./os/unix/libos.a ap/libap.a
lib/expat-lite/libexpat.a  -rdynamic -Lmodules/php4 -L../modules/php4 -L../.
./modules/php4 -lmodphp4   -ldl -lz -lpng -lgd -lresolv -lm -ldl -lcrypt -ln
sl  -lresolv   -lm -lcrypt
/usr/local/lib/libgd.a(gd_png.o): In function `gdPngErrorHandler':
gd_png.o(.text+0x37): undefined reference to `png_get_error_ptr'
/usr/local/lib/libgd.a(gd_png.o): In function `gdPngReadData':
gd_png.o(.text+0x95): undefined reference to `png_get_io_ptr'
/usr/local/lib/libgd.a(gd_png.o): In function `gdPngWriteData':
gd_png.o(.text+0xc5): undefined reference to `png_get_io_ptr'
/usr/local/lib/libgd.a(gd_png.o): In function `gdImageCreateFromPngCtx':
gd_png.o(.text+0x155): undefined reference to `png_check_sig'
...
/usr/local/lib/libgd.a(gd_png.o): In function `gdImagePngCtx':
gd_png.o(.text+0x975): undefined reference to `png_create_write_struct'
gd_png.o(.text+0x9ab): undefined reference to `png_create_info_struct'
...
gd_png.o(.text+0xefd): undefined reference to `png_write_end'
gd_png.o(.text+0xf16): undefined reference to `png_destroy_write_struct'
collect2: ld returned 1 exit status
make[3]: *** [target_static] Error 1
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Does anyone know a solution? please let me know :)

My commands to compile:
~/source/php-4.0.4#
./configure --with-apache=../apache_1.3.14 --with-mysql --with-gd --without-
ttf -with-ftp ; make ; make install
~/source/php-4.0.4# cd ../apache_1.3.14
~/source/apache_1.3.14#
./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a ;
make ; make install

I have/try:
PHP                     4.0.4
Apache          1.3.114
GD                      1.3.8
libpng          1.0.8
zlib                    1.1.3
Linux                   2.2.17
Original distro Slackware 7.0

Kees Hoekzema,
[EMAIL PROTECTED]





Hi,
I need to be able to reactive an unknown number of fields from a Data
Base generated form.
How do I handle an unknown number of fields?
II can generate a list of all possible fields and try them all but will
this generate errors?
I will appreciate any help or information.
Thanks 
Shimon Dekel

==============================
Shimon Dekel  Israeli Vegetable Board
Information System Manager
2 Karlibach St Tel-Aviv 67132
[EMAIL PROTECTED]   www.yerek.co.il
==============================





http://www.php.net/manual/en/function.mysql-fetch-field.php

--Joe

On Mon, Jan 15, 2001 at 05:27:03PM +0200, Shimon Dekel wrote:
> Hi,
> I need to be able to reactive an unknown number of fields from a Data
> Base generated form.
> How do I handle an unknown number of fields?
> II can generate a list of all possible fields and try them all but will
> this generate errors?
> I will appreciate any help or information.
> Thanks 
> Shimon Dekel
> 
> ==============================
> Shimon Dekel  Israeli Vegetable Board
> Information System Manager
> 2 Karlibach St Tel-Aviv 67132
> [EMAIL PROTECTED]   www.yerek.co.il
> ==============================
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

Joe Stump, PHP Hacker
[EMAIL PROTECTED]
http://www.miester.org/



Reply via email to