OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 27 Jul 2005 20:26:11 -0000 Issue 3591

php-general-digest-helplists.php.net
Date: Wed Jul 27 2005 - 15:26:11 CDT


php-general Digest 27 Jul 2005 20:26:11 -0000 Issue 3591

Topics (messages 219399 through 219456):

Re: php mySql question
        219399 by: Shaw, Chris - Accenture
        219403 by: Mark Rees
        219406 by: axel
        219416 by: John Nichel

Re: Object Inheritance, get_class() and a static function call
        219400 by: Jochem Maas
        219404 by: axel
        219413 by: Jochem Maas

Re: install or interference problem
        219401 by: Jochem Maas

Re: Very Basic question: What IDE/tools I need to begin using PHP?
        219402 by: Jochem Maas

Re: Setting clock backwards hangs webserver (PHP+THTTPD)
        219405 by: Alan Milnes

Multipage form redux
        219407 by: Jack Jackson
        219409 by: André Medeiros
        219410 by: Mark Rees
        219411 by: Richard Davey
        219412 by: Jack Jackson
        219451 by: Jack Jackson
        219453 by: Jim Moseby
        219454 by: Jack Jackson

Re: Apache 2.0.52 + PHP 4.3.9 configuration problem, for Linux Fedora 3.
        219408 by: David Robley

Re: quick question about using capital letters coding w/ PHP
        219414 by: Jochem Maas
        219419 by: Dotan Cohen

how to know referral function
        219415 by: Daniele Palumbo
        219417 by: André Medeiros

Question on exec() to call a php script from a php script
        219418 by: Liang ZHONG

preg_match - help please
        219420 by: Steve Turnbull
        219421 by: John Nichel
        219422 by: André Medeiros
        219423 by: André Medeiros
        219425 by: Mark Rees
        219426 by: André Medeiros
        219427 by: Mike Johnson
        219428 by: André Medeiros
        219429 by: John Nichel
        219431 by: Mike Johnson
        219433 by: André Medeiros
        219434 by: John Nichel
        219435 by: André Medeiros
        219437 by: John Nichel

Re: becoming root user within php
        219424 by: Tom Cruickshank

Calling methods in returned SOAP objects
        219430 by: Marcus Bointon

which is the correct method for "select" statement for oci8 functions
        219432 by: babu

Re: Playing Audio
        219436 by: Joe Wollard

looking for program/script to diff directories and show dates
        219438 by: Chris W. Parker
        219439 by: John Nichel
        219442 by: Philip Hallstrom
        219443 by: Philip Hallstrom
        219444 by: John Nichel
        219446 by: Chris W. Parker
        219447 by: Chris W. Parker
        219456 by: Philip Hallstrom

can I use Apache v 2 with PHP?
        219440 by: Taksam
        219449 by: Matthew Weier O'Phinney

Has anybody used amfphp? (open flash remoting + php)
        219441 by: Taksam

snapshot
        219445 by: Andy Pieters
        219448 by: tg-php.gryffyndevelopment.com

Event-Driven Programing
        219450 by: cron.odi.com.br
        219452 by: Marco Tabini

Re: Using PHP to get user input via checkbox through a data base
        219455 by: Wil Hitchman

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

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

attached mail follows:


Have you tried doing a search for the text "php5" in the php.ini file that
sits in your c:\windows folder?

C.

-----Original Message-----
From: Ned Kotter [mailto:nedkotteryahoo.com]
Sent: 26 July 2005 04:03
To: php-generallists.php.net
Subject: [PHP] php mySql question

I have installed php 5.0.4 on my windows 2000, IIS 6.0 server. PHP works but
when I try to connect to MySQL I get the Fatal error: Call to undefined
function mysql_connect(). I have uncommented the line in the php.ini file
that says 'extension=php_mysql.dll'. I have path variables set for both
c:\php and c:\php\ext. One very peculiar thing that I noticed when I ran
phpinfo() is that it shows the extension_dir is set to c:\php5 even though in
my php.ini file it is set to c:\php. I have a feeling that this is where the
problem exists. Any advice would be appreciated.

Thanks,
NK

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

************************

This message has been delivered to the Internet by the Revenue Internet e-mail service

*************************

attached mail follows:


Yes, it is quite possible that you have more than one php.ini file. Check
this and delete as appropriate.
""Shaw, Chris - Accenture"" <cshawrevenue.ie> wrote in message
news:7B24DAD09A74C649AE93B516E88946690115C9AArevchsemail01.revenuedomain.ie
...

Have you tried doing a search for the text "php5" in the php.ini file that
sits in your c:\windows folder?

C.

-----Original Message-----
From: Ned Kotter [mailto:nedkotteryahoo.com]
Sent: 26 July 2005 04:03
To: php-generallists.php.net
Subject: [PHP] php mySql question

I have installed php 5.0.4 on my windows 2000, IIS 6.0 server. PHP works
but
when I try to connect to MySQL I get the Fatal error: Call to undefined
function mysql_connect(). I have uncommented the line in the php.ini file
that says 'extension=php_mysql.dll'. I have path variables set for both
c:\php and c:\php\ext. One very peculiar thing that I noticed when I ran
phpinfo() is that it shows the extension_dir is set to c:\php5 even though
in
my php.ini file it is set to c:\php. I have a feeling that this is where
the
problem exists. Any advice would be appreciated.

Thanks,
NK

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

************************

This message has been delivered to the Internet by the Revenue Internet
e-mail service

*************************

attached mail follows:


Sure that your php.ini is located correctly?

> I have installed php 5.0.4 on my windows 2000, IIS 6.0 server. PHP works but when I try to connect to MySQL I get the Fatal error: Call to undefined function mysql_connect(). I have uncommented the line in the php.ini file that says 'extension=php_mysql.dll'. I have path variables set for both c:\php and c:\php\ext. One very peculiar thing that I noticed when I ran phpinfo() is that it shows the extension_dir is set to c:\php5 even though in my php.ini file it is set to c:\php. I have a feeling that this is where the problem exists. Any advice would be appreciated.
>
> Thanks,
> NK
>

attached mail follows:


Ned Kotter wrote:
> I have installed php 5.0.4 on my windows 2000, IIS 6.0 server. PHP works but when I try to connect to MySQL I get the Fatal error: Call to undefined function mysql_connect(). I have uncommented the line in the php.ini file that says 'extension=php_mysql.dll'. I have path variables set for both c:\php and c:\php\ext. One very peculiar thing that I noticed when I ran phpinfo() is that it shows the extension_dir is set to c:\php5 even though in my php.ini file it is set to c:\php. I have a feeling that this is where the problem exists. Any advice would be appreciated.

Look at your phpinfo page and make sure it's reading the ini file that
you think it is.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


axel wrote:
> Hello Jochem,

Axel lets start again.

you seem to want to write a method in 1 base class that
will give you the correct classname when you call
the method statically on the/a subclass) ...

In all cases It _seems_ to me that you must already know
the name of the class in order to get to the stage
that you want to call the getClassName() method.

SO: explain, please, why and what you are trying to do (DETAILS!).
don't dumb it down because that just makes the problem look moot.

I suspect that you will need to change you code to attack to the
problem from a different angle.

anyway I'm very interested in the general problem so lets work it!

rgds

