|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Mon Jun 03 2002 - 08:27:18 CDT
php-general Digest 3 Jun 2002 13:27:18 -0000 Issue 1383
Topics (messages 100356 through 100392):
Newbie Question - InstallShield PHP Installation with PWS
100356 by: Jesse Segovia
Re: 'Pure' php vs 'mixed' (html + php)
100357 by: Bogdan Stancescu
100358 by: Michael Davey
100359 by: Bogdan Stancescu
100363 by: Bogdan Stancescu
100381 by: Jason Teagle
Re: Setting PHP Include Dir
100360 by: Bogdan Stancescu
Re: simple email validation ereg
100361 by: Manuel Lemos
100365 by: Jason Wong
session security
100362 by: Giancarlo Pinerolo
Re: Include question
100364 by: Analysis & Solutions
Re: Determine overhead of PHP script.
100366 by: Analysis & Solutions
100367 by: Rasmus Lerdorf
Code dilema --> '".NULL."' or '.NULL.' or ...
100368 by: Ricardo Fitzgerald
100369 by: Jason Wong
preg_match_all href|src function
100370 by: Michael Elms
Re: still running the old version after recompiling??
100371 by: savaidis
100375 by: Jason Wong
100378 by: savaidis
process php script at regular intervals
100372 by: daniel cozzolino
100373 by: Justin French
100374 by: Michael Hall
Re: No such file or directory
100376 by: Edgard Berendsen
100383 by: Marek Kilimajer
100385 by: mike
echoing two varibles(newbie)
100377 by: webmaster.tececo.com
100379 by: Jason Teagle
Re: newbie help please
100380 by: Jason Teagle
php_mssql.dll extension problem
100382 by: Todor Stoyanov
Error handling
100384 by: Alia Mikati
remembering variables between many forms.
100386 by: Denis L. Menezes
100387 by: Jason Wong
Writing IPTC tags
100388 by: Dirk Bonenkamp - Bean IT
problem with compiling php-4.2.1 on solaris 2.7
100389 by: Moussa Dahadha
PHP & Hex Numbers
100390 by: Jonathan Rosenberg
100392 by: Jason Teagle
Re: Nothing will execute after calling imagejpeg.
100391 by: Leotta, Natalie (NCI/IMS)
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Here's a newbie question. I installed the Windows CGI InstallShield
version of PHP to use with the MS Personal Web Server I already have
working perfectly on my system.
On restarting my PC and trying a very simple php script, I get the error
at the bottom of this email. Unfortunately there isn't much help for
the InstallShield version of PHP on the web site. I'd rather get this
version working rather than install the manual version.
Can anyone help?
Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is set, e.g. via an Apache Action directive.
For more information as to why this behaviour exists, see the manual
page for CGI security.
For more information about changing this behaviour or re-enabling this
webserver, consult the installation file that came with this
distribution, or visit the manual page.
attached mail follows:
I fell for this some time ago - but the trick is that
1. You don't do for ($i=0; $i<99999999999; $i++) { echo "Line $i<br>\n";
} in real life - you do stuff, call object methods, run queries,
whatever, and in between those you have both html and php - and the
remote machine waits for you to do all the "extra" stuff and _then_
waits for you to switch in and out of php for several times. I'm
thinking about switching in and out of php in a "really-mixed" context -
such as having blocks of html inside if() and while() blocks, stuff like
that where you get to parse quite a number of php tags.
2. Your server doesn't only serve one client at a time - I'm surprised
that you're starting with commercial sites and this piece of information
isn't *always* present in your mind.
However, as I said in my original mail, "there's an urban legend saying
that [...] I don't know if that's true". So... I don't know if it
actually slows things down or not.
Bogdan
Marcelo Leitner wrote:
>On Mon, Jun 03, 2002 at 03:16:10AM +0300, Bogdan Stancescu wrote:
>
>
>>2. Speed
>>There's an urban legend saying that switching php tags on and off would
>>slow parsing down. I don't know if that's true and try to write "pure"
>>php as you call it due to the first reason.
>>
>>
>
>I don't mind about this.. I'm starting with comercial pages now and before that
>I noted that any script you run at the server, you will only see this latency
>if the output is buffered or you have a ultra-fast machine with a
>super-powerfull navigator that can renderize the page before it's fully sent to
>the browser..
>Try doing something like for ($i=0; $i<99999999999; $i++) { echo "Line $i<br>\n"; }
>Run the script in one machine and the browser at another.. you'll see that the
>client machine has the cpu burned much more then the server..
>You can see this when you're trying to open that big-flat-forums
>all-in-one-page.. you'll get sometime 1. to receive that, 2. to renderize..
>Note that you can only see the renderizing time if you're on a fast connection..
>
>What I do take care is about excessive database searchs.. that can slow down
>the things since I'll probably will not have a reserved server..
>
>
>
>>Bogdan
>>
>>
>---end quoted text---
>
>[]'s
>
>
attached mail follows:
> Point well-made. I suppose doing it the mixed way might have repercussions
> later on if/when the site grows. Perhaps while the code is still fresh in
my
> mid, it might be worth the effort to separate it.
>
> However, for a good part of the site, I've used CSS for appearance
details,
> and controlling a lot of stuff that changes from page-to-page. It's very
easy
> to change all or some of the pages from the CSS scripts. But, for the most
> part, not much of the actual php scripts COULD change, so that's why I've
> never bothered to separate html from php. Perhaps I wrong, but . . .
I think it is a case of horses for courses - you are working on what sounds
like a fairly small project, and "templatizing" your code may be more
trouble than it is worth, so whatever feels best for you...
attached mail follows:
This whole discussion made me really curious - so you might want to
check the attachments (access mixtest.php) for a very surprising result
(please note mixed.php and pure.php are exactly the same size so this
doesn't affect the test).
Bogdan
Marcelo Leitner wrote:
>On Mon, Jun 03, 2002 at 04:42:46AM +0300, Bogdan Stancescu wrote:
>
>
>>I fell for this some time ago - but the trick is that
>>1. You don't do for ($i=0; $i<99999999999; $i++) { echo "Line $i<br>\n";
>>} in real life - you do stuff, call object methods, run queries,
>>whatever, and in between those you have both html and php - and the
>>remote machine waits for you to do all the "extra" stuff and _then_
>>waits for you to switch in and out of php for several times. I'm
>>thinking about switching in and out of php in a "really-mixed" context -
>>such as having blocks of html inside if() and while() blocks, stuff like
>>that where you get to parse quite a number of php tags.
>>2. Your server doesn't only serve one client at a time - I'm surprised
>>that you're starting with commercial sites and this piece of information
>>isn't *always* present in your mind.
>>
>>However, as I said in my original mail, "there's an urban legend saying
>>that [...] I don't know if that's true". So... I don't know if it
>>actually slows things down or not.
>>
>>Bogdan
>>
>>
>---end quoted text---
>
>I gave that example to be a create a huge final page with the less time
>as possible..
>You never do that loop, but what about logfiles analysing? You have tons of
>lines, probably splited by day, of all the accesses and whatever were done..
>I did a some time ago a database of the itens from a MUD game.. I allowed
>users to list the whole database, so they could read that and search for new
>items for them.. but each item had 6 lines displayed, without tables or
>anything, neither <li></li>.. only <br> and <p>..
>when it got about 400 items, my PIII-733 321MB ram got under it's knees to
>render that page.. it didn't have any fig or whatever that would need more
>time to render..
>I now that I'll not have a dedicated http server, but loosing microseconds
>at each page on a server that has one thousand accesses per day is nothing..
>And even if you're going to have that traffic you'll have better servers
>that will deal with that and will probably run more processes at a time, so
>a script that is coded "slowly" wouldn't break the other..
>What I don't do is
>...
>if ($a == $x) { ?>
> <tr><td align=center><?echo $a?></td></tr>
><? } else { ?>
> <tr><td align=right><?echo $a?></td></tr>
><? }
>...
>
>That's really ugly! :)
>
>[]'s
>
>
<?
if ($foo=="bar") { ?>
<td>Bla-bla - testing</td>
<?
$bar=$foo;
?>
<td><?=$bar ?></td><?
}
?>
<?php
if ($foo=="bar") {
echo("<td>Bla-bla - testing</td>\n");
$bar=$foo;
echo("<td>$bar</td>\n");
}
?>
<?php
ini_set('max_execution_time', 600);
function gettime() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$t1=gettime();
for ($i=0;$i!=10000;$i++) {
include("mixed.php");
}
$t2=gettime();
for ($i=0;$i!=10000;$i++) {
include("pure.php");
}
$t3=gettime();
echo(($t2-$t1)."s for mixed code;<br>\n");
echo(($t3-$t2)."s for pure code.<br>\n");
echo(round((($t3-$t2)/($t2-$t1)-1)*100,2)."% more time used for <b>PURE</b> code.<br>\n");
?>
attached mail follows:
I was getting a typical 2.5% more for pure PHP with the original order -
switching them increases the difference to about 6.5% more for pure PHP.
Make sure you run it several times before drawing any conclusions, BTW.
Strange...
Bogdan
Marcelo Leitner wrote:
>On Mon, Jun 03, 2002 at 05:18:50AM +0300, Bogdan Stancescu wrote:
>
>
>>This whole discussion made me really curious - so you might want to
>>check the attachments (access mixtest.php) for a very surprising result
>>(please note mixed.php and pure.php are exactly the same size so this
>>doesn't affect the test).
>>
>>Bogdan
>>
>>
>---end quoted text---
>
>But try inverting the order of the test, first test the pure, then the
>mixed.. they will get almost equal..
>
>[]'s
>
>
attached mail follows:
"Andre Dubuc" <aajdubuc
webhart.net> wrote in message
news:20020602235509.8CC84200088
localhost.localdomain...
> I've noticed that many people on the list code in 'pure' php, i.e.
>
> I would like to understand the reasons for writing code in this manner,
when
> all my code works fine, displays great: am I missing something important
> here? Btw, I use the 'php' ending for all file names.
>
> Your thoughts, opinions and suggestions would be greatly appreciated --
I'd
> like to do what is best.
I can think of one other reason you would use pure... possibly not very
valid, but still...
Imagine you have a page where, if a password passed from another page is
correct, you want to show some data on the Web page, but if the password is
incorrect you want to show a warning and under no circumstances let them see
the data. If you used mixed, they could simply read the source of the page
to see that data... but with pure, the only source on the page is what PHP
actually prints out, so they won't see anything they shouldn't.
-- -------------------------------------------- _ _ o o Jason Teagle < jasonteagster.co.uk v --------------------------------------------
attached mail follows:
That REALLY is a tricky one because it's documented the way you wrote it in most places, except where you (and I) should've looked: http://www.php.net/manual/en/configuration.php
The trick is that you must remove the equal sign.
Bogdan
Tim Thorburn wrote:
> Hi, > > I'm trying to set a PHP include directory for one of my sites. I'm on > a shared hosting system, so I don't have access to the php.ini file. > > My plan was to do it using a .htaccess file in Apache - however I must > be doing something very much wrong, as it isn't working. > > Here is what I've tried: > > php_value include_dir = ".:/data/sites/site_name/htdocs/includes" > > I've checked the above path by running phpinfo(); on my site to > determine where its located on my servers hard drive. > > When I add the above line to my .htaccess file - I get a 500 Internal > Server Error. > > My site is using Apache 1.3.12 and PHP 3.0.18, any thoughts on how I > might get this to work? > > Thanks > -Tim > > >
attached mail follows:
Hello,
On 06/02/2002 01:13 AM, Justin French wrote: > Hi, > > I know that there are more complex functions and classes out there for > validating email address', but some of them do return "invalid" on > *technically* valid, although uncommon email address', so all I want is a > simple test for:
Instead of reinventing the wheel, you may want to try this PHP Classes that provides different levels of e-mail address validation.
http://www.phpclasses.org/emailvalidation
--Regards, Manuel Lemos
attached mail follows:
On Monday 03 June 2002 04:42, Alexander Skwar wrote: > Justin French wrote: > >my aim will be to strip out anything that doesn't at least LOOK like like > > an email address. > > Well, instead of coming up with some "clever" regexp, I'd suggest to > completely dump syntax checks. Instead, I only check if the host has a > MX entry associated. If not, then this host either does not exist, or > mails wouldn't get through. At any rate, it's not a valid adress.
The lack of an MX record doesn't necessarily mean mail will not get through, so you cannot use that as a test for whether the address is valid.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Who needs friends when you can sit alone in your room and drink? */
attached mail follows:
Why can a user force php to create a session he's giving the name in the URL? Do you want me to list an half a dozen ways to get rich now with this holes? Does anyone understand the malice of this? Anyone can offer you a click on a session he's going to visit later and hijack from you? Anyone can post data in a black hole of his own and pass it around secretly? Anyone can place precise strings in a precise file location on a server? How is it that a user can force to have any session string, passed in the URL, being created, even when cookies are fully funcional and enabled? Is it possible that there is no policy on creating a new session? There so much fuzz about register_globals, and we let the user create the sessions they want? Shouldn't we check that's us who issued the ticket?
How is it that I cannot find a decent reply to these questions?
Giancarlo
attached mail follows:
Hey John:
On Sun, Jun 02, 2002 at 12:10:27AM -0400, John Holmes wrote: > > What I'm looking at is if each include .html file is 50K, am I loading > 100K into memory and then running the script, or running the script and > only loading the appropriate 50K into memory when it's needed?
As of 4.0.2, stuff is only loaded when it's needed. So, in your example, only 50k is brought in.
Note, this is yet another case where it pays for me to read the manual before posting! I was still thinking in the old way, where include() was conditional and require() was always done.
Ciao!
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
JH:
On Sat, Jun 01, 2002 at 10:29:38PM -0400, John Holmes wrote: > Is there a way to determine the overhead or memory usage of a PHP script > as it runs?
You could do some sort of exec() or system() type call. For example, on a NetBSD (and similar unix type machines) you can do "ps -o rss,command"
Enjoy,
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
PHP has a built-in mechanism for logging high-watermark memory usage by scripts. Make sure you compile PHP using --enable-memory-limit then you can modify your Apache LogFormat and stick %{mod_php_memory_usage}n in there somewhere which will be replaced with the peak memory usage for that script in bytes.
-Rasmus
On Mon, 3 Jun 2002, Analysis & Solutions wrote:
> JH: > > On Sat, Jun 01, 2002 at 10:29:38PM -0400, John Holmes wrote: > > Is there a way to determine the overhead or memory usage of a PHP script > > as it runs? > > You could do some sort of exec() or system() type call. For example, on > a NetBSD (and similar unix type machines) you can do "ps -o rss,command" > > Enjoy, > > --Dan > > -- > PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hi,
I'm having troubles trying to insert form data into a mysql db, the thing is my client wants table data to be splitted, I mean some data comes from the first form, and the rest from another form. Then this is a portion of the php script.
// Add together proper fields to enter birth date $fecha_nac = $ano_nac + "-" + $mes_nac + "-" + $dia_nac;
// Open mysql db mysql_select_db("intertur");
// SQL query insert all data into a table $query = "insert into RegistroPersonas values ('".NULL."','".$nombre."', '".$apellido."', '".NULL."', '".$direccion."', '".$ciudad."', '".NULL."', '".NULL."', '".$pais."', '".$telefono."', '".$fax."', '".$email."', '".$login_usuario."', '".$clave."', '".$fecha_nac."', '".NULL."', '".NULL."' '".$sexo."', '".NULL."', '".NULL."', '".NULL."', '".NULL."' )"; ----> My problem is NOTHING gets inserted !!! ----> I filled all empty fields with NULL values ----> It connects to the db but does nothing else // Do query $result = mysql_query($query);
// this script has a form at the end, where the remaining fields are // filled // and calls the next script, where the tables are altered // there and the empty fields filled with the values retrieved
I suppose to use Update in the next script , to enter remaining data, but I'm not sure because the first field auto increments, and is the primary key.
TIA
Rick AXIS Computers
attached mail follows:
On Thursday 01 January 1970 08:00, Ricardo Fitzgerald wrote:
Your clock is broken!
> I'm having troubles trying to insert form data into a mysql db, the > thing is my client wants table data to be splitted, I mean some data > comes from the first form, and the rest from another form. > Then this is a portion of the php script. > > // Add together proper fields to enter birth date > $fecha_nac = $ano_nac + "-" + $mes_nac + "-" + $dia_nac; > > // Open mysql db > mysql_select_db("intertur"); > > // SQL query insert all data into a table > $query = "insert into RegistroPersonas values > ('".NULL."','".$nombre."', '".$apellido."', '".NULL."', > '".$direccion."', '".$ciudad."', '".NULL."', '".NULL."', '".$pais."', > '".$telefono."', '".$fax."', '".$email."', '".$login_usuario."', > '".$clave."', > '".$fecha_nac."', '".NULL."', '".NULL."' '".$sexo."', '".NULL."', > '".NULL."', '".NULL."', '".NULL."' )"; > ----> My problem is NOTHING gets inserted !!! > ----> I filled all empty fields with NULL values > ----> It connects to the db but does nothing else
MySQL has it's own NULL, you should probably be using that rather than PHP's.
> // Do query > $result = mysql_query($query);
Do some error checking -- how would you know what's going on if you don't check!?!
1) echo $query; // to check that it looks OK 2) $result = mysql_query($query) or die(mysql_error()); // to display any errors
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Bennett's Laws of Horticulture: (1) Houses are for people to live in. (2) Gardens are for plants to live in. (3) There is no such thing as a houseplant. */
attached mail follows:
Hi All,
I have being working on PHP perl compaitable regular expressions for the last month and cannot work out how to program a preg_match_all that will get the "file.html" from the following examples:
<a href="file.html"> <a href='file.html'> <a href=file.html> <frame src="file.html"> <frame src='file.html'> <frame src=file.html>
The preg_match_all I have below only works for <a href="file.html"> but not for the other variations...
preg_match_all("|href=\"?([^\"' >]+)|i", $data, $links);
I tried the preg_match_all below, but that didn't work...
preg_match_all("|(href|src)=([^\"']+)?([^\"' >]+)|i", $data, $links);
Any help would be greatly appreciated.
Regards,
Michael.
attached mail follows:
I forgot to write I run on a win98, so no shell :) So what?
Makis
> -----Original Message-----
> From: Evan Nemerson [mailto:evan
coeus-group.com]
> Sent: Monday, June 03, 2002 1:52 AM
> To: savaidis; php-general
lists.php.net
> Subject: Re: [PHP] still running the old version after recompiling??
>
>
> Do "echo $PATH" from a shell. This will output a list of several folders,
> seperated by a semi-colon. Check each of these folders for a file named
> "Php". Rename to "php". That should do the trick.
>
>
>
> On Sunday 02 June 2002 11:01 am, savaidis wrote:
> > I have one similar problem.
> >
> > I had a directory "Php" under my "root" directory that was the root for
> > Apache.
> > Then I rename "Php" to "php" but after restart, reset ecc - some months
> > now- still recognize only "Php" and NOT "php".
> >
> > What's wrong?
> >
> > Makis
> >
> > > -----Original Message-----
> > > From: Andy [mailto:news.letters
gmx.de]
> > > Sent: Sunday, June 02, 2002 4:51 PM
> > > To: php-general
lists.php.net
> > > Subject: Re: [PHP] still running the old version after recompiling??
> > >
> > >
> > > Hello Jason,
> > >
> > > you have been right, I did a new one on a fresh php untared dir.
> > > And the new
> > > php install is recognized.
> > >
> > > But I am still fighting with the installation. I need
> freetype2 and I did
> > > configure it ok, compiled freetype, gd2 but still I am getting a:
> > > function: imagettfbbox() not found
> > >
> > > Php did not complain about not finding freetype. Maybe php
> compiled with
> > > freetype 1 but how come?
> > > This drives me cracy! I did install php on several machines at
> > > home running
> > > the same operating system like my provider is offering. It
> always worked
> > > fine.
> > >
> > > do u have a good advice?
> > >
> > > Thank you for your help,
> > >
> > > Andy
> > >
> > >
> > >
> > >
> > > "Jason Wong" <php-general
gremlins.com.hk> schrieb im Newsbeitrag
> > > news:200206021738.18306.php-general
gremlins.com.hk...
> > >
> > > > On Sunday 02 June 2002 17:32, Andy wrote:
> > > > > Hi there,
> > > > >
> > > > > I did recompile php with different flags. Phpinfo() tells
> me that I
> > > > > am still running the old insatllation! I did restart apache after
> > >
> > > compiling.
> > >
> > > > > So whats wrong. Did I forget something?
> > > > >
> > > > > I did
> > > > > configure with some flags
> > > > > make
> > > > > make install
> > > > >
> > > > > restart apache
> > > >
> > > > 1) To avoid any complications I always compile from a
> freshly unpacked
> > >
> > > tar.gz.
> > >
> > > > 2) Stop apache before doing "make install" (not sure whether it
> > >
> > > makes any
> > >
> > > > difference but it doesn't hurt to do so).
> > > >
> > > > --
> > > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > > > Open Source Software Systems Integrators
> > > > * Web Design & Hosting * Internet & Intranet Applications
> Development *
> > > >
> > > > /*
> > > > There are two ways of disliking poetry; one way is to
> dislike it, the
> > > > other is to read Pope.
> > > > -- Oscar Wilde
> > > > */
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> I am prepared to meet anyone, but whether anyone is prepared for
> the great
> ordeal of meeting me is another matter.
>
> Samuel Clemens
>
attached mail follows:
On Monday 03 June 2002 12:31, savaidis wrote: > I forgot to write I run on a win98, so no shell :) > So what?
The equivalent in Win98 is to open an MS-DOS prompt and type: path<ENTER>
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Whom the gods would destroy, they first teach BASIC. */
attached mail follows:
There is not in PATH the directory name ("Php" or "php") Neither something related to "Apache".
Makis
> -----Original Message-----
> From: Jason Wong [mailto:php-general
gremlins.com.hk]
> Sent: Monday, June 03, 2002 10:31 AM
> To: php-general
lists.php.net
> Subject: Re: [PHP] still running the old version after recompiling??
>
>
> On Monday 03 June 2002 12:31, savaidis wrote:
> > I forgot to write I run on a win98, so no shell :)
> > So what?
>
> The equivalent in Win98 is to open an MS-DOS prompt and type: path<ENTER>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Whom the gods would destroy, they first teach BASIC.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I want to have a php script processed on a daily (eg 9am) interval. is there some way to automate this from within the script or do i need to schedule this with an external app?
has anyone had any experience with this previously?
thanks Daniel
attached mail follows:
it needs to be scheduled.
- on *nix, a cron job will do it - on mac, a program like iDo Script Scheduler (combined with a simple applwscript) will do it - on windows, i believe there are tools to do this, but not sure what they are
alternatively, i set up a HTML page as my 'start' page on IE, which acts as a portal, running a few scripts... since i open my browser about 360 days a year, it's pretty reliable, and i've got a failsafe in there to make sure the scripts are only run once per day.
justin french
on 03/06/02 4:49 PM, daniel cozzolino (danielc
anglissconsulting.com) wrote:
> I want to have a php script processed on a daily (eg 9am) interval. is > there some way to automate this from within the script or do i need to > schedule this with an external app? > > has anyone had any experience with this previously? > > thanks > Daniel > >
attached mail follows:
One way of doing this is to set up a cronjob that has Lynx call the script.
There is a flag that is usually added as well ... I'm not sure right now but it could be '-dump':
lynx -dump http://your/script/url.php
This has been covered a few times in the archive if you want to check the details there.
This assumes that you are on a Linux/UNIX server, and that PHP is an Apache module, not a standalone CGI installation (where you could call the script directly without using Lynx).
Michael Hall
On Mon, 3 Jun 2002, daniel cozzolino wrote:
> I want to have a php script processed on a daily (eg 9am) interval. is > there some way to automate this from within the script or do i need to > schedule this with an external app? > > has anyone had any experience with this previously? > > thanks > Daniel > > > >
-- -------------------------------- n i n t i . c o m php-python-perl-mysql-postgresql -------------------------------- Michael Hall nintininti.com --------------------------------
attached mail follows:
I'm trying to do a cronjob. If I'm right I should have a php file with #!/usr/lib/php -q at the beginning and a cronjob like
MAILTO="edgard
vtr.net"
0 * * * * /usr/lib/php/ $HOME/myfile.php
whereis php tells me: php: /usr/lib/php /usr/include/php
What's wrong?
At the beginning when I tried with other paths like /usr/bin/php I received a mail with 'No such file or directory' error, now I don't receive anything! Even I change to the old /usr/bin/php wrong dir and I still receive nothing!!!
attached mail follows:
Cron doesn't have the same enviroment like normal shell, so it knows nothing about $HOME, you need to use full path.
Edgard Berendsen wrote:
>I'm trying to do a cronjob.
>If I'm right I should have a php file with
>#!/usr/lib/php -q
>at the beginning and a cronjob like
>
>MAILTO="edgard
vtr.net"
>0 * * * * /usr/lib/php/ $HOME/myfile.php
>
>whereis php tells me:
>php: /usr/lib/php /usr/include/php
>
>What's wrong?
>
>At the beginning when I tried with other paths like /usr/bin/php I received
>a mail
>with 'No such file or directory' error, now I don't receive anything!
>Even I change to the old /usr/bin/php wrong dir and I still receive
>nothing!!!
>
>
>
>
>
>
>
attached mail follows:
Actually, /usr/lib/php is a directory most likely. You need to make sure you compiled the binary at compile time, and then (on Linux) it would be installed to /usr/local/bin/php.
Thanks,
----- Original Message -----
From: "Marek Kilimajer" <kilimajer
webglobe.sk>
To: "PHP" <php-general
lists.php.net>
Sent: Monday, June 03, 2002 5:42 AM
Subject: Re: [PHP] cron: No such file or directory
> Cron doesn't have the same enviroment like normal shell, so it knows
> nothing about $HOME, you need to use full path.
>
> Edgard Berendsen wrote:
>
> >I'm trying to do a cronjob.
> >If I'm right I should have a php file with
> >#!/usr/lib/php -q
> >at the beginning and a cronjob like
> >
> >MAILTO="edgard
vtr.net"
> >0 * * * * /usr/lib/php/ $HOME/myfile.php
> >
> >whereis php tells me:
> >php: /usr/lib/php /usr/include/php
> >
> >What's wrong?
> >
> >At the beginning when I tried with other paths like /usr/bin/php I
received
> >a mail
> >with 'No such file or directory' error, now I don't receive anything!
> >Even I change to the old /usr/bin/php wrong dir and I still receive
> >nothing!!!
> >
> >
> >
> >
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
How can I echo(or include) two variables?
ie include $DOCUMENT_ROOT then $row['location']
Thanks in Advance
JJ Harrison
webmaster
tececo.com
www.tececo.com
attached mail follows:
<webmaster
tececo.com> wrote in message
news:001301c20ad8$5539f2f0$67b8fea9
JohnH...
>How can I echo(or include) two variables? > >ie include $DOCUMENT_ROOT then $row['location']
Simply refer to them within double quotes as if they were words:
echo "This is $DOCUMENT_ROOT at $row['location'].<BR>";
or bundle them together as a string:
echo "This is " . $DOCUMENT_ROOT . " at " . $row['location'] . ".<BR>";
You can shove as many variables as you like into the string like this...
-- -------------------------------------------- _ _ o o Jason Teagle < jasonteagster.co.uk v --------------------------------------------
attached mail follows:
"Christopher J. Crane" <ccrane
inxdesign.com> wrote in message
news:20020602235956.97409.qmail
pb1.pair.com...
> $Tags['issue-name']. So I could print it out. Something like, print > "$Tags['issue-name']<br>\n"; > > I was able to get a numerical representation of the array like, $Tags[5] and > the value of that tag was "RED HAT", but then I would have to know what the > position of the data I am looking for in the array. I would prefer to know > the tag name and the array and get to the data that way. I know there is a > way to do this, but I just can't figure it out. There is a lot of > information on Parsing the XML file but not getting into a useful array, or > at least that I have found easily to understand.
Try this:
foreach ($Tags as $key => $value) { ... }
In that loop you will get all entries of $Tags[] one at a time, and $key will be the name of the entry you seek (like 'issue-name'), and $value will be the value held at that entry.
-- -------------------------------------------- _ _ o o Jason Teagle < jasonteagster.co.uk v --------------------------------------------
attached mail follows:
Hi, I'm trying to load the php_mssql.dll extension and always get this error:
PHP Warning: Unable to load dynamic library 'C:\PHP\extensions\php_mssql.dll' - The specified procedure could not be found. in Unknown on line 0.
Any ideas??
Thanks Todor
attached mail follows:
Hi everybody, I hope u can help me with this. This file should give me an error msg that there is time-out coz of the loop. But it's not giving me anything. What could be the problem? Thx a lot
<?php $str = "(0,0)";
// redefine the user error constants - PHP 4 only define (FATAL,E_USER_ERROR); define (ERROR,E_USER_WARNING); define (WARNING,E_USER_NOTICE);
// set the error reporting level for this script error_reporting (FATAL | ERROR | WARNING);
// error handler function function myErrorHandler ($errno, $errstr, $errfile, $errline) { switch ($errno) { case FATAL: echo "<b>FATAL</b> [$errno] $errstr<br>\n"; echo " Fatal error in line ".$errline." of file ".$errfile; echo ", PHP ".PHP_VERSION." (".PHP_OS.")<br>\n"; echo "Aborting...<br>\n"; exit (1); break; case ERROR: echo "<b>ERROR</b> [$errno] $errstr<br>\n"; break; case WARNING: echo "<b>WARNING</b> [$errno] $errstr<br>\n"; break; default: echo "Unkown error type: [$errno] $errstr<br>\n"; break; } }
// function to test the error handling function scale_by_log ($vect, $scale) { if ( !is_numeric($scale) || $scale <= 0 ) trigger_error("log(x) for x <= 0 is undefined, you used: scale = $scale", FATAL); if (!is_array($vect)) { trigger_error("Incorrect input vector, array of values expected", ERROR); return null; } for ($i=0; $i<count($vect); $i++) { if (!is_numeric($vect[$i])) trigger_error("Value at position $i is not a number, using 0 (zero)", WARNING); $temp[$i] = log($scale) * $vect[$i]; } return $temp; }
// set to the user defined error handler $old_error_handler = set_error_handler("myErrorHandler");
for ($i=0;$i<1000000;$i++) for ($j=0;$j<1000000;$j++) $str .= "($i,$j)"; echo $str;
?>
attached mail follows:
Hello friends.
Pls excuse me if this is too simple a question.
I have a mysql database running with PHG scripts for member registration, find members etc which is running well. Now I want to make a system to send the username and passwords to members if they have lost them.
the way I am doing it is : when the user logs in on the 1st page with his email address, I take him to the second page where I ask the favourite question from the database for which he must answer, then I check that the answer is correct in a third page and send his email. My problem is that I do not know how to remember the variable between the 1st and the third page. I can manage between two pages but not between three pages.
Can someone help how I can remember the email address between the above three pages?
Thanks very much Denis
attached mail follows:
On Monday 03 June 2002 19:33, Denis L. Menezes wrote:
> Pls excuse me if this is too simple a question. > > I have a mysql database running with PHG scripts for member registration, > find members etc which is running well. Now I want to make a system to send > the username and passwords to members if they have lost them. > > the way I am doing it is : when the user logs in on the 1st page with his > email address, I take him to the second page where I ask the favourite > question from the database for which he must answer, then I check that the > answer is correct in a third page and send his email. My problem is that I > do not know how to remember the variable between the 1st and the third > page. I can manage between two pages but not between three pages.
You don't need to 'remember' the variable between the 1st page and the 3rd page.
> Can someone help how I can remember the email address between the above > three pages?
You pass the variable(s) from the 1st page to the 2nd page. Then again from the 2nd to the 3rd.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* All men know the utility of useful things; but they do not know the utility of futility. -- Chuang-tzu */
attached mail follows:
Hi all,
Just wanted to know if it's possible to write iptc tags with php, and, if so, how?
I can read them trough getimagesize().
TIA,
Dirk
Bean IT
T: +31 (0)23 - 5422299 F: +31 (0)23 - 5422728 W: http://www.bean-it.nl
attached mail follows:
Hi All ,
I am having some problems with compiling the latest version of the source code on a solaris box The initial configure runs fine but when I go for the make this is what happens.
make Making all in Zend make[1]: Entering directory `/root/php-4.2.1/Zend' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/root/php-4.2.1/Zend' Making all in main make[1]: Entering directory `/root/php-4.2.1/main' make[2]: Entering directory `/root/php-4.2.1/main' make[2]: Nothing to be done for `all-p'. make[2]: Leaving directory `/root/php-4.2.1/main' make[1]: Leaving directory `/root/php-4.2.1/main' Making all in ext make[1]: Entering directory `/root/php-4.2.1/ext' Making all in ctype make[2]: Entering directory `/root/php-4.2.1/ext/ctype' make[3]: Entering directory `/root/php-4.2.1/ext/ctype' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/ctype' make[2]: Leaving directory `/root/php-4.2.1/ext/ctype' Making all in mysql make[2]: Entering directory `/root/php-4.2.1/ext/mysql' Making all in libmysql make[3]: Entering directory `/root/php-4.2.1/ext/mysql/libmysql' make[4]: Entering directory `/root/php-4.2.1/ext/mysql/libmysql' make[4]: Nothing to be done for `all-p'. make[4]: Leaving directory `/root/php-4.2.1/ext/mysql/libmysql' make[3]: Leaving directory `/root/php-4.2.1/ext/mysql/libmysql' make[3]: Entering directory `/root/php-4.2.1/ext/mysql' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/mysql' make[2]: Leaving directory `/root/php-4.2.1/ext/mysql' Making all in pcre make[2]: Entering directory `/root/php-4.2.1/ext/pcre' Making all in pcrelib make[3]: Entering directory `/root/php-4.2.1/ext/pcre/pcrelib' make[4]: Entering directory `/root/php-4.2.1/ext/pcre/pcrelib' make[4]: Nothing to be done for `all-p'. make[4]: Leaving directory `/root/php-4.2.1/ext/pcre/pcrelib' make[3]: Leaving directory `/root/php-4.2.1/ext/pcre/pcrelib' make[3]: Entering directory `/root/php-4.2.1/ext/pcre' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/pcre' make[2]: Leaving directory `/root/php-4.2.1/ext/pcre' Making all in posix make[2]: Entering directory `/root/php-4.2.1/ext/posix' make[3]: Entering directory `/root/php-4.2.1/ext/posix' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/posix' make[2]: Leaving directory `/root/php-4.2.1/ext/posix' Making all in session make[2]: Entering directory `/root/php-4.2.1/ext/session' make[3]: Entering directory `/root/php-4.2.1/ext/session' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/session' make[2]: Leaving directory `/root/php-4.2.1/ext/session' Making all in standard make[2]: Entering directory `/root/php-4.2.1/ext/standard' make[3]: Entering directory `/root/php-4.2.1/ext/standard' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/standard' make[2]: Leaving directory `/root/php-4.2.1/ext/standard' Making all in xml make[2]: Entering directory `/root/php-4.2.1/ext/xml' Making all in expat make[3]: Entering directory `/root/php-4.2.1/ext/xml/expat' make[4]: Entering directory `/root/php-4.2.1/ext/xml/expat' make[4]: Nothing to be done for `all-p'. make[4]: Leaving directory `/root/php-4.2.1/ext/xml/expat' make[3]: Leaving directory `/root/php-4.2.1/ext/xml/expat' make[3]: Entering directory `/root/php-4.2.1/ext/xml' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/xml' make[2]: Leaving directory `/root/php-4.2.1/ext/xml' make[1]: Leaving directory `/root/php-4.2.1/ext' Making all in sapi make[1]: Entering directory `/root/php-4.2.1/sapi' Making all in apache make[2]: Entering directory `/root/php-4.2.1/sapi/apache' make[3]: Entering directory `/root/php-4.2.1/sapi/apache' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/sapi/apache' make[2]: Leaving directory `/root/php-4.2.1/sapi/apache' make[1]: Leaving directory `/root/php-4.2.1/sapi' Making all in TSRM make[1]: Entering directory `/root/php-4.2.1/TSRM' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/root/php-4.2.1/TSRM' Making all in regex make[1]: Entering directory `/root/php-4.2.1/regex' make[2]: Entering directory `/root/php-4.2.1/regex' make[2]: Nothing to be done for `all-p'. make[2]: Leaving directory `/root/php-4.2.1/regex' make[1]: Leaving directory `/root/php-4.2.1/regex' Making all in . make[1]: Entering directory `/root/php-4.2.1' /bin/sh /root/php-4.2.1/libtool --silent --mode=link gcc -I. -I/root/php-4.2.1/ -I/root/php-4.2.1/main -I/root/php-4.2.1 -I/www/include -I/root/php-4.2.1/Zend -I/root/php-4.2.1/ext/mysql/libmysql -I/root/php-4.2.1/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=270 -DUSE_EXPAT -I/root/php-4.2.1/TSRM -g -O2 -prefer-pic -o libphp4.la -rpath /root/php-4.2.1/libs -avoid-version -L/usr/ucblib -R /usr/ucblib stub.lo Zend/libZend.la sapi/apache/libsapi.la main/libmain.la regex/libregex.la /root/php-4.2.1/ext/ctype/libctype.la /root/php-4.2.1/ext/mysql/libmysql.la /root/php-4.2.1/ext/pcre/libpcre.la /root/php-4.2.1/ext/posix/libposix.la /root/php-4.2.1/ext/session/libsession.la /root/php-4.2.1/ext/standard/libstandard.la /root/php-4.2.1/ext/xml/libxml.la TSRM/libtsrm.la -lpam -lcrypt -lresolv -lresolv -lm -ldl -lsocket -lsocket -lcrypt -ldl /usr/local/sparc-sun-solaris2.7/bin/ld: /root/php-4.2.1/ext/mysql/.libs/libmysql.al(libmysql.lo): Relocations in generic ELF (EM: 3) /root/php-4.2.1/ext/mysql/.libs/libmysql.al(libmysql.lo): could not read symbols: File in wrong format make[1]: *** [libphp4.la] Error 1 make[1]: Leaving directory `/root/php-4.2.1' make: *** [all-recursive] Error 1
Regards
attached mail follows:
I would think that if $a were a number that
echo $a;
and
printf('%d', $a);
would produce the same output. Is this correct?
Either I'm missing something, or PHP gets very confused when dealing with some numbers. For example, the following program
<? $result = 0x9E3779B9; echo $result printf('%d', $result); ?>
produces
2654435769 -1640531527
I get the same kind of unexpected results when doing arithmetic on such numbers.
Is this tickling some kind of known bug in PHP? or am I misunderstanding something?
-- JR
attached mail follows:
"Jonathan Rosenberg" <jr40
earthlink.net> wrote in message
news:NDBBLKBKIKFIPIFMDDNHAEHGFPAA.jr40
earthlink.net...
> would produce the same output. Is this correct?
Theoretically...
> > Either I'm missing something, or PHP gets very confused when > dealing with some numbers. For example, the following program > > <? > $result = 0x9E3779B9; > echo $result > printf('%d', $result); > ?> > > produces > > 2654435769 > -1640531527 > > I get the same kind of unexpected results when doing arithmetic > on such numbers. > > Is this tickling some kind of known bug in PHP? or am I > misunderstanding something?
It's not a bug, just an 'inconsistency'. Both are correct... if you have a calculator that supports hex, type both those results in and convert to hex. Both should say 9E3779B9. The first result treats 9E3779B9 as an unsigned 32-bit value, the second result treats it as a _signed_ 32-bit value. If you use
printf('%u', $result);
(assuming PHP supports the full range of C printf() format specifiers), it should print out 2654435769 as does the straight echo.
It seems echo treats numbers as unsigned...
When doing arithmetic in code, you should always be prepared to handle signed and unsigned.
-- -------------------------------------------- _ _ o o Jason Teagle < jasonteagster.co.uk v --------------------------------------------
attached mail follows:
You can't use echo or print in your image - you have to use ImageTTFText or ImageString or any other Image function. If you go to PHP.net and search the Image functions you should be able to find some helpful things that you can use. You also have to initialize your colors with ImageColorAllocate.
I have a meeting until about 1:00, but if you're still having problems let me know and I can email you some example code this afternoon.
-Natalie
-----Original Message-----
From: Kris Johnson [mailto:krisj
legal-stock.com]
Sent: Saturday, June 01, 2002 11:11 PM
To: Leotta, Natalie (NCI/IMS)
Subject: Nothing will execute after calling imagejpeg.
Hello, My name is Kris Johnson. I 'm hoping you can give me some direction on a problem I am having.
After calling imagejpeg nothing else will work. I have tried echoing html, echoing just a word in quotes, as well as a using a location header. I do not get any errors or warnings, but whatever command I use simply doesn't work. As a test I remarked imagejpeg out of the code and as soon as I did this the commands after worked fine. I tried changing the filetype to png but still get the same problem.
Have a nice day Kris
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]