|
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: Fri Aug 31 2001 - 04:33:26 CDT
php-general Digest 31 Aug 2001 09:33:26 -0000 Issue 848
Topics (messages 65368 through 65431):
Re: Header() function and redirect
65368 by: Don Read
Re: line by line
65369 by: Navid Yar
65383 by: Hugh Danaher
65402 by: Navid Yar
Re: Decent Web Calendar With Moderated Public Postings
65370 by: Mike Gifford
65371 by: Mike Gifford
65392 by: Dave Freeman
Re: determining the pixel width of a string
65372 by: Don Read
65428 by: _lallous
File read Parser error
65373 by: Gary
65374 by: Don Read
65377 by: Gary
65379 by: Franklin van Velthuizen
65381 by: John Meyer
Delete files older than X seconds.
65375 by: Julio Nobrega Trabalhando
65420 by: * R&zE:
Re: Quick TXT document stuff
65376 by: Steve Edberg
Documentation for snapshot releases?
65378 by: Philip Hallstrom
Is there anything in here that could be considered a parse error?
65380 by: John Meyer
65423 by: * R&zE:
Re: Database Preference? -- Manuel, Michael, Miles
65382 by: James Potts
65385 by: Manuel Lemos
65390 by: James Potts
Re: mail() not supported
65384 by: Yasuo Ohgaki
Re: The future of PHP
65386 by: Manuel Lemos
65391 by: Cristopher Daniluk
65394 by: Zeev Suraski
Re: Winning Confirmation ..
65387 by: Cathy4342.hotmail.com
Re: A Separate Process?
65388 by: James Potts
use php Convert between(foxpro) `.dbf' files and MySQL
65389 by: yang
65418 by: _lallous
Re: imagecreatefromgif
65393 by: David Robley
65396 by: Chris
header() + link..
65395 by: Ashwin Kutty
65419 by: * R&zE:
<-- to check airfares
65397 by: Kevin Keeler
About PHP & Oracle
65398 by: Duy B
65403 by: Joel Ricker
PHP_SELF or REQUEST_URI within Function ?
65399 by: Arcadius A.
65400 by: Jack Dempsey
65401 by: Jason Murray
sql query with join and same column twice...
65404 by: Web Manager
65405 by: ERISEN, Mehmet Kamil
Serious Fopen Problems - not newbie :)
65406 by: Paul Procacci
65407 by: Rasmus Lerdorf
65410 by: speedboy
65411 by: Paul Procacci
65412 by: Paul Procacci
65417 by: speedboy
access to the apache environment from the c-client built into PHP 4.0.x
65408 by: Liam Hoekenga
65409 by: Rasmus Lerdorf
Print out the form When click Submit?
65413 by: Jack
65415 by: Raphael Pirker
Refreshing php.ini without restart...
65414 by: Raphael Pirker
65416 by: B. van Ouwerkerk
65425 by: Gerard Samuel
help with strings...
65421 by: Stig-Řrjan Smelror
Problem with microtime()
65422 by: Rosen
65424 by: Lawrence.Sheed.dfait-maeci.gc.ca
65426 by: Andrey Hristov
65427 by: _lallous
help !
65429 by: Nikola Veber
Re: begginer needs help
65430 by: Ralph Guzman
Can PHP and Java work together?
65431 by: Jack
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:
On 30-Aug-2001 Zhu George-CZZ010 wrote:
> But I have to wait for the application to finish. The idea is: the
> application will take the file, and convert it into PDF file (it takes more
> than 30 seconds generally), then display the generated PDF file.
>
> I am just wondering if I can use "Header()" to redirect to a general php
> page, then in that page, redirect to the PDF file.
>
30 seconds might be timing-out,
instead let the browser handle the sleeping:
<?php
$goto='http://tt.mot.com/to_pdf/pdf_tmp/test.pdf';
$sleepfor=30;
printf('<META HTTP-EQUIV="Refresh" CONTENT="%d URL=%s">',
$sleepfor, $goto);
// run the job
$cmd='foo -bar baz ';
system($cmd);
?>
-- Don Read dreadtexas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
When using fgets() 3 times, does the pointer inside the file change positions?
Navid Yar
-----Original Message-----
From: Richard Lynch [mailto:ceo
l-i-e.com]
Sent: Thursday, August 30, 2001 4:57 AM
To: php-general
lists.php.net
Subject: [PHP] Re: line by line
http://php.net/fopen http://php.net/fgets
Call fopen. Call fgets 3 times. Call fread($file, 1000000) to get the rest.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Gary <gbland
worldnet.att.net> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Monday, August 27, 2001 4:10 PM Subject: line by line
> Hi All, > I need to get info from a flat file line by line. What I need to do is > get 3 separate lines and then a paragraph. Can someone point me to a > tutorial or info on the subject. > > TIA > Gary >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
That I know, calling fgets() 3 times would put the file pointer at the start
of the 4th. line. However, fread() "won't let you decide the position from
which the acquisition begins.." according to my help book. Perhaps the
filepointer is in the right spot, perhaps not. fread() requires an fseak()
file pointer to offset the start of the file to where you want to begin
reading.
I hope this helps.
hugh
----- Original Message -----
From: Navid Yar <Superbus22
home.com>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 1:50 PM
Subject: RE: [PHP] Re: line by line
> When using fgets() 3 times, does the pointer inside the file change
> positions?
>
> Navid Yar
>
> -----Original Message-----
> From: Richard Lynch [mailto:ceo
l-i-e.com]
> Sent: Thursday, August 30, 2001 4:57 AM
> To: php-general
lists.php.net
> Subject: [PHP] Re: line by line
>
>
> http://php.net/fopen
> http://php.net/fgets
>
> Call fopen.
> Call fgets 3 times.
> Call fread($file, 1000000) to get the rest.
>
> --
> WARNING richard
zend.com address is an endangered species -- Use
> ceo
l-i-e.com
> Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
> ----- Original Message -----
> From: Gary <gbland
worldnet.att.net>
> Newsgroups: php.general
> To: <php-general
lists.php.net>
> Sent: Monday, August 27, 2001 4:10 PM
> Subject: line by line
>
>
> > Hi All,
> > I need to get info from a flat file line by line. What I need to do is
> > get 3 separate lines and then a paragraph. Can someone point me to a
> > tutorial or info on the subject.
> >
> > TIA
> > Gary
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Thanks Hugh, that makes a lot of sense. I shall look for further details about these functions and learn more about them. Thanks again for your input.
Sincerely, Navid Yar
-----Original Message-----
From: Hugh Danaher [mailto:hdanaher
earthlink.net]
Sent: Thursday, August 30, 2001 5:23 PM
To: Navid Yar; php-general
lists.php.net
Cc: Php-General
Subject: Re: [PHP] Re: line by line
That I know, calling fgets() 3 times would put the file pointer at the start
of the 4th. line. However, fread() "won't let you decide the position from
which the acquisition begins.." according to my help book. Perhaps the
filepointer is in the right spot, perhaps not. fread() requires an fseak()
file pointer to offset the start of the file to where you want to begin
reading.
I hope this helps.
hugh
----- Original Message -----
From: Navid Yar <Superbus22
home.com>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 1:50 PM
Subject: RE: [PHP] Re: line by line
> When using fgets() 3 times, does the pointer inside the file change
> positions?
>
> Navid Yar
>
> -----Original Message-----
> From: Richard Lynch [mailto:ceo
l-i-e.com]
> Sent: Thursday, August 30, 2001 4:57 AM
> To: php-general
lists.php.net
> Subject: [PHP] Re: line by line
>
>
> http://php.net/fopen
> http://php.net/fgets
>
> Call fopen.
> Call fgets 3 times.
> Call fread($file, 1000000) to get the rest.
>
> --
> WARNING richard
zend.com address is an endangered species -- Use
> ceo
l-i-e.com
> Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
> ----- Original Message -----
> From: Gary <gbland
worldnet.att.net>
> Newsgroups: php.general
> To: <php-general
lists.php.net>
> Sent: Monday, August 27, 2001 4:10 PM
> Subject: line by line
>
>
> > Hi All,
> > I need to get info from a flat file line by line. What I need to do is
> > get 3 separate lines and then a paragraph. Can someone point me to a
> > tutorial or info on the subject.
> >
> > TIA
> > Gary
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Hello Ramus,
Rasmus Lerdorf wrote: > Well, the one on php.net is very simple, but it meets those basic > requirements. http://www.php.net/cal.php > You can grab the source for it out of cvs. See http://cvs.php.net
Ok.. I've got the source.. However, pulling the calendar out of php.net is a bit trickier than it seems.
I'm getting some results: http://pgs.ca/calendar/cal.php
But it certainly wasn't built to allow other folks to easily incorporate this calendar into their sites.
I suppose that they have had to conseal some things for the sake of security. However, it is proving to be a real nussance.. This has likely got all that I need for an event calendar.. However, I can't add events (big pain).
It is just a bloody nussance to untangle.
I think I now have the authorization figured out.. The trouble I think is in this line of code (and it's sister Reject_Selected which follows shortly after:
if(isset($HTTP_POST_VARS['Approve_Selected_x']) || isset($HTTP_POST_VARS['Approve_Selected']) || isset($HTTP_POST_VARS['Approve_Selected_y'])) { foreach($entries as $entry=>$val) { $result = mysql_query("update phpcal set approved=1, app_by='$user' where id=$entry"); if(!$result) echo mysql_error(); } }
This doesn't seem to be doing anything and I can not echo any results from: echo $HTTP_POST_VARS['Approve_Selected_y';
What the heck am I doing wrong here?
Mike
-- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein
attached mail follows:
Hello Ramus,
Rasmus Lerdorf wrote: > Well, the one on php.net is very simple, but it meets those basic > requirements. http://www.php.net/cal.php > You can grab the source for it out of cvs. See http://cvs.php.net
Ok.. I've got the source.. However, pulling the calendar out of php.net is a bit trickier than it seems.
I'm getting some results: http://pgs.ca/calendar/cal.php
But it certainly wasn't built to allow other folks to easily incorporate this calendar into their sites.
I suppose that they have had to conseal some things for the sake of security. However, it is proving to be a real nussance.. This has likely got all that I need for an event calendar.. However, I can't add events (big pain).
It is just a bloody nussance to untangle.
I think I now have the authorization figured out.. The trouble I think is in this line of code (and it's sister Reject_Selected which follows shortly after:
if(isset($HTTP_POST_VARS['Approve_Selected_x']) || isset($HTTP_POST_VARS['Approve_Selected']) || isset($HTTP_POST_VARS['Approve_Selected_y'])) { foreach($entries as $entry=>$val) { $result = mysql_query("update phpcal set approved=1, app_by='$user' where id=$entry"); if(!$result) echo mysql_error(); } }
This doesn't seem to be doing anything and I can not echo any results from: echo $HTTP_POST_VARS['Approve_Selected_y';
What the heck am I doing wrong here?
Mike
-- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein
attached mail follows:
On 30 Aug 01, at 13:40, Mike Gifford wrote:
> I'd like to find a good web calendar which will allow the general public to > enter suggested events into a web calendar. I would want these suggested > events to be moderated so that they can be verified.
I've got one that I downloaded from freshmeat and adjusted to do more things that I was after.
You can find a sample of the output at:
http://calendar.outbackqld.net.au/lsc/
The source is available as a tar.gz if you click on the application copyright link in the footer of the pages.
I'm actually doing a re-write at the moment to add a more robust admin module but it's a while away from being released as I've got other more pressing projects on the go.
CYA, Dave
-----------------------------------------------------------------------
Outback Queensland Internet - Longreach, Outback Queensland - Australia
http://www.outbackqld.net.au mailto:dfreeman
outbackqld.net.au
-----------------------------------------------------------------------
attached mail follows:
On 30-Aug-2001 John Meyer wrote: > Is there anyway to determine the pixel width of a string? >
$font=2; $strpx=imagefontwidth($font) * strlen($str);
Regards,
-- Don Read dreadtexas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
It also depends on the font! it might be a fixed font or not a fixed font!
"Don Read" <dread
texas.net> wrote in message
news:XFMail.20010830160307.dread
texas.net...
>
> On 30-Aug-2001 John Meyer wrote:
> > Is there anyway to determine the pixel width of a string?
> >
>
> $font=2;
> $strpx=imagefontwidth($font) * strlen($str);
>
> Regards,
> --
> Don Read dread
texas.net
> -- It's always darkest before the dawn. So if you are going to
> steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
Can someone tell me why I am getting an error for the second line below. It works locally but not live.
<?php $filename = "www/name/test/free.txt" $toread = fopen($filename, 'r'); $contents = fread($toread, filesize($filename)); fclose($toread); echo "$contents"; ?>
attached mail follows:
On 30-Aug-2001 Gary wrote: > Can someone tell me why I am getting an error for the second line below. > It works locally but not live. > > <?php > $filename = "www/name/test/free.txt" ^ semi-colon ?
> $toread = fopen($filename, 'r');
> $contents = fread($toread, filesize($filename));
> fclose($toread);
> echo "$contents";
> ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- Don Read dreadtexas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
geez, time to call it a day!
Thanks Gary
Don Read wrote:
> On 30-Aug-2001 Gary wrote:
>
>>Can someone tell me why I am getting an error for the second line below.
>>It works locally but not live.
>>
>> <?php
>> $filename = "www/name/test/free.txt"
>>
> ^ semi-colon ?
>
>
>> $toread = fopen($filename, 'r');
>> $contents = fread($toread, filesize($filename));
>> fclose($toread);
>> echo "$contents";
>> ?>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>>For additional commands, e-mail: php-general-help
lists.php.net
>>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>>
>
attached mail follows:
Gary wrote: > Can someone tell me why I am getting an error for the second line below. > It works locally but not live. > > <?php > $filename = "www/name/test/free.txt" > $toread = fopen($filename, 'r'); > $contents = fread($toread, filesize($filename)); > fclose($toread); > echo "$contents"; > ?> > >
It would be useful if you would point out which error it is you are encountering.
/ franklin
-- Franklin van Velthuizen fvebiris.se +46-(0)70-6786613 Ebiris Applications AB http://www.ebiris.se/ +46-(0)19-109917
attached mail follows:
At 11:53 PM 8/30/01 +0200, you wrote: >Gary wrote: >>Can someone tell me why I am getting an error for the second line below. >>It works locally but not live. >> <?php >> $filename = "www/name/test/free.txt" >> $toread = fopen($filename, 'r'); >> $contents = fread($toread, filesize($filename)); >> fclose($toread); >> echo "$contents"; >> ?> > >It would be useful if you would point out which error it is you are >encountering.
my guess would be that you need a semicolon on the first line.
attached mail follows:
Hi All,
Another doubt. How can I delete files older than X seconds from a given folder?
At the on-line manual I could only find a contributed note about 'discover time of last modification' from a file under a folder.
Any help is appreciated.
--Julio Nobrega
A hora está chegando: http://toca.sourceforge.net
attached mail follows:
<Original message>
From: Julio Nobrega Trabalhando <inerteARROBAhotmail.com
pb1.pair.com>
Date: Thu, Aug 30, 2001 at 12:56:38PM -0300
Message-ID: <20010830222200.24369.qmail
pb1.pair.com>
Subject: [PHP] Delete files older than X seconds.
> Hi All, > > Another doubt. How can I delete files older than X seconds from a given > folder? > > At the on-line manual I could only find a contributed note about 'discover > time of last modification' from a file under a folder. > > Any help is appreciated. > > -- > > Julio Nobrega > > A hora está chegando: > http://toca.sourceforge.net
</Original message>
<Reply>
I don't exactly see any problem here. If you want files older than X seconds, and you have a modification time... Then you can unlink() them can't you?! I think you pretty much found the solution yourself. But just in case... Take a look at the following manual pages and create a construction with them. I think these are all you need.
http://www.php.net/manual/en/function.opendir.php http://www.php.net/manual/en/function.readdir.php http://www.php.net/manual/en/function.closedir.php (in order to scan your directory)
http://www.php.net/manual/en/function.stat.php (in order to get the modification time)
Hope this helps... And if this wasn't the problem... Tell me/us!
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
At 1:31 PM -0700 8/30/01, Kyle Smith wrote: >ok i have this code to do whats below, but its not working > > <?php >$fp = fopen("meh.txt","r"); >for($i=0;$i<2;$i++) >{ >print "$fp[$i]"; >} >?>
That's because $fp is a file POINTER, not the actual contents of the file. You might have been thinking of the file() function, which sucks the entire contents of the file into an array...very wasteful, if all you need are the first few lines. What you want here is:
$fp = fopen("meh.txt","r"); for($i=0;$i<2;$i++) { print fread($fp, 4096); } or unset($FileArray); $fp = fopen("meh.txt","r"); for($i=0;$i<2;$i++) { $FileArray[] = fread($fp, 4096); }
foreach($FileArray as $line) { print $line; }
The second parameter in the fread function is the maximum line length; normally, that would be set to ma number larger than the maximum line length you're likely to encounter (unless you have long lines, and only need the first few characters of that line). See:
http://www.php.net/manual/en/function.fopen.php and http://www.php.net/manual/en/function.fread.php
Also, the line
print "$fp[$i]";
isn't likely to work the way you expect; if $fp was an array, you'd get something like
Array[0] Array[1] Array[2]
as the printout, since the $i, in quotes, wouldn't be interpreted as an array index. Use something like
print $fp[$i]; or print "Some text here ".$fp[$i]." more text here";
instead.
>
>-lk6-
>http://www.StupeedStudios.f2s.com
>Home of the burning lego man!
>
>ICQ: 115852509
>MSN: dbzno1fan
hotmail.com
>AIM: legokiller666
-- +------------------------ Open source questions? ------------------------+ | Steve Edberg University of California, Davis | | sbedbergucdavis.edu Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | +----------- http://pgfsun.ucdavis.edu/open-source-tools.html -----------+
attached mail follows:
Hi - Is it possible to get documentation for the snapshopt releases? Or something newer than 4.0.6? All pointers appreciated.
Thanks!
-philip
attached mail follows:
if (empty($DidSurvey[$p_surveyid])) { if (is_array($p_answers)){ foreach($p_answers as $value) { error line--> $sql = "INSERT INTO RESULTS(SURVEY_ID, ANSWER_ID) VALUES(" . $p_surveyid . "," . $value . ");"; mysql_query($sql); } else {
attached mail follows:
<Original message>
From: John Meyer <john_meyer
geocities.com>
Date: Thu, Aug 30, 2001 at 03:49:57PM -0700
Message-ID: <5.1.0.14.0.20010830154900.00a00d80
pop.mail.yahoo.com>
Subject: [PHP] Is there anything in here that could be considered a parse error?
> 1 if (empty($DidSurvey[$p_surveyid])) { > 2 if (is_array($p_answers)){ > 3 foreach($p_answers as $value) { > 4 $sql = "INSERT INTO RESULTS(SURVEY_ID, ANSWER_ID) VALUES(" . $p_surveyid . "," . $value . ");"; > 5 mysql_query($sql); > 6 } > 7 else {
</Original message>
<Reply>
Take a look yourself... Pretty obvious isn't it?! There's some code missing! At least... well... It's not right. You either don't close your foreach() loop which starts at line 3, or you don't close the if() loop which starts at line 2, and you definitely don't close the if() loop which starts at line 1. You probably mean something like:
1 if (empty($DidSurvey[$p_surveyid])) { 2 if (is_array($p_answers)){ 3 foreach($p_answers as $value) { 4 $sql = "INSERT INTO RESULTS(SURVEY_ID, ANSWER_ID) VALUES(" . $p_surveyid . "," . $value . ");"; 5 mysql_query($sql); 6 } 7 } 8 } else { etc.
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Manuel,
Thanx for the excellent overview of metabase. I will give it a test drive. A couple further questions, if you have time:
Do you execute meta commands like you do with the other db interface functions, e.g., odbc_connect(), odbc_select(), etc., or are you able to encapsulate SQL between tags, e.g.
<tag> SELECT bar FROM foo WHERE barname = "chocolate"; </tag>
Using a function set can be cumbersome, compared to embedded language interfaces where you just put SQL between tags, just like PHP is handled between the <? ?> tags.
Also, can you PREPARE, DECLARE, and OPEN cursors like, say, in Informix, so you can use variable SELECT parameters? For example, using Informix ESQL/C you can PREPARE a statement, use it to DECLARE a CURSOR, and the OPEN the CURSOR USING multiple values, as in:
sprintf( query, "%s %s %s %s %s %s %s %s %s", "begin work;", "update account set balance = balance + ?," "where acct_number = ?;", "update teller set balance = balance + ?", "where teller_number = ?;", "update brance set balance = balance + ?", "where branch_number = ?;" "insert into history values (?, ?);", "commit work;" ); $prepare qid from $query; $execute qid using $delta, $acct_number, $delta, $teller_number, $delta, $branch_number, $timestamp, $values;
I should be able to check metabase out later this evening. If it can handle the above native database language, I think it will be an asset, especially for some of our older applications.
Thanx again, James Potts
"Manuel Lemos" <mlemos
acm.org> wrote in message
news:3B8E8E47.289283CD
acm.org...
> Hello,
>
> James wrote:
> > Regarding a database abstraction package: does Metabase handle all
> > "standard" SQL constructs (as opposed to vendor-specific SQL
extensions)?
> > The GUI applications to be ported were built with JAM, which basically
> > provides an abstraction layer via its JPL language. JPL has not been
> > restrictive in terms of required functionality, nor was there any real
> > performance hits. Can the same be said of Metabase? Also, would
Metabase
> > present a significant learning curve for experienced C and SQL
programmers?
> >
> > I will download PostgreSQL and check it out.
>
> Metabase does much more than you probably may want. Basically you can
> just submit any queries to the database server. Metabase doesn't touch
> them. What it does is when you are composing your queries with constant
> values, it may convert the respective data type values from a database
> independent data type set to the target database data types.
>
> Let's say you have strings or date constant values. Each database may
> have different ways to escape strings or format dates. Metabase provides
> functions to do that translation if you want to use direct queries. I
> you want to use prefered queries, with placeholders ( ? ) in the queries
> that are replace with constant values when the queries are executed, the
> functions to set those values perform the translations for you.
>
> For retrieving result data returned by SELECT queries, Metabase also
> provides functions to translate the data to a database independent
> format, so in your applications you only have to handle one universal
> format that you do not need to adapt if you decide to switch to your
> database backend.
>
> That is not all. Metabase also provides unique features, that are very
> important for Web programming, all in a database independent way. One is
> the ability to create and access to database sequence objects. Sequences
> are objects that can generate sequential integer unique numbers. They
> are often used to generate id values for table primary keys. Sequence
> number generation is guaranteed to be atomic, so it is adequate for
> environments where many users access the database concurrently, like the
> Web. Sequences are implemented with real sequence objects in databases
> that support it like Oracle and Postgres, but others that don't support
> real sequence objects are emulated with tables with a single
> auto-incremented integer field.
>
> Another important feature is the ability for Web programming is the
> ability to limit the range of rows that are returned from a select
> query, like MySQL LIMIT clause, but in a way that is supported by all
> databases supported by Metabase. This is great to let you develop
> applications that display query results split in multiple pages if they
> have too many rows.
>
> Metabase is not also good for develop applications to access databases.
> It is also able to install databases for you creating tables, fields,
> indexes and sequence from a database independent schema description
> defined in a specific XML format. Also, if later you need to change your
> database schema, all you need to do is change the schema description XML
> file. Metabase manager is able to figure the differences between the new
> and the previously installed schema and then it just alters the database
> without affecting the data that was stored after the database was
> installed for the first time or changed for the last time. This saves
> you toons of hours and maintenance headache.
>
> Metabase is easy to learn. In the site there is a tutorial document that
> get you started real quick. If you need further help, you may join to
> the Metabase development mailing list that is listed in the Metabase
> page links sections. Look also in the database section of the PHP
> Classes site for components ready to use with Metabase.
>
> Regards,
> Manuel Lemos
attached mail follows:
James Potts wrote: > > Manuel, > > Thanx for the excellent overview of metabase. I will give it a test drive. > A couple further questions, if you have time: > > Do you execute meta commands like you do with the other db interface > functions, e.g., odbc_connect(), odbc_select(), etc., or are you able to > encapsulate SQL between tags, e.g. > > <tag> > SELECT bar FROM foo WHERE barname = "chocolate"; > </tag> > > Using a function set can be cumbersome, compared to embedded language > interfaces where you just put SQL between tags, just like PHP is handled > between the <? ?> tags.
That is the subject of some other project that I have which is an actual meta-language defined in XML. You write what you want to do with XML tags, and there is a compiler that translates that in to code of a target language, like PHP. This is not yet a released project although I have given a talk on this in San Diego O'Reilly Open Source conference in July, and if all goes well I will give another talk in November in PHP conference in Frankfurt. More information on that is available here:
> Also, can you PREPARE, DECLARE, and OPEN cursors like, say, in Informix, so > you can use variable SELECT parameters? For example, using Informix ESQL/C > you can PREPARE a statement, use it to DECLARE a CURSOR, and the OPEN the > CURSOR USING multiple values, as in: > > sprintf( query, "%s %s %s %s %s %s %s %s %s", > "begin work;", > "update account set balance = balance + ?," > "where acct_number = ?;", > "update teller set balance = balance + ?", > "where teller_number = ?;", > "update brance set balance = balance + ?", > "where branch_number = ?;" > "insert into history values (?, ?);", > "commit work;" ); > $prepare qid from $query; > $execute qid using $delta, $acct_number, $delta, $teller_number, > $delta, $branch_number, $timestamp, $values;
Metabase supports prepared queries which you can execute as many times as you want with different values, if it is that what you are asking.
> I should be able to check metabase out later this evening. If it can handle > the above native database language, I think it will be an asset, especially > for some of our older applications.
I am not sure if it is exactly what you are asking. In any case there is an extensive manual and a tutorial that details all it can do.
Regards, Manuel Lemos
attached mail follows:
Manuel,
Thanx again for your help. I will check it out this evening. Sounds like you're a busy man. ;-) Keep up the good work.
James Potts
"Manuel Lemos" <mlemos
acm.org> wrote in message
news:3B8EBD8F.D4383352
acm.org...
> James Potts wrote:
> >
> > Manuel,
> >
> > Thanx for the excellent overview of metabase. I will give it a test
drive.
> > A couple further questions, if you have time:
> >
> > Do you execute meta commands like you do with the other db interface
> > functions, e.g., odbc_connect(), odbc_select(), etc., or are you able to
> > encapsulate SQL between tags, e.g.
> >
> > <tag>
> > SELECT bar FROM foo WHERE barname = "chocolate";
> > </tag>
> >
> > Using a function set can be cumbersome, compared to embedded language
> > interfaces where you just put SQL between tags, just like PHP is handled
> > between the <? ?> tags.
>
> That is the subject of some other project that I have which is an actual
> meta-language defined in XML. You write what you want to do with XML
> tags, and there is a compiler that translates that in to code of a
> target language, like PHP. This is not yet a released project although I
> have given a talk on this in San Diego O'Reilly Open Source conference
> in July, and if all goes well I will give another talk in November in
> PHP conference in Frankfurt. More information on that is available here:
>
> http://www.meta-language.net/
>
>
> > Also, can you PREPARE, DECLARE, and OPEN cursors like, say, in Informix,
so
> > you can use variable SELECT parameters? For example, using Informix
ESQL/C
> > you can PREPARE a statement, use it to DECLARE a CURSOR, and the OPEN
the
> > CURSOR USING multiple values, as in:
> >
> > sprintf( query, "%s %s %s %s %s %s %s %s %s",
> > "begin work;",
> > "update account set balance = balance + ?,"
> > "where acct_number = ?;",
> > "update teller set balance = balance + ?",
> > "where teller_number = ?;",
> > "update brance set balance = balance + ?",
> > "where branch_number = ?;"
> > "insert into history values (?, ?);",
> > "commit work;" );
> > $prepare qid from $query;
> > $execute qid using $delta, $acct_number, $delta, $teller_number,
> > $delta, $branch_number, $timestamp, $values;
>
> Metabase supports prepared queries which you can execute as many times
> as you want with different values, if it is that what you are asking.
>
>
>
> > I should be able to check metabase out later this evening. If it can
handle
> > the above native database language, I think it will be an asset,
especially
> > for some of our older applications.
>
> I am not sure if it is exactly what you are asking. In any case there is
> an extensive manual and a tutorial that details all it can do.
>
> Regards,
> Manuel Lemos
attached mail follows:
Cyrille Mortreux wrote:
> Hi. > Troubles with PhpNuke and mail(): > When an user register, no mail i sent to him, but a message "warning; > mail() is not supported in this php build". > I got postfix working fine, php.ini all right with > sendmail_path=/usr/sbin/sendmail -t -i > Any idea ??? >
How did you install PHP? I guess you are building from source. I'm not a postfix user, but I think you have configured PHP w/o sendmail warpper.
Install sendmail wrapper then build PHP again. (e.g. configure checks if your system have sendmail or not)
-- Yasuo Ohgaki
attached mail follows:
Hello Zeev,
Zeev Suraski wrote: > > Manuel, > > I started answering your letter point by point, but stopped, as it wouldn't > have gotten us anywhere. > > I'm sorry if sharing my (IMHO very realistic) estimate of the PHP world > seemed like an insult to you or anybody else. Not everything that is done
You don't have to be sorry. It is your point of view. You don't have to agree. I don't feel insulted. I don't take difference of points of view personally, if they are just that.
> in the PHP world is of good quality. PHP and the various services around > it are not magical, and are not free of flaws. It would be scary if it > was. I basically said it out loud. Do I appreciate each and every effort > made to improve PHP and the community around it? Definitely. Is > everything that's done perfect? No. Some of the efforts are young, and > will mature. Some are just not that good. Many are great. I'm sorry you > fail to understand that this is a tricky business and not black&white, and > try to show my points in a very negative light. Talking in theoretical > terms is much easier than trying to work with the real-world resources and > context, and picking realistic routes.
Whoever hears you may even believe that Microsoft products and supporting sites are successful because they don't have flaws. Sorry, but honestely this sounds like an excuse for not doing it.
> As for the GUI business, I'll repeat what I answered to others on this > list, and on other lists, in many occassions. > First off, Perl and Python are *NOT* successful GUI platforms. They may be > feature complete, they may be very easy to use and develop (I don't use > either, so I don't know) but in practice, they're completely negligible in > the GUI world. I don't think anybody has a good reason to believe this is > going to change in a revolutionary manner. Now, does the fact that I think > that hurts the developers of Perl's and Python's GUI bindings? I sure as > hell hope it doesn't, and it doesn't, if they're realistic people. > I don't see the efforts made in the PHP-GUI front as fundamentally > different. It's useful, it's cool, it should be developed and improved, > and no, it will not take over the world.
The problem is not PHP-GUI capabilities being able to compete with other languages. The problem is that you seem to be willing to omit them when you present PHP as if it is something you don't want PHP be known for.
> About a central resource of PHP sites that has a voting system - I think > that's a good idea. You're quite welcome to implement it if you > volunteer. www.php.net will happily host it.
My point to suggest that was to help you to make it work according to a criteria that you would accept. In the end it would to favor your cause, which is the PHP future. I can't justify any time spent on that because I don't depend on PHP for my professional future. Currently, I even do not even program for a living. I manage people in a company that pays me for managing software development projects.
In this company, they have choose Microsoft stuff because they think it is the right choice for what they do. For some things, PHP could be a better choice, but it would be hard to convince who is in charge above me because PHP does not benefit of a great credibility in the market that would help me to make a good case to switch to PHP. This is my most important point: to make PHP a credible well known solution in all markets that it could be used with advantage.
Regards, Manuel Lemos
attached mail follows:
Manuel,
This thread is long since dead. Your points are respectfully taken by all of us, but I for one believe you are missing a fundamental point. That in mind, I've prepared a list of ubiquitous tools in use today. These tools are not backed by big marketing budgets or Microsoft or anything of the like. Some are represented in trade shows. Some don't say a word. Some have done crazy things like you have suggested we do, like contests. Some are old, some are relatively new. The only common thread they have is their success. Some went down a road similar to what you've suggested. Some have gone down long roads, some short. Many of the names you will see here today enjoy the backing of corporations who have built their existence around the survival (and thriving) of a technology which they did not create and do not own.
Apache Sendmail BIND Perl HTML/WWW Python Linux C++
I hope you will consider the point I'm making here and leave this thread to the winds. And for what it's worth, in passing, the reason PHP-GTK is not mentioned when presenting PHP is that it isn't relevant. You won't win hearts by dazzling them with irrelevant features. PHP-GTK is a great project, but the world is slowly being captivated by the power of its web capabilities, not buttons.
The
Regards,
Cristopher Daniluk
President & CEO
email: cris
dsnet.net
direct: 330/530-2373
Digital Services Network, Inc Unleashing Your Potential voice: 800/845-4822 web: http://www.dsnet.net/
-----Original Message-----
From: Manuel Lemos [mailto:mlemos
acm.org]
Sent: Thursday, August 30, 2001 6:40 PM
To: php-general
lists.php.net
Subject: Re: [PHP] The future of PHP
Hello Zeev,
Zeev Suraski wrote: > > Manuel, > > I started answering your letter point by point, but stopped, as it wouldn't > have gotten us anywhere. > > I'm sorry if sharing my (IMHO very realistic) estimate of the PHP world > seemed like an insult to you or anybody else. Not everything that is done
You don't have to be sorry. It is your point of view. You don't have to agree. I don't feel insulted. I don't take difference of points of view personally, if they are just that.
> in the PHP world is of good quality. PHP and the various services around > it are not magical, and are not free of flaws. It would be scary if it > was. I basically said it out loud. Do I appreciate each and every effort > made to improve PHP and the community around it? Definitely. Is > everything that's done perfect? No. Some of the efforts are young, and > will mature. Some are just not that good. Many are great. I'm sorry you > fail to understand that this is a tricky business and not black&white, and > try to show my points in a very negative light. Talking in theoretical > terms is much easier than trying to work with the real-world resources and > context, and picking realistic routes.
Whoever hears you may even believe that Microsoft products and supporting sites are successful because they don't have flaws. Sorry, but honestely this sounds like an excuse for not doing it.
> As for the GUI business, I'll repeat what I answered to others on this > list, and on other lists, in many occassions. > First off, Perl and Python are *NOT* successful GUI platforms. They may be > feature complete, they may be very easy to use and develop (I don't use > either, so I don't know) but in practice, they're completely negligible in > the GUI world. I don't think anybody has a good reason to believe this is > going to change in a revolutionary manner. Now, does the fact that I think > that hurts the developers of Perl's and Python's GUI bindings? I sure as > hell hope it doesn't, and it doesn't, if they're realistic people. > I don't see the efforts made in the PHP-GUI front as fundamentally > different. It's useful, it's cool, it should be developed and improved, > and no, it will not take over the world.
The problem is not PHP-GUI capabilities being able to compete with other languages. The problem is that you seem to be willing to omit them when you present PHP as if it is something you don't want PHP be known for.
> About a central resource of PHP sites that has a voting system - I think > that's a good idea. You're quite welcome to implement it if you > volunteer. www.php.net will happily host it.
My point to suggest that was to help you to make it work according to a criteria that you would accept. In the end it would to favor your cause, which is the PHP future. I can't justify any time spent on that because I don't depend on PHP for my professional future. Currently, I even do not even program for a living. I manage people in a company that pays me for managing software development projects.
In this company, they have choose Microsoft stuff because they think it is the right choice for what they do. For some things, PHP could be a better choice, but it would be hard to convince who is in charge above me because PHP does not benefit of a great credibility in the market that would help me to make a good case to switch to PHP. This is my most important point: to make PHP a credible well known solution in all markets that it could be used with advantage.
Regards, Manuel Lemos
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
At 01:40 31-08-01, Manuel Lemos wrote: >Whoever hears you may even believe that Microsoft products and >supporting sites are successful because they don't have flaws. Sorry, >but honestely this sounds like an excuse for not doing it.
Microsoft chooses which sites it links from microsoft.com *very* carefully - a very small select number of sites gets connected to it, and usually only for specific purposes (e.g., a specific article). If you draw a comparison to the PHP world, you actually proved my point.
>The problem is not PHP-GUI capabilities being able to compete with other >languages. The problem is that you seem to be willing to omit them when >you present PHP as if it is something you don't want PHP be known for.
I actually mention PHP-GTK in my sessions. I mention it as an anecdote, much like I mention some of the other interesting modules and projects in PHP (e.g., PEAR). I'm really not sure why people think I'm trying to bury PHP-GTK. Just because I don't see PHP-GTK as a main course of PHP, doesn't mean I don't think it's an important and useful project.
>In this company, they have choose Microsoft stuff because they think it >is the right choice for what they do. For some things, PHP could be a >better choice, but it would be hard to convince who is in charge above >me because PHP does not benefit of a great credibility in the market >that would help me to make a good case to switch to PHP.
In the US (and perhaps in the rest of America), that's relatively true. That's not the case in Europe or the far east. It has a lot to do with mentality and corporate culture.
> This is my most >important point: to make PHP a credible well known solution in all >markets that it could be used with advantage.
I don't think you'd find anybody who would argue with you about that.
Zeev
attached mail follows:
You have been specially selected to qualify for the following:
Premium Vacation Package and Pentium PC Giveaway To review the details of the please click on the link with the confirmation number below:
Confirmation Number#Lh340 Please confirm your entry within 24 hours of receipt of this confirmation.
Wishing you a fun filled vacation!
If you should have any additional questions or cann't connect to the site
do not hesitate to contact me direct:
mailto:vacation
btamail.net.cn?subject=Help!
attached mail follows:
Jordan,
Following (at the end of this post) is the code for a Unix daemon (daemon.c). It is setup to run on both System V and BSD. I am not familar with Linux. In any case, you link in the object built from this code with your main C program. After you've setup your environment in your main module, call daemon_start( 1 ). You do not need to start it as a background process, since it will fork itself and kill the child, anyway. The main thing the daemon does is disassociate itself from any terminals and ensures zombie processes are left in the environment.
Apart from starting the daemon, you'll need to setup an infinite loop in your main module. Here's a snippet from a main module we use to query a table, scg_system, that our applications in windows write to if they need to execute a report on our Unix database server: The only thing scg_system has is a varchar field for the reports command line, a status to tell if the command line has been run yet, and a time stamp. We use the status of 1 to tell if scg_sysd has read the row to execute the command line (so it won't execute it again); 2 to indicate that scg_sysd successfully executed the command; and 3 if scg_sysd tried, but could not execute the command, in which case the error is logged by the LogError() function.
A good way to test your daemon, is to just setup main(), call daemon_start(), and then in your infinite loop open a tty and write to it , then close the tty. After the wait() in your main() program, another child will be forked and it will write to the tty again. Once you're satisfied it works, just kill the process. Warning: Do not test a daemon on a production system. It is not difficult to code in an error that might cause the program to start forking until it fills-up the process table.
/* * check for an open database before continuing. This first loop is used because the daemon is started when the system * inits and the database will not yet be running. */ while( 1 ) {
if( !fork( ) ) { i = nCreateTable( ); /* nCreateTable() returns 0 when it has successfully checked for/created the table */ fprintf( fp, "%d", i ); /* write 1-char stat to tmp for parent */ fclose( fp ); exit( i ); } else {
wait( (int*)0 ); /* wait for child to exit */
if( ( fp = fopen( szTmpNam, "r" ) ) == NULL ) { LogError( "Can't open tmp file(2)", 0 ); exit( 1 ); }
fread( szBuf, sizeof( szBuf ), 256, fp ); /* get status */ fclose( fp ); /* close and unlink tmpfile */ unlink( szTmpNam );
status = atoi( szBuf ); if( !status ) break; /* the database is started; scg_system exists */
signal( SIGALRM, alarm_catch ); alarm( nSLEEPTIME ); /* nSLEEPTIME is the number of seconds to sleep */ pause( );
tmpnam( szTmpNam ); if( ( fp = fopen( szTmpNam, "w+" ) ) == NULL ) { LogError( "Can't open tmp file(3)", 0 ); exit( 1 ); } } } /* end while */
fclose( fp ); unlink( szTmpNam );
/* this is the processing loop */ while( 1 ) {
if( !fork() ) { nRunDBCommands( ); /* look up the command line and system() the command */ exit( 0 ); } else {
wait( (int*) 0 );
signal( SIGALRM, alarm_catch ); alarm( nSLEEPTIME ); pause( ); } } /* end while */
/* alarm catcher doesn't need to do anything. It could call alarm(), but we did it in the while loop */ int alarm_catch() { return(0); } /* end alarm_catch */
/********** here's daemon.c ************/ /* * daemon.c - start process as a UNIX daemon * * syntax: void daemon_start( int ignsigcld ) * * description: daemon is called by the main process to disconnect * the process from any terminals and/or group * leader roles. The nonzero ignsigcld flag is * to handle SIGCLDs so zombies don't clog. * * databases/files accessed: * name type description * ==== ==== =========== * scg_system table hold command lines to be executed by scg_sysd * * function calls: * name description * ==== =========== * * global variables: * name type description * ==== ==== =========== * * edit history: * Date Programmer Description * ==== ========== =========== * Thu Oct 24 02:34:24 EDT 1996 jlp baselined for fm_sysd.ec * * Programmer's Note: */
static char ident[] ="SCG Id:
(#) daemon.c 1.1.0.0. 10/14/97 17:00:50";
/* * defines */
/* * externals */
extern int errno ;
/* * includes */
#include <stdio.h> #include <signal.h> #include <errno.h> #include <sys/types.h> #include <sys/param.h> #include "SCGdefs.h"
/* * globals */
/* * function declarations */
/* ***************************** *** Function definitions *** ***************************** */ #ifdef SIGSTP #include <sys/file.h> #include <sys/ioctl.h> #endif
/* ignsigcld is nonzero to handle SIGCLDs so zombies don't clog the system */ void daemon_start( int ignsigcld ) { int nChildPID, fd ; strcpy( FUNC,"daemon_start") ;
/* * If we were started by init (process 1) from the /etc/inittab * file there's no need to detach. This test is unreliable due * to an unavoidable ambiguity; if the process is started by * some other process and orphaned (parent terminates before * we are started) */ if (getppid() == 1) goto out ;
/* * Ignore the terminal stop signals (BSD) */ #ifdef SIGTOU signal(SIGTOU, SIG_IGN) ; #endif
#ifdef SIGTTIN signal(SIGTTIN, SIG_IGN) ; #endif
#ifdef SIGTSTP signal(SIGTSTP, SIG_IGN) ; #endif
/* * If we were not started in the backgroung, fork and let * the parent exit. This also guarantees the first child * is not a process group leader */ nChildPID = fork() ; if (nChildPID < 0) { LogError( "daemon: Can't fork first child", 0 ); exit(-1) ; }
if (nChildPID > 0) exit(0); /* we are parent */
/* * First child process * Disassociate from controlling terminal and process group. * Ensure the process can't reacquire a new controlling terminal */ #ifdef SIGSTP /* BSD */ if (setpgrp(0, getpid()) == -1) { LogError( "daemon: Can't change process group (1)", 0 ); exit(-1) ; } if ((fd - open("/dev/tty", O_RDWR)) >= 0) { ioctl(fd, TIOCNOTTY, (char *)0) ; /* lose cont. tty */ close(fd) ; } #else /* System V */
if (setpgrp() == -1) { LogError( "daemon: Can't change process group (2)", 0 ) ; exit(-1) ; }
signal(SIGHUP, SIG_IGN) ; /* immune from pgrp leader death */
if ((nChildPID = fork()) < 0) { LogError( "daemon: Can't fork second child", 0 ) ; exit(-1) ; } else if (nChildPID > 0) exit(0) ; /* first child */ #endif
/* second child */ out: /* * close any open file descriptors */ for (fd = 0; fd < _NFILE; fd++) close(fd) ;
errno = 0; /* probably set from EBADF from a close */
/* * Move the current directory to root to ensure not * in a mounted file system */ chdir("/") ;
/* * clear inherited file creation mask */ umask(0) ;
/* * See if the caller isn't interested in the exit status * of its children and doesn't want to have them become * zombies and clog up the system. With System V all we * need to do is ignorre the signal. With BSD, however, * we have to catch each signal and execute the wait3() * system call. */ if (ignsigcld) { #ifdef SIGSTP int sig_child() ; signal(SIGCLD, sig_child) ; #else signal(SIGCLD,SIG_IGN) ; #endif } } /* end daemon_start */
/* eof: daemon.c */
-- HTH, James Potts"Richard Lynch" <ceo
l-i-e.com> wrote in message news:038001c13140$8e0bf1e0$6401a8c0
Lynchux100... > You could just log the IP into a database, and then look it up later in > another script in a "cron" job. You'll need PHP installed as a stand-alone > binary (aka CGI) and you'll want to read: > > man 5 crontab > > You could use select distinct and then would only need to look up each IP > once for a user that viewed many pages. > > If you wait too long, though, the IPs will change on you for DHCP clients. > Still the same country probably though. > > To answer your original question :-) what you are talking about is called > "fork" (like a fork in the road) and you do it something not unlike this: > > exec("/path/to/some/other/script &", $results, $errorcode); > echo implode("<BR>\n", $results); > if ($errorcode){ > echo "OS Error: $errorcode. Usually path/permissions. man > errno<BR>\n"; > } > > It's the & symbol that tells the shell to fork. > > The other script in question has to, errrr, I forget exactly, but I think it > has to *NOT* bind up stdin, stdout, or stderr, because then Apache and PHP > are waiting for that output... > > Search the archives for "fork" and "&" and "exec" and you should find more > posts. > > -- > WARNING richard
zend.com address is an endangered species -- Use > ceo
l-i-e.com > Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > ----- Original Message ----- > From: Jordan Pickup <JPickup
gprc.ab.ca> > Newsgroups: php.general > To: <php-general
lists.php.net> > Sent: Monday, August 27, 2001 4:03 PM > Subject: A Separate Process? > > > > Is there any way to make a separate process in PHP? > > > > I do real-time stats collection on my site and one of the things I collect > > is the domain of the user (to get their country). > > > > Sometimes getting the domain name takes a few seconds to come back and the > > user has to wait for that time before their page displays. > > > > Is there any way to split of a separate process - that doesn't end when > the > > current process ends - to do the stats collecting so that the user doesn't > > have to wait? > > > > Or, if not, is there some way to tell the browser that it has all the data > > (so that it will finish rendering the page and run my javascript) and the > > script can continue running and do the ns lookup? > > > > I'm sorry if this question has been asked and answered before but I > couldn't > > find an answer anywhere else... and the archive for this list seems to be > > down. > > > > Jordan >
attached mail follows:
use php Convert between(foxpro) `.dbf' files and MySQL thk
attached mail follows:
I'm not sure how the DBF format is, but I think you can export the Fox's .dbf to comma-seperated-values no?
If yes, you can easily then put them back into MySql.
"Yang" <jakry
bbcode.com.tw> wrote in message
news:20010830142332.12985.qmail
pb1.pair.com...
> use php Convert between(foxpro) `.dbf' files and MySQL
> thk
>
>
attached mail follows:
On Fri, 31 Aug 2001 05:56, Chris wrote: > The version of php that I use states that Gif Support is enabled. And > in fact I am > able to create and display gif images. However when it comes to > creating an image > from a file the imagecreatefromgif function doesn't seem to work. I'll > qualify doesn't > work to mean a broken image icon is displayed when I try to use this > function. I > don't know of a way to display error messages yet. > > Also there are no other graphic formats supported in the gd section of > my phpinfo() > report so I am assuming jpeg, wbmp and png can't be used. > > I've read many posts and am aware of the problems with gif support, > regarding the fact that gif isn't supported in certain versions of php. > > Since I have been able to create gifs using imagecreate() I'm a little > puzzled about > using imagecreatefromgif() > > I also found in the posts the idea of using the fread() function which > works well to > display my gif. Unfortunately what I want to do is annotate the gif > before I display it. > > Any comments welcome. > Chris
Try outputting the result direct to your browser, without anything in the way to define it as an image - that way you may get to see the error.
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAWhere there's a whip there's a way.
attached mail follows:
OK, NOW I FEEL STUPID!!!
Upon trying the suggestion I notice a missing semicolon.
Thanks, Chris
attached mail follows:
Hi,
Is there a simple way to hide the redirect url when using the header function? I would like for the script url or even the form url to remain, but not the redirected url.. Besides printing the page in the script itself, would there be any other way?
Any help is appreciated..
thanks..
attached mail follows:
<Original message>
From: Ashwin Kutty <akutty
is.dal.ca>
Date: Thu, Aug 30, 2001 at 10:51:20PM -0300
Message-ID: <Pine.A41.3.95.1010830225009.59478D-100000
is.dal.ca>
Subject: [PHP] header() + link..
> > Hi, > > Is there a simple way to hide the redirect url when using the header > function? I would like for the script url or even the form url to remain, > but not the redirected url.. Besides printing the page in the script > itself, would there be any other way? > > Any help is appreciated.. > > thanks..
</Original message>
<Reply>
There's actually no good way to achieve it in a different way. You could include/require the new page, but that's actually what you don't want (<quote>Besides printing the page in the script itself</quote>). But there is a different way to do it. It concerns the frame-layout, though. 'Cause if you use frames, the URL of one of the frames will not be shown in the location bar. But then you'll have to use frames, which I don't know if you want. One thing I can tell you though... of a page that's being shown, you cannot hide the URL. Never.
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
has anyone seen a script that checks a travel site (such as travelovity or expedia or even yahoo) and sucks out the relevant prices for certina destinations?
If not, I'm thinking I could do it, but I was just wondering if anyone had an opinion on which site would be the simplest and "cleanest" to extract the data from?
--kevin
attached mail follows:
Dear all, Now i have an Oracle database. I have created a table contains 43 rows for example. I use PHP to contact with my oracle. I want to write a script access my Oracle for display data into table. Each time display 9 rows. So I dont't know how to program such as "Page 1 2 3 4 Next".Can anybody show me the way?And addition, when i use SQL command as "select * from table_name where id>'$id' ", it didn't display at all. Thanks you in advance. BaDu
attached mail follows:
> Dear all, > Now i have an Oracle database. I have created a table contains 43 rows for example. I use PHP to contact with my oracle. I want to write a script access my Oracle for display data into table. Each time display 9 rows. So I dont't know how to program such as "Page 1 2 3 4 Next".Can anybody show me the way?And addition, when i use SQL command as "select * from table_name where id>'$id' ", it didn't display at all. > Thanks you in advance. > BaDu
Below is some snippets of code from a project I just did where I did the same thing. You will have to do some editing for this but I hope it gives you the general idea. First of all, this was for MySQL but assuming that a LIMIT statement in Oracle works the same as in MySQL, you should be ok. Second of all, in some versions of MySQL numbering of table records for an offset on LIMIT starts at 0, newer versions at 1. I'm using the older version as you can see but you will want to check your Oracle documentation for future information.
<?php $perpage=10;
//you'll want to change the above to 9 since that is how many items per page you want to show.
$q = "SELECT COUNT(*) AS NumImage FROM Photo_Image WHERE Cat_ID = '$id' GROUP BY Cat_ID"; $db->query($q); $db->next_record(); $numrows = $db->f("NumImage");
if (empty($offset)) { $offset=0; //Again, offset may be 1 or it may be 0.. check docs. }
$q = "SELECT Photo_Image.*, Photo_Cat.Name FROM Photo_Image, Photo_Cat WHERE Photo_Image.Cat_ID = '$id' AND Photo_Cat.Cat_ID = '$id' ORDER BY SortOrder LIMIT $offset, $perpage"; $db->query($q);
// print stuff here
$pages = ceil($numrows/$perpage);
if ($offset - $perpage >= 0) { ?> <a href="<? echo $PHP_SELF; ?>?func=ph&id=<? echo $id; ?>&offset=<? echo $offset - $perpage; ?>">[Prev] </a><? }
if ($pages > 1) { for ($x = 0; $x < $pages; $x++) { ?> <a href="<? echo $PHP_SELF; ?>?func=ph&id=<? echo $id; ?>&offset=<? echo $x * $perpage; ?>"><? echo $x+1; ?></a> <?
} }
if (($offset + $perpage) < $numrows) { ?> <a href="<? echo $PHP_SELF; ?>?func=ph&id=<? echo $id; ?>&offset=<? echo $offset + $perpage; ?>">[Next] </a><? }
Hope this helps. Joel
attached mail follows:
Hello ! Why this script prints an empty string(it prints nothing) as the value of the variable "u" ? This happens even if $REQUEST_URI or PHP_SELF is used instead of SCRIPT_FILENAME . Thanks...
<? function menu( $theurl) { //global $u ; $u = $SCRIPT_FILENAME; echo $u; echo $theurl; } ?>
Hello there !!!
<? menu(hoho.com) ?>
attached mail follows:
you have to use $GLOBALS["SCRIPT_FILENAME"]
jack
"Arcadius A." wrote:
> Hello !
> Why this script prints an empty string(it prints nothing) as the value of
> the variable "u" ?
> This happens even if $REQUEST_URI or PHP_SELF is used instead of
> SCRIPT_FILENAME .
> Thanks...
>
> <?
> function menu( $theurl)
> {
> //global $u ;
> $u = $SCRIPT_FILENAME;
> echo $u;
> echo $theurl;
> }
> ?>
>
> Hello there !!!
>
> <? menu(hoho.com) ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
> <? > function menu( $theurl) > { > //global $u ; > $u = $SCRIPT_FILENAME; > echo $u; > echo $theurl; > } > ?> > > Hello there !!! > > <? menu(hoho.com) ?>
Variable scope.
You need a "global $SCRIPT_FILENAME;" at the top of the function.
Jason
attached mail follows:
Hello,
Here are 2 tables:
airport --------- airport_id name code city_id
destination ----------- destination_id dest_name airport_dep_id // using airport.airport_id (departure) airport_arr_id // using airport.airport_id has well (arrival)
I have 2 columns in the second table that uses the same name column in the first table...
I dont know how to formulate my SQL query... I want to select the destinations in the destination table with not the ID of each airport but their names. I can do a join with one but with the second one, I get no results... And this is confusing!
select dest.dest_name, air.name as airport1, air.name as airport2 from destination, airport air where dest.airport_dep_id_id=air.airport_id and dest.airport_arr_id=air.airport_id;
This is not good...
Any help?
Thanks!
-- Marc Andre Paquin
attached mail follows:
Please try select dest.dest_name, air.name as airport1, air2.name as airport2 from destination, airport air, airport air2 where dest.airport_dep_id_id=air.airport_id and dest.airport_arr_id=air2.airport_id;
you can use the same table as manu times as you like in
sql.
It's calld a self join if my memory does not fail me.
--- Web Manager <web
inter-resa.com> wrote:
> Hello,
>
> Here are 2 tables:
>
> airport
> ---------
> airport_id
> name
> code
> city_id
>
>
> destination
> -----------
> destination_id
> dest_name
> airport_dep_id // using airport.airport_id (departure)
> airport_arr_id // using airport.airport_id has well
> (arrival)
>
>
> I have 2 columns in the second table that uses the same
> name column in
> the first table...
>
> I dont know how to formulate my SQL query... I want to
> select the
> destinations in the destination table with not the ID of
> each airport
> but their names. I can do a join with one but with the
> second one, I get
> no results... And this is confusing!
>
> select dest.dest_name, air.name as airport1, air.name as
> airport2 from
> destination, airport air where
> dest.airport_dep_id_id=air.airport_id and
> dest.airport_arr_id=air.airport_id;
>
> This is not good...
>
> Any help?
>
> Thanks!
> --
> Marc Andre Paquin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
===== Mehmet Erisen http://www.erisen.com
__________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com
attached mail follows:
Hey all, I've been using php for a long time and never have I had a problem with fopen(). Everytime I try to use fopen, I get some weird error messages. If I do fopen("http://www.php.net", "r") - I get this error message: Undefined error: If I try doing fopen("http://www.somehost.com/~myname/somefile.php?var=value", "r") - I get this message: Bad file descriptor What the heck is going on here? I've tried everything, except for submitting a bug report. I hope someone will have some answers.
Thanks, Paul
attached mail follows:
Well, try it from the command line and strace it and see which errno the socket open call is giving you (you said you weren't a newbie).
-Rasmus
On Fri, 31 Aug 2001, Paul Procacci wrote:
> Hey all, > I've been using php for a long time and never have I had a problem > with fopen(). Everytime I try to use fopen, I get some weird error > messages. If I do fopen("http://www.php.net", "r") - I get this error > message: Undefined error: > If I try doing > fopen("http://www.somehost.com/~myname/somefile.php?var=value", "r") - I > get this message: Bad file descriptor > What the heck is going on here? I've tried everything, except for > submitting a bug report. I hope someone will have some answers. > > Thanks, > Paul > > >
attached mail follows:
> > with fopen(). Everytime I try to use fopen, I get some weird error > > messages. If I do fopen("http://www.php.net", "r") - I get this error > > message: Undefined error: > > If I try doing > > fopen("http://www.somehost.com/~myname/somefile.php?var=value", "r") - I > > get this message: Bad file descriptor
You're trying to do operations on a file descripter that doesn't exist?
attached mail follows:
I'm sure http://www.php.net exists. :)
Speedboy wrote:
> > > with fopen(). Everytime I try to use fopen, I get some weird error > > > messages. If I do fopen("http://www.php.net", "r") - I get this error > > > message: Undefined error: > > > If I try doing > > > fopen("http://www.somehost.com/~myname/somefile.php?var=value", "r") - I > > > get this message: Bad file descriptor > > You're trying to do operations on a file descripter that doesn't exist?
attached mail follows:
Any help debugging the below would help greatly :)
ok, I ran strace and tried this via a command line: bash-2.05$ strace ./tmp.php
A snippet from tmp.php looks like this:
##################################################### #!/usr/local/bin/php -q <?php
$fopen = fopen("http://www.php.net/", "r"); exit; #####################################################
This was the output from the strace.
execve("./tmp.php", ["./tmp.php"], [/* 21 vars */]) = 0 __sysctl([hw.pagesize], 2, "\0\20\0\0", [4], NULL, 0) = 0 mmap(0, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0x2813e000
geteuid(0xbfbffaec) = 1000 getuid() = 1000 (euid 1000) getegid(0xbfbffaec) = 1000 getgid() = 1000 (egid 1000) open("/var/run/ld-elf.so.hints", O_RDONLY) = 3 read(3, "Ehnt\1\0\0\0\200\0\0\0a\0\0\0\0\0\0\0`\0\0\0\0\0\0\0\0"..., 128) = 128 lseek(3, 128, SEEK_SET) = 128 read(3, "/usr/lib:/usr/lib/compat:/usr/X1"..., 97) = 97 close(3) = 0 access("/usr/lib/libpam.so.1", F_OK) = 0 open("/usr/lib/libpam.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0444, st_size=34588, ...}) = 0 read(3, "\177ELF\1\1\1\tFreeBSD\0\3\0\3\0\1\0\0\0\344\30\0\0004"..., 4096) = 4096 mmap(0, 36864, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x28146000 mmap(0x2814e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x7000) = 0x2814e000 close(3) = 0 access("/usr/lib/libcrypt.so.2", F_OK) = 0 open("/usr/lib/libcrypt.so.2", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0444, st_size=11680, ...}) = 0 read(3, "\177ELF\1\1\1\tFreeBSD\0\3\0\3\0\1\0\0\0\304\7\0\0004\0"..., 4096) = 4096 mmap(0, 86016, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2814f000 mmap(0x28152000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x28152000 mmap(0x28153000, 69632, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0x28153000 close(3) = 0 access("/usr/lib/libm.so.2", F_OK) = 0 open("/usr/lib/libm.so.2", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0444, st_size=118928, ...}) = 0 read(3, "\177ELF\1\1\1\tFreeBSD\0\3\0\3\0\1\0\0\0\2302\0\0004\0"..., 4096) = 4096 mmap(0, 110592, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x28164000 mmap(0x2817b000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x16000) = 0x2817b000 close(3) = 0 access("/usr/lib/libc.so.4", F_OK) = 0 open("/usr/lib/libc.so.4", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0444, st_size=561580, ...}) = 0 read(3, "\177ELF\1\1\1\tFreeBSD\0\3\0\3\0\1\0\0\0\274*\1\0004\0"..., 4096) = 4096 mmap(0, 614400, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2817f000 mmap(0x281fc000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x7c000) = 0x281fc000 mmap(0x28201000, 81920, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0x28201000 close(3) = 0 sigaction(SIGILL, {0x2812f084, [], 0}, {SIG_DFL}) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigaction(SIGILL, {SIG_DFL}, NULL) = 0 sigprocmask(SIG_BLOCK, ~[ILL TRAP ABRT EMT FPE BUS SEGV SYS], []) = 0 sigprocmask(SIG_SETMASK, [], NULL) = 0 sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 readlink("/etc/malloc.conf", 0xbfbff8b4, 63) = -1 ENOENT (No such file or directory) mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0x28215000 break(0x814b000) = 0 break(0x814c000) = 0 break(0x814d000) = 0 break(0x814e000) = 0 break(0x814f000) = 0 break(0x8150000) = 0 break(0x8151000) = 0 open("./php.ini", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/lib/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory) break(0x8152000) = 0 break(0x8153000) = 0 break(0x8154000) = 0 break(0x8155000) = 0 break(0x8156000) = 0 break(0x8157000) = 0 break(0x8158000) = 0 break(0x8159000) = 0 break(0x815a000) = 0 break(0x815b000) = 0 break(0x815c000) = 0 break(0x815d000) = 0 break(0x815e000) = 0 break(0x815f000) = 0 break(0x8160000) = 0 break(0x8161000) = 0 break(0x8162000) = 0 break(0x8163000) = 0 break(0x8164000) = 0 break(0x8165000) = 0 break(0x8166000) = 0 break(0x8167000) = 0 break(0x8168000) = 0 break(0x8169000) = 0 break(0x816a000) = 0 break(0x816b000) = 0 break(0x816c000) = 0 break(0x816d000) = 0 break(0x816e000) = 0 open("/etc/protocols", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=5770, ...}) = 0 break(0x8170000) = 0 read(3, "#\n# Internet protocols\n#\n# $Free"..., 8192) = 5770 close(3) = 0 open("/etc/protocols", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=5770, ...}) = 0 read(3, "#\n# Internet protocols\n#\n# $Free"..., 8192) = 5770 close(3) = 0 break(0x8171000) = 0 break(0x8172000) = 0 open("/etc/services", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=72301, ...}) = 0 break(0x8174000) = 0 read(3, "#\n# Network services, Internet s"..., 8192) = 8192 read(3, "TSAP Class 0\niso-tsap\t102/udp\t "..., 8192) = 8192 read(3, "ing\t\t\nat-3\t\t203/tcp\t #AppleTal"..., 8192) = 8192 read(3, "s\nups\t\t401/tcp\t #Uninterruptib"..., 8192) = 8192 read(3, "in\t534/udp\t #MegaMedia Admin\ni"..., 8192) = 8192 read(3, "tl_bootc\t1068/tcp #Installatio"..., 8192) = 8192 read(3, "\t\t1429/tcp #Hypercom NMS\t\t "..., 8192) = 8192 read(3, "\t1534/udp\nampr-info\t1535/tcp\namp"..., 8192) = 8192 read(3, "33/udp #DEC Notes\nrsvp-encap\t3"..., 8192) = 6765 read(3, "", 8192) = 0 close(3) = 0 break(0x8175000) = 0 break(0x8176000) = 0 setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={30, 0}}, NULL) = 0 sigaction(SIGPROF, {0x80c84c4, [], SA_RESTART}, {SIG_DFL}) = 0 sigprocmask(SIG_UNBLOCK, [PROF], NULL) = 0 break(0x8177000) = 0 break(0x8178000) = 0 break(0x8179000) = 0 break(0x817a000) = 0 gettimeofday({999235401, 414103}, NULL) = 0 getpid() = 58490 (ppid 58489) getpid() = 58490 (ppid 58489) open("./tmp.php", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=1945, ...}) = 0 chdir(".") = 0 fstat(3, {st_mode=S_IFREG|0755, st_size=1945, ...}) = 0 break(0x817c000) = 0 read(3, "#!/usr/local/bin/php -q\n<?php\n\n/"..., 8192) = 1945 sigprocmask(SIG_BLOCK, NULL, []) = 0 break(0x8181000) = 0 ioctl(3, TIOCGETA, 0xbfbfe84c) = -1 ENOTTY (Inappropriate ioctl for device) break(0x8182000) = 0 read(3, "", 8192) = 0 break(0x8186000) = 0 break(0x8196000) = 0 ioctl(3, TIOCGETA, 0xbfbfd898) = -1 ENOTTY (Inappropriate ioctl for device) break(0x819b000) = 0 close(3) = 0 gettimeofday({999235401, 421434}, NULL) = 0 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(5, 0), ...}) = 0 ioctl(1, TIOCGETA, {B9600 opost isig icanon echo ...}) = 0 write(1, "<br>\n", 5<br> ) = 5 write(1, "<b>Warning</b>: Cannot send ses"..., 108<b>Warning</b>: Cannot send session cookie - headers already sent in <b>./tmp.php</b> on line <b>5</b><br> ) = 108 write(1, "<br>\n", 5<br> ) = 5 write(1, "<b>Warning</b>: Cannot send ses"..., 147<b>Warning</b>: Cannot send session cache limiter - headers already sent (output started at ./tmp.php:5) in <b>./tmp.php</b> on line <b>5</b><br> ) = 147 open("/tmp/sess_e4761f15ea219adcc61fa75fc23e3931", O_RDWR) = -1 ENOENT (No such file or directory) open("/tmp/sess_e4761f15ea219adcc61fa75fc23e3931", O_RDWR|O_CREAT|O_EXCL, 0600) = 3 flock(3, LOCK_EX) = 0 fstat(3, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0 lseek(3, 0, SEEK_SET) = 0 read(3, "", 0) = 0 gettimeofday({999235401, 444693}, NULL) = 0 open("/etc/host.conf", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=205, ...}) = 0 read(4, "# $FreeBSD: src/etc/host.conf,v "..., 8192) = 205 read(4, "", 8192) = 0 close(4) = 0 open("/etc/hosts", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=1115, ...}) = 0 read(4, "# $FreeBSD: src/etc/hosts,v 1.11"..., 8192) = 1115 read(4, "", 8192) = 0 close(4) = 0 gettimeofday({999235401, 449289}, NULL) = 0 getpid() = 58490 (ppid 58489) issetugid(0x281ffea8) = 0 open("/etc/resolv.conf", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=47, ...}) = 0 read(4, "domain\txanthusinc.com\nnameserver"..., 8192) = 47 read(4, "", 8192) = 0 close(4) = 0 issetugid(0x281ffea8) = 0 kqueue(0x281ffea8) = 4 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5 connect(5, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("209.191.146.3")}}, 16) = 0 sendto(5, " ;\1\0\0\1\0\0\0\0\0\0\3www\3php\3net\0\0\34\0\1", 29, 0, NULL, 0) = 29 kevent(0x4, 0xbfbf9eb4, 0x1, 0xbfbf9eb4, 0x1, 0xbfbf9ea0) = 1 recvfrom(5, " ;\201\200\0\1\0\1\0\1\0\0\3www\3php\3net\0\0\34\0\1\300"..., 1024, 0, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("209.191.146.3")}}, [16]) = 100 close(5) = 0 close(4) = 0 kqueue(0x281ffea8) = 4 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5 connect(5, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("209.191.146.3")}}, 16) = 0 sendto(5, " <\1\0\0\1\0\0\0\0\0\0\3www\3php\3net\0\0\1\0\1", 29, 0, NULL, 0) = 29 kevent(0x4, 0xbfbf9eb4, 0x1, 0xbfbf9eb4, 0x1, 0xbfbf9ea0) = 1 recvfrom(5, " <\201\200\0\1\0\2\0\4\0\4\3www\3php\3net\0\0\1\0\1\300"..., 1024, 0, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("209.191.146.3")}}, [16]) = 214 close(5) = 0 close(4) = 0 open("/etc/hosts", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=1115, ...}) = 0 read(4, "# $FreeBSD: src/etc/hosts,v 1.11"..., 8192) = 1115 read(4, "", 8192) = 0 close(4) = 0 kqueue(0x281ffea8) = 4 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5 connect(5, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("209.191.146.3")}}, 16) = 0 sendto(5, " =\1\0\0\1\0\0\0\0\0\0\3www\3php\3net\0\0\34\0\1", 29, 0, NULL, 0) = 29 kevent(0x4, 0xbfbf9eb4, 0x1, 0xbfbf9eb4, 0x1, 0xbfbf9ea0) = 1 recvfrom(5, " =\201\200\0\1\0\1\0\1\0\0\3www\3php\3net\0\0\34\0\1\300"..., 1024, 0, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("209.191.146.3")}}, [16]) = 100 close(5) = 0 close(4) = 0 kqueue(0x281ffea8) = 4 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5 connect(5, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("209.191.146.3")}}, 16) = 0 sendto(5, " >\1\0\0\1\0\0\0\0\0\0\3www\3php\3net\0\0\1\0\1", 29, 0, NULL, 0) = 29 kevent(0x4, 0xbfbf9eb4, 0x1, 0xbfbf9eb4, 0x1, 0xbfbf9ea0) = 1 recvfrom(5, " >\201\200\0\1\0\2\0\4\0\4\3www\3php\3net\0\0\1\0\1\300"..., 1024, 0, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("209.191.146.3")}}, [16]) = 214 close(5) = 0 close(4) = 0 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4 connect(4, {sin_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("208.247.106.187")}}, 16) = 0 sendto(4, "GET / HTTP/1.0\r\n", 16, 0, NULL, 0) = 16 sendto(4, "Host: www.php.net\r\n", 19, 0, NULL, 0) = 19 sendto(4, "User-Agent: PHP/4.0.6\r\n\r\n", 25, 0, NULL, 0) = 25 select(5, [4], NULL, NULL, NULL) = 1 (in [4]) recvfrom(4, "HTTP/1.1 200 OK\r\nDate: Fri, 31 A"..., 8192, 0, NULL, NULL) = 1460 sigprocmask(SIG_SETMASK, [], NULL) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 ftruncate(3, 0) = 0 lseek(3, 0, SEEK_SET) = 0 write(3, "", 0) = 0 close(3) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 shutdown(4, 0 /* receive */) = 0 close(4) = 0 shutdown(4, 0 /* receive */) = -1 EBADF (Bad file descriptor) sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 break(0x8192000) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 sigprocmask(SIG_BLOCK, ~[ILL TRAP ABRT EMT FPE BUS SEGV SYS], []) = 0 sigprocmask(SIG_SETMASK, [], NULL) = 0 exit(0) = ?
Rasmus Lerdorf wrote:
> Well, try it from the command line and strace it and see which errno the > socket open call is giving you (you said you weren't a newbie). > > -Rasmus > > On Fri, 31 Aug 2001, Paul Procacci wrote: > > > Hey all, > > I've been using php for a long time and never have I had a problem > > with fopen(). Everytime I try to use fopen, I get some weird error > > messages. If I do fopen("http://www.php.net", "r") - I get this error > > message: Undefined error: > > If I try doing > > fopen("http://www.somehost.com/~myname/somefile.php?var=value", "r") - I > > get this message: Bad file descriptor > > What the heck is going on here? I've tried everything, except for > > submitting a bug report. I hope someone will have some answers. > > > > Thanks, > > Paul > > > > > >
Rasmus Lerdorf wrote:
> Well, try it from the command line and strace it and see which errno the > socket open call is giving you (you said you weren't a newbie). > > -Rasmus > > On Fri, 31 Aug 2001, Paul Procacci wrote: > > > Hey all, > > I've been using php for a long time and never have I had a problem > > with fopen(). Everytime I try to use fopen, I get some weird error > > messages. If I do fopen("http://www.php.net", "r") - I get this error > > message: Undefined error: > > If I try doing > > fopen("http://www.somehost.com/~myname/somefile.php?var=value", "r") - I > > get this message: Bad file descriptor > > What the heck is going on here? I've tried everything, except for > > submitting a bug report. I hope someone will have some answers. > > > > Thanks, > > Paul > > > > > >
attached mail follows:
> I'm sure http://www.php.net exists. :)
No, what my sentence meant was you're trying to do some operations on a mis-typed file descripter?
$fp = fopen... fputs($fp2... ^- There should be no 2.
Possibly something like that?
> > > > with fopen(). Everytime I try to use fopen, I get some weird error > > > > messages. If I do fopen("http://www.php.net", "r") - I get this error > > > > message: Undefined error: > > > > If I try doing > > > > fopen("http://www.somehost.com/~myname/somefile.php?var=value", "r") - I > > > > get this message: Bad file descriptor > > > > You're trying to do operations on a file descripter that doesn't exist?
attached mail follows:
we're trying to get a krb4 c-client working with php built as an apache server module (either dso or static).
we've hit a wall in that, c-client itself seems to have access to the environment in which apache was started, but not the apache environment.
ie... we threw this into c-client:
{ extern char **environ;
int i;
for ( i = 0; environ[ i ] != NULL; i++ ) { fprintf( stderr, "%s\n", environ[ i ] ); } }
and the environment that c-client itself can see is: [Fri Aug 31 00:22:19 2001] [info] Server built: Aug 30 2001 12:11:45 APACHE=/usr/local/httpsd/bin/httpsd AWK=/usr/bin/awk GREP=/usr/bin/grep HOME=/ KRBTKFILE=/ticket/p1090525904 PIDFILE=/usr/local/httpsd/log/httpd.pid PS=/usr/bin/ps PWD=/ USER=nobody
ie - the same stuff phpinfo() lists under HTTP_ENV_VARS. We really need access to the HTTP_SERVER_VARS (we're revising the krb4 imap patches for c-client, *really* need access to REMOTE_USER from within c-client itself).
does anyone have suggestions?
Liam
attached mail follows:
Just do a putenv() from PHP?
On Fri, 31 Aug 2001, Liam Hoekenga wrote:
> we're trying to get a krb4 c-client working with php built as an apache > server module (either dso or static). > > we've hit a wall in that, c-client itself seems to have access to the > environment in which apache was started, but not the apache environment. > > ie... we threw this into c-client: > > { > extern char **environ; > > int i; > > for ( i = 0; environ[ i ] != NULL; i++ ) { > fprintf( stderr, "%s\n", environ[ i ] ); > } > } > > and the environment that c-client itself can see is: > [Fri Aug 31 00:22:19 2001] [info] Server built: Aug 30 2001 12:11:45 > APACHE=/usr/local/httpsd/bin/httpsd > AWK=/usr/bin/awk > GREP=/usr/bin/grep > HOME=/ > KRBTKFILE=/ticket/p1090525904 > PIDFILE=/usr/local/httpsd/log/httpd.pid > PS=/usr/bin/ps > PWD=/ > USER=nobody > > ie - the same stuff phpinfo() lists under HTTP_ENV_VARS. We really need > access to the HTTP_SERVER_VARS (we're revising the krb4 imap patches for > c-client, *really* need access to REMOTE_USER from within c-client > itself). > > does anyone have suggestions? > > Liam > > >
attached mail follows:
Dear all I'm trying to write a user input form which when the user click the submit button, two task of php will proceed.
1. The data user input into the form will be insert into Mysql. (Which i had done so already!)
2. The form will regenerate a new page which for the user to print out to get approveral, but is there any script for php that when the user click the submit button, the Regenerated page which print to user default printer automatically??
Pls help
Thx
Jack
jack
nedcor.com
attached mail follows:
if there were, webmasters could take control over your printer using their website. what a horrible thought! you can start a "request for print" however, simply by adding :
<script language="JavaScript"> <!--
document.print();
// --> </script>
this will open a print window...
Hope that helps,
Raphael
attached mail follows:
Hi,
i just moved my PHP project from my local PC to the online webserver and I will need to do a few adjustments to the server. since the server is used by all the employees in the company, there is no chance I can reboot it without prior notice... my question: is there any way I can refresh the changes I make in php.ini without doing a reboot?
TIA,
Raphael
attached mail follows:
>i just moved my PHP project from my local PC to the online webserver and I >will need to do a few adjustments to the server. since the server is used by >all the employees in the company, there is no chance I can reboot it without >prior notice... my question: is there any way I can refresh the changes I >make in php.ini without doing a reboot?
I assume you're running PHP on a Linux box.. You should be able to restart apache.. even on NT you could stop and restart the service.
Bye,
B.
/"\ \ / ASCII Ribbon Campaign X Against HTML Mail and News / \
attached mail follows:
I can only speak for apache...
==> apachectl graceful
Raphael Pirker wrote: > Hi, > > i just moved my PHP project from my local PC to the online webserver and I > will need to do a few adjustments to the server. since the server is used by > all the employees in the company, there is no chance I can reboot it without > prior notice... my question: is there any way I can refresh the changes I > make in php.ini without doing a reboot? > > TIA, > > Raphael > > > >
attached mail follows:
Hei all.
I've got this string, $string = "test"; and I want to make a $t; out of $string. Is this possible?
I tried ${substr($string, 0, 1)}, but that didn't work ;)
Any help appreciated.
TIA.
-- Stig-Řrjan Smelror SystemutviklerLinux Communications AS Sandakerveien 48b Box 1801 - Vika N-0123 Oslo, Norway
tel. +47 22 09 28 80 fax. +47 22 09 28 81 http://www.lincom.no/
attached mail follows:
Hi, I'm using the following code: for ($i = 0; $i < 100; $i++) { $k = (int) microtime(); echo "<br>$k";
for ($j = 0; $j < 10000; $j++) $m = $j *3; }
but it prints me only "0......"
Where can be problem ?
Thanks,
Rosen
attached mail follows:
You are casting microtimes results as an integer value. It isn't an integer value, hence the 0.
From the manual It returns the string the string "msec sec" where sec is the current time measured in the number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and msec is the microseconds part. This function is only available on operating systems that support the gettimeofday() system call.
Try:
for ($i = 0; $i < 100; $i++) { $k = microtime(); echo "<br>$k";
for ($j = 0; $j < 10000; $j++) $m = $j *3; }
Or look in the http://www.php.net/manual/en/function.microtime.php for examples.
-----Original Message-----
From: Rosen [mailto:rosen_dm
dir.bg]
Sent: August 31, 2001 3:29 PM
To: php-general
lists.php.net
Subject: [PHP] Problem with microtime()
Hi, I'm using the following code: for ($i = 0; $i < 100; $i++) { $k = (int) microtime(); echo "<br>$k";
for ($j = 0; $j < 10000; $j++) $m = $j *3; }
but it prints me only "0......"
Where can be problem ?
Thanks,
Rosen
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
<?php $a="123 456"; echo (int)$a; $b=(int) $a; echo "<br>"; echo $b; ?>
Produces : 123 123
So I don't think that the problem is how PHP makes the casting but the algorithm is useless. Do that : $ar=explode(' ',microtime()); $a=$ar[1]+$ar[0];
Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS
----- Original Message -----
From: <Lawrence.Sheed
dfait-maeci.gc.ca>
To: <rosen_dm
dir.bg>; <php-general
lists.php.net>
Sent: Friday, August 31, 2001 10:42 AM
Subject: RE: [PHP] Problem with microtime()
>
> You are casting microtimes results as an integer value. It isn't an integer
> value, hence the 0.
>
>
> From the manual It returns the string the string "msec sec" where sec is
> the current time measured in the number of seconds since the Unix Epoch
> (0:00:00 January 1, 1970 GMT), and msec is the microseconds part. This
> function is only available on operating systems that support the
> gettimeofday() system call.
>
>
> Try:
>
> for ($i = 0; $i < 100; $i++) {
> $k = microtime();
> echo "<br>$k";
>
> for ($j = 0; $j < 10000; $j++)
> $m = $j *3;
> }
>
> Or look in the http://www.php.net/manual/en/function.microtime.php for
> examples.
>
> -----Original Message-----
> From: Rosen [mailto:rosen_dm
dir.bg]
> Sent: August 31, 2001 3:29 PM
> To: php-general
lists.php.net
> Subject: [PHP] Problem with microtime()
>
>
> Hi,
> I'm using the following code:
> for ($i = 0; $i < 100; $i++) {
> $k = (int) microtime();
> echo "<br>$k";
>
> for ($j = 0; $j < 10000; $j++)
> $m = $j *3;
> }
>
>
> but it prints me only "0......"
>
>
>
> Where can be problem ?
>
>
>
> Thanks,
>
> Rosen
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
string microtime(void);
you see? you're casting from a string to int by your code: (int) microtime();
you can do: $k = microtime() w/o the (int)
"Rosen" <rosen_dm
dir.bg> wrote in message
news:20010831084959.93048.qmail
pb1.pair.com...
> Hi,
> I'm using the following code:
> for ($i = 0; $i < 100; $i++) {
> $k = (int) microtime();
> echo "<br>$k";
>
> for ($j = 0; $j < 10000; $j++)
> $m = $j *3;
> }
>
>
> but it prints me only "0......"
>
>
>
> Where can be problem ?
>
>
>
> Thanks,
>
> Rosen
>
>
>
>
>
>
>
attached mail follows:
I'm sorry I have to ask these stuff, but I havent found anything like this in the manual. I am running win98 with properly insalled xitami web server with php support (I ran installshield). Any way, I cant figure out hov to make a smple program with echo command, because I don't know where to place the code. I am using opera 5.12 as my default browser, and Macromedia Dreamweaver as the html editor. Maybe there is an option in Dreamweaver , but I couldn't find it in it's documentation
Please help !
Nikola Veber
attached mail follows:
If you choose to install Apache/PHP and perhaps even mySQL and you want to avoid downloading each individually, then configuring them to work together. You can download at straight-forward easy installation distribution that includes all three. Check out Nu-Sphere, and download one of their free distributions.
Hope this helps.
-----Original Message-----
From: Nikola Veber [mailto:veber
ptt.yu]
Sent: Thursday, August 30, 2001 11:19 AM
To: php forum
Subject: [PHP] begginer needs help
Importance: High
I have been doing some amateur web-design by now, but I decided to learn something like php. I was wondering if there is a way to test php code without a server(on local computer).
Thanx in advance
Nikola Veber
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Dear all I want to ask if i want to perform two task after the user had click a button, 1 is the task perform by PHP 2 is the task perform by JavaScript is it possible to do so?
I'm actually fresh on JavaScript, before i would call the JavaScript, what should i do first or what should i set before though?
Thx
Jack
jack
nedcor.com
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]