>
>
>> either you tested some different code to what you posted above OR
>> (your build of?) 5.0.3 is borked.
>
>
> sorry, I didn't tested the code at all, because my code is more complex.
> I just tried to show the problem.
>
> class ClassA {
> public static function getClassName() {
> return get_class($this); // [1]
> // or [2] return get_class(self);
> // or [3] return __CLASS__;
> }
> }
> class ClassB extends ClassA { }
> echo ClassB::getClassName();
>
> I am searching for a function to use in line [1] so that the script's
> output is "ClassB".
>
>> I tested this on 5.0.2 and 5.0.4 and both did exactly what I expected,
>> namely
>> output nothing - $this is not defined when you call
>> ClassB::getClassName()
>> (because you make a static call) so nothing is the only logical output.
>
>
> my fault, again, sorry. I jumbled the different outputs. I understood
> that this behaviour is coherent.
>
>
>> maybe you mean:
>>
>> class ClassA {function getClassName() { return get_class($this); }}
>> class ClassB extends ClassA {}
>> $B = new ClassB();
>> echo $B->getClassName();
>>
>> which _does_ work but is fairly pointless because you
>> already know the classname in order to be able to create the object
>> in the first place.
>
>
> that's true. I don't want to use this. I just checked it.
>
>
>> I don't really see what the problem is, can you give some
>> more real world detail on what you are trying/want to do?
>>
>> otherwise (re-)read this chapter:
>> http://php.belnet.be/manual/en/language.oop5.php
>
>
> http://php.belnet.be/manual/en/language.oop5.static.php#48234
> is better. but it seems that even debug_backtrace() is not what i'm
> looking for...
>
>>
>> ... if you're _really_ into generic code then the reflection API
>
>
> no, no generic code. ;)
>
> regards
> axel
>

attached mail follows:


Hello Jochem,

> Axel lets start again.

Okay.

> SO: explain, please, why and what you are trying to do (DETAILS!).
> don't dumb it down because that just makes the problem look moot.

I need the classname to register variables in the session. It's
complicated. There are a lot of inheritences. Please take a look at the
code:

class onObject {
  // ... }

abstract class onAplObject extends onObject {

