php-general Digest 19 Sep 2007 04:01:42 -0000 Issue 5026
Topics (messages 262203 through 262224):
Case insensitive ksort
262203 by: Christoph Boget
262206 by: Jim Lucas
262207 by: Robin Vickery
262208 by: TG
Re: dynamic <img>
262204 by: Stut
262205 by: Edward Kay
Questions about overloading and visibility in PHP5
262209 by: Steve Brown
262210 by: Andrew Ballard
262211 by: Gregory Beaver
Job openings in Maryland
262212 by: Christoph Boget
read the main domain cookie in sub domain
262213 by: Sanjeev N
262214 by: Stut
262215 by: Sanjeev N
262216 by: Stut
262217 by: Sanjeev N
date weirdness
262218 by: Greg Donald
262219 by: Andrew Ballard
262222 by: Robert Cummings
Re: Try to find a solution, when restart Apache with PHP Script
262220 by: James Ausmus
Re: PHP "preg_replace" help
262221 by: Arpad Ray
setup help in IIS6
262223 by: Chuck Chidekel
trouble trying to connect to gmail server.
262224 by: Fábio Generoso
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
I looked in the docs but didn't see anything regarding case
insensitivity and I fear the functionality doesn't exist. I'm just
hoping I'm looking in the wrong place.
Is there a way to get ksort to work without regard to case? When I
sort an array using ksort, all the upper case keys end up at the top
(sorted) and all the lower case keys end up at the bottom (sorted).
Ideally, I'd like to see all the keys sorted (and intermixed)
regardless of case. Am I going to have to do this manually? Or is
there an internal php command that will do it for me?
thnx,
Christoph
--- End Message ---
--- Begin Message ---
Christoph Boget wrote:
I looked in the docs but didn't see anything regarding case
insensitivity and I fear the functionality doesn't exist. I'm just
hoping I'm looking in the wrong place.
Is there a way to get ksort to work without regard to case? When I
sort an array using ksort, all the upper case keys end up at the top
(sorted) and all the lower case keys end up at the bottom (sorted).
Ideally, I'd like to see all the keys sorted (and intermixed)
regardless of case. Am I going to have to do this manually? Or is
there an internal php command that will do it for me?
thnx,
Christoph
Is this what you are looking for?
<?php
$yourarray = array();
$sorted = natcasesort(array_keys($yourarray));
foreach ( $sorted AS $key ) {
echo $yourarray[$key];
}
?>
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--- End Message ---
--- Begin Message ---
On 18/09/2007, Christoph Boget <[EMAIL PROTECTED]> wrote:
> I looked in the docs but didn't see anything regarding case
> insensitivity and I fear the functionality doesn't exist. I'm just
> hoping I'm looking in the wrong place.
>
> Is there a way to get ksort to work without regard to case? When I
> sort an array using ksort, all the upper case keys end up at the top
> (sorted) and all the lower case keys end up at the bottom (sorted).
> Ideally, I'd like to see all the keys sorted (and intermixed)
> regardless of case. Am I going to have to do this manually? Or is
> there an internal php command that will do it for me?
uksort($array, 'strcasecmp');
-robin
--- End Message ---
--- Begin Message ---
I don't have time to look up in the manual but I don't remember a case
insensitive ksort().
I think there's a uksort() where you could specify your own sorting
parameters for the keys.
Also, you could create the array with keys run through strtoupper() or
strtolower(). If you need the proper upper/lowercase version too, you
could store that separately within the array.
Just some thoughts on how you could do this. good luck!
-TG
----- Original Message -----
From: "Christoph Boget" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: Tue, 18 Sep 2007 11:37:01 -0400
Subject: [PHP] Case insensitive ksort
> I looked in the docs but didn't see anything regarding case
> insensitivity and I fear the functionality doesn't exist. I'm just
> hoping I'm looking in the wrong place.
>
> Is there a way to get ksort to work without regard to case? When I
> sort an array using ksort, all the upper case keys end up at the top
> (sorted) and all the lower case keys end up at the bottom (sorted).
> Ideally, I'd like to see all the keys sorted (and intermixed)
> regardless of case. Am I going to have to do this manually? Or is
> there an internal php command that will do it for me?
>
> thnx,
> Christoph
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Anugrah Widya wrote:
dear friends :),
i have problem with dynamic image displaying
here the snippets
thumb.php
<?php
header("Content-type: image/jpg");
$file = "data/original/filename.jpg";
readfile($file);
?>
img.php
<img src="thumb.php?filename.jpg" />
problem is i always get broken images, someone know how to fix this ?
Rather than viewing img.php, go directly to thumb.php?filename.jpg in
your browser. Change the content-type to text/plain and see what you get
in the browser.
You may also want to remove the ?> at the end of thumb.php - it's not
needed and may be adding whitespace to the image you are returning.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
> >> thumb.php
> >> <?php
> >> header("Content-type: image/jpg");
> >> $file = "data/original/filename.jpg";
> >> readfile($file);
> >> ?>
Change
header("Content-type: image/jpg");
to
header("Content-type: image/jpeg");
Apparently IE doesn't like image/jpg [1].
[1] http://pear.php.net/bugs/bug.php?id=4586
Edward
--- End Message ---
--- Begin Message ---
I've been doing a bunch of reading about objects and overloading in
PHP5, but I've got a couple of questions that I can't seem to find the
answer to online. Suppose the following code in PHP5.2.4:
<?php
class foo {
public $x;
private $z = 'z';
public function __set ($name, $val) {
echo "Setting \$this->$name to $val...\n";
$this->{$name} = $val;
}
public function __get ($name) {
return "The value of $name is {$this->{$name}}.\n";
}
}
?>
My questions are as follows:
1) It seems that the getter and setter are not called on every single
call. For example, if I do the following:
$bar = new foo;
$bar->x = 'x';
There is no output. I would expect to see "Setting $this->x to x."
Another example:
$bar = new foo;
$bar->y = 'y';
echo $bar->y;
I would expect this to see "The value of y is y." but instead I just
get 'y' as output. So when do the various setters/getters get used?
2) It seems that getters ignore the visibility of properties. Why is
this? For example:
$bar = new foo;
echo $bar->z;
I would expect this to throw an error about accessing a private
member, but it outputs "The value of z is z." just fine. If I remove
the __get() overloader, an error is thrown.
I'm guessing that the answer to all of my questions is some how
wrapped up in visibility and overloading. Unfortunately I cannot find
any resource that documents the interactions. TIA.
--- End Message ---
--- Begin Message ---
> 1) It seems that the getter and setter are not called on every single
> call. For example, if I do the following:
>
> $bar = new foo;
> $bar->x = 'x';
>
> There is no output. I would expect to see "Setting $this->x to x."
> Another example:
>
> $bar = new foo;
> $bar->y = 'y';
> echo $bar->y;
>
> I would expect this to see "The value of y is y." but instead I just
> get 'y' as output. So when do the various setters/getters get used?
>
> 2) It seems that getters ignore the visibility of properties. Why is
> this? For example:
>
> $bar = new foo;
> echo $bar->z;
>
> I would expect this to throw an error about accessing a private
> member, but it outputs "The value of z is z." just fine. If I remove
> the __get() overloader, an error is thrown.
>
> I'm guessing that the answer to all of my questions is some how
> wrapped up in visibility and overloading. Unfortunately I cannot find
> any resource that documents the interactions. TIA.
>
As I understand it, the __get and __set do not ignore visibility;
rather, they only work for accessing private members. If a property is
declared public, it does not need the __get and __set, so they aren't
used. Likewise, $bar->y is public since it was added dynamically
outside the class.
Andrew
--- End Message ---
--- Begin Message ---
Steve Brown wrote:
> I've been doing a bunch of reading about objects and overloading in
> PHP5, but I've got a couple of questions that I can't seem to find the
> answer to online. Suppose the following code in PHP5.2.4:
>
> <?php
> class foo {
> public $x;
> private $z = 'z';
>
> public function __set ($name, $val) {
> echo "Setting \$this->$name to $val...\n";
> $this->{$name} = $val;
> }
>
> public function __get ($name) {
> return "The value of $name is {$this->{$name}}.\n";
> }
> }
> ?>
>
> My questions are as follows:
>
> 1) It seems that the getter and setter are not called on every single
> call. For example, if I do the following:
>
> $bar = new foo;
> $bar->x = 'x';
>
> There is no output. I would expect to see "Setting $this->x to x."
remove "public $x" and it works. __set() is only called for
non-existent variables.
> Another example:
>
> $bar = new foo;
> $bar->y = 'y';
> echo $bar->y;
>
> I would expect this to see "The value of y is y." but instead I just
> get 'y' as output. So when do the various setters/getters get used?
again, because your code sets $y with $this->{$name} = $value, the
variable $y now exists, and so __get() is not called.
If you're using normal variables, then you don't need setters/getters.
Instead, if you store the values inside an internal array (for
instance), then a setter/getter can help to abstract the array contents.
For instance, this class:
http://svn.pear.php.net/wsvn/PEARSVN/Pyrus/trunk/src/PackageFile/v2/Developer.php?op=file&rev=0&sc=0
(which is under development currently for the next incarnation of the
PEAR installer) allows logical manipulation of maintainers of a package
within package.xml. Instead of either direct array manipulation or the
old way, which was a complex method call that is easy to mis-order:
$pf->addMaintainer('cellog', 'Greg Beaver', '[EMAIL PROTECTED]', 'yes');
One can do:
$pf->maintainer['cellog']
->name('Greg Beaver')
->email('[EMAIL PROTECTED]')
->active('yes');
and then values can be retrieved using normal stuff like:
echo $pf->maintainer['cellog']->email;
The entire time, the class is abstracting stuff that would be really
complex as it is actually accessing the underlying XML of the
package.xml directly when making the modifications.
The examples you give don't need this kind of complexity.
> 2) It seems that getters ignore the visibility of properties. Why is
> this? For example:
>
> $bar = new foo;
> echo $bar->z;
>
> I would expect this to throw an error about accessing a private
> member, but it outputs "The value of z is z." just fine. If I remove
> the __get() overloader, an error is thrown.
private properties simply don't exist outside the class, so you can
create public properties on external access with impunity.
You should open a documentation bug for this at bugs.php.net
Greg
--- End Message ---
--- Begin Message ---
My company has the following job openings available:
Join in the Adventure.
Yakabod, a web software and services company, is located in a beautifully
restored facility in Frederick, Maryland's historic district. We've
experienced steady growth since starting in 2001. We've set our hearts on
building a great company. Now we're looking for some great people to help
fuel our growth. We need a skilled Software Test Engineer to join our
Application Factory team.
We'll expect you to have a combination of solid in-depth knowledge of QA,
QA's goals, working with QA and non-QA groups, and extensive background in
solid test coverage. You'll be responsible for providing Quality Assurance
for the Yakabod KnowledgeWork application. This will include the creation of
test suites and test harness for front and backend testing, API testing,
automating UI test cases, defining test plans and test specifications,
designing tools for automated performance testing, execution of test cases,
and reporting product failures. You'll work with development teams to ensure
that a product is testable, that it is adequately unit tested, and that it
can be automated even further in the test harness. You'll review design
documents for adequate testing hooks, and implement mock objects and servers
to help developers with their unit testing and to allow for testing of
components individually. Following project milestones, you'll design,
implement, document, and/or execute tests; evaluate and communicate results;
develop API tests; and investigate product features (including ad hoc
testing). You'll also work closely with developers in defect resolution and
assist troubleshooting issues.
You can communicate clearly and effectively. You will also be responsible
for setting up the processes required to promote the overall quality of the
product. You have the ability to influence, lead, manage and help build QA
with excellence, in a fun and fast-paced dynamic team and corporate
environment.
Software Test Engineer
Minimum skills:
* 5-6 years of overall IT experience
* 3+ years software quality assurance testing
* 3+ years experience with automated test tools and load testing packages
(especially any PHP related testing tools i.e. PHPUnit)
* 2+ years creating and writing test plans and test scripts
* 2+ years web based testing
* Experience with XML and web services testing
* Experience with SQL and data retrieval from a relational database (i.e.,
MySql, Oracle)
* Strong UNIX background especially Linux
* Ability to work against extremely tight deadlines
* Experience in HTML, Java Script, DHTML
Preferred skills:
* Bachelors degree with emphasis on CS, CE and EE majors
* Familiarity with quality methodologies such as: CMM, ISO or IEEE.
* Familiarity with the Agile Development Framework
* Experience in PHP, PERL and shell scripting is a strong plus
* Strong understanding of all aspects of the QA role and all areas of
application testing
* Detailed understanding of the entire development cycle
* Experience with defect tracking systems and other software life cycle
management tools (Bugzilla)
* Knowledge of and ability to rapidly learn third party development/QA tools
* Capacity for attention to details
* Strong organizational and communication skills
Web Application Developers
We're still small, so you'll do a bit of everything –from integrating and
supporting critical customer applications to creating new components in our
core software products. Specifically, you can do many of the following with
excellence:
• Lead, manage, and/or architect knowledge-based dynamic web applications
• Develop software using PHP, MySQL, JavaScript, HTML, XML, AJAX and other
web application environments (experience with J2EE or MS environments will
be considered if you have demonstrated strong lifecycle development and
problem solving skills).
• Capture requirements, and then create use cases, specs, object-oriented
design, user interfaces, and data models
• Execute disciplined development practices over a full-lifecycle
• Deploy, support, and maintain customer applications, including
networks,Linux servers, development tools, and custom applications
We'll expect you to reliably "get things done" – you're a self-motivated,
entrepreneurial, problem solver who desires to be part of a team that builds
software that "works the way it ought to". You thrive as part of a team
that's undertaking a bold adventure together. Most important, you resonate
with our core values and culture. Experience in an early stage tech firm is
desirable, but not required. An active TS/SCI clearance with polygraph is
desirable, but not required. If you don't have one, you must be willing to
be submitted for clearance processing.
We're not looking for "bodies", just a few select impact players. We've set
pay and benefits accordingly, including participation in our generous stock
options plan and plenty of great coffee.
Interested?
Send your resume to [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi,
Assume, I have www.domain.com <http://www.domain.com/> in which I wrote the
functionality for user authentication and his profile related functionality.
Now, when user logs in using http://www.domain.com/users/login.php then
after his successful login a session as well as a cookie is getting created.
This will creates a cookie called myCookie123
Now I have my subdomain as http://sub.domain.com/index.php . here at the top
I am checking whether the user is logged in or not, for that I have to check
whether the cookie is created or not..
Here my problem is that, I am not getting the idea about, how to access or
read the cookie of http://www.domain.com <http://www.domain.com/> from
http://sub.domain.com/. can anyone please suggest me how to achieve this.
Thanks In advance.
Warm Regards,
Sanjeev
http://www.sanchanworld.com/
http://webdirectory.sanchanworld.com - Submit your website URL
http://webhosting.sanchanworld.com - Choose your best web hosting plan
--- End Message ---
--- Begin Message ---
Sanjeev N wrote:
Assume, I have www.domain.com <http://www.domain.com/> in which I wrote the
functionality for user authentication and his profile related functionality.
Now, when user logs in using http://www.domain.com/users/login.php then
after his successful login a session as well as a cookie is getting created.
This will creates a cookie called myCookie123
Now I have my subdomain as http://sub.domain.com/index.php . here at the top
I am checking whether the user is logged in or not, for that I have to check
whether the cookie is created or not..
Here my problem is that, I am not getting the idea about, how to access or
read the cookie of http://www.domain.com <http://www.domain.com/> from
http://sub.domain.com/. can anyone please suggest me how to achieve this.
Set the $domain parameter of setcookie to '.domain.com'.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
I did it. Still I am not able to access it.
Warm Regards,
Sanjeev
http://www.sanchanworld.com/
http://webdirectory.sanchanworld.com - Submit your website URL
http://webhosting.sanchanworld.com - Choose your best web hosting plan
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 19, 2007 12:41 AM
To: Sanjeev N
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] read the main domain cookie in sub domain
Sanjeev N wrote:
> Assume, I have www.domain.com <http://www.domain.com/> in which I wrote
the
> functionality for user authentication and his profile related
functionality.
>
> Now, when user logs in using http://www.domain.com/users/login.php then
> after his successful login a session as well as a cookie is getting
created.
>
> This will creates a cookie called myCookie123
>
> Now I have my subdomain as http://sub.domain.com/index.php . here at the
top
> I am checking whether the user is logged in or not, for that I have to
check
> whether the cookie is created or not..
>
> Here my problem is that, I am not getting the idea about, how to access or
> read the cookie of http://www.domain.com <http://www.domain.com/> from
> http://sub.domain.com/. can anyone please suggest me how to achieve this.
Set the $domain parameter of setcookie to '.domain.com'.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
Sanjeev N wrote:
I did it. Still I am not able to access it.
You'll probably need to delete the existing cookie from your browser and
get it set again.
-Stut
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 19, 2007 12:41 AM
To: Sanjeev N
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] read the main domain cookie in sub domain
Sanjeev N wrote:
Assume, I have www.domain.com <http://www.domain.com/> in which I wrote
the
functionality for user authentication and his profile related
functionality.
Now, when user logs in using http://www.domain.com/users/login.php then
after his successful login a session as well as a cookie is getting
created.
This will creates a cookie called myCookie123
Now I have my subdomain as http://sub.domain.com/index.php . here at the
top
I am checking whether the user is logged in or not, for that I have to
check
whether the cookie is created or not..
Here my problem is that, I am not getting the idea about, how to access or
read the cookie of http://www.domain.com <http://www.domain.com/> from
http://sub.domain.com/. can anyone please suggest me how to achieve this.
Set the $domain parameter of setcookie to '.domain.com'.
-Stut
--- End Message ---
--- Begin Message ---
Hey Stut, Thanks..
Now its working fine. Now I am able to access the value. Actually problem
was in main domain the cookies path was wrong. It was showing /user/ . I set
it to /
Thanks Stut.
Warm Regards,
Sanjeev
http://www.sanchanworld.com/
http://webdirectory.sanchanworld.com - Submit your website URL
http://webhosting.sanchanworld.com - Choose your best web hosting plan
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 19, 2007 12:46 AM
To: Sanjeev N
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] read the main domain cookie in sub domain
Sanjeev N wrote:
> I did it. Still I am not able to access it.
You'll probably need to delete the existing cookie from your browser and
get it set again.
-Stut
> -----Original Message-----
> From: Stut [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 19, 2007 12:41 AM
> To: Sanjeev N
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] read the main domain cookie in sub domain
>
> Sanjeev N wrote:
>> Assume, I have www.domain.com <http://www.domain.com/> in which I wrote
> the
>> functionality for user authentication and his profile related
> functionality.
>> Now, when user logs in using http://www.domain.com/users/login.php then
>> after his successful login a session as well as a cookie is getting
> created.
>> This will creates a cookie called myCookie123
>>
>> Now I have my subdomain as http://sub.domain.com/index.php . here at the
> top
>> I am checking whether the user is logged in or not, for that I have to
> check
>> whether the cookie is created or not..
>>
>> Here my problem is that, I am not getting the idea about, how to access
or
>> read the cookie of http://www.domain.com <http://www.domain.com/> from
>> http://sub.domain.com/. can anyone please suggest me how to achieve this.
>
> Set the $domain parameter of setcookie to '.domain.com'.
>
> -Stut
>
--- End Message ---
--- Begin Message ---
I have extracted a small portion of a calendar application I developed
recently to show some strange behavior with the date() function. When I
run this I get duplicate dates occasionally down the list. I'm seeing
11/4 twice for example. Sometimes dates are missing from the list. The
results change from day to day.
#!/usr/bin/env php
<?php
error_reporting( E_ALL );
define( 'SECONDS_IN_A_DAY', 60 * 60 * 24 );
define( 'LAST_SUNDAY', strtotime( 'last Sunday' ) );
echo 'SECONDS_IN_A_DAY = ' . SECONDS_IN_A_DAY . "\n";
echo 'LAST_SUNDAY = ' . LAST_SUNDAY . "\n";
for( $x = 0; $x < 365; $x++ )
{
$seconds = LAST_SUNDAY + ( SECONDS_IN_A_DAY * $x );
$date = date( 'n/j', $seconds );
echo "$seconds $date\n";
}
I get the same results with latest PHP4 and PHP5.
--
Greg Donald
Cyberfusion Consulting
http://cyberfusionconsulting.com/
--- End Message ---
--- Begin Message ---
> I'm seeing
> 11/4 twice for example. Sometimes dates are missing from the list. The
> results change from day to day.
>
That would be DST. The number of seconds per day changes on Nov. 4,
2007 in the US local time zones.
--- End Message ---
--- Begin Message ---
On Tue, 2007-09-18 at 15:32 -0500, Greg Donald wrote:
> I have extracted a small portion of a calendar application I developed
> recently to show some strange behavior with the date() function. When I
> run this I get duplicate dates occasionally down the list. I'm seeing
> 11/4 twice for example. Sometimes dates are missing from the list. The
> results change from day to day.
>
> #!/usr/bin/env php
> <?php
>
> error_reporting( E_ALL );
>
> define( 'SECONDS_IN_A_DAY', 60 * 60 * 24 );
> define( 'LAST_SUNDAY', strtotime( 'last Sunday' ) );
>
> echo 'SECONDS_IN_A_DAY = ' . SECONDS_IN_A_DAY . "\n";
> echo 'LAST_SUNDAY = ' . LAST_SUNDAY . "\n";
>
> for( $x = 0; $x < 365; $x++ )
> {
> $seconds = LAST_SUNDAY + ( SECONDS_IN_A_DAY * $x );
> $date = date( 'n/j', $seconds );
> echo "$seconds $date\n";
> }
> ?>
>
> I get the same results with latest PHP4 and PHP5.
Using seconds is a hack that doesn't account for DST. Use the following
instead:
<?php
error_reporting( E_ALL );
define( 'LAST_SUNDAY', strtotime( 'last Sunday' ) );
echo 'LAST_SUNDAY = ' . LAST_SUNDAY . "\n";
for( $x = 0; $x < 365; $x++ )
{
$timestamp = strtotime( "+$x days", LAST_SUNDAY );
$date = date( 'n/j', $timestamp );
echo "$timestamp $date\n";
}
?>
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................
--- End Message ---
--- Begin Message ---
On 9/17/07, Rodolfo De Nadai <[EMAIL PROTECTED]> wrote:
> Hi all...
>
> I'm facing a serious problem with my application. I have a script write
> in PHP that starts in Internet Explorer, this script keep on running
> until a varible value change on my MySQL database.
> The problem is that when i restart Apache, the process child initalized
> isn't kill... then the apache can't be start because the script is use
> the port 80.
Hi Rodolfo-
I think you are going about this the wrong way. You shoud not have the
PHP script itself execute the forever running task, it should just
trigger the separate starting/stopping of the task. There are several
ways to do this, the first two that spring to mind are:
1. Create a custom init-script in /etc/init.d (or wherever your
distribution has init scripts) that the PHP process triggers with a
start command (/etc/init.d/myprog start). This will require root
privileges for the PHP process (or no-password sudo privileges for
that command).
--or--
2. Have a cron job running as a user that has appropriate permissions.
This cron job should look for the presence of specific files - if it
sees them, it takes the appropriate action, and then deletes the
trigger file. For example, have the cron job watch for the presence of
/tmp/startMyProg.marker - when it sees it, it starts the program and
deletes /tmp/startMyProg.marker. Also have it watch for the presence
of /tmp/stopMyProg.marker, when it sees that, it would stop the
running program, and delete the marker file. At this point, all your
PHP script has to do is create the appropriate file in /tmp (could be
as simple as a exec("touch /tmp/startMyProg.marker") call).
Hope that sends you a workable direction-
James
--- End Message ---
--- Begin Message ---
Apologies if you already received this message, I tried to send it
earlier from my webmail but it doesn't seem to have worked.
Al wrote:
Just use stripslashes() on your submitted data and forget about
testing for magic_quotes. It's good practice anyhow. \" is not legit
text regardless.
Using stripslashes() on all submitted data is most certainly *not* good
practice. If magic_quotes_gpc is later turned off or you're using one of
the versions of PHP with buggy magic_quotes_gpc support then you can
easily lose data. Reversing the effects of magic_quotes_gpc is far from
trivial, there's lots of potential for subtle bugs, let alone completely
forgetting about $_COOKIE.
See my earlier reply for a real solution.
Arpad
--- End Message ---
--- Begin Message ---
Hello,
I have installed the latest PHP on my windows server 2003 IIS6 machine. From
the DOS command line interface (when in the C:\PHP directory) if I type PHP
phpinfo.php, the file runs. However I cannot get it to work on the browser
on the server our out on the web using my URL. I'm sure it's just an II6
issue, but what am I doing wrong?
Thanks!
--- End Message ---
--- Begin Message ---
I have a little trouble while trying to connect to gmail server.
I already enabled POP on gmail.
After experience a lots of errors with the command below, now I'm
seeing no more errors, but it still doesn't working, the page stay
processing and just is broke after this command.
$mbox = imap_open('{pop.gmail.com:995/pop3}INBOX',
'[EMAIL PROTECTED]', 'my_pass');
What should I do?
Tks in advance.
--- End Message ---