Re: [PHP] process php script at regular intervals
One way of doing this is to set up a cronjob that has Lynx call the script. There is a flag that is usually added as well ... I'm not sure right now but it could be '-dump': lynx -dump http://your/script/url.php This has been covered a few times in the archive if you want to check the details there. This assumes that you are on a Linux/UNIX server, and that PHP is an Apache module, not a standalone CGI installation (where you could call the script directly without using Lynx). Michael Hall On Mon, 3 Jun 2002, daniel cozzolino wrote: > I want to have a php script processed on a daily (eg 9am) interval. is > there some way to automate this from within the script or do i need to > schedule this with an external app? > > has anyone had any experience with this previously? > > thanks > Daniel > > > > -- n i n t i . c o m php-python-perl-mysql-postgresql Michael Hall [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] still running the old version after recompiling??
On Monday 03 June 2002 12:31, savaidis wrote: > I forgot to write I run on a win98, so no shell :) > So what? The equivalent in Win98 is to open an MS-DOS prompt and type: path -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Whom the gods would destroy, they first teach BASIC. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cron: No such file or directory
I'm trying to do a cronjob. If I'm right I should have a php file with #!/usr/lib/php -q at the beginning and a cronjob like MAILTO="[EMAIL PROTECTED]" 0 * * * * /usr/lib/php/ $HOME/myfile.php whereis php tells me: php: /usr/lib/php /usr/include/php What's wrong? At the beginning when I tried with other paths like /usr/bin/php I received a mail with 'No such file or directory' error, now I don't receive anything! Even I change to the old /usr/bin/php wrong dir and I still receive nothing!!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] echoing two varibles(newbie)
How can I echo(or include) two variables? ie include $DOCUMENT_ROOT then $row['location'] Thanks in Advance JJ Harrison[EMAIL PROTECTED]www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] still running the old version after recompiling??
There is not in PATH the directory name ("Php" or "php") Neither something related to "Apache". Makis > -Original Message- > From: Jason Wong [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 03, 2002 10:31 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] still running the old version after recompiling?? > > > On Monday 03 June 2002 12:31, savaidis wrote: > > I forgot to write I run on a win98, so no shell :) > > So what? > > The equivalent in Win98 is to open an MS-DOS prompt and type: path > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Whom the gods would destroy, they first teach BASIC. > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: echoing two varibles(newbie)
<[EMAIL PROTECTED]> wrote in message 001301c20ad8$5539f2f0$67b8fea9@JohnH">news:001301c20ad8$5539f2f0$67b8fea9@JohnH... >How can I echo(or include) two variables? > >ie include $DOCUMENT_ROOT then $row['location'] Simply refer to them within double quotes as if they were words: echo "This is $DOCUMENT_ROOT at $row['location']."; or bundle them together as a string: echo "This is " . $DOCUMENT_ROOT . " at " . $row['location'] . "."; You can shove as many variables as you like into the string like this... -- _ _ o oJason Teagle < [EMAIL PROTECTED] v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: newbie help please
"Christopher J. Crane" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > $Tags['issue-name']. So I could print it out. Something like, print > "$Tags['issue-name']\n"; > > I was able to get a numerical representation of the array like, $Tags[5] and > the value of that tag was "RED HAT", but then I would have to know what the > position of the data I am looking for in the array. I would prefer to know > the tag name and the array and get to the data that way. I know there is a > way to do this, but I just can't figure it out. There is a lot of > information on Parsing the XML file but not getting into a useful array, or > at least that I have found easily to understand. Try this: foreach ($Tags as $key => $value) { ... } In that loop you will get all entries of $Tags[] one at a time, and $key will be the name of the entry you seek (like 'issue-name'), and $value will be the value held at that entry. -- _ _ o oJason Teagle < [EMAIL PROTECTED] v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 'Pure' php vs 'mixed' (html + php)
"Andre Dubuc" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I've noticed that many people on the list code in 'pure' php, i.e. > > I would like to understand the reasons for writing code in this manner, when > all my code works fine, displays great: am I missing something important > here? Btw, I use the 'php' ending for all file names. > > Your thoughts, opinions and suggestions would be greatly appreciated -- I'd > like to do what is best. I can think of one other reason you would use pure... possibly not very valid, but still... Imagine you have a page where, if a password passed from another page is correct, you want to show some data on the Web page, but if the password is incorrect you want to show a warning and under no circumstances let them see the data. If you used mixed, they could simply read the source of the page to see that data... but with pure, the only source on the page is what PHP actually prints out, so they won't see anything they shouldn't. -- _ _ o oJason Teagle < [EMAIL PROTECTED] v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php_mssql.dll extension problem
Hi, I'm trying to load the php_mssql.dll extension and always get this error: PHP Warning: Unable to load dynamic library 'C:\PHP\extensions\php_mssql.dll' - The specified procedure could not be found. in Unknown on line 0. Any ideas?? Thanks Todor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron: No such file or directory
Cron doesn't have the same enviroment like normal shell, so it knows nothing about $HOME, you need to use full path. Edgard Berendsen wrote: >I'm trying to do a cronjob. >If I'm right I should have a php file with >#!/usr/lib/php -q >at the beginning and a cronjob like > >MAILTO="[EMAIL PROTECTED]" >0 * * * * /usr/lib/php/ $HOME/myfile.php > >whereis php tells me: >php: /usr/lib/php /usr/include/php > >What's wrong? > >At the beginning when I tried with other paths like /usr/bin/php I received >a mail >with 'No such file or directory' error, now I don't receive anything! >Even I change to the old /usr/bin/php wrong dir and I still receive >nothing!!! > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error handling
Hi everybody, I hope u can help me with this. This file should give me an error msg that there is time-out coz of the loop. But it's not giving me anything. What could be the problem? Thx a lot FATAL [$errno] $errstr\n"; echo " Fatal error in line ".$errline." of file ".$errfile; echo ", PHP ".PHP_VERSION." (".PHP_OS.")\n"; echo "Aborting...\n"; exit (1); break; case ERROR: echo "ERROR [$errno] $errstr\n"; break; case WARNING: echo "WARNING [$errno] $errstr\n"; break; default: echo "Unkown error type: [$errno] $errstr\n"; break; } } // function to test the error handling function scale_by_log ($vect, $scale) { if ( !is_numeric($scale) || $scale <= 0 ) trigger_error("log(x) for x <= 0 is undefined, you used: scale = $scale", FATAL); if (!is_array($vect)) { trigger_error("Incorrect input vector, array of values expected", ERROR); return null; } for ($i=0; $i -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron: No such file or directory
Actually, /usr/lib/php is a directory most likely. You need to make sure you compiled the binary at compile time, and then (on Linux) it would be installed to /usr/local/bin/php. Thanks, - Original Message - From: "Marek Kilimajer" <[EMAIL PROTECTED]> To: "PHP" <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 5:42 AM Subject: Re: [PHP] cron: No such file or directory > Cron doesn't have the same enviroment like normal shell, so it knows > nothing about $HOME, you need to use full path. > > Edgard Berendsen wrote: > > >I'm trying to do a cronjob. > >If I'm right I should have a php file with > >#!/usr/lib/php -q > >at the beginning and a cronjob like > > > >MAILTO="[EMAIL PROTECTED]" > >0 * * * * /usr/lib/php/ $HOME/myfile.php > > > >whereis php tells me: > >php: /usr/lib/php /usr/include/php > > > >What's wrong? > > > >At the beginning when I tried with other paths like /usr/bin/php I received > >a mail > >with 'No such file or directory' error, now I don't receive anything! > >Even I change to the old /usr/bin/php wrong dir and I still receive > >nothing!!! > > > > > > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] remembering variables between many forms.
Hello friends. Pls excuse me if this is too simple a question. I have a mysql database running with PHG scripts for member registration, find members etc which is running well. Now I want to make a system to send the username and passwords to members if they have lost them. the way I am doing it is : when the user logs in on the 1st page with his email address, I take him to the second page where I ask the favourite question from the database for which he must answer, then I check that the answer is correct in a third page and send his email. My problem is that I do not know how to remember the variable between the 1st and the third page. I can manage between two pages but not between three pages. Can someone help how I can remember the email address between the above three pages? Thanks very much Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] remembering variables between many forms.
On Monday 03 June 2002 19:33, Denis L. Menezes wrote: > Pls excuse me if this is too simple a question. > > I have a mysql database running with PHG scripts for member registration, > find members etc which is running well. Now I want to make a system to send > the username and passwords to members if they have lost them. > > the way I am doing it is : when the user logs in on the 1st page with his > email address, I take him to the second page where I ask the favourite > question from the database for which he must answer, then I check that the > answer is correct in a third page and send his email. My problem is that I > do not know how to remember the variable between the 1st and the third > page. I can manage between two pages but not between three pages. You don't need to 'remember' the variable between the 1st page and the 3rd page. > Can someone help how I can remember the email address between the above > three pages? You pass the variable(s) from the 1st page to the 2nd page. Then again from the 2nd to the 3rd. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* All men know the utility of useful things; but they do not know the utility of futility. -- Chuang-tzu */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Writing IPTC tags
Hi all, Just wanted to know if it's possible to write iptc tags with php, and, if so, how? I can read them trough getimagesize(). TIA, Dirk Bean IT T: +31 (0)23 - 5422299 F: +31 (0)23 - 5422728 W: http://www.bean-it.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with compiling php-4.2.1 on solaris 2.7
Hi All , I am having some problems with compiling the latest version of the source code on a solaris box The initial configure runs fine but when I go for the make this is what happens. make Making all in Zend make[1]: Entering directory `/root/php-4.2.1/Zend' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/root/php-4.2.1/Zend' Making all in main make[1]: Entering directory `/root/php-4.2.1/main' make[2]: Entering directory `/root/php-4.2.1/main' make[2]: Nothing to be done for `all-p'. make[2]: Leaving directory `/root/php-4.2.1/main' make[1]: Leaving directory `/root/php-4.2.1/main' Making all in ext make[1]: Entering directory `/root/php-4.2.1/ext' Making all in ctype make[2]: Entering directory `/root/php-4.2.1/ext/ctype' make[3]: Entering directory `/root/php-4.2.1/ext/ctype' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/ctype' make[2]: Leaving directory `/root/php-4.2.1/ext/ctype' Making all in mysql make[2]: Entering directory `/root/php-4.2.1/ext/mysql' Making all in libmysql make[3]: Entering directory `/root/php-4.2.1/ext/mysql/libmysql' make[4]: Entering directory `/root/php-4.2.1/ext/mysql/libmysql' make[4]: Nothing to be done for `all-p'. make[4]: Leaving directory `/root/php-4.2.1/ext/mysql/libmysql' make[3]: Leaving directory `/root/php-4.2.1/ext/mysql/libmysql' make[3]: Entering directory `/root/php-4.2.1/ext/mysql' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/mysql' make[2]: Leaving directory `/root/php-4.2.1/ext/mysql' Making all in pcre make[2]: Entering directory `/root/php-4.2.1/ext/pcre' Making all in pcrelib make[3]: Entering directory `/root/php-4.2.1/ext/pcre/pcrelib' make[4]: Entering directory `/root/php-4.2.1/ext/pcre/pcrelib' make[4]: Nothing to be done for `all-p'. make[4]: Leaving directory `/root/php-4.2.1/ext/pcre/pcrelib' make[3]: Leaving directory `/root/php-4.2.1/ext/pcre/pcrelib' make[3]: Entering directory `/root/php-4.2.1/ext/pcre' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/pcre' make[2]: Leaving directory `/root/php-4.2.1/ext/pcre' Making all in posix make[2]: Entering directory `/root/php-4.2.1/ext/posix' make[3]: Entering directory `/root/php-4.2.1/ext/posix' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/posix' make[2]: Leaving directory `/root/php-4.2.1/ext/posix' Making all in session make[2]: Entering directory `/root/php-4.2.1/ext/session' make[3]: Entering directory `/root/php-4.2.1/ext/session' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/session' make[2]: Leaving directory `/root/php-4.2.1/ext/session' Making all in standard make[2]: Entering directory `/root/php-4.2.1/ext/standard' make[3]: Entering directory `/root/php-4.2.1/ext/standard' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/standard' make[2]: Leaving directory `/root/php-4.2.1/ext/standard' Making all in xml make[2]: Entering directory `/root/php-4.2.1/ext/xml' Making all in expat make[3]: Entering directory `/root/php-4.2.1/ext/xml/expat' make[4]: Entering directory `/root/php-4.2.1/ext/xml/expat' make[4]: Nothing to be done for `all-p'. make[4]: Leaving directory `/root/php-4.2.1/ext/xml/expat' make[3]: Leaving directory `/root/php-4.2.1/ext/xml/expat' make[3]: Entering directory `/root/php-4.2.1/ext/xml' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/ext/xml' make[2]: Leaving directory `/root/php-4.2.1/ext/xml' make[1]: Leaving directory `/root/php-4.2.1/ext' Making all in sapi make[1]: Entering directory `/root/php-4.2.1/sapi' Making all in apache make[2]: Entering directory `/root/php-4.2.1/sapi/apache' make[3]: Entering directory `/root/php-4.2.1/sapi/apache' make[3]: Nothing to be done for `all-p'. make[3]: Leaving directory `/root/php-4.2.1/sapi/apache' make[2]: Leaving directory `/root/php-4.2.1/sapi/apache' make[1]: Leaving directory `/root/php-4.2.1/sapi' Making all in TSRM make[1]: Entering directory `/root/php-4.2.1/TSRM' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/root/php-4.2.1/TSRM' Making all in regex make[1]: Entering directory `/root/php-4.2.1/regex' make[2]: Entering directory `/root/php-4.2.1/regex' make[2]: Nothing to be done for `all-p'. make[2]: Leaving directory `/root/php-4.2.1/regex' make[1]: Leaving directory `/root/php-4.2.1/regex' Making all in . make[1]: Entering directory `/root/php-4.2.1' /bin/sh /root/php-4.2.1/libtool --silent --mode=link gcc -I. -I/root/php-4.2.1/ -I/root/php-4.2.1/main -I/root/php-4.2.1 -I/www/include -I/root/php-4.2.1/Zend -I/root/php-4.2.1/ext/mysql/libmysql -I/root/php-4.2.1/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=270 -DUSE_EXPAT -I/root/php-4.2.1/TSRM -g -O2 -prefer-pic -o libphp4.la -rpath /root/php-4.2.1/libs -avoid-version -L/usr/ucblib -R /usr/ucblib stub.lo Zen
[PHP] PHP & Hex Numbers
I would think that if $a were a number that echo $a; and printf('%d', $a); would produce the same output. Is this correct? Either I'm missing something, or PHP gets very confused when dealing with some numbers. For example, the following program produces 2654435769 -1640531527 I get the same kind of unexpected results when doing arithmetic on such numbers. Is this tickling some kind of known bug in PHP? or am I misunderstanding something? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Nothing will execute after calling imagejpeg.
You can't use echo or print in your image - you have to use ImageTTFText or ImageString or any other Image function. If you go to PHP.net and search the Image functions you should be able to find some helpful things that you can use. You also have to initialize your colors with ImageColorAllocate. I have a meeting until about 1:00, but if you're still having problems let me know and I can email you some example code this afternoon. -Natalie -Original Message- From: Kris Johnson [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 01, 2002 11:11 PM To: Leotta, Natalie (NCI/IMS) Subject: Nothing will execute after calling imagejpeg. Hello, My name is Kris Johnson. I 'm hoping you can give me some direction on a problem I am having. After calling imagejpeg nothing else will work. I have tried echoing html, echoing just a word in quotes, as well as a using a location header. I do not get any errors or warnings, but whatever command I use simply doesn't work. As a test I remarked imagejpeg out of the code and as soon as I did this the commands after worked fine. I tried changing the filetype to png but still get the same problem. Have a nice day Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP & Hex Numbers
"Jonathan Rosenberg" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > would produce the same output. Is this correct? Theoretically... > > Either I'm missing something, or PHP gets very confused when > dealing with some numbers. For example, the following program > > $result = 0x9E3779B9; > echo $result > printf('%d', $result); > ?> > > produces > > 2654435769 > -1640531527 > > I get the same kind of unexpected results when doing arithmetic > on such numbers. > > Is this tickling some kind of known bug in PHP? or am I > misunderstanding something? It's not a bug, just an 'inconsistency'. Both are correct... if you have a calculator that supports hex, type both those results in and convert to hex. Both should say 9E3779B9. The first result treats 9E3779B9 as an unsigned 32-bit value, the second result treats it as a _signed_ 32-bit value. If you use printf('%u', $result); (assuming PHP supports the full range of C printf() format specifiers), it should print out 2654435769 as does the straight echo. It seems echo treats numbers as unsigned... When doing arithmetic in code, you should always be prepared to handle signed and unsigned. -- _ _ o oJason Teagle < [EMAIL PROTECTED] v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 3 Jun 2002 13:27:18 -0000 Issue 1383
php-general Digest 3 Jun 2002 13:27:18 - Issue 1383 Topics (messages 100356 through 100392): Newbie Question - InstallShield PHP Installation with PWS 100356 by: Jesse Segovia Re: 'Pure' php vs 'mixed' (html + php) 100357 by: Bogdan Stancescu 100358 by: Michael Davey 100359 by: Bogdan Stancescu 100363 by: Bogdan Stancescu 100381 by: Jason Teagle Re: Setting PHP Include Dir 100360 by: Bogdan Stancescu Re: simple email validation ereg 100361 by: Manuel Lemos 100365 by: Jason Wong session security 100362 by: Giancarlo Pinerolo Re: Include question 100364 by: Analysis & Solutions Re: Determine overhead of PHP script. 100366 by: Analysis & Solutions 100367 by: Rasmus Lerdorf Code dilema --> '".NULL."' or '.NULL.' or ... 100368 by: Ricardo Fitzgerald 100369 by: Jason Wong preg_match_all href|src function 100370 by: Michael Elms Re: still running the old version after recompiling?? 100371 by: savaidis 100375 by: Jason Wong 100378 by: savaidis process php script at regular intervals 100372 by: daniel cozzolino 100373 by: Justin French 100374 by: Michael Hall Re: No such file or directory 100376 by: Edgard Berendsen 100383 by: Marek Kilimajer 100385 by: mike echoing two varibles(newbie) 100377 by: webmaster.tececo.com 100379 by: Jason Teagle Re: newbie help please 100380 by: Jason Teagle php_mssql.dll extension problem 100382 by: Todor Stoyanov Error handling 100384 by: Alia Mikati remembering variables between many forms. 100386 by: Denis L. Menezes 100387 by: Jason Wong Writing IPTC tags 100388 by: Dirk Bonenkamp - Bean IT problem with compiling php-4.2.1 on solaris 2.7 100389 by: Moussa Dahadha PHP & Hex Numbers 100390 by: Jonathan Rosenberg 100392 by: Jason Teagle Re: Nothing will execute after calling imagejpeg. 100391 by: Leotta, Natalie (NCI/IMS) Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- Here's a newbie question. I installed the Windows CGI InstallShield version of PHP to use with the MS Personal Web Server I already have working perfectly on my system. On restarting my PC and trying a very simple php script, I get the error at the bottom of this email. Unfortunately there isn't much help for the InstallShield version of PHP on the web site. I'd rather get this version working rather than install the manual version. Can anyone help? Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. For more information as to why this behaviour exists, see the manual page for CGI security. For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page. --- End Message --- --- Begin Message --- I fell for this some time ago - but the trick is that 1. You don't do for ($i=0; $i<999; $i++) { echo "Line $i\n"; } in real life - you do stuff, call object methods, run queries, whatever, and in between those you have both html and php - and the remote machine waits for you to do all the "extra" stuff and _then_ waits for you to switch in and out of php for several times. I'm thinking about switching in and out of php in a "really-mixed" context - such as having blocks of html inside if() and while() blocks, stuff like that where you get to parse quite a number of php tags. 2. Your server doesn't only serve one client at a time - I'm surprised that you're starting with commercial sites and this piece of information isn't *always* present in your mind. However, as I said in my original mail, "there's an urban legend saying that [...] I don't know if that's true". So... I don't know if it actually slows things down or not. Bogdan Marcelo Leitner wrote: >On Mon, Jun 03, 2002 at 03:16:10AM +0300, Bogdan Stancescu wrote: > > >>2. Speed >>There's an urban legend saying that switching php tags on and off would >>slow parsing down. I don't know if that's true and try to write "pure" >>php as you call it due to the first reason. >> >> > >I don't mind about this.. I'm starting with comercial pages now and before that >I noted that any script you run at the server, you will only see this latency >if the output is buffered or you have a ultra-fast machine with a >super-powerfull navigator that can renderize the page before it's ful
Re: [PHP] simple email validation ereg
So sprach Jason Wong am 2002-06-03 um 12:10:29 +0800 : > The lack of an MX record doesn't necessarily mean mail will not get through, > so you cannot use that as a test for whether the address is valid. It will not? Do you have an example? How is a mail server supposed to know where the mail should be delivered if there's no MX? Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.iso-top.de |Jabber: [EMAIL PROTECTED] iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 21 hours 18 minutes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 'Pure' php vs 'mixed' (html + php)
>> Imagine you have a page where, if a password passed from another page is >> correct, you want to show some data on the Web page, but if the password is >> incorrect you want to show a warning and under no circumstances let them see >> the data. If you used mixed, they could simply read the source of the page >> to see that data... but with pure, the only source on the page is what PHP >> actually prints out, so they won't see anything they shouldn't. > >No becose I'll not check the password when I'm going to display the data.. >I'll check it right after the post, and if it's invalid, I redirect the user >to another page, or prints a block and exits the script.. Ignore my previous comment, I was incorrect - they won't see the sensitive data with PHP. PHP parsing (I discover) ensures that the HTML mixed between PHP blocks gets treated as if it had been echoed or printed by PHP, and thus does not appear if the 'if' test fails. Sorry to have misled you (I learned something today!). -- _ _ o oJason Teagle < [EMAIL PROTECTED] v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP & Hex Numbers
-Original Message- > From: Jason Teagle [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 03, 2002 9:27 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: PHP & Hex Numbers > When doing arithmetic in code, you should always be > prepared to handle signed and unsigned. Thanks for the reply. I figured something like this was going on. But, how does one become "prepared" to handle signed & unsigned integers? Is PHP consistent regarding signed/unsigned when it does arithmetic on integers? > -- > > _ _ > o oJason Teagle > < [EMAIL PROTECTED] > v > -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP & Hex Numbers
- Original Message - From: "Jonathan Rosenberg" <[EMAIL PROTECTED]> To: "Jason Teagle" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 3:18 PM Subject: RE: [PHP] Re: PHP & Hex Numbers > > When doing arithmetic in code, you should always be > > prepared to handle signed and unsigned. > > Thanks for the reply. I figured something like this was going > on. > > But, how does one become "prepared" to handle signed & unsigned > integers? Is PHP consistent regarding signed/unsigned when it > does arithmetic on integers? I don't know the answer to that question (yet). What I meant was, we should always be thinking about numbers possibly being negative when treated as signed (which I believe is the default when using numbers for arithmetic), and if necessary account for it. For example, testing if $result < 0 would alert us to the fact that it is probably too large for a signed 32-bit integer, and needs special handling. I don't know if PHP supports a larger integer type (64 bits, for example) - if it does, that helps since you can cast to that type to ensure it is added correctly. _ _ o oJason Teagle < [EMAIL PROTECTED] v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] building php --with-imap problems
Hi there, I am new to imap and I am trying to build php with imap. Therfore I have to figure out how to install the c-library from the wahington university. the php.net page says this is required. The docu tells me this: 1) Look in imap-2001/Makefile and find your system type code, e.g. slx for glibc Linux and/or Linux with shadow password security. 3) Install the POP2 daemon (ipopd/ipop2d), the POP3 daemon (ipopd/ipop3d), and the IMAP daemon (imapd/imapd) on a system directory of your choosing. 5) Update /etc/inetd.conf to invoke the POP2, POP3, and IMAP daemons on their associated services. This is pretty generic. - Where do I obtain ipopd/ipop2d and so on. I am on suse72 this is the - second point... I cant find this system in Makefile. - What do I have to enter in /etc/inetd.conf ? Thanx for any help, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'Pure' php vs 'mixed' (html + php)
On Dom 02 Jun 2002 21:45, David Freeman wrote: > > I've noticed that many people on the list code in 'pure' php, i.e. > > > > > print ""; > > > > // etc > > ?> > > Personally, it depends on what I'm doing. I find that excessive use of > in my code gets distracting so if I need a lot of php code I > will usually put the straight html into echo/print strings. If I'm > doing something that is predominantly html with only a few php variables > or some such then I'll do it mostly in html. > > Often if there's just a php code block I'll move it into an include and > then just include it in normal html. This helps readability and lets me > separate some of the layout aspects from the code logic aspects. > > In the end if it's valid it will work. My only real decision is based > on readability for my own purposes. See the HTML template class that comes with PEAR! Saludos... :-) -- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? - Martín Marqués |[EMAIL PROTECTED] Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] opendir security hole
On Thu, May 23, 2002 at 11:23:42AM -0400, Analysis & Solutions wrote: > On Thu, May 23, 2002 at 11:22:28PM +1000, daniel wrote: > > dir=../../../../ it will show you the root dir of the server , how can i > > Before passing the $Dir variable to the file functions, clean it up... > >$Dir = preg_replace('/..\//', '', $Dir); The initial poster just wrote me off list with a follow up question. Here's my reply Hi: > $dir = preg_replace('/..\//', '', $dir); Hmm. I must have been tired when I wrote that. "." matches any character. Thus "..\/" will match any two characters before a "/". I should have escaped the periods. That should have been $dir = preg_replace('/\.\.\//', '', $dir); Sorry. Now, you are also attempting to strip ".." via a whole separate regex. > $dir = preg_replace('..', '', $dir); First, that expression isn't encapsulated in the "/" delimiters, thus it's an invalid preg expression. Second, as in my first regex, you didn't escape the "." Third, you can do it in the initial expression. $dir = preg_replace('/\.\.\/?/', '', $dir); That translates to find any string that has two periods and maybe one forward slash. Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple email validation ereg
On Monday 03 June 2002 21:35, Alexander Skwar wrote: > So sprach Jason Wong am 2002-06-03 um 12:10:29 +0800 : > > The lack of an MX record doesn't necessarily mean mail will not get > > through, so you cannot use that as a test for whether the address is > > valid. > > It will not? Do you have an example? How is a mail server supposed to > know where the mail should be delivered if there's no MX? For domains without an MX record the MTA should try to deliver to the IP address. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* E.T. GO HOME!!! (And take your Smurfs with you.) */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Probs with MIME multipart/alternative generated with PEAR mime.php
Hi, I just don't know enough about MIME encoded email to figure this problem out. I'm using a PHP script (mime.php from the Pear library) to automate the sending of an HTML newsletter to my subscribers. The email the script dishes out has mixed results. Some of my users have the email rendered fine in there client, others receive a corrupted email with the headers bleading into the body. To further complicate the matter, this is not an issue related to a particular email client, as users using identical clients on identical platforms have either had proper results or not. My hunch is that the problem originates from either my MTA, or the script itself. But, I just don't know enough about MIME multipart/alternative to diagnos the problem. A raw version of the email is below. Any MIME gurus out there? Thanks, mike >From [EMAIL PROTECTED] Mon Jun 3 05:27:54 2002 Return-Path: <[EMAIL PROTECTED]> Delivered-To: [EMAIL PROTECTED] Received: by flag.blackened.net (Postfix, from userid 65534) id 1E5B26702; Mon, 3 Jun 2002 05:27:54 -0700 (PDT) To: [EMAIL PROTECTED] Subject: ise-news 018 :: June 2002 MIME-Version: 1.0 From: [EMAIL PROTECTED] Status: Content-Type: multipart/alternative; boundary="=_f74fc4c7192d1983b9f144709175f8eb" Message-Id: <[EMAIL PROTECTED]> Date: Mon, 3 Jun 2002 05:27:54 -0700 (PDT) --=_f74fc4c7192d1983b9f144709175f8eb Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Your email client is unable to display this issue of ise-news. Most likely this is because your email client cannot read HTML. To change your ise-news subscription to the text version, go to: http://www.social-ecology.org/ise-news/change.php?id=d963dfb04befe0df8673367 050c9ad8d To unsubscribe, go to: http://www.social-ecology.org/ise-news/unsubscribe.php?id=d963dfb04befe0df86 73367050c9ad8d --=_f74fc4c7192d1983b9f144709175f8eb Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ise-news June 2002 http://www.social-eco= logy.org/images/ise-news/logo.gif" width=3D"181" height=3D"65" alt=3D"ISE N= ews">018<= /FONT> June 2002Instit= ute for Social Ecology Electronic Newsletterhttp://www.social-ecology.org/images/i= se-news/bar.gif" width=3D"319" height=3D"5" alt=3D" ">In this Issue: David Rovics and Seth Tobocman Bene= fit Show Politics For The Future<= /A> Renewing the Anarchist Traditio= n Support / Subscribe to Harbinge= r Upcoming Events http://www.social-eco= logy.org/images/ise-news/sw.gif" width=3D"11" height=3D"11" alt=3D" ">= http://www.social-ecology.org/ima= ges/ise-news/se.gif" width=3D"11" height=3D"11" alt=3D" "> http://www.soc= ial-ecology.org/images/ise-news/b_nw.gif" width=3D"11" height=3D"11" alt=3D= " ">http://www.social-ecology.org/images/ise-n= ews/b_ne.gif" width=3D"11" height=3D"11" alt=3D" ">David Rov= ics and Seth Tobocman Benefit ShowWorld renowned political folksinger David Rovics and political cartoonis= t Seth Tobocman will be playing a benefit show on Thursday June 6th to help= raise scholarship money for students at the Institute for Social Ecology.<= /Font>=20 When<= /b>: June 6th at 7:30pm Where: Plainfield VT, Town Hall Donation: Sliding scale $5-20, no one will be turned away David Ro= vics is a folksinger of the rabble-rousing variety. He has become something= of a fixture in the North American protest scene, performing at demonstrat= ions throughout the continent, as well as in Prague, Quebec City and many o= thers. David has shared the stage with the likes of Pete Seeger, Michael Mo= ore, Billy Bragg, and Ralph Nader. David sings original songs about the var= ious struggles of the day, combining accomplished bluegrass-style flat-pick= ing with incisive lyrics. His fifth CD, Living In These Times, inclu= des songs about the September 11th tragedy in New York City as well as many= songs focusing on the evils of US foreign policy. "Listen = to David Rovics..." --Pete Seeger=20 Seth Tob= ocman, a comic book artist and revolutionary, has been involved in the anti= -war movement, NYC=92s squatters=92 movement, and now in the movement for g= lobal justice. His performances have inspired activists from NYC to Prague= . Tobocman has been publishing the radical comic book World War Three since 1979 and has authored two books, You Don=92t Have to Fuck People= Over To Survive and War in the Neighborhood. Tobocman has worke= d as an illustrator for the New York Times and his work has been use= d on posters by peoples=92 movements around the world. "It has = always been the function of artists to turn suffering and struggle into som= ething beautiful, to derive meaning from experience." --Seth Tobocman The Inst= itute for Social Ecology is twenty-five year-old independent institution of= higher education dedicated to the study of social ecology, which is an int= erdisciplinary field drawing on
[PHP] Re: No such file or directory
I have a web-hosting and they gave me ssh2 acces. There I can run lynux commands with no problems. I don't find php.exe for exectuting the script. Can I upload a php.exe to the server and run it without any other file from php? What can I do? "Edgard Berendsen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm trying to do a cronjob. > If I'm right I should have a php file with > #!/usr/lib/php -q > at the beginning and a cronjob like > > MAILTO="[EMAIL PROTECTED]" > 0 * * * * /usr/lib/php/ $HOME/myfile.php > > whereis php tells me: > php: /usr/lib/php /usr/include/php > > What's wrong? > > At the beginning when I tried with other paths like /usr/bin/php I received > a mail > with 'No such file or directory' error, now I don't receive anything! > Even I change to the old /usr/bin/php wrong dir and I still receive > nothing!!! > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Probs with MIME multipart/alternative generated with PEAR mime.php
i've been doing a bit of mime lately. not with pear but with my own scripts. just a suggestion - does it matter that you have the From below the Mime-Version? and also allowed another CRLF after the first boundary. those CRLF's are a killer! btw - i find outlook some help because it bolds the headers. what if you changed it to something like: > From [EMAIL PROTECTED] Mon Jun 3 05:27:54 2002 > Return-Path: <[EMAIL PROTECTED]> > Delivered-To: [EMAIL PROTECTED] > Received: by flag.blackened.net (Postfix, from userid 65534) > id 1E5B26702; Mon, 3 Jun 2002 05:27:54 -0700 (PDT) > To: [EMAIL PROTECTED] > From: [EMAIL PROTECTED] > Subject: ise-news 018 :: June 2002 > Status: > MIME-Version: 1.0 > Content-Type: multipart/alternative; > boundary="=_f74fc4c7192d1983b9f144709175f8eb" > Message-Id: <[EMAIL PROTECTED]> > Date: Mon, 3 Jun 2002 05:27:54 -0700 (PDT) > > --=_f74fc4c7192d1983b9f144709175f8eb > Content-Type: text/plain; charset="iso-8859-1" > Content-Transfer-Encoding: 7bit > cheers Henry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] converting www's to links in text fields...
Hi there, i am currently going nuts, because i want to parse a string, so that any "www." and "http://"; becomes a real link. I think i kept thinking about this way too long, so that i ended up with quite a huge function. Is there any easy way to get all the www. and http:// links from a string? Thanks, Duncan
[PHP] php4win.com
I originally posted this to the PHP-WIN list but there doesn't seem to be anyone there... maybe you guys can help? Does anyone know what has happened to the php4win.com web-site? I have been trying to get there now for the best part of a month and still get site errors. regards, Mikey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Are we getting spammed?
I just got something call ise-news, and the bottom it saying it mail from -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Are getting spammed? Or it this for real? This is from the e-mail. --=_f74fc4c7192d1983b9f144709175f8eb Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Your email client is unable to display this issue of ise-news. Most likely this is because your email client cannot read HTML. To change your ise-news subscription to the text version, go to: http://www.social-ecology.org/ise-news/change.php?id=d963dfb04befe0df8673367 050c9ad8d To unsubscribe, go to: http://www.social-ecology.org/ise-news/unsubscribe.php?id=d963dfb04befe0df86 73367050c9ad8d Chuck Payne Magi Design and Support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php to generate statiscs
Does anybody knows the link to this article or other that treats something like this. I couldn;t find it in devshed. Rodrigo on 6/2/02 3:57 PM, John Holmes at [EMAIL PROTECTED] wrote: > Look into cross-tab queries (I think that's what they are called). There > is a good article on Devshed.com about it. You can do a query like this > > SELECT SUM(IF(Gender='M'),1,0)) AS Male, SUM(IF(Gender='F',1,0)) AS > Female FROM table > > That'll give you two columns, one named Male, one named Female, in the > result set. The result set will have one row, containing the number of > males in the database in the Male column, the number of females in the > database in the second. > > You could probably do the majority of your "statistic" queries this way. > > ---John Holmes... > >> -Original Message- >> From: Rodrigo Peres [mailto:[EMAIL PROTECTED]] >> Sent: Sunday, June 02, 2002 2:02 PM >> To: [EMAIL PROTECTED] >> Subject: [PHP] php to generate statiscs >> >> Hi list, >> >> Sorry if this is a off-topic, but I really don't know where to begin. > I >> have a mysql database with about 20.000 records, now I need to build a >> statistics panel to show for example how many of this record are male, >> female, lives in determinated city, school graduation etc, everything >> grouped by sex and alone too, present the respectives percentages > etc... >> How do I begin??? Can someone help?? >> >> thank's in advance >> >> Rodrigo Peres >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php > > -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] delete file contents before writing?
Not sure how I could do this as I could not find a functions on php.net to allow me to first delete the entire contents of a file "before" writting the changes supplied by a textarea. Here is what I have thus far: Page one - Form: Page two - open file and write changes: As of right now it opens the file and writes your changes, however it simply goes to the end of the file then begins writting. I would like to delete the contents of the file, then write the changes. Any help or pointers are appreciated! Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] converting www's to links in text fields...
> i am currently going nuts, because i want to parse a string, so that > any "www." and "http://"; becomes a real link. Perhaps your insanity has kept you from learning about Google's newsgroup archives? The PHP general list is at http://groups.google.com/groups?hl=en&safe=off&group=php.general This question has been asked and answered TONS of times. Here's an answer I posted back in Nov 2000: http://groups.google.com/groups?selm=3A248B2C.13ED233C%40analysisandsolutions.com While that one doesn't convert things that just start with "www," you can tweak it to do so. Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] delete file contents before writing?
On Monday 03 June 2002 23:37, Jas wrote: > Not sure how I could do this as I could not find a functions on php.net to > allow me to first delete the entire contents of a file "before" writting > the changes supplied by a textarea. Here is what I have thus far: [snip] > As of right now it opens the file and writes your changes, however it > simply goes to the end of the file then begins writting. I would like to > delete the contents of the file, then write the changes. > Any help or pointers are appreciated! Read the manual entry for fopen() and see what it says about the 'w' flag. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Money can't buy love, but it improves your bargaining position. -- Christopher Marlowe */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: delete file contents before writing?
$file_open = fopen($file_name, "w"); this will empty the existing file contents then write to the file "Jas" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Not sure how I could do this as I could not find a functions on php.net to > allow me to first delete the entire contents of a file "before" writting the > changes supplied by a textarea. Here is what I have thus far: > Page one - Form: > $file_name = 'blank.php'; > $open_file = fopen("$file_name","rw"); > if (!$open_file) { > die("cannot open $file_name"); > } else { > $read_file = fread($open_file, filesize($file_name)); > $strip_php = eregi_replace("<","&a&", $read_file); > fclose($open_file); > } > ?> > >?> > > > > Page two - open file and write changes: > if (!$passwords) { > header ("Location: index.php"); > } else { > $file_name= "blank.php"; > $file_open = fopen($file_name, "r+"); > eregi_replace("&a&","<", $file_open); > #eregi_replace("\","", $file_open); > fwrite($file_open, $passwords); > print ("$passwords was written to $file_name"); } > ?> > As of right now it opens the file and writes your changes, however it simply > goes to the end of the file then begins writting. I would like to delete > the contents of the file, then write the changes. > Any help or pointers are appreciated! > Jas > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] delete file contents before writing?
If you really want to delete the file contents then open the file in write-only mode, like so: $open_file = fopen("$file_name","w"); -Naintara -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] t]On Behalf Of Jas Sent: Monday, June 03, 2002 8:37 AM To: [EMAIL PROTECTED] Subject: [PHP] delete file contents before writing? Not sure how I could do this as I could not find a functions on php.net to allow me to first delete the entire contents of a file "before" writting the changes supplied by a textarea. Here is what I have thus far: Page one - Form: Page two - open file and write changes: As of right now it opens the file and writes your changes, however it simply goes to the end of the file then begins writting. I would like to delete the contents of the file, then write the changes. Any help or pointers are appreciated! Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.363 / Virus Database: 201 - Release Date: 05/21/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.363 / Virus Database: 201 - Release Date: 05/21/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php.ini question
When setting doc_root in the php.ini section, should that be the cgi-bin directory, or the doc-root of the webserver, i.e. htdocs..? Thanks, Taylor Taylor Lewick Unix System Administrator Fortis Benefits 816 881 6073 "Help Wanted. Seeking Telepath..." "You Know where to apply." Please Note The information in this E-mail message is legally privileged and confidential information intended only for the use of the individual(s) named above. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender. Thank you * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question regarding :: syntax
According to the CHM manual: "Sometimes it is useful to refer to functions and variables in base classes or to refer to functions in classes that have not yet any instances.: Using parent::foo() works fine but I am having problems getting the variable part of this to work. For Example: class A { var $b A() { $b = "something"; } } class B extends A { B() { echo parent::$b // this is the problem } } Is there not a way to refer directly to the parent properties? Or do i have to setup a get function for every parent var that I want to access. Thanks -Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CHM Form Of PHP Manual? (Was: [PHP] Question regarding :: syntax)
- Original Message - From: "Jared Boelens" <[EMAIL PROTECTED]> To: "php list" <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 5:06 PM Subject: [PHP] Question regarding :: syntax > According to the CHM manual: There's a CHM form of a PHP manual? * bounce, bounce *Where could I get it from? I find self-contained help files s much easier... _ _ o oJason Teagle < [EMAIL PROTECTED] v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] changed behavior of shutdown-registered function in 4.0.x->4.1.x (conn. handling)
Hi again, Joseph answered this on the dev list (http://lists.php.net/article.php?group=php.dev&article=84800), thanks. Arpi On Monday 03 June 2002 17:57, you wrote: > Hi, > I use register_shutdown_function to regenerate my content-cache's > data after the old page were sent. In 4.0.6 there was no problem > with it, the connection was closed after the normal script is > finished, and before the shutdown_registered function is started > (which does the real work). So I could use it for gaining a "fake" > speed in delivering pages, and it really made our system faster > because only one process can regenerate the page in a time, the > others simply return the old content. > > But unfortunatelly this doesn't work since 4.1.x, because after the > normal script finishes it still holds the "line". It doesn't close > the connection, so the browser is still waiting for data (and the > http process is being held too). > Is there any php.ini setting or switch for configure that I can use > for turning off this behavior? Or is there any other reason why it > works this way for me? If I copy the old (4.0.6) php module over > the new one (4.1.1) it works fine. > For the dev list: Is there any real reason for this way of > connection handling, or it's just a side-effect of some other > featuer? > > Thanks for your help, > Arpi > > p.s.:sorry for mailing this to the dev list too, but I don't know > where can I find somebody who can help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php to generate statiscs
First article under MySQL... http://www.devshed.com/Server_Side/MySQL/MySQLWiz/page1.html ---John Holmes... > -Original Message- > From: Rodrigo Peres [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 03, 2002 11:34 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] php to generate statiscs > > Does anybody knows the link to this article or other that treats something > like this. I couldn;t find it in devshed. > > Rodrigo > > > on 6/2/02 3:57 PM, John Holmes at [EMAIL PROTECTED] wrote: > > > Look into cross-tab queries (I think that's what they are called). There > > is a good article on Devshed.com about it. You can do a query like this > > > > SELECT SUM(IF(Gender='M'),1,0)) AS Male, SUM(IF(Gender='F',1,0)) AS > > Female FROM table > > > > That'll give you two columns, one named Male, one named Female, in the > > result set. The result set will have one row, containing the number of > > males in the database in the Male column, the number of females in the > > database in the second. > > > > You could probably do the majority of your "statistic" queries this way. > > > > ---John Holmes... > > > >> -Original Message- > >> From: Rodrigo Peres [mailto:[EMAIL PROTECTED]] > >> Sent: Sunday, June 02, 2002 2:02 PM > >> To: [EMAIL PROTECTED] > >> Subject: [PHP] php to generate statiscs > >> > >> Hi list, > >> > >> Sorry if this is a off-topic, but I really don't know where to begin. > > I > >> have a mysql database with about 20.000 records, now I need to build a > >> statistics panel to show for example how many of this record are male, > >> female, lives in determinated city, school graduation etc, everything > >> grouped by sex and alone too, present the respectives percentages > > etc... > >> How do I begin??? Can someone help?? > >> > >> thank's in advance > >> > >> Rodrigo Peres > >> > >> > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] CHM Form Of PHP Manual? (Was: [PHP] Question regarding :: syntax)
The CHM version of the help file can be downloaded here: http://www.php.net/download-docs.php -Jared -Original Message- From: Jason Teagle [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 12:16 PM To: php list Subject: [PHP] CHM Form Of PHP Manual? (Was: [PHP] Question regarding :: syntax) - Original Message - From: "Jared Boelens" <[EMAIL PROTECTED]> To: "php list" <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 5:06 PM Subject: [PHP] Question regarding :: syntax > According to the CHM manual: There's a CHM form of a PHP manual? * bounce, bounce *Where could I get it from? I find self-contained help files s much easier... _ _ o oJason Teagle < [EMAIL PROTECTED] v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Code dilema --> '".NULL."' or '.NULL.' or ...
> // Add together proper fields to enter birth date > $fecha_nac = $ano_nac + "-" + $mes_nac + "-" + $dia_nac; That's not the correct way to join strings. Use . instead of + > > // Open mysql db > mysql_select_db("intertur"); > > // SQL query insert all data into a table > $query = "insert into RegistroPersonas values > ('".NULL."','".$nombre."', '".$apellido."', '".NULL."', > '".$direccion."', > '".$ciudad."', '".NULL."', '".NULL."', '".$pais."', '".$telefono."', > '".$fax."', '".$email."', '".$login_usuario."', '".$clave."', > '".$fecha_nac."', '".NULL."', '".NULL."' '".$sexo."', '".NULL."', > '".NULL."', '".NULL."', '".NULL."' )"; > > My problem is NOTHING gets inserted !!! > > I filled all empty fields with NULL values > > It connects to the db but does nothing else > // Do query > $result = mysql_query($query); $result = MySQL_query($query) or die(MySQL_error()); That will at least tell you why the query isn't working... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] delete file contents before writing?
Not sure how I could do this as I could not find a functions on php.net to allow me to first delete the entire contents of a file "before" writting the changes supplied by a textarea. Here is what I have thus far: Page one - Form: Page two - open file and write changes: As of right now it opens the file and writes your changes, however it simply goes to the end of the file then begins writting. I would like to delete the contents of the file, then write the changes. Any help or pointers are appreciated! Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] delete file contents before writing?
On Mon, 2002-06-03 at 11:37, Jas wrote: > Not sure how I could do this as I could not find a functions on php.net to > allow me to first delete the entire contents of a file "before" writting the > changes supplied by a textarea. Here is what I have thus far: Just fopen a file with the 'w' mode when you want to clear/truncate it before writing to it. $file_open($file_name,'w'); ... would probably do what you want. Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question regarding :: syntax
On Mon, 2002-06-03 at 12:06, Jared Boelens wrote: > Is there not a way to refer directly to the parent properties? Or do i have > to setup a get function for every parent var that I want to access. Tis my understanding that you cannot refer to class properties without an instance of the class. If I were wrong it would make my life much easier, but I don't believe I am. Regards, Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] echoing two varibles(newbie)
string concat something like this require(contant.$variable."string"); Jim Lucas - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 03, 2002 1:26 AM Subject: [PHP] echoing two varibles(newbie) How can I echo(or include) two variables? ie include $DOCUMENT_ROOT then $row['location'] Thanks in Advance JJ Harrison [EMAIL PROTECTED] www.tececo.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CHM Form Of PHP Manual? (Was: [PHP] Question regarding :: syntax)
- Original Message - From: "Jared Boelens" <[EMAIL PROTECTED]> To: "php list" <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 5:20 PM Subject: RE: [PHP] CHM Form Of PHP Manual? (Was: [PHP] Question regarding :: syntax) > The CHM version of the help file can be downloaded here: > > http://www.php.net/download-docs.php Hmmm... I swear I tried downloading that version (English) before and it didn't work - but it is fine this time. Thanks. _ _ o oJason Teagle < [EMAIL PROTECTED] v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question regarding :: syntax
So am i to understand that i will have to do it in this manner? class A { var $b; A() { } function getB() { return $this->B; } function setB($b) { $this->B = $b; } } class B extends A { B($b) { parent::setB($b); } } $B = new B(); echo $B->getB(); This means writing a get and set function for every property that belongs to the parent. I understand this is how it is done in other languages but the manual is misleading in this case. It explicity says "Sometimes it is useful to refer to functions and variables..". This lead me to believe that you could directly access VARIABLES as well as functions. I guess i was wrong. Oh well, it just means more typing for me, which means more hours, which means more $. -Jared -Original Message- From: Tobyn Baugher [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 12:30 PM To: php list Subject: Re: [PHP] Question regarding :: syntax On Mon, 2002-06-03 at 12:06, Jared Boelens wrote: > Is there not a way to refer directly to the parent properties? Or do i have > to setup a get function for every parent var that I want to access. Tis my understanding that you cannot refer to class properties without an instance of the class. If I were wrong it would make my life much easier, but I don't believe I am. Regards, Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Include and memory
Hi people... I'd like to know if the include function alocates the variables that are in the included file in the memory... and, if it happens, if do I have a way to access a file with some variables without alocating it in memory. Tks... Paulo Cesar
Re: Re[2]: [PHP] A small question - Mysql_insert_id
and you want people to actually ready your books after talking to customers like that. I should burn your book. I thought you were a helping person. If someone has a question and it is obvious that they have no clue about what they are talking about. shouldn't you walk them through it instead of shitting on them and telling them to f*** off? Just an observation Jim Lucas - Original Message - From: "Julie Meloni" <[EMAIL PROTECTED]> To: "r" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, June 01, 2002 8:06 AM Subject: Re[2]: [PHP] A small question - Mysql_insert_id > r> Actually the ID field is not null,primary and auto_increment. > > Well, it has to be of a TYPE as well... > > r> Thanks for the URL but in my message I did quote the line from that same url > r> (http://www.php.net/manual/en/function.mysql-insert-id.php) > > r> I just need to get the ID of the just inserted record. > > I'm just going to assume you're f*cking with all of us and leave it at > that. > > > - Julie > > --> Julie Meloni > --> [EMAIL PROTECTED] > --> www.thickbook.com > > Find "Sams Teach Yourself MySQL in 24 Hours" at > http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question regarding :: syntax
On Mon, 2002-06-03 at 12:45, Jared Boelens wrote: > So am i to understand that i will have to do it in this manner? *SNIP* No no no... B extends A, and you have an instance of B. Just do this: class A { var $b; *snip* } class B { function B($b) { $this->b = $b; } } That will work fine. Regards, Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 'Pure' php vs 'mixed' (html + php)
Sunday, June 02, 2002, 7:55:09 PM, Andre wrote: AD> I've been wondering why code in 'pure' php? Is there some compelling reason AD> (that I'm unaware of) for doing so? Should I rewrite all my earlier code into Andre, Sorry to chime in so late, but IMO, be more concerned with saving output for the last step in execution, because once it's echoed out, there's no turning back or sending headers or a redirect.. Have functions return strings instead of echo them (and take advantage of "<<<" syntax for more readable string building), build up a document into variables, send out at very end. Some home-grown example code might be useful: connect()) { $Template["main_content"] = join('',file("DB_down_message.html",1)); include("main_template.php"); exit(0); } // build result table HTML $result_table = open_result_table(); $dbi->run_query("SELECT .."); while ($row = $dbi->next_row_array()) { $result_table .= << {$row["guns"]} {$row["butter"]} EOD; } $result_table .= "\n"; // load results content $results_copy = join('',file("about_results.html",1)); $Template["main_content"] .= <Point is, at any point in execution cookies or headers can be sent or content changed. You end up with most content in seperate files and script logic/execution very easy to understand/debug. Stick a "watch" echo anywhere in the code and it pops up at the top of the browser window. For the above code, main_template.php is a full HTML document (only HTML editor needed) with PHP tags in just a few spots to echo elements of the $Template array: Bogdan wrote: > There's an urban legend saying that switching php tags on and off would > slow parsing down. Content outside PHP tags gets to skip the parser. From the manual: "..for outputting large blocks of text, dropping out of PHP parsing mode is generally more efficient than sending all of the text through echo() or print() or somesuch." Steve -- [EMAIL PROTECTED] ** http://mrclay.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Speed comparison of PHP vs. PERL (not conclusive)
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Daniel Grace) wrote: > Comments? I was expecting the numbers to be very similiar -- rather shocked > that the PERL ended up being about 2.5x as fast as PHP was. As Rasmus says, one of the things Perl was designed for was speed. The Perl designers really take speed seriously for things like this, because Perl tends to be used for things like looping over a few million lines of text. I resisted Perl for a long time because of its somewhat odd syntax, but the first time I programmed in it seriously, the main thing that wasted my time was that I didn't believe my program was working; I was re-writing a log analysis program; the previous version, in a different language (which did other things very well but wasn't designed for looping at all) took about 6 hours to complete an analysis. It was getting to where I could foresee that the daily log analysis was going to take longer than a day! I couldn't get the Perl program to do anything. It seemed to work on the short test data, but on the full file I'd type the command and it would just drop right back to the command line. Of course the program was working fine--Perl was doing its work almost instantaneously. Each language has its advantages; I tend to use PHP for web pages, but there are times I'd like to easily switch back and forth between PHP and Perl on the same page. Perl makes great filters. Jerry -- http://www.hoboes.com/jerry/ "Give a man a fish and you feed him for a day. Teach him to fish, and you've depleted the lake."--It Isn't Murder If They're Yankees (http://www.hoboes.com/jerry/Murder/) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: 'Pure' php vs 'mixed' (html + php)
On Monday 03 June 2002 01:00 pm, you wrote: > Sunday, June 02, 2002, 7:55:09 PM, Andre wrote: > AD> I've been wondering why code in 'pure' php? Is there some compelling > reason AD> (that I'm unaware of) for doing so? Should I rewrite all my > earlier code into > > Andre, > Sorry to chime in so late, but IMO, be more concerned with > saving output for the last step in execution, because once it's echoed > out, there's no turning back or sending headers or a redirect.. Have > functions return strings instead of echo them (and take advantage of > "<<<" syntax for more readable string building), build up a document > into variables, send out at very end. > > Some home-grown example code might be useful: > > > //setup session, DB, some common functions > require_once("setup_session.php"); > require_once("create_DB_object_instance.php"); > require_once("html_building_functions.php"); > > // start building string array for later output > $Template["title"] = "query results"; > > // if DB problems, load content, output, quit. > if (!$dbi->connect()) { > $Template["main_content"] = > join('',file("DB_down_message.html",1)); > include("main_template.php"); > exit(0); > } > > // build result table HTML > $result_table = open_result_table(); > $dbi->run_query("SELECT .."); > while ($row = $dbi->next_row_array()) { > $result_table .= << > {$row["guns"]} > {$row["butter"]} > > EOD; > } > $result_table .= "\n"; > > // load results content > $results_copy = join('',file("about_results.html",1)); > > $Template["main_content"] .= << Query Results > $result_table > About Results > $results_copy > EOD; > > if (//need to go elsewhere) { > header("Location: http://elsewhere";); > exit(0); > } > > $_SESSION['last_accessed'] = $PHP_SELF; > > setcookie(//something); > > include("main_template.php"); > > ?> > > Point is, at any point in execution cookies or headers can be sent or > content changed. You end up with most content in seperate files and > script logic/execution very easy to understand/debug. Stick a "watch" > echo anywhere in the code and it pops up at the top of the browser > window. > > For the above code, main_template.php is a full HTML document (only > HTML editor needed) with PHP tags in just a few spots to echo elements > of the $Template array: > > > > > > > > > > > > Bogdan wrote: > > There's an urban legend saying that switching php tags on and off would > > slow parsing down. > > Content outside PHP tags gets to skip the parser. From the manual: > > "..for outputting large blocks of text, dropping out of PHP parsing mode > is generally more efficient than sending all of the text through > echo() or print() or somesuch." > > Steve Thanks Steve, How I wish I had seen this before I started coding. Looks very good . . . I might work on some changes, after all . . . Regards, Andre -- Please pray the Holy Rosary to end the holocaust of abortion. Remember in your prayers the Holy Souls in Purgatory. May God bless you abundantly in His love! For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Previous & Next Navigation
Howdy! I am working on a project where approximately 3k - 5k records are returned and need to be displayed 30 per page with 'previous' and 'next' navigation at the request of the users. Does anyone know of an efficient script that will do this in PHP (with MySQL) that will not query the database every time? I would like to place the records into an array after one query to the database and then navigate the array...both for efficiency and speed. Anyhow, if anyone knows, please let me know. Otherwise I will have to write what I am looking for, and I really have no desire to re-invent the whell on a Monday afternoon. TIA! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RegEx problems...
This is baffling me, I have a form on one page that opens a php file in a text area for editing. In order to view the contents of the file in the text area I had to setup a eregi_replace("<","&a&") string. When I save the changes back to the text file I setup a reverse string i.e. [ eregi_replace("&a&","<") ] however it just blows right by this portion of the script. I have tried a few different variations ex. $file_name= "blank.php"; $file_open = fopen($file_name, "wr+"); $replace = eregi_replace("&a&","<", $passwords); fwrite($replace, $file_open, stripslashes($passwords)); print ("$passwords was written to $file_name"); and $file_name= "blank.php"; $file_open = fopen($file_name, "wr+"); fwrite(eregi_replace("&a&","<"), $file_open, stripslashes($passwords)); print ("$passwords was written to $file_name"); So far nothing has worked, actually the last example overwrites the file with nothing. Anyone come across a problem similar to this? If so how did you solve it? Thanks in advance, Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OT - php/mysql/cron
Any way to use cron to automate the mysqldumping of databases on a nighly basis? Any examples would be greatly appreciated. TIA, Kelly
Re: [PHP] RegEx problems...
On Mon, Jun 03, 2002 at 11:15:15AM -0600, Jas wrote: > > In order to view the contents of the file in the > text area I had to setup a eregi_replace("<","&a&") string. &'s are not legal in HTML. You need to escape them. When pulling stuff out of the file, use htmlspecialchars() before displaying the text in your form. THEN, when you're putting the user input from the form back into the file, use this: $Replace['&'] = '&'; $Replace['<'] = '<'; $Replace['>'] = '>'; $Replace['"'] = '"'; $UserInput = strtr($UserInput, $Replace); --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT - php/mysql/cron
On Mon, 2002-06-03 at 13:18, Kelly Meeks wrote: > Any way to use cron to automate the mysqldumping of databases on a nighly basis? > > Any examples would be greatly appreciated. This line's gonna wrap, but it all goes on the same line :P 0 0 * * * /usr/local/bin/mysqldump -u --password= > Obviously replace , , , and with the values you want to use for each. Of course, I would never recommend putting a "secure" password in a text file like your crontab, so if you have admin rights on the server maybe consider setting up a read-only account with no password, or maybe a unique password that won't work on any other accounts. Never hurts to be a little paranoid. HTH, Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include and memory
On Mon, Jun 03, 2002 at 01:49:03PM -0300, Paulo Cesar wrote: > I'd like to know if the include function alocates the variables that are in the included file in the memory... and, if it happens, if do I have a way to access a file with some variables without alocating it in memory. Dude, turn line wrapping on in your email program. Taking the following two bits of information into account should answer your question: 1) Variables are put into memory when your code executes the line that assigns the variable. 2) Stuff in an include file is just like having the included code inside your script. So, if you don't want everything going into memory, add some conditional statements (like "if" or "switch"), that'll put the stuff into memory only when you want it to be in memory. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include and memory
No offense but what you just said made absolutely no sense. There is no way to perform an operation on a computer without allocating memory for that operation. Unlike other lower level prgramming languages (ie. C/C++) PHP automatically allocates the necessary amount of memory for whatever operation it is you're doing. It is completely out of your control. So I don't see that there's anything for you to worry about in this regard. -Kevin - Original Message - From: "Paulo Cesar" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 10:49 AM Subject: [PHP] Include and memory Hi people... I'd like to know if the include function alocates the variables that are in the included file in the memory... and, if it happens, if do I have a way to access a file with some variables without alocating it in memory. Tks... Paulo Cesar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question regarding :: syntax
This may be a dumb question but, how can you be sure that the $this-> is referring to the parent classes' property and not the current class. On that note, does it really matter of which one it refers? -Jared -Original Message- From: Tobyn Baugher [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 12:58 PM To: php list Subject: RE: [PHP] Question regarding :: syntax On Mon, 2002-06-03 at 12:45, Jared Boelens wrote: > So am i to understand that i will have to do it in this manner? *SNIP* No no no... B extends A, and you have an instance of B. Just do this: class A { var $b; *snip* } class B { function B($b) { $this->b = $b; } } That will work fine. Regards, Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OT - php/mysql/cron
Here's a little tweak to gzip the backup results. I put this into another script that gets called by crontab. Are my DB userid and password still visible when run this way? I'm never here to see it run, because it happens late at night. /usr/bin/mysqldump --user=DBUSER --password=DBPASSWORD DATABASETOBACKUP | gzip > /backup_path/backup.sql.gz -Original Message- From: Tobyn Baugher [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 1:29 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] OT - php/mysql/cron On Mon, 2002-06-03 at 13:18, Kelly Meeks wrote: > Any way to use cron to automate the mysqldumping of databases on a nighly basis? > > Any examples would be greatly appreciated. This line's gonna wrap, but it all goes on the same line :P 0 0 * * * /usr/local/bin/mysqldump -u --password= > Obviously replace , , , and with the values you want to use for each. Of course, I would never recommend putting a "secure" password in a text file like your crontab, so if you have admin rights on the server maybe consider setting up a read-only account with no password, or maybe a unique password that won't work on any other accounts. Never hurts to be a little paranoid. HTH, Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question regarding :: syntax
On Mon, 2002-06-03 at 13:42, Jared Boelens wrote: > This may be a dumb question but, how can you be sure that the $this-> is > referring to the parent classes' property and not the current class. On > that note, does it really matter of which one it refers? B inherits $b from A. $this->b and "parent"->b are the exact same thing. This is why there's no special syntax to access "parent"->b from PHP. Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question regarding :: syntax
That is exactly what I thought, I was just looking for some reassurance. I have been working with C# lately and the syntax for classes is a lot more explicit. I wanted to make sure I wasn't making a mistake on what PHP implcitly does. Thanks -Jared -Original Message- From: Tobyn Baugher [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 1:58 PM To: php list Subject: RE: [PHP] Question regarding :: syntax On Mon, 2002-06-03 at 13:42, Jared Boelens wrote: > This may be a dumb question but, how can you be sure that the $this-> is > referring to the parent classes' property and not the current class. On > that note, does it really matter of which one it refers? B inherits $b from A. $this->b and "parent"->b are the exact same thing. This is why there's no special syntax to access "parent"->b from PHP. Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Previous & Next Navigation
look on phpbuilder.com and/or zend.com... I've seen articles on this very subject. On Mon, 3 Jun 2002, Jay Blanchard wrote: > Howdy! > > I am working on a project where approximately 3k - 5k records are returned > and need to be displayed 30 per page with 'previous' and 'next' navigation > at the request of the users. Does anyone know of an efficient script that > will do this in PHP (with MySQL) that will not query the database every > time? I would like to place the records into an array after one query to the > database and then navigate the array...both for efficiency and speed. > > Anyhow, if anyone knows, please let me know. Otherwise I will have to write > what I am looking for, and I really have no desire to re-invent the whell on > a Monday afternoon. > > TIA! > > Jay > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT - php/mysql/cron
"Tobyn Baugher" <[EMAIL PROTECTED]> wrote: > This line's gonna wrap, but it all goes on the same line :P > > 0 0 * * * /usr/local/bin/mysqldump -u --password= > > > > Obviously replace , , , and > with the values you want to use for each. > > Of course, I would never recommend putting a "secure" password in a text > file like your crontab, so if you have admin rights on the server maybe > consider setting up a read-only account with no password, or maybe a > unique password that won't work on any other accounts. Or create a .my.cnf file in the home directory of the user the cron job runs as, chmod 600 .my.cnf and include the following in it: [client] user= password= Then you don't need to supply the -u and --password parameters to mysqldump. Only that user can read .my.cnf and you won't need to supply those parameters to the mysql commandline program or other MySQL programs if you want to login as that default user. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Probs with MIME multipart/alternative generated with PEAR mime.php
Henry, Thanks for the reply. I tryed tweaking the pearMime.php class to handle correctly with no luck. As a temporary solution, I didtched the Mime.php class and just simpley added my own headers. $hdrs = array( 'MIME-Version' => "1.0", 'From' => $list_sender, 'Subject' => $subject, 'Return-Path' => $list_sender, 'Content-Type' => 'text/html; charset=\"iso-8859-1\"', 'Content-Transfer-Encoding' => "7bit", 'Reply-To' => $list_sender ); $mail = new Mail; $mail->factory('mail'); $mail->send($to_email, $hdrs, $body); For text email, I swapped the "Content-Type" to "text/plain; charset="iso-8859-1"". Fine, but multipart/alternative is much nicer. Michael "Henry" <[EMAIL PROTECTED]> wrote in message 003d01c20b12$1f461a40$a451fea9@ADSL">news:003d01c20b12$1f461a40$a451fea9@ADSL... > i've been doing a bit of mime lately. not with pear but with my own scripts. > > just a suggestion - does it matter that you have the From below the Mime-Version? and also allowed > another CRLF after the first boundary. those CRLF's are a killer! > > btw - i find outlook some help because it bolds the headers. > > what if you changed it to something like: > > > From [EMAIL PROTECTED] Mon Jun 3 05:27:54 2002 > > Return-Path: <[EMAIL PROTECTED]> > > Delivered-To: [EMAIL PROTECTED] > > Received: by flag.blackened.net (Postfix, from userid 65534) > > id 1E5B26702; Mon, 3 Jun 2002 05:27:54 -0700 (PDT) > > To: [EMAIL PROTECTED] > > From: [EMAIL PROTECTED] > > Subject: ise-news 018 :: June 2002 > > Status: > > MIME-Version: 1.0 > > Content-Type: multipart/alternative; > > boundary="=_f74fc4c7192d1983b9f144709175f8eb" > > > Message-Id: <[EMAIL PROTECTED]> > > Date: Mon, 3 Jun 2002 05:27:54 -0700 (PDT) > > > > --=_f74fc4c7192d1983b9f144709175f8eb > > Content-Type: text/plain; charset="iso-8859-1" > > Content-Transfer-Encoding: 7bit > > > > cheers > Henry > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] A small question - Mysql_insert_id
Jim- Please don't post such useless garbage to the lists. The thread was dead, mistakes were made, time to move on. We all make mistakes from time to time (frustration), and can only learn from them. Draft folders are good. Regards, Philip Olson > and you want people to actually ready your books after talking to customers > like that. I should burn your book. I thought you were a helping person. > If someone has a question and it is obvious that they have no clue about > what they are talking about. shouldn't you walk them through it instead of > shitting on them and telling them to f*** off? > > Just an observation -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Previous & Next Navigation
So you think it's more efficient and faster to load a 3 - 5 thousand row table into an array in memory and pass that around to all of your scripts (through sessions?), rather than just passing a $page variable and doing a query to return 30 rows on each page?? If you pass a $Page variable, you can make your query like this: SELECT * FROM table LIMIT $Page*30,30 Just increment and decriment $Page as you traverse the results...easy, eh? ---John Holmes... - Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 1:06 PM Subject: [PHP] Previous & Next Navigation > Howdy! > > I am working on a project where approximately 3k - 5k records are returned > and need to be displayed 30 per page with 'previous' and 'next' navigation > at the request of the users. Does anyone know of an efficient script that > will do this in PHP (with MySQL) that will not query the database every > time? I would like to place the records into an array after one query to the > database and then navigate the array...both for efficiency and speed. > > Anyhow, if anyone knows, please let me know. Otherwise I will have to write > what I am looking for, and I really have no desire to re-invent the whell on > a Monday afternoon. > > TIA! > > Jay > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Previous & Next Navigation
[snip] So you think it's more efficient and faster to load a 3 - 5 thousand row table into an array in memory and pass that around to all of your scripts (through sessions?), rather than just passing a $page variable and doing a query to return 30 rows on each page?? If you pass a $Page variable, you can make your query like this: SELECT * FROM table LIMIT $Page*30,30 Just increment and decriment $Page as you traverse the results...easy, eh? [/snip] It's definitely faster, as for more efficient I would have to do benchmarks. The original table consists of millions of rows and each time you query with LIMIT the query traverses the entire set of records in the data to get the proper CONDITIONS. Given that there are 3k -5k rows amongst the millions this requires a lot of search time for each query. The memory footprint of the 3k - 5k of records, even if the total memory needed for each record is 1k (which it is not), is 30k - 50k RAM, less than the size of most web pages. The LIMIT query, running on a slow server to simulate dial-up connections, takes anywhere from 1.3 to 2.2 minutes (been timing it a lot today) to execute. Since efficiency is often lumped in with speed, I would have to surmise that using an array in this instance would be more efficient as well. Thanks! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 1 session, 2 subdomains
I am working on a sports website that will have a subdomain for each major sport. There is a login panel on the main domain that routes users to the appropriate subdomain depending on the sport that they are in. Everything seems to be ok with cookies (cookiedomain=.domain.tld) but I can't get it to work with sessions -- even if I pass the session id in the URL. In the login script, I define the session then route to the appropriate subdomain. This where the problem lies - after redirection, the session is lost. It appears that the session is defined for the domain name that the user signs in on - if I allow users to login on their given sport subdomain, the session works ok, but this doesn't work the way I'd like. Any ideas on what I'm doing wrong? (I can post my login/session code if need be) Thanks for any suggestions!! __ Jason Dulberg Extreme MTB http://extreme.nas.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Previous & Next Navigation
Okay...glad to see someone put some thought into it instead of just wanting to do it because "queries are bad!". Also, the speed of the query doesn't depend on the connection speed at all. So, to solve your problem, load it into a session array. session_start(); $result = mysql_query("..."); while($row = mysql_fetch_row($result)) { $_SESSION['result']['column0'][] = $row[0]; $_SESSION['result']['column1'][] = $row[1]; etc... } Then, set a $Page variable and use that (times 30), as the index for the session array. $Start = $Page * 30; $End = $Start + 30; for($x=$Start;$x<$End;$x++); { echo $_SESSION['result']['column0'][$x]; echo $_SESSION['result']['column1'][$x]; etc... } Adapt to your needs. Or maybe you could load the results into a temporary table and do the subsequent paging out of that table (which will be faster, only having 3-5K rows). run a cron job to delete temp tables after the are X minutes old, etc... ---John Holmes... - Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 3:07 PM Subject: RE: [PHP] Previous & Next Navigation > [snip] > So you think it's more efficient and faster to load a 3 - 5 thousand row > table into an array in memory and pass that around to all of your scripts > (through sessions?), rather than just passing a $page variable and doing a > query to return 30 rows on each page?? > > If you pass a $Page variable, you can make your query like this: > > SELECT * FROM table LIMIT $Page*30,30 > > Just increment and decriment $Page as you traverse the results...easy, eh? > [/snip] > > It's definitely faster, as for more efficient I would have to do benchmarks. > The original table consists of millions of rows and each time you query with > LIMIT the query traverses the entire set of records in the data to get the > proper CONDITIONS. Given that there are 3k -5k rows amongst the millions > this requires a lot of search time for each query. The memory footprint of > the 3k - 5k of records, even if the total memory needed for each record is > 1k (which it is not), is 30k - 50k RAM, less than the size of most web > pages. The LIMIT query, running on a slow server to simulate dial-up > connections, takes anywhere from 1.3 to 2.2 minutes (been timing it a lot > today) to execute. Since efficiency is often lumped in with speed, I would > have to surmise that using an array in this instance would be more efficient > as well. > > Thanks! > > Jay > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 1 session, 2 subdomains
On Mon, 3 Jun 2002, Jason Dulberg wrote: > I am working on a sports website that will have a subdomain for each major > sport. There is a login panel on the main domain that routes users to the > appropriate subdomain depending on the sport that they are in. Everything > seems to be ok with cookies (cookiedomain=.domain.tld) but I can't get it to > work with sessions -- even if I pass the session id in the URL. > > In the login script, I define the session then route to the appropriate > subdomain. This where the problem lies - after redirection, the session is > lost. It appears that the session is defined for the domain name that the > user signs in on - if I allow users to login on their given sport subdomain, > the session works ok, but this doesn't work the way I'd like. > I'm guessing that your "redirection to the appropriate subdomain" actually refers to a different instance of the webserver potentially on a different machine? If so, then that's why "the session is lost". Sessions are maintained on a per server basis (am I correct here?) Even so, you can redirect to a specific page in the appropriate sport tld and reconstruct/restart the session (I guess to that point you should only have a memberid after the authentication). cheers, thalis > Any ideas on what I'm doing wrong? > > (I can post my login/session code if need be) > > Thanks for any suggestions!! > > __ > Jason Dulberg > Extreme MTB > http://extreme.nas.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] zlib double free bug and php question.
I've tried to search the archives/bug reports/faq's and didn't find any definitive answers on the zlib Double Free Bug CERT's Advisory CA-2002-07 issue. Even though I didn't compile php with the --with-zlib option when I run strings against the php library I still see zlib information. For example: > strings libphp4.a | grep -i zlib Request error: class file/memory mismatch Zlib So Zlib is still in the libphp4.a library. So does this mean that I could possibly still be vulnerable to the zlib Double Free Bug? Also, if I DO need to compile php with the --with-zlib option I assume I will also need to give it the --with-zlib-dir option. I assume if that zlib install directory does NOT have the bug, then I would be safe from it. I'm asking since I know there's the ext/zlib directory under the php source directory (well at least php v4.0.6) and I'm not sure if the bug exists somewhere in those files. Thanks for any help you can give me on those 2 questions. Please mail me directly since I'm not on this list. Thanks for your time and help, Lenny Miceli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Previous & Next Navigation
I don't know if it's possible (or faster, or more efficient), but could you query your millions of records for those 3k - 5k, insert them into a temp table, then do your LIMIT queries on that table for your prev/next pages? Just an idea! Jason Soza Juneau, Alaska - Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> Date: Monday, June 3, 2002 11:07 am Subject: RE: [PHP] Previous & Next Navigation > [snip] > So you think it's more efficient and faster to load a 3 - 5 > thousand row > table into an array in memory and pass that around to all of your > scripts(through sessions?), rather than just passing a $page > variable and doing a > query to return 30 rows on each page?? > > If you pass a $Page variable, you can make your query like this: > > SELECT * FROM table LIMIT $Page*30,30 > > Just increment and decriment $Page as you traverse the > results...easy, eh? > [/snip] > > It's definitely faster, as for more efficient I would have to do > benchmarks.The original table consists of millions of rows and > each time you query with > LIMIT the query traverses the entire set of records in the data to > get the > proper CONDITIONS. Given that there are 3k -5k rows amongst the > millionsthis requires a lot of search time for each query. The > memory footprint of > the 3k - 5k of records, even if the total memory needed for each > record is > 1k (which it is not), is 30k - 50k RAM, less than the size of most web > pages. The LIMIT query, running on a slow server to simulate dial-up > connections, takes anywhere from 1.3 to 2.2 minutes (been timing > it a lot > today) to execute. Since efficiency is often lumped in with speed, > I would > have to surmise that using an array in this instance would be more > efficientas well. > > Thanks! > > Jay > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Previous & Next Navigation
[snip] Okay...glad to see someone put some thought into it instead of just wanting to do it because "queries are bad!". Also, the speed of the query doesn't depend on the connection speed at all. [/snip] I know...in this case it is just the number of records that are needed vs. the number of records in the table. [snip] Or maybe you could load the results into a temporary table and do the subsequent paging out of that table (which will be faster, only having 3-5K rows). run a cron job to delete temp tables after the are X minutes old, etc... [/snip] This is where I am leaning right now, the LIMIT query would be much faster than an array if this is the case. Thanks John! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 1 session, 2 subdomains
The subdomain's are all on the same server and all have their docroot set to the same directory. I'm mainly using subdomains as a way to keep the site organized and to have different graphics based on their sport location. So if I pass to the next subdomain, do I just use session_start() if the person is logged in with sessions?? Thanks for your help! Jason > I'm guessing that your "redirection to the appropriate subdomain" > actually refers to a different instance of the webserver > potentially on a different machine? If so, then that's why "the > session is lost". Sessions are maintained on a per server basis > (am I correct here?) > > Even so, you can redirect to a specific page in the appropriate > sport tld and reconstruct/restart the session (I guess to that > point you should only have a memberid after the authentication). > > cheers, > thalis > > > On Mon, 3 Jun 2002, Jason Dulberg wrote: > > > I am working on a sports website that will have a subdomain for > each major > > sport. There is a login panel on the main domain that routes > users to the > > appropriate subdomain depending on the sport that they are in. > Everything > > seems to be ok with cookies (cookiedomain=.domain.tld) but I > can't get it to > > work with sessions -- even if I pass the session id in the URL. > > > > In the login script, I define the session then route to the appropriate > > subdomain. This where the problem lies - after redirection, the > session is > > lost. It appears that the session is defined for the domain > name that the > > user signs in on - if I allow users to login on their given > sport subdomain, > > the session works ok, but this doesn't work the way I'd like. > > > > Any ideas on what I'm doing wrong? > > > > (I can post my login/session code if need be) > > > > Thanks for any suggestions!! > > > > __ > > Jason Dulberg > > Extreme MTB > > http://extreme.nas.net > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] opendir security hole
On Monday, June 3, 2002 at 3:37:48 PM, you wrote: >$dir = preg_replace('/\.\.\/?/', '', $dir); Surely a regular expression is overkill for this? It would be more efficient to use str_replace()... $dir = str_replace('..', '', $dir); -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] delete file contents before writing?
Try unlink("$file_name") then fopen("$file_name","rw") unlink() deletes the whole file from the directory. Hope this helps. Hugh - Original Message - From: "Jas" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 8:37 AM Subject: [PHP] delete file contents before writing? > Not sure how I could do this as I could not find a functions on php.net to > allow me to first delete the entire contents of a file "before" writting the > changes supplied by a textarea. Here is what I have thus far: > Page one - Form: > $file_name = 'blank.php'; > $open_file = fopen("$file_name","rw"); > if (!$open_file) { > die("cannot open $file_name"); > } else { > $read_file = fread($open_file, filesize($file_name)); > $strip_php = eregi_replace("<","&a&", $read_file); > fclose($open_file); > } > ?> > >?> > > > > Page two - open file and write changes: > if (!$passwords) { > header ("Location: index.php"); > } else { > $file_name= "blank.php"; > $file_open = fopen($file_name, "r+"); > eregi_replace("&a&","<", $file_open); > #eregi_replace("\","", $file_open); > fwrite($file_open, $passwords); > print ("$passwords was written to $file_name"); } > ?> > As of right now it opens the file and writes your changes, however it simply > goes to the end of the file then begins writting. I would like to delete > the contents of the file, then write the changes. > Any help or pointers are appreciated! > Jas > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 1 session, 2 subdomains
On Mon, 3 Jun 2002, Jason Dulberg wrote: > The subdomain's are all on the same server and all have their docroot set to > the same directory. I'm mainly using subdomains as a way to keep the site > organized and to have different graphics based on their sport location. > > So if I pass to the next subdomain, do I just use session_start() if the > person is logged in with sessions?? > > Thanks for your help! I'm guessing 'no'. The sessions are kept on a per domain basis. Using a separate domain will cause a new session to be started when you do session_start() in the appopriate sport subdomain. So when you redirect from MAIN->FOOTBALL, send with a POST/GET the memberid of the autenticated user so that you can register this in the new session you start under FOOTBALL. Can't tell how safe it is though... That was my 2c. cheers, --thalis > > Jason > > > > > I'm guessing that your "redirection to the appropriate subdomain" > > actually refers to a different instance of the webserver > > potentially on a different machine? If so, then that's why "the > > session is lost". Sessions are maintained on a per server basis > > (am I correct here?) > > > > Even so, you can redirect to a specific page in the appropriate > > sport tld and reconstruct/restart the session (I guess to that > > point you should only have a memberid after the authentication). > > > > cheers, > > thalis > > > > > > On Mon, 3 Jun 2002, Jason Dulberg wrote: > > > > > I am working on a sports website that will have a subdomain for > > each major > > > sport. There is a login panel on the main domain that routes > > users to the > > > appropriate subdomain depending on the sport that they are in. > > Everything > > > seems to be ok with cookies (cookiedomain=.domain.tld) but I > > can't get it to > > > work with sessions -- even if I pass the session id in the URL. > > > > > > In the login script, I define the session then route to the appropriate > > > subdomain. This where the problem lies - after redirection, the > > session is > > > lost. It appears that the session is defined for the domain > > name that the > > > user signs in on - if I allow users to login on their given > > sport subdomain, > > > the session works ok, but this doesn't work the way I'd like. > > > > > > Any ideas on what I'm doing wrong? > > > > > > (I can post my login/session code if need be) > > > > > > Thanks for any suggestions!! > > > > > > __ > > > Jason Dulberg > > > Extreme MTB > > > http://extreme.nas.net > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] delete file contents before writing?
My mistake: Try unlink() then touch() not fopen(). Hugh - Original Message - From: "hugh danaher" <[EMAIL PROTECTED]> To: "php" <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 12:43 PM Subject: Re: [PHP] delete file contents before writing? > Try unlink("$file_name") then fopen("$file_name","rw") > unlink() deletes the whole file from the directory. > Hope this helps. > Hugh > - Original Message - > From: "Jas" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, June 03, 2002 8:37 AM > Subject: [PHP] delete file contents before writing? > > > > Not sure how I could do this as I could not find a functions on php.net to > > allow me to first delete the entire contents of a file "before" writting > the > > changes supplied by a textarea. Here is what I have thus far: > > Page one - Form: > > > $file_name = 'blank.php'; > > $open_file = fopen("$file_name","rw"); > > if (!$open_file) { > > die("cannot open $file_name"); > > } else { > > $read_file = fread($open_file, filesize($file_name)); > > $strip_php = eregi_replace("<","&a&", $read_file); > > fclose($open_file); > > } > > ?> > > > >> ?> > > > > > > > > Page two - open file and write changes: > > > if (!$passwords) { > > header ("Location: index.php"); > > } else { > > $file_name= "blank.php"; > > $file_open = fopen($file_name, "r+"); > > eregi_replace("&a&","<", $file_open); > > #eregi_replace("\","", $file_open); > > fwrite($file_open, $passwords); > > print ("$passwords was written to $file_name"); } > > ?> > > As of right now it opens the file and writes your changes, however it > simply > > goes to the end of the file then begins writting. I would like to delete > > the contents of the file, then write the changes. > > Any help or pointers are appreciated! > > Jas > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 1 session, 2 subdomains
Store your session information in a database. Assign it an ID and send that ID to the cookie or the URL in the new domain. Then you can write a session handler that retrieves the session info form the database. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Jason Dulberg [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:13 PM To: [EMAIL PROTECTED] Subject: [PHP] 1 session, 2 subdomains I am working on a sports website that will have a subdomain for each major sport. There is a login panel on the main domain that routes users to the appropriate subdomain depending on the sport that they are in. Everything seems to be ok with cookies (cookiedomain=.domain.tld) but I can't get it to work with sessions -- even if I pass the session id in the URL. In the login script, I define the session then route to the appropriate subdomain. This where the problem lies - after redirection, the session is lost. It appears that the session is defined for the domain name that the user signs in on - if I allow users to login on their given sport subdomain, the session works ok, but this doesn't work the way I'd like. Any ideas on what I'm doing wrong? (I can post my login/session code if need be) Thanks for any suggestions!! __ Jason Dulberg Extreme MTB http://extreme.nas.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] opendir security hole
On Mon, Jun 03, 2002 at 08:41:37PM +0100, Stuart Dallas wrote: > > Surely a regular expression is overkill for this? It would be more efficient to > use str_replace()... > > $dir = str_replace('..', '', $dir); Sure. But you'd need to do two replaces. First for '../' then for '..' Not a big deal. Don't know if that's faster than preg or not. I'm used to preg, so am biased toward writing them. Alas... Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 1 session, 2 subdomains
I am currently storing the session hash/login info (userid, session hash, host, etc.) in the db and send it to the next domain in the redireted URL. How would the handler work if no session info isn't being passed to the subdomain? Thanks! Jason > From: Cal Evans [mailto:[EMAIL PROTECTED]] > > Store your session information in a database. Assign it an ID and > send that > ID to the cookie or the URL in the new domain. Then you can > write a session > handler that retrieves the session info form the database. > > =C= > > * > * Cal Evans > * Journeyman Programmer > * Techno-Mage > * http://www.calevans.com > * > > > -Original Message- > From: Jason Dulberg [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 03, 2002 2:13 PM > To: [EMAIL PROTECTED] > Subject: [PHP] 1 session, 2 subdomains > > > I am working on a sports website that will have a subdomain for each major > sport. There is a login panel on the main domain that routes users to the > appropriate subdomain depending on the sport that they are in. Everything > seems to be ok with cookies (cookiedomain=.domain.tld) but I > can't get it to > work with sessions -- even if I pass the session id in the URL. > > In the login script, I define the session then route to the appropriate > subdomain. This where the problem lies - after redirection, the session is > lost. It appears that the session is defined for the domain name that the > user signs in on - if I allow users to login on their given sport > subdomain, > the session works ok, but this doesn't work the way I'd like. > > Any ideas on what I'm doing wrong? > > (I can post my login/session code if need be) > > Thanks for any suggestions!! > > __ > Jason Dulberg > Extreme MTB > http://extreme.nas.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP-Windows2000 Server-Apache/Tomcat
Help! I'm having trouble getting the PHP module installed on the Apache/Tomcat installation. I've set it up as a service. The documentation mentions editing the httpd.conf file but I cannot find that file with this installation. The only thing that I can find to configure the server is the server.xml but there are no references as to what to enter in that file to make the module work. Any assistance would be greatly appreciated. Thanks, Rick Kalifa.
RE: [PHP] 1 session, 2 subdomains
Actually, if you are doing this then just re-login the person once they get to the new domain. Then you have the login and the session. PHP has the capability to allow you to replace the session handler. If you have to have them login in one domain and then use the info in another, building your own session handler is one way to do it. But if you have no session info to pass, why is it a problem? =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Jason Dulberg [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 3:08 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] 1 session, 2 subdomains I am currently storing the session hash/login info (userid, session hash, host, etc.) in the db and send it to the next domain in the redireted URL. How would the handler work if no session info isn't being passed to the subdomain? Thanks! Jason > From: Cal Evans [mailto:[EMAIL PROTECTED]] > > Store your session information in a database. Assign it an ID and > send that > ID to the cookie or the URL in the new domain. Then you can > write a session > handler that retrieves the session info form the database. > > =C= > > * > * Cal Evans > * Journeyman Programmer > * Techno-Mage > * http://www.calevans.com > * > > > -Original Message- > From: Jason Dulberg [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 03, 2002 2:13 PM > To: [EMAIL PROTECTED] > Subject: [PHP] 1 session, 2 subdomains > > > I am working on a sports website that will have a subdomain for each major > sport. There is a login panel on the main domain that routes users to the > appropriate subdomain depending on the sport that they are in. Everything > seems to be ok with cookies (cookiedomain=.domain.tld) but I > can't get it to > work with sessions -- even if I pass the session id in the URL. > > In the login script, I define the session then route to the appropriate > subdomain. This where the problem lies - after redirection, the session is > lost. It appears that the session is defined for the domain name that the > user signs in on - if I allow users to login on their given sport > subdomain, > the session works ok, but this doesn't work the way I'd like. > > Any ideas on what I'm doing wrong? > > (I can post my login/session code if need be) > > Thanks for any suggestions!! > > __ > Jason Dulberg > Extreme MTB > http://extreme.nas.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php.ini question
document root is where your webserver gets his files from. Default on Apache is htdocs. Hope this helps, Andy http://www.globosapiens.net Global Travellers Network! "Taylor Lewick" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... When setting doc_root in the php.ini section, should that be the cgi-bin directory, or the doc-root of the webserver, i.e. htdocs..? Thanks, Taylor Taylor Lewick Unix System Administrator Fortis Benefits 816 881 6073 "Help Wanted. Seeking Telepath..." "You Know where to apply." Please Note The information in this E-mail message is legally privileged and confidential information intended only for the use of the individual(s) named above. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender. Thank you * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 1 session, 2 subdomains
There should be session info to pass though, its just not getting through to the subdomain from the main one. The login script (on the main domain) for sessions looks like this: session_register("type","user","pass","userid","user_is_logged_in","sessid") ; then it redirects to the subdomain based on $type $redirecturl=$config[listings_dir].$config[client_dir].$type."/index.php?s=" .$sessid; If I don't redirect outside of the main domain, it works fine, it just breaks once it hits the new one. How would I find info about creating a session handler for this application? Jason > Actually, if you are doing this then just re-login the person > once they get > to the new domain. Then you have the login and the session. > > PHP has the capability to allow you to replace the session > handler. If you > have to have them login in one domain and then use the info in another, > building your own session handler is one way to do it. But if you have no > session info to pass, why is it a problem? > > =C= > > * > * Cal Evans > * Journeyman Programmer > * Techno-Mage > * http://www.calevans.com > * > > > -Original Message- > From: Jason Dulberg [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 03, 2002 3:08 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] 1 session, 2 subdomains > > > I am currently storing the session hash/login info (userid, session hash, > host, etc.) in the db and send it to the next domain in the redireted URL. > > How would the handler work if no session info isn't being passed to the > subdomain? > > Thanks! > > Jason > > > > From: Cal Evans [mailto:[EMAIL PROTECTED]] > > > > Store your session information in a database. Assign it an ID and > > send that > > ID to the cookie or the URL in the new domain. Then you can > > write a session > > handler that retrieves the session info form the database. > > > > =C= > > > > * > > * Cal Evans > > * Journeyman Programmer > > * Techno-Mage > > * http://www.calevans.com > > * > > > > > > -Original Message- > > From: Jason Dulberg [mailto:[EMAIL PROTECTED]] > > Sent: Monday, June 03, 2002 2:13 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] 1 session, 2 subdomains > > > > > > I am working on a sports website that will have a subdomain for > each major > > sport. There is a login panel on the main domain that routes > users to the > > appropriate subdomain depending on the sport that they are in. > Everything > > seems to be ok with cookies (cookiedomain=.domain.tld) but I > > can't get it to > > work with sessions -- even if I pass the session id in the URL. > > > > In the login script, I define the session then route to the appropriate > > subdomain. This where the problem lies - after redirection, the > session is > > lost. It appears that the session is defined for the domain > name that the > > user signs in on - if I allow users to login on their given sport > > subdomain, > > the session works ok, but this doesn't work the way I'd like. > > > > Any ideas on what I'm doing wrong? > > > > (I can post my login/session code if need be) > > > > Thanks for any suggestions!! > > > > __ > > Jason Dulberg > > Extreme MTB > > http://extreme.nas.net > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] keep alive refresh
Hello, I looked for some old questions about my problem in the m.l. archive but I did not find anything. I'm writing a php script which takes a couple of values from the web interface and then passes these values to a program which writes it's output on a file. Then the output of the file is published on the web page. The problem is that this program may take 1 minute up to 1 hour to write all the output on the file and the browser times out. Any suggestion on how to solve this? Many thanx Mauro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Overriding Class functions and variables
>From reading the manual, it is my understanding that one cannot explicitly override parent class functions and/or properties. I found this article stating, "You can override any function but it is an implicit override...any function that is overridden in a child is never called in the parent, so if you have funct() on both, only child will be called." http://www.phpbuilder.com/forum/archives/2/2000/12/2/115715 In my case i am trying to override a variable. I have a property Username for both the parent and the child. I am wondering if there is a way to differenciate between parent->Username and child->Username. Thanks -Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] changed behavior of shutdown-registered function in 4.0.x->4.1.x (conn. handling)
Hi, I use register_shutdown_function to regenerate my content-cache's data after the old page were sent. In 4.0.6 there was no problem with it, the connection was closed after the normal script is finished, and before the shutdown_registered function is started (which does the real work). So I could use it for gaining a "fake" speed in delivering pages, and it really made our system faster because only one process can regenerate the page in a time, the others simply return the old content. But unfortunatelly this doesn't work since 4.1.x, because after the normal script finishes it still holds the "line". It doesn't close the connection, so the browser is still waiting for data (and the http process is being held too). Is there any php.ini setting or switch for configure that I can use for turning off this behavior? Or is there any other reason why it works this way for me? If I copy the old (4.0.6) php module over the new one (4.1.1) it works fine. For the dev list: Is there any real reason for this way of connection handling, or it's just a side-effect of some other featuer? Thanks for your help, Arpi p.s.:sorry for mailing this to the dev list too, but I don't know where can I find somebody who can help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD 2.x formulas
Does anyone know of a good site for GD 2.x formulas using Alpha channels? Currently I'm trying to make a color gradiant, but in an oval rather than a line. I have a tools that can do this on an image, but my goal is to allow the color to be dynamic so I need to build it on the fly. -Jim _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sablotron broken in 4.2.1 ?
Is Sablotron broken in 4.2.1 because none of the transformations have worked that I have tried. I am using: php 4.2.1 apache_1.3.24 expat-1.95.2 my files are: 'wget http://213.84.71.105/news.xml' 'wget http://213.84.71.105/news.xsl' 'wget http://213.84.71.105/news.php' If someone could tell me what to correct to make it right I would appreciate it. Note: Please disregard the content. It is copied from a site that I knew to be using XML with Sablotron and is not mine. -- Bill Amsterdam, NL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] still running the old version after recompiling??
In that case, you can look at your autoexec.bat. There is a variable (I think called path). Just make sure it's right. On Sunday 02 June 2002 21:31 pm, you wrote: > I forgot to write I run on a win98, so no shell :) > So what? > > Makis > > > -Original Message- > > From: Evan Nemerson [mailto:[EMAIL PROTECTED]] > > Sent: Monday, June 03, 2002 1:52 AM > > To: savaidis; [EMAIL PROTECTED] > > Subject: Re: [PHP] still running the old version after recompiling?? > > > > > > Do "echo $PATH" from a shell. This will output a list of several folders, > > seperated by a semi-colon. Check each of these folders for a file named > > "Php". Rename to "php". That should do the trick. > > > > On Sunday 02 June 2002 11:01 am, savaidis wrote: > > > I have one similar problem. > > > > > > I had a directory "Php" under my "root" directory that was the root for > > > Apache. > > > Then I rename "Php" to "php" but after restart, reset ecc - some months > > > now- still recognize only "Php" and NOT "php". > > > > > > What's wrong? > > > > > > Makis > > > > > > > -Original Message- > > > > From: Andy [mailto:[EMAIL PROTECTED]] > > > > Sent: Sunday, June 02, 2002 4:51 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: Re: [PHP] still running the old version after recompiling?? > > > > > > > > > > > > Hello Jason, > > > > > > > > you have been right, I did a new one on a fresh php untared dir. > > > > And the new > > > > php install is recognized. > > > > > > > > But I am still fighting with the installation. I need > > > > freetype2 and I did > > > > > > configure it ok, compiled freetype, gd2 but still I am getting a: > > > > function: imagettfbbox() not found > > > > > > > > Php did not complain about not finding freetype. Maybe php > > > > compiled with > > > > > > freetype 1 but how come? > > > > This drives me cracy! I did install php on several machines at > > > > home running > > > > the same operating system like my provider is offering. It > > > > always worked > > > > > > fine. > > > > > > > > do u have a good advice? > > > > > > > > Thank you for your help, > > > > > > > > Andy > > > > > > > > > > > > > > > > > > > > "Jason Wong" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > > > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > > > > > > > On Sunday 02 June 2002 17:32, Andy wrote: > > > > > > Hi there, > > > > > > > > > > > > I did recompile php with different flags. Phpinfo() tells > > > > me that I > > > > > > > > am still running the old insatllation! I did restart apache after > > > > > > > > compiling. > > > > > > > > > > So whats wrong. Did I forget something? > > > > > > > > > > > > I did > > > > > > configure with some flags > > > > > > make > > > > > > make install > > > > > > > > > > > > restart apache > > > > > > > > > > 1) To avoid any complications I always compile from a > > > > freshly unpacked > > > > > > tar.gz. > > > > > > > > > 2) Stop apache before doing "make install" (not sure whether it > > > > > > > > makes any > > > > > > > > > difference but it doesn't hurt to do so). > > > > > > > > > > -- > > > > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > > > > Open Source Software Systems Integrators > > > > > * Web Design & Hosting * Internet & Intranet Applications > > > > Development * > > > > > > > /* > > > > > There are two ways of disliking poetry; one way is to > > > > dislike it, the > > > > > > > other is to read Pope. > > > > > -- Oscar Wilde > > > > > */ > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > > I am prepared to meet anyone, but whether anyone is prepared for > > the great > > ordeal of meeting me is another matter. > > > > Samuel Clemens -- Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family. Kofi Annan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php