  protected static function registerVariable($key, $value) {

     $theRealClassName = ???;

     # $theRealClassName = get_class($this);
     # output is --> Undefined variable: this in ...

     # $theRealClassName = get_class(self);
     # output is --> Notice: Use of undefined constant self ...

     # $theRealClassName = __CLASS__; # =>
$theRealClassName=="onAplObject"

     # $theRealClassName = debug_backtrace()[1]['class'];
     # => $theRealClassName=="onDbTableEdit"

     # $theRealClassName = debug_backtrace()[0]['class'];
     # => $theRealClassName=="onAplObject"

     $_SESSION[$theRealClassName.'_'.$key]=$value;
  }
}

class onDbTableEdit extends onAplObject { public static function show() {
    self::registerVariable("listsort", "id");
  }
}

class onUseradmin extends onDbTableEdit {
  // ....
}

onUseradmin::show();

Best regards
Axel

attached mail follows:


axel wrote:
> Hello Jochem,
>
> > Axel lets start again.
>
>
> Okay.
>
> > SO: explain, please, why and what you are trying to do (DETAILS!).
> > don't dumb it down because that just makes the problem look moot.
>
>
>
> I need the classname to register variables in the session. It's
> complicated. There are a lot of inheritences. Please take a look at the
> code:

will take a deeper look this evening ... but ...

>
>
> class onObject {
> // ... }
>
>
> abstract class onAplObject extends onObject {
>
> protected static function registerVariable($key, $value) {

try making the function defintion like this:

protected function registerVariable($key, $value) {

and then use:

$theRealClassName = get_class($this);

otherwise the simplest solution maybe to do:

protected static function registerVariable($obj, $key, $value) {

and then:

$theRealClassName = get_class($obj);

which is a little clumsy but will work!

>
> $theRealClassName = ???;
>
> # $theRealClassName = get_class($this);
> # output is --> Undefined variable: this in ...
>
> # $theRealClassName = get_class(self);
> # output is --> Notice: Use of undefined constant self ...
>
> # $theRealClassName = __CLASS__; # =>
> $theRealClassName=="onAplObject"
>
> # $theRealClassName = debug_backtrace()[1]['class'];
> # => $theRealClassName=="onDbTableEdit"
>
> # $theRealClassName = debug_backtrace()[0]['class'];
> # => $theRealClassName=="onAplObject"
>
> $_SESSION[$theRealClassName.'_'.$key]=$value;
> }
> }
>
> class onDbTableEdit extends onAplObject { public static function show() {
> self::registerVariable("listsort", "id");
> }
> }
>
> class onUseradmin extends onDbTableEdit {
> // ....
> }
>
> onUseradmin::show();
>
>
> Best regards
> Axel
>

attached mail follows:


Fam Ruijters-Verberne wrote:
> Hello,
>

this is not a php question.

and you problem is that Apache cannot _bind_ itself to the port
that you specified in the apache.conf file (more likely XAMMP install
did it for you). specifically Apache appears to be trying to bind
itself to port 443 (which is the default port for HTTPS) and it's not
succeeding - the reason it's not succeeding (AFAICT) is that it's trying to
bind to port 443 on the network interface with IP 0,0,0,0 - which is a
totally invalid IP address.

try changing the string '0,0,0,0:443' into '*:443' in your apachce.conf file.
(search and replace)

here are better sources of info on the matter:

http://www.google.com/search?q=apache+config
http://httpd.apache.org/docs-project/

> It seems I do not get apache server to run. It shuts down instantly.
> I installed via
> http://www.hotscripts.com/PHP/Software_and_Servers/Installation_Kits/
> the XAMPP implementation for the PHP-mysql server. I captured the
> following part of the message of the dos window when activating the
> apache server. Part is in dutch ...I freely translated that part in the
> "translated dos message".
>
> As far as I know I only run zone alarm in the background, and this

you're on windows which means that there are hundreds of processes running
in the background - and assuming you're running windowsXP service pack 2
you are probably running the windows firewall on top of ZoneAlarm.

not to mention a plethora of spyware, adware and related junk that has a high
probability that it's running on your PC ... but that's down to Bill'n'Steve
more than anyone else ;-/

> nicely asks for access to internet for the various components of the
> XAMPP programs. What do I have to check/change/adapt to make sure the
> apache server runs. The mysql part does run properly by the way.
>
> Thanks....
>
>
>
> _*Original dos message*_
> Apache 2 is starting ....
> <OS 10048> Elk socketadres <protocol/netwerkadres/poort> kan normaal
> slechts een keer worden gebruikt. :make_sock: could not bind to address
> 0,0,0,0:443
> no listening sockets available, shutting down
> Unable to open logs
>
> _*Translated dos message:*_
> I translated the "dutch" part and then you get:
> <OS 10048> Every socketaddress <protocol/networkaddress/port> can
> normally only be used once. :make_sock: could not bind to address
> 0,0,0,0:443
> no listening sockets available, shutting down
> Unable to open logs
>

attached mail follows:


Taksam wrote:
> Hi everybody, I am learning PHP, and have this very basic question:
>
> What software/tools I need to begin?
> What is the best IDE I can use? (in windows) Please tell me about FULL-IDEs, not just "super text editors that can syntax-highlight PHP code". I want to debug, deploy... ALL!
> I have just downloaded Zend Studio Client AND Zend Studio Server. Is that all I need to begin?...

we are not you, research & decide for yourself want _you_ need/want/can handle.

>
> Tak
>
>
> ---------------------------------
> Start your day with Yahoo! - make it your home page

attached mail follows:


Vinoo S Warrier wrote:

>Hi all,
>Iam running PHP on THTTPD 2.21b
>
>I have a simple php script that sets the system clock (using exec("date -s MMDDhhmmYYYY.ss") and returns a page showing the system time
>
>when i use it to set the time forwards, it works fine
>but if i use it and set the time backwards (even a few seconds), the webserver hangs. also it hangs only for exactly the amount of time needed for the backwards-set time to catch up with the original time. when the clock catches up with the original time, the page is returned. till then it hangs
>
>it's almost as if the webserver is waiting for the time to come back to the request-received time before sending the page.
>
Sounds like a Server problem rather than PHP - is this behaviour
supported by the Server? At work we used to have to power the servers
off for an hour at clock change time because of logging conflicts etc.

Alan

attached mail follows:


Hi,
I have searched the archives and seen links to tutorials at phpclasses
(which seem to be down) and not found an answer to my question:
I have a long form I want to break into seven pages. Rather than pass
values from page to page as hidden, I'd rather write the results to the
db after each page then move on.

Anyone know of any tutorials on this?

Thanks in advance,
JJ

attached mail follows:


On Wed, 2005-07-27 at 07:51 -0400, Jack Jackson wrote:
> Hi,
> I have searched the archives and seen links to tutorials at phpclasses
> (which seem to be down) and not found an answer to my question:
> I have a long form I want to break into seven pages. Rather than pass
> values from page to page as hidden, I'd rather write the results to the
> db after each page then move on.
>
> Anyone know of any tutorials on this?
>
> Thanks in advance,
> JJ
>

That's not a very good idea. Imagine the user gets to the fourth form
and gets a cup of coffee, or goes out to lunch. By the time he gets to
the computer he might have lost the session, thus having data on your DB
that is wasting space.

And what if the user closes the browser window? :)

Bad bad idea.

attached mail follows:


"André Medeiros" <andre.caumgmail.com> wrote in message
news:1122470550.3613.0.camelvaio...
> On Wed, 2005-07-27 at 07:51 -0400, Jack Jackson wrote:
> > Hi,
> > I have searched the archives and seen links to tutorials at phpclasses
> > (which seem to be down) and not found an answer to my question:
> > I have a long form I want to break into seven pages. Rather than pass
> > values from page to page as hidden, I'd rather write the results to the
> > db after each page then move on.
> >
> > Anyone know of any tutorials on this?
> >
> > Thanks in advance,
> > JJ
> >
>
> That's not a very good idea. Imagine the user gets to the fourth form
> and gets a cup of coffee, or goes out to lunch. By the time he gets to
> the computer he might have lost the session, thus having data on your DB
> that is wasting space.
>
> And what if the user closes the browser window? :)
>
> Bad bad idea.

What if the form takes ages to fill out, and the user has to go away and
find out other information, then wants to come back to the form and see it
pre-filled? For an insurance quote, say?

It could be a good idea under those circumstances. You can always delete all
incomplete data with a cron job every week or so if needs be.

Do you know how to write data to a db? The mechanics of what you want to do
are not especially complex.

page 1
form vars
page 2
request form vars, write to db, display form
etc

attached mail follows:


Hello André,

Wednesday, July 27, 2005, 2:22:30 PM, you wrote:

AM> That's not a very good idea. Imagine the user gets to the fourth
AM> form and gets a cup of coffee, or goes out to lunch. By the time
AM> he gets to the computer he might have lost the session, thus
AM> having data on your DB that is wasting space.

AM> And what if the user closes the browser window? :)

All of those things are unavoidable no matter what technique you use
:)

I've seen multi-page forms with a "Finish this later" option that
issues a cookie to your browser, allowing you to visit the site at any
(realistic) point in the future and carry on. In which cases the
part-filled contents must already be in a database somewhere. This
isn't a bad thing imho, it's a nice touch.

Of course it's prone to the usual "browser doesn't accept cookies /
browser deletes cookies" syndrome though.

If you don't want to pass the form values across in a hidden manner
(and I don't blame you) then it's either dump it all in a session and
hope it doesn't time-out, or dump it into a database, issue the
visitor some link to that entry (cookie, session var) and again hope
they don't time out.

The only real difference being the DB option will need purging to get
rid of incomplete forms > X days old. But that in itself could prove a
useful statistic for reports. Unless you're dealing with thousands of
sign-ups an hour, I don't see any issue with this option.

Another technique might be the following - rethink how your forms
work. Exactly what is it you're collecting data about? If it's part of
a long sign-up process then you could consider changing the process
around a bit - so that the VERY first thing the user does is create a
temporary account on your site (call them "incomplete users"). So you
grab some method of login + authentication details from them. Then the
form pages following this can all be saved to a DB and linked to that
user.

So, as long as they complete this first step, they can always come
back and finish the job off - whenever they want, avoiding cookie and
session time-out issues.

This won't work for all forms of course, it depends what the nature of
the process is, but it's certainly an option.

Best regards,

Richard Davey
--
 http://www.launchcode.co.uk - PHP Development Services
 Zend Certified Engineer
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

attached mail follows:


Thanks everyone. I take the point of Andre, but believe that the depth
and sensitivity of the data require it be stored server side. I think
that Richard and Mark have put their fingers on it - it's gotta be
cookie based. Someone on the IRC suggested sessions and I think that it
the way it goes. As for the idea that new users would be sent packing by
such a ridiculously long form, right on! This is a form to be filled in
by a client of the company after they've hired to company to provide an
assessment of ther practices, so they'd expect a long form. But point taken

Thanks everyone for replying so quickly!

I'll come back when I botch the sessions and need help fixing!!

JJ

Richard Davey wrote:
> Hello André,
>
> Wednesday, July 27, 2005, 2:22:30 PM, you wrote:
>
> AM> That's not a very good idea. Imagine the user gets to the fourth
> AM> form and gets a cup of coffee, or goes out to lunch. By the time
> AM> he gets to the computer he might have lost the session, thus
> AM> having data on your DB that is wasting space.
>
> AM> And what if the user closes the browser window? :)
>
> All of those things are unavoidable no matter what technique you use
> :)
>
> I've seen multi-page forms with a "Finish this later" option that
> issues a cookie to your browser, allowing you to visit the site at any
> (realistic) point in the future and carry on. In which cases the
> part-filled contents must already be in a database somewhere. This
> isn't a bad thing imho, it's a nice touch.
>
> Of course it's prone to the usual "browser doesn't accept cookies /
> browser deletes cookies" syndrome though.
>
> If you don't want to pass the form values across in a hidden manner
> (and I don't blame you) then it's either dump it all in a session and
> hope it doesn't time-out, or dump it into a database, issue the
> visitor some link to that entry (cookie, session var) and again hope
> they don't time out.
>
> The only real difference being the DB option will need purging to get
> rid of incomplete forms > X days old. But that in itself could prove a
> useful statistic for reports. Unless you're dealing with thousands of
> sign-ups an hour, I don't see any issue with this option.
>
> Another technique might be the following - rethink how your forms
> work. Exactly what is it you're collecting data about? If it's part of
> a long sign-up process then you could consider changing the process
> around a bit - so that the VERY first thing the user does is create a
> temporary account on your site (call them "incomplete users"). So you
> grab some method of login + authentication details from them. Then the
> form pages following this can all be saved to a DB and linked to that
> user.
>
> So, as long as they complete this first step, they can always come
> back and finish the job off - whenever they want, avoiding cookie and
> session time-out issues.
>
> This won't work for all forms of course, it depends what the nature of
> the process is, but it's certainly an option.
>
> Best regards,
>
> Richard Davey

attached mail follows:


hi, my first attempt at a sessions-based form is starting at

http://pastebin.com/322696

and I have a question. What I want to do is, after the user answers the
questions in section one and they are error checked, I want to write the
answers to $_SESSION() and then continue down the script to the next
page of questions. I do *not* want to re-send the answers from page one
as $_POST vars back to the user and have the user submit the answers to
page 2 plus the $_POST answers from page 1.

What I am doing now is clearly wrong, basically :

if (empty($error)) {
         include_once($page2);
}

because that's keeping it all in one script. But how should I be getting
to the next page, sending headers to a new script, and at the end of the
chain the script which pulls it all together?

Thanks in advance,

JJ

Jack Jackson wrote:

> Thanks everyone. I take the point of Andre, but believe that the depth
> and sensitivity of the data require it be stored server side. I think
> that Richard and Mark have put their fingers on it - it's gotta be
> cookie based. Someone on the IRC suggested sessions and I think that it
> the way it goes. As for the idea that new users would be sent packing by
> such a ridiculously long form, right on! This is a form to be filled in
> by a client of the company after they've hired to company to provide an
> assessment of ther practices, so they'd expect a long form. But point taken
>
> Thanks everyone for replying so quickly!
>
> I'll come back when I botch the sessions and need help fixing!!
>
> JJ
>
>
> Richard Davey wrote:
>
>> Hello André,
>>
>> Wednesday, July 27, 2005, 2:22:30 PM, you wrote:
>>
>> AM> That's not a very good idea. Imagine the user gets to the fourth
>> AM> form and gets a cup of coffee, or goes out to lunch. By the time
>> AM> he gets to the computer he might have lost the session, thus
>> AM> having data on your DB that is wasting space.
>>
>> AM> And what if the user closes the browser window? :)
>>
>> All of those things are unavoidable no matter what technique you use
>> :)
>>
>> I've seen multi-page forms with a "Finish this later" option that
>> issues a cookie to your browser, allowing you to visit the site at any
>> (realistic) point in the future and carry on. In which cases the
>> part-filled contents must already be in a database somewhere. This
>> isn't a bad thing imho, it's a nice touch.
>>
>> Of course it's prone to the usual "browser doesn't accept cookies /
>> browser deletes cookies" syndrome though.
>>
>> If you don't want to pass the form values across in a hidden manner
>> (and I don't blame you) then it's either dump it all in a session and
>> hope it doesn't time-out, or dump it into a database, issue the
>> visitor some link to that entry (cookie, session var) and again hope
>> they don't time out.
>>
>> The only real difference being the DB option will need purging to get
>> rid of incomplete forms > X days old. But that in itself could prove a
>> useful statistic for reports. Unless you're dealing with thousands of
>> sign-ups an hour, I don't see any issue with this option.
>>
>> Another technique might be the following - rethink how your forms
>> work. Exactly what is it you're collecting data about? If it's part of
>> a long sign-up process then you could consider changing the process
>> around a bit - so that the VERY first thing the user does is create a
>> temporary account on your site (call them "incomplete users"). So you
>> grab some method of login + authentication details from them. Then the
>> form pages following this can all be saved to a DB and linked to that
>> user.
>>
>> So, as long as they complete this first step, they can always come
>> back and finish the job off - whenever they want, avoiding cookie and
>> session time-out issues.
>>
>> This won't work for all forms of course, it depends what the nature of
>> the process is, but it's certainly an option.
>>
>> Best regards,
>>
>> Richard Davey
>
>

attached mail follows:


> -----Original Message-----
> From: Jack Jackson [mailto:jackson.linuxgmail.com]
> Sent: Wednesday, July 27, 2005 3:47 PM
> To: php >> "[php] PHP General List"
> Subject: Re: [PHP] Multipage form redux
>
>
> hi, my first attempt at a sessions-based form is starting at
>
> http://pastebin.com/322696
>
> and I have a question. What I want to do is, after the user
> answers the
> questions in section one and they are error checked, I want
> to write the
> answers to $_SESSION() and then continue down the script to the next
> page of questions. I do *not* want to re-send the answers
> from page one
> as $_POST vars back to the user and have the user submit the
> answers to
> page 2 plus the $_POST answers from page 1.
>
>
>
> What I am doing now is clearly wrong, basically :
>
> if (empty($error)) {
> include_once($page2);
> }
>
> because that's keeping it all in one script. But how should I
> be getting
> to the next page, sending headers to a new script, and at the
> end of the
> chain the script which pulls it all together?
>
> Thanks in advance,
>
> JJ

This seems so simple to me. As I understand it, you want to split a data
entry session into several pages. You don't want to collect the data and
submit it all at the end, but instead commit it to session variables along
the way. Am I missing something?

Here's how I would do it in a nutshell:

Page1 // User enters first batch of data, presses SUBMIT at bottom. Data is
POSTed to Page2

Page2 // Commit data from page 1 to session variables, then displays form
for next batch of data. User presses SUBMIT, posts data to Page 3.

Page3 // Commit data from page 2 to session variables, then displays form
for next batch of data. User presses SUBMIT, posts data to Page 4.

... etc etc etc (Each page begins by assigning data from the previous page
to session variables)

Page515 // Displays all session variables set in previous pages, asks user
to confirm. User confirms by pressing SUBMIT, confirmation POSTed to page
516, who writes it all to the database, and sends confirmation email.

Personally, I would take the advice of a previous poster and start off
assigning a username and password to the user. Then store each page in the
database as the user progresses. That way, if he is interrupted in the
middle of the process, he won't lose all his data and have to start over.
He can just enter his username and pick up where he left off. You will just
have to write a script that purges old incomplete records. (A great job for
cron!)

JM

attached mail follows:


Jim Moseby wrote:
>>-----Original Message-----
>>From: Jack Jackson [mailto:jackson.linuxgmail.com]
>>Sent: Wednesday, July 27, 2005 3:47 PM
>>To: php >> "[php] PHP General List"
>>Subject: Re: [PHP] Multipage form redux
>>
>>
>>hi, my first attempt at a sessions-based form is starting at
>>
>>http://pastebin.com/322696
>>
>>and I have a question. What I want to do is, after the user
>>answers the
>>questions in section one and they are error checked, I want
>>to write the
>>answers to $_SESSION() and then continue down the script to the next
>>page of questions. I do *not* want to re-send the answers
>>from page one
>>as $_POST vars back to the user and have the user submit the
>>answers to
>>page 2 plus the $_POST answers from page 1.
>>
>>
>>
>>What I am doing now is clearly wrong, basically :
>>
>>if (empty($error)) {
>> include_once($page2);
>>}
>>
>>because that's keeping it all in one script. But how should I
>>be getting
>>to the next page, sending headers to a new script, and at the
>>end of the
>>chain the script which pulls it all together?
>>
>>Thanks in advance,
>>
>>JJ
>
>
>
> This seems so simple to me. As I understand it, you want to split a data
> entry session into several pages. You don't want to collect the data and
> submit it all at the end, but instead commit it to session variables along
> the way. Am I missing something?
>
> Here's how I would do it in a nutshell:
>
> Page1 // User enters first batch of data, presses SUBMIT at bottom. Data is
> POSTed to Page2
>
> Page2 // Commit data from page 1 to session variables, then displays form
> for next batch of data. User presses SUBMIT, posts data to Page 3.
>
> Page3 // Commit data from page 2 to session variables, then displays form
> for next batch of data. User presses SUBMIT, posts data to Page 4.
>
> ... etc etc etc (Each page begins by assigning data from the previous page
> to session variables)
>
> Page515 // Displays all session variables set in previous pages, asks user
> to confirm. User confirms by pressing SUBMIT, confirmation POSTed to page
> 516, who writes it all to the database, and sends confirmation email.
>
> Personally, I would take the advice of a previous poster and start off
> assigning a username and password to the user. Then store each page in the
> database as the user progresses. That way, if he is interrupted in the
> middle of the process, he won't lose all his data and have to start over.
> He can just enter his username and pick up where he left off. You will just
> have to write a script that purges old incomplete records. (A great job for
> cron!)
>
> JM
>

Right. Except I would rather have it working in a session because I
specifically do not want to have the form sending $_POST data back and
forth to the browser six times for several reasons. SO I'd like to

Page1 // User enters first batch of data, presses SUBMIT at bottom.
Data is cleaned and written to SESSION, user passed to Page2

repeat as necessary to last page. At last page, process and error check
newest input, then commit it, plus all previously stored session info to
db.

Does this make sense?

Thanks in advance

attached mail follows:


nferracuns.edu.ar wrote:

> Hi,
>
> I have Apache 2.0.52 with PHP 4.3.9, running on a Linux Fedora 3, and
> cannot write through PHP on any folder, except for /tmp.
> No matter which permissions, owner or group are set for the folders or
> files, they never become writable.
>
> When I execute the following script, I have always obtain as a result,
> that "The file is not writable", although it should be, because test.txt
> has Apache as its owner and group, and permissions for reading, writing
> and executing for the owner, group and others.
>
> In Apache, the user and group are set to Apache, and in PHP the safe mode
> is off

<SNIP code>

The directory where you are trying to write should also have write and scan
(x) permissions for the user; this probably means making the directory
chmod o+wx

Cheers
--
David Robley

My hat covers my head... Just like hair used to!

attached mail follows:


Dotan Cohen wrote:
> On 7/26/05, Jochem Maas <jochemiamjochem.com> wrote:
>
>>>>...somebody beat me with a virtual stick if I am wrong!
>>>
>>>Why? I'd rather just throw the php.net/manual at you!
>>
>>harddrive or memory stick?
>
> just /home/dotan/myfiles/docs/php-manual/
>
>
>>but seriously did I err?
>
> Not that I see. But don't forget that to err is human. To really fuck
> things up we invented computers.

no sh*t :-) I recieved you last email (to me) 4 times! :-/

