Re: [PHP] Screen Shots
Stut may not be entirely correct here. It /is/ possible if the user sends all the pixels of their current view (and their colors), or simply a print screen and then upload it :) Ok, bad joke. On 10/22/06, Stut [EMAIL PROTECTED] wrote: Mark McWhirter wrote: Is there any way that I can get a script to take a screen shot every minute of all the users using my php website? Wow, does that ever have nothing to do with PHP!! To answer the inappropriate question... No. Or rather, not without the use of a client-side technology such as ActiveX and the ability to bypass any active content security or convince your visitors to give you permission to spy on them. So, as I said previously, no. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Mukul Sabharwal http://mjsabby.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session - cookie issues
The way you're setting cookies (without a time parameter), it's set to expire at the end of the current session. Though it should work regardless, try setting an expire time: setcookie('djst', 'test', time()+3600); // expire in an hour On 10/20/06, Dave Goodchild [EMAIL PROTECTED] wrote: Hi all, I am having issues with users not being able to post their details to my site. The system uses sessions, so when they hit the index page a test cookie is set thus: setcookie('djst', 'test'); and then I test whether that cookie is set on the next page. If not, I direct the users to an informational page. This works my end in FF and IE6 (sec settings tested at low, medium and medium high) but appox 1 in 20 users cannot get past the cookie warning, even if they set their security settings to low in IE. I am also setting PHPSESSID to something of my own, as I hear that IE does not like PHPSESSID (correct?). Any ideas? -- http://www.web-buddha.co.uk -- Mukul Sabharwal http://mjsabby.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to Authenitcate using PHP (RH9, PHP 4.3.2, MySQL 4)
Hello, I have a class that just does that :: http://www.devhome.org/php/scripts/authlib.html - Original Message - From: Matt Babineau [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 8:30 AM Subject: [PHP] How to Authenitcate using PHP (RH9, PHP 4.3.2, MySQL 4) Hi All- I was wondering if anyone had any suggestions on how to properly authenticate users using redhat php and mysql. Currently we are using .htaccess files, but I was thinking it may be easier to manage this via a php/mysql admin interface... I imagine plenty of authentication schemes have been put in place but which one might be the best? Opinions? Thanks, Matt = Mukul Sabharwal ([EMAIL PROTECTED]) __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem in class creation
From the looks of it, if i were to do the same, I would rather make second class the one I initiate and return it, but that would require a third. And the error is strange because you're doing something strange! What do you want to do ? Be able to access base_class stuff from second_class ? If so : ?php class base_class { function base_class() { do something ... ; } var $some = 200; }; class second_class { var $foo; function second_class($oref) //constructor { $this-foo = $oref; } }; $base = new base_class; $second = new second_class($base); $second-foo-some = 100; // here it is, base_class' some is accessible ? HTH Mukul Sabharwal From: Fabio Rotondo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 2:38 AM Subject: [PHP] Strange problem in class creation Hi all, I have encountered a tricky problem with PHP 4.3.1 (installed with SuSE 8.2). I don't know if it is a bug or not. Maybe is just me missing something. What I'd like to do is to pass a reference of base_class instance to the constructor of second_class (so that the newly created second_class instance can call methods from the base_class instance. It seems that if base_class constructor directly calls its method create() (that is responsible of creating the second_class instance, passing _$this_ as constructor argument) the second_class gets a copy of base_class instance and not the real thing. To test it, I have added an array ($arr) in the base_class and set a value into it. If second_class really have a reference to the real base_class instance, it should be able to print its contents, but this just doesn't work. Please, notice that if in the following code you remove the line $this-create() in the base_class constructor and add the commented line in the main body, everything works fine. What I am really missing? Please, help! Ciao, Fabio CODE STARTS HERE -- ?php class base_class { var $arr; var $class; function base_class () { $this-arr = array (); $this-class = false; // it seems to create another instance of base_class $this-create (); // this line does not work } function set ( $val ) { $this-arr [] = $val; } function create () { $this-class = new second_class ( $this ); } function test () { $this-class-dump (); } } class second_class { function second_class ( $main_class ) { $this-main_class = $main_class; } function dump () { print_r ( $this-main_class-arr ); } } $b = new base_class (); // $b-create (); // This line works as expected $b-set ( ciao ); $b-test (); print br /; print_r ( $b-arr ); ? END CODE - = Mukul Sabharwal ([EMAIL PROTECTED]) __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] prob. with function parameter with
Sorry the $x should be $v, if it caused any confusion. Mukul Sabharwal http://www.devhome.org = Mukul Sabharwal ([EMAIL PROTECTED]) __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Document root
$_SERVER[REQUEST_URI] , $_SERVER[SCRIPT_NAME] They give abs. web server paths ... like /php/scripts/file.php HTH Mukul Sabharwal http://www.devhome.org - Original Message - From: Mukta Telang [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 11:27 AM Subject: [PHP] Document root Hi! Is there any constant in php like $DOCUMENT_ROOT which holds path to the Document root of the server? I want to do something like this: $path=$DOCUMENT_ROOT./files/one.php; echo a href=\$path\; Thanks in advance, Mukta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mukul Sabharwal ([EMAIL PROTECTED]) __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] prob. with function parameter with
You cannot pass NULL, where a 'reference' was exptected, it is not legal. Just as any other constant. NULL is a constant. function myfunc($p) { ... } $v = NULL; // passing NULL myfunc($x); Mukul Sabharwal http://www.devhome.org - Original Message - From: Mirek Novak [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 12:06 PM Subject: [PHP] prob. with function parameter with Hi everybody, I have defined function function func ($var,$val,$struct){ // do something } if I call this function following way func('a','b',NULL); = Mukul Sabharwal ([EMAIL PROTECTED]) __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex help appreciated
Firstly, If your text spans more than one line you should use \n, rather than just doing something like : a href=\ hello\...(.*)/a because that will mess up, depending on what text editor you use, eg. notepad will put \r\n, but it should only be \n. Though I'm not sure about it. So the best solution is : a href=\\nhell\...(.*)/a Now that said, let's look into your problem, you mention you want one common regex that does both of them. That would be tideous enough to let be, instead using two distinct regex checks would be easier, and faster. So : eregi('para font-size=12 font-family=Arial style=heading 2(.*)anchor type=bkmrk/(.*)/para', $string, $matches); would store Some in $matches[1], more text- in $matches[2]. eregi('para font-size=12 font-family=Arial style=heading 2inline caps=false(.*)/inline(.*)/para', $string, $datex); would store Some text in $datex[1], more text in $datex[2] Now if you want to know which one to execute, just do a if(eregi('inline caps=false', $input_string)) { execute_this_Regex(); } It should be faster this way, and an even more efficient solution can be using Perl Regex. HTH Mukul Sabharwal http://www.dehvome.org - Original Message - From: David Pratt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 10:55 AM Subject: [PHP] Regex help appreciated I am trying to get a regex to extract the Some and more text between the para elements below in a single pass for style attribute of heading 2 para font-size=12 font-family=Arial style=heading 2Someanchor type=bkmrk/more text-/para para font-size=12 font-family=Arial style=heading 2inline caps=falseSome text/inlinemore text/para Tried something like this for first bit but grabbing the anchor tag with the text. |para(.*)style=\heading 2\(([a-zA-Z0-9/-/_/\s]+)?)([anchor type=bkmrk name=[a-zA-Z0-9/_]+/])?(.*)/para| Help much appreciated. Thanx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] files being downloaded when a 404 occurs
Look at this bug file : http://bugs.php.net/bug.php?id=25009 It's been fixed in the CVS snapshots, anything after the 11PM GMT on the 10th of August works. hth. --- Rigi Toney [EMAIL PROTECTED] wrote: Hello, I'm using Apache 2.0.47 (Unix) with PHP 4.3.3RC2. My httpd.conf file reads : AddType application/x-httpd-php .html ... and then a little further down ErrorDocument 404 /404redir.html (404redir.hml is a PHP file, consisting of : ?php header(Location: /404.html); ? ) The reason why I do this is so that the Google Adsense doesnt' display welfare ads, since the 404 page contains a lot of keywords! Anyway, the problem is this. When a 404 occurs, for say a directory ... http://localhost/heidkjsdjksd which doesnot exist... everything works great... i get redirected as per requirement. Now when a .php files occurs .. it still works (http://localhost/sdjkdkjskd.php) BUT when a .html files occurs... http://localhost/crap.html it starts to download the file... and the browser says can't download!!! And now when I add a .php file to my AddType... it happens for the .php file too... so since i've moved my website.. and had .php files... i can't use the .php extension otherwise 404's don't get logged and taken care of! Help appreciated. thank you. Tony. = Mukul Sabharwal ([EMAIL PROTECTED]) __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem in class creation
And the error is strange because you're doing something strange! I don't think I'm doing anything strange. What I have exposed here is a simplification of my own class loader. I have the main class that must load (include and then instance) other PHP classes. The problem is that if I do instance other classes in the loader constructor they get a copy of the loader instance and not the real instance reference. That code (looked closely) confirms you're doing something strange :) A constructor cannot call (or rather should not call) itself while being constructed. It leads to unexpected results. So technically in some cases you might be able to get it, but on most occassions you won't, it depends on how your class is made. And yours recurses, I'm presuming you wanted that for some reason (??) On almost all times your data will be still pointing to your base class (second_class). So i'm afraid your method is not reliable, dangerous none the less. The reliable and correct way of doing it is after your constructor has finished your class and made it ready (guaranteed), then you can do what you want to. = Mukul Sabharwal ([EMAIL PROTECTED]) __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crypt and decrypt a string
http://www.paphe.com/php/tutorials/230101.php an encryption class = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] file maniputation??
Hi, It looks most certainly like a file permission error, however if you have concurrent users maybe it's over riding the file contents, and screwing up something somewhere. So use flock(), a tutorial : http://www.paphe.com/php/tutorials/111000.php = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] querying a berkley db3 database with a php script..
Hi Sovan, try this link : http://p2p.wrox.com/archive/pro_php/2001-05/46.asp = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] file reading and textarea problem
Hi, fopen let's you read the whole file. Try this tutorials on files for a more hands on approach : http://www.paphe.com/php/tutorials/111000.php = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mirroring Website
Hi, Try rsync, it's pretty much what you want. http://rsync.samba.org = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] bulk e-mails
Hi, Well to reach the customers, each and every, you would have to send it to each and everybody, very simple. Ofcourse, it's not the most nice job the server can do, but your emails say 20K each, and 10,000 users, isn't a very rough job. You could essentially loop through the user record and send emails, which would make the To field, only show the recipients address. Maybe you could like put a url in to the message, and ask the users to come on there, and read the message. So that you aren't sending as much KB's. Hope that helps. = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Restrict where PHP is Usable?
Hi, Take a look at the ScriptAlias directive of the Apache webserver. I'm not sure how other webservers limit execution, but apache does it using that directive. http://httpd.apache.org/docs/ http://httpd.apache.org/docs/misc/security_tips.html http://httpd.apache.org/docs/vhosts/mass.html Hope that helps. = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sockets on FreeBSD Mac OS X
Hi, A bind error means that the port is being used by another application, incase that's incorrect you can assure yourself by doing this : socket_setopt(listener, SOL_SOCKET, SO_REUSEADDR, 1); This function is undocumented (yet) and would require you to download the latest version from CVS. Hope that helps. = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sockets on FreeBSD Mac OS X
Oops, socket_setopt($listener, SOL_SOCKET, SO_REUSEADDR, 1); = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] socket_get_status()
Hi, Well I'm not totally sure, why socket_get_status would not give you the correct value, other than a bug, as the manual does indicate the socket functions are experimental. There are altenative ways to get the number of bytes in the buffer, like using ioctl with FIONREAD, ofcourse that is a C function, and I can't really locate a PHP counterpart for it, other than what may be a counterpart (socket_get_status). However yet another solution is using the recv() counterpart, socket_recv() with the MSG_PEEK flag. Now you'd probably open up a local copy of the php manpages, hunting for socket_recv()! Well it's not there, it's an undocumented function (yet), and to my knowlegde exists in PHP 4.0.7, atleast in the CVS. function prototype: mixed socket_recv(resource socket, int len, int flags) and example usage: $data = socket_recv($sockfd, $nbytes, MSG_PEEK); $len = sizeof($data); Now you would have to loop through the the complete buffer, and let me remind you, that MSG_PEEK means peeking into the buffer, it does not actually remove the data from the recv() queue but only gives you a copy, if you call the function without MSG_PEEK you will get the same data, and then the data will be discarded. This is one way of finding out the no. of bytes in the buffer, ofcourse socket_get_status() is surely much better. Incase I interpreted you incorrectly and you wanted to know the no. of bytes the recieve buffer can hold then here's the function, and this is also 4.0.7+ : function prototype: mixed socket_getopt(resource socket, int level, int optname) example usage: $info = socket_getopt($sockfd, SOL_SOCKET, SO_RCVBUF); and it remains pretty much the same for the send buffer : $info = socket_getopt($sockfd, SOL_SOCKET, SO_SNDBUF); Hope that helps. P.S - phpguru.org, nice domain name. = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] socket_get_status()
Hi, Well I'm not totally sure, why socket_get_status would not give you the correct value, other than a bug, as the manual does indicate the socket functions are experimental. There are altenative ways to get the number of bytes in the buffer, like using ioctl with FIONREAD, ofcourse that is a C function, and I can't really locate a PHP counterpart for it, other than what may be a counterpart (socket_get_status). However yet another solution is using the recv() counterpart, socket_recv() with the MSG_PEEK flag. Now you'd probably open up a local copy of the php manpages, hunting for socket_recv()! Well it's not there, it's an undocumented function (yet), and to my knowlegde exists in PHP 4.0.7, atleast in the CVS. function prototype: mixed socket_recv(resource socket, int len, int flags) and example usage: $data = socket_recv($sockfd, $nbytes, MSG_PEEK); $len = sizeof($data); Now you would have to loop through the the complete buffer, and let me remind you, that MSG_PEEK means peeking into the buffer, it does not actually remove the data from the recv() queue but only gives you a copy, if you call the function without MSG_PEEK you will get the same data, and then the data will be discarded. This is one way of finding out the no. of bytes in the buffer, ofcourse socket_get_status() is surely much better. Incase I interpreted you incorrectly and you wanted to know the no. of bytes the recieve buffer can hold then here's the function, and this is also 4.0.7+ : function prototype: mixed socket_getopt(resource socket, int level, int optname) example usage: $info = socket_getopt($sockfd, SOL_SOCKET, SO_RCVBUF); and it remains pretty much the same for the send buffer : $info = socket_getopt($sockfd, SOL_SOCKET, SO_SNDBUF); Hope that helps. P.S - phpguru.org, nice domain name. = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mysql query for current id-1
Hi, The reason probably is that you're limiting from the 2nd row, instead of the first, 0 is the row starting point (I think). So : $sql=select id,agent,host, DATE_FORMAT(time_in, '%M %d, %Y, %l:%i') AS unixdate from logged_in WHERE userid='$current_user' ORDER BY id DESC LIMIT 0, 1; = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie But Urgent
Hi, Well take a look at a library I've implemented in PHP : http://www.paphe.com/php/scripts/authlib.html P.S - PHP is way faster, and ofcourse much more elegant than ASP, however it's a matter of personal preference. = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sessions in php4
Hi, Well probably because you've got that automatic PHPSESSID thing carryover in your php.ini which through your situation indicates that it doesn't work in a header() so either you'll put cookies on, or use PHPSESSID. = * Know more about me: http://www.geocities.com/mimodit * __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] script execution stops after mail()
Hi, Well the PHP script is timing out after it executes a no. of (or all the mail() commands). So what you got todo is either set the PHP's timeout limit to 0 or infinite. set_time_limit(0); Or you could invoke another program in the background disconnect PHP (terminal) from it, and voila. But if you want the mail command to be executed before anything else you will have to set the execution limit to infinite, or increase it to a very big limit, and also use ignore_user_abort(1); --- Vincent [EMAIL PROTECTED] wrote: Hi, I've been skipping a night over this strange error: after execution of a mail() command, de rest of the script just gets ignored and my browser displays a Cannot find server or DNS Error page instead. Ideas about how to make this baby work would be very welcome; thanks in advance. I'm using PHP 4.0.6 on Apache/1.3.20 and sendmail -t -i. Just in case that helps. Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = * http://www.geocities.com/mimodit * __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] FileSize -- fread($fd, 7000)
Hi, fread($fd, filesize(somefile.txt)); --- Augusto Cesar Castoldi [EMAIL PROTECTED] wrote: Hi. instead use 7000 in fread($fd, 7000), i'd like to use the size of the file opened. How can I know the size of the fopen? thanks. Augusto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = * http://www.geocities.com/mimodit * __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Try to get PHP to read the content from MS Word
Hi, MS Word encodes it's contents, so you'll need to use the COM interface to access MS Word Files. A tutorial is available @ http://www.xeru.com on COM with PHP4. --- Jack [EMAIL PROTECTED] wrote: Dear all I'm trying to get PHP to read the content which created by MS Word.But when php runs, and it just return Nothing (Blank ) to the browser!! Actually , i was thinking to make a HTML Page which can let user to type in the content, then the content will copy to a file and finally a php will pick the content of that file and display it to browser! I had tried to use fput and fgets before, which it work, but the second time i type in something again from the input HTML, it doesn't change the content of that file. actually it remain the same as i last type in!!! IS there any good suggestion for performing this task??? User Input --- Copy content to a file --- Read content display to browser! Thx jack [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = * http://www.geocities.com/mimodit * __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] FileSize -- fread($fd, 7000)
Hi, It doesnt' matter what you're doing, filesize will give you what it reads from the particular file. --- Augusto Cesar Castoldi [EMAIL PROTECTED] wrote: ops. I forgot to say. but I'm calling a script, so I get diferents filesizes $fd = fopen(http://localhost/script.php;, r); $aux = fread($fd, 70); fclose($fd); Can I now the size of $fd? Well, I need to ready all $fd. thanks. Augusto - Original Message - From: Mukul Sabharwal [EMAIL PROTECTED] To: Augusto Cesar Castoldi [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 16, 2001 9:08 AM Subject: Re: [PHP] FileSize -- fread($fd, 7000) Hi, fread($fd, filesize(somefile.txt)); --- Augusto Cesar Castoldi [EMAIL PROTECTED] wrote: Hi. instead use 7000 in fread($fd, 7000), i'd like to use the size of the file opened. How can I know the size of the fopen? thanks. Augusto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = * http://www.geocities.com/mimodit * __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = * http://www.geocities.com/mimodit * __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] script execution stops after mail()
Hey, It can be issues that PHP doesn't have control over for example if your systems' sendmail is being used by 100's of users, maybe it's taking for your request to be processed. So it could be more than just PHP, but you should basically when sending mail just but the mail in background. --- Vincent [EMAIL PROTECTED] wrote: Thanks, but for now the mail()-function is only used once. I already found the timeout-issue in the manual and will use your tip when I expand it to serve a mailing list. Have you ever heard of this problem before, so it could be a bug? Or is there something special with the quotes to do? I remember an earlier website I built that had problems too, but they were solved when I replaced single quotes by doubles. Back then, the error-page didn't appear also. Vincent -Original Message- From: Mukul Sabharwal [mailto:[EMAIL PROTECTED]] Sent: donderdag 16 augustus 2001 13:57 To: Vincent; [EMAIL PROTECTED] Subject: Re: [PHP] script execution stops after mail() Hi, Well the PHP script is timing out after it executes a no. of (or all the mail() commands). So what you got todo is either set the PHP's timeout limit to 0 or infinite. set_time_limit(0); Or you could invoke another program in the background disconnect PHP (terminal) from it, and voila. But if you want the mail command to be executed before anything else you will have to set the execution limit to infinite, or increase it to a very big limit, and also use ignore_user_abort(1); --- Vincent [EMAIL PROTECTED] wrote: Hi, I've been skipping a night over this strange error: after execution of a mail() command, de rest of the script just gets ignored and my browser displays a Cannot find server or DNS Error page instead. Ideas about how to make this baby work would be very welcome; thanks in advance. I'm using PHP 4.0.6 on Apache/1.3.20 and sendmail -t -i. Just in case that helps. Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = * http://www.geocities.com/mimodit * __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ = * http://www.geocities.com/mimodit * __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Sharing session data with Perl
Hi, It's not really very trivial. But since I don't PHP sessions that much I might be incorrect, however if you're not wanting to use WDDX, you'll probably have to dawn some light on the raw sessions. Shifting control across processes is fairly simple, in the UNIX environment, and executing another process cane be achieved by making a call to exec() or other system related functions in the PHP library. Exec will return control to the php script, which can possibly depending on what you want, maybe able to bring some data back from the perl script. HTH. = * http://www.geocities.com/mimodit * __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] stripping white space?
Hi, I take that you simply want to remove ALL whitespaces from a data block (variable). you could simply use str_replace( , , $var); --- Kurt Lieber [EMAIL PROTECTED] wrote: Is there a way using PHP to easily strip white space out of an html page as it's being sent to the client. That is to say, the page that we as developers work on is nicely formatted, indented, etc. but when it's sent out to the client, PHP will remove all the extra white space both to obfuscate the code and reduce the size a bit. For anyone who knows Cold Fusion, I'm looking for the PHP equivalent of the Suppress whitespace by default option in the Cold Fusion Server Administrator. (NOTE: I'm not looking for a discussion on the merits of stripping vs. not stripping white space characters or whether or not it really does any good -- I just want to know if it can be done easily using PHP) Thanks. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = * http://www.geocities.com/mimodit * __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Store PHP Code in MySQL?
Hi, ? while($data = mysql_fetch_array($result)) { echo $data[text]; } eval($data['text']); ? That'll work :-) http://www.php.net/manual/en/html/function.eval.html read that for more information. = * http://www.geocities.com/mimodit * __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
Re: [PHP] hmm sockets (again)
Hi, I might have missed a follow up or your original message, but have you tried socket_set_blocking() ? --- Joseph Blythe [EMAIL PROTECTED] wrote: Hey all, Just looked through the changelog for 4.0.5 and was suprised to see that the socket functions had not been fixed, (set_nonblock does not seem to work under linux), I have retried my scripts under the new version but nothing seems to have changed, For the time being I am going back to the network and filesystem functions which do seem to be more reliable now. I am a little confused though,about the following extracted from the changelog: Fixed a compatibility problem in some file functions (fgets, fputs, fread, fwrite). The ANSI standard says that if a file is opened in read/write mode, fseek() should be called before switching from reading to writing and vice versa. How does this affect calls to a fsockopen? Can anybody else can confirm that set_nonblock() is indeed broken. If it is I will make sure that the bug is reported. Regards, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] @ at the begining
Hey, @ simply means to suppress warnings, or errors! @functioncall(); would simply not display an error or warning, incase it caused one or more. = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Programming Jobs - what I look for.
--- Michael Kimsal [EMAIL PROTECTED] wrote: To follow up just a bit more, here are skills I would require of someone before hiring them: * Practical SQL knowledge, with hands-on experience of at least 6 months (with projects/URLs to show for it) with either MySQL, Postgres, MSSQL, Oracle, DB2 or another high-level DB system (preferably more than one, but we'll take just one). * At least 6 months of practical PHP knowledge - projects/URLs to show for it. * Ability to design/debug complex HTML tables, or create scripts to do the same. :) * Ability to talk me through at least 2 ways of solving a data manipulation problem, without code - whiteboard/paper/hand gestures and words only. You also need to be able to argue why one method is better over another. You don't have to be right, but you have to be able to justify your choices. * Understanding of HTTP, session management, cookies, etc. * More than a passing interest in new technologies, and how to apply your current skills to those new areas (wireless, etc.) * Willingness to work weekends/evenings, if need be, to meet deadlines. Well what better opputunity is there to post your resume link, an employer sitting right here (or there), and not being considered as spam -:) http://www.devhome.net/resume.txt i've been working on php since hmm... quite some time, maybe 2 years back or more, a hop from perl, never looked back though. my resume does explain much of my knowledge, so i'll let anyone interested go there :-) well not many php jobs in india sadly -:( my php projects have been diverse, but the only when you'll be able to appreciate is http://www.devhome.net a site i keep working on, and some of you even may know of. thanks There are some tech things above, and some personality things. I don't care too much if the projects people show me are personal or professional, as long as they get excited about some of those projects - either by talking about the skills they gained or mistakes they made, or about how these projects can be adapted to other situations. I'm not dogging you personally Jon - I don't even know you. I'm just speaking as an employer in the web services field - these are the skills I generally look for in people. :) My guess is that others have similar criteria, but I may be way off base. Jon Jacob wrote: I hope this is not off topic, but I need to ask a general audience this question and this seems like the right group. I have been out of work for two months and I am not sure why. I am a talented web programmer with three years experience, strong Perl, JavaScript, CGI, and HTML skills and a great work ethic. I have been offered a job (which I turned down) but nothing desirable has come my way. I know the economy is slow, but I am shocked that I am out of work for this long. Are others experiencing this, or is it just me? I live in Portland, OR which is not the center of the tech universe but has strong tech companies nonetheless. I am just confused and am wondering if it is something I am doing or something that is being done to me. If the later, I can wait it out, but I just wanted to know if anyone in my silimiar situation was experiencing something the same and had any insight to share. I apologize for the vent, but it is starting to become frustrating and confusing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Programming Jobs - what I look for.
oops, a 404, well try http://www.devhome.net/resume.txt in txt and http://www.devhome.net/resume.doc in word! :) --- Mukul Sabharwal [EMAIL PROTECTED] wrote: --- Michael Kimsal [EMAIL PROTECTED] wrote: To follow up just a bit more, here are skills I would require of someone before hiring them: * Practical SQL knowledge, with hands-on experience of at least 6 months (with projects/URLs to show for it) with either MySQL, Postgres, MSSQL, Oracle, DB2 or another high-level DB system (preferably more than one, but we'll take just one). * At least 6 months of practical PHP knowledge - projects/URLs to show for it. * Ability to design/debug complex HTML tables, or create scripts to do the same. :) * Ability to talk me through at least 2 ways of solving a data manipulation problem, without code - whiteboard/paper/hand gestures and words only. You also need to be able to argue why one method is better over another. You don't have to be right, but you have to be able to justify your choices. * Understanding of HTTP, session management, cookies, etc. * More than a passing interest in new technologies, and how to apply your current skills to those new areas (wireless, etc.) * Willingness to work weekends/evenings, if need be, to meet deadlines. Well what better opputunity is there to post your resume link, an employer sitting right here (or there), and not being considered as spam -:) http://www.devhome.net/resume.txt i've been working on php since hmm... quite some time, maybe 2 years back or more, a hop from perl, never looked back though. my resume does explain much of my knowledge, so i'll let anyone interested go there :-) well not many php jobs in india sadly -:( my php projects have been diverse, but the only when you'll be able to appreciate is http://www.devhome.net a site i keep working on, and some of you even may know of. thanks There are some tech things above, and some personality things. I don't care too much if the projects people show me are personal or professional, as long as they get excited about some of those projects - either by talking about the skills they gained or mistakes they made, or about how these projects can be adapted to other situations. I'm not dogging you personally Jon - I don't even know you. I'm just speaking as an employer in the web services field - these are the skills I generally look for in people. :) My guess is that others have similar criteria, but I may be way off base. Jon Jacob wrote: I hope this is not off topic, but I need to ask a general audience this question and this seems like the right group. I have been out of work for two months and I am not sure why. I am a talented web programmer with three years experience, strong Perl, JavaScript, CGI, and HTML skills and a great work ethic. I have been offered a job (which I turned down) but nothing desirable has come my way. I know the economy is slow, but I am shocked that I am out of work for this long. Are others experiencing this, or is it just me? I live in Portland, OR which is not the center of the tech universe but has strong tech companies nonetheless. I am just confused and am wondering if it is something I am doing or something that is being done to me. If the later, I can wait it out, but I just wanted to know if anyone in my silimiar situation was experiencing something the same and had any insight to share. I apologize for the vent, but it is starting to become frustrating and confusing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] C and PHP
you can use shared memory functions to ineract between C and PHP. --- Ft Karras [EMAIL PROTECTED] wrote: Somebody knows if it is possible to link C and PHP? I have a C library and need to 'include' with PHP code, as it does PERL, is it possible? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Running a script without flowing
hey, exec("foo /some/file 21 "); or register_shut_down("whatever"); incase it's a C program that does the math, you could make it a daemon like thing: and do that math in the main :-) #include sys/types.h #include sys/time.h #include stdlib.h #include stdio.h #include string.h #include signal.h #include unistd.h // copyright 2001, mukul sabharwal [[EMAIL PROTECTED]] void get_into_background(void) { pid_t pid; // all the familiar kitchenware! pid = fork(); if(pid != 0) exit(0); setsid(); // sets out process and group id as part of the session // but only if the process ain't a leader, hehe close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); // the program shouldn't acquire a terminal signal(SIGHUP, SIG_IGN); // incase we get HUP'd, ignore! pid = fork(); if(pid != 0) exit(0); chdir("/towhere"); umask(0); } void the_actual_exec(void) { char buffer[1024]; char *args[3]; args[0] = "ls"; args[1] = "-F"; args[2] = 0; execv("/bin/ls", args); // 0 terminated array perror("execv"); // as exec dont return nutting // going past exec is an ERROR } int main(int argc, char **argv) { get_into_background(); the_actual_exec(); return 0; } = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] writing to a file
heyo, http://devhome.net/php/tutorials/230101.html will be nice --- adam [EMAIL PROTECTED] wrote: how do i write to the beginning of a file instead of the end? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Two Way Encryption
Hey, http://www.devhome.net/php/tutorials/230101.html that's RC4 implementation in PHP. you don't need mcrypt. --- Joe Njeru [EMAIL PROTECTED] wrote: Hi All, I'm looking for a two way encryption function that I can use to encrypt a cookie value. I have had experience with MD5 but its one way. Is there one I can use with a key in php? Thanks in advance, Joe Njeru, Nairobi Kenya. "Where the women are beautiful" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP.Net India
Hi, Well this is the second time I've made such an announcement. I was wondering if some individuals or groups would be interested in mirroring PHP.net for indian programmers, so that downloads are faster ? If not a complete mirror, atleast manuals, and binaries, and tars. thanks, www.devhome.net = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] file access(mpeg) only for authenticated people
Hey, Well sure there is: $fp = fopen($filename, 'r') or die('damn'); $read = fread($fp, filesize($filename)) or die('damn'); $filestr = basename($filename); header("Content-Disposition: attachment; filename=$filestr"); header("Content-Type: application/octet-stream"); echo $read; exit; Neat And Clean! Your authentication can be done above that piece of code, you then open the file, read it through send the filename download as $filestr, and the contents $read. Simple! --- Thorsten Gutermuth [EMAIL PROTECTED] wrote: Hi! I'm trying to make some mpegs available only to people who authenticated themselves using php. But all the solutions I found somewhat unpleasant because I uses chmod to set the file attributes to u=rw and then used either i) readfile("ftp://name:password@server/path//test.mpeg"); or ii) header ("Location: ftp://name:password@server/path/test.mpeg"); But in case i) the browser asks if I want to download the file or view it. If I choose view the browser suggests to save the movie as myscript.php and if I choose view it doesn't display anything. ii.) the browser displayes my username and password in the statusbar And in both cases it downloads the whole file(I guess cause I use ftp) before starting the mpeg programm(where nothing happens afterwards in case i) Is there a better way? Like telling the server via http my login data and sending the file to the users browser? Thanks Thorsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Background processing / forking
Hi Natasha, Well the probably easiest shitty way to do it is: exec("theprogram 1 /some/file 21 "); would exec()ute theprogram and will put it's output in /some/file and stderr's output also in the /some/file, and at last signifies the backgroundness of the program. however as you mentioned C, the better way could fork it in C, and since i don't wanna get offtopic i won't mention it here. -:) HTH --- Natasha [EMAIL PROTECTED] wrote: hey, i wanted to know if there's a fork function in php, cause i don't see it in the manual. I basically wanna call a C program from PHP. Now the problem is that the C program will be running for longs periods like maybe half or even an hour. So i would basically want to just execute the program and return control to the script immediately so that the c program continues it's work. it's easy with forking. but i dont see it in php. thx. __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] background processing / forking
Disclaimer: The following post contains C code for *nix! Viewer discretion recommended! Hi, I'm back, I couldn't resist you mentioning C, so as you did, big fault, the code that follows is probably much better than exec, as an stderr terminal will still be attached, but anyway: exec("yourprogramname"); this /should/ work, if it don't then the before exec i mentioned would work! #include sys/types.h #include sys/time.h #include stdlib.h #include stdio.h #include string.h #include signal.h #include unistd.h void get_into_background(void) { pid_tpid; // all the familiar kitchenware! pid = fork(); if(pid != 0) exit(0); setsid(); // sets out process and group id as part of the session // but only if the process ain't a leader, hehe close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); // the program shouldn't acquire a terminal signal(SIGHUP, SIG_IGN); // incase we get HUP'd, ignore! pid = fork(); if(pid != 0) exit(0); chdir("/towhere"); umask(0); } void the_actual_exec(void) { charbuffer[1024]; char*args[3]; args[0] = "ls"; args[1] = "-F"; args[2] = 0; execv("/bin/ls", args); // 0 terminated array perror("execv"); // as exec dont return nutting // going past exec is an ERROR } int main(int argc, char **argv) { get_into_background(); the_actual_exec(); return 0; } = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] encrypt and decrypt in standard PHP
Hi, You can also use an RC4Encryption / Decryption class made in PHP. http://www.devhome.net/php/tutorials/230101.html it's pretty easy to use. --- Richard Lynch [EMAIL PROTECTED] wrote: You could use popen() to execute http://gnupg.org or PGP... It would be easier to recompile PHP, though, and performance on popen() is going to suck. You *might* be able to compile just the encryption module, and use dl("mcrypt.so") in your PHP script to load it up rather than recompile all of PHP, but again, it's going to be harder, and performance will suffer. Compiling PHP the *second* time is *way* easier than the first time, especially if you've saved your previous PHP source tree and all the other source trees -- There's a file in the PHP source tree called config.status, and some other config.* files, that "remember" what you did last time. So, copy those somewhere safe, and then look at them. You'll probably be able to copy config.status to config.zhu, and then edit that to add --with-mcrypt (or whatever it is), and do: chmod 755 config.zhu ./config.zhu -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Zhu George-CZZ010 [EMAIL PROTECTED] Newsgroups: php.general Sent: Friday, February 23, 2001 11:07 AM Subject: [PHP] encrypt and decrypt in standard PHP As the PHP manual indicates, we can use Mcrypt to do the encrypt and decrypt work in PHP, but that needs to download the encrypt module and recompile PHP. Is there any other way to encrypt and decrypt the string in standard PHP4.0.4 without any extension module? Thank you very much! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to get new row on top?
I'm not quite sure what that code has to do with anything, but anyway, incase you're using files, you can open the file with the 'a' flag, using fseek goto 0byteth, and append from there. $fp = fopen('file', 'a'); fseek($fp, 0); fwrite... or whatever here. --- Jan Grafstrm [EMAIL PROTECTED] wrote: Hi! I have this code: $message = ereg_replace("\r\n\r\n", "\nP", $message); And the new rows are placed under the old ones. I want to change so the old messages get placed under is that possible? Thanks for help. Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to get new row on top?
if ($message) { /* uncomment the next two lines to strip out html from input */ /* $name = strip_tags($name); */ /* $message = strip_tags($message); */ $message = ereg_replace("\r\n\r\n", "\nP", $message); $date = date("l, F j Y, h:i a"); $message = "B$name /B -- $dateP $message BRHR"; $fp = fopen (basename($PHP_SELF) . ".comment", "a"); fseek($fp, 0); // works both with php4.0.1pl1 , fwrite ($fp, $message); fclose ($fp); } @readfile(basename(($PHP_SELF . ".comment"))); --- Jan Grafstrm [EMAIL PROTECTED] wrote: Thank You for the answer. Here is my file: if ($message) { /* uncomment the next two lines to strip out html from input */ /* $name = strip_tags($name); */ /* $message = strip_tags($message); */ $message = ereg_replace("\r\n\r\n", "\nP", $message); $date = date("l, F j Y, h:i a"); $message = "B$name /B -- $dateP $message BRHR"; $fp = fopen (basename($PHP_SELF) . ".comment", "a"); fwrite ($fp, $message); fclose ($fp); } @readfile(basename(($PHP_SELF . ".comment"))); - And here is a html form placed. - When I submit the form I can se the result on the top of the same page with newest message at the bottom. I you know how to get latest message at the toprow I am greatful for an answer. Regards Jan 2001-02-16 18:38:36, Mukul Sabharwal [EMAIL PROTECTED] wrote: I'm not quite sure what that code has to do with anything, but anyway, incase you're using files, you can open the file with the 'a' flag, using fseek goto 0byteth, and append from there. $fp = fopen('file', 'a'); fseek($fp, 0); fwrite... or whatever here. --- Jan Grafstrm [EMAIL PROTECTED] wrote: Hi! I have this code: $message = ereg_replace("\r\n\r\n", "\nP", $message); And the new rows are placed under the old ones. I want to change so the old messages get placed under is that possible? Thanks for help. Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ Jan Grafstrm Lillemans Hus AB Sweden +46 (0)611 60920 +46 (0)70 6409073 = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is there a MOD function in PHP
$remainder = 10 % 5; --- Randall Perry [EMAIL PROTECTED] wrote: Couldn't find one in the manual under arithmetic functions. -- Randy Perry sysTame Mac Consulting/Sales -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Count columns in array
Hi, Well it depends, on which elements /2nd/ dimension you wanna see! here's some code: $myarr[0][0] = "sdkjsjks"; $myarr[1][0] = "dsjkdkjsd"; $myarr[1][1] = "hsjdsh"; $myarr[1][2] = "dsjkdsjkdkjsdkjs"; echo sizeof($myarr); // would print 2, element 0 and 1. echo sizeof($myarr[0]); would print 1, 0 of 0. echo sizeof($myarr[1]); would print 3, 3 of 1. Hope that helps. It goes on into as many dimensions! = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Searching HTML file for tr tags
Hi, You've forgot to put fread() : ? $file = fopen('closings.html', 'r'); if (!$file) echo 'Error opening file'; else echo 'got the filebr'; $data = fread($file, filesize('closings.html')); if (eregi('trtdStratford/tdtdClosed/td/tr', $data)) echo 'Stratford closed'; else echo 'Stratfor open'; ? --- Tyler Longren [EMAIL PROTECTED] wrote: Hello everybody, Here's my code: ? $file = fopen("closings.html", "r"); if (!$file) { print "Error getting file"; } else { print "Closings.html has been gottenBr"; if (eregi("trtdStratford/tdtdClosed/td/tr",$file)) { print "Stratford Closed"; } else { print "Stratford Open"; } } ? The file closings.html has tables with weather related closings. I want to search closings.html for this line: trtdStratford/tdtdClosed/td/tr If that line is found, it prints "Stratford Closed", if it finds that line, it prints "Stratford Open". I'm not sure that the file is even open all the way. Thanks everyone! Regards, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RC4 Encryption / Decryption Class
Hi, I've made a small class that adds RC4 encryption functionality to those versions of PHP which don't have mycrypt either installed or the specific version for RC4 is not installed. It's a class that simply requires you to pass some parameters, like key, and the plaintext, and an optional decrypting value. http://devhome.net/php/ http://phpclasses.upperdesign.com/browse.html/package/146 Thanks. = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] archiving php lists ?
hi, how do sites like http://marc.theaimsgroup.com, make mailing list indexes, like even phpbuilder and zend's site which archive the list. How do they index all the message ? thanks. = To Find Out More About Me : http://mukul.tsx.org/ __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] problem using flock()
Hi, Well the problem might be while obtaining the lock. fopen() with let's say 'a' will open the file, and put the cursor to the very last byte. The time period between opening the file and getting the lock is probably where you're clobbered. At let's say time X, a file is opened and the writing lock is obtained at X.2 (2 seconds later), if something has been written to the file in these 2 seconds, then you've had it, the cursor will remain at the position of X. So a work around could be doing an fseek() after obtaining the lock. http://www.devhome.net/php/tutorials/ Look at the File Handling in a Nutshell, it has some detailed info. On Sat, 13 Jan 2001, 10,000 Screaming Monkeys wrote: Hi, I'm having a problem with one of the PHP scripts I've written and I'm hoping someone can point me in the right direction. The portion of the script that is giving me trouble is the locking of, and writing to, a logfile (plain text). I'm using flock() as I understand it and have looked at the online manual page for it to no avail... What's happening is, under "high" traffic conditions on the website I wrote the script for, the logfile is occasionally getting clobbered. I tried one of the suggestions on the man page (the one by [EMAIL PROTECTED]), but it resulted in the logfile being appended to, rather than properly updated as I want. (better than being clobbered, but rather confusing to cleanup after later...) Here is an example snippit of the script. Can anyone tell me what I might be doing wrong, or suggest a better/more efficient way to write this? BEGIN CODE SNIP if (@fopen($dlfile, "r")) { $log_entries = file($download_log); $total = count($log_entries); $dl_time = time(); for ($i=0; $total$i; $i++) { $split = explode("||", $log_entries[$i]); if ($stats_url == $split[1]) { // If the file being downloaded is already in the logfile, // increment the download count and update the $dl_time $fp = fopen($download_log, "r"); flock($fp,1); $x = fread($fp, filesize($download_log)); fclose($fp); $fp = fopen($download_log, "w"); flock($fp,2); // Increment download counter $add = $split[0]+1; // Do the actual update of the download count latest dl time $x = str_replace("$split[0]||$split[1]||$split[2]||$split[3]||$split[4]||", "$add||$split[1]||$split[2]||$dl_time||$split[4]||", $x); fwrite($fp, $x); fclose($fp); $write = 1; } } if ($write != 1) { // The file being downloaded is not in the logfile -- // add it now and start its counter at 1 $fp = fopen($download_log, "a"); flock($fp,2); $fw = fwrite($fp, "1||$stats_url||$dl_time||$dl_time||dir2=$dir2file=$urlfile||\n"); fclose($fp); } } END CODE SNIP Thanks...I'm desperate... - Jamie -- The sweetest cherry in an apple pie [EMAIL PROTECTED] (Single purpose Email address) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = To Find Out More About Me : http://mukul.tsx.org/ __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]