[PHP] scan a text string to pick up certain words
Hi All, I guess regex can do the trick but I don't know much about regex :(( Here is what I want: Say a text string in which there're several words enclosed by { and }, for example {hellow}. I need to pick up each of the words like this and print them or do some processing one by one. Can any one please show me an example how to do this in PHP. Thanks in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] scan a text string to pick up certain words
It works the way as supposed :) Thanks! On Wed, 11 Aug 2004 18:07:57 -0400, Alex Shi [EMAIL PROTECTED] wrote: Hi All, I guess regex can do the trick but I don't know much about regex :(( Here is what I want: Say a text string in which there're several words enclosed by { and }, for example {hellow}. I need to pick up each of the words like this and print them or do some processing one by one. Can any one please show me an example how to do this in PHP. Thanks in advance! preg_match_all('/{([^}]*)}/', $text, $matches); print_r($matches[1]); -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/MySQL based webmail?
Hi All, Can any one recommend a strong/stable PHP/MySQL based web mail system? It must support large mail transfer, some times may be more than 10 MB for a single message. Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php inventory control software
Hello, Any one can suggest me a php template (or modules) of a web-based inventory control software including a web-store. Thanks in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Very weird issue....
Hi all, Please take a look at following very simple script; #!/usr/bin/php -q ? echo Hello, world!\n; if (!$tty) { $tty = fopen('php://stdin', 'r'); } print Hello: ; $ch = fgets($tty, 1024); print $ch\n; ? I tested it on many servers. Here is how it running (you can figure out yourself): Firstly it displays Hello, world!, then displays Hello: at second line and waits for user input; You input a yes and it displays the yes; then end. So, on the screen you will see: Hello, world! Hello: yes yes However, on one of the servers, it doesn't run like above, but in a reversed way: Firstly, it displays nothing but waits for your input; you input a yes, then it displays the yes, then Hello, world!, then Hello: yes. So, on the screen it looks like this: yes Hello, world! Hello: yes Weird? To me IT IS! I really don't understand why all the echos/prints did not function until the script got data from tty, even they are before fgets.. I found this issue during an unsuccessfull pear installation. The pear installer stopped and waited for my input without any prompt - there is prompt message but not displayed! Can anyone let me know how this can happen? Thanks in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using PHP script to simulate a login
Hi, We have a web interface to do following: 1. login 2. check phone number (maybe thousands of) 3. logout. I am just wondering is it possible to use a php script to simulate the three steps? I understand that after login the web server will send a cookie to browser, so in that way a session can be kept at the visiter's end in correspondance to the web server. However I have no idea is it possible for a script to simulate browser's session handling? Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using PHP script to simulate a login
On Fri, 16 Jul 2004 19:23:30 -0400, Alex Shi [EMAIL PROTECTED] wrote: Hi, We have a web interface to do following: 1. login 2. check phone number (maybe thousands of) 3. logout. I am just wondering is it possible to use a php script to simulate the three steps? I understand that after login the web server will send a cookie to browser, so in that way a session can be kept at the visiter's end in correspondance to the web server. However I have no idea is it possible for a script to simulate browser's session handling? Yep. http://pear.php.net/package/HTTP_Client Thanks! I downloaded the package and all its required dependencies. But I'm still wondering that is it required to install pear to run all these packages? We have PHP 4.3.0 and PHP 4.3.2. Thanks in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Got error Inappropriate ioctl for device when trying ssl connection....
Hello, I got an error message when trying following script: ? //.. if (!$handle = fsockopen (ssl://my.com, 443, $errno, $errstr, $timeout = 30)) { print $errno: $errstr\n; return -1; /* connection failed */ } /* The my.com site WAS installed with a SSL certificate, and it works perfect if access from a browser with 'https://' prefix. */ //.. ? The errstr said 25: Inappropriate ioctl for device. I'm using PHP 4.3.0. Its phpinfo indicates that OpenSSL is enabled. However, I also tested the script on a server with php 4.3.2 and it works perfect. Both PHPs are OpenSSL enabled but why behaved differently? Thanks in advance! Alex Shi -- Regards, Alex Shi Stonix.com Inc. Phone: 416-422-4466 Cell: 416-827-3685 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Slideshow using PHP
Search google for javascript slideshow script. Javascript slideshow need an array of image names, this can be done by php and mysql when dynamically generate the page. Alex Shi I would like to have images displayed automatically using PHP with a Database and/or an array of images. Is there any sample code available for doing that? Can that be done with Flash and PHP? Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php unlink a file - is it possible?
Hi, How can have a php script unlink/delete a file uploaded via FTP? Usually a ftp-uploaded file belongs to the ftp user, and a php script is running by apache/nobody. Seems like there shouldn't be any way to do this...OK, my situation is that I want a php script to this: it can move bulk uploaded (ftp) file to certain directories and then remove the original files, something just like a move. If anyone knows on how to move or delete a file, please give me a hand. Thanks in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header ('Content-type...') does not work properly if session_start initiated...
Hello, I have a strange problem with a download script. Here is the situation: On my development server, the php is 4.0.6 while on the application server it is 4.3.2. I created a very simple code for opening pdf in browser. the main part of it is like following: ? session_start (); ... $docPath = '/path/to/file_name.pdf'; $pdftmp_name = 'tmp_name.pdf'; header ('Cache-Control: no-store, no-cache, must-revalidate'); header ('Content-Type: application/pdf'); header ('Content-disposition: inline; filename=' . $pdftmp_name); header ('Content-length: ' . filesize ($docPath)); readfile ($docPath); ? This code is working perfect on development server. However on the application server, it will first ask for confirm downloading then report error saying that cannot download. I checked the code line by line and found that if remove the first line session_start () then it will work in the correct way. However session is required for this script. I don't understand why it works OK on the development server but not for application server. Thanks in advance for all help! Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header ('Content-type...') does not work properly if session_start initiated...
Curt Zirzow wrote: hmm.. i think i just rememberd that it might had to do with making sure that session.cache_limiter being set as 'nocache'. Search the archives, the answer is there i believe. Curt You are close, it was session_cache_limiter('private_no_expire'); So, this function should be called before session_start ()? I will try... thanks! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header ('Content-type...') does not work properly if session_start initiated...
Curt Zirzow wrote: hmm.. i think i just rememberd that it might had to do with making sure that session.cache_limiter being set as 'nocache'. Search the archives, the answer is there i believe. Curt You are close, it was session_cache_limiter('private_no_expire'); You are right, it is working perfect now! Thanks a bunch! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] convert Excell to MySQL table
Hello, Does any one out there happend to know a php solution to directly (without CSV) transfer an Excell spreadsheet into MySQL table? Thanks in advance! Alex -- == Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com == TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] convert Excell to MySQL table
Yes I believe this is an excellent solution for MS planforms... But how about UNIX/Linux/FreeBSD based applications? Alex :[EMAIL PROTECTED] If it doesn't have to be automatic, I believe you can open an ODBC connection to the MySQL database and use the export functionality of Excel. I may be wrong since it's been a while since I've done anything with Excel, but it's worth a try. On Tue, 2003-06-17 at 11:09, Alex Shi wrote: Hello, Does any one out there happend to know a php solution to directly (without CSV) transfer an Excell spreadsheet into MySQL table? Thanks in advance! Alex -- == Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com == TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 == -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to set a timeout limit for a call of a connection?
Hi, I have a script in which there is a call to open a remote file: fopen (http://www.somewhere.com/file.php?foo=bar;, r); Sometimes if www.somewhere.com is down, it will stuck at the function for very long a time. I hope to setup a timeout limit for this function (just this), so that it won't stay very long to wait for a result, but just quit if the call take a time longer than timeout limit, and then go on for next steps. Thanks in advance! Alex Shi -- == Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com == TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to set a timeout limit for a call of a connection?
I have a script in which there is a call to open a remote file: fopen (http://www.somewhere.com/file.php?foo=bar;, r); Sometimes if www.somewhere.com is down, it will stuck at the function for very long a time. I hope to setup a timeout limit for this function (just this), so that it won't stay very long to wait for a result, but just quit if the call take a time longer than timeout limit, and then go on for next steps. You can't control the timeout with fopen(). Try looking at fsockopen(). You can set a timeout for that. I checked the manual. From the example, it is apparently that timeout only works for the handle setup by fsockopen, but not for fsockopen itself. Alex ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to set a timeout limit for a call of a connection?
I have a script in which there is a call to open a remote file: fopen (http://www.somewhere.com/file.php?foo=bar;, r); Sometimes if www.somewhere.com is down, it will stuck at the function for very long a time. I hope to setup a timeout limit for this function (just this), so that it won't stay very long to wait for a result, but just quit if the call take a time longer than timeout limit, and then go on for next steps. You can't control the timeout with fopen(). Try looking at fsockopen(). You can set a timeout for that. Oh, yes, you are right! there is a parameter for timeout! Thanks a lot! alex ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Post method
Hi, Any one know in a php script, if it is possible to simulate a post method? I mean I want to header() to an url but don't like to embed the parameters into that url. Thanks in advance! Alex Shi -- == Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com == TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post method
Curl will let you perform post operationgs, take a look at http://www.php.net/curl. Note you will need to have libcurl installed and PHP will have to be compiled with curl support. There are also probably classes that allow you to do post requests, take a look at the script repositories, hotscripts.com and you might try phpclasses.org as well. ^^ Thanks! I found a great class in phpclasses.org. Alex Jason On Fri, 2003-02-28 at 14:09, Alex Shi wrote: Hi, Any one know in a php script, if it is possible to simulate a post method? I mean I want to header() to an url but don't like to embed the parameters into that url. Thanks in advance! Alex Shi -- == Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com == TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] again, dynamic image of text string
Hi, I am using following script to generate a dynamic picture from a text string. It works fine for both my developing server and the application server (a virtual host). Both server are Linux RH. ? $im = ImageCreate (110, 16); $white = ImageColorAllocate ($im, 255, 255, 255); $black = ImageColorAllocate ($im, 0, 0, 0); $blue = ImageColorAllocate ($im, 0, 0, 255); // ImageFtText ($im, 10, 0, 0, 1, $black, /path/verdana.ttf, hello); $font = 2; ImageString ($im, $font, 0, 1, hello, $black); Header (Content-type: image/png); ImagePNG($im); ImageDestroy($im); ? The ImageString utilizes a php built-in font to generate image. However if replace this function with ImageFtText() (see the commented line), it will get error on both servers. On my developing server the error is no ttf support. I checked phpinfo and in the GD section it says it does not have ttf support, so I would assume a recompiling with ttf support will resolve the issue. On the application server since the server API is CGI but not Apache, all type of errors will be shown as 500 internal error. I checked the phpinfo in its GD section ttf support is enabled. I tried several different types of fonts but all get same error. I found those font files from windows and uploaded them to the server. I don't if the Windows fonts could work for Linux. Alex Shi -- == Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com == TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] text to image
Hello, I am thinking to create php script to dynamically convert a text string to image. My questions are: 1. with a given text string, say hello, world, is it possible to dynamically convert it to an image? and what php built-in functions can be utilized? 2. if I want to use true-type verdana font, can I just upload the windows font file to the web server (linux) and use php to load the font? Thanks in advance! Alex Shi -- == Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com == TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text to image
Hi, THanks for your reply. I search the manual and created following script. ? header (Content-type: image/gif); $im = imagecreate (400, 16); $black = imagecolorallocate ($im, 0, 0, 0); $white = imagecolorallocate ($im, 255, 255, 255); imagettftext ($im, 10, 0, 10, 20, $black, verdana.ttf, date('| l | F | d | Y |')); imagegif ($im); imagedestroy ($im); ? I got following error msg when ran it: br bWarning/b: ImageTtfText: No TTF support in this PHP build in b/home/dotkard/www/current_time.php/b on line b6/bbr br bWarning/b: ImageGif: No GIF support in this PHP build in b/home/dotkard/www/current_time.php/b on line b7/bbr I checked the phpinfo but failed to find which variable I should turn on. Alex Alex, Easy to do what you want. Check out the image functions in the php manual. There are some font limitations, specifically dealing with alternate characters, but you'll find out what works and what doesn't soon enough. Hugh - Original Message - From: Alex Shi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 14, 2003 10:16 AM Subject: [PHP] text to image Hello, I am thinking to create php script to dynamically convert a text string to image. My questions are: 1. with a given text string, say hello, world, is it possible to dynamically convert it to an image? and what php built-in functions can be utilized? 2. if I want to use true-type verdana font, can I just upload the windows font file to the web server (linux) and use php to load the font? Thanks in advance! Alex Shi -- == Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com == TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text to image
forgot somethingwhen try following script in another server I got 500 internal server error. ? header (Content-type: image/gif); $im = imagecreate (400, 16); $black = imagecolorallocate ($im, 0, 0, 0); $white = imagecolorallocate ($im, 255, 255, 255); imagettftext ($im, 10, 0, 10, 20, $black, verdana.ttf, date('| l | F | d | Y |')); imagegif ($im); imagedestroy ($im); ? Alex again I got following error msg when ran it: br bWarning/b: ImageTtfText: No TTF support in this PHP build in b/home/dotkard/www/current_time.php/b on line b6/bbr br bWarning/b: ImageGif: No GIF support in this PHP build in b/home/dotkard/www/current_time.php/b on line b7/bbr I checked the phpinfo but failed to find which variable I should turn on. Alex Alex, Easy to do what you want. Check out the image functions in the php manual. There are some font limitations, specifically dealing with alternate characters, but you'll find out what works and what doesn't soon enough. Hugh - Original Message - From: Alex Shi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 14, 2003 10:16 AM Subject: [PHP] text to image Hello, I am thinking to create php script to dynamically convert a text string to image. My questions are: 1. with a given text string, say hello, world, is it possible to dynamically convert it to an image? and what php built-in functions can be utilized? 2. if I want to use true-type verdana font, can I just upload the windows font file to the web server (linux) and use php to load the font? Thanks in advance! Alex Shi -- == Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com == TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.1.2 session problem
Hi, I am sure at least I was not a newbie in the topic I am talking about. But this problem made crazy. I was hoping for a bit of help please. The problem is: you have to make double correct logins to get into the session protected area. Here is the situation: 1. server configuration: PHP 4.1.2, Rapidsite/Apa/1.3.26 (Unix), FrontPage/5.0.2.2510, mod_ssl/2.8.10, OpenSSL/0.9.6e 2. the the login script: ? session_start (); session_register ('_SS_AUTHEN'); if ($_SS_AUTHEN == 'passed') { header (Location: protected/index.php); } if ($trying = $HTTP_POST_VARS['trying']) { // for the first time display the page don't check $userID = $HTTP_POST_VARS['userID']; $userPwd = $HTTP_POST_VARS['userPwd']; if (check_user_ok($userID, $userPwd)) { $_SS_AUTHEN = 'passed'; header (Location: protected/index.php); } else { $error_msg = 'Error: username/password not matched!'; } } else { $error_msg = ''; // for first time display the page, no error_msg } // require login page require 'templates/timereport_login.inc'; // in the login page, $error_msg will be displayed ? 3. in the session protected area, each php file must be added with following code at very begining: ? // check session session_start (); if ($_SS_AUTHEN != 'passed') { $reDirect_to = '../login.php'; } else { $ReDirect_to = 'thescript.php'; } header (Location: $ReDirect_to); ? Again, with the script above, the problem is: you have to make double correct logins then you can get into the protected location. The similar scripts have been used in many different projects but only this one get so weird result. So I would prefer to say session behaviour on this server is abnormalHowever, I do hope I myself made something wrong thus the bug is possible to be fixed... Thanks for any help in advance! Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Referrer
How can know the referrer of a script? Let's say script B is linked from script/page A. Is it possible to obtain A's name in script B? Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help for a where clause
Hi, I need a where clause in following situation: Say I want to query two tables: A and B. In table A there is field Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want to do a query, in which the where clause must do these things: if A.Afn=1, then check value of B.Bfn1; if A.Afn=2, then check value of B.Bfn2; if A.Afn=3, then check value of B.Bfn3. So how can I create such a where clause to do this? Thanks in advance! Alex Shi -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to drop a element from an array
Is there a good way do drop an element from an array? Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to drop a element from an array
Yes I have read about the array functions in the manul. But I don't think they are what I need. What I want is to drop what ever an element from an array, not just from top or bottom. I can create a function to do this. But I need a better solution, that is to say not to cost too much memery. Alex Shi Timothy J Hitchens [EMAIL PROTECTED] 写入消息新闻 :002e01c26d89$780c14c0$[EMAIL PROTECTED] Hint... look at array_push etc (like a stack) Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 8:35 AM To: [EMAIL PROTECTED] Subject: [PHP] How to drop a element from an array Is there a good way do drop an element from an array? Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to drop a element from an array
Thanks! Alex Shi Timothy J Hitchens [EMAIL PROTECTED] 写入消息新闻 :002f01c26d8a$77332470$[EMAIL PROTECTED] unset $some_variable[4]; then you would need to resort... etc (if needed) Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 8:43 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to drop a element from an array Yes I have read about the array functions in the manul. But I don't think they are what I need. What I want is to drop what ever an element from an array, not just from top or bottom. I can create a function to do this. But I need a better solution, that is to say not to cost too much memery. Alex Shi Timothy J Hitchens [EMAIL PROTECTED] 写入消息新闻 :002e01c26d89$780c14c0$[EMAIL PROTECTED] Hint... look at array_push etc (like a stack) Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 8:35 AM To: [EMAIL PROTECTED] Subject: [PHP] How to drop a element from an array Is there a good way do drop an element from an array? Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help for a where clause
Thanks! This is what I need! Alex Shi Sascha Cunz [EMAIL PROTECTED] 写入消息新闻 :[EMAIL PROTECTED] A solution on that depends strongly on how much values A.Afn would take. For 3, it's still okay. But i wouldn't do more. Against what shall the B.Bfn* be checked? What Data do you want to be returned from the query? try: SELECT ### FROM A, B WHERE ((A.Afn=1) AND (B.Bfn1 = ...)) OR ((A.Afn=2) AND (B.Bfn2 = ...)) OR ((A.Afn=3) AND (B.Bfn3 = ...)) where you should replace ### with things you want to select and ... with the things you want to check. On more than 3 different values for A.Afn, you should use a more normalized version of B. i.e.: B contains only one Bfn field and a Reference to A.Afn. - SELECT ### FROM A, B WHERE B.AfnRef = A.Afn AND B.Bfn = ... Sascha Am Montag, 7. Oktober 2002 00:33 schrieb Alex Shi: Hi, I need a where clause in following situation: Say I want to query two tables: A and B. In table A there is field Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want to do a query, in which the where clause must do these things: if A.Afn=1, then check value of B.Bfn1; if A.Afn=2, then check value of B.Bfn2; if A.Afn=3, then check value of B.Bfn3. So how can I create such a where clause to do this? Thanks in advance! Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Server API
Hi, My hosting provider still using CGI as Server API. I think this is way too much dropped behind. On my own development server I use Apache as Server API. However, maybe this could be a kind of consideration for the situation that multi-sites hosted on one server? I am thinking I'd better learn something before I ask my hosting provier. Thanks! Alex Shi -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.2.2 vs PHP 4.0.6
THanks! John W. Holmes [EMAIL PROTECTED] wrote in message 000f01c269a4$a7329be0$7c02a8c0@coconut">news:000f01c269a4$a7329be0$7c02a8c0@coconut... I didn't realized that PHP had been going so fast that it was creating problems for compatiblility. Here is my situation: PHP on my development server is 4.0.6 while on the application server it is PHP 4.2.2. I bet you all know that there's a huge basic differences between the two but I don't know them! In PHP 4.2.2, variables passed by either GET or POST method can not be accessed straitforwardly by their name, you have to fetch them from $HTTP_POST_VARS or $HTTP_GET_VARS. To my understanding, directly using submitted variables by their name is one of the basic great PHP features, and I always use vars in this way. However, you can imagine that, recently due to the PHP upgrading I got bunch of problems when deploying. What I want to know are: 1. why PHP changed the way to access submitted vars; PHP wasn't changed, it just changed the default of one configuration in php.ini. Set your register_globals back to ON and things are just as they were in the past. It was changed to stop poorly written code from having as many security issues. If you use a variable $var, you have no idea if it came from the user, session, cookie, or from the script. You have to remember it yourself. So, you may assume your script made $var, but it really came from the URL. Using $_GET['var'] lets you know for sure that that value came from the url. With register_globals off, you know $var was created from within your scripts and cannot of came from a user. 2. any good suggestion to avoid this problem, such as that is it possible to configure 4.2.2 to compatible downward. register_globals = On ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP version
Is there any way to report PHP version? -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.2.2 vs PHP 4.0.6
Hi, I didn't realized that PHP had been going so fast that it was creating problems for compatiblility. Here is my situation: PHP on my development server is 4.0.6 while on the application server it is PHP 4.2.2. I bet you all know that there's a huge basic differences between the two but I don't know them! In PHP 4.2.2, variables passed by either GET or POST method can not be accessed straitforwardly by their name, you have to fetch them from $HTTP_POST_VARS or $HTTP_GET_VARS. To my understanding, directly using submitted variables by their name is one of the basic great PHP features, and I always use vars in this way. However, you can imagine that, recently due to the PHP upgrading I got bunch of problems when deploying. What I want to know are: 1. why PHP changed the way to access submitted vars; 2. any good suggestion to avoid this problem, such as that is it possible to configure 4.2.2 to compatible downward. Thanks! Alex Shi BTW: my development server is RH Linux 7.1 so cannot upgrade PHP to 4.2.2. -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] datetime convert
Hi, I'm trying to convert a formated datetime string into a timestamp. The string format is Y-m-d H:i:s. I use strtotime() to convert the datetime string. However, the converted datetime seems lost its time part. Is there any easy solution to make the converting? Thanks in advance! Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What these two things mean: __FILE__ and __LINE__
What these two things mean: __FILE__ and __LINE__ ? I searched manul but find nothing about them... Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What these two things mean: __FILE__ and __LINE__
I read the link, still don't get what are the exact meaning of those two things. What the link refered is a section from PHP manul that I have a copy on my local computer, and to me it doesn't seems like a formal defination of them. From the messages appending to the ariticle I saw one more thing don't understand: __PATH__. Alex Kevin Stone [EMAIL PROTECTED] wrote in message 008801c2590a$28d7ede0$6501a8c0@kevin">news:008801c2590a$28d7ede0$6501a8c0@kevin... http://www.php.net/manual/en/language.constants.php -Kevin - Original Message - From: Alex Shi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 10, 2002 2:31 PM Subject: [PHP] What these two things mean: __FILE__ and __LINE__ What these two things mean: __FILE__ and __LINE__ ? I searched manul but find nothing about them... Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checkbox question
Thanks for your reply! I tested $_SERVER['QUERY_STRING']. Seems like it only return the string for get method but not for post. Any idea? Alex Marek Kilimajer [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... If you cannot use square brackets, get the values yourself from $_SERVER['QUERY_STRING'] Alex Shi wrote: How to ontain data from a group of checkbox using same name? For example, in a form there're 6 checkboxes and all named as Interesting_Area. I know if put a pairs of square brackets at the end of the name then in php all the values of them can be ontained. However, for some reason I cannot use square brackets. Please help me out if anyone know how to do the trick. THanks! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] checkbox question
How to ontain data from a group of checkbox using same name? For example, in a form there're 6 checkboxes and all named as Interesting_Area. I know if put a pairs of square brackets at the end of the name then in php all the values of them can be ontained. However, for some reason I cannot use square brackets. Please help me out if anyone know how to do the trick. THanks! Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Link for downloading?
Hello, How to create a link that when click it will lauch file downloading at client's end. And another question which might be biased from this topic, but still related with the subject of this message: why some downloading link will lauch a ftp client such as NetAnts or Download Accelerator while other link will start a Window's builtin download window? Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Link for downloading?
Thanks...but how to use header() to generate such a download link? Alex [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... First, to create a link thats just a a href=.. that point to the file. ie a href=file.zipfile/a Second, that depend of your windows's default configuration. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Alex Shi [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hello, How to create a link that when click it will lauch file downloading at client's end. And another question which might be biased from this topic, but still related with the subject of this message: why some downloading link will lauch a ftp client such as NetAnts or Download Accelerator while other link will start a Window's builtin download window? Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Link for downloading?
Thanks for your reply! Still have another question: How to use header() to generate download link? Alex - Original Message - From: [EMAIL PROTECTED] To: Alex Shi [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 06, 2002 7:27 AM Subject: Re: [PHP] Link for downloading? Question 1: I think this has to do with how you attribute your file extensions in httpd.conf (Apache thing, not PHP), so check out the docs on apache.org Question 2: I woudl tend to believe it depends what kind of link it is... is it and HTTP downlaod site (which would use the windows save file as dialog, or is it a link to an FTP site, which may use your local FTP software... HTH -Brad Hello, How to create a link that when click it will lauch file downloading at client's end. And another question which might be biased from this topic, but still related with the subject of this message: why some downloading link will lauch a ftp client such as NetAnts or Download Accelerator while other link will start a Window's builtin download window? Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] stupid question
I have almost two years of experience in PHP. so don't think qualified for being a newbie...However still found something don't know when reading other's code :( Here is what I want to know: $Global{'hello'}. What this means? Is it a Variable-variable? Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: stupid question
I checked the code again...it is $Globals{'lala'}... [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I never saw that is it really working? it is supposed to be $_GLOBAL['lala'] too.. but.. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Alex Shi [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] I have almost two years of experience in PHP. so don't think qualified for being a newbie...However still found something don't know when reading other's code :( Here is what I want to know: $Global{'hello'}. What this means? Is it a Variable-variable? Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Template and Replacement
Hello, Currently I am using following method to generate dynamic page content: 1. Create a page template, in which the places where substitution is supposed to take place are marked by a key bracketed with '{' and '}'. For example: {news}, {date}, {headlines}, {article_content}.. 2. in php script: - prepare all the content and assign them to varialbes which have exactly the same name as the keys in the template. for example: $news = ...; $headlines = ...; - create a array using all the keys in the template. in this example it is: $keys = array (news, date, headlines, article_content); - dump the template into a buffer: $page = file ($template_file_path); - do replacement: foreach ($keys as $key ){ $page = str_replace ('{'.$key.'}', $$key, $page); } - send out the page: print $page; OKay, this process works perfect. However I am thinking that this might not be a effective way do to replacement because for each key replacement the whole template has to be scanned. No, this is too expensive. What I am currently thinking is, just use one scan but do all replacements. Here is my proposed solution: 1. create an associcate array using the keys and their values: $pattern = array ( news = ...; date = ..., headlines = ..., ); 2. scan the template and, when found something matched with '{[what_ever_a_key]}', replace it with $pattern[what_ever_a_key]. I would assume that with step 2 just one scan all replacements can be done. However I don't know with what php function and regex this solution can be implemented. Any suggestion, advice are highly appreciated! alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] upgrading
Hi, I am currently have PHP 4.0.4p11 and Apache 1.3.19 running on RH Linux 7.1. Now I am thinking of upgrade my PHP to 4.1.2-7 (the version come with RH 7.3). I have downloaded all 4.1.2-7 rpm packages altogether 10 files. I will stay with RH 7.1 but upgrade PHP to 4.1.2-7. I am going to do upgrading later today, but hope to know any advice if any one out there have such experience and has something to say abou this. Thanks in advance! Alex - TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a Web Host for php/mySQl
Thomas Edison Jr. [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Glory, I'm looking for a new Web Hosting company, to host my sites. I had been with Aletia, but i'm experiencing some technical flaws with them, so i need a new one. Aletia is very economical, with $7.95 a month for 200 MB, 10 GB Bandwidth, sub-domains, dbs, and a hell a lot of goodies. so i would prefer someone like them or better then them. I'd really appreciate if someone can find me a better Host. Thanks, T. Edison Jr. It's hard to obtain a better one considering the price and services. Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] upgrading error
I have PHP 4.0.4p11 on RH Linux 7.1. Today I downloaded PHP 4.1.2-7 rpm packages (10 packages) from RH web site. These packages are come with RH Linux 7.3. I don't want to upgrade Linux but just upgrade PHP so I tried rpm -Uvh php-4.1.2-7.i386.rpm. I got following error message: error: failed dependencies: libcrypto.so.2 is needed by php-4.1.2-7 libcurl.so.2 is needed by php-4.1.2-7 libdb-3.3.so is needed by php-4.1.2-7 libltdl.so.3 is needed by php-4.1.2-7 libmm.so.11 is needed by php-4.1.2-7 libpspell.so.4 is needed by php-4.1.2-7 libssl.so.2 is needed by php-4.1.2-7 libxml2.so.2 is needed by php-4.1.2-7 php = 4.0.4pl1-9 is needed by php-imap-4.0.4pl1-9 php = 4.0.4pl1-9 is needed by php-ldap-4.0.4pl1-9 php = 4.0.4pl1-9 is needed by php-mysql-4.0.4pl1-9 php = 4.0.4pl1-9 is needed by php-pgsql-4.0.4pl1-9 php = 4.0.4pl1-9 is needed by php-manual-4.0.4pl1-9 Any idea? Seems like it is impossible to directly upgrade from 4.0.4 to 4.1.2-7Please advice. Thanks in advace! Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] wanto uninstall php manual
Hi, I upgraded php from 4.0.4p11 to 4.0.6 with up2date (a RedHat Update Agent). The new php includes a huge manual but I cannot find where is it after installed, and I don't know how can access it. And more, my free disk space is only 120M. So I am thinking to uninstall this manual. Any one know how can do uninstallation? Thanks in advance! Alex P.S. thank Edwin for your suggestion for upgrading. -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] wanto uninstall php manual
Thanks! It works as I expected ;-) Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 "@ Edwin" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I haven't use up2date but perhaps this will work anyway. Open a terminal and execute this: rpm -ql php-manual The 'l' will tell you where the package was installed. While, rpm -e php-manual will uninstall the package... HTH - E Hi, I upgraded php from 4.0.4p11 to 4.0.6 with up2date (a RedHat Update Agent). The new php includes a huge manual but I cannot find where is it after installed, and I don't know how can access it. And more, my free disk space is only 120M. So I am thinking to uninstall this manual. Any one know how can do uninstallation? Thanks in advance! Alex P.S. thank @ Edwin for your suggestion for upgrading. You're welcome! -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!>?&(B http://career.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convert MySQL table into Access or Excell format
Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Saturday 13 July 2002 14:00, Alex Shi wrote: Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Saturday 13 July 2002 13:31, Alex Shi wrote: The thing is that, the MySQL table resides on a remote web server, my client want to download it and access it in Access. Doesn't matter, ODBC works across a network. But what can we do if the ISP closed 3306 port on their firewall? This thread is leading into non-PHP territory (ie you're better off asking on the mysql list). Put simply, you can specify which port you want MySQL to use. However if the ISP only allows certain ports, eg SMTP, HTTP, _and_ you're already using those ports, then you're stuck up a creek. Of course you can always ask your ISP to unblock that port. Why are _they_ firewalling _your_ network anyway? Sorry for the confusing...the ISP is the hosting company where my client's web site hosted. That's why I need a php solution for this... -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* What we do not understand we do not possess. -- Goethe */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convert MySQL table into Access or Excell format
the mysql list). Put simply, you can specify which port you want MySQL to use. However if the ISP only allows certain ports, eg SMTP, HTTP, _and_ you're already using those ports, then you're stuck up a creek. Of course you can always ask your ISP to unblock that port. Why are _they_ firewalling _your_ network anyway? Sorry for the confusing...the ISP is the hosting company where my client's web site hosted. That's why I need a php solution for this... OK, export mysql tables to CSV, import into Access. okay thanks a lot! -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Try to be the best of whatever you are, even if what you are is no good. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convert MySQL table into Access or Excell format
Hello, My client has a website and it support MySQL/PHP. The client want to download the MySQL tables and then access them in Excell or Access. So my question is, is it possible to convert MySQL table into Access or Excell format? Thanks in advance for all answer! Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convert MySQL table into Access or Excell format
The thing is that, the MySQL table resides on a remote web server, my client want to download it and access it in Access. Alex You can also use ODBC (Ships with Acess) to make a DSN connection to MySQL. Access can retrieve data from any ODBC DSN. Jason White - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 12, 2002 9:48 PM Subject: Re: [PHP] Convert MySQL table into Access or Excell format On Saturday 13 July 2002 06:48, Alex Shi wrote: Hello, My client has a website and it support MySQL/PHP. The client want to download the MySQL tables and then access them in Excell or Access. So my question is, is it possible to convert MySQL table into Access or Excell format? Thanks in advance for all answer! archives - mysql excel -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* After years of research, scientists recently reported that there is, indeed, arroz in Spanish Harlem. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convert MySQL table into Access or Excell format
Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Saturday 13 July 2002 13:31, Alex Shi wrote: The thing is that, the MySQL table resides on a remote web server, my client want to download it and access it in Access. Doesn't matter, ODBC works across a network. But what can we do if the ISP closed 3306 port on their firewall? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The young lady had an unusual list, Linked in part to a structural weakness. She set no preconditions. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Newbie Questionabout variables
Not sure what your question is In the case password is not a variable but the value of the variable, while admin is the name of the variable. Variables passed by url is obtained by GET method, and in your script all vairables passed by GET method can be accessed directly. So, in following script, ? . print $admin; . ? the result of print will be password. If this is not the answer to your quesiton, pls clarify. Alex Al [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I hope this posting is not a duplicate. I originally posted it yesterday, but it doesn't show on the newsgroup for me. Apparently you can set a variable as part of a URL statement. For example: www.company.com/index.php?admin=password. Where password might be a simple variable to test as a rudimentary authorization password. I can't find anything like this on the php website or manual. Can someone point me in the right direction? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP script
For file uploading: http://www.php.net/manual/en/features.file-upload.php For chmod: http://www.php.net/manual/en/function.chmod.php For the third question: php has no restriction where php scripts have to be put in. so just put the script where you want to upload file. Hope these can help. Alex R [EMAIL PROTECTED] wrote in message 000801c203db$5ba81b20$0a6da8c0@lgwezec83s94bn">news:000801c203db$5ba81b20$0a6da8c0@lgwezec83s94bn... Hi Guys, I need a PHP script that will allow me to upload/download chmod files etc on a remote server... I know there are loads of these scripts out there but being a newbie to PHP I really dont know which one is good... can you recomend any? coming from Java I love PHP so would appreciate if you would recomend only a php script and not perl,servlet,asp etc. Another problem is my webserver is something like /wtn/cgi-bin/www/ all cgi scripts will have to be put in the cgi-bin directory of course but must be called like this mysite.com/cgibin/script.pl the php script should allow me access to this directory too! ANY ideas or recomendations will be deeply appreciated esp from John Holmes, Jason Wong, Miguel Cruz coz you guys are really brainy and have helped me in the past so I know your advise is supurb. I would tip my hat to you, but dont wear one...;-) Cheers, -Ryan A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How is SESSION_ID passed?
Hello, I have created several web sites using php. In all these sites session id is passed via cookie. However I noticed that some times it was passed by url. I am thinking that to pass session id by url will be safer than by cookie. However I don't know how can do this without change my code. Do I have to do any configuration on php so that I can use url session id but don't need to modify my code? Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can obtain referer's name?
Hi! I want to know how can a script obtain the page name where it was linked. e.g., there's a link on page.html, and the link points to script.php, how can script.php know the name of page.html? Thanks in advance for all answer! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Send html email
Hi! How can I send a html email with just the build-in function mail()? Is this required to put some infomation in header field? Thanks in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Send html email
Thanks for all of you who answered my question. But another of my stupid question is: what is RTFM? Alex Michael Geier [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... While I understand the necessity in not answering every question that a newbie may post, a more pleasant approach would have been: the following is documented at http://www.php.net/manual/en/function.mail.php; or see the Content-Type: header for instructions on how to do this. Do you think someone who won't read the docs, or search the archives, prior to the question understands what RTFM means? My recommendation: http://phpmailer.sourceforge.net While this is not using the mail() function, it is a more robust, more functional method of sending mail, including multi-part, SMTP-Auth, attachments, etc, that works with a variety of MTAs including Sendmail, Qmail, and direct SMTP transport. -- Michael Geier CDM Sports, Inc. - Systems Administrator email: [EMAIL PROTECTED] Quoting Liam MacKenzie [EMAIL PROTECTED]: RTFM http://www.php.net/manual/en/function.mail.php - Original Message - From: Alex Shi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, May 12, 2002 10:00 AM Subject: [PHP] Send html email Hi! How can I send a html email with just the build-in function mail()? Is this required to put some infomation in header field? Thanks in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - This mail sent through CDM Sports Webmail. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I want to use a mailer other than sendmail
Hi, I am using PHP 4.0.4pl1 on RH 7.0. I know PHP uses sendmail as it's default mailer. However on my system sendmail has never been working well. So I am thinking that if it is possible to configure php to use my ISP's SMTP server instead of using the sendmail. Any one can help me out how to do this? Thanks in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I want to use a mailer other than sendmail
Thank you, Rasmus. I am going to try your way right away.. Alex Alex, the real answer is to just turn your sendmail into a SMTP passthrough. It is dead simple to do. Locate your sendmail.cf file. (Yeah, I can already hear the screams of anguish, but this file isn't actually all that bad) Now find the line that starts with DS and change it so it says: DSmail.mindspring.com for example. Then restart your sendmail. And now hocus-pocus-presto-shazzam, your sendmail suddenly works great for all your apps, not just PHP. -Rasmus On Fri, 3 May 2002, John Holmes wrote: From php.ini: [mail function] SMTP = localhost ;for win32 only sendmail_from = [EMAIL PROTECTED] ;for win32 only ;sendmail_path = Enter the name of your SMTP server on the first line, instead of localhost. If you use mindspring, for example, you would put mail.mindspring.com instead of localhost. ---John Holmes... -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Friday, May 03, 2002 6:52 PM To: [EMAIL PROTECTED] Subject: [PHP] I want to use a mailer other than sendmail Hi, I am using PHP 4.0.4pl1 on RH 7.0. I know PHP uses sendmail as it's default mailer. However on my system sendmail has never been working well. So I am thinking that if it is possible to configure php to use my ISP's SMTP server instead of using the sendmail. Any one can help me out how to do this? Thanks in advance! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to obtain the script's path?
Hi, I have a script need to be launched from terminal, and I want it to report the script's path. Because this script is required to be launched from command line, so those Apache env vars have not effect work, even $PHP_SELF don't work. Can anybody has a solution for this? Thanks in advance for any answers! Regards, Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP script for command line
I am now trying to use php script from command line. Everything is Ok except only one thing: it will always send out header msg. How can stop it from sending header? Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Zend Studio
Hi, After a long time absent from Zend I came across to it today just for any new articles. To my surprise they changed their home page and it seems like they are promoting their Zend Studio 2.0. I have no idea what it is. Is it like a Visual Studio? Does it support template? If any out there has ever used it could you please give some comment. Thanks! Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function not sending to Yahoo address
Hi, Monday, February 04, 2002, 12:17:27 AM, recebi de John P. Donaldson: John I've tried several PHP form processors, and all of John them have trouble sending the form contents to a Yahoo John address. When I change the address to something other John than a Yahoo account, it sends the form results with John no problem. Is there an issue with PHP's mail John function and Yahoo email addresses? check your SMTP server in the configuration of PHP Could you please further suggest how to check and what should be check for this issue, and what could be a concern in php configuration regarding to Yahoo account? Thanks! Alex Ricardo J. Veludo e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP don't know 'localhost'
Hi, Today I met a very strange problem. My system had been working perfect since long time back when I setup mysql/php/apache on RH 7.1, until today I found that php could not connect mysql with the user from 'localhost'. But actually user@localhost can login to mysql from terminal. 'Locahost' just don't work for PHP! However, if don't use 'localhost' but use the system's nick name (my machine is called 'puma'), then the mysql-connect() success! I just have no idea how it happend. Any one out there have idea about this please help! Thanks 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] MySQL connection problem?
Here is my situation: 1. Two hosts: HA and HB, both connected with each other via Internet. 2. On HA there is a MySQL server SA and a Web server WA, while on HB there is a SB and a WB. 3. On WA there is a page, on which there are two buttons: ba and bb. The ba is linked to a script sa.php while bb linked to sb.php. Both the scripts are lcated on HA. The sa.php only talks with SA while sb.php talks with both SA and SB. So connection between sb.php and SB will have to go via Internet. 4. Sometimes both the scripts works well, when click on either ba or bb the scritps responce very quickly. But sometimes there may be problem with sb.php: when click on bb the WEB just stuck there and the small earth keep on rotating but nothing return. The most strange thing is that, if something wrong with sb.php, you cannot stop it. You click browser's stop button (it do looks stopped because the earth stopped) and then click ba (will call sa.php), still got nothing return, the browser seems not wake from sb.php's problem. I guess it might be something to do with MySQL connection via internet. But have no clue how to look into the problem. Could any one here can point me the right direction to get it fixed? Thanks 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] How MySQL Query and Fetch work?
Yesterday I posted a question yet got response. The question is regarding to how Query works. Now I repost it in a more specific way. I am just wondering how MySQL API functions work. Let's look at following two functions: 1. mysql_query(), 2. mysql_fetch_array() To my understanding, mysql_query() will definately to its job with MySQL server. But how about the latter? Does it just fetch data from client/local buffer, which is previously put in by mysql_query(), or still has to goto server side to fetch data? 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] 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] List all session currently associated with a web site
Hi, I 'd like to know how can we list all the sessions concurrently active on a web site. If anyone out there knows how to do the trick please help. Thanks 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] 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] PHP4 on Windows98 with PWS4
Hello, folks! I installed PHP4 on Windows 98 with PWS4. When I try to run a very simple script, I got a just one line error message One of the library files needed to run this application cannot be found. The script is very simple: ? phpinfo(); ?, so I don't think the error has anything to do with it. Anyone has idea what's wrong with it? Please help me out if you know this issue. Thanks in advance! Alex Shi -- 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] PHP4 on Windows98 with PWS4
Now I set extension_dir point to correct path in php.ini, the problem changed: it shows 500 internal server error. - Original Message - From: Alex Shi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 18, 2001 5:51 PM Subject: [PHP] PHP4 on Windows98 with PWS4 Hello, folks! I installed PHP4 on Windows 98 with PWS4. When I try to run a very simple script, I got a just one line error message One of the library files needed to run this application cannot be found. The script is very simple: ? phpinfo(); ?, so I don't think the error has anything to do with it. Anyone has idea what's wrong with it? Please help me out if you know this issue. Thanks in advance! Alex Shi -- 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] PHP4 on Windows98 with PWS4
Thank you! I copied all the .dlls and point extension_dir to corrent path...Okay, the library file not found problem seems fixed but now the problem changed to 500 internal server error! I typed php -i from dos shell and it print correct html code. And I tried both cgi and isapi mode but got same error. It seems like this must be a web server config problem but I don't how to find out a clue. Alex - Original Message - From: Jim Lucas [EMAIL PROTECTED] To: Alex Shi [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, December 18, 2001 6:52 PM Subject: Re: [PHP] PHP4 on Windows98 with PWS4 make sure you copy all the correct dll's into the c:\windows\system or system32 directory. the dll's have to be in a location that is included in the window PATH in the autoexec.bat Jim - Original Message - From: Alex Shi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 18, 2001 2:51 PM Subject: [PHP] PHP4 on Windows98 with PWS4 Hello, folks! I installed PHP4 on Windows 98 with PWS4. When I try to run a very simple script, I got a just one line error message One of the library files needed to run this application cannot be found. The script is very simple: ? phpinfo(); ?, so I don't think the error has anything to do with it. Anyone has idea what's wrong with it? Please help me out if you know this issue. Thanks in advance! Alex Shi -- 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] Logo proposal - voting script!
Really? It seems perfect from my end (IE5.5/Win2K).. I got the same error... --- R'twick Niceorgaw [EMAIL PROTECTED] wrote: While voting I got this error Warning: Cannot add header information - headers already sent by (output started at /home/b1642/public_html/vote/logo.php:6) in /home/b1642/public_html/vote/logo.php on line 49 - Original Message - From: Michael Cronström [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 13, 2001 12:55 PM Subject: [PHP] Logo proposal - voting script! OK guys, a voting script! at: http://zoon.se/vote/logo.php try it :) Michael Cronstrom Web Inventor = work: 800-873-0078x7218 cell: 214-673-1468 home: 972-641-5535 __ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP 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] HEX value for str variable
Hello, For some reason I need to test Hex value in a string variable. Could any one here help me out how to write one or more hex values into a string variable? Thanks! 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]
Re: [PHP] Script like this for PHP
Javascript. - Original Message - From: Indera [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 12, 2001 4:01 AM Subject: [PHP] Script like this for PHP Hello, I came across this FAQ and I really would like to create my FAQ like this one. I was wondering if someone would take a look at this link and let me know how it's created. I looked at the code, but can't figure out how it's done. http://www.installshield.com/ds/info/generalqa.asp Thanks Indera -- 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] Help!
Have the page expired at once! Alex - Original Message - From: ryan adorable [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, December 09, 2001 10:07 AM Subject: [PHP] Help! Hi, I created a poll program for my homepage. When i vote some field in my database gets incremented, but after successfully voting when i clicked on reload/refresh of my browser the said field is also incremented. How can I fix/avoid this problem? Hoping for a reply. Thanks Ryan _ Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.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 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] Comparing Dates
Absolutely you are doing in the right way:) But pls make sure that string comparison is from left to right. For example, 16 is larger than 15-12-01. Alex - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 8:16 PM Subject: [PHP] Comparing Dates I'm trying to do a check on a date, to see if it's after the current date, so basically i'm doing an if(date(d-m-y)15-12-01) { do something } I know that's obviously not the right way to do it, but can someone help me out? -- 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 compute time to load page...
Basically I agree with you. But the second time to get time must be done after the page is rendered on local browser. So I suggest to use Javascript for the second time to get time, and pass the first time value into a js function. Alex - Original Message - From: Andrew Forgue [EMAIL PROTECTED] To: Jack Dempsey [EMAIL PROTECTED]; Torkil Johnsen [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 9:42 PM Subject: Re: [PHP] How to compute time to load page... Or this: at the beginning of your script, get the time using microtime then at the bottom, you could get the time again, subtract the difference and voila, thats how long the execution time of your script is. -ajf - Original Message - From: Jack Dempsey [EMAIL PROTECTED] To: Torkil Johnsen [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 7:59 PM Subject: RE: [PHP] How to compute time to load page... the search time is different than the page load timegoogle for example can find thousands of records in a tenth of a second, yet it takes longer to get that html result back to your browseryou could estimate page download time by calculating the filesize and using the connection speedcertainly not 100% accurate, but it will give you a way of estimating. jack -Original Message- From: Torkil Johnsen [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 08, 2001 7:14 PM To: [EMAIL PROTECTED] Subject: [PHP] How to compute time to load page... Hi All... (again) I was just wondering if anyone out there has made a function that will compute how long time (seconds, milliseconds) it will take to load a page? I see some search engines have a function that displays how long time the search took, and I'm looking for the same thing, to compare different designs and improve loading time for my viewers. Anyone? - Torkil Johnsen -- 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] How to compute time to load page...
This is an Einstein problem :)) Maybe we need a time server However, we can have an alternative solution to get round turn time. Let's say on page A there's a link to a backend script. When the link is clicked, then use javascript to pick up current time T1 and pass it to the script. This script will send a page back to browser. Let's say this is page B. Time T1 is passed to the js of page B. And at the end of page B a js function will pick up current time T2. When the page rendered at local browser, we have both T1 and T2. Thus we calculate the time difference of a round turn. I know it is not a final solution but this is acurate. Hope someone else out there can give better solution. Alex - Original Message - From: Jason G. [EMAIL PROTECTED] To: Alex Shi [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 11:42 PM Subject: Re: [PHP] How to compute time to load page... What about the small difference there will be between server time and local time? -Jason Garber At 10:40 PM 12/8/2001 -0500, Alex Shi wrote: Basically I agree with you. But the second time to get time must be done after the page is rendered on local browser. So I suggest to use Javascript for the second time to get time, and pass the first time value into a js function. Alex - Original Message - From: Andrew Forgue [EMAIL PROTECTED] To: Jack Dempsey [EMAIL PROTECTED]; Torkil Johnsen [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 9:42 PM Subject: Re: [PHP] How to compute time to load page... Or this: at the beginning of your script, get the time using microtime then at the bottom, you could get the time again, subtract the difference and voila, thats how long the execution time of your script is. -ajf - Original Message - From: Jack Dempsey [EMAIL PROTECTED] To: Torkil Johnsen [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 7:59 PM Subject: RE: [PHP] How to compute time to load page... the search time is different than the page load timegoogle for example can find thousands of records in a tenth of a second, yet it takes longer to get that html result back to your browseryou could estimate page download time by calculating the filesize and using the connection speedcertainly not 100% accurate, but it will give you a way of estimating. jack -Original Message- From: Torkil Johnsen [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 08, 2001 7:14 PM To: [EMAIL PROTECTED] Subject: [PHP] How to compute time to load page... Hi All... (again) I was just wondering if anyone out there has made a function that will compute how long time (seconds, milliseconds) it will take to load a page? I see some search engines have a function that displays how long time the search took, and I'm looking for the same thing, to compare different designs and improve loading time for my viewers. Anyone? - Torkil Johnsen -- 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] -- 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] HTTP Environment Varialbles
Hi, I have a question about how we can read environment variables. In perl we can do this as following: $caller = $ENV{'HTTP_REFERER'}; $doc_name = $ENV{'DOCUMENT_NAME'}; $visitor_ip = $ENV{'REMOTE_ADDR'}; $visitor_host = $ENV{'REMOTE_HOST'}; Actually in Perl, either SSI or CGI, we can get all the environment variables. How can we do the same thing in PHP? 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]
Re: [PHP] Trying to pass a variable through a form...
Can you paste Tnoy2.php script? Please make sure in Tony2.php $name is printed but not $lname. Alex - Original Message - From: Anthony Ritter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 07, 2001 12:01 AM Subject: [PHP] Trying to pass a variable through a form... I'm trying to pass a variable from a form text box into a php file (Tony1.php). Then, I'd like to click on a link in the Tony1.php page and get the Tony2.php page to load with the original variable -$lname - printed on the next page (Tony2.php). The Tony2.php loads when I click the link but the value from the variable is not printed. Any help would be greatly appreciated. The code is below. Tony Ritter ... file://TonyForm.html// HTML FORM ACTION=Tony1.php METHOD=get Name: INPUT TYPE=text NAME=lname br INPUT TYPE=Submit VALUE=Go /FORM /HTML . file://Tony1.php// ? echo (Welcome $lname); ? A HREF=Tony2.php?name=?echo($lname) ? Link /A ... file://Tony2.php// Hello -- 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] Redirect Function?!!
You can use, header (Location: http://www.php.net;); and you can pass variable, header (Location: http://www.php.net?name1=$value$name2=$value2;); Hope this can helps. Alex Shi - Original Message - From: Cam [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 07, 2001 12:22 AM Subject: [PHP] Redirect Function?!! Anyone know of a way to redirect to another page with PHP? I'm aware of the META tag redirection via the HTTP header, but I really need a more elegant solution that redirects immediately without relying on any HTML tags. Appreciate the help, -C -- 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] Is there a GUI for MySQL?
http://phpwizard.net/projects/phpMyAdmin/ -- this is a great admin tool through web http://www.mysql.com/downloads/gui-mysqlgui.html -- you can find screenshot there, looks ugly - Original Message - From: Hai Nguyen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 07, 2001 12:31 AM Subject: [PHP] Is there a GUI for MySQL? Hi, I am a newbie at this. I was just wondering if there is a Graphical User Interface for MySQL? Cheers, Hai Nguyen -- 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] Visual PHP Studio--comments?
Where you find it? Why not show up the link? Actually I have been always thinking of a php studio. I think at least following things could be integrated into such a studio: a php IDE bundled with a web authority tool, and port to SQL server and web server. Alex - Original Message - From: René Fournier [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Friday, October 19, 2001 3:50 PM Subject: [PHP] Visual PHP Studio--comments? Just found this app, and wondered if anyone here is using it and could comment on it. I was just wondering how it might help me do basic PHP development more than a good editor alone. (I am a PHP newbie, so perhaps it's just overkill.) ...Rene --- Rene Fournier [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP 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] A powerful editor!
Hello folks, Today, I found a very powerful editor, called TextPad. I said it is 'powerful' because it can recognize syntax of php, html, java, css and also many many more great featuresmuch better that Windows Notepad. You can download and try. You need to take a few minutes to explore it and maximize its functionality for you. Here is the link: http://www.textpad.com/ 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]
Re: [PHP] sessions in php4
I always using session together with header() and never got a problem. Here's something might be a hint to you: ? session_start(); $value = 908; // I always register it before using it session_register(value); header(location : new location); // How did you write the new location? I never header() to a // location outsite of the current site, and I never use http://...; // in the new location ? Alex - Original Message - From: sagar N Chand [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Monday, October 01, 2001 9:54 PM Subject: [PHP] sessions in php4 hi all, i'm using a php4.0.6 with apache on win2k. when i register a session and immediately if i redirect to another page the session seems not to be registered. eg. ? session_start(); $value = 908; session_register(value); header(location : new location); ? when i go to the new page i c that the session has not been reigstered. but in case if i dont redirect from php rather use a html redirection code like click here to redirect then it worked. why ? ? session_start(); $value = 908; session_register(value); ? a href=newlocationclick here to redirect/a(this worked out ) any suggestions ? /sagar -- 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 obtain all the fields' names of a MySQL table?
Hi, I wanto know how can obtain all of the fields' names of a MySQL table in a php script. Anyone have an idea about this please help. Thanks! 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]
Re: [PHP] How to obtain all the fields' names of a MySQL table?
Thanks for all reply! I just realized that this is just a simple issue of a sql query. Alex - Original Message - From: Alex Shi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 25, 2001 3:03 PM Subject: [PHP] How to obtain all the fields' names of a MySQL table? Hi, I wanto know how can obtain all of the fields' names of a MySQL table in a php script. Anyone have an idea about this please help. Thanks! 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] creating ZIP files
Raphael, check fillowing link: http://www.php.net/manual/en/ref.zip.php Php has built-in zip functions. Alex - Original Message - From: Raphael Pirker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 4:23 PM Subject: [PHP] creating ZIP files Hi Guys, Is there any way I can create a zip file from files? (filenames and their paths will be specified in an array) Any help would be very much appreciated! TIA, Raphael -- 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] Script Performance
Hi All, Anyone here know how can estimate performance of a script? For example, to use template will definitely have much benefit for both maintenance and development, but it will also cause more IO cost, so I guess it may have negtive effect on performance. Anyone here can please say something about this or suggest some readings on the topic. Thanks! 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] Call a script without a return
Hi, I know my question might be a little bit strange but I am really thinking for the posiblity. Suppose we have a page and on it a button link to a backend script. When click the button, at the server side the scritp will be called. My question is, how can we program the script that just let to do something on server but not to send out a return to browser, so at client end the page will be stay unchanged. Can any one here have an idea how to do this? 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]
Re: [PHP] Showing up variables in URL !
Try this: ? if( $greetings ){ echo $greetings; } else { header( Location: index.php?greetings=Hello ); } ? Alex - Original Message - From: Arcadius A. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 19, 2001 6:14 AM Subject: [PHP] Showing up variables in URL ! Hello ! We all know how to pass value to variable using an URL. So, how can I do the inverse ? I mean , showing the value of a variable in the URL? for instance my page index.php is : ? $greetings=Hello ; echo $greetings ; ? So, how to make PHP so that when I load my page in the browser(typing index.php in the adress bar) , it will print not only hello on the page,but also show index.php?greetings=hello as URL , So , I basically want PHP to dynamically append ?greetings=?=$greetings? to the URL I've typed How to do this ? I hope I've made myself understood ... :o) Thanks... Arcad. -- 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] HTML mail
Hi Sid, Following link is an article about sending MIME email in php: http://www.phpbuilder.com/columns/kartic2807.php3 But I think it is too complicated for me to read:((. I suggest you can try following instead: example $email_address=[EMAIL PROTECTED]; $subject=anything you can do; $email_contents=HTML test: write your HTML tags here; $tips=Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 7bit; mail($email_address,$subject,$email_contnets,$tips); /example here $tips is the key for html mail. Hope this can help. Alex - Original Message - From: Sid [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 06, 2000 11:32 AM Subject: [PHP] HTML mail hi, How would you send HTML mail using the mail() function in PHP. SID -- 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] Problem with header()
Hi, Can anyone tell me why header() cannot been used after any network operation? In my script, there are following steps: 1).a socket is opened for smtp; 2).send email; 3).closed the socket; 4).use header() to redirect to another page. If no 1), 2) and 3), 4) can be processed without any problem. But if socket steps added, system will send warning message: Cannot add header information - headers already sent by ( output started at.) So, it seems like fsockopen will cause a header to be sent and other header cannot been sent after that within same scritp even though the socket is closed. Now my question is how can the second header been sent? 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]
Re: [PHP] what does this line means? Many thanks
strstr($str, $needle) returns a substr start from first occurance of $needle in $str to the end of $str. strstr($value,VLD:) != ? $VLD_CNDTNS[] = strtr($value,VLD:,) : $SBMT_CNDTNS[] = $value; equivalent to: if( strstr($value, VLD:) != ) { $VLD_CNDTNS[] = strtr($value,VLD:,); } else { $SBMT_CNDTNS[] = $value; } This kind of express is borrowed from C. Alex - Original Message - From: Sall Him [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 05, 2001 3:35 PM Subject: [PHP] what does this line means? Many thanks strstr($value,VLD:) != ? $VLD_CNDTNS[] = strtr($value,VLD:,) : $SBMT_CNDTNS[] = $value; -- 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]