>
> Dotan
> http://lyricslist.com/lyrics/artist_albums/27/alice_in_chains.php
> Alice In Chains Song Lyrics

attached mail follows:


On 7/27/05, Jochem Maas <jochemiamjochem.com> wrote:
> Dotan Cohen wrote:
> > On 7/26/05, Jochem Maas <jochemiamjochem.com> wrote:
> >
> >>>>...somebody beat me with a virtual stick if I am wrong!
> >>>
> >>>Why? I'd rather just throw the php.net/manual at you!
> >>
> >>harddrive or memory stick?
> >
> > just /home/dotan/myfiles/docs/php-manual/
> >
> >
> >>but seriously did I err?
> >
> > Not that I see. But don't forget that to err is human. To really fuck
> > things up we invented computers.
>
> no sh*t :-) I recieved you last email (to me) 4 times! :-/
>

As if we needed proof!
I got a letter from "mail admin" that the original message couldn't be
delivered because of profanity. I wasn't sure if it was from the php
server or one of the subscribers, so I changed a naughty little word
to a nicer one: two messages. Times two for you, pal, you're in the CC
field! (not anymore)

Dotan
http://lyricslist.com/lyrics/artist_albums/159/dido.php
Dido Song Lyrics

attached mail follows:


hi.

i have a p_debug(), that print out some useful information (for me).

