[PHP] Yawn, good morning? night? Whateva! :)
Good day, morning, night? It's dark, so that makes it sleepy bye time. Bit before I do, I'm trying to work this out. I have a little bit of code to print Next n articles in my database. Can someone help me straighten out these lines of code, pretty please ... before I go fleeping nuts :) if(!$rendu) { $rendu = 0; } $nombre = 10; $news = mysql_query(select * from $table ORDER by DT desc); $num_rows = mysql_num_rows($news); $nouveau = $rendu + $nombre; if ($nouveau $num_rows) { if ($nombre $num_rows) { $nouveau = $num_rows - $nombre; #when there are 23 articles, and I am number 20 on the screen, I want to display the remaining 3, not ten. } $myinsert = font face=\arial\ size=2A HREF=\index.html?rendu=.$nouveau.\Next .$nouveau. Articles gt;gt;/a/font\n; } John ?php if(!$rendu) { $rendu = 0; } $nombre = 10; #$myconnection = mysql_pconnect($server,$user,$pass); $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myconnection); $news = mysql_query(SHOW TABLE STATUS FROM .$db. LIKE '$table'); while ($news_story = mysql_fetch_array($news)) { $table_comment = $news_story['Comment']; } $news = mysql_query(select * from $table ORDER by DT desc); $num_rows = mysql_num_rows($news); $news = mysql_query(select * from $table ORDER by DT desc LIMIT $rendu,$nombre); $old_WHO = ; while ($mydata = mysql_fetch_object($news)) { $mydata-RQ = str_replace(\r, , $mydata-RQ); $mydata-RQ = str_replace(\n, br, $mydata-RQ); $mydata-RQ = str_replace(brbr, p, $mydata-RQ); $mydata-CM = str_replace(\r, , $mydata-CM); $mydata-CM = str_replace(\n, br, $mydata-CM); $mydata-CM = str_replace(brbr, p, $mydata-CM); ### Display WHO Once if ($old_WHO != $mydata-WHO) #when WHO occurs the first time, echo it once only. { $old_WHO = $mydata-WHO; $body .= bFrom .$mydata-WHO.:/b; } ## Description ### if($mydata-RQ) $body .= ol.$mydata-RQ./ol\n; ## Description ### if($mydata-CM) $body .= olsmall.$mydata-DT. - font color=\blue\i.$mydata-CM./i/font/small/olbr\n; }#end of while mysql_close($myconnection); # $nouveau = $rendu + $nombre; if ($nouveau $num_rows) { if ($nouveau $num_rows) { $nouveau = $num_rows - $nouveau ; } $myinsert = font face=\arial\ size=2A HREF=\index.html?rendu=.$nouveau.\Next .$nouveau. Articles gt;gt;/a/font\n; } # echo h2 align=center.$table_comment./h2 ul h3$course_description/h3 .. $myinsertbr .. $num_rowsbr .. $nouveau = $rendu + $nombrebr if ($nouveau $num_rows)br ol $body /ol hr /ul; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sending an e-mail to 1,000 people
Hello, B Richards wrote: How many emails per hour can people generate on a typical dedicated server? on qmail? on smtp? It depends on many things. Anyway, queueing is one thing and delivering is another. Queuing and delivering from the same machine is usually slow because it requires the server to resolve the domain and connecting with each recipient MX to deliver the messages. If the connection is slow, everything is stalled. For very large recipient lists like large mailing lists sites like eGroups, the recommended setup is at least one server for queuing the messages in one or many others. The queuing is best achieved using QMQP. SMTP is too slow because it degrades queuing speed exponentially with the number of recipients. Anyway in a network with one server for queueing (where ezmlm was) and 8 servers for delivery, it could queue 10.000 messages per minute using SMTP. With QMQP it would be much faster queueing because it would not expand VERP addresses and would only queue one message in the delivery servers. The actual delivery it depends a lot on the Internet link you have and the connectivity with the remote servers. Bouncing and hard to connect servers make it very slow. That is why it is important to prune the bouncing addresses from your mailing lists. ezmlm process is reasonably good handling bounces but I would not recommend starting a mailing list with a large number of subscribers without first pruning it because the last retry message that is sent to all bouncing addresses after 11 days (1.000.000 seconds) may choke your queuing server because it send out individual messages and if there are many bouncing addresses that can make your machine and network choke with very high traffic. Trust me, I had to put up with the embarrassment of choking a newsletter server with 1/3 of near 300.000 subscribers of MTV Brasil newsletter! Can you imagine almost 100.000 subscribers being mailed and bouncing at the same time. (Gulp!) Living and learning. :-) Regards, Manuel Lemos - Original Message - From: Manuel Lemos [EMAIL PROTECTED] To: Ed Lazor [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, February 02, 2002 9:09 PM Subject: Re: [PHP] Re: Sending an e-mail to 1,000 people Hello, Ed Lazor wrote: At 06:25 PM 2/2/2002 -0500, Chris Cocuzzo wrote: Godamnit. Shut-up about this already for godsakes and answer the original question!! LOL hehe good point Chris. Aleluia, somebody sensible! :-) Ben Clumeck [EMAIL PROTECTED] wrote in message I would like to send an e-mail (the same e-mail) to 1,000 different people. I want each persons name to be in the To: field. Is there a way to customize it to where it can say Dear (having a different persons name corresponding to an e-mail address) so that it looks customized. Ben, how you approach this will depend on how you have the data stored. Let's assume two things: you have the e-mail addresses and names in a database and know how to retrieve and store them into the variables $email and $name. That said, create the body of your text: $body = Dear $name, Here are recent developments on our web site... etc. ; Then use the mail function (http://www.php.net/manual/en/function.mail.php) to send the letter to the person like this: mail($email, Site update, $body, From: [EMAIL PROTECTED]); The next thing you'll probably start wondering is how to send fancy e-mail instead of those generic text based ones... PHPBuilder has an article you'll want to check out located here: http://www.phpbuilder.com/columns/kartic2807.php3. I do not advice anybody to send personalized bulk mail, even less in PHP. It will take a lot of time to just queue the message in the local relay mail server and since each message has to be stored separately in the mail server queue disk consuming a lot of space. What I recommend is to just queue a single message with all recepients in Bcc:. This is better done with qmail using qmail-inject because you do not have to actually add Bcc: headers to the message, just the recipients addresses, one per line, and then headers and the body of the message. You may want to try this class for composing and sending MIME messages. It has subclasses for queing with PHP mail function, SMTP server, sendmail and qmail. http://phpclasses.upperdesign.com/browse.html/package/9 If you can use it, I recommend to use qmail because it is much faster than the other alternatives to queue message to be sent to many recipients and also provides very good means to figure exactly which addresses are bouncing your messages so you can process them eventually unsubscribing the users in question, thanks to its VERP capability (Variable Envelope Return Path). http://www.qmail.org/ If you want to send messages regularly to the same group of
Re: [PHP] Re: Sending an e-mail to 1,000 people
Hello, B Richards wrote: How many emails per hour can people generate on a typical dedicated server? on qmail? on smtp? It depends on many things. Anyway, queueing is one thing and delivering is another. Queuing and delivering from the same machine is usually slow because it requires the server to resolve the domain and connecting with each recipient MX to deliver the messages. If the connection is slow, everything is stalled. For very large recipient lists like large mailing lists sites like eGroups, the recommended setup is at least one server for queuing the messages in one or many others. The queuing is best achieved using QMQP. SMTP is too slow because it degrades queuing speed exponentially with the number of recipients. Anyway in a network with one server for queueing (where ezmlm was) and 8 servers for delivery, it could queue 10.000 messages per minute using SMTP. With QMQP it would be much faster queueing because it would not expand VERP addresses and would only queue one message in the delivery servers. The actual delivery it depends a lot on the Internet link you have and the connectivity with the remote servers. Bouncing and hard to connect servers make it very slow. That is why it is important to prune the bouncing addresses from your mailing lists. ezmlm process is reasonably good handling bounces but I would not recommend starting a mailing list with a large number of subscribers without first pruning it because the last retry message that is sent to all bouncing addresses after 11 days (1.000.000 seconds) may choke your queuing server because it send out individual messages and if there are many bouncing addresses that can make your machine and network choke with very high traffic. Trust me, I had to put up with the embarrassment of choking a newsletter server with 1/3 of near 300.000 subscribers of MTV Brasil newsletter! Can you imagine almost 100.000 subscribers being mailed and bouncing at the same time. (Gulp!) Living and learning. :-) Regards, Manuel Lemos - Original Message - From: Manuel Lemos [EMAIL PROTECTED] To: Ed Lazor [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, February 02, 2002 9:09 PM Subject: Re: [PHP] Re: Sending an e-mail to 1,000 people Hello, Ed Lazor wrote: At 06:25 PM 2/2/2002 -0500, Chris Cocuzzo wrote: Godamnit. Shut-up about this already for godsakes and answer the original question!! LOL hehe good point Chris. Aleluia, somebody sensible! :-) Ben Clumeck [EMAIL PROTECTED] wrote in message I would like to send an e-mail (the same e-mail) to 1,000 different people. I want each persons name to be in the To: field. Is there a way to customize it to where it can say Dear (having a different persons name corresponding to an e-mail address) so that it looks customized. Ben, how you approach this will depend on how you have the data stored. Let's assume two things: you have the e-mail addresses and names in a database and know how to retrieve and store them into the variables $email and $name. That said, create the body of your text: $body = Dear $name, Here are recent developments on our web site... etc. ; Then use the mail function (http://www.php.net/manual/en/function.mail.php) to send the letter to the person like this: mail($email, Site update, $body, From: [EMAIL PROTECTED]); The next thing you'll probably start wondering is how to send fancy e-mail instead of those generic text based ones... PHPBuilder has an article you'll want to check out located here: http://www.phpbuilder.com/columns/kartic2807.php3. I do not advice anybody to send personalized bulk mail, even less in PHP. It will take a lot of time to just queue the message in the local relay mail server and since each message has to be stored separately in the mail server queue disk consuming a lot of space. What I recommend is to just queue a single message with all recepients in Bcc:. This is better done with qmail using qmail-inject because you do not have to actually add Bcc: headers to the message, just the recipients addresses, one per line, and then headers and the body of the message. You may want to try this class for composing and sending MIME messages. It has subclasses for queing with PHP mail function, SMTP server, sendmail and qmail. http://phpclasses.upperdesign.com/browse.html/package/9 If you can use it, I recommend to use qmail because it is much faster than the other alternatives to queue message to be sent to many recipients and also provides very good means to figure exactly which addresses are bouncing your messages so you can process them eventually unsubscribing the users in question, thanks to its VERP capability (Variable Envelope Return Path). http://www.qmail.org/ If you want to send messages regularly to the same group of
Re: [PHP] RANT: Why doesn't PHP have built-in support for dynamic image generation?
PEAR? I think it would be better if someone did a real PHP module for ImageMagick, just like PerlMagick is for Perl. There is one at http://php.chregu.tv/imagick/, but it's far from complete. If someone would like to help him with the project then it would be great. ImageMagick is so much easier to install than GD, and it's a lot better too. // Victor. - Original Message - From: Weston Houghton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, February 03, 2002 8:45 AM Subject: Re: [PHP] RANT: Why doesn't PHP have built-in support for dynamic image generation? Anybody interested in working on a PEAR module to interface PHP with something like ImageMagick directly? I would love to see it. Maybe if I am unemployed long enough soon I can work on it myself. Not that I really want that to happen... I think that might be the best solution for PHP's lack of image functionality though... Wes Hi Erica, I feel your pain - I've been dealing with the same thing this week. I finally got the compile to complete and the system up and running, but it was painful. It seemed like everything was finished, but I've noticed high server loads (.8), trouble accessing web pages (I tested using wget and it had to try 6 times to get the page and kept reporting EOF in headers), and my MySQL server keeps reporting errors communicating with the web server, and dropped connections to the MySQL server. Safe to say, something didn't work and I need to start over and pray for the best. Have you gotten it to work properly? If so, what files did you use and what steps did you take in the install? -Ed At 11:24 PM 2/2/2002 -0800, Erica Douglass wrote: Forgive my grumpiness, but I've spent the last several hours trying to install GD, etc. Let's be honest. PHP needs built-in support for creating dynamic images. JSP already has this. Heck, you could even make it a configure option. As it stands now, you have to do the following: -- Install GD -- Install all of GD's numerous dependencies -- Install zlib -- Install freetype -- Install libttf THEN you have to compile PHP with all of the requisite options to enable GD here and Freetype there, and PHP often won't compile without specifying /path/to/various/options, so you have to dig around your system to find out where everything was installed. This results in a long and unwieldy configure statement which often does not work. PHP needs to have a simple configure option called --enable-dynamic-images or something similar. This should use built-in libraries that are downloaded with the PHP source to create PNG images. Images can then be created with standard PHP functions. This would be much more useful than relying on several third-party solutions which do not easily work with each other. This would also have the benefit of being more portable -- as I plan to release my code to several different people running different types of servers, I would like to minimize compatibility issues. If anyone has a better solution, feel free to email me. As it stands, I am very frustrated with this, and I haven't yet seen the light at the end of the tunnel. Thanks, Erica -- 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
[PHP] Re: Default mysql path
In article Pine.LNX.4.21.0202030030140.29558- [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hello, I have installed php and mysql in my machine.By default in which path php check for mysql Anyone can know this tell to me as soon as possible This question is a bit hard to answer without knowing what system (Windows, *nix etc) and how you installed - eg source. rpm, binary install. -- David Robley Temporary Kiwi! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-INST] Default mysql path
In article Pine.LNX.4.21.0202030112050.30779- [EMAIL PROTECTED], [EMAIL PROTECTED] says... Actually i have stored mysql in my machine in /usr/lib/mysql when i am tried to connect it is giving this error. nomysql support.From the prompt itself i can connect to mysql .using php script i can't connect. While in the installtion also i have mentioned the path for mysql I couldn't guess where is the error Can u guess where is the error?. If u came to know this tell me as soon as possible -Uma On Sat, 2 Feb 2002, David Jackson wrote: should be /usr/local/mysql. Uma Shankari T. wrote: Hello, I have installed php and mysql in my machine.By default in which path php check for mysql Anyone can know this tell to me as soon as possible -Uma This seems to be an ongoing case of you aren't quite understanding or listening to what you are being advised. If in fact you have installed mysql in /usr/lib/mysql (which seems an odd place) then configuring php with --with-mysql=/usr/lib/mysql should work. And as I think you have been advised, looking at a script with phpinfo() in it should tell you what stuff your compile has successfully included. -- David Robley Temporary Kiwi! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] inserting jpeg images into a interbase database
Hi 1. Can anyone help with inserting jpeg images into a interbase database from a php page? 2. What does this error message mean: Warning: InterBase module: invalid blob id 3.Must the subtype be set to 0 or must it be user-defined in interbase? ie User defined: JPEG BLOB SUB_TYPE -2 SEGMENT SIZE 100, 4. Can the segment size be 100? What does the segment size refer to? 5. How do I display/output the images from the database on a php page. Thanks! Sonya -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file validation
On Sun, 2002-02-03 at 02:35, Mike Frazer wrote: A slightly less cumbersome method than the while() loop below would be a foreach() loop: function check_file($filename) { if (!$lines = file($filename)) { return false; } foreach ($lines as $line) { $num_pipes = substr_count($line, '|'); if ($num_pipes 2 || $num_pipes 4) { return false; } } return true; } Same result, probably absolutely no measurable (and we're talking fractions of microseconds here) difference in speed, but much easier to read. That's a matter of opinion. In general, I've found while() to be 10-20% faster than foreach(), and the only reason foreach() makes any sense to me is because I've got a perl background. The style issue could be argued for days--go with what works for you. Torben Mike Frazer Lars Torben Wilson [EMAIL PROTECTED] wrote in message 1012602758.3230.127.camel@ali">news:1012602758.3230.127.camel@ali... On Fri, 2002-02-01 at 14:02, toni baker wrote: I would like to prevent users from uploading a file that contains more than 4 pipes or less than 2 pipes. The code below prevents users from uploading a file containing more than 4 pipes, but not less than 2 pipes. Should I use awk, ereg, or sed? Thanks Unless you *have* to spawn processes to do this for you for some reason, you can keep things a lot simpler by doing it in PHP, something like this: ?php error_reporting(E_ALL); function check_file($filename) { if (!$upload_file = file($filename)) { return false; } while (list(, $line) = each($upload_file)) { $num_pipes = substr_count($line, '|'); if ($num_pipes 2 || $num_pipes 4) { return false; } } return true; } $userfile = 'testpipes.txt'; if (check_file($userfile)) { echo File passed.\n; } else { echo File failed.\n; } ? Hope this helps, Torben system (/bin/cat $userfile|/bin/sed -n 's/.*|.*|.*|.*|.*|//p' pipes.txt; $fd =fopen(pipes.txt, 'r'); $pipes5=fgets($fd,50); echo ($pipes5); fclose($fd); if ($pipes5) { print wrong number of pipes; } The uploaded file below should not pass but it does: a|b|c|d|e a|b|c| a|b|c|d a|b a|b|c|d|e -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to call method from another class
Thanks Joel. I thought Sandeep meant I should create object A within object B in order to refer to the method in object A, but I guess that won't work. David - Original Message - From: Joel Boonstra [EMAIL PROTECTED] To: Sandeep Murphy [EMAIL PROTECTED] Cc: 'David Yee' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, January 28, 2002 12:07 PM Subject: RE: [PHP] How to call method from another class first create an instance of class B like this... $test = new classB(); Now, u can refer to any function or method of classB like this: $test-hello(); // where hello() is a method of classB.. That's not what the original question was, though. David (I think, unless I got my nested replies wrong), was looking to call a method of ClassA with an object of ClassB: If I have a PHP class (let's say it's called ClassA), how do I call a method from another class (ClassB) within ClassA? Thanks. The answer to this question, unless my OOP theory is gone, is that you can't, unless ClassB is an extension of classA. So if you have: class ClassA { // some vars function get_contents() { // some stuff return $something; } } and then: class ClassB extends ClassA { // some vars function display_contents() { print $this-get_contents(); } } Then you're good. Otherwise, I don't think it's possible... -- [ joel boonstra | [EMAIL PROTECTED] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RANT: Why doesn't PHP have built-in support for dynamic image generation?
In [EMAIL PROTECTED], Victor Boivie wrote: PEAR? I think it would be better if someone did a real PHP module for ImageMagick, just like PerlMagick is for Perl. There is one at http://php.chregu.tv/imagick/, but it's far from complete. If someone would like to help him with the project then it would be great. yeah. do it :) chregu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: imagecopy or why men don't use maps.
I think you might need to use $source = ImageCreateFromJPEG('map1.jpg'); I've created several maps using this method, although I am using PNG. You could see them at our web site but unfortunatly it's not parsing PHP correctly. Something went wrong during migration, but might be fixed in a couple of days. Hugh Danaher [EMAIL PROTECTED] wrote in message 000801c1ac61$a1d858c0$017f@localhost">news:000801c1ac61$a1d858c0$017f@localhost... Help! I have an image file which is a map of the local area. I want to put symbols on the map at various points, but I first need to get the php image function to work. My site has imaging enabled and I can create graphs from scratch, but this has stumped me so far. Any help will be greatly appreciated. Hugh code? below: $image=imagecreate(400,400); // created image // source image info $source=map1.jpg; $imageinfo = getimagesize($source); $source_00=0; // origin (0,0) $source_width=$imageinfo[0]; $source_height-$imageinfo[1]; $image_00=0; // origin (0,0) imagecopy($image,$source, $image_00, $image_00, $source_00, $source_00, $source_width, $source_height); / / this is line 36. Warning: Supplied argument is not a valid Image resource in /www/site.com/somepage.php on line 36 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Secure User Auth
Hi I have a web site that needs a secure login system. Users of the system can SSH in to the server, and POP, IMAP, Postgres and other services are provided, and I'd like the users to be able to log in to the site - obviously as securely as possible. Maybe using SSL + sessions? I have not used SSL or HTTPS before, and certainly not with PHP. Can anyone give me any suggestions? Thanks --jaa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convert PostgreSQL timestamp to nicer format
Hi How can I convert the PostgreSQL timestamp to several strings? This sort of thing: array($hour,$minute,$second,$day,$month,$year) = convert($timestamp) Thanks --jaa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-DB] PHP + Postgresql + Linux = Frustration
Is there an easy way to do this sort of stuff on Linux or is it better to just buy off the shelf products that work? Hi I hate to do the my distro is better than yours thing, but typing apt-get install postgresql postgresql-client apache php4 php4-pgsql at the command line on a Debian system will download and install it all automatically for you. Just configure the postgres settings to how you want them, edit the php.ini and httpd.conf files and that's it. I run a debian-based system at home with postgresql, apache and PHP4, and I've also set up web servers with this configuration on Debian boxes. If you're looking for ease-of-maintainence of a Linux server, then Debian is really the one you want to look at. --jaa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IP based redirection
Could you please tell us:We would like to redirect the user based on their Country so we are collecting their IP address. We have used SmartRedirect PHP software to do this but on some of our ISP it is not working, it shows you are from unknown country. We are located at New Delhi, India. Could you please tell us how we can do this in smartand effective way. Thanks, Shikha __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IP based redirection
Could you please tell us: We would like to redirect the user based on their Country so we are collecting their IP address. We have used SmartRedirect PHP software to do this but on some of our ISP it is not working, it shows you are from unknown country. We are located at New Delhi, India. Could you please tell us how we can do this in smart and effective way. Thanks, Shikha __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Adding 6 digits to a str?
Try http://php.net/str_pad Andy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi guys, I am trying to force a int to be 8 digits. If it is only 3 dig filling the first ones with 0. Anyhow I tryed it with type casting, but it does not matter what I try, I always get an addition. E.g: $member_id is: 136 should be: 0136 Here is the code, which is still returning 136: for($i=0;$icount($member_id);$i++){ $length = strlen($member_id[$i]); settype ($member_id[$i], string); $zero = '0'; settype ($zero, string); $member_id[$i] = $zero + $member_id[$i]; echo $member_id[$i]; } Does anybody know how to solve this thing?? Thanx Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] crypt/Password
Hi there, I'm creating a user/password table that will use either Mysql Password or PHP Crypt function to encrypt the data. I know these functions are non reversible for good reason, but how do I deal with a situation where I want to email out a forgotton password? How can I get the passwrd back to a form recognisable to the user? Thanx in advance Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crypt/Password
What you could do is send a newly generated password to them, and then allow them to change the password on your site to something easier to remember... Jeff At 11:56 PM 2/3/2002 +0800, Phil wrote: Hi there, I'm creating a user/password table that will use either Mysql Password or PHP Crypt function to encrypt the data. I know these functions are non reversible for good reason, but how do I deal with a situation where I want to email out a forgotton password? How can I get the passwrd back to a form recognisable to the user? Thanx in advance Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crypt/Password
Thanx, sounds like the way to go. Still curious though whether there is anyway at all to get the original password back to the user? Jeff Sheltren [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What you could do is send a newly generated password to them, and then allow them to change the password on your site to something easier to remember... Jeff At 11:56 PM 2/3/2002 +0800, Phil wrote: Hi there, I'm creating a user/password table that will use either Mysql Password or PHP Crypt function to encrypt the data. I know these functions are non reversible for good reason, but how do I deal with a situation where I want to email out a forgotton password? How can I get the passwrd back to a form recognisable to the user? Thanx in advance Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crypt/Password
Phil [EMAIL PROTECTED] wrote: Thanx, sounds like the way to go. Still curious though whether there is anyway at all to get the original password back to the user? not without storing it unencrypted or cracking the password with a dictionary attack. as you said, the php crypt() function and mysql's password() function are one-way algorithms. jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file validation
Your reply piqued my curiosity so I whipped together a script that times the execution of a foreach(), a while() and a for() loop executing the same commands. The results were rather surprising in some ways but not really overall. The while() loop is, as you stated, is quicker than a foreach() loop. However, the for() loop is the fastest of all three. Below are the results of three tests: Timed foreach() loop: 0.00766 sec. Timed while() loop: 0.00689 sec. Timed for() loop: 0.00676 sec. Timed foreach() loop: 0.00768 sec. Timed while() loop: 0.00688 sec. Timed for() loop: 0.00677 sec. Timed foreach() loop: 0.00770 sec. Timed while() loop: 0.00689 sec. Timed for() loop: 0.00674 sec. The loops were parsing the text in a text file. Again, we're talking about going down to 13/100,000th-second as an average speed gain with a for() loop over a while() loop. The average difference between foreach() and while() is considerably larger, approximately 79/100,000th. But again, you'd have to run through the complete execution of the loop (53 lines of text in the file) 1,266 times to lose a single second between foreach() and while(). A minimal gain in speed; I was just mentioning it because it's easier to read a foreach() loop. But in all fairness, because the for() loop was quickest, here is the code converted to for(): function check_file($filename) { if (!$lines = file($filename)) { return false; } for ($i = 0; $ sizeof($lines); $i++) { $num_pipes = substr_count($lines[$i], '|'); if ($num_pipes 2 || $num_pipes 4) { return false; } } return true; } I performed the test purely out of curiosity, not pride :) Thanks for the idea though, it was interesting to see the results. Mike Frazer PS - If you'd like the code for my Timer class, email me off-list and I'll send it to you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Secure User Auth
Well it depends what you want to do, Do they need to just get into the app or do they need to have different access levels? If they dont need access levels just use htaccess that should work out fine. -=Adam=- Quoting James Arthur [EMAIL PROTECTED]: Hi I have a web site that needs a secure login system. Users of the system can SSH in to the server, and POP, IMAP, Postgres and other services are provided, and I'd like the users to be able to log in to the site - obviously as securely as possible. Maybe using SSL + sessions? I have not used SSL or HTTPS before, and certainly not with PHP. Can anyone give me any suggestions? Thanks --jaa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - http://www.2ghz.net/ Welcome To the Future -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR IMAGICK [WAS- RANT: Why doesn't PHP have built-in support for dynamic]
Weston Houghton wrote: Anybody interested in working on a PEAR module to interface PHP with something like ImageMagick directly? I would love to see it. Maybe if I am unemployed long enough soon I can work on it myself. Not that I really want that to happen... I think that might be the best solution for PHP's lack of image functionality though... Wes Someone seems to have started this, although I'm not sure why he's not going more object-based. http://pear.php.net/manual/en/packages.imagick.php I would prefer something like $i = new Imagick(); $i-read(file); instead of $i= imagick_create(); imagick_read($i,file); Also, it's 'experimental' so might not have 100% of what you're looking for yet. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PEAR IMAGICK [WAS- RANT: Why doesn't PHP have built-in support for dynamic]
In [EMAIL PROTECTED], Michael Kimsal wrote: Weston Houghton wrote: Anybody interested in working on a PEAR module to interface PHP with something like ImageMagick directly? I would love to see it. Maybe if I am unemployed long enough soon I can work on it myself. Not that I really want that to happen... I think that might be the best solution for PHP's lack of image functionality though... Wes Someone seems to have started this, although I'm not sure why he's not going more object-based. http://pear.php.net/manual/en/packages.imagick.php I would prefer something like $i = new Imagick(); $i-read(file); instead of $i= imagick_create(); imagick_read($i,file); it's open source. just do it more object orientated ... and i'm sure the author (me...) will be very happy to impelement it ;) honestly, OO-Interface was and still is planned, but i think more functionality is much more needed at the moment than an oo interface. it was my first extension, so i wanted to keep it simple for the beginning. but if someone else likes to implement it earlier, i'm the last, who has a problem with that (and don't expect 00 soon from me ...) chregu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Secure User Auth
It wont matter if it is sent in clear text because at that point you are over https/SSL. The entire stream is encrypted. I understand the need for using the existing system. I think LDAP does look like a good way to go. -=Adam=- Quoting James Arthur [EMAIL PROTECTED]: On Sunday 03 Feb 2002 17:43, Viper wrote: Well it depends what you want to do, Do they need to just get into the app or do they need to have different access levels? If they dont need access levels just use htaccess that should work out fine. htaccess isn't secure enough, since it sends the password in plain text to the server. Besides, the users already have accounts on the server, so it would make more sense to authenticate against an existing system, like IMAP/POP3. Doing that's easy enough, and also has the side effect that when they log in it tells them whether they have new mail or not. The problem is finding a way to enter login details that does not send the password across the internet in plain text mode. The only way seems to use SSL, but I don't know how to implement it. --jaa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - http://www.2ghz.net/ Welcome To the Future -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: imagecopy or why men don't use maps.
Chris, Thank you for your help. I actually found an example on web monkey late last night for .gif and made the translation to .jpg. However, whatever color text I use, it turns out gray. Any help here would go down nicely. Hugh - Original Message - From: Chris Williams [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, February 03, 2002 8:29 AM Subject: [PHP] Re: imagecopy or why men don't use maps. I think you might need to use $source = ImageCreateFromJPEG('map1.jpg'); I've created several maps using this method, although I am using PNG. You could see them at our web site but unfortunatly it's not parsing PHP correctly. Something went wrong during migration, but might be fixed in a couple of days. Hugh Danaher [EMAIL PROTECTED] wrote in message 000801c1ac61$a1d858c0$017f@localhost">news:000801c1ac61$a1d858c0$017f@localhost... Help! I have an image file which is a map of the local area. I want to put symbols on the map at various points, but I first need to get the php image function to work. My site has imaging enabled and I can create graphs from scratch, but this has stumped me so far. Any help will be greatly appreciated. Hugh code? below: $image=imagecreate(400,400); // created image // source image info $source=map1.jpg; $imageinfo = getimagesize($source); $source_00=0; // origin (0,0) $source_width=$imageinfo[0]; $source_height-$imageinfo[1]; $image_00=0; // origin (0,0) imagecopy($image,$source, $image_00, $image_00, $source_00, $source_00, $source_width, $source_height); / / this is line 36. Warning: Supplied argument is not a valid Image resource in /www/site.com/somepage.php on line 36 -- 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 Digest 3 Feb 2002 19:53:11 -0000 Issue 1150
php-general Digest 3 Feb 2002 19:53:11 - Issue 1150 Topics (messages 83291 through 83324): Re: Mysql php 83291 by: Mike Frazer Re: file validation 83292 by: Mike Frazer 83303 by: Lars Torben Wilson 83317 by: Mike Frazer Re: Why doesn't PHP have built-in support for dynamic image generation? 83293 by: Ed Lazor 83294 by: Weston Houghton 83299 by: Victor Boivie 83305 by: Christian Stocker Re: Sending an e-mail to 1,000 people 83295 by: B Richards 83297 by: Manuel Lemos 83298 by: Manuel Lemos Yawn, good morning? night? Whateva! :) 83296 by: jtjohnston Re: Default mysql path 83300 by: David Robley Re: [PHP-INST] Default mysql path 83301 by: David Robley inserting jpeg images into a interbase database 83302 by: Sonya Davey Re: How to call method from another class 83304 by: David Yee Re: imagecopy or why men don't use maps. 83306 by: Chris Williams 83324 by: hugh danaher Secure User Auth 83307 by: James Arthur 83318 by: Viper 83319 by: James Arthur 83322 by: Viper Convert PostgreSQL timestamp to nicer format 83308 by: James Arthur Re: [PHP-DB] PHP + Postgresql + Linux = Frustration 83309 by: James Arthur IP based redirection 83310 by: Sweet Shikha 83311 by: Sweet Shikha Re: Adding 6 digits to a str? 83312 by: John Lim crypt/Password 83313 by: Phil 83314 by: Jeff Sheltren 83315 by: Phil 83316 by: Jim Winstead PEAR IMAGICK [WAS- RANT: Why doesn't PHP have built-in support for dynamic] 83320 by: Michael Kimsal 83321 by: Christian Stocker Talk with a remote script 83323 by: Alex Shi 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] -- ---BeginMessage--- Give us the exact error message, that probably will hold the answer. Mike Frazer Uma Shankari T. [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I am trying to connect php and mysql with the following syntax mysql_connect(localhost,username,password); But it is giving error NoMysql support. Also i have stored the files in another webserver and trying to connect the mysql and php in the localhost it is working properly.but it is not working if i have tried to connect in the localhost itself Then where is the problem... -Uma ---End Message--- ---BeginMessage--- A slightly less cumbersome method than the while() loop below would be a foreach() loop: function check_file($filename) { if (!$lines = file($filename)) { return false; } foreach ($lines as $line) { $num_pipes = substr_count($line, '|'); if ($num_pipes 2 || $num_pipes 4) { return false; } } return true; } Same result, probably absolutely no measurable (and we're talking fractions of microseconds here) difference in speed, but much easier to read. Mike Frazer Lars Torben Wilson [EMAIL PROTECTED] wrote in message 1012602758.3230.127.camel@ali">news:1012602758.3230.127.camel@ali... On Fri, 2002-02-01 at 14:02, toni baker wrote: I would like to prevent users from uploading a file that contains more than 4 pipes or less than 2 pipes. The code below prevents users from uploading a file containing more than 4 pipes, but not less than 2 pipes. Should I use awk, ereg, or sed? Thanks Unless you *have* to spawn processes to do this for you for some reason, you can keep things a lot simpler by doing it in PHP, something like this: ?php error_reporting(E_ALL); function check_file($filename) { if (!$upload_file = file($filename)) { return false; } while (list(, $line) = each($upload_file)) { $num_pipes = substr_count($line, '|'); if ($num_pipes 2 || $num_pipes 4) { return false; } } return true; } $userfile = 'testpipes.txt'; if (check_file($userfile)) { echo File passed.\n; } else { echo File failed.\n; } ? Hope this helps, Torben system (/bin/cat $userfile|/bin/sed -n 's/.*|.*|.*|.*|.*|//p' pipes.txt; $fd =fopen(pipes.txt, 'r'); $pipes5=fgets($fd,50); echo ($pipes5); fclose($fd); if ($pipes5) { print wrong number of pipes; } The uploaded file below should not pass but it does: a|b|c|d|e a|b|c| a|b|c|d a|b a|b|c|d|e -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 ---End Message--- ---BeginMessage--- On Sun, 2002-02-03 at 02:35,
[PHP] Using session functions in PHP4.1.1
Hi, I'm using Win ME-Apache1.3.22-PHP4.1.1 and run this script: ?php session_start(); ? I got this error: Php has caused an error in PHP4TS.DLL and will be closed. If the problem continues try to reboot your system. And in the Apache log file I got : Premature end of script headers. This happens when using functions: session_start and session_register What can I do to resolve the problem. John Mpaliza
[PHP] Re: PEAR IMAGICK [WAS- RANT: Why doesn't PHP have built-in support for dynamic]
Someone seems to have started this, although I'm not sure why he's not going more object-based. http://pear.php.net/manual/en/packages.imagick.php I would prefer something like $i = new Imagick(); $i-read(file); instead of $i= imagick_create(); imagick_read($i,file); it's open source. just do it more object orientated ... and i'm sure the author (me...) will be very happy to impelement it ;) honestly, OO-Interface was and still is planned, but i think more functionality is much more needed at the moment than an oo interface. it was my first extension, so i wanted to keep it simple for the beginning. but if someone else likes to implement it earlier, i'm the last, who has a problem with that (and don't expect 00 soon from me ...) chregu Hello - Please don't take my comment the wrong way - I know what I'd *like* to see (which is how I labelled it above) and what I'm capable of actually contributing. Doing C-code PHP extensions is beyond my capabilities, so I make do with what others contribute. Simply because something is opensource doesn't mean everyone has equal talent to add in actual code. :( I thank you for your contribution of this code so far, and should you continue to work on it in whatever fashion you choose, so much the better. It is appreciated, OO or not (it would just be appreciated more if it was OO.) :) Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PEAR IMAGICK [WAS- RANT: Why doesn't PHP have built-in support for dynamic]
In [EMAIL PROTECTED], Michael Kimsal wrote: Someone seems to have started this, although I'm not sure why he's not going more object-based. http://pear.php.net/manual/en/packages.imagick.php I would prefer something like $i = new Imagick(); $i-read(file); instead of $i= imagick_create(); imagick_read($i,file); it's open source. just do it more object orientated ... and i'm sure the author (me...) will be very happy to impelement it ;) honestly, OO-Interface was and still is planned, but i think more functionality is much more needed at the moment than an oo interface. it was my first extension, so i wanted to keep it simple for the beginning. but if someone else likes to implement it earlier, i'm the last, who has a problem with that (and don't expect 00 soon from me ...) chregu Hello - Please don't take my comment the wrong way - I know what I'd *like* to no, didn't take it the wrong way. maybe my answer was a bit to harsh ;) see (which is how I labelled it above) and what I'm capable of actually contributing. Doing C-code PHP extensions is beyond my capabilities, so I make do with what others contribute. Simply because something is opensource doesn't mean everyone has equal talent to add in actual code. :( I thank you for your contribution of this code so far, and should you continue to work on it in whatever fashion you choose, so much the better. It is appreciated, OO or not (it would just be appreciated more if it was OO.) :) i would it appreciate as well, if it was OO. I was just not capable back then to do it OO, maybe i am the next time I invest more time in it. christian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying a please wait while doing a file upload?
Hi guys, I would like to display something like: please wait, uploading while I am doing a image creation which takes a while. After the work is done, it should redirect to another page displaying something like upload ok. As far as I know the HEADER location satement is only valid if there is no output in front. So I can't just echo the sentence. Does anybody know the trick? Thanx for your help. Cheers Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Installing GD original question
Hi guys, I think his original question was how to install GD! It's not a big deal! - Install PHP 4.06 - edit the php.ini - delete the comment tags from the gd import module - restart your server if it is running not as a CGI extension Thats it!!! For gd2 support take care in PHP4.1.1 there are 2 gdmodules gd1 and gd2 Hope this helps, Andy Christian Stocker [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In [EMAIL PROTECTED], Michael Kimsal wrote: Someone seems to have started this, although I'm not sure why he's not going more object-based. http://pear.php.net/manual/en/packages.imagick.php I would prefer something like $i = new Imagick(); $i-read(file); instead of $i= imagick_create(); imagick_read($i,file); it's open source. just do it more object orientated ... and i'm sure the author (me...) will be very happy to impelement it ;) honestly, OO-Interface was and still is planned, but i think more functionality is much more needed at the moment than an oo interface. it was my first extension, so i wanted to keep it simple for the beginning. but if someone else likes to implement it earlier, i'm the last, who has a problem with that (and don't expect 00 soon from me ...) chregu Hello - Please don't take my comment the wrong way - I know what I'd *like* to no, didn't take it the wrong way. maybe my answer was a bit to harsh ;) see (which is how I labelled it above) and what I'm capable of actually contributing. Doing C-code PHP extensions is beyond my capabilities, so I make do with what others contribute. Simply because something is opensource doesn't mean everyone has equal talent to add in actual code. :( I thank you for your contribution of this code so far, and should you continue to work on it in whatever fashion you choose, so much the better. It is appreciated, OO or not (it would just be appreciated more if it was OO.) :) i would it appreciate as well, if it was OO. I was just not capable back then to do it OO, maybe i am the next time I invest more time in it. christian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Why doesn't PHP have built-in support for dynamic image generation?
Hi guys, I think his original question was how to install GD! It's not a big deal! - Install PHP 4.06 - edit the php.ini - delete the comment tags from the gd import module - restart your server if it is running not as a CGI extension Thats it!!! For gd2 support take care in PHP4.1.1 there are 2 gdmodules gd1 and gd2 Hope this helps, Andy Christian Stocker [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In [EMAIL PROTECTED], Michael Kimsal wrote: Someone seems to have started this, although I'm not sure why he's not going more object-based. http://pear.php.net/manual/en/packages.imagick.php I would prefer something like $i = new Imagick(); $i-read(file); instead of $i= imagick_create(); imagick_read($i,file); it's open source. just do it more object orientated ... and i'm sure the author (me...) will be very happy to impelement it ;) honestly, OO-Interface was and still is planned, but i think more functionality is much more needed at the moment than an oo interface. it was my first extension, so i wanted to keep it simple for the beginning. but if someone else likes to implement it earlier, i'm the last, who has a problem with that (and don't expect 00 soon from me ...) chregu Hello - Please don't take my comment the wrong way - I know what I'd *like* to no, didn't take it the wrong way. maybe my answer was a bit to harsh ;) see (which is how I labelled it above) and what I'm capable of actually contributing. Doing C-code PHP extensions is beyond my capabilities, so I make do with what others contribute. Simply because something is opensource doesn't mean everyone has equal talent to add in actual code. :( I thank you for your contribution of this code so far, and should you continue to work on it in whatever fashion you choose, so much the better. It is appreciated, OO or not (it would just be appreciated more if it was OO.) :) i would it appreciate as well, if it was OO. I was just not capable back then to do it OO, maybe i am the next time I invest more time in it. christian Erica Douglass [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Forgive my grumpiness, but I've spent the last several hours trying to install GD, etc. Let's be honest. PHP needs built-in support for creating dynamic images. JSP already has this. Heck, you could even make it a configure option. As it stands now, you have to do the following: -- Install GD -- Install all of GD's numerous dependencies -- Install zlib -- Install freetype -- Install libttf THEN you have to compile PHP with all of the requisite options to enable GD here and Freetype there, and PHP often won't compile without specifying /path/to/various/options, so you have to dig around your system to find out where everything was installed. This results in a long and unwieldy configure statement which often does not work. PHP needs to have a simple configure option called --enable-dynamic-images or something similar. This should use built-in libraries that are downloaded with the PHP source to create PNG images. Images can then be created with standard PHP functions. This would be much more useful than relying on several third-party solutions which do not easily work with each other. This would also have the benefit of being more portable -- as I plan to release my code to several different people running different types of servers, I would like to minimize compatibility issues. If anyone has a better solution, feel free to email me. As it stands, I am very frustrated with this, and I haven't yet seen the light at the end of the tunnel. Thanks, Erica -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Adding 6 digits to a str?
thanx!!! John Lim [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Try http://php.net/str_pad Andy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi guys, I am trying to force a int to be 8 digits. If it is only 3 dig filling the first ones with 0. Anyhow I tryed it with type casting, but it does not matter what I try, I always get an addition. E.g: $member_id is: 136 should be: 0136 Here is the code, which is still returning 136: for($i=0;$icount($member_id);$i++){ $length = strlen($member_id[$i]); settype ($member_id[$i], string); $zero = '0'; settype ($zero, string); $member_id[$i] = $zero + $member_id[$i]; echo $member_id[$i]; } Does anybody know how to solve this thing?? Thanx Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Why doesn't PHP have built-in support for dynamic image generation?
In [EMAIL PROTECTED], Andy wrote: Hi guys, I think his original question was how to install GD! It's not a big deal! - Install PHP 4.06 - edit the php.ini - delete the comment tags from the gd import module - restart your server if it is running not as a CGI extension Thats it!!! If you have windows ... But said that, i never had any problems in compiling php with gdlib under debian testing... chregu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying a please wait while doing a file upload?
Well, although this won't wait until exactly when the image creation is done, you could use a meta refresh tag to refresh to your new page after a certain number of seconds... Create a php page with whatever code you need, and then have something like this: html head meta http-equiv= refresh content=5;URL='targetpage.php' titlePlease Wait/title /head body Please wait... /body /html This example would wait 5 seconds before loading targetpage.php. Jeff At 10:00 PM 2/3/2002 +0100, Andy wrote: Hi guys, I would like to display something like: please wait, uploading while I am doing a image creation which takes a while. After the work is done, it should redirect to another page displaying something like upload ok. As far as I know the HEADER location satement is only valid if there is no output in front. So I can't just echo the sentence. Does anybody know the trick? Thanx for your help. Cheers Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying a please wait while doing a file upload?
Ya, that's what I meant - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Andy [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, February 04, 2002 7:24 AM Subject: Re: [PHP] Displaying a please wait while doing a file upload? Well, although this won't wait until exactly when the image creation is done, you could use a meta refresh tag to refresh to your new page after a certain number of seconds... Create a php page with whatever code you need, and then have something like this: html head meta http-equiv= refresh content=5;URL='targetpage.php' titlePlease Wait/title /head body Please wait... /body /html This example would wait 5 seconds before loading targetpage.php. Jeff At 10:00 PM 2/3/2002 +0100, Andy wrote: Hi guys, I would like to display something like: please wait, uploading while I am doing a image creation which takes a while. After the work is done, it should redirect to another page displaying something like upload ok. As far as I know the HEADER location satement is only valid if there is no output in front. So I can't just echo the sentence. Does anybody know the trick? Thanx for your help. Cheers Andy -- 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] file validation
On Sun, 2002-02-03 at 12:12, Mike Frazer wrote: Your reply piqued my curiosity so I whipped together a script that times the execution of a foreach(), a while() and a for() loop executing the same commands. The results were rather surprising in some ways but not really overall. The while() loop is, as you stated, is quicker than a foreach() loop. However, the for() loop is the fastest of all three. Below are the results of three tests: Odd.. I get the opposite result: Running test_foreach() 5000 times...2.6176570653915 seconds Running test_for() 5000 times...3.0155370235443 seconds Running test_while() 5000 times...2.0656290054321 seconds Results: test_foreach_1: 2.6176570653915 test_for_2: 3.0155370235443 test_while_3: 2.0656290054321 Using the following code: ?php error_reporting(E_ALL); function test_while() { global $upload_file; reset($upload_file); foreach ($upload_file as $line) { $num_pipes = substr_count($line, '|'); if ($num_pipes 2 || $num_pipes 4) { return false; } } return true; } function test_foreach() { global $upload_file; reset($upload_file); while (list(, $line) = each($upload_file)) { $num_pipes = substr_count($line, '|'); if ($num_pipes 2 || $num_pipes 4) { return false; } } return true; } function test_for() { global $upload_file; for ($i = 0; $i count($upload_file); $i++) { $num_pipes = substr_count($upload_file[$i], '|'); if ($num_pipes 2 || $num_pipes 4) { return false; } } return true; } $filename = 'testpipes.txt'; $upload_file = file($filename); speedtest(array('test_foreach', 'test_for', 'test_while'), 5000); ? Curioser and curiouser Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Natively compiled classes
Hi! A few colleagues and I found our PHP scripts running very slowly due to the very processor intensive calculations on a site for a client. By intensive calculations, I mean encryption, random number generation, and prime verification, for some cryptographic algorithms. The code was very object oriented using lots of classes. We decided to write our own extension so that some of the code could be compiled natively, and avoid the PHP interpreter altogether. My question, is there any way of doing this with classes? I know I can write individual functions in C and build them into a module, but how can I do this with classes, if at all? TIA Stephano Mariani -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: attachment via mail PHP
aloo... Olev Rumm [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello I was looking a way to fill a forms on line and send them over via the server. Found a good(in my mind) and simple php mail skript from http://open.appideas.com/phpMailForm/source.php I managed to get it working. In my form there is a upload the the file section. like this: FORM name=your_file value=200input name=attachment type=file with max value of 2megs. It's not working. Pecause Im absolutely new in this I dont have a any idea how to implement attachment part into this script.Original script is here: ? $MailToAddress = [EMAIL PROTECTED]; $MailSubject = Equipment Posting; if (!$MailFromAddress) { $MailFromAddress = [EMAIL PROTECTED]; } $Header = ; $Footer = ; ? html body bgcolor=#FF font face=Arialcenter The following information has been delivered: /center ? if (!is_array($HTTP_POST_VARS)) return; reset($HTTP_POST_VARS); while(list($key, $val) = each($HTTP_POST_VARS)) { $GLOBALS[$key] = $val; $val=stripslashes($val); echo b$key/b = $valbr; $Message .= $key = $val\n; } if ($Header) { $Message = $Header.\n\n.$Message; } if ($Footer) { $Message .= \n\n.$Footer; } mail( $MailToAddress, $MailSubject, $Message, From: $MailFromAddress); ? brbr bThank You!/b brbr a href=? echo $HTTP_REFERER; ?Return To The Mail Form/abrbr a href=/Home Page/abrbr I dont know if I'm explained correctly so please excuse me. Can anybody help please. Olev. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() function not sending to Yahoo address
I've tried several PHP form processors, and all of them have trouble sending the form contents to a Yahoo address. When I change the address to something other than a Yahoo account, it sends the form results with no problem. Is there an issue with PHP's mail function and Yahoo email addresses? thanks, John __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function not sending to Yahoo address
Monday, February 04, 2002, 12:17:27 AM, recebi de John P. Donaldson: John I've tried several PHP form processors, and all of John them have trouble sending the form contents to a Yahoo John address. When I change the address to something other John than a Yahoo account, it sends the form results with John no problem. Is there an issue with PHP's mail John function and Yahoo email addresses? check your SMTP server in the configuration of PHP Ricardo J. Veludo e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crypt/Password
Hi, I just thought i would point out that the entire point of crypt, md5, or MySQL password() function is to create a hash out of the original string. However, they are designed so it is computationally infeasible to take a hash and find out the original string was. Actually, it is impossible to know exactly what the original string was, because there may be more than one input that creates the same output. The chances of this happening in a password case are EXTREMELLY RARE. Sometimes, I to use md5 to hash passwords, and others, I just store the plain text passwords in the protected database. In most cases, if someone has access to your database, you have bigger things to worry about than them getting your password list. Best Regards, Jason Garber IonZoft.com At 11:56 PM 2/3/2002 +0800, you wrote: Hi there, I'm creating a user/password table that will use either Mysql Password or PHP Crypt function to encrypt the data. I know these functions are non reversible for good reason, but how do I deal with a situation where I want to email out a forgotton password? How can I get the passwrd back to a form recognisable to the user? Thanx in advance Phil -- 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] gzinflate and HTTP_RAW_POST_DATA problem
I'm sending Content-type: application/x-gzip to a PHP script, and I successfully write it to a file using the HTTP_RAW_POST_DATA variable, and can then gunzip it. What confuses me is that I *cannot* use the gzinflate function with the same compressed data. In other words, the first method works, but the second does not. Why? First: $f = fopen(/tmp/foo.gz,w); fwrite($f,$HTTP_RAW_POST_DATA); fclose($f); $f = gzopen(/tmp/foo.gz,r); $pixels = gzread($f,25); gzclose($f); Second: $pixels = gzinflate($HTTP_RAW_POST_DATA,25); ERROR!! bWarning/b: gzinflate: data error in bsaver.php/b on line b8/bbr I don't get it. It's the same data, right? Noisey Apache/1.3.12 (Unix) ApacheJServ/1.1.2 mod_mp3/0.25 PHP/4.0.6 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and XML
Hi, I'd appreciate any pointers you recommend to good sources of information on how to use PHP and XML. Thanks, Peter --- Reality is that which, when you stop believing in it, doesn't go away. -- Philip K. Dick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using session functions in PHP4.1.1
John Mpaliza wrote: Hi, I'm using Win ME-Apache1.3.22-PHP4.1.1 and run this script: ?php session_start(); ? I got this error: Php has caused an error in PHP4TS.DLL and will be closed. If the problem continues try to reboot your system. And in the Apache log file I got : Premature end of script headers. This happens when using functions: session_start and session_register What can I do to resolve the problem. You have invalid session.save_path, right? It will be fixed next release or 4.2.0. -- Yasuo Ohgaki Please CC me when you reply to news/list messages. Do not reply only to me :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sessions in URL not being recognized!
Try to enable output bufffering to see if it helps. -- Yasuo Ohgaki Please CC me when you reply to news/list messages. Do not reply only to me :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: use_trans_sid
Justin French wrote: Hi, When I run phpinfo(), use_trans_sid is set to 1 (assume 1 = enabled) on both my test server, and on my live server. Great! Only trouble is, when I disable cookies in my browser, the sessions are lost (in this case, each page asks me to login, rather than only once). Is there anything special I have to do to ensure I have a system which uses cookies by default, and use_trans_sid as a second option, without have to carry the SID around in the URL? (page.php??=SID?)? Look for my PHP4 sesison helper HTML in www.zend.com Code Gallary. -- Yasuo Ohgaki Please CC me when you reply to news/list messages. Do not reply only to me :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function not sending to Yahoo address
Hi, Monday, February 04, 2002, 12:17:27 AM, recebi de John P. Donaldson: John I've tried several PHP form processors, and all of John them have trouble sending the form contents to a Yahoo John address. When I change the address to something other John than a Yahoo account, it sends the form results with John no problem. Is there an issue with PHP's mail John function and Yahoo email addresses? check your SMTP server in the configuration of PHP Could you please further suggest how to check and what should be check for this issue, and what could be a concern in php configuration regarding to Yahoo account? Thanks! Alex Ricardo J. Veludo e-mail: [EMAIL PROTECTED] -- 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] mail() function not sending to Yahoo address
I found out it was my SMTP server that was actually having the problem sending to Yahoo accounts, not PHP. I changed which server my PHP script used to send mail and it sent it to my Yahoo account no problem. John --- Alex Shi [EMAIL PROTECTED] wrote: Hi, Monday, February 04, 2002, 12:17:27 AM, recebi de John P. Donaldson: John I've tried several PHP form processors, and all of John them have trouble sending the form contents to a Yahoo John address. When I change the address to something other John than a Yahoo account, it sends the form results with John no problem. Is there an issue with PHP's mail John function and Yahoo email addresses? check your SMTP server in the configuration of PHP Could you please further suggest how to check and what should be check for this issue, and what could be a concern in php configuration regarding to Yahoo account? Thanks! Alex Ricardo J. Veludo e-mail: [EMAIL PROTECTED] -- 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 __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using session functions in PHP4.1.1
i dont know how u r using the thing like PHP on the fucking Win. Moreover WinMe is the worst of all the OS's. So, better migrate to other OS as soon as possible. /sagar - Original Message - From: John Mpaliza [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 04, 2002 1:23 AM Subject: [PHP] Using session functions in PHP4.1.1 Hi, I'm using Win ME-Apache1.3.22-PHP4.1.1 and run this script: ?php session_start(); ? I got this error: Php has caused an error in PHP4TS.DLL and will be closed. If the problem continues try to reboot your system. And in the Apache log file I got : Premature end of script headers. This happens when using functions: session_start and session_register What can I do to resolve the problem. John Mpaliza _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: use_trans_sid
Justin French wrote: Hi, I didn't have much luck finding it... If you have a chance to send me a link, that'd be great, otherwise I'll just keep looking :) Justin Try link :) http://www.zend.com/search_code_author.php?author=yohgaki -- Yasuo Ohgaki Yasuo Ohgaki wrote: Justin French wrote: Hi, When I run phpinfo(), use_trans_sid is set to 1 (assume 1 = enabled) on both my test server, and on my live server. Great! Only trouble is, when I disable cookies in my browser, the sessions are lost (in this case, each page asks me to login, rather than only once). Is there anything special I have to do to ensure I have a system which uses cookies by default, and use_trans_sid as a second option, without have to carry the SID around in the URL? (page.php??=SID?)? Look for my PHP4 sesison helper HTML in www.zend.com Code Gallary. -- Yasuo Ohgaki Please CC me when you reply to news/list messages. Do not reply only to me :) _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- Yasuo Ohgaki _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ereg_replace help
I have a file open and can successfully write to it, but I was to be able to search for a certain string of text and replace it with a string of text. I can't figure out how to construct a proper ereg_replace statement to search through this file and do the replacing. Examples I've seen are in the manner of: $text = line1\nline2\n; fputs(ereg_replace(\n, br, $text)); But how do I set the value of $text to be the entire contents of the text file I've got open so it can search through the entire file to find matches and replace those matches? Any help is greatly appreciated. Thanks, John __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ereg_replace help
$lines = file(filename_here.blah); // read in file as an array $content = implode(\n, $lines); // join it all back together $new_cont = ereg_replace(from, to, $content); fopen(...); fputs(..., $new_content); fclose(...); if your intent is to replace all new lines with br's then use this instead ... $lines = file(filename_here.blah); // read in file as an array $content = implode(br, $lines); // join it all back together fopen(...); fputs(..., $content); fclose(...); hope this helps -Original Message- From: John P. Donaldson [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 3:39 PM To: php Subject: [PHP] ereg_replace help I have a file open and can successfully write to it, but I was to be able to search for a certain string of text and replace it with a string of text. I can't figure out how to construct a proper ereg_replace statement to search through this file and do the replacing. Examples I've seen are in the manner of: $text = line1\nline2\n; fputs(ereg_replace(\n, br, $text)); But how do I set the value of $text to be the entire contents of the text file I've got open so it can search through the entire file to find matches and replace those matches? Any help is greatly appreciated. Thanks, John __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Warning: Failed opening
I'm attempting to use the ISAPI interface to PHP but I keep getting Warning: Failed opening '' for inclusion (include_path='\winbbs') in Unknown on line 0 no matter what URL I request. The PHP doc's does say the ISAPI has some bugs and I was wondering if maybe this is one of them. But, before I go report I would like someone who knows what it SHOULD say would look at what the ISAPI server module is passing to the ISAPI dll. It's possible that something isn't being passed right. Below is a debug dump of what is passed to the DLL. Items that contain nothing after the - is an empty string. == EXTENSION_CONTROL_BLOCK cbSize - 144 dwVersion - 262144 ConnID - 1 dwHttpStatusCode - 200 lpszLogData - %s lpszMethod - GET lpszQueryString - lpszPathInfo - lpszPathTranslated - cbAvailable - 0 lpbData - lpszContentType - HTTP_COOKIE - UID=1DISK13217 HTTPS - off SCRIPT_NAME - 265.php AUTH_PASSWORD - AUTH_TYPE - AUTH_USER - CONTENT_LENGTH - 0 CONTENT_TYPE - PATH_TRANSLATED - QUERY_STRING - REMOTE_ADDR - 216.63.63.193 REMOTE_HOST - www.webbbs.org REMOTE_USER - 216.63.63.193 REQUEST_METHOD - GET SERVER_NAME - www.webbbs.org SERVER_PORT - 80 SERVER_PROTOCOL - HTTP/1.0 SERVER_SOFTWARE - WebBBS 1.30 APPL_MD_PATH - C:\WINBBS\WORK\HTML\265.php APPL_PHYSICAL_PATH - C:\WINBBS\WORK\HTML\265.php INSTANCE_ID - 2 INSTANCE_META_PATH - \winbbs LOGON_USER - 216.63.63.193 REQUEST_URI - GET http://www.webbbs.org/265.php HTTP/1.0 URL - http://www.webbbs.org/265.php HSE_REQ_MAP_URL_TO_PATH_EX - C:\WINBBS\WORK\HTML\265.php dwFlags - HSE_URL_FLAGS_SCRIPT|HSE_URL_FLAGS_READ cchMatchingPath - 28 cchMatchingURL - 28 lpdwSize - 28 --- WebBBS Secure Internet Information Server v1.30.3 : Genesis ( http://www.webbbs.org/ ) Log on to www.webbbs.org for free web based and pop3 [ virus free and spam free ] email accounts. Free access to virus and internet security message boards with 10's of thousands of new messages every month. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg_replace help
nl2br() would serve that purpose as well. See the Strings section of the Functions Reference in the manual. Mike Frazer Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $lines = file(filename_here.blah); // read in file as an array $content = implode(\n, $lines); // join it all back together $new_cont = ereg_replace(from, to, $content); fopen(...); fputs(..., $new_content); fclose(...); if your intent is to replace all new lines with br's then use this instead ... $lines = file(filename_here.blah); // read in file as an array $content = implode(br, $lines); // join it all back together fopen(...); fputs(..., $content); fclose(...); hope this helps -Original Message- From: John P. Donaldson [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 3:39 PM To: php Subject: [PHP] ereg_replace help I have a file open and can successfully write to it, but I was to be able to search for a certain string of text and replace it with a string of text. I can't figure out how to construct a proper ereg_replace statement to search through this file and do the replacing. Examples I've seen are in the manner of: $text = line1\nline2\n; fputs(ereg_replace(\n, br, $text)); But how do I set the value of $text to be the entire contents of the text file I've got open so it can search through the entire file to find matches and replace those matches? Any help is greatly appreciated. Thanks, John __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- 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] ereg_replace help
I'm not actually replacing \n with br, I just used that as an example. When I tried Martin's solution, I got a parse error on this line: $content = implode($lines, \n,); I checked the manual and it's constructed properly .. I think. What could be giving me the parse error on this line. The previous line reads: $lines = file(log.txt); Thanks, John --- Mike Frazer [EMAIL PROTECTED] wrote: nl2br() would serve that purpose as well. See the Strings section of the Functions Reference in the manual. Mike Frazer Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $lines = file(filename_here.blah); // read in file as an array $content = implode(\n, $lines); // join it all back together $new_cont = ereg_replace(from, to, $content); fopen(...); fputs(..., $new_content); fclose(...); if your intent is to replace all new lines with br's then use this instead ... $lines = file(filename_here.blah); // read in file as an array $content = implode(br, $lines); // join it all back together fopen(...); fputs(..., $content); fclose(...); hope this helps -Original Message- From: John P. Donaldson [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 3:39 PM To: php Subject: [PHP] ereg_replace help I have a file open and can successfully write to it, but I was to be able to search for a certain string of text and replace it with a string of text. I can't figure out how to construct a proper ereg_replace statement to search through this file and do the replacing. Examples I've seen are in the manner of: $text = line1\nline2\n; fputs(ereg_replace(\n, br, $text)); But how do I set the value of $text to be the entire contents of the text file I've got open so it can search through the entire file to find matches and replace those matches? Any help is greatly appreciated. Thanks, John __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- 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 __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ereg_replace help
is that a direct copy from your code? - if it is, there's two errors 1. you have a comma just before the closing backet 2. the function is : implode(string glue, array pieces) so that would be : $content = implode(\n, $lines); ie. the two arguments are the wrong way around Martin -Original Message- From: John P. Donaldson [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 4:32 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] ereg_replace help I'm not actually replacing \n with br, I just used that as an example. When I tried Martin's solution, I got a parse error on this line: $content = implode($lines, \n,); I checked the manual and it's constructed properly .. I think. What could be giving me the parse error on this line. The previous line reads: $lines = file(log.txt); Thanks, John --- Mike Frazer [EMAIL PROTECTED] wrote: nl2br() would serve that purpose as well. See the Strings section of the Functions Reference in the manual. Mike Frazer Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $lines = file(filename_here.blah); // read in file as an array $content = implode(\n, $lines); // join it all back together $new_cont = ereg_replace(from, to, $content); fopen(...); fputs(..., $new_content); fclose(...); if your intent is to replace all new lines with br's then use this instead ... $lines = file(filename_here.blah); // read in file as an array $content = implode(br, $lines); // join it all back together fopen(...); fputs(..., $content); fclose(...); hope this helps -Original Message- From: John P. Donaldson [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 3:39 PM To: php Subject: [PHP] ereg_replace help I have a file open and can successfully write to it, but I was to be able to search for a certain string of text and replace it with a string of text. I can't figure out how to construct a proper ereg_replace statement to search through this file and do the replacing. Examples I've seen are in the manner of: $text = line1\nline2\n; fputs(ereg_replace(\n, br, $text)); But how do I set the value of $text to be the entire contents of the text file I've got open so it can search through the entire file to find matches and replace those matches? Any help is greatly appreciated. Thanks, John __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- 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 __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg_replace help
On Monday 04 February 2002 13:31, John P. Donaldson wrote: I'm not actually replacing \n with br, I just used that as an example. When I tried Martin's solution, I got a parse error on this line: $content = implode($lines, \n,); You've got a trailing comma. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* A halted retreat Is nerve-wracking and dangerous. To retain people as men -- and maidservants Brings good fortune. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can php Read contents from MS Word in Exactly same format
Dear all I had made a news input page for one of the HR Manger to input the news for the whole company to read, she is quick comfort with using MS word as a editor, so is there anyway that the php can read the contents from the MS Word and display as exactly same format to html? If there is so, could any one suggest a book to me? Thx a lot Jack [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can php Read contents from MS Word in Exactly same format
MS Word is a proprietary, binary (i think), format... Have fun. There may be a solution out there. If you could convince her to save it in Rich Text Format (rtf) and then upload it, your life would be much easier... -Jason Garber At 01:51 PM 2/4/2002 +0800, Jack wrote: Dear all I had made a news input page for one of the HR Manger to input the news for the whole company to read, she is quick comfort with using MS word as a editor, so is there anyway that the php can read the contents from the MS Word and display as exactly same format to html? If there is so, could any one suggest a book to me? Thx a lot Jack [EMAIL PROTECTED] -- 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] can't fint php.ini on OS X
does anybody know where the php.ini is on Mac OS X? I would like to activate gdlibrary. Thanx for the hint Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] include_path auto_prepend
Ack... I recompiled my server and screwed something up in the process. PHP files are parsed, but the include_path and auto_prepend variables are now ignored in my httpd.conf file. Any idea of what I did? I'm using virtual hosts and have php_value include_path php_value auto_prepend in virtual host containers. I didn't change the configuration files... When I run a script that tries doing any include, it says Warning: Failed opening 'top.php' for inclusion (include_path='') The include_path variable is empty... any idea why? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sockets
Anyone know if there is a way yet to see if a socket is still connected to a host? I want to use a socket to send GET / HTTP/1.0\r\n\r\n over a socket, and retrieve everything the server sends. That part works great, but I can't figure out when the remote host disconnects. I have the CVS version of php. Here is the function so far. The problem is at the end. function getdata ($host, $port, $data) { /* well, the below comment would be true if i could get it working! */ /* This function sends $data to $host:$port, then returns the response * until connection is severed. Great for HTTP, but won't usually work * too well in protocols where data needs to be analyzed, and replied * to appropriatly, such as POP v3 */ // Create a socket $so = socket_create (AF_INET, SOCK_STREAM, getprotobyname(TCP)); if ( !$so ) { exit(Could not create socket.\n); } // Connect... $ec = socket_connect ($so, $host, $port); if ( $ec 0 ) { exit (ERROR $ec: .socket_strerror($ec)); } /* Write $data to socket. The manual doesn't say what it returns, but I'll * assume (even though it makes an ass out of you and me) that it is the same * as socket_connect() because it wouldn't be logical to return a descriptor. */ $ec = socket_write ( $so, $data, ( strlen($data) )); if ( $ec 0 ) { exit (ERROR $ec: .socket_strerror($ec)); } else { /* PROBLEM IS HERE- what do I put instead of while ( $x == 0 )??? */ $x = 0; while ( $x == 0 ) { $buffer = socket_read ( $so, 1, PHP_BINARY_READ); $string .= $buffer; } } // And (hopefully) return $string, for your viewing pleasure. return $string; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help - config setting directives in Apache config files not working
I found this on a web site... When using PHP as an Apache module, you can also change the configuration settings using directives in Apache configuration files and .htaccess files. What do you do if you compile apache and php together - ie. not a module? I compiled using the static method and now the php_value commands in my httpd.conf don't work. Do I have to compile as a dynamic module to get them to work again? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function not sending to Yahoo address
Hi, I use a form on my website for the visitors to send me the feedback and use the mail() to do this job for me. And I get mails without any problems I am happy... :-).. Karthick I've tried several PHP form processors, and all of them have trouble sending the form contents to a Yahoo address. When I change the address to something other than a Yahoo account, it sends the form results with no problem. Is there an issue with PHP's mail function and Yahoo email addresses? thanks, John __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sockets
A quick note... If you are not aware of cURL (curl.haxx.se), then you may want to look into it. If you are, then please disregard this post. -Jason Garber At 11:06 PM 2/3/2002 -0800, Evan Nemerson wrote: Anyone know if there is a way yet to see if a socket is still connected to a host? I want to use a socket to send GET / HTTP/1.0\r\n\r\n over a socket, and retrieve everything the server sends. That part works great, but I can't figure out when the remote host disconnects. I have the CVS version of php. Here is the function so far. The problem is at the end. function getdata ($host, $port, $data) { /* well, the below comment would be true if i could get it working! */ /* This function sends $data to $host:$port, then returns the response * until connection is severed. Great for HTTP, but won't usually work * too well in protocols where data needs to be analyzed, and replied * to appropriatly, such as POP v3 */ // Create a socket $so = socket_create (AF_INET, SOCK_STREAM, getprotobyname(TCP)); if ( !$so ) { exit(Could not create socket.\n); } // Connect... $ec = socket_connect ($so, $host, $port); if ( $ec 0 ) { exit (ERROR $ec: .socket_strerror($ec)); } /* Write $data to socket. The manual doesn't say what it returns, but I'll * assume (even though it makes an ass out of you and me) that it is the same * as socket_connect() because it wouldn't be logical to return a descriptor. */ $ec = socket_write ( $so, $data, ( strlen($data) )); if ( $ec 0 ) { exit (ERROR $ec: .socket_strerror($ec)); } else { /* PROBLEM IS HERE- what do I put instead of while ( $x == 0 )??? */ $x = 0; while ( $x == 0 ) { $buffer = socket_read ( $so, 1, PHP_BINARY_READ); $string .= $buffer; } } // And (hopefully) return $string, for your viewing pleasure. return $string; } -- 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] can't fint php.ini on OS X
Actually there is not a php.ini in MacOS X. When you run phpinfo() see where the php.ini file should be located and you can put your own there. Cheers! Rick There are only two ways to live your life. One is as though nothing is a miracle. The other is as though everything is a miracle. - Albert Einstein From: Andy [EMAIL PROTECTED] Reply-To: Andy [EMAIL PROTECTED] Date: Mon, 4 Feb 2002 07:40:01 +0100 To: [EMAIL PROTECTED] Subject: [PHP] can't fint php.ini on OS X does anybody know where the php.ini is on Mac OS X? I would like to activate gdlibrary. Thanx for the hint Andy -- 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] Sockets
I am aware of cURL, but I want to just use the standard PHP stuff if I can because I plan on releasing this when I'm done, and want to KISS for other people. I know people have to compile PHP with sockets, but they will anyways for this project- I'm going to need socket_listen and socket_create_listen too. This is for a proxy server which will work kinda like multiproxy, but should be more powerful. It will support direct connections or going through another proxy server. It seperates anonymous from non-anonymous proxy servers, then sorts them by speed. Data is stored in tab seperated value text files (I'm even avoiding mySQL!!!) I just signed up for a page @ sourceforge. If anyone is interesting in helping out e-mail me. Thanks for the idea, though. I think right now my fall-back is fsockopen. I would really love to get sockets working for this... On Sunday 03 February 2002 23:32, you wrote: A quick note... If you are not aware of cURL (curl.haxx.se), then you may want to look into it. If you are, then please disregard this post. -Jason Garber At 11:06 PM 2/3/2002 -0800, Evan Nemerson wrote: Anyone know if there is a way yet to see if a socket is still connected to a host? I want to use a socket to send GET / HTTP/1.0\r\n\r\n over a socket, and retrieve everything the server sends. That part works great, but I can't figure out when the remote host disconnects. I have the CVS version of php. Here is the function so far. The problem is at the end. function getdata ($host, $port, $data) { /* well, the below comment would be true if i could get it working! */ /* This function sends $data to $host:$port, then returns the response * until connection is severed. Great for HTTP, but won't usually work * too well in protocols where data needs to be analyzed, and replied * to appropriatly, such as POP v3 */ // Create a socket $so = socket_create (AF_INET, SOCK_STREAM, getprotobyname(TCP)); if ( !$so ) { exit(Could not create socket.\n); } // Connect... $ec = socket_connect ($so, $host, $port); if ( $ec 0 ) { exit (ERROR $ec: .socket_strerror($ec)); } /* Write $data to socket. The manual doesn't say what it returns, but I'll * assume (even though it makes an ass out of you and me) that it is the same * as socket_connect() because it wouldn't be logical to return a descriptor. */ $ec = socket_write ( $so, $data, ( strlen($data) )); if ( $ec 0 ) { exit (ERROR $ec: .socket_strerror($ec)); } else { /* PROBLEM IS HERE- what do I put instead of while ( $x == 0 )??? */ $x = 0; while ( $x == 0 ) { $buffer = socket_read ( $so, 1, PHP_BINARY_READ); $string .= $buffer; } } // And (hopefully) return $string, for your viewing pleasure. return $string; } -- 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] Can php Read contents from MS Word in Exactly sameformat
Is there a function or class written to convert rtf reliably to html? :) Let me know, John A post reply would be helpful if you can. Jason G. wrote: MS Word is a proprietary, binary (i think), format... Have fun. There may be a solution out there. If you could convince her to save it in Rich Text Format (rtf) and then upload it, your life would be much easier... -Jason Garber At 01:51 PM 2/4/2002 +0800, Jack wrote: Dear all I had made a news input page for one of the HR Manger to input the news for the whole company to read, she is quick comfort with using MS word as a editor, so is there anyway that the php can read the contents from the MS Word and display as exactly same format to html? If there is so, could any one suggest a book to me? Thx a lot Jack [EMAIL PROTECTED] -- 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 Digest 4 Feb 2002 08:05:30 -0000 Issue 1151
php-general Digest 4 Feb 2002 08:05:30 - Issue 1151 Topics (messages 83325 through 83367): Using session functions in PHP4.1.1 83325 by: John Mpaliza 83343 by: Yasuo Ohgaki 83348 by: sagar N chand Re: PEAR IMAGICK [WAS- RANT: Why doesn't PHP have built-in support for dynamic] 83326 by: Michael Kimsal 83327 by: Christian Stocker Displaying a please wait while doing a file upload? 83328 by: Andy 8 by: Jeff Sheltren 83334 by: Liam MacKenzie Installing GD original question 83329 by: Andy Re: Why doesn't PHP have built-in support for dynamic image generation? 83330 by: Andy 83332 by: Christian Stocker Re: Adding 6 digits to a str? 83331 by: Andy Re: file validation 83335 by: Lars Torben Wilson Natively compiled classes 83336 by: Stephano Mariani Re: attachment via mail PHP 83337 by: Olev Rumm mail() function not sending to Yahoo address 83338 by: John P. Donaldson 83339 by: Ricardo J. Veludo 83346 by: Alex Shi 83347 by: John P. Donaldson 83363 by: TV Karthick Kumar Re: crypt/Password 83340 by: Jason G. gzinflate and HTTP_RAW_POST_DATA problem 83341 by: Noisey PHP and XML 83342 by: Peter J. Schoenster Re: Sessions in URL not being recognized! 83344 by: Yasuo Ohgaki Re: use_trans_sid 83345 by: Yasuo Ohgaki 83349 by: Yasuo Ohgaki ereg_replace help 83350 by: John P. Donaldson 83351 by: Martin Towell 83353 by: Mike Frazer 83354 by: John P. Donaldson 83355 by: Martin Towell 83356 by: Jason Wong Warning: Failed opening 83352 by: Mike_Bryeans.webbbs.org Can php Read contents from MS Word in Exactly same format 83357 by: Jack 83358 by: Jason G. 83367 by: jtjohnston can't fint php.ini on OS X 83359 by: Andy 83365 by: Richard Baskett include_path auto_prepend 83360 by: Ed Lazor Sockets 83361 by: Evan Nemerson 83364 by: Jason G. 83366 by: Evan Nemerson help - config setting directives in Apache config files not working 83362 by: Ed Lazor 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] -- ---BeginMessage--- Hi, I'm using Win ME-Apache1.3.22-PHP4.1.1 and run this script: ?php session_start(); ? I got this error: Php has caused an error in PHP4TS.DLL and will be closed. If the problem continues try to reboot your system. And in the Apache log file I got : Premature end of script headers. This happens when using functions: session_start and session_register What can I do to resolve the problem. John Mpaliza ---End Message--- ---BeginMessage--- John Mpaliza wrote: Hi, I'm using Win ME-Apache1.3.22-PHP4.1.1 and run this script: ?php session_start(); ? I got this error: Php has caused an error in PHP4TS.DLL and will be closed. If the problem continues try to reboot your system. And in the Apache log file I got : Premature end of script headers. This happens when using functions: session_start and session_register What can I do to resolve the problem. You have invalid session.save_path, right? It will be fixed next release or 4.2.0. -- Yasuo Ohgaki Please CC me when you reply to news/list messages. Do not reply only to me :) ---End Message--- ---BeginMessage--- i dont know how u r using the thing like PHP on the fucking Win. Moreover WinMe is the worst of all the OS's. So, better migrate to other OS as soon as possible. /sagar - Original Message - From: John Mpaliza [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 04, 2002 1:23 AM Subject: [PHP] Using session functions in PHP4.1.1 Hi, I'm using Win ME-Apache1.3.22-PHP4.1.1 and run this script: ?php session_start(); ? I got this error: Php has caused an error in PHP4TS.DLL and will be closed. If the problem continues try to reboot your system. And in the Apache log file I got : Premature end of script headers. This happens when using functions: session_start and session_register What can I do to resolve the problem. John Mpaliza _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ---End Message--- ---BeginMessage--- Someone seems to have started this, although I'm not sure why he's not going more object-based. http://pear.php.net/manual/en/packages.imagick.php I would prefer something like $i = new Imagick(); $i-read(file); instead of $i= imagick_create(); imagick_read($i,file); it's open source. just do it more object orientated ... and i'm sure the author (me...) will be very happy to impelement it ;) honestly,