Re: [PHP] docs.google.com how do the export ?
Hi there, I guess they have some sort of mapping between HTML generated and PDF or Word syntax. There is a PDF extension for PHP so generaly they would do something like Hello There Some text Here !!! this can be easily converted to PDF $PDF = new PdfDoc(); $page_1 = $PDF->addPage(); $page_1->addText('Hello There','22'); // eg 22px default for H1 element $page_1->newLine(); $page_1->addText('Some Text Here!!!','14','green'); $PDF->save('sample.pdf'); P.S. methods for PfdDoc class was just sample ones for more info on PDF and PHP http://pear.php.net/package/File_PDF http://pecl.php.net/package/pdflib On Oct 24, 2007, at 8:35 AM, Torsten Rosenberger wrote: Hello I watched docs.google.com an wonder how they can export the WYSIWYG created content in pdf, word, ... Are they working with COM() functions on Windows ? to generate the docs and pdf or is it possible to create them with XSLT BR Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bojan Tesanovic http://www.classicio.com/ http://www.real-estates-sale.com/
[PHP] Close a session knowing it's ID (not the current session)
Hi all, i'd like that "admin" users on my site could close the session of another user, immediately forbidding him the access to the site (beside i'd delete the login of the user). Anyway of doing it using the default PHP session handler (i.e. whithout using a db to store sessions)? -- Stefano Esposito -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Prestiti e Finanziamenti con un semplice click, scopri subito se sei finanziabile cliccando qui Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2910&d=24-10 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Close a session knowing it's ID (not the current session)
You'll need to know the session_id of the session you want to close. The code above closes/ends the current users session, but simply substitute the desired session id (of course you'll need to know this in advance) for the call to session_id(). -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CURL + Frames, fopen + remote sessions
Hi, When using CURL to access a page with frames I get the "Your browser does not appear to support frames" error. How can get around this? Is there special header info that can be added? Also, if I were using fopen can anyone offer sample code how to login to remote site and deal with remote session info? Thanks! Jennifer -- View this message in context: http://www.nabble.com/CURL-%2B-Frames%2C-fopen-%2B-remote-sessions-tf4683978.html#a13384539 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FINDER
Hi everyone. I need to know how do I do a FINDER of clinics for zones. I am new in PHP, so my knowloge is not much. The user of this finder select the zone from the list, and click in the button, and them show a list of clinic with its data info (name, address, phones, etc) Thanks a lot! Emiliano
Re: [PHP] EMPTY??
Can you show us the form tag of your php file(html code)? Dan Shirah 写道: doing a var_dump($_POST['comments']; returns string(0) "" So the value of $comments in $comments = $_POST['comments']; SHOULD be equal to 0 or "", right? In which case when I do my original: if (!empty($comments)) { echo "Do Something"; } It SHOULD just bypass that and continue with my code, but instead it gives me the error, "Changed database context to Database." On 10/23/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote: On 10/23/07, Dan Shirah <[EMAIL PROTECTED]> wrote: I made two variables for the same posted value because I believe empty() does not work with strtoupper in front of the value. It only works with a standalone variable, correct? no; strtoupper modifies its argument, that is all. empty evaluates the argument it is given that is all. therefore, if empty is passed an string with no contents that has been passed through strtoupper, it will still be regarded as empty. When comments is left blank and I echo out the value for $check_comments it returns nothing at all which is why I think empty() or "" should work, but they don't. try using var_dump(); you will see that it is a string that has no contents, or perhaps some whitespace characters. -nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FINDER
On 10/24/07, Emiliano Boragina <[EMAIL PROTECTED]> wrote: > > Hi everyone. > > > > I need to know how do I do a FINDER of clinics for zones. > > I am new in PHP, so my knowloge is not much. > > The user of this finder select the zone from the list, and click in the > button, and them show a list of clinic with its data info (name, address, > phones, etc) > > > > Thanks a lot! > > Emiliano Emiliano, Some questions to begin: 1. Do you already have the clinic data? 2. If yes, in what form is it stored ( flat file? database? ) 3. How much knowledge of html/javascript, etc... do you have? David
[PHP] file_exists, is_readable & effective UID/GID
Hi all, file_exists and is_readable perfom there test with real UID/GID. Is there any functions that tests file existance with effective UID/GID ? Note: stat is not an option because it raises an E_WARNING if the file is not readable. Thanks, Manuel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file_exists, is_readable & effective UID/GID
On 10/24/07, Manuel Vacelet <[EMAIL PROTECTED]> wrote: > Hi all, > > file_exists and is_readable perfom there test with real UID/GID. > Is there any functions that tests file existance with effective UID/GID ? > > Note: stat is not an option because it raises an E_WARNING if the file > is not readable. > > Thanks, > Manuel > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > That's what you have things like -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic and is hospitalized. See? No good deed goes unpunished -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help with code not wrking
Hi all, I have inherited a problem script from a client, and it's a simple upload function. The problem is that while the image is being uploaded and saved as the same name it was uploaded as, it's not writing to the table the file name for display reference so it's like there is no picture. I appreciate any help you can provide. Thanks! Joey include ("sesion_admin.php"); include("../contentdb.php"); $res_state=mysql_query("select * from states where 1 order by state"); $id = $_GET["id"]; echo "ID: " . $id . "IDL: " . $local_id . " Photo: " . $userfile . " [B4 Upload]"; $p_proceso = $_POST["p_proceso"]; if($p_proceso=="borrar"){ $query_editar ="update Basic_Info set photo='' where Id=$id "; mysql_query($query_editar); } if($p_proceso=="upload"){ $UPLOAD = fopen($userfile, "r" ); $contents = fread($UPLOAD,$userfile_size); fclose($UPLOAD); $SAVEFILE = fopen("../photos/".$userfile, "wb" ); fwrite( $SAVEFILE, $contents,$userfile_size); fclose( $SAVEFILE ); #$query_editar ="update Basic_Info set photo='$userfile' where Id=$id "; mysql_query($query_editar); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] help with code not wrking
> From: [EMAIL PROTECTED] > To: php-general@lists.php.net > Date: Wed, 24 Oct 2007 15:27:28 -0400 > Subject: [PHP] help with code not wrking > > Hi all, > > > > I have inherited a problem script from a client, and it's a simple upload > function. > > The problem is that while the image is being uploaded and saved as the same > name it was uploaded as, it's not writing to the table the file name for > display reference so it's like there is no picture. > > > > I appreciate any help you can provide. > > > > Thanks! > > > Joey > > > > > > > > include ("sesion_admin.php"); > > include("../contentdb.php"); > > > > $res_state=mysql_query("select * from states where 1 order by state"); > > $id = $_GET["id"]; > > > > echo "ID: " . $id . "IDL: " . $local_id . " Photo: " . $userfile . " [B4 > Upload]"; > > > > $p_proceso = $_POST["p_proceso"]; > > > > if($p_proceso=="borrar"){ > > > > $query_editar ="update Basic_Info set photo='' where Id=$id "; > > mysql_query($query_editar); > > } > > > > if($p_proceso=="upload"){ > > > > > > $UPLOAD = fopen($userfile, "r" ); > > $contents = fread($UPLOAD,$userfile_size); > > fclose($UPLOAD); > > $SAVEFILE = fopen("../photos/".$userfile, "wb" ); > > fwrite( $SAVEFILE, $contents,$userfile_size); > > fclose( $SAVEFILE ); > > > > > > #$query_editar ="update Basic_Info set photo='$userfile' where Id=$id "; > > mysql_query($query_editar); > > } What is "$userfile"? Are you using "$_FILES"? http://php.he.net/manual/en/features.file-upload.php $_FILES['userfile']['name'] The original name of the file on the client machine. $_FILES['userfile']['tmp_name'] The temporary filename of the file in which the uploaded file was stored on the server. And don't forget to set the HTML form tag's enctype="multipart/form-data" _ Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now. http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033
[PHP] Question about time...
Hi Everyone, I am attempting to get the logic of something figured out and I thought someone might be able to confirm what I'm thinking :) I want to be able to display something like an image of a turkey during the month of november from now until I'm dead. I was playing around with mktime and it showed very different time stamps for 11/1/07 and 11/1/08 so I can't set it to compare specifically to the timestamp.. But, would I be able to have it evaluate the string stored in php as 11/1/07 and create a timestamp to compare todays date to, and if it matches within the month, have it display the turkey? and if not, have it display a different graphic? I'm attempting to be able to make small changes to my website without having to remember to do them or change them :) I hope I've made enough sense that someone can point me in the right direction :) Thanks for looking! -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED]
[PHP] Can a PHP script process a file on a remote computer?
Hi all: I'm working on a project that requires frequent updating of a large amount of data to a MySQL database. Currently, I'm trying to transfer a CSV file to the server, have it process the file, and then delete it once the processing is complete. Rather than waste the up-front time of having to upload the file (which is currently timing out without fully uploading the file and I have no idea how to resolve this!), is it possible to have the server open the specified file remotely and read it using the fgetcsv() function? If so, how? Any help you can give me will be GREATLY appreciated! Thanks, Jon
Re: [PHP] Question about time...
On 10/24/07, Jason Pruim <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > I am attempting to get the logic of something figured out and I > thought someone might be able to confirm what I'm thinking :) > > I want to be able to display something like an image of a turkey > during the month of november from now until I'm dead. I was playing > around with mktime and it showed very different time stamps for > 11/1/07 and 11/1/08 so I can't set it to compare specifically to the > timestamp.. But, would I be able to have it evaluate the string > stored in php as 11/1/07 and create a timestamp to compare todays > date to, and if it matches within the month, have it display the > turkey? and if not, have it display a different graphic? > > I'm attempting to be able to make small changes to my website without > having to remember to do them or change them :) > > I hope I've made enough sense that someone can point me in the right > direction :) > > Thanks for looking! > > -- > > Jason Pruim > Raoset Inc. > Technology Manager > MQC Specialist > 3251 132nd ave > Holland, MI, 49424 > www.raoset.com > [EMAIL PROTECTED] > > > -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic and is hospitalized. See? No good deed goes unpunished -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about time...
Errr... Never mind... Soon as I hit send I got a brain storm... I just do this: Or something similar, I'll try and feather it out and see how it works for multiple holidays :) (IE: Thanksgiving, Christmas, New Years, Halloween etc. etc.) On Oct 24, 2007, at 3:57 PM, Jason Pruim wrote: Hi Everyone, I am attempting to get the logic of something figured out and I thought someone might be able to confirm what I'm thinking :) I want to be able to display something like an image of a turkey during the month of november from now until I'm dead. I was playing around with mktime and it showed very different time stamps for 11/1/07 and 11/1/08 so I can't set it to compare specifically to the timestamp.. But, would I be able to have it evaluate the string stored in php as 11/1/07 and create a timestamp to compare todays date to, and if it matches within the month, have it display the turkey? and if not, have it display a different graphic? I'm attempting to be able to make small changes to my website without having to remember to do them or change them :) I hope I've made enough sense that someone can point me in the right direction :) Thanks for looking! -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about time...
I am attempting to get the logic of something figured out and I thought someone might be able to confirm what I'm thinking :) I want to be able to display something like an image of a turkey during the month of november from now until I'm dead. I was playing around with mktime and it showed very different time stamps for 11/1/07 and 11/1/08 so I can't set it to compare specifically to the timestamp.. But, would I be able to have it evaluate the string stored in php as 11/1/07 and create a timestamp to compare todays date to, and if it matches within the month, have it display the turkey? and if not, have it display a different graphic? I'm attempting to be able to make small changes to my website without having to remember to do them or change them :) I hope I've made enough sense that someone can point me in the right direction :) Well, I hope this makes sense: '; } ?> -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about time...
On 10/24/07, Daniel Brown <[EMAIL PROTECTED]> wrote: > On 10/24/07, Jason Pruim <[EMAIL PROTECTED]> wrote: > > Hi Everyone, > > > > I am attempting to get the logic of something figured out and I > > thought someone might be able to confirm what I'm thinking :) > > > > I want to be able to display something like an image of a turkey > > during the month of november from now until I'm dead. I was playing > > around with mktime and it showed very different time stamps for > > 11/1/07 and 11/1/08 so I can't set it to compare specifically to the > > timestamp.. But, would I be able to have it evaluate the string > > stored in php as 11/1/07 and create a timestamp to compare todays > > date to, and if it matches within the month, have it display the > > turkey? and if not, have it display a different graphic? > > > > I'm attempting to be able to make small changes to my website without > > having to remember to do them or change them :) > > > > I hope I've made enough sense that someone can point me in the right > > direction :) > > > > Thanks for looking! > > > > -- > > > > Jason Pruim > > Raoset Inc. > > Technology Manager > > MQC Specialist > > 3251 132nd ave > > Holland, MI, 49424 > > www.raoset.com > > [EMAIL PROTECTED] > > > > > > > > > if(date("M") == "11") { > // Display turkey > } > ?> > > -- > Daniel P. Brown > [office] (570-) 587-7080 Ext. 272 > [mobile] (570-) 766-8107 > > Give a man a fish, he'll eat for a day. Then you'll find out he was > allergic and is hospitalized. See? No good deed goes unpunished > Sorry, that should've been a lower-case M. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic and is hospitalized. See? No good deed goes unpunished -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can a PHP script process a file on a remote computer?
How big is the file? fgetcsv() will read any file that you can get a handle to using fopen() or fsockopen(), including remote files. However, if allow_url_fopen is not enabled, you can't use fopen(). Also if the file is so large that your script is timing out while waiting for it to be uploaded, it could also timeout just trying to read the file remotely as well. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can a PHP script process a file on a remote computer?
Go into your php.ini file and increase the script timeout length, which should allow the upload to finish. Jon Westcot <[EMAIL PROTECTED]> wrote: > Hi all: > > I'm working on a project that requires frequent updating of a large > amount of data to a MySQL database. Currently, I'm trying to transfer a CSV > file to the server, have it process the file, and then delete it once the > processing is complete. Rather than waste the up-front time of having to > upload the file (which is currently timing out without fully uploading the > file and I have no idea how to resolve this!), is it possible to have the > server open the specified file remotely and read it using the fgetcsv() > function? If so, how? > > Any help you can give me will be GREATLY appreciated! > > Thanks, > > Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about time...
On Oct 24, 2007, at 4:09 PM, Richard Heyes wrote: I am attempting to get the logic of something figured out and I thought someone might be able to confirm what I'm thinking :) I want to be able to display something like an image of a turkey during the month of november from now until I'm dead. I was playing around with mktime and it showed very different time stamps for 11/1/07 and 11/1/08 so I can't set it to compare specifically to the timestamp.. But, would I be able to have it evaluate the string stored in php as 11/1/07 and create a timestamp to compare todays date to, and if it matches within the month, have it display the turkey? and if not, have it display a different graphic? I'm attempting to be able to make small changes to my website without having to remember to do them or change them :) I hope I've made enough sense that someone can point me in the right direction :) Well, I hope this makes sense: '; } ?> Yeah... The joys of dealing with a cold that makes your head feel like it wants to explode and you just wish it would so it would feel better :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can a PHP script process a file on a remote computer?
Thanks, Wolf. I'm going to have to do a lot of long processes -- uploads, queries, and the like -- and I appreciate knowing that I can adjust that. Now if I can just find the PHP.INI file (Stupid GoDaddy-shared-domains; can't find anything on 'em.) Jon - Original Message - From: "Wolf" <[EMAIL PROTECTED]> To: "Jon Westcot" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Wednesday, October 24, 2007 1:16 PM Subject: Re: [PHP] Can a PHP script process a file on a remote computer? > Go into your php.ini file and increase the script timeout length, which should allow the upload to finish. > > > Jon Westcot <[EMAIL PROTECTED]> wrote: > > Hi all: > > > > I'm working on a project that requires frequent updating of a large amount of data to a MySQL database. Currently, I'm trying to transfer a CSV file to the server, have it process the file, and then delete it once the processing is complete. Rather than waste the up-front time of having to upload the file (which is currently timing out without fully uploading the file and I have no idea how to resolve this!), is it possible to have the server open the specified file remotely and read it using the fgetcsv() function? If so, how? > > > > Any help you can give me will be GREATLY appreciated! > > > > Thanks, > > > > Jon > > -- > 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 a PHP script process a file on a remote computer?
Hi Andrew: Thanks for the reply. If I use fopen() to open the remote file, how do I specify its location? Isn't it going to need to know not only the address of the computer I'm using but the path on that computer to the file? Does it get all that from the name I pass over to it? Also, can I adjust the allow_url_fopen setting from within a PHP script, or do I need to manually set it in the PHP.INI file? The server I'm using -- not my own; this is for a friend -- is a shared server with GoDaddy and they make it so incredibly hard to find anything. Thanks! Jon - Original Message - From: "Andrew Ballard" <[EMAIL PROTECTED]> To: "PHP General" Sent: Wednesday, October 24, 2007 1:15 PM Subject: Re: [PHP] Can a PHP script process a file on a remote computer? > How big is the file? fgetcsv() will read any file that you can get a > handle to using fopen() or fsockopen(), including remote files. > However, if allow_url_fopen is not enabled, you can't use fopen(). > Also if the file is so large that your script is timing out while > waiting for it to be uploaded, it could also timeout just trying to > read the file remotely as well. > > Andrew > > -- > 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 a PHP script process a file on a remote computer?
you probably won't be able to edit PHP.ini with shared-hosting. The other solutions, one I can think of it now - you can use PHP to upload files from remote computer to the server at certain time, and set schedule with cron to run your PHP scripts on your server. Good luck -Original Message- From: Jon Westcot [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 24, 2007 3:18 PM To: PHP General Subject: Re: [PHP] Can a PHP script process a file on a remote computer? Thanks, Wolf. I'm going to have to do a lot of long processes -- uploads, queries, and the like -- and I appreciate knowing that I can adjust that. Now if I can just find the PHP.INI file (Stupid GoDaddy-shared-domains; can't find anything on 'em.) Jon - Original Message - From: "Wolf" <[EMAIL PROTECTED]> To: "Jon Westcot" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Wednesday, October 24, 2007 1:16 PM Subject: Re: [PHP] Can a PHP script process a file on a remote computer? > Go into your php.ini file and increase the script timeout length, which should allow the upload to finish. > > > Jon Westcot <[EMAIL PROTECTED]> wrote: > > Hi all: > > > > I'm working on a project that requires frequent updating of a large amount of data to a MySQL database. Currently, I'm trying to transfer a CSV file to the server, have it process the file, and then delete it once the processing is complete. Rather than waste the up-front time of having to upload the file (which is currently timing out without fully uploading the file and I have no idea how to resolve this!), is it possible to have the server open the specified file remotely and read it using the fgetcsv() function? If so, how? > > > > Any help you can give me will be GREATLY appreciated! > > > > Thanks, > > > > Jon > > -- > 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 a PHP script process a file on a remote computer?
Hi again, Andrew: You had asked some questions that I forgot to address with my previous reply, so here goes: The test file that I'm using -- which probably is a small version of the normal file -- is around 60 MB in size (just under 30,000 records). I checked the phpinfo info and it appears that the allow_url_fopen setting is set to "On," which I take is a good thing. How, then, do I specify the filename at the server so that it points back to the file that is on my computer (or whatever computer is trying to initiate the process)? Thanks again for your help, Jon - Original Message - From: "Jon Westcot" <[EMAIL PROTECTED]> To: "PHP General" Sent: Wednesday, October 24, 2007 1:22 PM Subject: Re: [PHP] Can a PHP script process a file on a remote computer? > Hi Andrew: > > Thanks for the reply. > > If I use fopen() to open the remote file, how do I specify its location? > Isn't it going to need to know not only the address of the computer I'm > using but the path on that computer to the file? Does it get all that from > the name I pass over to it? > > Also, can I adjust the allow_url_fopen setting from within a PHP script, > or do I need to manually set it in the PHP.INI file? The server I'm > using -- not my own; this is for a friend -- is a shared server with GoDaddy > and they make it so incredibly hard to find anything. > > Thanks! > > Jon > > > - Original Message - > From: "Andrew Ballard" <[EMAIL PROTECTED]> > To: "PHP General" > Sent: Wednesday, October 24, 2007 1:15 PM > Subject: Re: [PHP] Can a PHP script process a file on a remote computer? > > > > How big is the file? fgetcsv() will read any file that you can get a > > handle to using fopen() or fsockopen(), including remote files. > > However, if allow_url_fopen is not enabled, you can't use fopen(). > > Also if the file is so large that your script is timing out while > > waiting for it to be uploaded, it could also timeout just trying to > > read the file remotely as well. > > > > Andrew > > > > -- > > 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] Multiple asynchronous requests (ajax)
Warning... this is ajax-related and not necessarily PHP (even though it calls PHP scripts). I sent this to several JS lists, but haven't received a response, so I thought I'd query this list to see if anyone here had an idea. ~Philip On 10/24/07, Philip Thompson <[EMAIL PROTECTED]> wrote: > > Hi. I have this js function below. In it I grab the coordinates of where > the user clicked (on the map). I want to take these coordinates and stuff > 'em into a database, then display on the map where they clicked. Then I want > to display some links in another div (not the map). > > [js code] > function addPoint (e, imageId) > { > var pl = new Array(); > pl = map.pointLocation (e, CURRENT_POINT_SIZE); > > var url = 'addPoint.php?x='+pl['x']+'&y='+pl['y']+'&size='+ > CURRENT_POINT_SIZE+'&map='+imageId; > xmlHttpRequest (url, null, updateMap, 'GET'); > > url = 'updateForm.php?x='+pl['x']+'&y='+pl['y']+'&size='+ > CURRENT_POINT_SIZE+'&map='+imageId; > xmlHttpRequest (url, null, updateForm, 'GET'); > } > > function xmlHttpRequest (url, vars, callbackFunction, requestMethod) {...} > [/js code] > > Here, xmlHttpRequest is the method I call to perform the asynchronous > requests. Ok, if I don't make the 2nd call to it, the points show up fine on > the map (from the 1st request). If I make both calls, the points do NOT show > up, but the links (from the 2nd request) appear. > > Is there an issue with calling this more than once? I tried setting a > timeout for the 2nd request, but that didn't seem to help. Thoughts? > > Thanks in advance, > ~Philip > >
[PHP] output-buffer and memory-issue
Hi, I got a strange problem: Using php 4.4.x, I capture the whole output for a webpage into the output-buffer by using ob_start and ob_get_clean, because I got to make some replacements in the html-code before sending the page to the browser. This worked fine with a small page, but now I got a page for which the html-code is about 280 KB (not too big I think). But I get an server-error 500 for this script on my linux-based webhoster. I tried to run it on an local WAMP-installation - it worked without error. I temporarly deleted some of the output - it worked without error. I turned of the output-buffering - it worked without error. I printed memory_get_usage, but it never exceeded 2 MB (I load about 200 records from a database and create objects from it and then print the data of these 200 records). On phpinfo(), memory_limit of my webhoster is 40M - so 2MB SHOULD be no problem. I increased the memory-limit to 64M - it doesn't help. Any idea what I could do next? I got no access to the apache error-log, but the error is definitely connected to the output buffer and how much I try to store in it. Any help is welcome. Regards Wuschba __ Ihr erstes Fernweh? Wo gibt es den schönsten Strand? www.yahoo.de/clever -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can a PHP script process a file on a remote computer?
On 10/24/07, Jon Westcot <[EMAIL PROTECTED]> wrote: > The test file that I'm using -- which probably is a small version of the > normal file -- is around 60 MB in size (just under 30,000 records). That sounds like a rather large file to process anyway. You might need to use some scheduled task like Lance suggested to copy the file and then open it locally. I'm not sure how GoDaddy hosting works. > I checked the phpinfo info and it appears that the allow_url_fopen > setting is set to "On," which I take is a good thing. It's pretty typical, but you never know without checking since it is an option. > How, then, do I > specify the filename at the server so that it points back to the file that > is on my computer (or whatever computer is trying to initiate the process)? The file has to be accessible from the server through either a web path or some sort of file share or local file path. So if the server can see the file as http://remoteserver/remotefile.csv, \\remoteserver\remotefile.csv, etc., you can use that path. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file_exists, is_readable & effective UID/GID
Daniel Brown wrote: On 10/24/07, Manuel Vacelet <[EMAIL PROTECTED]> wrote: Hi all, file_exists and is_readable perfom there test with real UID/GID. Is there any functions that tests file existance with effective UID/GID ? Note: stat is not an option because it raises an E_WARNING if the file is not readable. Thanks, Manuel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php That's what you have things like what about doing it like this? http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiple asynchronous requests (ajax) [SOLVED]
After doing some reading, I figured out that I was causing a race condition because my request was declared globally. I fixed this by making it local. So, it had nothing to do with the addPoint() function, but I just saw the affects there. I read this here (http://developer.mozilla.org/en/docs/AJAX:Getting_Started) on Step 3, Note 3. ~Philip On 10/24/07, Philip Thompson <[EMAIL PROTECTED]> wrote: > > Hi. I have this js function below. In it I grab the coordinates of where > the user clicked (on the map). I want to take these coordinates and stuff > 'em into a database, then display on the map where they clicked. Then I want > to display some links in another div (not the map). > > [js code] > function addPoint (e, imageId) > { > var pl = new Array(); > pl = map.pointLocation (e, CURRENT_POINT_SIZE); > > var url = 'addPoint.php?x='+pl['x']+'&y='+pl['y']+'&size='+ > CURRENT_POINT_SIZE+'&map='+imageId; > xmlHttpRequest (url, null, updateMap, 'GET'); > > url = 'updateForm.php?x='+pl['x']+'&y='+pl['y']+'&size='+ > CURRENT_POINT_SIZE+'&map='+imageId; > xmlHttpRequest (url, null, updateForm, 'GET'); > } > > function xmlHttpRequest (url, vars, callbackFunction, requestMethod) {...} > [/js code] > > Here, xmlHttpRequest is the method I call to perform the asynchronous > requests. Ok, if I don't make the 2nd call to it, the points show up fine on > the map (from the 1st request). If I make both calls, the points do NOT show > up, but the links (from the 2nd request) appear. > > Is there an issue with calling this more than once? I tried setting a > timeout for the 2nd request, but that didn't seem to help. Thoughts? > > Thanks in advance, > ~Philip >
RE: [PHP] Question about time...
> I want to be able to display something like an image of a turkey > during the month of november from now until I'm dead. And how will the application know when you are dead? _ Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now. http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033
Re: [PHP] Question about time...
On 10/24/07, Instruct ICC <[EMAIL PROTECTED]> wrote: > > > I want to be able to display something like an image of a turkey > > during the month of november from now until I'm dead. > > And how will the application know when you are dead? > > _ > Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it > now. > http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033 \n"; die($jason); ?> -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic and is hospitalized. See? No good deed goes unpunished -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can a PHP script process a file on a remote computer?
There is set_time_limit() that works from the script as long as safe_mode is not enabled. http://docs.php.net/manual/en/function.set-time-limit.php Ed On Oct 24, 2007, at 3:26 PM, Vo, Lance wrote: you probably won't be able to edit PHP.ini with shared-hosting. The other solutions, one I can think of it now - you can use PHP to upload files from remote computer to the server at certain time, and set schedule with cron to run your PHP scripts on your server. Good luck -Original Message- From: Jon Westcot [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 24, 2007 3:18 PM To: PHP General Subject: Re: [PHP] Can a PHP script process a file on a remote computer? Thanks, Wolf. I'm going to have to do a lot of long processes -- uploads, queries, and the like -- and I appreciate knowing that I can adjust that. Now if I can just find the PHP.INI file (Stupid GoDaddy-shared- domains; can't find anything on 'em.) Jon - Original Message - From: "Wolf" <[EMAIL PROTECTED]> To: "Jon Westcot" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Wednesday, October 24, 2007 1:16 PM Subject: Re: [PHP] Can a PHP script process a file on a remote computer? Go into your php.ini file and increase the script timeout length, which should allow the upload to finish. Jon Westcot <[EMAIL PROTECTED]> wrote: Hi all: I'm working on a project that requires frequent updating of a large amount of data to a MySQL database. Currently, I'm trying to transfer a CSV file to the server, have it process the file, and then delete it once the processing is complete. Rather than waste the up-front time of having to upload the file (which is currently timing out without fully uploading the file and I have no idea how to resolve this!), is it possible to have the server open the specified file remotely and read it using the fgetcsv() function? If so, how? Any help you can give me will be GREATLY appreciated! Thanks, Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question about time...
what about if (date("m") == 11){ echo ""; } bastien > To: php-general@lists.php.net> From: [EMAIL PROTECTED]> Date: Wed, 24 Oct 2007 15:57:38 -0400> Subject: [PHP] Question about time...>> Hi Everyone,>> I am attempting to get the logic of something figured out and I> thought someone might be able to confirm what I'm thinking :)>> I want to be able to display something like an image of a turkey> during the month of november from now until I'm dead. I was playing> around with mktime and it showed very different time stamps for> 11/1/07 and 11/1/08 so I can't set it to compare specifically to the> timestamp.. But, would I be able to have it evaluate the string> stored in php as 11/1/07 and create a timestamp to compare todays> date to, and if it matches within the month, have it display the> turkey? and if not, have it display a different graphic?>> I'm attempting to be able to make small changes to my website without> having to remember to do them or change them :)>> I hope I've made enough sense that someone can point me in the right> direction :)>> Thanks for looking!>> -->> Jason Pruim> Raoset Inc.> Technology Manager> MQC Specialist> 3251 132nd ave> Holland, MI, 49424> www.raoset.com> [EMAIL PROTECTED]>> _ Have fun while connecting on Messenger! Click here to learn more. http://entertainment.sympatico.msn.ca/WindowsLiveMessenger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] register globals not working
Hi I have installed php v5 on a windowsXP PC. Server is Apache 2.2. Even though I have turned register globals on in the ini file, the php is still not allowing the use of $HTTP_GET_VARS (and probably other similier variables), and I am having to change my existing script to $_GET before they will run. Any idea why the directive is being ignored? Rodney Courtis
RE: [PHP] Question about time...
At 3:10 PM -0700 10/24/07, Instruct ICC wrote: > I want to be able to display something like an image of a turkey during the month of november from now until I'm dead. And how will the application know when you are dead? When you stop paying for hosting, the application get's the idea when it's bits go poof! If anyone ever noticed, my web site (http://sperling.com) has a tree on it that changes with the seasons. I use: $dates = getdate(); $month = $dates['mon']; $w = "http://www.sperling.com/css/seasons/";; switch( $month ) { case "03": case "04": case "05": $var = $w . "spring.jpg"; break; case "06": case "07": case "08" : $var = $w . "summer.jpg"; break; case "09": case "10": case "11": $var = $w . "fall.jpg"; break; case "12": case "01": case "02": $var = $w . "winter.jpg"; $break; } echo($var); And this code is called from within my css file for a background image. Yes, I use variables in css. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] register globals not working
You're using the wrong option. Register globals is for the auto-creation of variables passed through GET, POST, etc. What you want is register_long_vars (or something like that, long variables, long arrays...) Chris Rodney Courtis wrote: Hi I have installed php v5 on a windowsXP PC. Server is Apache 2.2. Even though I have turned register globals on in the ini file, the php is still not allowing the use of $HTTP_GET_VARS (and probably other similier variables), and I am having to change my existing script to $_GET before they will run. Any idea why the directive is being ignored? Rodney Courtis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] system command
I tried: $a=$_SERVER["REMOTE_ADDR"]; echo "REMOTE_ADDR=$a"; if($a="192.168.250.108") { $a="61.64.101.101"; } $aa=system('lynx -dump http://api.hostip.info/country.php?ip=$a',$location); echo "a=$aaa=$aalocation=$location"; $aa=system('lynx -dump http://api.hostip.info/country.php?ip=61.64.101.101',$location); echo "a=$aaa=$aalocation=$location"; I get: REMOTE_ADDR=192.168.250.108 XX a=61.64.101.101 aa=XX location=0 TW a=61.64.101.101 aa=TW location=0 as you can see, if I put the IP address in, I get the right answer (TW). What am I doing wrong? bye Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] output-buffer and memory-issue
On Wed, 2007-10-24 at 21:07 +, Werner Schneider wrote: > Hi, I got a strange problem: Using php 4.4.x, I capture the whole output for > a webpage into the output-buffer by using ob_start and ob_get_clean, because > I got to make some replacements in the html-code before sending the page to > the browser. > > This worked fine with a small page, but now I got a page for which the > html-code is about 280 KB (not too big I think). But I get an server-error > 500 for this script on my linux-based webhoster. > > I tried to run it on an local WAMP-installation - it worked without error. > I temporarly deleted some of the output - it worked without error. > I turned of the output-buffering - it worked without error. > > I printed memory_get_usage, but it never exceeded 2 MB (I load about 200 > records from a database and create objects from it and then print the data of > these 200 records). > On phpinfo(), memory_limit of my webhoster is 40M - so 2MB SHOULD be no > problem. > I increased the memory-limit to 64M - it doesn't help. > > Any idea what I could do next? I got no access to the apache error-log, but > the error is definitely connected to the output buffer and how much I try to > store in it. > > Any help is welcome. Use some random URL parameter and detect it in your script. When detected enabled display errors: Then see if you get any errors. Although, if you're seg faulting, you still won't see an error since the program just dies. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question about time...
> > > I want to be able to display something like an image of a turkey > >> during the month of november from now until I'm dead. > > > >And how will the application know when you are dead? > > When you stop paying for hosting, the application get's the idea when > it's bits go poof! Yep, that will do it. I wonder if they can legally bill your "estate"? Or if the estate is liable. > If anyone ever noticed, my web site (http://sperling.com) has a tree > on it that changes with the seasons. I use: Nice. _ Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare! http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews
RE: [PHP] system command
> Date: Thu, 25 Oct 2007 09:43:14 +0800 > From: [EMAIL PROTECTED] > To: php-general@lists.php.net > Subject: [PHP] system command > > I tried: > > $a=$_SERVER["REMOTE_ADDR"]; > echo "REMOTE_ADDR=$a"; > if($a="192.168.250.108") { > $a="61.64.101.101"; > } > > > $aa=system('lynx -dump http://api.hostip.info/country.php?ip=$a',$location); > echo "a=$aaa=$aalocation=$location"; > > $aa=system('lynx -dump > http://api.hostip.info/country.php?ip=61.64.101.101',$location); > echo "a=$aaa=$aalocation=$location"; > > > I get: > > REMOTE_ADDR=192.168.250.108 > XX > > a=61.64.101.101 > aa=XX > location=0 > TW > > a=61.64.101.101 > aa=TW > location=0 > > > as you can see, if I put the IP address in, I get the right answer (TW). > > What am I doing wrong? > > bye > > Ronald Use double quotes to get the value of $a or else you get the literal string "$a". $aa=system("lynx -dump http://api.hostip.info/country.php?ip=$a",$location); or $aa=system('lynx -dump http://api.hostip.info/country.php?ip='.$a,$location); _ Peek-a-boo FREE Tricks & Treats for You! http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
Re: [PHP] file_exists, is_readable & effective UID/GID
On 10/24/07, Jim Lucas <[EMAIL PROTECTED]> wrote: > Daniel Brown wrote: > > On 10/24/07, Manuel Vacelet <[EMAIL PROTECTED]> wrote: > >> Hi all, > >> > >> file_exists and is_readable perfom there test with real UID/GID. > >> Is there any functions that tests file existance with effective UID/GID ? > >> > >> Note: stat is not an option because it raises an E_WARNING if the file > >> is not readable. > >> > >> Thanks, > >> Manuel > >> > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > > > > That's what you have things like > > > > what about doing it like this? > > > $filename = __FILE__; > > $stat_info = @stat($filename); > > if ( $stat_info ) { > // do something... > } > > The '@' will suppress the E_WARNING notice > if stat fails the condition will fail. I much prefer the second solution (Jim's one) even if I find that php limitation amazing ! Thank you for your help. Cheers, Manuel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] output-buffer and memory-issue
--- Robert Cummings <[EMAIL PROTECTED]> schrieb: > On Wed, 2007-10-24 at 21:07 +, Werner Schneider > wrote: > > Hi, I got a strange problem: Using php 4.4.x, I > capture the whole output for a webpage into the > output-buffer by using ob_start and ob_get_clean, > because I got to make some replacements in the > html-code before sending the page to the browser. > > > > This worked fine with a small page, but now I got > a page for which the html-code is about 280 KB (not > too big I think). But I get an server-error 500 for > this script on my linux-based webhoster. > > > > I tried to run it on an local WAMP-installation - > it worked without error. > > I temporarly deleted some of the output - it > worked without error. > > I turned of the output-buffering - it worked > without error. ... > > Any idea what I could do next? I got no access to > the apache error-log, but the error is definitely > connected to the output buffer and how much I try to > store in it. > > > > Any help is welcome. > > Use some random URL parameter and detect it in your > script. When > detected enabled display errors: > > > if( isset( $_GET['knjdcrksjhfcsjkhfndkf'] ) ) > { >ini_set( 'display_errors', 1 ); > } > > ?> > > Then see if you get any errors. Although, if you're > seg faulting, you > still won't see an error since the program just > dies. Thanks for your reply. It seems that this is happening, becaus even with your code I get no errors. It could be as well that the script dies before the printing of the output buffer starts, because it could be that the error is printed to the output buffer as well. Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php