it is called by a lot of my functions, and i want to know which one is
generating the error.
the referral function :)

no, i don't want to write in all call to p_debug some information on running
function...

thanks
daniele

--
PGP Key-ID: 0xF482D454
--
To boldly go where no man has gone before.

attached mail follows:


On Wed, 2005-07-27 at 15:14 +0200, Daniele Palumbo wrote:
> hi.
>
> i have a p_debug(), that print out some useful information (for me).
>
> it is called by a lot of my functions, and i want to know which one is
> generating the error.
> the referral function :)
>
> no, i don't want to write in all call to p_debug some information on running
> function...
>
> thanks
> daniele
>
> --
> PGP Key-ID: 0xF482D454
> --
> To boldly go where no man has gone before.
>

http://pt.php.net/manual/en/function.debug-backtrace.php

attached mail follows:


If my php is configured as ( http://liang.ns2user.info/php/info-train06.htm)
an apache 2.0 filter module. The php is invoked by apache on request of http
client. Can I do an exec() to call another php script to run in the
background? If yes, how?

Highly appreciate if somebody helps. Thank you.

attached mail follows:


Hi

I want to see that a user is submiting a form field in the correct manner.
So I decided to use preg_match to verify their input.

The pattern I am trying to match is;

Firstname Secondname

I am not bothered about character length just yet (but advise on this would
be appreciated if it can be done with a regular expression - saves extra
checking code), but I would like case sensitity.

The code I haev so far, which doesn't seem to work is;

$un = $_REQUEST['name'];
$exp = '/^\b[a-zA-Z] [a-zA-Z]$/';

if (preg_match($exp, $un)) {
    //has this matched?
    echo "<h2>matched</h2>";
}

Help would be greatly appreciated

Thanks
Steve

attached mail follows:


Steve Turnbull wrote:
> Hi
>
> I want to see that a user is submiting a form field in the correct manner.
> So I decided to use preg_match to verify their input.
>
> The pattern I am trying to match is;
>
> Firstname Secondname
>
> I am not bothered about character length just yet (but advise on this would
> be appreciated if it can be done with a regular expression - saves extra
> checking code), but I would like case sensitity.
>
> The code I haev so far, which doesn't seem to work is;
>
> $un = $_REQUEST['name'];
> $exp = '/^\b[a-zA-Z] [a-zA-Z]$/';
>
> if (preg_match($exp, $un)) {
> //has this matched?
> echo "<h2>matched</h2>";
> }
>
> Help would be greatly appreciated

/^[a-zA-Z]{1,}\s[a-zA-Z]{1,}$/

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


On Wed, 2005-07-27 at 15:27 +0100, Steve Turnbull wrote:
> Hi
>
> I want to see that a user is submiting a form field in the correct manner.
> So I decided to use preg_match to verify their input.
>
> The pattern I am trying to match is;
>
> Firstname Secondname
>
> I am not bothered about character length just yet (but advise on this would
> be appreciated if it can be done with a regular expression - saves extra
> checking code), but I would like case sensitity.
>
> The code I haev so far, which doesn't seem to work is;
>
> $un = $_REQUEST['name'];
> $exp = '/^\b[a-zA-Z] [a-zA-Z]$/';
>
> if (preg_match($exp, $un)) {
> //has this matched?
> echo "<h2>matched</h2>";
> }
>
> Help would be greatly appreciated
>
> Thanks
> Steve
>

http://pt.php.net/strpos

attached mail follows:


On Wed, 2005-07-27 at 15:27 +0100, Steve Turnbull wrote:
> Hi
>
> I want to see that a user is submiting a form field in the correct manner.
> So I decided to use preg_match to verify their input.
>
> The pattern I am trying to match is;
>
> Firstname Secondname
>
> I am not bothered about character length just yet (but advise on this would
> be appreciated if it can be done with a regular expression - saves extra
> checking code), but I would like case sensitity.
>
> The code I haev so far, which doesn't seem to work is;
>
> $un = $_REQUEST['name'];
> $exp = '/^\b[a-zA-Z] [a-zA-Z]$/';
>
> if (preg_match($exp, $un)) {
> //has this matched?
> echo "<h2>matched</h2>";
> }
>
> Help would be greatly appreciated
>
> Thanks
> Steve
>

A reminder... sometimes First and Last name can contain three words.
There are portuguese names, like "Inês de Medeiros". Watch out for that
too.

attached mail follows:


"André Medeiros" <andre.caumgmail.com> wrote in message
news:1122479077.3613.7.camelvaio...
> On Wed, 2005-07-27 at 15:27 +0100, Steve Turnbull wrote:
> > Hi
> >
> > I want to see that a user is submiting a form field in the correct
manner.
> > So I decided to use preg_match to verify their input.
> >
> > The pattern I am trying to match is;
> >
> > Firstname Secondname
> >
> > I am not bothered about character length just yet (but advise on this
would
> > be appreciated if it can be done with a regular expression - saves extra
> > checking code), but I would like case sensitity.
> >
> > The code I haev so far, which doesn't seem to work is;
> >
> > $un = $_REQUEST['name'];
> > $exp = '/^\b[a-zA-Z] [a-zA-Z]$/';
> >
> > if (preg_match($exp, $un)) {
> > //has this matched?
> > echo "<h2>matched</h2>";
> > }
> >
> > Help would be greatly appreciated
> >
> > Thanks
> > Steve
> >
>
> A reminder... sometimes First and Last name can contain three words.
> There are portuguese names, like "Inês de Medeiros". Watch out for that
> too.

Or even four - like Rafael van der Vaart for example - so make sure that the
surname box matches spaces as well, and special characters like the ê, as
well as ' as in John O'Kane

attached mail follows:


On Wed, 2005-07-27 at 16:16 +0100, Mark Rees wrote:
> "André Medeiros" <andre.caumgmail.com> wrote in message
> news:1122479077.3613.7.camelvaio...
> > On Wed, 2005-07-27 at 15:27 +0100, Steve Turnbull wrote:
> > > Hi
> > >
> > > I want to see that a user is submiting a form field in the correct
> manner.
> > > So I decided to use preg_match to verify their input.
> > >
> > > The pattern I am trying to match is;
> > >
> > > Firstname Secondname
> > >
> > > I am not bothered about character length just yet (but advise on this
> would
> > > be appreciated if it can be done with a regular expression - saves extra
> > > checking code), but I would like case sensitity.
> > >
> > > The code I haev so far, which doesn't seem to work is;
> > >
> > > $un = $_REQUEST['name'];
> > > $exp = '/^\b[a-zA-Z] [a-zA-Z]$/';
> > >
> > > if (preg_match($exp, $un)) {
> > > //has this matched?
> > > echo "<h2>matched</h2>";
> > > }
> > >
> > > Help would be greatly appreciated
> > >
> > > Thanks
> > > Steve
> > >
> >
> > A reminder... sometimes First and Last name can contain three words.
> > There are portuguese names, like "Inês de Medeiros". Watch out for that
> > too.
>
> Or even four - like Rafael van der Vaart for example - so make sure that the
> surname box matches spaces as well, and special characters like the ê, as
> well as ' as in John O'Kane
>

Yeah, that's why strpos will make his life much easier :)

attached mail follows:


From: André Medeiros [mailto:andre.caumgmail.com]

> On Wed, 2005-07-27 at 16:16 +0100, Mark Rees wrote:
>
> > Or even four - like Rafael van der Vaart for example - so
> make sure that the
> > surname box matches spaces as well, and special characters
> like the ê, as
> > well as ' as in John O'Kane
> >
>
> Yeah, that's why strpos will make his life much easier :)

Can you explain how you'd use strpos() in this situation? I was going to ask earlier, but didn't bother, but now I'm curious...

--
Mike Johnson Smarter Living, Inc.
Web Developer www.smartertravel.com
mikesmarterliving.com (617) 886-5539

attached mail follows:


On Wed, 2005-07-27 at 11:41 -0400, Mike Johnson wrote:
> From: André Medeiros [mailto:andre.caumgmail.com]
>
> > On Wed, 2005-07-27 at 16:16 +0100, Mark Rees wrote:
> >
> > > Or even four - like Rafael van der Vaart for example - so
> > make sure that the
> > > surname box matches spaces as well, and special characters
> > like the ê, as
> > > well as ' as in John O'Kane
> > >
> >
> > Yeah, that's why strpos will make his life much easier :)
>
> Can you explain how you'd use strpos() in this situation? I was going to ask earlier, but didn't bother, but now I'm curious...
>

That's not very nice of you, saying that to people who try to help ;)

if( strpos( $_POST['frmName'], ' ' ) === false ) {
    // Do error handling here
} else {
    // All is OK :)
}

attached mail follows:


André Medeiros wrote:
> That's not very nice of you, saying that to people who try to help ;)
>
> if( strpos( $_POST['frmName'], ' ' ) === false ) {
> // Do error handling here
> } else {
> // All is OK :)
> }
>

How does that match "Firstname Lastname" better than a regex? That will
return true as long as there is at least one space, no matter what the
rest of the submission is. I could submit "$^&#^&$&#& )(*!#", or I
could submit just a single space, and that would return true. strpos()
has it's uses, but this isn't one of them.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


From: André Medeiros [mailto:andre.caumgmail.com]

> On Wed, 2005-07-27 at 11:41 -0400, Mike Johnson wrote:
> > From: André Medeiros [mailto:andre.caumgmail.com]
> >
> > > On Wed, 2005-07-27 at 16:16 +0100, Mark Rees wrote:
> > >
> > > > Or even four - like Rafael van der Vaart for example - so
> > > make sure that the
> > > > surname box matches spaces as well, and special characters
> > > like the ê, as
> > > > well as ' as in John O'Kane
> > > >
> > >
> > > Yeah, that's why strpos will make his life much easier :)
> >
> > Can you explain how you'd use strpos() in this situation? I
> was going to ask earlier, but didn't bother, but now I'm curious...
> >
>
> That's not very nice of you, saying that to people who try to help ;)

Well, it could be argued that an obtuse link to the online docs and nothing else isn't "trying to help." ;)

> if( strpos( $_POST['frmName'], ' ' ) === false ) {
> // Do error handling here
> } else {
> // All is OK :)
> }

Gotcha. Except that it'll accept a ' ' string as valid. :P

--
Mike Johnson Smarter Living, Inc.
Web Developer www.smartertravel.com
mikesmarterliving.com (617) 886-5539

attached mail follows:


On Wed, 2005-07-27 at 11:55 -0400, John Nichel wrote:
> André Medeiros wrote:
> > That's not very nice of you, saying that to people who try to help ;)
> >
> > if( strpos( $_POST['frmName'], ' ' ) === false ) {
> > // Do error handling here
> > } else {
> > // All is OK :)
> > }
> >
>
> How does that match "Firstname Lastname" better than a regex? That will
> return true as long as there is at least one space, no matter what the
> rest of the submission is. I could submit "$^&#^&$&#& )(*!#", or I
> could submit just a single space, and that would return true. strpos()
> has it's uses, but this isn't one of them.
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> johnkegworks.com
>

There is a large number of sittuations that the regex won't work in.
Special characters aren't included (from what I can understand using my
weak regex knowlege), you could even be chinese, and it wouldn't work.

