Re: [PHP] array_walk inside class method
Hi Thanks for ur help. Its Working but I couldn't understand the syntax given by u can u explain pls. Thanks again. On Sun, 6 Jan 2002, Gyozo Papp wrote: it may be better: array_walk($this-array, array($this, 'func1'); Attila Strauss [EMAIL PROTECTED] wrote in message 001d01c195db$67647da0$[EMAIL PROTECTED]">news:001d01c195db$67647da0$[EMAIL PROTECTED]... | hi | | $this-func1(); | | | best regards | attila | | | | | Hi All, | I want to use array_walk function inside a class method. But the | problem is i want the second argument to array_walk ( function name ) | be a another function of the same class. when i gave like that its telling | | Error : function not exist. | | class some() | { | | function func1() | { | } | function func2() | { | array_walk($array,func1); | } | } | | What is the syntax or way to do this. | | | Thanks in Advance. | | S.Murali Krishna | [EMAIL PROTECTED] | = | We grow slow trying to be great | | - E. Stanley Jones | - | | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | To contact the list administrators, e-mail: [EMAIL PROTECTED] | | S.Murali Krishna [EMAIL PROTECTED] = We grow slow trying to be great - E. Stanley Jones - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: bcc
If you mean blind carbon copy on e-mails then www.php.net/manual/en/function.mail.php http://www.php.net/manual/en/function.mail.php explains how to do it. If you mean anything else please elaborate Tim www.chessish.com http://www.chessish.com -- From: Deependra B. Tandukar [SMTP:[EMAIL PROTECTED]] Sent: 07 January 2002 03:29 To: PHP General Subject: bcc Greetings ! Is Bcc supported in PHP? Looking forward to hearing from you. Warm Regards, DT -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] strip from html to closing body tag
Hi, Hi i need to strip out the html up to the body tag. For some reason, my function, preg_replace( /html(.*)body(.*) , , $body ); does not work. Ok I am not really brilliant at regular expressions ... Help? Jay
[PHP] Regarding mail function
Hi , My file name: bala.php --- ?phpmail("[EMAIL PROTECTED]", "hi friend", "Hi, how are you? Expecting reply from you. -Bala"); ? for the above program I am getting the following warning.. - Warning: Server Error in c:\www/bala.php on line 3- I have changed in php.ini with my SMTP server (arabhi.wipro.com or 10.145.2.18) In outlook settings we give the username and password for our mail server. Is it required here also? could you please tell available headers for e-mail function? Is ther any headers like user name and password?? Any help greatly appreciable... Thanks in advance. -Balaji --- Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at mailto:[EMAIL PROTECTED] and delete this mail from your records. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Regarding mail function
tet -Original Messa[Sandeep Murphy] ter ge- From: Balaji Ankem [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 7 de Janeiro de 2002 10:55 To: [EMAIL PROTECTED] Subject: [PHP] Regarding mail function Hi , My file name: bala.php --- ?php mail([EMAIL PROTECTED], hi friend, Hi, how are you? Expecting reply from you. -Bala); ? for the above program I am getting the following warning.. - Warning: Server Error in c:\www/bala.php on line 3 - I have changed in php.ini with my SMTP server (arabhi.wipro.com or 10.145.2.18) In outlook settings we give the username and password for our mail server. Is it required here also? could you please tell available headers for e-mail function? Is ther any headers like user name and password?? Any help greatly appreciable... Thanks in advance. -Balaji
[PHP] define() function strange output... !!!!
Hi everibody I have Apache running under Linux SuSE 7.2 with PHP/4.0.4pl1 The server the Linux and the php instalation is the standart SuSE package instalation from the SuSE install cd-s so, everithing is fine except one thing: calling this test.php script in browser window: ?php define(_Sc,Test); #echo 'the constant is: ' . _Sc . 'br /'; if(defined(_Sc)){ echo 'Test:' . _Sc ; }else{ echo 'Test: false'; } ? ... gives only on first time the excpected output: Test: Test after reloading a few times the script returns some strange output like : Test: /%/(% or something like this, sometimes some values of other constants then some characters and sometimes the server hangs up.. so that means that the httpd process dies and the process SSL hangs up, and i have to kill it manualy in order to be able to start up the server again. one small detail: calling the same script from the shell: shell: ./test.php !/usr/bin/php ?php define(_Sc,hi hu hi\n); #echo 'the constant is: ' . _Sc . 'br /'; if(defined(_Sc)){ echo 'ja:' . _Sc ; }else{ echo 'nein'; } ? .. returns allways the excpected output without errors so my idea is that this may be a mod_php4 problem, but i wonder if i am the only one that have this problemm yet becoase i have the standart instalation from SuSe CD Do anyone have some similar problemm and if yes how would you suggest to solwe this? I hasitate to uninstal php or apache becouse this is a customer server and i did not foud some updates or patches by SuSE for this, strange is that i did not heared about someone having this problem thanks levon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP + Windows 98 + Apache
Hi all, I have installed Apache on my win 98 machine and it runs fine .. however, am unable to configure Apache to run with PHP. I installed the binary version of PHP and edited the httpd.conf file as instructed in the install.txt of php but am getting a browser (400) page not found error.. any suggestions are appreciated, TIA, Sandeep -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strip from html to closing body tag
Hi, Ur quest is not clear. Whether u want to delete everything upto body tag or only html tags up to body tag. anyway this might work for the former. $parsed = preg_replace(/\\n/,,$html); // to remove '\n' in HTML file $parsed = preg_replace(/^(html.*)(body.*)/,\\2,$parsed); // to remove string upto body tag Thanks. On Mon, 7 Jan 2002, WB wrote: Hi, Hi i need to strip out the html up to the body tag. For some reason, my function, preg_replace( /html(.*)body(.*) , , $body ); does not work. Ok I am not really brilliant at regular expressions ... Help? Jay S.Murali Krishna [EMAIL PROTECTED] = We grow slow trying to be great - E. Stanley Jones - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP + Windows 98 + Apache
hm.. I also have Apache with PHP and mysql on my win 98 and it runs fine with both.. check ones more the configure steps to be done for php configuration or write detailed what steps have you gone thru configuring levon On Mon, 7 Jan 2002, Sandeep Murphy wrote: Hi all, I have installed Apache on my win 98 machine and it runs fine .. however, am unable to configure Apache to run with PHP. I installed the binary version of PHP and edited the httpd.conf file as instructed in the install.txt of php but am getting a browser (400) page not found error.. any suggestions are appreciated, TIA, Sandeep -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strip from html to closing body tag
Hi WB, Hi i need to strip out the html up to the body tag. preg_replace( /html(.*)body(.*) , , $body ); try this: preg_replace( /html[^body]*body[^]*/ , , $body ); -- Jimmy Your mind is like parachute. It works best when it is open. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: NEWBIE IN DISTRESS: Install Instructions are not work for PHP 4.1.1!!!
My module configuration (Win98, Apache 1.3.22, PHP 4.1.1) started working after I added the line: AddModule mod_php4.c to httpd.conf. This seems to be an omission from the install.txt as stated in the php.windows thread Apache 1.3.22 and PHP 4.1.0 d.d. Jan 3, 2002. It's added as note to the on-line manual (http://www.php.net/manual/en/install.apache.php): Note: In Apache 1.3.22 for Windows, the default configuration file (httpd.conf-dist-win) has a ClearModuleList directive included by default. If this directive is used, it is required to put an AddModule mod_php4.c to the AddModule list, as else PHP will not be registered as an Apache module. HTH, Freddy Vulto Mark [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I apologize if the title of this post sounds overly aggresive, but I have followed the instructions to a 'T' and got nowhere!! I have tried the auto install version of PHP and manual instructions for installing PHP 4.1.1. Neither of them work. I added the lines to my httpd.conf file for both types of installs (not at the same time) as discribed in the Install.txt file, along with the instructions on the website, and can get no test scripts to run or PHP for that matter. All I get is a blank screen when running the CGI version or can not even get apache to load when I try the Module version (Get a Requested Operation Failed message). can someone please help? My system is as follows: Windows 2000 SP2 Apache 2.0.28 (I have also tried version 1.3.22 with same results as mentioned above) PHP 4.1.1 MDAC 2.7 MySQL 3.23.46a Thanks in advance!! Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP + Windows 98 + Apache
hi, ok, heres what I did exactly... 1.Downloaded and extracted PHP version 4.1.1 to c:\php 2. Copied php4ts.dll to c:\windows\system (running win98) 3. php.ini-dist to c:\windows and renamed it to php.ini 4. Edited the php.ini as follows: changed the 'extension_dir' setting to point to my c:\php Set the 'doc_root' to point to my webservers document_root. c:\apache\htdocs 5. Copied the lines ( ScriptAlias /php/ c:/php4/ AddHandler application/x-httpd-php .php Action application/x-httpd-php3 /php-bin/php.exe) to my httpd.conf (tried placing these lines at the end first, then after the load module statements.. all in vain) 6. Restarted Apache any suggestions?? Thanks, sandeep -Original Message- From: Levon Ghazaryan [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 7 de Janeiro de 2002 11:39 To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP + Windows 98 + Apache hm.. I also have Apache with PHP and mysql on my win 98 and it runs fine with both.. check ones more the configure steps to be done for php configuration or write detailed what steps have you gone thru configuring levon On Mon, 7 Jan 2002, Sandeep Murphy wrote: Hi all, I have installed Apache on my win 98 machine and it runs fine .. however, am unable to configure Apache to run with PHP. I installed the binary version of PHP and edited the httpd.conf file as instructed in the install.txt of php but am getting a browser (400) page not found error.. any suggestions are appreciated, TIA, Sandeep -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP + Windows 98 + Apache
I think this steps could not make PHP running.. On Mon, 7 Jan 2002, Sandeep Murphy wrote: hi, ok, heres what I did exactly... 1.Downloaded and extracted PHP version 4.1.1 to c:\php 2. Copied php4ts.dll to c:\windows\system (running win98) 3. php.ini-dist to c:\windows and renamed it to php.ini 4. Edited the php.ini as follows: changed the 'extension_dir' setting to point to my c:\php Set the 'doc_root' to point to my webservers document_root. c:\apache\htdocs 5. Copied the lines ( ScriptAlias /php/ c:/php4/ --- Do you whant php running as CGI ? AddHandler application/x-httpd-php .php --- OK Action application/x-httpd-php3 /php-bin/php.exe) -- Action application/x-httpd-php4 /php-bin/php.exe) -- is php.exe really in [Apache-root]/php-bin/php.exe ? to my httpd.conf (tried placing these lines at the end first, then after the load module statements.. all in vain) 6. Restarted Apache any suggestions?? Thanks, sandeep -Original Message- From: Levon Ghazaryan [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 7 de Janeiro de 2002 11:39 To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP + Windows 98 + Apache hm.. I also have Apache with PHP and mysql on my win 98 and it runs fine with both.. check ones more the configure steps to be done for php configuration or write detailed what steps have you gone thru configuring levon On Mon, 7 Jan 2002, Sandeep Murphy wrote: Hi all, I have installed Apache on my win 98 machine and it runs fine .. however, am unable to configure Apache to run with PHP. I installed the binary version of PHP and edited the httpd.conf file as instructed in the install.txt of php but am getting a browser (400) page not found error.. any suggestions are appreciated, TIA, Sandeep -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] POSTing HTML into a database
On Monday 07 January 2002 01:59, Richard S. Crawford wrote: I've used a combination of addslashes() and stripslashes() along with htmlspecialchars() to perform just that sort of thing, though I used MySQL instead of PostreSQL. Can you help me along a bit further? I can't seem to get them in the right order. Thanks. --jaa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regarding mail function
Gee, Sandeep, what a great reply! I wish I got this kind of support when I asked a question on this list too! Balaji, sorry, man, I don't know how to help you - I was just touched by Sandeep's reply and wanted to point it out for everybody to see just how helpful we are in these parts. Tet be thy name! Bogdan Sandeep Murphy wrote: tet -Original Messa[Sandeep Murphy] ter ge- From: Balaji Ankem [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 7 de Janeiro de 2002 10:55 To: [EMAIL PROTECTED] Subject: [PHP] Regarding mail function Hi , My file name: bala.php --- ?php mail([EMAIL PROTECTED], hi friend, Hi, how are you? Expecting reply from you. -Bala); ? for the above program I am getting the following warning.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Stupid Question Alert - part 2
Thanks for everyone's comments. If I understand what you are saying it should be possible to fill the content of a layer by issuing some sort of server include command.. (?) So, for example, rather than have a something that looks like this: div id=haiti style=position:absolute; left:752px; top:321px; width:166px; height:162px; z-index:14; visibility: hidden table width=166 border=0 cellpadding=0 cellspacing=0 tr td img src=Atlas/images/photolayer_11.gif width=81 height=55/td td img src=Atlas/images/photolayer_12.gif width=85 height=55/td /tr tr td img src=Atlas/images/photolayer_14.gif width=81 height=53/td td img src=Atlas/images/photolayer_15.gif width=85 height=53/td /tr tr td img src=Atlas/haiti_17.gif width=81 height=55/td td img src=Atlas/haiti_18.gif width=85 height=55/td /tr /table /div It should be possible to have some code that gives the layer position but rather than then having all the other code describing the layer contents, have some sort of php command that says 'get the contents from file xxx.php'. If this is the case what should I be learning about to make this happen? Thanks again, Tim (standing on the shoulders of giants) --- Your question is not stupid - it's just uninformed, and that's easily understandable if you never used PHP. The concept is dynamically creating the page SERVER-SIDE. That is, use some databases or some nifty code to dynamically build a page using specific parameters. Unforunately for you, this means that all the fun ends on the server side. Once PHP ends its job, Apache takes over and serves the content generated by PHP as it would serve any regular file. What you actually pass to the client is dead information - it's not dynamic unless you echo some JavaScript code or something similar from PHP (which is the same as writing the respective code in a regular file, unless you create some custom parameters in JavaScript based on some other parameters you pass to PHP). Hope my explanation makes sense... ;-) Bogdan tim at 10Kv wrote: Hi, first of all apologise to the list this is a very basic question for you I¹m sure. I have tried to find an answer on the web but the problem is knowing HOW to ask the question and I hoping you can provide me with a starting point. Anyway.. I design a lot of graphic intensive pages which rely heavily on layers that contain images, mouseovers and image swaps. The trouble is, when there are more than a couple of these layers on a page the code gets long and over complicated. For example, if I have a page which on one side contains an image map with 5 clickable points that shows one of 5 possible layers on the other side of the page (each with different content) this is automatically a page with lots of code which is slow to load especially if the page already has a layer based navigation bar! My question is: is there a way to use a language like php to make this process easier? For example populate the layers from a different file rather than have all the code on the same page and perhaps slim the page down a little or is this missing the point of what a language like php is about. Thanks for your help and my apologies if this is the worst question of the week. Tim Rogers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Another php data gathering question
Use the exec() function to make the system calls you need. Miles Thompson At 10:47 PM 1/6/2002 -0600, Gaylen Fraley wrote: Is there any way, through PHP, to get the: server uptime processor type number of cpu's I'm trying to find a compatable solution for both win32 and *nix. Thanks! -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com/ PHP KISGB v3.02 Guest Book http://www.gaylenandmargie.com/phpwebsite/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strip from html to closing body tag
Hi, the code u sent is displaying the html as it is, but There is more than one way to do that. Atmost we can atleast do this. $pos = strpos($html,body); $start = substr($html,0,$pos - 1); $html = substr($html,$pos); $start = preg_replace(/html/,,$start); print $start $html ; On Mon, 7 Jan 2002, Jimmy wrote: Hi WB, Hi i need to strip out the html up to the body tag. preg_replace( /html(.*)body(.*) , , $body ); try this: preg_replace( /html[^body]*body[^]*/ , , $body ); -- Jimmy Your mind is like parachute. It works best when it is open. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] S.Murali Krishna [EMAIL PROTECTED] = We grow slow trying to be great - E. Stanley Jones - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Remote Cookie ID and Web Statistics
Miles, The reason for the javascript is that the hosting ISP does not support PHP. Each time a new session is started, the javascript would have to: - check for cookie - if it doesn't exist -poll database for next new custome ID# -set new cookie id -update database with page info -download java applet (does something else) I guess I wasn't sure if a non PHP supported domain could access the PHP database from a remot server or not and how one would do that. I am setting things up in PHP but fairly new at it. Rick Miles Thompson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Why would you want to use Javascript? Just have some code at the top of each page which -checks for the cookie -if it doesn't exist -identify customer, login page or however you choose -set cookie -update database -if it does exist -update the database with some information pertinent to that page Or are these straight HTML pages, thus the need for Javascript to do something? I don't konw a lot of Javascript, but you could have it pop open a PHP page in a child browser window, back in the Z-order so that it would be behind your main page (only for Internet Explorer), and use it to do the above steps. For every page transition you would have to pass the appropriate parameters to the child window and force it to refresh. You will have some trouble with people who have Javascript and cookies turned off. As I said, I don't know Javascript, so this is just off the top of my head. A straight PHP solution would be preferable and I assume it's not possible either because the ISP doesn't host it or for some political reason. Miles Thompson At 10:28 PM 1/6/2002 -0500, Richard Spangenberg wrote: Hello, - for something a little different... Does anyone have experience using Javascript on remote server html delivered pages to capture data in a PHP MySQL database resident at my domain. I would like to build a customer profile database for a customer using a permanent cookie on a visitor's browser client to ID them and track their visits by page over time. This is similar to a live or remote web statistics process for a session but posting to a mysql database by some mapped category by page in addition to the web stats. I'd like to track both the session and by posting to a visitor database, long term trends as well. Any suggestions would be appreciated. Thanks, Rick [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Zhang Session Expiration
Hey all, I am using the Zhang session method from http://www.phpbuilder.com/columns/ying2602.php3 and it works great with a mysql database. Does anyone out there know how to tell if a session is expired using this method? The Read Session function is: \\---; function sess_read($key) { global $SESS_DBH, $SESS_LIFE; $qry = SELECT value FROM Sessions WHERE sesskey = '$key' AND expiry . time(); $qid = mysql_query($qry, $SESS_DBH); if (list($value) = mysql_fetch_row($qid)) { return $value; } return false; } \\---; So if session is expired, this script will return nothing (per the expiry WHERE clause). Say I had placed a variable called $NameOfUser in the session data using session_register($NameOfUser), if the session is expired, would I be able to know that it was expired by using isset($NameOfUser) after running the session_register($NameOfUser) in the script?? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Remote Cookie ID and Web Statistics
Rick, It's amazing how one gets locked into a PHP mindset. Do all that stuff you outlined in your reply, but why not have a second Java applet to update a remote database? PHP doesn't have ownership over the database. Miles At 08:06 AM 1/7/2002 -0500, Richard Spangenberg wrote: Miles, The reason for the javascript is that the hosting ISP does not support PHP. Each time a new session is started, the javascript would have to: - check for cookie -if it doesn't exist -poll database for next new custome ID# -set new cookie id -update database with page info -download java applet (does something else) I guess I wasn't sure if a non PHP supported domain could access the PHP database from a remot server or not and how one would do that. I am setting things up in PHP but fairly new at it. Rick -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 06, 2002 10:52 PM To: Richard Spangenberg; [EMAIL PROTECTED] Subject: Re: [PHP] Remote Cookie ID and Web Statistics Why would you want to use Javascript? Just have some code at the top of each page which -checks for the cookie -if it doesn't exist -identify customer, login page or however you choose -set cookie -update database -if it does exist -update the database with some information pertinent to that page Or are these straight HTML pages, thus the need for Javascript to do something? I don't konw a lot of Javascript, but you could have it pop open a PHP page in a child browser window, back in the Z-order so that it would be behind your main page (only for Internet Explorer), and use it to do the above steps. For every page transition you would have to pass the appropriate parameters to the child window and force it to refresh. You will have some trouble with people who have Javascript and cookies turned off. As I said, I don't know Javascript, so this is just off the top of my head. A straight PHP solution would be preferable and I assume it's not possible either because the ISP doesn't host it or for some political reason. Miles Thompson At 10:28 PM 1/6/2002 -0500, Richard Spangenberg wrote: Hello, - for something a little different... Does anyone have experience using Javascript on remote server html delivered pages to capture data in a PHP MySQL database resident at my domain. I would like to build a customer profile database for a customer using a permanent cookie on a visitor's browser client to ID them and track their visits by page over time. This is similar to a live or remote web statistics process for a session but posting to a mysql database by some mapped category by page in addition to the web stats. I'd like to track both the session and by posting to a visitor database, long term trends as well. Any suggestions would be appreciated. Thanks, Rick [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Remote Cookie ID and Web Statistics
Miles, Thanks, now I have to just figure out how to do that stuff. I take it handling PHP from a remote non-PHP server is not a big issue. The Java Applet is doing something else. It is providing a monitoring process to the database so a static html page and be pushed whatever content if the database application so deems it without refreshing the html page. :) Miles Thompson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Rick, It's amazing how one gets locked into a PHP mindset. Do all that stuff you outlined in your reply, but why not have a second Java applet to update a remote database? PHP doesn't have ownership over the database. Miles At 08:06 AM 1/7/2002 -0500, Richard Spangenberg wrote: Miles, The reason for the javascript is that the hosting ISP does not support PHP. Each time a new session is started, the javascript would have to: - check for cookie -if it doesn't exist -poll database for next new custome ID# -set new cookie id -update database with page info -download java applet (does something else) I guess I wasn't sure if a non PHP supported domain could access the PHP database from a remot server or not and how one would do that. I am setting things up in PHP but fairly new at it. Rick -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 06, 2002 10:52 PM To: Richard Spangenberg; [EMAIL PROTECTED] Subject: Re: [PHP] Remote Cookie ID and Web Statistics Why would you want to use Javascript? Just have some code at the top of each page which -checks for the cookie -if it doesn't exist -identify customer, login page or however you choose -set cookie -update database -if it does exist -update the database with some information pertinent to that page Or are these straight HTML pages, thus the need for Javascript to do something? I don't konw a lot of Javascript, but you could have it pop open a PHP page in a child browser window, back in the Z-order so that it would be behind your main page (only for Internet Explorer), and use it to do the above steps. For every page transition you would have to pass the appropriate parameters to the child window and force it to refresh. You will have some trouble with people who have Javascript and cookies turned off. As I said, I don't know Javascript, so this is just off the top of my head. A straight PHP solution would be preferable and I assume it's not possible either because the ISP doesn't host it or for some political reason. Miles Thompson At 10:28 PM 1/6/2002 -0500, Richard Spangenberg wrote: Hello, - for something a little different... Does anyone have experience using Javascript on remote server html delivered pages to capture data in a PHP MySQL database resident at my domain. I would like to build a customer profile database for a customer using a permanent cookie on a visitor's browser client to ID them and track their visits by page over time. This is similar to a live or remote web statistics process for a session but posting to a mysql database by some mapped category by page in addition to the web stats. I'd like to track both the session and by posting to a visitor database, long term trends as well. Any suggestions would be appreciated. Thanks, Rick [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HOWTO USE : htmlspecialchars
form action=form.php method=GET Info: input type=text name=info size=25 maxlength=25 value=?php htmlspecialchars($info); ? input type=submit /form Hi, im trying this form w/ htmlspecialchars (php function), but it doesn't seem to work, when i submit the form.. htmlspecialchars($info); is included on the source ex: ? HTMLSpecialChars($info); ? Hm, am i correct? thanks!! louie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Zhang Session Expiration
At 07:20 AM 1/7/2002 -0600, phantom wrote: Hey all, I am using the Zhang session method from http://www.phpbuilder.com/columns/ying2602.php3 and it works great with a mysql database. Does anyone out there know how to tell if a session is expired using this method? Yep. The expiry field is equal to the UNIX timestamp at which the session will expire. To get a list of sessions that have already expired, you can use this: $query = SELECT * FROM sessions WHERE expiry . time(); Say I had placed a variable called $NameOfUser in the session data using session_register($NameOfUser), if the session is expired, would I be able to know that it was expired by using isset($NameOfUser) after running the session_register($NameOfUser) in the script?? That sounds about right. You might want to try: if (!session_is_registered(NameOfUser)) { //restart session } Although I don't know if that function is reliable with the custom session handler...I think it should be though. I've been using that exact same session handler for several weeks in one of my scripts and it works great -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Compiled version of PHP 4.1.1 for Mandrake 8.1
I am looking for with compiled version of the newest PHP 4.1.1 for Linux Mandrake 8.1. -- Jaroslaw -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] CC Processing in PHP
hi, Do PHP has some built-in support for Credit Card Processing? Is there any library available that can be used for processing Credit Cards? Thanks for your time. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Compiling PHP with GD2.0 ?
Hi, I have just upgraded my system (FreeBSD4.4 box with Apache/PHP/MySQL) and I want to use GD2.0.1 with PHP. I have installed GD 2.0.1 from /usr/ports onto the system so the package is actually there, but I have no idea how to compile GD2 ability into PHP. If anyone can lend some assistance it would be appreciated. I really want to be able to use the ImageCopyResampled() function. Thanks Chris --- CDR - Crowley Digital Reproductions - Hard Rock Heavy Metal CD Bootlegs http://crowley.thegatesofhell.org/cdr/ My ICQ # is 1096929 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MSFT Front Page inserts quotes
I have a client which edits all his PHP pages as HTML files in MSFT Front Page. That's not been a problem until now, as the pages are all straight HTML except for a bit at the very top. Here's the problem. We need this line at the top of the page, ahead of the HTML tag, for an automatic login routine: ? session_start();session_register( origin );$origin=$PHP_SELF; ..and a bunch of stuff ... ? Front Page insists on doing this to the line: ? session_start();session_register( origin );$origin= $PHP_SELF; ..and a bunch of stuff ... ?, putting quotation marks around $PHP_SELF; like so : $PHP_SELF; Needless to say this causes parse errors. I can open the file in the HTML tag of Front Page, eliminate the quotes and save it. When I reopen the file the quotes have reappeared. I have removed the file from the Front Page web, edited it using a plain ASCII editor, then reloaded it. Guess what, the quotes magically reappear. Does anyone have any suggestions? It's Front Page 98 by the way. For those of you who are wondering how I change these files to PHP I just parse them after they are uploaded to the server, changing all links to point to .php rather than .html and saving the changed files with .php extensions. Regards - Miles Thompson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MSFT Front Page inserts quotes
Why not just use an auto_prepend rule in your config and prepend that bit of PHP code automatically without touching the FrontPage-generated crap? -Rasmus On Mon, 7 Jan 2002, Miles Thompson wrote: I have a client which edits all his PHP pages as HTML files in MSFT Front Page. That's not been a problem until now, as the pages are all straight HTML except for a bit at the very top. Here's the problem. We need this line at the top of the page, ahead of the HTML tag, for an automatic login routine: ? session_start();session_register( origin );$origin=$PHP_SELF; ..and a bunch of stuff ... ? Front Page insists on doing this to the line: ? session_start();session_register( origin );$origin= $PHP_SELF; ..and a bunch of stuff ... ?, putting quotation marks around $PHP_SELF; like so : $PHP_SELF; Needless to say this causes parse errors. I can open the file in the HTML tag of Front Page, eliminate the quotes and save it. When I reopen the file the quotes have reappeared. I have removed the file from the Front Page web, edited it using a plain ASCII editor, then reloaded it. Guess what, the quotes magically reappear. Does anyone have any suggestions? It's Front Page 98 by the way. For those of you who are wondering how I change these files to PHP I just parse them after they are uploaded to the server, changing all links to point to .php rather than .html and saving the changed files with .php extensions. Regards - Miles Thompson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HOWTO USE : htmlspecialchars
Hi louie, ?php htmlspecialchars($info); ? htmlspecialchars() do not change the passed variable. it will _return_ the result. so you have to do like this: $info = htmlspecialchars($info); please read the manual before asking to the list. it's clearly stated there, and there's even an example on how to use this function. -- Jimmy Leave loved ones with loving words, it may be the last time you see them -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] take links from url
Hi Alawi, I want to take string between table/table tags in put it in variable preg_match (|table([^/table]*)/table|i, $str, $match); $match[1] will contain the string between table/table -- Jimmy Fate shuffles the cards and we play with them -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP, XML
hi, Does anyone know of a mailing list for PHP and XML or can I just pose them here?? Thanks, sandeep -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP, XML
Does anyone know of a mailing list for PHP and XML or can I just pose them here?? PHP-XML. The list address is: [EMAIL PROTECTED] Chris
[PHP] I am very new Question
Hello I am extremely new to PHP and I want to have a clickable item that will bring up a particular item from the database (i.e a menu) What is the proceedure here? Can anyone help me? Thanks Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I am very new Question
I am extremely new to PHP and I want to have a clickable item that will bring up a particular item from the database (i.e a menu) What is the proceedure here? Can anyone help me? Hi, Take a look at one or more scriptarchives like hotscripts.com If you want to learn more about PHP please go to the links on www.php.net it will give you several links where you can learn more. Many many tutorials.. Bye, B. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strange Session Issues
I posted a question earlier, but I don't think I explained my problem all that well. I am having problem with sessions on my W2K box. I can start sessions and register variables but I can't, however, seem to get the contents of the registered variables written. When I open the session file (the actual physical file located on the server), this is its contents: !sess_user|!blah|!sessUserClass|!sessFormData|!oUser| Each of those variables should have some data associated with them. Please note that I have not added the '!' to the variables. I don't think I am having file permission problems because some data is actually being written. The only data missing (and the most crucial) is the contents of each those variables. Does anybody have any suggestions? Thanks! alastair -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
php-general Digest 7 Jan 2002 16:09:14 -0000 Issue 1097
php-general Digest 7 Jan 2002 16:09:14 - Issue 1097 Topics (messages 79643 through 79702): Re: bcc 79643 by: Bogdan Stancescu 79646 by: Mehmet Kamil ERISEN 79668 by: Tim Ward Re: How to read/write form/into certain place in a text fil e 79644 by: Zhang, Leon (STHK/Zh) 79651 by: Jimmy 79652 by: Zhang, Leon (STHK/Zh) Re: bcc] 79645 by: Bogdan Stancescu Re: Remote Cookie ID and Web Statistics 79647 by: Miles Thompson 79685 by: Richard Spangenberg 79687 by: Miles Thompson 79688 by: Richard Spangenberg phpinfo() question 79648 by: Gaylen Fraley 79649 by: Jason Murray 79650 by: Gaylen Fraley no reply-to header? 79653 by: Jimmy 79654 by: Martin Towell 79666 by: Jimmy Another php data gathering question 79655 by: Gaylen Fraley 79683 by: Miles Thompson Scripting events with php 79656 by: Puck 79657 by: Jason Murray 79658 by: Richard S. Crawford IF in mysql query results problem 79659 by: Jason Dulberg 79662 by: Mehmet Kamil ERISEN 79663 by: Jason Dulberg Re: To you know-it-all's out there... 79660 by: qartis Re: PHP Security Alert for Apache/Win32 79661 by: Garth Dahlstrom 2 images, merge, make one transparent 79664 by: Peter J. Schoenster Re: distinct element from array 79665 by: Kancha . Re: array_walk inside class method 79667 by: S. Murali Krishna strip from html to closing body tag 79669 by: WB 79674 by: S. Murali Krishna 79677 by: Jimmy 79684 by: S. Murali Krishna Regarding mail function 79670 by: Balaji Ankem 79671 by: Sandeep Murphy 79681 by: Bogdan Stancescu define() function strange output... 79672 by: Levon Ghazaryan PHP + Windows 98 + Apache 79673 by: Sandeep Murphy 79675 by: Levon Ghazaryan 79678 by: Sandeep Murphy 79679 by: Levon Ghazaryan Re: NEWBIE IN DISTRESS: Install Instructions are not work for PHP 4.1.1!!! 79676 by: Freddy Vulto Re: POSTing HTML into a database 79680 by: James Arthur Stupid Question Alert - part 2 79682 by: tim at 10Kv Zhang Session Expiration 79686 by: phantom 79690 by: Michael Sims HOWTO USE : htmlspecialchars 79689 by: louie miranda 79696 by: Jimmy Compiled version of PHP 4.1.1 for Mandrake 8.1 79691 by: Programmer CC Processing in PHP 79692 by: Muhammad Asif Compiling PHP with GD2.0 ? 79693 by: Chris Aitken MSFT Front Page inserts quotes 79694 by: Miles Thompson 79695 by: Rasmus Lerdorf Re: take links from url 79697 by: Jimmy PHP, XML 79698 by: Sandeep Murphy 79699 by: Boget, Chris I am very new Question 79700 by: Kevin P 79701 by: B. van Ouwerkerk Strange Session Issues 79702 by: Alastair 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--- What do you mean? Supported in what way? (I take it you're referring to the e-mail blind carbon copy feature). Bogdan Deependra B. Tandukar wrote: Greetings ! Is Bcc supported in PHP? Looking forward to hearing from you. ---End Message--- ---BeginMessage--- Dear List, I is always a good idea to check out the manual before asking questions. The answer to Leon's question about files is in the manual as well as the answer to this questions. I hope the following links help. File Operations: http://www.php.net/manual/en/ref.filesystem.php Bcc can be found in this section: http://www.php.net/manual/en/ref.mail.php Copying from the manual: /* recipients */$to = Mary [EMAIL PROTECTED] . , ; //note the comma$to .= Kelly [EMAIL PROTECTED];/* subject */$subject = Birthday Reminders for August;/* message */$message = 'htmlhead titleBirthday Reminders for August/title/headbodypHere are the birthdays upcoming in August!/ptable tr thPerson/ththDay/ththMonth/ththYear/th /tr tr tdJoe/tdtd3rd/tdtdAugust/tdtd1970/td tdSally/tdtd17th/tdtdAugust/tdtd1973/td /tr/table/body/html';/* To send HTML mail, you can set the Content-type header. */$headers = MIME-Version: 1.0\r\n;$headers .= Content-type: text/html; charset=iso-8859-1\r\n;/* additional headers */$headers .= From: Birthday Reminder [EMAIL PROTECTED]\r\n;$headers .= Cc: [EMAIL PROTECTED]\r\n;$headers .= Bcc: [EMAIL PROTECTED]\r\n;/* and now mail it */mail($to, $subject, $message, $headers); Bogdan Stancescu [EMAIL PROTECTED] wrote: What do you mean? Supported in what way? (I take it you're referring to the e-mail blind carbon copy feature). Bogdan Deependra B. Tandukar wrote: Greetings ! Is Bcc supported
[PHP] global generation
I need to call a generated variable global w/i a function but the following doesn't work: for ($i=0; $i $num_results; $i++) { global $variable[$i]; } I am trying to pass a similarly created form element to a function. I have two questions. Why doesn't this work? And, what else can I do to get the same results. Thanks, rodney
RE: [PHP] Strange Session Issues
Once again, is register_globals on or off in your php.ini file? It would help us if we knew that :) Kirk -Original Message- From: Alastair [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 9:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Strange Session Issues I posted a question earlier, but I don't think I explained my problem all that well. I am having problem with sessions on my W2K box. I can start sessions and register variables but I can't, however, seem to get the contents of the registered variables written. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] global generation
try : for ($i=0; $i $num_results; $i++) { $some= $$GLOBALS[variable]; // $some[$i] is what you need. } Regards, Andrey Hristov - Original Message - From: Rodney Davis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 07, 2002 6:11 PM Subject: [PHP] global generation I need to call a generated variable global w/i a function but the following doesn't work: for ($i=0; $i $num_results; $i++) { global $variable[$i]; } I am trying to pass a similarly created form element to a function. I have two questions. Why doesn't this work? And, what else can I do to get the same results. Thanks, rodney -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] global generation
Ooops, no $$ before GLOBALS, single $ for ($i=0; $i $num_results; $i++) { $some= $GLOBALS[variable]; // $some[$i] is what you need. } Regards, Andrey Hristov - Original Message - From: Andrey Hristov [EMAIL PROTECTED] To: Rodney Davis [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, January 07, 2002 6:15 PM Subject: Re: [PHP] global generation try : for ($i=0; $i $num_results; $i++) { $some= $$GLOBALS[variable]; // $some[$i] is what you need. } Regards, Andrey Hristov - Original Message - From: Rodney Davis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 07, 2002 6:11 PM Subject: [PHP] global generation I need to call a generated variable global w/i a function but the following doesn't work: for ($i=0; $i $num_results; $i++) { global $variable[$i]; } I am trying to pass a similarly created form element to a function. I have two questions. Why doesn't this work? And, what else can I do to get the same results. Thanks, rodney -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strange Session Issues
I've turned it off. When I try reading a variable using $HTTP_SESSION_VARS[blah] but it says that there is no index for 'blah'. thanks! alastair Kirk Johnson [EMAIL PROTECTED] wrote in message 01A4B59FD1EBD311838100A0C98BE0D9AD5EFB@chef">news:01A4B59FD1EBD311838100A0C98BE0D9AD5EFB@chef... Once again, is register_globals on or off in your php.ini file? It would help us if we knew that :) Kirk -Original Message- From: Alastair [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 9:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Strange Session Issues I posted a question earlier, but I don't think I explained my problem all that well. I am having problem with sessions on my W2K box. I can start sessions and register variables but I can't, however, seem to get the contents of the registered variables written. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strange Session Issues
With it off, session_register() is not needed. Also, session variables must be accessed thru the $HTTP_SESSION_VARS[] array. Try this code: test_session1.php ? session_start(); $HTTP_SESSION_VARS['blah'] = good; ? test_session2.php ? session_start(); echo session_is_registered(blah) . br; echo session_encode(). br; echo isset($HTTP_SESSION_VARS) . br; echo sizeof($HTTP_SESSION_VARS) . br; echo $HTTP_SESSION_VARS['blah']; ? -Original Message- From: Alastair [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 9:33 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Strange Session Issues I've turned it off. When I try reading a variable using $HTTP_SESSION_VARS[blah] but it says that there is no index for 'blah'. thanks! alastair Kirk Johnson [EMAIL PROTECTED] wrote in message 01A4B59FD1EBD311838100A0C98BE0D9AD5EFB@chef">news:01A4B59FD1EBD311838100A0C98BE0D9AD5EFB@chef... Once again, is register_globals on or off in your php.ini file? It would help us if we knew that :) Kirk -Original Message- From: Alastair [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 9:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Strange Session Issues I posted a question earlier, but I don't think I explained my problem all that well. I am having problem with sessions on my W2K box. I can start sessions and register variables but I can't, however, seem to get the contents of the registered variables written. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP/SQL login problems
I am having problems connecting and pulling data from a local SQL server. I have set up a user and, as far as I can tell, all the settings for the user are correct. However, when I try to pull data using the user, I get empty result sets--almost as if I don't have SELECT permissions. When I log in via Query Analyzer with the same login/pass, I am able to pull the data with no problems. Also, when I use the same code but log into an offsite database, the code works fine (except for the lag of pulling large amounts of data--which is what I'm trying to avoid) The only thing I can figure that might be affecting it is the ownership. The owner of the DB is 'dbo'--because this is a straight copy of a database on an offsite server. Any help would be greatly appreciated. Best regards, Jeremy Reed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strange Session Issues
WOO HOO!!! :-) Thanks Kirk! I didn't realize that you had to use session_vars to write the variables as well. That's a huge weight taken off my chest. :-) cheers, alastair Kirk Johnson [EMAIL PROTECTED] wrote in message 01A4B59FD1EBD311838100A0C98BE0D9AD5EFC@chef">news:01A4B59FD1EBD311838100A0C98BE0D9AD5EFC@chef... With it off, session_register() is not needed. Also, session variables must be accessed thru the $HTTP_SESSION_VARS[] array. Try this code: test_session1.php ? session_start(); $HTTP_SESSION_VARS['blah'] = good; ? test_session2.php ? session_start(); echo session_is_registered(blah) . br; echo session_encode(). br; echo isset($HTTP_SESSION_VARS) . br; echo sizeof($HTTP_SESSION_VARS) . br; echo $HTTP_SESSION_VARS['blah']; ? -Original Message- From: Alastair [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 9:33 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Strange Session Issues I've turned it off. When I try reading a variable using $HTTP_SESSION_VARS[blah] but it says that there is no index for 'blah'. thanks! alastair Kirk Johnson [EMAIL PROTECTED] wrote in message 01A4B59FD1EBD311838100A0C98BE0D9AD5EFB@chef">news:01A4B59FD1EBD311838100A0C98BE0D9AD5EFB@chef... Once again, is register_globals on or off in your php.ini file? It would help us if we knew that :) Kirk -Original Message- From: Alastair [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 9:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Strange Session Issues I posted a question earlier, but I don't think I explained my problem all that well. I am having problem with sessions on my W2K box. I can start sessions and register variables but I can't, however, seem to get the contents of the registered variables written. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strange Session Issues
So, it *is* a Happy Monday for you ;) You're very welcome. Kirk -Original Message- From: Alastair [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 10:06 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Strange Session Issues WOO HOO!!! :-) Thanks Kirk! I didn't realize that you had to use session_vars to write the variables as well. That's a huge weight taken off my chest. :-) cheers, alastair -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] carriage returns
Sorry for the newbie question but I can't find it in the docs. How do I preserve carriage returns when inserting into and extracting data from a mysql db? I thought htmlspecialchars() would do the trick but it doesn't. thanks
[PHP] create a file .png
Hi, i wanna create a file png, but i don´t want. i don´t know what happens but an error occurs... Warning: ImagePng: unable to open /home/httpd/html/pollolitoral/tempo/07012002.png for writing in /home/httpd/html/admin/generic/create_png_clima.php3 on line 80 i put imagepng($img,pollolitoral/tempo/07012002.png); please, help me Aurélio Sabino
RE: [PHP] create a file .png
problems with this email: - no script to look at problems with the script: - directory permissions? - gd installation incomplete? - php installation missing gd? -Original Message- From: aurelio [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 12:46 PM To: [EMAIL PROTECTED] Subject: [PHP] create a file .png Hi, i wanna create a file png, but i don´t want. i don´t know what happens but an error occurs... Warning: ImagePng: unable to open /home/httpd/html/pollolitoral/tempo/07012002.png for writing in /home/httpd/html/admin/generic/create_png_clima.php3 on line 80 i put imagepng($img,pollolitoral/tempo/07012002.png); please, help me Aurélio Sabino -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] carriage returns
Inserting data from a textarea or something? If so, have a look at http://www.php.net/nl2br - probably what you're after. Cheers Jon -Original Message- From: Rodney Davis [mailto:[EMAIL PROTECTED]] Sent: 07 January 2002 17:47 To: [EMAIL PROTECTED] Subject: [PHP] carriage returns Sorry for the newbie question but I can't find it in the docs. How do I preserve carriage returns when inserting into and extracting data from a mysql db? I thought htmlspecialchars() would do the trick but it doesn't. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Running php in background?
I wrote a php program that has to do a lot of processing on a couple large mySQL tables that can take hours, so often the page will time out or kick back a cannot find server errir. But it seems by checking the DB that records are still being updated. IS it possible the job runs in background even though it fails to delive the final results in the browser? I don't need the final results, it just says when the job is completed. Ideally, I would like to run the job in the background anyway. Can that be done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to check if a session exists
if (session_is_registered(variable)) { ... } - Original Message - From: Alex Shi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 20, 2001 11:34 PM Subject: [PHP] How to check if a session exists If a sesson_id is known, how can check if the session exists? Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MSFT Front Page inserts quotes
The dull thud you hear is me giving myself a good whack on the side of the head. I don't want to require a security check / auto-login for every file on the site, so I'm just removing the offending text to an include and trying it that way. Tks - Miles Thompson At 06:35 AM 1/7/2002 -0800, Rasmus Lerdorf wrote: Why not just use an auto_prepend rule in your config and prepend that bit of PHP code automatically without touching the FrontPage-generated crap? -Rasmus On Mon, 7 Jan 2002, Miles Thompson wrote: I have a client which edits all his PHP pages as HTML files in MSFT Front Page. That's not been a problem until now, as the pages are all straight HTML except for a bit at the very top. Here's the problem. We need this line at the top of the page, ahead of the HTML tag, for an automatic login routine: ? session_start();session_register( origin );$origin=$PHP_SELF; ..and a bunch of stuff ... ? Front Page insists on doing this to the line: ? session_start();session_register( origin );$origin= $PHP_SELF; ..and a bunch of stuff ... ?, putting quotation marks around $PHP_SELF; like so : $PHP_SELF; Needless to say this causes parse errors. I can open the file in the HTML tag of Front Page, eliminate the quotes and save it. When I reopen the file the quotes have reappeared. I have removed the file from the Front Page web, edited it using a plain ASCII editor, then reloaded it. Guess what, the quotes magically reappear. Does anyone have any suggestions? It's Front Page 98 by the way. For those of you who are wondering how I change these files to PHP I just parse them after they are uploaded to the server, changing all links to point to .php rather than .html and saving the changed files with .php extensions. Regards - Miles Thompson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Running php in background?
Hi James, Ideally, I would like to run the job in the background anyway. Can that be done? read this: http://www.php.net/manual/en/function.exec.php and search for 'background' keyword. -- Jimmy Brigands will demand your money or your life, but a woman will demand both. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] global generation
Wait until after the for loop has completed. for ($i=0; $i $num_results; $i++) { $variable[$i]; } global $variable; I need to call a generated variable global w/i a function but the following doesn't work: for ($i=0; $i $num_results; $i++) { global $variable[$i]; } I am trying to pass a similarly created form element to a function. I have two questions. Why doesn't this work? And, what else can I do to get the same results. Thanks, rodney -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] global generation
Wait until after the for loop has completed. for ($i=0; $i $num_results; $i++) { $variable[$i]; } global $variable; That's not going to work. The only thing that is doing is making an already global instance of $variable global within the function. What you want is this instead: $GLOBALS[$variable] = $variable; Chris
[PHP] PHP and security (like fopen)
Hello, this is my security problem with PHP have a free web hosting server and i permit users to use PHP and some functions like fopen ! The problem is that i would like to denied fopen to works with my own web file of my website users: /home/user/www/ Me: /var/www/html/ One solution consist to forbidden the user of fopen (i dont want this for their file ...) 2nd: all extension for my own php scripts are for exemple phx Can i accept the commande fopen with file php but forbid fopen(any_file.phx) ??? 3: Or, can i accept some function ONLY if they are execute from my own subnet ? The final alternative will be to modify directly the code source of php and recompile but any help will be welcoming ! Thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Running php in background?
I had Apache running on Win98 and doing a pretty demanding job (well, for a 350MHz K2) and it slowed the machine down noticeably. If the PHP script timed out the computer came back to like but if i closed the browser window or clicked stop it seemed to keep doing it. Maybe MySQL is finishing off the query it was last given until it terminates or whatever. If a big, complex query was sent through lots of records this one quesry could take a long time to sort out LJ James Hudnall [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I wrote a php program that has to do a lot of processing on a couple large mySQL tables that can take hours, so often the page will time out or kick back a cannot find server errir. But it seems by checking the DB that records are still being updated. IS it possible the job runs in background even though it fails to delive the final results in the browser? I don't need the final results, it just says when the job is completed. Ideally, I would like to run the job in the background anyway. Can that be done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] SAR data graphing toolkit
Is there a PHP SAR data graphing toolkit out there? I've yet to see one. Any info on this is welcome. -- Austin Gonyou Systems Architect, CCNA Coremetrics, Inc. Phone: 512-698-7250 email: [EMAIL PROTECTED] It is the part of a good shepherd to shear his flock, not to skin it. Latin Proverb signature.asc Description: This is a digitally signed message part
[PHP] counting with dates (help!)
Hello, This is my problem: $today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! How can I let php count in real days/month/years in stead of numbers? Maybe this is a silly question, but anyone who has the answer would help me very much! Thanks in advance! -- Met vriendelijke groet / With Greetings, Sander Peters site: http://www.visionnet.nl/ email: mailto:[EMAIL PROTECTED] webmail: mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] counting with dates (help!)
You'll need to use Julian format (I think that the name for it) which is DDD - is the year and DDD is the number of days into the year. I'm unsure as to how to do this in PHP so you'll need to do some searching - unless someone knows... Would be nice to know exactly how to do it in case it crops up for me in the future sometime... Martin -Original Message- From: Sander Peters [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 9:22 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] counting with dates (help!) Hello, This is my problem: $today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! How can I let php count in real days/month/years in stead of numbers? Maybe this is a silly question, but anyone who has the answer would help me very much! Thanks in advance! -- Met vriendelijke groet / With Greetings, Sander Peters site: http://www.visionnet.nl/ email: mailto:[EMAIL PROTECTED] webmail: mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] counting with dates (help!)
$today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! No, that's the difference in time represented by the number of seconds. You still need to work with it a little more. 8876 / 60 = number of hours /* 60 = number of seconds in an hour */ 8876 / 60 / 24 = number of days. /* 24 = number of hours in a day */ Chris
[PHP] Re: counting with dates (help!)
$today=mktime(0,0,0,date(m),date(d),date(Y)); $last_week=mktime(0,0,0,date(m,mktime(0,0,0,date(m),date(d)-7,date(Y ))),date(d,mktime(0,0,0,date(m),date(d)-7,date(Y))),date(Y,mktime( 0,0,0,date(m),date(d)-7,date(Y; echo date(d,$today)-date(d,$last_week); -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com Sander Peters [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, This is my problem: $today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! How can I let php count in real days/month/years in stead of numbers? Maybe this is a silly question, but anyone who has the answer would help me very much! Thanks in advance! -- Met vriendelijke groet / With Greetings, Sander Peters site: http://www.visionnet.nl/ email: mailto:[EMAIL PROTECTED] webmail: mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP and security (like fopen)
It sounds like you're on a UNIX-like system. Ever hear of user/group file permissions? Just set the proper permissions on your directories and files and you're fine. There are many ways to do this sort of thing, so I won't get into it, but it would be much easier to focus on permissions than hacking the PHP source code for something so simple. Hint: A good place to start would be to look at the user that Apache runs as (or whatever web server you're using). J Yves Reveillon wrote: Hello, this is my security problem with PHP have a free web hosting server and i permit users to use PHP and some functions like fopen ! The problem is that i would like to denied fopen to works with my own web file of my website users: /home/user/www/ Me: /var/www/html/ One solution consist to forbidden the user of fopen (i dont want this for their file ...) 2nd: all extension for my own php scripts are for exemple phx Can i accept the commande fopen with file php but forbid fopen(any_file.phx) ??? 3: Or, can i accept some function ONLY if they are execute from my own subnet ? The final alternative will be to modify directly the code source of php and recompile but any help will be welcoming ! Thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Running php in background?
For this sort of thing, it may be easier to run the job from a shell. Try compiling php as the CGI/CLI executable. Then you can run your scripts like, say, a Perl script or whatever. Just add the ampersand at the end of the command to run it in the background. (I'm assuming a UNIX-like system with some sort of sh/bash-like shell.) Also remember to set the timeout to 0 at the beginning of the script using set_time_limit(0); You might also want to surpress output to stdout for background jobs, which is generally preferable for UNIX background processes. If you still want to do it via the browser, just use set_time_limit(0). Even if you hit stop or the connection is broken, I think the script will still execute, unless you've registered a shutdown function, but I'm not 100% positive on that one. J James Hudnall wrote: I wrote a php program that has to do a lot of processing on a couple large mySQL tables that can take hours, so often the page will time out or kick back a cannot find server errir. But it seems by checking the DB that records are still being updated. IS it possible the job runs in background even though it fails to delive the final results in the browser? I don't need the final results, it just says when the job is completed. Ideally, I would like to run the job in the background anyway. Can that be done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] counting with dates (help!)
Well, I'll chime in as well. I'd recommend doing all your calculations in timestamps in seconds, then convert the results into days, dates, or whatever. If you only have a date to start with then convert to a timestamp, do the calculation, and convert back. You could wrap it in a function like this: ?php function dateDiffInDays($date1,$date2) { $date1Tm = strtotime($date1); $date2Tm = strtotime($date2); $diff = abs($date1Tm - $date2Tm) / 86400; return $diff; } $today = date(Ymd,mktime(0,0,0, date(m), date(d), date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m), date(d)-7, date(Y))); print(today: $today br\n); print(last_week: $last_week br\n); print(diff in days: . dateDiffInDays($last_week, $today) . br\n); ? On Thursday, February 7, 2002, at 04:21 PM, Sander Peters wrote: Hello, This is my problem: $today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! How can I let php count in real days/month/years in stead of numbers? Maybe this is a silly question, but anyone who has the answer would help me very much! Thanks in advance! -- Met vriendelijke groet / With Greetings, Sander Peters site: http://www.visionnet.nl/ email: mailto:[EMAIL PROTECTED] webmail: mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP timesheets?
Hi, Are there any PHP coded timesheet type web application? And if so, what would we be suggested. Thanks, Christian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] counting with dates (help!)
RE: [PHP] counting with dates (help!)Hi Sander, (and Chris, and Martin) $today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! No, that's the difference in time represented by the number of seconds. You still need to work with it a little more. 8876 / 60 = number of hours /* 60 = number of seconds in an hour */ 8876 / 60 / 24 = number of days. /* 24 = number of hours in a day */ =I'm sorry but neither the above, nor the suggestion of Julian dates was correct (in all cases). The two numbers ($today and $last_week) generated in the PHP code above are in CCYYMMDD format (as used by MySQL to store dates, BTW). =So you are correct (Sander): 20020107 less 20011231 equals 8876 =but this number is meaningless. If the formulae proposed above are applied, the answer is not 7 days. =Similarly (Julian dates = CCYYDDD format) 2002007 less 2001365 equals 642 =However let's jump forward in time, to tomorrow (hey what's 45 minutes between friends?): 20020108 less 20020101 equals 0007 =and: 2002008 less 2002001 equals 007 =woohoo! How come they 'work' tomorrow but not today? Because (using the first format) whilst the last and second to last digits represent days (hence it 'works' tomorrow), the preceding pair of digits represent months, and the procession of days into months is not a decimal progression. (smack your forehead into the wall now...but don't do it too often, because no matter how good it feels, it'll feel a whole lot better when you stop!) =this is also the reason that using a Julian date format won't work - they look like decimal numbers (look like a duck), you can perform arithmetic on them (walk like a duck), but if your calculation spans a year-break you will discover that they are not really decimal numbers (and they bark like a dog). =The three main date formats are: 1 CCYYMMDD (as mentioned above) because it is the way MySQL does things. You can't use this for 'real arithmetic' as we've just discussed, but you can do comparisons, eg is 'today' 'yesterday' (when I was young...) 2 dd-mm-ccyy (or variant) which is the way humans like to read their dates. This is for appearances, and once again not for arithmetic/logic. PS never, never, never (did I say never) use dd/mm/yy or mm/dd/yy because of the ambiguities it causes - particularly between Americans and the rest of the world (and date-guessing functions - see your manual) 3 UNIX Epoch timestamp which is a count of the number of seconds since midnight 1 Jan 1970 (GMT). This is an absolutely ugly way to look at dates (and times), but it is really easy to use for arithmetic and after a while you don't think it at all odd that without any effort you can recall that there are 86,400 seconds in one day. =Now that piece of trivia, a pocket protector, and band-aid keeping your spectacle frames together will make you a babe-magnet in every bar (well those that serve Heineken anyway). =Putting aside several HOURS to study the two manuals to get your head around date functions is time well spent (yes I know, it takes me a little longer...) - particularly the sheer number of SQL date functions (the power of which is all too frequently overlooked). Regarding the PHP functions, I made a page list, and as I made notes about each one, I annotated it with a 'purpose' so that I could keep them straight in my mind. Well, enough of me and there reasons why girls in bars don't talk to me... =Let me do my usual frustrating thing and ask you what you are REALLY wanting to do. You don't actually want to subtract those two numbers/PHP variables, because you already know the answer in their very creation... =Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Re: Problem with PHP security on windows
Hi, I wrote this already one time and received some parameters for my apache. but I think document root etc are all correct in apache. I set safemode etc also on in php.ini but it seems to ignore those settings completly. here my problem: I have a big security hole in my php and I cannot get out why: Operating system: Windows XP PHP version: 4.1.1 Bug description: Script accesses harddrive. what did I do wrong? I installed Apache 1.3.20 with PHP and now I saw, a php script can show my complete harddrive remotly. I don't know if it is a bug in php, I think not, I think I configured something wrong but I have ABSOLUTLY no idea what and I didn't find help anywhere. maybe you can tell me what this could be. thanks a lot P.S.: how can I configure that scripts only access things in the directory they where executed or in their subdirs? chris __ Darf es ein bisschen mehr sein? Mehr Speicher, mehr Mail, mehr Erlebnis, mehr Prämie, mehr WEB.DE. Der WEB.DE Club - http://club.web.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How to run a PHP script on the UNIX command line
Hello all, I would like to have some PHP scripts to do DB maintanance. There are not intended for web CGI. How can I run a script on my UNIX machine command line? I want to include it on my crontab. I know how to make it happen with Perl which is quite easy but I do not know how to do it in PHP. Can anyone help me with that? Thank you, Carlos Fernando Scheidecker Antunes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to run a PHP script on the UNIX command line
Read this --- http://www.php.net/manual/en/commandline.php On Mon, 7 Jan 2002, Carlos Fernando Scheidecker Antunes wrote: Hello all, I would like to have some PHP scripts to do DB maintanance. There are not intended for web CGI. How can I run a script on my UNIX machine command line? I want to include it on my crontab. I know how to make it happen with Perl which is quite easy but I do not know how to do it in PHP. Can anyone help me with that? Thank you, Carlos Fernando Scheidecker Antunes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Thank you, Steve Maroney -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] counting with dates (help!)
Soon after I sent my email, I realised that it was wrong - oops :( As Steve Cayford said, use timestamps and then convert it back into whatever format you want I think the best way to work with dates is not to :) find someone else's code that works and use that - dates are awful!! ? $today = mktime(0, 0, 0, date(m), date(d), date(Y)); $last_week = mktime(0, 0, 0, date(m), date(d)-7, date(Y)); $diff = $today - $last_week; echo $diff / 86400; // (60 sec/min * 60 min/hr * 24 hr/day) ? Your comment about not using dd/mm/yy or mm/dd/yy I totally agree with - I use dd-Mon- format for my dates for that reason... Martin -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 08, 2002 10:42 AM To: Boget, Chris; 'Sander Peters'; [EMAIL PROTECTED]; Martin Towell Subject: Re: [PHP] counting with dates (help!) RE: [PHP] counting with dates (help!)Hi Sander, (and Chris, and Martin) $today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! No, that's the difference in time represented by the number of seconds. You still need to work with it a little more. 8876 / 60 = number of hours /* 60 = number of seconds in an hour */ 8876 / 60 / 24 = number of days. /* 24 = number of hours in a day */ =I'm sorry but neither the above, nor the suggestion of Julian dates was correct (in all cases). The two numbers ($today and $last_week) generated in the PHP code above are in CCYYMMDD format (as used by MySQL to store dates, BTW). =So you are correct (Sander): 20020107 less 20011231 equals 8876 =but this number is meaningless. If the formulae proposed above are applied, the answer is not 7 days. =Similarly (Julian dates = CCYYDDD format) 2002007 less 2001365 equals 642 =However let's jump forward in time, to tomorrow (hey what's 45 minutes between friends?): 20020108 less 20020101 equals 0007 =and: 2002008 less 2002001 equals 007 =woohoo! How come they 'work' tomorrow but not today? Because (using the first format) whilst the last and second to last digits represent days (hence it 'works' tomorrow), the preceding pair of digits represent months, and the procession of days into months is not a decimal progression. (smack your forehead into the wall now...but don't do it too often, because no matter how good it feels, it'll feel a whole lot better when you stop!) =this is also the reason that using a Julian date format won't work - they look like decimal numbers (look like a duck), you can perform arithmetic on them (walk like a duck), but if your calculation spans a year-break you will discover that they are not really decimal numbers (and they bark like a dog). =The three main date formats are: 1 CCYYMMDD (as mentioned above) because it is the way MySQL does things. You can't use this for 'real arithmetic' as we've just discussed, but you can do comparisons, eg is 'today' 'yesterday' (when I was young...) 2 dd-mm-ccyy (or variant) which is the way humans like to read their dates. This is for appearances, and once again not for arithmetic/logic. PS never, never, never (did I say never) use dd/mm/yy or mm/dd/yy because of the ambiguities it causes - particularly between Americans and the rest of the world (and date-guessing functions - see your manual) 3 UNIX Epoch timestamp which is a count of the number of seconds since midnight 1 Jan 1970 (GMT). This is an absolutely ugly way to look at dates (and times), but it is really easy to use for arithmetic and after a while you don't think it at all odd that without any effort you can recall that there are 86,400 seconds in one day. =Now that piece of trivia, a pocket protector, and band-aid keeping your spectacle frames together will make you a babe-magnet in every bar (well those that serve Heineken anyway). =Putting aside several HOURS to study the two manuals to get your head around date functions is time well spent (yes I know, it takes me a little longer...) - particularly the sheer number of SQL date functions (the power of which is all too frequently overlooked). Regarding the PHP functions, I made a page list, and as I made notes about each one, I annotated it with a 'purpose' so that I could keep them straight in my mind. Well, enough of me and there reasons why girls in bars don't talk to me... =Let me do my usual frustrating thing and ask you what you are REALLY wanting to do. You don't actually want to subtract those two numbers/PHP variables, because you already know the answer in their very creation... =Regards, =dn
[PHP] Arrays
Hi, Can anybody suggest a good reading on how to work with arrays with multiple keys? thanks. = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP timesheets?
On Mon, 7 Jan 2002, Christian Calloway wrote: Are there any PHP coded timesheet type web application? And if so, what would we be suggested. Thanks, Take a look at these: http://freshmeat.net/search/?site=Freshmeatq=timesheet+phpsection=projects ~Chris /\ \ / September 11, 2001 X We Are All New Yorkers / \ rm -rf /bin/laden -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php4 startup error
hi, I have installed php-4.0.0-Win32(into c:\php) and apache_1_3_9_win32(into C:\Program Files\Apache Group\Apache\ ) on my window98,the apache alone can be run normally,however when I run a test.php,windows told me the general protection error on PHP4TS.DLL and let me see the error log ,this is what I found in it: [Tue Jan 08 09:45:55 2002] [error] [client 127.0.0.1] Premature end of script headers: c:/php/php.exe following are some configurtation in php.ini: include_path= ; UNIX: "/path1:/path2" Windows: "\path1;\path2"doc_root= C:\Program Files\Apache Group\Apache\htdocs; the root of the php pages, used only if nonemptyuser_dir=; the directory under which php opens the script using /~username, used only if nonempty;upload_tmp_dir= ; temporary directory for HTTP uploaded files (will use system default if not specified)upload_max_filesize = 2097152 ; 2 Meg default limit on file uploadsextension_dir=c:\php; directory in which the loadable extensions (modules) reside following are some configurtation in httpd.conf: ScriptAlias /php "c:\php\php.exe" Action application/x-httpd-php "/php" AddType application/x-httpd-php .php .php3 Can anyone give me a hand on this ? Thank you in advance. Leon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ask cookie in win2000
halo... i want to know, why cookie not working in win2000. please help me. Mpu Strees IncrediMail - Email has finally evolved - Click Here
RE: [PHP] ask cookie in win2000
Please dont send html emails to the list. Switch to plain text email. You also should send your code to the list so we can see what you are doing wrong. What is the error you are getting? You haven't provided enough info in order to answer the question. This question has been asked many times; you should search the archives to find an answer. Matt Friedman -Original Message- From: gendeng [mailto:[EMAIL PROTECTED]] Sent: Monday January 7, 2002 8:17 PM To: [EMAIL PROTECTED] Subject: [PHP] ask cookie in win2000 halo... i want to know, why cookie not working in win2000. please help me. Mpu Strees IncrediMail - Email has finally evolved - Click Here -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How Query Works?
My situation is to access a remote MySQL server, and of course I do care about traffic. Suppose In a script there's a query: $result = mysql_query (select * from employ where age45) or die (Invalid query); I am just wondering that if MySQL server would return all the query result in total, so that the following fetches won't go to server again. This is what I expect. However if it does in the other way, I mean MySQL would hold the result and the following fetches had to go server to obtain dataOh my GOD it will definately cause trouble- some traffic Is it a MySQL question, or a PHP question? I'm not sure. I am thinking that PHP's API would have something to do with Query behaviour. Thanks for all reply in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problems with uploading even small files
I'm trying to upload files using php to a server on the lan. Apache/1.3.22, PHP 4.0.6, MySQL 3.23.40 My problem is that file uploads are slow, a 50KB file takes around 5 minutes. Thats kilobytes. in 5 minutes. Larger files just timeout. I've set the max file sizes in apache and php configs, although my files are nowhere near the maximum yet. does anyone know what i'm doing wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Slow upload with small files
I'm trying to upload files using php to a server on the lan. Apache/1.3.22, PHP 4.0.6, MySQL 3.23.40 My problem is that file uploads are slow, a 50KB file takes around 5 minutes. Thats kilobytes. in 5 minutes. Larger files just timeout. I've set the max file sizes in apache and php configs, although my files are nowhere near the maximum yet. does anyone know what i'm doing wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ooh forms or better
Hi, I'm interested in finding a good solution for creating forms programmatically; something like ooh forms. I haven't been able to find decent docs on ooh forms but I'm under the impression that it's very good. Does anyone know of examples of ooh forms and where the docs might be found? Examples would be ideal. I also found phpOpenForms which seems very good; anyone have experience with it? Many thanks, Matt Friedman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sessions
I am having problems getting the sessions to work. when i input the following code: session_start(); session_register(sess_id); i get nothing registered. I have checked the sess_***etc... files in /tmp and they say: !sess_id| Does anybody have any ideas why this is? Thanks in advance Ryan Kelley -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
php-general Digest 8 Jan 2002 04:14:57 -0000 Issue 1098
If I comment out $stmnt = 'SELECT COUNT(*) FROM PHOTOS'; All run fine. Also, this piece of code use to work. Any suggestions? Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- On Monday 07 January 2002 01:59, Richard S. Crawford wrote: I've used a combination of addslashes() and stripslashes() along with htmlspecialchars() to perform just that sort of thing, though I used MySQL instead of PostreSQL. I've got it sorted so that when the user enters the HTML data in the form, it is retrieved and stripslashes() is used so that I can just use print() to display it. The only problem comes when I want to send this data back again (so that the user can edit it after they view it). Everything's fine unless the user has a quote () in the text because it messes up the HTML tag. For example, consider the string $body = I am saying \Hello\; input type=hidden name=body value=?=$body is interpreted by the browser as input type=hidden name=body value=I am saying Hello And so we have a problem. What can I do about that? --jaa ---End Message--- ---BeginMessage--- Is there a PHP SAR data graphing toolkit out there? I've yet to see one. Any info on this is welcome. -- Austin Gonyou Systems Architect, CCNA Coremetrics, Inc. Phone: 512-698-7250 email: [EMAIL PROTECTED] It is the part of a good shepherd to shear his flock, not to skin it. Latin Proverb signature.asc Description: This is a digitally signed message part ---End Message--- ---BeginMessage--- Hello, This is my problem: $today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! How can I let php count in real days/month/years in stead of numbers? Maybe this is a silly question, but anyone who has the answer would help me very much! Thanks in advance! -- Met vriendelijke groet / With Greetings, Sander Peters site: http://www.visionnet.nl/ email: mailto:[EMAIL PROTECTED] webmail: mailto:[EMAIL PROTECTED] ---End Message--- ---BeginMessage--- You'll need to use Julian format (I think that the name for it) which is DDD - is the year and DDD is the number of days into the year. I'm unsure as to how to do this in PHP so you'll need to do some searching - unless someone knows... Would be nice to know exactly how to do it in case it crops up for me in the future sometime... Martin -Original Message- From: Sander Peters [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 9:22 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] counting with dates (help!) Hello, This is my problem: $today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! How can I let php count in real days/month/years in stead of numbers? Maybe this is a silly question, but anyone who has the answer would help me very much! Thanks in advance! -- Met vriendelijke groet / With Greetings, Sander Peters site: http://www.visionnet.nl/ email: mailto:[EMAIL PROTECTED] webmail: mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- $today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! No, that's the difference in time represented by the number of seconds. You still need to work with it a little more. 8876 / 60 = number of hours /* 60 = number of seconds in an hour */ 8876 / 60 / 24 = number of days. /* 24 = number of hours in a day */ Chris ---End Message--- ---BeginMessage--- $today=mktime(0,0,0,date(m),date(d),date(Y)); $last_week=mktime(0,0,0,date(m,mktime(0,0,0,date(m),date(d)-7,date(Y ))),date(d,mktime(0,0,0,date(m),date(d)-7,date(Y))),date(Y,mktime( 0,0,0,date(m),date(d)-7,date(Y; echo date(d,$today)-date(d,$last_week); -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com Sander Peters [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, This is my problem: $today = date(Ymd, mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date(Ymd, mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! How can I let php count in real days/month/ye
[PHP] Question About W32 API
Let's say I'm doing the following: w32api_deftype ( 'STRUCT', 'long', 'someNumber', 'string', 'someText', 'int', 'someInt' ); w32api_register_function('library', 'test', 'int'); $test = w32api_init_dtype('WHATEVER'); test($test); The function test should place data into STRUCT $test. print_r($test) gives me 'Resource ID.' Will I have to use some other library function to tell me what's in $test or can I use php to do it? Sincerely, João P. Bragança -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php 4.1.1 and imap/ssl
I've installed php 4.1.1. with the following configure options: ./configure --prefix=/usr/local/versioned/php-4.1.1 --with-apache=../apache_1.3.19 --with-openssl --with-imap --with-imap-ssl=/usr/local/openssl --with-kerberos --with-gettext --with-xml --with-pgsql=/usr/local/postgresql The following script fails. ? $mbox = imap_open ({localhost:993/imap/ssl/novalidate-cert}INBOX, username, password); print $mbox . \n; ? The symptom is that an imapd process is started, but then nothing ever happens. A corresponding non-ssl script works fine. My imap/ssl installation works fine - I use it all the time. I'm using the following UW imap RPM's: imap-devel-2000c-10 imap-2000-9 I can telnet to port 993 o.k. Any ideas? Or can anyone at least verify that imap-ssl works in php 4.1.1.? -- -Ron- https://www.yellowbank.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How to add a carriage return in the end when using implode?
$subdata has been changed before then $data[$index]=implode(",", $subdata);--what shouldI change here? rewrite the file like this : $data[$index]=$data[$index];$fp=fopen($datafile,"w+"); $a=0; do{ fputs($fp,$data[$a]);--or here?. $a++; }while($acount($data));fclose($fp); however if one line of the $datab has been implode with $subdata ,there will not be a 'return' in the final text file , this line just is joined with the next line ,what should I do here to add the $data as a single line? Thanks Leon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How to define subroutine
Hi I am new to PHP and want to do object oriented programming in PHP. I want to write a subroutine and call that subroutine. I tried the following code but it gives me an error. Regards Sanjay ? $ref = testfun(); print Ref is $ref; sub testfun() { return HI; } ?
[PHP] Re: How to define subroutine
In article 002901c1980e$4ba456f0$0200a8c0@piii, [EMAIL PROTECTED] (Sanjay) wrote: I am new to PHP and want to do object oriented programming in PHP. I want to write a subroutine and call that subroutine. http://download.php.net/manual/en/functions.php http://download.php.net/manual/en/language.oop.php -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Question about Php/Mysql. Unsure if it's enabled.
Hello, my subject is a bit confusing, I bet. I need a bit more speace to explain this situation. Ok, basically I only configured php with apxs However, I noticed the mysql was supported (It said so on php info page) How is that possible? I never tested a mysql script yet on this server (linux) yet, I just had to ask if this is normal and how this is possible. Or if I am misinterpreting the output. The file actually prints: mysql MySQL Support enabled Active Persistent Links 0 Active Links0 Client API version 3.23.32 MYSQL_INCLUDE MYSQL_LFLAGS MYSQL_LIBS Does this mean it really supports it? or am I just not understanding something? It even says zend server is in use, yet I never installed zend. The version of php is 4.0.5 on apache webserver on linux How is this possible? Just curious Thanks
Re: [PHP] PHP and OpenLDAP
On Thu, Jan 03, 2002 at 10:42:30AM -0700, Quinn Perkins wrote: I have installed OpenLDAP 2.x on an OS X Server 10.1.2 box. Everything seems to be fine. I have written a simple PHP front end to modify LDAP values. I can modify values in the core.schema without any problem, but if I try to modify anything in cosine.schema or inetorgperson.schema, I get an error (Warning: LDAP: modify operation could not be completed. in ldapeditor.b2.php on line 247) This ONLY happens when I try and modify a value in a schema other than core.schema. The project I am working on will require use of cosine and inetorgperson schemas. This is a test page to make sure I can read/write values. I see you don't modify the object class, does the current object class allow the new attributes. If say the current class is person, you will get an error. You could also try to look at your slapd log. You could also get a lot of useful info from slapd by starting it in debug mode (-d7) or some other number than 7 perhaps. Stig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]