php-general Digest 27 Nov 2004 04:11:23 -0000 Issue 3136 Topics (messages 202899 through 202927):
Re: Read PDF files with Php 202899 by: Jacob Friis 202902 by: Brad Ciszewski Installing PHP5 on Red Hat 202900 by: Sandy Keathley Running PHP as CGI 202901 by: Tim Traver 202922 by: Curt Zirzow automatic responder 202903 by: Alessandro Rosa 202910 by: Manuel Lemos 202920 by: Curt Zirzow 202923 by: Matthew Weier O'Phinney 202925 by: Michael Sims proxy - detect 202904 by: Brad Ciszewski 202905 by: Jason Wong 202908 by: Rens Admiraal Passing Parameters 202906 by: David Blackburn mysql_connect vs mysql_pconnect 202907 by: fabien champel 202926 by: Robby Russell unlink images 202909 by: Julian 202911 by: Vail, Warren 202912 by: Mike 202913 by: Jason Wong PHP arrays and javascript 202914 by: Nick Peters 202917 by: Pablo Gosse 202919 by: Marek Kilimajer Re: remember me cookie 202915 by: Curt Zirzow Re: fedora core 3 mail() not working from web 202916 by: Curt Zirzow Re: Script Name 202918 by: Jerry Swanson Re: help with html through php 202921 by: Curt Zirzow Go Back Problem 202924 by: Cyrus Reg Jpgraph... 202927 by: Sagar C Nannapaneni Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
--- Begin Message ---Do I need PDFlib in order to read PDF files? Is there another way?> There is a nifty tutorial on this subject over at zends.com
Can I read PDF files with that?
Thanks, Jacob
--- End Message ---
--- Begin Message ---i am not sure if this uses PDFlib but, this is a wonderful script which helps create a PDF file. http://sourceforge.net/projects/pdf-php/ ----- Original Message ----- From: "Jacob Friis" <[EMAIL PROTECTED]> To: "Christopher Way" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, November 26, 2004 9:58 AM Subject: Re: [PHP] Read PDF files with Php > >> Do I need PDFlib in order to read PDF files? > >> Is there another way? > > There is a nifty tutorial on this subject over at zends.com > > Can I read PDF files with that? > > Thanks, > Jacob > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
--- End Message ---
--- Begin Message ---Has anyone come across this problem? PHP5 on Red Hat Linux (Enterprise version) Can't locate API module structure `php5_module' in file /usr/local/lib/libphp5.so: /usr/lib/libapr-0.so.0: undefined symbol: php5_module Thanks. Sandy Keathley
--- End Message ---
--- Begin Message ---Hi all,
In the quest to secure php script running, I am starting to think about running php as a cgi instead of through the module.
I generally set the open_basedir directory within the apache configuration file for individual hosts. If I ran php as a CGI, would that directive still be in effect ? or do I have to set that in a php.ini file that is specific for that virtual host ?
Thanks,
Tim.
--- End Message ---
--- Begin Message ---* Thus wrote Tim Traver: > Hi all, > > In the quest to secure php script running, I am starting to think about > running php as a cgi instead of through the module. > > I generally set the open_basedir directory within the apache > configuration file for individual hosts. If I ran php as a CGI, would > that directive still be in effect ? or do I have to set that in a > php.ini file that is specific for that virtual host ? The directive will be effectve for which ever apache's <Directory> direcve applies, other wise the setting to the default directory will be used. php in general, has no clue about virtual hosts. This is rather a appache issue. Curt -- Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---How about coding an automatic responder via PHP ? Alessandro Rosa
--- End Message ---
--- Begin Message ---Hello,
On 11/26/2004 03:58 PM, Alessandro Rosa wrote:How about coding an automatic responder via PHP ?
The most portable solution is to have a POP3 mailbox associated with the e-mail address to which the messages are received and use a POP3 client to access and process the message replying to it if that is the case.
You may want to try this POP3 client class to do that.
http://www.phpclasses.org/pop3class
--
Regards, Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html
--- End Message ---
--- Begin Message ---* Thus wrote Manuel Lemos: > Hello, > > On 11/26/2004 03:58 PM, Alessandro Rosa wrote: > >How about coding an automatic responder via PHP ? > > The most portable solution is to have a POP3 mailbox associated with the > e-mail address to which the messages are received and use a POP3 > client to access and process the message replying to it if that is the case. > > You may want to try this POP3 client class to do that. /me ponders how pop3 has to dow with auto respoders /me then thinks spam. Curt -- Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---* Manuel Lemos <[EMAIL PROTECTED]>: > Hello, > > On 11/26/2004 03:58 PM, Alessandro Rosa wrote: > > How about coding an automatic responder via PHP ? > > The most portable solution is to have a POP3 mailbox associated with > the e-mail address to which the messages are received and use a POP3 > client to access and process the message replying to it if that is the > case. or IMAP... or use something like procmail or maildrop to pipe an incoming message to a PHP script that then processes and responds to it (my preferred method). > You may want to try this POP3 client class to do that. Or use PEAR's NET::POP3 classes, or mysql's native imap classes ( which cover much more than IMAP). -- Matthew Weier O'Phinney | mailto:[EMAIL PROTECTED] Webmaster and IT Specialist | http://www.garden.org National Gardening Association | http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org
--- End Message ---
--- Begin Message ---Matthew Weier O'Phinney wrote: > * Manuel Lemos <[EMAIL PROTECTED]>: >> On 11/26/2004 03:58 PM, Alessandro Rosa wrote: >>> How about coding an automatic responder via PHP ? >> >> The most portable solution is to have a POP3 mailbox associated with >> the e-mail address to which the messages are received and use a POP3 >> client to access and process the message replying to it if that is >> the case. > > or IMAP... or use something like procmail or maildrop to pipe an > incoming message to a PHP script that then processes and responds to > it (my preferred method). Or if using sendmail alias an address to a php script: username: "|/usr/local/bin/your_script.php" I'm sure other MTA's support this as well...
--- End Message ---
--- Begin Message ---does anyone know the function to get the IP address before the proxy-IP?
--- End Message ---
--- Begin Message ---On Saturday 27 November 2004 02:10, Brad Ciszewski wrote: > does anyone know the function to get the IP address before the proxy-IP? print_r($_SERVER) If it's there it's there. If not change proxy(!) -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* A commune is where people join together to share their lack of wealth. -- R. Stallman */
--- End Message ---
--- Begin Message --- Is only possible with proxy servers which support it (transparant proxy's)... otherwise it won't work...
Brad Ciszewski wrote:
does anyone know the function to get the IP address before the proxy-IP?
--- End Message ---
--- Begin Message ---Hi I used to pass parameters to my scripts like this shell>php myscript.php "dog=max&cat=jess" Since I have upgraded to PHP5 I dont seem to have this functionality any more, has anyone else noticed this ? or know of a way to get this working again ? Thanks Dave
--- End Message ---
--- Begin Message ---hello, I do not know when I must use mysql_pconnect instead of the mysql_connect :( what are the real advantages of persistent connections, please ?
--- End Message ---
--- Begin Message ---On Fri, 2004-11-26 at 19:55 +0100, fabien champel wrote: > hello, > I do not know when I must use mysql_pconnect instead of the mysql_connect :( > > what are the real advantages of persistent connections, please ? > http://www.google.com/search?q=advantages+of+persistent+connection -- /*************************************** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting & Development * --- Now supporting PHP5 --- ****************************************/signature.asc
Description: This is a digitally signed message part
--- End Message ---
--- Begin Message ---Hello, I would like to delete a set of images right after they are displayed on the page using unlink. Unfortunately, with unlink the images are deleted before they display on the user's browser. Is there a way to do this? Thank you!
--- End Message ---
--- Begin Message ---PHP has wonderful capabilities to generate images on the fly, such that they are never stored on disk, perhaps you should look into that as an option, you could even make the code decide who should be able to see the image and who should not. http://www.php.net/manual/en/ref.image.php Warren Vail > -----Original Message----- > From: Julian [mailto:[EMAIL PROTECTED] > Sent: Friday, November 26, 2004 11:14 AM > To: [EMAIL PROTECTED] > Subject: [PHP] unlink images > > > Hello, > I would like to delete a set of images right after they are > displayed on the > page using unlink. Unfortunately, with unlink the images are > deleted before > they display on the user's browser. Is there a way to do this? > > Thank you! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
--- End Message ---
--- Begin Message ---What you may want to try doing is when the script is ran, it goes through a "clean-up" function and deletes everything that it doesn't need for the current execution. Though, realize that if two people hit a page within a few seconds, you may end up deleting some images that the first user is trying to get rid of. You'll have to judge the traffic for yourself and figure out if this is a viable option. Other solutions that I can think of is after the page is ran you update a text file with the names of the images that are to get deleted and just run a cronjob to read this file and delete the files in there. Similarly, you could add the names to a db table with a timestamp and delete all files that are older than a particular time. Many options, but you have to figure out what works best for you. -M > -----Original Message----- > From: Julian [mailto:[EMAIL PROTECTED] > Sent: Friday, November 26, 2004 2:14 PM > To: [EMAIL PROTECTED] > Subject: [PHP] unlink images > > Hello, > I would like to delete a set of images right after they are > displayed on the page using unlink. Unfortunately, with > unlink the images are deleted before they display on the > user's browser. Is there a way to do this? > > Thank you! > > -- > PHP General Mailing List (http://www.php.net/) To > unsubscribe, visit: http://www.php.net/unsub.php >
--- End Message ---
--- Begin Message ---On Saturday 27 November 2004 03:13, Julian wrote: > I would like to delete a set of images right after they are displayed on > the page using unlink. I'm curious to know why you want this. > Unfortunately, with unlink the images are deleted > before they display on the user's browser. Is there a way to do this? Channel your image requests to a php script that: fopen() fpassthru() unlink() Haven't tried it, but in theory it looks like it should work. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Talkers are no good doers. -- William Shakespeare, "Henry VI" */
--- End Message ---
--- Begin Message ---Hey, i know this probally a simple question, but it has been stumping me for quite some time now. How do i pass a php array to a javascript? i tryed: <script language="javascript"> var myarray = new Array(<?PHP echo $myarray; ?>); </script> but it didn't work. Anybody got any ideas? thanks in advance. -- -Nick Peters
--- End Message ---
--- Begin Message ---<snip> i know this probally a simple question, but it has been stumping me for quite some time now. How do i pass a php array to a javascript? i tryed: <script language="javascript"> var myarray = new Array(<?PHP echo $myarray; ?>); </script> but it didn't work. Anybody got any ideas? </snip> You need to generate the javascript array from your PHP array. Example: In your script create a php array of the values you wish to use. Using indeces is not essential. If you do not use them, you can just use a counter var when you loop through the array to create the indeces for the JS array. <?php $arrayVar = array('first index'=>'item 1', 'second index'=>'item 2', 'third index'=>'item 3'); $jsVar = "var myArray = new Array();\n"; foreach ($arrayVar as $idx=>$val) { $jsVar .= "myArray['{$idx}'] = {$val}\n"; } ?> The final output of this will be: var myArray = new Array(); myArray['first index'] = 'item 1'; myArray['second index'] = 'item 2'; myArray['third index'] = 'item 3'; HTH, Pablo
--- End Message ---
--- Begin Message --- Nick Peters wrote:Hey,
i know this probally a simple question, but it has been stumping me for quite some time now. How do i pass a php array to a javascript?
i tryed: <script language="javascript"> var myarray = new Array(<?PHP echo $myarray; ?>); </script>
but it didn't work. Anybody got any ideas?
thanks in advance.
For integers and floats:
var myarray = new Array(<?PHP echo implode(', ', $myarray); ?>);
For strings:
var myarray = new Array(<?PHP echo '"'. implode('", "', $myarray) .'"'; ?>);
--- End Message ---
--- Begin Message ---* Thus wrote Justin French: > I've done these plenty of times, but today i've decided to take a > serious look at how I do it, and do it the right way. My current > method is just to store the username and an md5 of the password in a > couple of cookies. I'd avoid storing username and expecially any sort of password (even md5 hashed). If your athentication uses those values to validate the user, and those values are accessable, your security is very low. If you have a basic authentication system that once the user logs in you establish some sort of session var that flags the user as authenticated. I would simply stick with that model, and just adjust the time that that session is valid. By default, php only keeps a session that will last for some value of in-active minutes or until the user closes the browser. All you need to do is set the ini setting session.cookie_lifetime to a value (in seconds) for how long you want to remember this session. I've never tested the above but in theory the idea is to retain the session until a certain time, if that time has passed forget the session and start a new one, forcing a new login. I would avoid supplying a 'remember me' option excpecially if the information that your application provides is sensitive data. > > Is there anything else I should be doing, or an article I should be > reading, etc??? > > Shiflett??? :) Hopefully he's on a plane to northern california for a good talk I can attend. Curt -- Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---* Thus wrote Minuk Choi: > hey gang, > > I have a fedora core 3, with standard PHP and MySQL included with the > distribution. > > I'm having a rather odd problem. > > the following script(mailTest.php) > > <?PHP > $result = mail('[EMAIL PROTECTED]', 'test subject', 'test message'); > > if (!$result) > echo "FAILURE"; > else > echo "SUCCESS"; > ?> > > does NOT work if I access it from the web > > BUT > > if I were to execute it as root on the Command prompt > > php mailTest.php > > It executes correctly and I get mail. > > This feels like the apache user is lacking access over sendmail or > something... since as root I can execute the script from the CLI without a > problem, but from the web, I get a failure. You're probably on the right track with this. Check your php.ini settings for sendmail_path. Also.. the default setting for sendmail_path is 'sendmail -t -i' so if sendmail isn't in the path for your webuser then it wont get executed. To fix this, specifiy in you php.ini with the sendmail_path the absolute sendmail executable. ie: sendmail_path = "/usr/sbin/sendmail -t -i" HTH, Curt -- Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---I meant, file that are being executed. On Fri, 26 Nov 2004 09:46:05 -0500, John Nichel <[EMAIL PROTECTED]> wrote: > Jerry Swanson wrote: > > > > What variable(parameter) in PHP stores file name? > > > > TH > > Stores what filename? The name of the file being executed? > > $_SERVER['SCRIPT_NAME'] > > -- > John C. Nichel > ÜberGeek > KegWorks.com > 716.856.9675 > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
--- End Message ---
--- Begin Message ---* Thus wrote Todd Alexander: > Hello all, > I am a complete newbie to php so apologies for what I'm sure is a > simple/dumb question. I want to use php to include another html doc in > an existing set of documents. In other words "123.html" will use php to > call on "abc.html" so I can make changes to abc.html and have it update > on all my pages. I'm not sure what your asking. But by default .html files will *not* get parsed by php, unless you modifyy how your webserver treats .html files Curt -- Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---Dear All, I have a problem of back to the previous page in php..... I need to create a form let people to fill in .It can let user to preview the form, if information is not correct , user can back to previous page and correct it, I have used the javascript : OnClick='history.go(-1)' and OnClick='history.back()' in php , but it can not works....pls help me. Thanks and Regards, Cyrus Chan
--- End Message ---
--- Begin Message ---Hi all, I think I shouldnt post this here...but i didnt find proper support at the jpgraph forums. I'm using PHP 4.3.9 with GDK precompiled on apache2 using win2k. When i open any of the jpgraph example files its giving me an error saying "IE cannot find the site your are requesting". But when i remove some code in the example file and refresh the page its working and when i put the deleted code again back in that file and refresh its displaying the graph. When i close and open a fresh browser the same problem persisting. Couldnt find what might be the problem. Again ...i'm sorry for posting this topic here... /sagar
--- End Message ---