If you use strpos with trim and strlen cleverlly, you won't have to
worry about it again.

My $0.02

attached mail follows:


André Medeiros wrote:
> On Wed, 2005-07-27 at 11:55 -0400, John Nichel wrote:
>
>>André Medeiros wrote:
>>
>>>That's not very nice of you, saying that to people who try to help ;)
>>>
>>>if( strpos( $_POST['frmName'], ' ' ) === false ) {
>>> // Do error handling here
>>>} else {
>>> // All is OK :)
>>>}
>>>
>>
>>How does that match "Firstname Lastname" better than a regex? That will
>>return true as long as there is at least one space, no matter what the
>>rest of the submission is. I could submit "$^&#^&$&#& )(*!#", or I
>>could submit just a single space, and that would return true. strpos()
>>has it's uses, but this isn't one of them.
>
> There is a large number of sittuations that the regex won't work in.
> Special characters aren't included (from what I can understand using my
> weak regex knowlege), you could even be chinese, and it wouldn't work.
>
> If you use strpos with trim and strlen cleverlly, you won't have to
> worry about it again.
>
> My $0.02

You can trim whitespace and check the length until the cows come home,
and that still won't stop a string such as "#T*& a%!". A regex can
cover practicaly every situation for a name submission; it all depends
on how deep you want to validate. strpos() has too narrow of a scope to
match a complex pattern.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


On Wed, 2005-07-27 at 12:30 -0400, John Nichel wrote:
> André Medeiros wrote:
> > On Wed, 2005-07-27 at 11:55 -0400, John Nichel wrote:
> >
> >>André Medeiros wrote:
> >>
> >>>That's not very nice of you, saying that to people who try to help ;)
> >>>
> >>>if( strpos( $_POST['frmName'], ' ' ) === false ) {
> >>> // Do error handling here
> >>>} else {
> >>> // All is OK :)
> >>>}
> >>>
> >>
> >>How does that match "Firstname Lastname" better than a regex? That will
> >>return true as long as there is at least one space, no matter what the
> >>rest of the submission is. I could submit "$^&#^&$&#& )(*!#", or I
> >>could submit just a single space, and that would return true. strpos()
> >>has it's uses, but this isn't one of them.
> >
> > There is a large number of sittuations that the regex won't work in.
> > Special characters aren't included (from what I can understand using my
> > weak regex knowlege), you could even be chinese, and it wouldn't work.
> >
> > If you use strpos with trim and strlen cleverlly, you won't have to
> > worry about it again.
> >
> > My $0.02
>
> You can trim whitespace and check the length until the cows come home,
> and that still won't stop a string such as "#T*& a%!". A regex can
> cover practicaly every situation for a name submission; it all depends
> on how deep you want to validate. strpos() has too narrow of a scope to
> match a complex pattern.
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> johnkegworks.com
>

You can have four words to describe a first and last name... you can
have other alphabets, like arabian, chinese, etc... inserting accented
characters alone would make that a big, nasty regex, let alone
predicting ways you can describe first/last names.

I'm not saying that I have the _BEST_ sollution. All I'm saying is that
there are sittuations that are out of your control, and it seems to me
this might be the easiest way out, guaranteeing that there are at least
two words.

If you find a way to fit accented characters / other alphabets there
nicelly, be my guest :)

Take care.

attached mail follows:


André Medeiros wrote:
> On Wed, 2005-07-27 at 12:30 -0400, John Nichel wrote:
>
>>André Medeiros wrote:
>>
>>>On Wed, 2005-07-27 at 11:55 -0400, John Nichel wrote:
>>>
>>>
>>>>André Medeiros wrote:
>>>>
>>>>
>>>>>That's not very nice of you, saying that to people who try to help ;)
>>>>>
>>>>>if( strpos( $_POST['frmName'], ' ' ) === false ) {
>>>>> // Do error handling here
>>>>>} else {
>>>>> // All is OK :)
>>>>>}
>>>>>
>>>>
>>>>How does that match "Firstname Lastname" better than a regex? That will
>>>>return true as long as there is at least one space, no matter what the
>>>>rest of the submission is. I could submit "$^&#^&$&#& )(*!#", or I
>>>>could submit just a single space, and that would return true. strpos()
>>>>has it's uses, but this isn't one of them.
>>>
>>>There is a large number of sittuations that the regex won't work in.
>>>Special characters aren't included (from what I can understand using my
>>>weak regex knowlege), you could even be chinese, and it wouldn't work.
>>>
>>>If you use strpos with trim and strlen cleverlly, you won't have to
>>>worry about it again.
>>>
>>>My $0.02
>>
>>You can trim whitespace and check the length until the cows come home,
>>and that still won't stop a string such as "#T*& a%!". A regex can
>>cover practicaly every situation for a name submission; it all depends
>>on how deep you want to validate. strpos() has too narrow of a scope to
>>match a complex pattern.
>
> You can have four words to describe a first and last name... you can
> have other alphabets, like arabian, chinese, etc... inserting accented
> characters alone would make that a big, nasty regex, let alone
> predicting ways you can describe first/last names.

And this can all be matched with a regex. Like I said, it depends on
how deep you want to validate.

> I'm not saying that I have the _BEST_ sollution. All I'm saying is that
> there are sittuations that are out of your control, and it seems to me
> this might be the easiest way out, guaranteeing that there are at least
> two words.

But it doesn't even guarantee that. As shown previously, it will return
true even on strings that have non-word characters in them (no matter
the language). The only thing you're guaranteeing with strpos (
$string, " " ); is that the string contains a space...that's it; and
basically that's what you're limited too, until you start running other
functions to check/remove other parts of the string

> If you find a way to fit accented characters / other alphabets there
> nicelly, be my guest :)

It's really quite easy, when you look at it from the other direction.
When you're trying to match a pattern that can contain just about
anything and be considered valid, it might be best to check for
characters that you _do not_ want in there. With that in mind, there's
no reason to build a regex that can account for every possible alphabet
and/or accents. Make sure it contains a space, but doesn't contain
characters we don't want (such as #%).

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


Hello,
Thanks for all the info guys! I successfully made php use root user to
preform a few commands. I restricted root access to allow only a few
commands which were needed.

I'm doing my best to keep this thing as secure as possible which still
preforming the tasks that need to be done.

Tom

On 7/26/05, Jack Scott <jackglengroup.com> wrote:
>
> Hello,
> Stop! never give up the root password inside a text file anywhere on
> your machine!
>
> you should keep this script out of the web path and exicute it using
> either the sudo or visudo commands in the shell.
>
> If you are on a UNIX/Linux machine:
> add this to the first line of your script
> #!/usr/bin/php
> (or whatever the path to your php executable is)
>
> then something like this to execute it...
> sudo ./myscript.php
>
> Make sence?
>
> On Tue, 2005-07-26 at 17:28 -0400, Tom Cruickshank wrote:
> > Hello,
> > I'm in the process of executing system commands using php. The only
> problem
> > is that I am not entirely sure how to execute these system commands
> using
> > root user.
> > (I need root access to do a few things through php). Whenever I use the
> exec
> > command it uses the www user. Would anyone know? Thanks for any
> assistance!
> >
> > Tom
>
>

attached mail follows:


I'm successfully calling SOAP functions via a WSDL interface using
PHP5, but sometimes the functions return things that are complex
objects with methods as well as attributes. For example, the
interface I'm using has a query function which returns an array, but
it also has a function called IsDone() which can be called to find
out if this is the last page of results (it returns records in batches).

It goes like this:

<?php
require_once 'MyClient.class.php';

$mc = new MyClient();
$mc->dologin('id', 'pass');
try {
     $res = $mc->query(array('queryString' => 'select Field from
Table'));
     $alldone = $res->isDone();
} catch (SoapFault $f) {
     print 'Caught Exception: '. $f->faultstring. "\n";
     var_dump($mc);
}
?>

You can see that $res is the result returned from the query, and it
is presented as a stdClass object with results stored in an array
property. However, when I try to call $res->IsDone(), it fails to work:

PHP Fatal error: Call to undefined method stdClass::isDone()

I have some example code in Java for the same WSDL that makes it look
very simple:

...
queryResult = binding.query("select Field from Table");
if (queryResult.isDone()) {
...

How on earth do I do that in PHP? I don't think that creating PHP
classes and using classmap will help (it just moves the problem), at
least partly because this is a dynamic WSDL that is subject to change.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcussynchromedia.co.uk | http://www.synchromedia.co.uk

attached mail follows:


Hi all,
 
which is the correct method to get a value from the database table into a php variable using the select statement for both oracle and mssql databases.
for example if i have a query like "SELECT email_address FROM users_activation WHERE username='$username';".
how to get the email address into a simple string variable from above select statement using oci8 functions and mssql functions.
 
Thanks
babu

                
---------------------------------
How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos. Get Yahoo! Photos

attached mail follows:


More specifically, I'd have two frames, one of which is hidden using
css and the other that would display the content of the website. The
user would never know that there were frames on the page by looking
at it.

Just as a warning most people will tell you that putting background
music on your site (especially midi) is kinda grouped in with ye ol'
blink tag. Check out "no-no" number 9: http://www.webdevstore.com/
freebies/free_articles_tutorials/10designnos.htm

On Jul 26, 2005, at 10:10 AM, André Medeiros wrote:

> On Tue, 2005-07-26 at 13:47 +0100, Tom Chubb wrote:
>
>> This seems really silly, but I can't find a way of doing it!
>> How can I play/stream an audio file, that may be upto an hour long
>> and
>> keep it playing while visitors view other pages?
>> Is it possible to use sessions so that the file will continue playing
>> when they hit the next page.
>> (It wouldn't really matter if there was a small pause while they
>> changed)
>> (I don't really want to play it from a popup window.)
>> Any help would be greatly appreciated.
>> Tom
>>
>>
>
> Using frames?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


(It's been a while and I haven't seen this message yet. Are we back to
rediculous message delays?? Forgive the repost if it be such.)

Hello,

I was just expirementing with the diff command and was wondering if
there was anything out there that does the same thing but with a more
intuitive interface?

The problem I want to avoid is a basic one. "Which file did I update
last week that I forgot to publish to the live site?"

It would be really cool if there was something built on ncurses and not
just command line driven.

Alternatively, if there aren't any scripts out there I'd like to hear
how the list members handle this.

Thanks!
Chris.

attached mail follows:


Chris W. Parker wrote:
> (It's been a while and I haven't seen this message yet. Are we back to
> rediculous message delays?? Forgive the repost if it be such.)
>
> Hello,
>
> I was just expirementing with the diff command and was wondering if
> there was anything out there that does the same thing but with a more
> intuitive interface?
>
> The problem I want to avoid is a basic one. "Which file did I update
> last week that I forgot to publish to the live site?"
>
> It would be really cool if there was something built on ncurses and not
> just command line driven.
>
>
> Alternatively, if there aren't any scripts out there I'd like to hear
> how the list members handle this.

What about just checking the modified times of the two files with
filemtime()? You could have it grab the timestamp of both files,
compare them, and see if it's outside a set parameter (like 24 hours, 7
days, etc).

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


> I was just expirementing with the diff command and was wondering if
> there was anything out there that does the same thing but with a more
> intuitive interface?

What's wrong with "diff -r --brief dir1 dir2"

That's about as intuitive as you can get, no?

attached mail follows:


>> I was just expirementing with the diff command and was wondering if
>> there was anything out there that does the same thing but with a more
>> intuitive interface?
>>
>> The problem I want to avoid is a basic one. "Which file did I update
>> last week that I forgot to publish to the live site?"
>>
>> It would be really cool if there was something built on ncurses and not
>> just command line driven.
>>
>>
>> Alternatively, if there aren't any scripts out there I'd like to hear
>> how the list members handle this.
>
> What about just checking the modified times of the two files with
> filemtime()? You could have it grab the timestamp of both files, compare
> them, and see if it's outside a set parameter (like 24 hours, 7 days, etc).

Can't you run into problems where depending on how they get copied from
server to server the modified time gets adjusted? Seems I've run into
that in Windows when FTP'ing. It doesn't preserver that info and treats
all the files as brand spanking new...

attached mail follows:


Philip Hallstrom wrote:
>>> I was just expirementing with the diff command and was wondering if
>>> there was anything out there that does the same thing but with a more
>>> intuitive interface?
>>>
>>> The problem I want to avoid is a basic one. "Which file did I update
>>> last week that I forgot to publish to the live site?"
>>>
>>> It would be really cool if there was something built on ncurses and not
>>> just command line driven.
>>>
>>>
>>> Alternatively, if there aren't any scripts out there I'd like to hear
>>> how the list members handle this.
>>
>>
>> What about just checking the modified times of the two files with
>> filemtime()? You could have it grab the timestamp of both files,
>> compare them, and see if it's outside a set parameter (like 24 hours,
>> 7 days, etc).
>
>
> Can't you run into problems where depending on how they get copied from
> server to server the modified time gets adjusted? Seems I've run into
> that in Windows when FTP'ing. It doesn't preserver that info and treats
> all the files as brand spanking new...
>

Yeah, but I *think* he's in the *nix world. I'm just throwing s**t at
the wall and seeing what will stick. ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


Philip Hallstrom <mailto:phpphilip.pjkh.com>
    on Wednesday, July 27, 2005 11:09 AM said:

>> I was just expirementing with the diff command and was wondering if
>> there was anything out there that does the same thing but with a more
>> intuitive interface?
>
> What's wrong with "diff -r --brief dir1 dir2"
>
> That's about as intuitive as you can get, no?

Well to answer your question, no. It could get a lot more intuitive than
that. For one, I don't know which file was updated last (ok, well, *I*
know when, but not anyone else that might come later, or for that matter
me in 6 mths.)

I was using 'diff -rc dir1 dir2' before I wrote my email. I didn't
notice the --brief command, but I like it.

Thanks,
Chris.

attached mail follows:


John Nichel <mailto:johnkegworks.com>
    on Wednesday, July 27, 2005 10:56 AM said:

> What about just checking the modified times of the two files with
> filemtime()? You could have it grab the timestamp of both files,
> compare them, and see if it's outside a set parameter (like 24 hours,
> 7 days, etc).

Yeah, that's not a bad idea. A web based app would be pretty cool.

Thanks,
Chris.

p.s. Yes I am in a *nix environment. RH9 to be specific. Good job John!

attached mail follows:


>>> I was just expirementing with the diff command and was wondering if
>>> there was anything out there that does the same thing but with a more
>>> intuitive interface?
>>
>> What's wrong with "diff -r --brief dir1 dir2"
>>
>> That's about as intuitive as you can get, no?
>
> Well to answer your question, no. It could get a lot more intuitive than
> that. For one, I don't know which file was updated last (ok, well, *I*
> know when, but not anyone else that might come later, or for that matter
> me in 6 mths.)

Ah... good point. I'd assumed that dir1 would always be newer than dir2
(ie. that you only make changes in dir1).

You could combine the output of the diff command though to loop through
and grab timestamps. there might be an option to diff to just show
timestamps, not the actual diffs too... not sure though

attached mail follows:


Hello everybody:

I finally installed Apache 1.3.3 and PHP 5.0.4 engine and made my first PHP page and it works! thanks for your help! And didn't use an IDE, just UltraEdit :) but, I WILL use and IDE someday anyway.

Now, my question is: can I use Apache version 2 with PHP? And, even if I can use it in my development environment... is it safe to use Apache 2+PHP in a production environment?

Fist of all, thanks for your answers, I am new with PHP, but I've been using Java for the last 5 years, so, it's very interesting to compare both.

Tak (learning PHP in turbo-mode)

                
---------------------------------
 Start your day with Yahoo! - make it your home page

attached mail follows:


* Taksam <taksam_tongyahoo.com>:
> I finally installed Apache 1.3.3 and PHP 5.0.4 engine and made my
> first PHP page and it works! thanks for your help! And didn't use an
> IDE, just UltraEdit :) but, I WILL use and IDE someday anyway.

The beauty of PHP (and most scripting languages) is that you don't need
an IDE ever. A good editor with syntax highlighting will get you where
you need to go reliably. I use vim.

> Now, my question is: can I use Apache version 2 with PHP? And, even if
> I can use it in my development environment... is it safe to use Apache
> 2+PHP in a production environment?

Yes. But there *are* issues with it. The biggest thing Apache2 introduced
was threaded processes. Unfortunately, PHP isn't necessarily threadsafe
-- not all of the libraries it can be compiled are threadsafe, and many
are in a state where thread status is simply unknown. (My understanding
is that the PHP core is probably threadsafe; it's the extensions --
database, mail, etc --- that you can't be sure of. Somebody correct me
if I'm wrong.)

The upshot is that when compiling PHP to work with Apache2, you have to
compile it to work without threads -- which means that, in the end,
there are no performance gains, and, in most instances, PHP performance
actually suffers under Apache2 (up to 30% decrease).

John Coggeshall announced today that he is going to work to get PHP
completely threadsafe, but my guess is that this will likely be a late
version of PHP 5.1, if not even another minor version (5.2, 5.3) before
it's complete.

By the way -- I'm hoping you meant Apache 1.3.33, and not Apache
1.3.3... ;-)

--
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

attached mail follows:


Anybody used OpenAMF+PHP? ( http://www.amfphp.org/ )

It is an open-source Flash Remoting gateway. I already used it with Java and works OK. Just wanted to know if somebody here used it with PHP and would like to know if they recommend it or not.

Tak

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

attached mail follows:


Hi all

We just bought ourselfs a very basic windows station so that we can test our
php and html applications on windows as well. For the html applications, a
simple screen shot of how it looks in internet explorer is sufficient.

I know how to handle http authentication, file uploads, streaming files back
to the browser and all that, but would like some advise on how I can control
internet explorer from php.

The scheme: a coworker logs on on the page, enters a local network url, the
scripts launches internetxplorer with that url, takes a screen shot picture
and streams that back to the browser.

Any ideas anyone?

With kind regards

Andy
--
Registered Linux User Number 379093
Now listening to Highlander - Last Forever

   amaroK::the Coolest Media Player in the known Universe!

   Cockroaches and socialites are the only things that can
   stay up all night and eat anything.
                                            Herb Caen
--
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-) W+++>+++$ !N o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+) !tv b-() DI(+) D+(+++) G(+)
e>++++$ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/

--

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQBC59Nc6Hylol726jIRAkYsAJ9gbt90tFOl0Q6EDOI8JIAh8+xtEwCfSFZu
uhix/ogUghmhTAf9Z2lOWIY=
=QXD6
-----END PGP SIGNATURE-----

attached mail follows:


Launching a brower shouldn't be difficult.. there's a few ways to do that. Taking the screenshot might be trickier though. I don't know of any function in IE that'll take a screenshot so don't know if you could do it through a COM interface to IE.

My first impulse was to maybe check out the PHP extension Winbinder:

http://www.hypervisual.com/winbinder/

But while it gives you access to low level Windows API functions, it might take some hacking to get it to get you a screenshot.

A non-php solution might be to use something like WinBatch. It's a Windows scripting/automation language that I've used in the past. It DOES have a Snapshot() function and can probably do everything you need.

http://www.winbatch.com/

The program costs money, but there are more i