[PHP] Mailing Archieve
Hello, Can anyone please tell me how to create a mailing archieve list Thanks in advance Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Full-Duplex communication
Hi Miguel, I can go in for a php based listener, yes, but this system is already in a production environment and there will be major changes required to get it done. If I get a chance to redevelop this, that is probably what I'll go in for. Tx, Vinod. -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 10:18 PM To: Vinod Panicker Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Re: [PHP] Full-Duplex communication So still there is nothing in your requirements that doesn't suggest you'll do fine with a PHP-based listener. Of course you have the memory overhead of the PHP interpreter's RAM infrastructure multiplied by the number of simultaneous connections, but that would be the same with Apache (at least on Unix). miguel On 24 May 2002, Vinod Panicker wrote: Let me explain my project more in detail. This system is an Instant messaging system, with the backed running on apache / php / mysql. The front end client is a COM component that communicates with the backend, and interfaces with an MFC app. Now since Instant messaging requires that the server should be able to send asynchronous messages to the client (Presence, IM's, notifications, etc), and HTTP does not allow asynchronous communication, the only solution is to have the client poll the server for messages. Now i know that apache / php is not a good solution for an instant messaging server, but we needed it to be ready in a months time, and php is so amazing that we could get it up and running so fast. But it meant that we have to live with latency between messages because of the polling. So i was thinking if there was some way in which i could avoid the polling and send data asynchronously to the client (Pls refer to my previous posts). Thats why i was looking at a way in which i could get hold of the socket to the client, so i could use it to send data directly. Tx, Vinod. On Fri, 24 May 2002 Miguel Cruz wrote : Not to be argumentative, but what you're trying to do is just so amazingly much more complicated than any of my suggestions. Maybe I haven't communicated it well, it maybe there's some requirement to your project that I don't understand. Why not just write a listener in PHP and redirect to it? It's basically no work. Handcrafting packets for this purpose is like building a car out of paper clips and cat hair because the car that's freely available to you is red - and you don't like the color red because your old girlfriend used to wear it a lot. miguel On 23 May 2002, Vinod Panicker wrote: What you said did make sense, and complements my knowledge of sockets. But what i'm not sure of is this - if i construct my own packet and send it across, presuming that i do have the ip address and port number of the client on which it is reading, will the client accept it as a legitimate packet? I suspect that since the packets would be having some kind of session identifier / sequence number. Getting the ip address and port number is no problem. I already have that getting stored on the server. But from what i know of sockets, i'm sceptical if the client will accept the packet. Guess the only way to go ahead is to try this out. Would someone pls pls pls write a PHP interface to libnet?? Tx, Vinod. On Thu, 23 May 2002 Evan Nemerson wrote : You're right- this is getting interesting ;) http://www.packetfactory.net/libnet/manual/4.html#s4.1.5 Unless I'm mistaken, you don't need to actually hijack the socket- you merely need to write to the network. Check out section 3.1 of RFC 793. There is source and destination port- that is how they are routed. Okay anyone PLEASE correct me if i'm wrong... My understanding is a socket is an interface to the kernel. So basically, you talk to a socket, which the kernel associates with source and destination ports, and destination IP address. Thats why you can just write to a socket instead of explicitly stating all the information. The kernel then sends out then creates the packet and send it to the destination IP. libnet would allow you to bypass the socket phase, and manually create a socket. Think of a socket as a GUI for the network, and libnet is like a console ;) Hope that helps, and once again anyone PLEASE correct any inaccuracies, since I want to know. On Tuesday 21 May 2002 23:53 pm, Vinod Panicker wrote: Thanks for the reply Miguel, but here i'm not trying to implement my own multi-threaded server - exactly the reason why i'm using Apache / PHP. I could have made a listening server which is based on a multi-threaded or multi-forked model, but the time and complexities involved would be huge. Thats why I chose Apache /
[PHP] mod_rewrite open_basedir pear
Hi Can anyone please help me with a following problem. There's a script which uses PEAR library (namely, DB class) ? $dbhost=... $dblogin=... $dbpassword=... $dbname=... require_once(DB.php); $dsn = mysql://$dblogin:$dbpassword@$dbhost/$dbname; $db = DB::connect($dsn, true); if (DB::isError($db)) die (*** .$db-getMessage()); var_dump($db); ? When i execute it everything is ok. BUT when i access this script via redirect by mod_rewrite it throws an error that open_basedir settings don't allow this require to be made .htaccess: RewriteEngine on RewriteRule test2.php /~xaxa/test/test3.php [L] test2.php,test3.php contain the code that i quoted above error: Warning: open_basedir restriction in effect. File is in wrong directory in /home/xaxa/public_html/test/test3.php on line 4 Fatal error: Failed opening required 'DB.php' (include_path='.:/usr/local/lib/php') in /home/xaxa/public_html/test/test/test3.php on line 4 Is there any way to overcome this problem? mod_rewrite is used to _hide_ urls from users and to _extend_ url with additional params. Alexei -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session's is slowing the page ??
Hi PHP's sessions are blocking, i.e. until a session is closed, all other calls to session_start() are pending. If you don't close a session explicitely, it remains opened until the script is terminated. The solution is to close a session as soon as possible (session_write_close) or use non-blocking read-only sessions (session_readonly instead of session_start) in case you don't need to modify registered variables. Tom Dima Dubin wrote: Hello, I have very wierd problem : I use session to manage users and I have this structure of the page : - include(db.php); include(header.php); bla bla include(footer.php); - in the db.php I have : session_start(); #some mysql connect stuff I use session with the $_SESSION array (cheking if registered[isset($_S...)] and registering...) and all work fine but sometimes the page loading is very very very slow (and its a really really fast host) and when I removing session_start(); from the top of the page, the page load normaly. the PHP version is 4.1.1, someone have an idea ? thanks in advance, Dima. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File not getting created
I am opening file in append mode but file is not getting created at all. I am not getting error too. I think it is due to write permission. How to check it and how to set it ? Environment - Linux / PHP4 Thanks in advance Manisha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable vs Constant
what harm (in term of loading/performance) will it make if i declear a value as VARIABLE where i should make it as CONSTANT actually?? how about if i declear 100 values as VARIABLEs where all are CONSTANTs actually? thx HPS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] function return
Hi all, I have a Q about functions. My function should return 2 values. What syntax should I use and how do I call these values outside the function? Are these values returned as en array or something? this is what I have now, - function myFunction($some_vars) { $max=count($some_vars); $some_value=($max/2); return($some_value $max); } $var1=should be the value of $some_value $var2=should be the value of $max thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie question about PHP and Oracle
I don't know how it works in my sql. I've written some functions to help me construct these sort of things. It might help you PS : Sorry but the comments are in French. Laurent Drouet /* ** Cette fonction retourne toutes les lignes d'une ** ** requette dans un tableau multidimensionnel. Une ** ** variable globale $db_selectall2_nrows2 est ** ** definie pour pouvoir transmettre le nombre ** ** de ligne de la requette ** **/ function db_selectall2($id_connect,$query) { global $db_selectall2_nrows2; $stmt = ociparse($id_connect,$query); ociexecute($stmt); $db_selectall2_nrows2 = ociFetchStatement($stmt,$results); return $results; } /* ** Creation d'une liste d'options (SELECT) a partir d'un** ** tableau bidimensionnel. Les parametres a fournir a ** ** cette fonction sont le tableau et le nombre de lignes** ** de la requette. Le premier parametre du tableau ** ** contient la valeur de la liste deroulante. Les ** ** autres colonnes du tableau sont concatenees avec ** ** la premiere et sont affichees. Cette fonction ** ** peut etre appelee apres db_selectall2 ** **/ function creat_select($resquery,$totlines, $action) { $nbre=sizeof($resquery); $colres=array_keys($resquery); print SELECT $action\n; for ($row=0; $row$totlines; $row++ ) { print OPTION value=\.$resquery[$colres[0]][$row].\; for ($x=0; $x$nbre; $x++) { if ($x0) { print , .$resquery[$colres[$x]] [$row]; } else { print $resquery[$colres[$x]] [$row]; } } print /OPTION\n; } print /SELECT; } /* ** Creation d'une liste d'options (SELECT) a partir ** ** d'un tableau bidimensionnel. Les parametres a fournir** ** a cette fonction sont le tableau et le nombre de ** ** ligne de la requette. la valeur de la liste ** ** deroulante sera la concatenation de toutes ** ** les valeurs. Cette fonction peut etre appelee ** ** apres db_selectall2 ** **/ function creat_select1value($resquery,$totlines, $action) { $nbre=sizeof($resquery); $colres=array_keys($resquery); print SELECT $action\n; print OPTION--SELECT--/OPTION\n; for ($row=0; $row$totlines; $row++ ) { print OPTION value=\; for ($x=0; $x$nbre; $x++) { if ($x0) { $texte.=, .$resquery[$colres [$x]][$row]; } else { $texte=$resquery[$colres[$x]] [$row]; } } print $texte.\.$texte./OPTION\n; } print /SELECT; } /* ** Creation d'une liste d'options (SELECT) a partir ** ** d'un tableau bidimensionnel. Les parametres a fournir** ** a cette fonction sont le tableau et le nombre de ** ** ligne de la requette. la valeur de la liste ** ** deroulante sera la concatenation de toutes ** ** les valeurs. Cette fonction peut etre appelee ** ** apres db_selectall2 ** **/ function creat_selectcomplex($resquery,$headervalue, $headerdisplay, $totlines, $action) { $nbrevalue=sizeof($headervalue); $nbredisplay=sizeof($headerdisplay); //$colres=array_keys($resquery); print SELECT $action\n; print OPTION--SELECT--/OPTION\n; for ($row=0; $row$totlines; $row++ ) { print OPTION value=\; for ($y=0; $y$nbrevalue; $y++) { if ($y0) { $textevalue.=, .$resquery [$headervalue[$y]][$row]; } else { $textevalue=$resquery[$headervalue [$y]][$row]; } } for ($x=0; $x$nbredisplay; $x++) {
[PHP] Re: Newbie question about PHP and Oracle
Hi, I think you mean hwo u can get the data into an array well here is an example : $query = select ...; $stmt = ociparse( $connectionhandle, $query ); if( ociexecute( $stmt, OCI_DEFAULT ) ){ ocifetchinto( $stmt, $row, OCI_ASSOC+OCI_RETURN_NULLS ); } and now you got 1 resultset in an associative array called $row. take a look at the oci-functions in the manual for the different flags u can set. regards markus mirsberger Michael Sweeney [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... a VERY newbie question, just how do I get data into a listbox? In mysql it was pretty easy with mysql_fetch_row, but for oracle I am totally lost. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable vs Constant
Billy, There must be a limit to the number of variables you can use in php but I haven't run up against a limit yet, and php seems to run as fast on my high variable count code as my more mundane code. Obviously, the advantage of using variables is that you can group your variables/constants in one area at the top of your code and when you need to change one of the constants (and you know you will need to do this eventually) you won't need to look for it in amongst your code. Not really an answer to your question but more of an observation on my part. I hope one of the more experienced will also pipe in. Good Luck Hugh - Original Message - From: Billy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 27, 2002 8:46 AM Subject: [PHP] Variable vs Constant what harm will it make if i declear a value as VARIABLE where i should make it as CONSTANT actually?? how about if i declear 100 values as VARIABLEs where all are CONSTANTs actually? thx HPS -- 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] function return
Hi, I don't know if there is an easier way to do this but why don't you concatenate the two values to be returned and then split the returned value ? ex : function myFunction($some_vars) { $max=count($some_vars); $some_value=($max/2); $result = $some_value.;.$max; return $result; } $resultado = myFunction($some_other_name_vars); list($var1,$var2) = split(;,$resultado); I hope it helps. SR $var1=should be the value of $some_value $var2=should be the value of $max W. Enserink a écrit : Hi all, I have a Q about functions. My function should return 2 values. What syntax should I use and how do I call these values outside the function? Are these values returned as en array or something? this is what I have now, - function myFunction($some_vars) { $max=count($some_vars); $some_value=($max/2); return($some_value $max); } $var1=should be the value of $some_value $var2=should be the value of $max thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] function return
I have a Q about functions. My function should return 2 values. What syntax should I use and how do I call these values outside the function? Are these values returned as en array or something? I don't know if there is an easier way to do this but why don't you concatenate the two values to be returned and then split the returned value ? ex : function myFunction($some_vars) { $max=count($some_vars); Personally, I'd put both values to be returned into an array and then return the array. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable vs Constant
Thx Hugh i got what u meanlet me give u more background for my problem i am now working on a project which was developed by some others b4. As the project is a multi-language enabled, there is a PHP file (language file) which has all the setting , say $i_no_record_exists_msg = There is no record at the moment.; $i_no_search_result_msg = Sorry, your search yielded no results. Please revise your search query and try again.; $i_alert_pleasefillin = Please fill in the ; $i_email_to = To; $i_status_approve = Approve; $i_status_pendinguser = Pending; $i_status_publish = Publish; $i_status_checkin = Check In; . .. .. In this language file, over 500 variables are declared. And what i scare is 1. programmatically, should i change all these to CONSTANT? (coz all these values will never change) 2. if there is difference in declaring variable and constant (say, memory space required), how much harm it will ? 3. as this file would be included in the entire systemthe downside will be even more thx Billy Hugh Danaher [EMAIL PROTECTED] wrote in message 000701c20620$885cd2e0$017f@localhost">news:000701c20620$885cd2e0$017f@localhost... Billy, There must be a limit to the number of variables you can use in php but I haven't run up against a limit yet, and php seems to run as fast on my high variable count code as my more mundane code. Obviously, the advantage of using variables is that you can group your variables/constants in one area at the top of your code and when you need to change one of the constants (and you know you will need to do this eventually) you won't need to look for it in amongst your code. Not really an answer to your question but more of an observation on my part. I hope one of the more experienced will also pipe in. Good Luck Hugh - Original Message - From: Billy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 27, 2002 8:46 AM Subject: [PHP] Variable vs Constant what harm will it make if i declear a value as VARIABLE where i should make it as CONSTANT actually?? how about if i declear 100 values as VARIABLEs where all are CONSTANTs actually? thx HPS -- 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] onchange read file, php JS
Hy, Is it possible to use a javascript variable into php or to change it into php variable? I have a list with the files from a directory, this works fine. For the event onchange I want to show the content of the file chosen. So, in the code, the variable inputf has the file name that I want to read. How can I use it in the code php? Thanks a lot! Mihaela form name=showfile SELECT NAME=Types onChange=javascript:FileContenu (this.form) OPTION SELECTED value=choisir- Choisissez - ?php $conn_id = ftp_connect($server); $login_result = ftp_login($conn_id, $user, $pass); if ((!$conn_id) || (!$login_result)) { echo Connection problem! ; die; } else { $list=Array(); $list=@ftp_nlist($conn_id, dirName); $i=0; do{ ? OPTION value=?php echo $list[$i]; ? ?php echo $list[$i]; $i++; }while($list[$i]); } ? /SELECT /form //JAVASCRIPT script language=JavaScript function FileContenu(n){ var inputf =; inputf=n.Types.options[n.Types.selectedIndex].value; if(inputf==choisir){ n.mesg.value = ; } else{ ?php //conection ftp to read the file $file=ftp://$user:$pass@$server/home/$user/;; $filehandle=fopen($file,r); if($filehandle){ while (!feof ($fp)) { $buffer = fgets($fp, 4096); } fclose($filehandle); ? n.mesg.value = ?php echo $buffer;?; } } //-- /script __ Boîte aux lettres - Caramail - http://www.caramail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newsletter wordwrapping for Outlook?
Hello I'm wrapping a newsletter with $message = wordwrap( $message1,75,\r\n ); before sending it out. still, my customer with his Outlook client gets everything on one line! (Eudora and Outlook Express on my own machine display it fine.) Any takes? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 28 May 2002 09:02:52 -0000 Issue 1371
php-general Digest 28 May 2002 09:02:52 - Issue 1371 Topics (messages 99399 through 99454): Logout 99399 by: Jonas Hörnblad 99400 by: Sagie Maoz 99401 by: Thalis A. Kalfigopoulos php's variables javascript 99402 by: burak delice 99407 by: Sagie Maoz 99408 by: Jason Wong 99410 by: Boyan Nedkov 99411 by: burak delice 99437 by: Brad McCrorey javascript and php 99403 by: burak delice PHP Include directory 99404 by: Tim Thorburn Newbie question about PHP and Oracle 99405 by: Michael Sweeney 99447 by: DrouetL.ldnegoce.com 99448 by: Markus Mirsberger Re: fread and session vars 99406 by: Zac Hillier OT - 1u linux web servers... 99409 by: Kelly Meeks at least right code is here :) 99412 by: burak delice A bit confused 99413 by: r 99414 by: Peter 99418 by: Justin French A bit confused PART 2 99415 by: r 99429 by: Evan Nemerson Include load question (newbie) 99416 by: r 99417 by: David Freeman Re: newbie bigtime 99419 by: Justin French Regex Assistance 99420 by: Scott Reismanis 99421 by: Martin Towell Is this a bug? 99422 by: zhaoxd 99423 by: Jule 99424 by: Jule 99426 by: Jule Re: PhP, mysql and pictures 99425 by: Greg Wright Re: PHP script and external C program 99427 by: Evan Nemerson Re: Session's is slowing the page ?? 99428 by: Dima Dubin 99443 by: Tom Mikulecky Re: Parse Error(Newbie) 99430 by: Matt Giddings 99431 by: Matt Giddings Setting PHP Authentication manually? 99432 by: Laura Harley 99433 by: Martin Towell 99435 by: Rasmus Lerdorf Variable vs Constant 99434 by: Billy 99445 by: Billy 99449 by: hugh danaher 99452 by: Billy Missing functions?? 99436 by: Weston Houghton Re: PHP 4.1.2 ignores ini-set on max_upload_filesize 99438 by: DevilKin 99439 by: DevilKin Mailing Archieve 99440 by: Uma Shankari T. Re: Full-Duplex communication 99441 by: Vinod Panicker mod_rewrite open_basedir pear 99442 by: Alexei Tenitski File not getting created 99444 by: Manisha function return 99446 by: W. Enserink 99450 by: RIVES Sergio 99451 by: David Freeman onchange read file, php JS 99453 by: Mihaela Dupret newsletter wordwrapping for Outlook? 99454 by: m u i n a r Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Hi there, I've only been PHPing for some week and ofcours I've ran into my first two problems. 1. I'm building this community thing and I have a text file with the users that is currently logged in. When they press logout there name is deleted from the textfile, but if they just close there browser or surf to another site there name is still in the text-file until they log out next time. Any ideas how to avoid this? 2. How do I sort an array? I've tried array_multisort(); but I can only ascci-sort my array which makes R come before j and so on. How do I sort alphabeticly and not case sencetive ascci? Thanks /Jonas _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx ---End Message--- ---BeginMessage--- Jonas ? wrote: 1. I'm building this community thing and I have a text file with the users that is currently logged in. When they press logout there name is deleted from the textfile, but if they just close there browser or surf to another site there name is still in the text-file until they log out next time. Any ideas how to avoid this? What you should do is save for each user the last time he was seen in the site: the value of this time is updated for each page he or she loads. Then, when checking to see if a user is currently logged in, you check how long ago was he last seen. If it was more than X seconds/minutes/etc. (this is for you to set), she is considered offline and you can remove him from the file. Best Regards, Sagie Maoz [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- On Mon, 27 May 2002, Jonas Hörnblad wrote: Hi there, I've only been PHPing for some week and ofcours I've ran into my first two problems. 1. I'm building this community thing and I have a text file with the users that is currently logged in. When they press logout there name is deleted from the textfile, but if they just close there browser or surf to another site there name is still in the text-file until they log out next time. Any ideas how
[PHP] Re: Session's is slowing the page ??
Hello Tom I looked in the manual for session_readonly because its basicly what I need : 1 login page, and the just read the session data in other pages but, there is no examples or anything like that in the manual could you please show me a little example how to use it on my pages ? THANKS !! Dima. Tom Mikulecky [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi PHP's sessions are blocking, i.e. until a session is closed, all other calls to session_start() are pending. If you don't close a session explicitely, it remains opened until the script is terminated. The solution is to close a session as soon as possible (session_write_close) or use non-blocking read-only sessions (session_readonly instead of session_start) in case you don't need to modify registered variables. Tom Dima Dubin wrote: Hello, I have very wierd problem : I use session to manage users and I have this structure of the page : - include(db.php); include(header.php); bla bla include(footer.php); - in the db.php I have : session_start(); #some mysql connect stuff I use session with the $_SESSION array (cheking if registered[isset($_S...)] and registering...) and all work fine but sometimes the page loading is very very very slow (and its a really really fast host) and when I removing session_start(); from the top of the page, the page load normaly. the PHP version is 4.1.1, someone have an idea ? thanks in advance, Dima. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] function return
Hi, function myFunction($some_vars, $max, $some_value) { $max=count($some_vars); $some_value=($max/2); //return true; } Rudolf Visagie Principal Software Developer Digital Healthcare Solutions mailto:[EMAIL PROTECTED] Tel: + 27 011 2655478 Cell: + 27 82 895 1598 -Original Message- From: W. Enserink [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 10:02 AM To: [EMAIL PROTECTED] Subject: [PHP] function return Hi all, I have a Q about functions. My function should return 2 values. What syntax should I use and how do I call these values outside the function? Are these values returned as en array or something? this is what I have now, - function myFunction($some_vars) { $max=count($some_vars); $some_value=($max/2); return($some_value $max); } $var1=should be the value of $some_value $var2=should be the value of $max thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [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] Problem with compilation
Hi, I'm trying to compile CGI version of latest PHP v4 (4.2.1) on Linux RH 6.2 kernel 2.2.14 with mysql client/server ver 2.22.49 and it always fails to compile while compiling mysql extension. I've included part with error message which I don't understand to. CONFIG ./configure --prefix=/usr \ --with-config-file-path=/etc \ --enable-sockets \ --enable-ftp \ --with-mysql=/usr \ --enable-inline-optimization [root@www php-4.2.1]# /CONFIG MESSAGE Making all in mysql make[2]: Entering directory `/usr/src/php-4.2.1/ext/mysql' make[3]: Entering directory `/usr/src/php-4.2.1/ext/mysql' gcc -I. -I/usr/src/php-4.2.1/ext/mysql -I/usr/src/php-4.2.1/main -I/usr/src/php-4.2.1 -I/usr/src/php-4.2.1/Zend -I/usr/include/mysql -I/usr/src/php-4.2.1/ext/xml/expat -I/usr/src/php-4.2.1/TSRM -g -O2 -c php_mysql.c touch php_mysql.lo In file included from /usr/include/sys/socket.h:34, from /usr/include/netdb.h:31, from php_mysql.c:49: /usr/include/bits/socket.h:35: warning: redefinition of `socklen_t' /usr/src/php-4.2.1/main/php.h:114: warning: `socklen_t' previously declared here php_mysql.c: In function `_close_mysql_link': php_mysql.c:252: `SIGPIPE' undeclared (first use in this function) php_mysql.c:252: (Each undeclared identifier is reported only once php_mysql.c:252: for each function it appears in.) php_mysql.c:252: `SIG_IGN' undeclared (first use in this function) php_mysql.c:252: warning: assignment makes pointer from integer without a cast php_mysql.c: In function `_close_mysql_plink': php_mysql.c:267: `SIGPIPE' undeclared (first use in this function) php_mysql.c:267: `SIG_IGN' undeclared (first use in this function) php_mysql.c:267: warning: assignment makes pointer from integer without a cast php_mysql.c: In function `php_mysql_do_connect': php_mysql.c:602: `SIGPIPE' undeclared (first use in this function) php_mysql.c:602: `SIG_IGN' undeclared (first use in this function) php_mysql.c:602: warning: assignment makes pointer from integer without a cast make[3]: *** [php_mysql.lo] Error 1 make[3]: Leaving directory `/usr/src/php-4.2.1/ext/mysql' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/src/php-4.2.1/ext/mysql' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/php-4.2.1/ext' make: *** [all-recursive] Error 1 /MESSAGE I'm not able to identify the real cause of this problem. Can someone help? Mirek. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newsletter wordwrapping for Outlook?
Everything ok. Like often, in the minute I sent my posting, I got a message from the customer that it looks great now. This list seems to help metaphysically:) Have a nice day. Mike At 11:00 28.05.02, you wrote: Hello I'm wrapping a newsletter with $message = wordwrap( $message1,75,\r\n ); before sending it out. still, my customer with his Outlook client gets everything on one line! (Eudora and Outlook Express on my own machine display it fine.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] onchange read file, php JS
You have to put the variable into a hidden form element or tack it onto a URL in order to pass it to the PHP page. ---John Holmes... - Original Message - From: Mihaela Dupret [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 6:51 AM Subject: [PHP] onchange read file, php JS Hy, Is it possible to use a javascript variable into php or to change it into php variable? I have a list with the files from a directory, this works fine. For the event onchange I want to show the content of the file chosen. So, in the code, the variable inputf has the file name that I want to read. How can I use it in the code php? Thanks a lot! Mihaela form name=showfile SELECT NAME=Types onChange=javascript:FileContenu (this.form) OPTION SELECTED value=choisir- Choisissez - ?php $conn_id = ftp_connect($server); $login_result = ftp_login($conn_id, $user, $pass); if ((!$conn_id) || (!$login_result)) { echo Connection problem! ; die; } else { $list=Array(); $list=@ftp_nlist($conn_id, dirName); $i=0; do{ ? OPTION value=?php echo $list[$i]; ? ?php echo $list[$i]; $i++; }while($list[$i]); } ? /SELECT /form //JAVASCRIPT script language=JavaScript function FileContenu(n){ var inputf =; inputf=n.Types.options[n.Types.selectedIndex].value; if(inputf==choisir){ n.mesg.value = ; } else{ ?php //conection ftp to read the file $file=ftp://$user:$pass@$server/home/$user/;; $filehandle=fopen($file,r); if($filehandle){ while (!feof ($fp)) { $buffer = fgets($fp, 4096); } fclose($filehandle); ? n.mesg.value = ?php echo $buffer;?; } } //-- /script __ Boîte aux lettres - Caramail - http://www.caramail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function return
Return an array function whatever($var1, $var2) { // do whatever $ret[0] = $var1 + $var2; $ret[1] = $var1 - $var2; $ret['something'] = ($var1/$var2) * 100; return $ret; } $value = whatever(5,4); echo $value[0]; echo $value['something']; ---John Holmes... - Original Message - From: W. Enserink [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 4:01 AM Subject: [PHP] function return Hi all, I have a Q about functions. My function should return 2 values. What syntax should I use and how do I call these values outside the function? Are these values returned as en array or something? this is what I have now, - function myFunction($some_vars) { $max=count($some_vars); $some_value=($max/2); return($some_value $max); } $var1=should be the value of $some_value $var2=should be the value of $max thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [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] Re: Problem with compilation
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hi, I'm trying to compile CGI version of latest PHP v4 (4.2.1) on Linux RH 6.2 kernel 2.2.14 with mysql client/server ver 2.22.49 and it always fails to compile while compiling mysql extension. I've included part with error message which I don't understand to. CONFIG ./configure --prefix=/usr \ --with-config-file-path=/etc \ --enable-sockets \ --enable-ftp \ --with-mysql=/usr \ --enable-inline-optimization [root@www php-4.2.1]# /CONFIG MESSAGE Making all in mysql make[2]: Entering directory `/usr/src/php-4.2.1/ext/mysql' make[3]: Entering directory `/usr/src/php-4.2.1/ext/mysql' gcc -I. -I/usr/src/php-4.2.1/ext/mysql -I/usr/src/php-4.2.1/main -I/usr/src/php-4.2.1 -I/usr/src/php-4.2.1/Zend -I/usr/include/mysql -I/usr/src/php-4.2.1/ext/xml/expat -I/usr/src/php-4.2.1/TSRM -g -O2 -c php_mysql.c touch php_mysql.lo In file included from /usr/include/sys/socket.h:34, from /usr/include/netdb.h:31, from php_mysql.c:49: /usr/include/bits/socket.h:35: warning: redefinition of `socklen_t' /usr/src/php-4.2.1/main/php.h:114: warning: `socklen_t' previously declared here php_mysql.c: In function `_close_mysql_link': php_mysql.c:252: `SIGPIPE' undeclared (first use in this function) php_mysql.c:252: (Each undeclared identifier is reported only once php_mysql.c:252: for each function it appears in.) php_mysql.c:252: `SIG_IGN' undeclared (first use in this function) php_mysql.c:252: warning: assignment makes pointer from integer without a cast php_mysql.c: In function `_close_mysql_plink': php_mysql.c:267: `SIGPIPE' undeclared (first use in this function) php_mysql.c:267: `SIG_IGN' undeclared (first use in this function) php_mysql.c:267: warning: assignment makes pointer from integer without a cast php_mysql.c: In function `php_mysql_do_connect': php_mysql.c:602: `SIGPIPE' undeclared (first use in this function) php_mysql.c:602: `SIG_IGN' undeclared (first use in this function) php_mysql.c:602: warning: assignment makes pointer from integer without a cast make[3]: *** [php_mysql.lo] Error 1 make[3]: Leaving directory `/usr/src/php-4.2.1/ext/mysql' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/src/php-4.2.1/ext/mysql' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/php-4.2.1/ext' make: *** [all-recursive] Error 1 /MESSAGE I'm not able to identify the real cause of this problem. Can someone help? Mirek. -- You seem to be pointing to an unusual directory for your mysql installation?? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] (Unlink(file) == rm file) ? (ignore this mail):(explain diffs);
Hi, (Unlink(file) == rm file) ? (ignore this mail):(explain diffs); Does PHP unlink function handle deletion of files equally as the rm command on the system in my case FreeBSD. Or does it involve caching/handling files in any different way? / Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] exec() under win2000 apache not works?
Hi! My problem is: I'm traying to use the following commandos under win2000 / apache / php4.0.6: ? // for testing if CMD works or not: $cmd_commando = cmd /c echo My Name is Adrian; passthru($cmd_commando); // the 'hot' commando for CMD: $cmd_commando = cmd /c xcopy C:\php\INPUT\* C:\php\OUTPUT\* /w /f /i /s /e /h /y; passthru($cmd_commando); ? Actualy the first 'test'-commando response the defined text 'My Name is Adrian' ... so far so good. But if i have a look on my Windows-Explorer for checking the Directory and files under 'C:\php\OUTPUT\*', (there shut be the same structure as in the 'C:\php\INPUT\*')there is nothing. Also i used the following methodes without any success: 'shell_exec();' and 'system();'. Where am i wrong or what shut i do for success?? Thanx for your answer! Greatings --- Adrian Christen / [EMAIL PROTECTED]
Re: [PHP] exec() under win2000 apache not works?
Posteingang [EMAIL PROTECTED] wrote: $cmd_commando = cmd /c xcopy C:\php\INPUT\* C:\php\OUTPUT\* /w /f /i /s /e /h /y; You need to escape your backslashes... $cmd_commando = cmd /c xcopy C:\\php\\INPUT\\* C:\\php\\OUTPUT\\* /w /f /i /s /e /h /y; Also, make sure the account Apache is running as has the permissions required to perform that copy. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] continue execution after end of document?
Hi, I'm looking for a way to execute several time consuming PHP commands without the need for the user to wait until the entire script is finished. So I'd like to know if it's possible to send an end-of-document to the user but not the end of the script. These commands do not produce any output (normally) so there's no need for the user to wait for them. Can this be done somehow? Cheers, Bob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache query error affecting PHP?
Hello... I'm wondering if I have found an oddity in httpd. I'm currently writing a PHP directory listing system. I am pretty sure that this is not a php issue, but I have not been able to test it on a httpd install sans php, but it can be seen when requesting an image file, which should not invoke the PHP parser. So here it is, if you try hitting the URL: http://www.anapraxis.com/assets/global/en_solutions.gif?element=../../../ Or if you would like to see it on the httpd site: http://httpd.apache.org/images/httpd_logo_wide.gif?element=../../ Apache will actually return the directory listing of the assets/ directory (assuming you have directory listing enabled, otherwise it returns the standard forbidden error). It does not seem to matter what the actual variable name following the ? is. However, shouldn't apache ignore anything following the ? as it should really just be a part of the query string variables? This really seems to be buggering my attempt at passing directories in variables, but it seems that a lot of scripts must do this, am I just doing something stupid? Thanks, Wes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache query error affecting PHP?
Weston Houghton [EMAIL PROTECTED] wrote: Apache will actually return the directory listing of the assets/ directory (assuming you have directory listing enabled, otherwise it returns the standard forbidden error). It does not seem to matter what the actual variable name following the ? is. However, Both URLs display the images as expected from here. shouldn't apache ignore anything following the ? as it should really just be a part of the query string variables? If you are requesting a static resource (e.g. an image file) Apache will ignore the query string. This really seems to be buggering my attempt at passing directories in variables, but it seems that a lot of scripts must do this, am I just doing something stupid? I gave the same answer when you asked on the httpd mailing list. Have I misunderstood your problem? -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session's is slowing the page ??
Login page: // suppose that user login was verified // Following code have to be executed only if user is valid session_start(); session_register(user,user_email);//register here all needed data. //In this case, it will register $user and $user_email in the session Put the following in session.inc and include session.inc on top of each script that has to be run for logged users session_readonly(); if((!session_is_registered(user)) || (!session_is_registered(user_email))) header(Location: login.php); This will redirect user to the login page if not logged in. If he was logged, script will go on and you can access $user and $user_email. Any change of their value will not be saved in the session Tom PS: in my PHP version 4.04 , function session_readonly() is unknown. What I use instead is: session_start(); session_write_close(); //session_end is also unknown by 4.0.4 Dima Dubin wrote: Hello Tom I looked in the manual for session_readonly because its basicly what I need : 1 login page, and the just read the session data in other pages but, there is no examples or anything like that in the manual could you please show me a little example how to use it on my pages ? THANKS !! Dima. Tom Mikulecky [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi PHP's sessions are blocking, i.e. until a session is closed, all other calls to session_start() are pending. If you don't close a session explicitely, it remains opened until the script is terminated. The solution is to close a session as soon as possible (session_write_close) or use non-blocking read-only sessions (session_readonly instead of session_start) in case you don't need to modify registered variables. Tom Dima Dubin wrote: Hello, I have very wierd problem : I use session to manage users and I have this structure of the page : - include(db.php); include(header.php); bla bla include(footer.php); - in the db.php I have : session_start(); #some mysql connect stuff I use session with the $_SESSION array (cheking if registered[isset($_S...)] and registering...) and all work fine but sometimes the page loading is very very very slow (and its a really really fast host) and when I removing session_start(); from the top of the page, the page load normaly. the PHP version is 4.1.1, someone have an idea ? thanks in advance, Dima.
Re: [PHP] PHP script and external C program
- Original Message - From: John Holmes [EMAIL PROTECTED] To: 'ing.Martin Prek' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, May 27, 2002 8:28 PM Subject: RE: [PHP] PHP script and external C program I don't have example code, but what you want is the exec() function. Be careful passing user variables to a command line program. In PHP docs it seems,that exec() does not solve my problem . It is easy to grab output of mycomand to an array, but it seems , that there is no way to feed mycommands STDIN with something, ie commandline is only way to pass some argument or data for mycomand. I need something like this hypotetical example: /bin/mycommand $variable $parsed_variable or $variable | /bin/mycommand | $parsed_variable -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() source code
When mail() sends, via sendmail, an e-mail to an invalid address, it's returned to the envelope-sender (e.g.: the ISP), NOT returned to the from address, or the return-path address, etc. that are included with mail()'s 4th parameter. I'm planning to write a modified mail() to include the true return-path. In order to do so, I need to communicate directly with sendmail and, in my newbie's opinion, a good start would be to review the source code of the mail(). Where can I find it? Thank you! Anthony F. Rodriguez ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP script and external C program
http://www.php.net/popen Process Handling. - Original Message - From: John Holmes [EMAIL PROTECTED] To: 'ing.Martin Prá¹ek' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, May 27, 2002 8:28 PM Subject: RE: [PHP] PHP script and external C program I don't have example code, but what you want is the exec() function. Be careful passing user variables to a command line program. In PHP docs it seems,that exec() does not solve my problem . It is easy to grab output of mycomand to an array, but it seems , that there is no way to feed mycommands STDIN with something, ie commandline is only way to pass some argument or data for mycomand. I need something like this hypotetical example: /bin/mycommand $variable $parsed_variable or $variable | /bin/mycommand | $parsed_variable -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() source code
Anthony Rodriguez [EMAIL PROTECTED] wrote: I'm planning to write a modified mail() to include the true return-path. In order to do so, I need to communicate directly with sendmail and, in my newbie's opinion, a good start would be to review the source code of the mail(). Before you do that you might want to look at what is already available. Have a Google or at least look at the following resources... http://www.zend.com/codex.php?CID=11 http://www.phpclasses.org/ In other words, this particular wheel already exists! -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session's is slowing the page ??
Hi Tom Thanks for your help but the problem still happens :-( First I tried to use session_readonly() but it was unknown FUNC` in my php, then I try the second way : I have header.php footer.php in the header I use session_start(); and in the footer I use session_write_close() and still every minute the site freezes. Is there any other way ? I really need to use these session's... thanks again for your great help, Dima. Tom Mikulecky [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Login page: // suppose that user login was verified // Following code have to be executed only if user is valid session_start(); session_register(user,user_email);//register here all needed data. //In this case, it will register $user and $user_email in the session Put the following in session.inc and include session.inc on top of each script that has to be run for logged users session_readonly(); if((!session_is_registered(user)) || (!session_is_registered(user_email))) header(Location: login.php); This will redirect user to the login page if not logged in. If he was logged, script will go on and you can access $user and $user_email. Any change of their value will not be saved in the session Tom PS: in my PHP version 4.04 , function session_readonly() is unknown. What I use instead is: session_start(); session_write_close(); //session_end is also unknown by 4.0.4 Dima Dubin wrote: Hello Tom I looked in the manual for session_readonly because its basicly what I need : 1 login page, and the just read the session data in other pages but, there is no examples or anything like that in the manual could you please show me a little example how to use it on my pages ? THANKS !! Dima. Tom Mikulecky [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi PHP's sessions are blocking, i.e. until a session is closed, all other calls to session_start() are pending. If you don't close a session explicitely, it remains opened until the script is terminated. The solution is to close a session as soon as possible (session_write_close) or use non-blocking read-only sessions (session_readonly instead of session_start) in case you don't need to modify registered variables. Tom Dima Dubin wrote: Hello, I have very wierd problem : I use session to manage users and I have this structure of the page : - include(db.php); include(header.php); bla bla include(footer.php); - in the db.php I have : session_start(); #some mysql connect stuff I use session with the $_SESSION array (cheking if registered[isset($_S...)] and registering...) and all work fine but sometimes the page loading is very very very slow (and its a really really fast host) and when I removing session_start(); from the top of the page, the page load normaly. the PHP version is 4.1.1, someone have an idea ? thanks in advance, Dima. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache query error affecting PHP?
How silly of me not to think of this problem in the first place. It is not an error in the server, but in the browser. I didn't bother testing it in any other browser initially. So this problem only occurs in MSIE 5.1.4 under MacOS X. Ugh, thank you for showing I am somewhat silly in this one (but not fully crazy). Now I have to try to convince Microsoft that they have a bug... ooh fun. Thanks for the reply here, it seems my mail from the apache list is not coming through, so I hadn't seen the response there. Cheers, Wes Weston Houghton [EMAIL PROTECTED] wrote: Apache will actually return the directory listing of the assets/ directory (assuming you have directory listing enabled, otherwise it returns the standard forbidden error). It does not seem to matter what the actual variable name following the ? is. However, Both URLs display the images as expected from here. shouldn't apache ignore anything following the ? as it should really just be a part of the query string variables? If you are requesting a static resource (e.g. an image file) Apache will ignore the query string. This really seems to be buggering my attempt at passing directories in variables, but it seems that a lot of scripts must do this, am I just doing something stupid? I gave the same answer when you asked on the httpd mailing list. Have I misunderstood your problem? -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I remove the last character from a one line file?
Hi all, How can I remove the last character from a one line file? i.e. I need to change Jacko to Jack I would really appreciate a response on this! Thank you! Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I remove the last character from a one line file?
Try: $string=Jacko; $string=substr($string,0,(strlen($string)-1)); echo $string; ed At 09:35 AM 5/28/2002 -0400, [EMAIL PROTECTED] wrote: Hi all, How can I remove the last character from a one line file? i.e. I need to change Jacko to Jack I would really appreciate a response on this! Thank you! Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Edmund Gorski Programmer / Analyst WWW Coordinator Dept. @ District Office 727-341-3181 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Efficient PHP
Anyone know any good links on papers/articles/reports on creating efficient PHP scripts (ie functions to stay away from, good practices, etc). As a C programmer, I am a nut on efficiency and speed and I have been trying to read up on efficient PHP coding practices (besides obvious general coding practices). So can anyone offer any links or experiences? ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Efficient PHP
One thing that springs to mind was something Sterling Hughes said at the PHP Conference in Frankfurt last year: If speed is an issue don't use objects, cos at the moment the oo implementation isn't particularly efficient, although it was something that would be addressed soon. Actually, for all I know this may have been addressed already... Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Ed Gorski [mailto:[EMAIL PROTECTED]] Sent: 28 May 2002 14:46 To: [EMAIL PROTECTED] Subject: [PHP] Efficient PHP Anyone know any good links on papers/articles/reports on creating efficient PHP scripts (ie functions to stay away from, good practices, etc). As a C programmer, I am a nut on efficiency and speed and I have been trying to read up on efficient PHP coding practices (besides obvious general coding practices). So can anyone offer any links or experiences? ed -- 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] Efficient PHP
Yeah I've heard that they've made improvements in the oo code but I usually stay away from them on principle. Thanks for the reply, Ed At 02:54 PM 5/28/2002 +0100, Richard Black wrote: One thing that springs to mind was something Sterling Hughes said at the PHP Conference in Frankfurt last year: If speed is an issue don't use objects, cos at the moment the oo implementation isn't particularly efficient, although it was something that would be addressed soon. Actually, for all I know this may have been addressed already... Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Ed Gorski [mailto:[EMAIL PROTECTED]] Sent: 28 May 2002 14:46 To: [EMAIL PROTECTED] Subject: [PHP] Efficient PHP Anyone know any good links on papers/articles/reports on creating efficient PHP scripts (ie functions to stay away from, good practices, etc). As a C programmer, I am a nut on efficiency and speed and I have been trying to read up on efficient PHP coding practices (besides obvious general coding practices). So can anyone offer any links or experiences? ed -- 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] Previous Discussions
Is anyone aware of previous discussions with php/mysql with using file inside the db (BLOBs) and integrating php to serve these files? In my opinion, I'm sure there's a better way than store to a temp file and send user the hyperlink, then deleting the temp file. Perhaps something with output buffering, etc. I'm sure this topic has come up before, but I have been unable to find any relevant information. Thank you for your help Dan VandeMore -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Server error when executing mail() function
Hi, I keep getting a 'Server Error' when executing the mail() function. I thought the problem was the SMTP server in php.ini, so I've tried several alternatives (including my Outlook smtp and free smtp servers). I'm starting to think that it's not that that's causing the problem. Is there anything else that can cause the same error? Info: OS: Win98 PHP Version: 4.1.2 Web Server: Apache/1.3.6 (Win32) Browser: MSIE 6.0 Regards, Paul Cuthbertson.
Re: [PHP] Previous Discussions
You want to try to stay away from storing anything so large in a DB like a file or an image (if the option exists). I am not aware of the previous discussion but if you send me a few details maybe I can offer an opinion.. ed At 07:54 AM 5/28/2002 -0600, Dan Vande More wrote: Is anyone aware of previous discussions with php/mysql with using file inside the db (BLOBs) and integrating php to serve these files? In my opinion, I'm sure there's a better way than store to a temp file and send user the hyperlink, then deleting the temp file. Perhaps something with output buffering, etc. I'm sure this topic has come up before, but I have been unable to find any relevant information. Thank you for your help Dan VandeMore -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session's is slowing the page ??
Hat you do is the same as if you do nothing, because your session_write_close() is called near the end of script and sessions are automatically closed at the end of a script. You should 'copy' all needed variables from the session in your header.php like this: session_start(); $copy_user = $user;//if $user and $user_email are session data $copy_user_email = $user_email; session_write_close();//or session_end() if your php knows it That way you can access $copy_* in the body instead of session variables. It works as readonly access to session data Tom Dima Dubin wrote: Hi Tom Thanks for your help but the problem still happens :-( First I tried to use session_readonly() but it was unknown FUNC` in my php, then I try the second way : I have header.php footer.php in the header I use session_start(); and in the footer I use session_write_close() and still every minute the site freezes. Is there any other way ? I really need to use these session's... thanks again for your great help, Dima.
RE: [PHP] Previous Discussions
Title: RE: [PHP] Previous Discussions Is anyone aware of previous discussions with php/mysql with using file inside the db (BLOBs) and integrating php to serve these files? In my opinion, I'm sure there's a better way than store to a temp file and send user the hyperlink, then deleting the temp file. Perhaps something with output buffering, etc. Regardless of whether this is a good idea or not, it's fairly easy. Store the file data itself (accessible via fopen($whatever)) in a longblob, then write it back with the appropriate headers (Content-type: iamge/jpeg or whatever) when the time comes. I'd be happy to provide examples if anyone is curious. Regards, Ian Samuel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Previous Discussions
Hey thanks Ian! Could I have some examples, of say a pdf or zip? It looks like this will work perfectly! Dan -Original Message- From: Ian Samuel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 9:00 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Previous Discussions Is anyone aware of previous discussions with php/mysql with using file inside the db (BLOBs) and integrating php to serve these files? In my opinion, I'm sure there's a better way than store to a temp file and send user the hyperlink, then deleting the temp file. Perhaps something with output buffering, etc. Regardless of whether this is a good idea or not, it's fairly easy. Store the file data itself (accessible via fopen($whatever)) in a longblob, then write it back with the appropriate headers (Content-type: iamge/jpeg or whatever) when the time comes. I'd be happy to provide examples if anyone is curious. Regards, Ian Samuel
Re: [PHP] Server error when executing mail() function
Is 'Server Error' all you get? If there's more, please post the whole error message. ;-) thanks! tyler - Original Message - From: Paul Cuthbertson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 9:06 AM Subject: [PHP] Server error when executing mail() function Hi, I keep getting a 'Server Error' when executing the mail() function. I thought the problem was the SMTP server in php.ini, so I've tried several alternatives (including my Outlook smtp and free smtp servers). I'm starting to think that it's not that that's causing the problem. Is there anything else that can cause the same error? Info: OS: Win98 PHP Version: 4.1.2 Web Server: Apache/1.3.6 (Win32) Browser: MSIE 6.0 Regards, Paul Cuthbertson. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] browscap.ini
Hi Has anyone got an up to date browscap.ini-file or does someone know where to get one? The most up to date browscap I found got it's last update in October 9, 2001 - since then a lot new browser appeared... best regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session's is slowing the page ??
THANK YOU !!! Tom Mikulecky [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hat you do is the same as if you do nothing, because your session_write_close() is called near the end of script and sessions are automatically closed at the end of a script. You should 'copy' all needed variables from the session in your header.php like this: session_start(); $copy_user = $user;//if $user and $user_email are session data $copy_user_email = $user_email; session_write_close();//or session_end() if your php knows it That way you can access $copy_* in the body instead of session variables. It works as readonly access to session data Tom Dima Dubin wrote: Hi Tom Thanks for your help but the problem still happens :-( First I tried to use session_readonly() but it was unknown FUNC` in my php, then I try the second way : I have header.php footer.php in the header I use session_start(); and in the footer I use session_write_close() and still every minute the site freezes. Is there any other way ? I really need to use these session's... thanks again for your great help, Dima. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server error when executing mail() function
I'm afraid all I get is: Warning: Server Error in d:\htdocs\scriptname.php on line 19 Line 19 being the mail() command. The script works fine on a different server. Any Ideas? Paul. - Original Message - From: Tyler Longren [EMAIL PROTECTED] To: Paul Cuthbertson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: 28 May 2002 16:14 Subject: Re: [PHP] Server error when executing mail() function Is 'Server Error' all you get? If there's more, please post the whole error message. ;-) thanks! tyler - Original Message - From: Paul Cuthbertson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 9:06 AM Subject: [PHP] Server error when executing mail() function Hi, I keep getting a 'Server Error' when executing the mail() function. I thought the problem was the SMTP server in php.ini, so I've tried several alternatives (including my Outlook smtp and free smtp servers). I'm starting to think that it's not that that's causing the problem. Is there anything else that can cause the same error? Info: OS: Win98 PHP Version: 4.1.2 Web Server: Apache/1.3.6 (Win32) Browser: MSIE 6.0 Regards, Paul Cuthbertson.
Re: [PHP] browscap.ini
I found this in the PHP FAQ: http://www.cyscape.com/browscap/ http://www.php.net/manual/en/faq.obtaining.php Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: Stefan Rusterholz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 10:15 AM Subject: [PHP] browscap.ini Hi Has anyone got an up to date browscap.ini-file or does someone know where to get one? The most up to date browscap I found got it's last update in October 9, 2001 - since then a lot new browser appeared... best regards Stefan Rusterholz -- 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] Server error when executing mail() function
Try this thread on phpbuilder.com: http://www.phpbuilder.com/forum/read.php3?num=4id=6681loc=0thread=6681 One person suggests using fewer headers as windows can be picky about which headers you're trying to send with your e-mail. Good luck, Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: Paul Cuthbertson To: [EMAIL PROTECTED] ; Tyler Longren Sent: Tuesday, May 28, 2002 10:27 AM Subject: Re: [PHP] Server error when executing mail() function I'm afraid all I get is: Warning: Server Error in d:\htdocs\scriptname.php on line 19 Line 19 being the mail() command. The script works fine on a different server. Any Ideas? Paul. - Original Message - From: Tyler Longren [EMAIL PROTECTED] To: Paul Cuthbertson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: 28 May 2002 16:14 Subject: Re: [PHP] Server error when executing mail() function Is 'Server Error' all you get? If there's more, please post the whole error message. ;-) thanks! tyler - Original Message - From: Paul Cuthbertson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 9:06 AM Subject: [PHP] Server error when executing mail() function Hi, I keep getting a 'Server Error' when executing the mail() function. I thought the problem was the SMTP server in php.ini, so I've tried several alternatives (including my Outlook smtp and free smtp servers). I'm starting to think that it's not that that's causing the problem. Is there anything else that can cause the same error? Info: OS: Win98 PHP Version: 4.1.2 Web Server: Apache/1.3.6 (Win32) Browser: MSIE 6.0 Regards, Paul Cuthbertson. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cannot add header infomation
Hello, Anyone in the mood to help someone who doesn't really know what they are doing when it comes to PHP? I am tring to get NoCC Mail to work http://nocc.sourceforge.net/ on my website, and keep getting the warning, Warning: Cannot add header information - headers already sent by (output started at D:\Inetpub\wwwroot\imap\noccmail\conf.php:203) in D:\Inetpub\wwwroot\imap\noccmail\index.php on line 14 Warning: Cannot add header information - headers already sent by (output started at D:\Inetpub\wwwroot\imap\noccmail\conf.php:203) in D:\Inetpub\wwwroot\imap\noccmail\html\header.php on line 3 I am useing PHP 4.2.1 If you need any more infomation, let me know.. As I said i'm new at this.. Drew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot add header infomation
Those errors mean that PHP is trying to send headers to the browser after something has already been made viewable in the browser. Make sure that the header() functions are being used before anything gets output to the browser. Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: Drew Boillot [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 10:26 AM Subject: [PHP] Cannot add header infomation Hello, Anyone in the mood to help someone who doesn't really know what they are doing when it comes to PHP? I am tring to get NoCC Mail to work http://nocc.sourceforge.net/ on my website, and keep getting the warning, Warning: Cannot add header information - headers already sent by (output started at D:\Inetpub\wwwroot\imap\noccmail\conf.php:203) in D:\Inetpub\wwwroot\imap\noccmail\index.php on line 14 Warning: Cannot add header information - headers already sent by (output started at D:\Inetpub\wwwroot\imap\noccmail\conf.php:203) in D:\Inetpub\wwwroot\imap\noccmail\html\header.php on line 3 I am useing PHP 4.2.1 If you need any more infomation, let me know.. As I said i'm new at this.. Drew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Validating forms and showing errors
Hello, On 05/27/2002 02:19 AM, Victor Boivie wrote: Hi everybody, This might be a RTFM or STFW-question, but I haven't found it. I want to validate a form (in page1.php) to check if the user has entered a correct email-adress and more, and if he needs to correct some fields, I'd like to display the form again with all correct values filled in and the incorrect fields hightlighted. You may want to try this class that is meant precisely for that: http://www.phpclasses.org/formsgeneration To make it a bit more difficult I've decided to POST to another file (post.php) which validates the information and redirects the user (with Header - Location) to page1.php if he has to correct the errors. If the form is correctly filled in then he will be redirected to page2.php. This is to prevent the browser for asking him if he wants to repost data if he hits Actually that does not prevent it. There are more robust way to prevent undesirable effects of form reposting. It depends what effects you want to avoid. 'Refresh'. Now I want to know how to pass information from post.php to page1.php since the form page (page1) needs to know what was incorrect and what was correct so that it can hightlight the bad fields. I don't want to stick it in the URL since it would be too ugly, but I do have session variables I can stick them in. Is this the way to go? Or is there a better solution? I would not bother to do that. I just make the script form generation, validation and processing be the same and your life will be much easier. -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server error when executing mail() function
Firstly, thank you for the continued help. Unfortunately I just tried this: ? mail ([EMAIL PROTECTED], Test, Testing); ? ..and the error still occurred. The error appears immediately, as if it's not even trying to connect to anything. Paul. - Original Message - From: Tyler Longren [EMAIL PROTECTED] To: Paul Cuthbertson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: 28 May 2002 16:34 Subject: Re: [PHP] Server error when executing mail() function Try this thread on phpbuilder.com: http://www.phpbuilder.com/forum/read.php3?num=4id=6681loc=0thread=6681 One person suggests using fewer headers as windows can be picky about which headers you're trying to send with your e-mail. Good luck, Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: Paul Cuthbertson To: [EMAIL PROTECTED] ; Tyler Longren Sent: Tuesday, May 28, 2002 10:27 AM Subject: Re: [PHP] Server error when executing mail() function I'm afraid all I get is: Warning: Server Error in d:\htdocs\scriptname.php on line 19 Line 19 being the mail() command. The script works fine on a different server. Any Ideas? Paul. - Original Message - From: Tyler Longren [EMAIL PROTECTED] To: Paul Cuthbertson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: 28 May 2002 16:14 Subject: Re: [PHP] Server error when executing mail() function Is 'Server Error' all you get? If there's more, please post the whole error message. ;-) thanks! tyler - Original Message - From: Paul Cuthbertson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 9:06 AM Subject: [PHP] Server error when executing mail() function Hi, I keep getting a 'Server Error' when executing the mail() function. I thought the problem was the SMTP server in php.ini, so I've tried several alternatives (including my Outlook smtp and free smtp servers). I'm starting to think that it's not that that's causing the problem. Is there anything else that can cause the same error? Info: OS: Win98 PHP Version: 4.1.2 Web Server: Apache/1.3.6 (Win32) Browser: MSIE 6.0 Regards, Paul Cuthbertson. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 'ucfirst' function for text area strings?
Is there a way to get a function similar to 'ucfirst' to work with the first letters of a set of strings in textarea strings? ** Inputted strings: hi. i hope there is one. any ideas? Should appear: Hi. I hope there is one. Any ideas? ** Would it be possible to do a 'foreach' 'ucfirst' type of statement while reading a string and breaking it apart at punctuation marks? Any suggestions will be greatly appreciated. This one's got me stumped. Tia, Andre -- Please pray the Holy Rosary to end the holocaust of abortion. Remember in your prayers the Holy Souls in Purgatory. May God bless you abundantly in His love! For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] browscap.ini
Hi Sorry, but this one is pretty old, an excerpt from the website: browscap.ini download Current version: 2.5 Last updated: February 2000 Download size: 14 KB February 2000 I took the following: http://asp.net.do/browscap.zip (found in the user-comments for get_browser()) It's from October 2001. But that's still not new enough... Am Dienstag den, 28. Mai 2002, um 17:31, schrieb Tyler Longren: I found this in the PHP FAQ: http://www.cyscape.com/browscap/ http://www.php.net/manual/en/faq.obtaining.php Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: Stefan Rusterholz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 10:15 AM Subject: [PHP] browscap.ini Hi Has anyone got an up to date browscap.ini-file or does someone know where to get one? The most up to date browscap I found got it's last update in October 9, 2001 - since then a lot new browser appeared... best regards Stefan Rusterholz -- 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] Server error when executing mail() function
I was having this same problem a few weeks ago and ended up giving up. After reading the response about the headers i decided to try it. If i call this it works: mail($recipient, $subject); If i call this is gets the server error msg: mail($recipient, $subject, $headers); In that case their are like 10 headers but none of them are ended properly with CRLF. Hope this helps -Jared -Original Message- From: Paul Cuthbertson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 11:49 AM To: Tyler Longren; [EMAIL PROTECTED] Subject: Re: [PHP] Server error when executing mail() function Firstly, thank you for the continued help. Unfortunately I just tried this: ? mail ([EMAIL PROTECTED], Test, Testing); ? ..and the error still occurred. The error appears immediately, as if it's not even trying to connect to anything. Paul. - Original Message - From: Tyler Longren [EMAIL PROTECTED] To: Paul Cuthbertson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: 28 May 2002 16:34 Subject: Re: [PHP] Server error when executing mail() function Try this thread on phpbuilder.com: http://www.phpbuilder.com/forum/read.php3?num=4id=6681loc=0thread=6681 One person suggests using fewer headers as windows can be picky about which headers you're trying to send with your e-mail. Good luck, Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: Paul Cuthbertson To: [EMAIL PROTECTED] ; Tyler Longren Sent: Tuesday, May 28, 2002 10:27 AM Subject: Re: [PHP] Server error when executing mail() function I'm afraid all I get is: Warning: Server Error in d:\htdocs\scriptname.php on line 19 Line 19 being the mail() command. The script works fine on a different server. Any Ideas? Paul. - Original Message - From: Tyler Longren [EMAIL PROTECTED] To: Paul Cuthbertson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: 28 May 2002 16:14 Subject: Re: [PHP] Server error when executing mail() function Is 'Server Error' all you get? If there's more, please post the whole error message. ;-) thanks! tyler - Original Message - From: Paul Cuthbertson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 9:06 AM Subject: [PHP] Server error when executing mail() function Hi, I keep getting a 'Server Error' when executing the mail() function. I thought the problem was the SMTP server in php.ini, so I've tried several alternatives (including my Outlook smtp and free smtp servers). I'm starting to think that it's not that that's causing the problem. Is there anything else that can cause the same error? Info: OS: Win98 PHP Version: 4.1.2 Web Server: Apache/1.3.6 (Win32) Browser: MSIE 6.0 Regards, Paul Cuthbertson. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: imagettftext question
Ziying Sherwin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In our application, we need to write a UTF8 strings to the image using True Type fonts. The php function that we are using is imagettftext. However, we have the two problems regarding that function: 1. The images that are generated by this function is white fonts on the black background. But what we want is black fonts on the white background. It seems impossible to set the background color. What we are doing now is to call external commands to reverse the color which is rather slow. Is there better way to achieve the same result? How about this example: var $width = 200; var $height = 50; var $offset_x = 0; var $offset_y = 10; var $font = '/usr/share/fonts/times.ttf'; //default font. var $msg = Hello!; var $size = 24; var $rot = 0; // rotation in degrees. var $transparent = 1; // transparency set to on. var $red = 0; // black text... var $grn = 0; var $blu = 0; var $bg_red = 255; // on white background. var $bg_grn = 255; var $bg_blu = 255; var $truecolor = false; if($truecolor) { $image = ImageCreateTrueColor($width,$height); $background = ImageColorResolveAlpha($image, $bg_red, $bg_grn, $bg_blu, $transparent?127:0); $foreground = ImageColorAllocate($image, $red, $grn, $blu); ImageFilledRectangle($image, 0, 0, $width, $height, $background); } else { $image = ImageCreate($width, $height); $background = ImageColorAllocate($image, $bg_red, $bg_grn, $bg_blu); if($transparent) ImageColorTransparent($image, $background); ImageFilledRectangle($image, 0, 0, $width, $height, $background); $foreground = ImageColorAllocate($image, $red, $grn, $blu); } ImageTTFText($image, $size, $rot, $offset_x, $offset_y, $foreground, $font, $msg); Header(Content-type: image/png); ImagePNG($image); 2. We also have long UTF8 stings that need to be broken into several lines. Which php function has the ability to properly break UTF8 strings? And how to display multiple lines using imagettftext? I guess you have to develop an algorithm do line breaks your self ImageTTFBBox() should provide you with data to make it possible. -- Stellan Klebom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Server error when executing mail() function
Hello, On 05/28/2002 11:06 AM, Paul Cuthbertson wrote: Hi, I keep getting a 'Server Error' when executing the mail() function. I thought the problem was the SMTP server in php.ini, so I've tried several alternatives (including my Outlook smtp and free smtp servers). I'm starting to think that it's not that that's causing the problem. Is there anything else that can cause the same error? Info: OS: Win98 PHP Version: 4.1.2 Web Server: Apache/1.3.6 (Win32) Browser: MSIE 6.0 If the SMTP server is on a different machine, most likely your server requires authentication. Anyway, to see exactly what is going on, you may want to try this SMTP client class for sending messages eventually to servers that require authentication, just enable debug to see exactly why messages are being rejected: http://www.phpclasses.org/smtpclass -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Server error when executing mail() function
Hello, On 05/28/2002 11:06 AM, Paul Cuthbertson wrote: Hi, I keep getting a 'Server Error' when executing the mail() function. I thought the problem was the SMTP server in php.ini, so I've tried several alternatives (including my Outlook smtp and free smtp servers). I'm starting to think that it's not that that's causing the problem. Is there anything else that can cause the same error? Info: OS: Win98 PHP Version: 4.1.2 Web Server: Apache/1.3.6 (Win32) Browser: MSIE 6.0 If the SMTP server is on a different machine, most likely your server requires authentication. Anyway, to see exactly what is going on, you may want to try this SMTP client class for sending messages eventually to servers that require authentication, just enable debug to see exactly why messages are being rejected: http://www.phpclasses.org/smtpclass -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Efficient PHP
-Original Message- From: Ed Gorski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 9:46 AM To: [EMAIL PROTECTED] Subject: [PHP] Efficient PHP Anyone know any good links on papers/articles/reports on creating efficient PHP scripts (ie functions to stay away from, good practices, etc). As a C programmer, I am a nut on efficiency and speed and I have been trying to read up on efficient PHP coding practices (besides obvious general coding practices). So can anyone offer any links or experiences? ed Depends what kind of efficiency you are looking for, and the type of application you're writing. Personally, i've always taken the view that my time is worth a lot more than the CPU's time (unless i'm writing a speed-critical app, which is not very often :), so i code for human efficiency and ease of maintenence, even if the code is a little bit slower than heavily optimized code. --- Scott Hurring Systems Programmer EAC Corporation [EMAIL PROTECTED] Voice: 201-462-2149 Fax: 201-288-1515 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can I remove the last character from a one line file?
TIMTOWTDI $string = Jacko; print preg_replace('/.$/', '', $string); --- Scott Hurring Systems Programmer EAC Corporation [EMAIL PROTECTED] Voice: 201-462-2149 Fax: 201-288-1515 -Original Message- From: Ed Gorski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 9:41 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] How can I remove the last character from a one line file? Try: $string=Jacko; $string=substr($string,0,(strlen($string)-1)); echo $string; ed At 09:35 AM 5/28/2002 -0400, [EMAIL PROTECTED] wrote: Hi all, How can I remove the last character from a one line file? i.e. I need to change Jacko to Jack I would really appreciate a response on this! Thank you! Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Edmund Gorski Programmer / Analyst WWW Coordinator Dept. @ District Office 727-341-3181 -- 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 can I remove the last character from a one line file?
Ouch! echo substr($string,0,-1); is much more efficient. -Rasmus On Tue, 28 May 2002, Scott Hurring wrote: TIMTOWTDI $string = Jacko; print preg_replace('/.$/', '', $string); --- Scott Hurring Systems Programmer EAC Corporation [EMAIL PROTECTED] Voice: 201-462-2149 Fax: 201-288-1515 -Original Message- From: Ed Gorski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 9:41 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] How can I remove the last character from a one line file? Try: $string=Jacko; $string=substr($string,0,(strlen($string)-1)); echo $string; ed At 09:35 AM 5/28/2002 -0400, [EMAIL PROTECTED] wrote: Hi all, How can I remove the last character from a one line file? i.e. I need to change Jacko to Jack I would really appreciate a response on this! Thank you! Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Edmund Gorski Programmer / Analyst WWW Coordinator Dept. @ District Office 727-341-3181 -- 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] How can I remove the last character from a one line file?
Or just: $string = Jacko; $string = substr( $string, 0, -1 ); echo $string; The third argument to substr() means 'one character from the end', see http://www.php.net/manual/en/function.substr.php - Kev -Original Message- From: Ed Gorski [SMTP:[EMAIL PROTECTED]] Sent: 28 May 2002 14:41 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] How can I remove the last character from a one line file? Try: $string=Jacko; $string=substr($string,0,(strlen($string)-1)); echo $string; ed At 09:35 AM 5/28/2002 -0400, [EMAIL PROTECTED] wrote: Hi all, How can I remove the last character from a one line file? i.e. I need to change Jacko to Jack I would really appreciate a response on this! Thank you! Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Edmund Gorski Programmer / Analyst WWW Coordinator Dept. @ District Office 727-341-3181 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Efficient PHP
Well I work for a college with some 49,000+ students so my primary concern with all those users is efficient memory and processor usage. You'd be surprised how easily a few ten's of thousands of users can bring an application server to it's knees if you have a bottleneck or two that you can avoid.. ed At 12:32 PM 5/28/2002 -0400, Scott Hurring wrote: -Original Message- From: Ed Gorski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 9:46 AM To: [EMAIL PROTECTED] Subject: [PHP] Efficient PHP Anyone know any good links on papers/articles/reports on creating efficient PHP scripts (ie functions to stay away from, good practices, etc). As a C programmer, I am a nut on efficiency and speed and I have been trying to read up on efficient PHP coding practices (besides obvious general coding practices). So can anyone offer any links or experiences? ed Depends what kind of efficiency you are looking for, and the type of application you're writing. Personally, i've always taken the view that my time is worth a lot more than the CPU's time (unless i'm writing a speed-critical app, which is not very often :), so i code for human efficiency and ease of maintenence, even if the code is a little bit slower than heavily optimized code. --- Scott Hurring Systems Programmer EAC Corporation [EMAIL PROTECTED] Voice: 201-462-2149 Fax: 201-288-1515 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail() function
Hello, On 05/27/2002 04:38 PM, Jochem Kempe wrote: It appears to me that there is something wrong with the mail() function, I've got an Apache 2.0.36 webserver in an Windows XP environment, now everythin seems to work just fine until I try to execute this: mail([EMAIL PROTECTED], My Subject, Line 1\r\nLine 2\r\nLine3); it's almost the same code as on your web site but I changed the [EMAIL PROTECTED] to my own e-mail adress so I would be able to see if I've got the mail. I tried severeal ways (somethin with IMAP or such?) but since I'm a php newbie it is quite hard to find understandable documentation. You're message is probably being rejected and is not bouncing. Anyway, you may want to try this SMTP client class to try to see if the message gets delivered: http://www.phpclasses.org/smtpclass -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Thread safe
I'm not sure if it's atomic, but (AFAIK) you can do something like this with Mysql: UPDATE table SET field=field+1 where . --- Scott Hurring Systems Programmer EAC Corporation [EMAIL PROTECTED] Voice: 201-462-2149 Fax: 201-288-1515 -Original Message- From: J Smith [mailto:[EMAIL PROTECTED]] Sent: Monday, May 27, 2002 12:49 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Thread safe You could use a transaction block if your database supports it, or just use some sort of auto-numbering field, such as SERIAL in Postgres, auto_increment in MySQL, etc. Then you wouldn't have to worry about retrieving the next cno before inserting a new row. J R wrote: Hi, In java servlets I used to use a synchronised block of code to make sure it was thread safe...how do i do this in PHP? Heres what should be thread safe { $r=select max(cno)+1 from MyTable; (then i insert into the table the new cno plus my name) insert into mytable ($r,'myname'); } How to do this and make sure its thread safe? Any help appreciated, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail() source code
Hello, On 05/28/2002 08:27 AM, Anthony Rodriguez wrote: When mail() sends, via sendmail, an e-mail to an invalid address, it's returned to the envelope-sender (e.g.: the ISP), NOT returned to the from address, or the return-path address, etc. that are included with mail()'s 4th parameter. The 4th parameter is not for putting headers but rather to pass arguments to sendmail. The -f argument sets the return path which is the same thing as the envelope sender. Of course this only works Unix. On Windows you need to use the sendmail_form option of php.ini -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regex Assistance
This should work for most cases: function strip_key($key, $string) { $string = preg_replace(/(|\?)($key=(\w+)?)(?)/, '$1', $string); return preg_replace('/(\?|)$/', '', $string); } print strip_key(list, yadda?bo=ralist=XXXtwo=three); print strip_key(list, yadda?bo=ralist=two=three); print strip_key(list, yadda?list=XXX); print strip_key(list, yadda?list=XXXtwo=three); print strip_key(list, yadda?no=wherelist=XXX); --- Scott Hurring Systems Programmer EAC Corporation [EMAIL PROTECTED] Voice: 201-462-2149 Fax: 201-288-1515 -Original Message- From: Scott Reismanis [mailto:[EMAIL PROTECTED]] Sent: Monday, May 27, 2002 10:00 PM To: [EMAIL PROTECTED] Subject: [PHP] Regex Assistance Hey All, I am just begining to learn regex functions in PHP. Anyhow I am trying to code a preg_replace function which basically cleans a URL. What I mean is say a url is index.php?page=hellolist=10start=4 you pass that URL and say 'list' to the function (shown below) Anyhow I want that to then return index.php?page=hellostart=4 (see how the entire list reference is now gone) Here is what I have come up with so far, though I am yet to test it as I am coding this at work :) function stripUrl($url, $url_strip) { // Check that $url_strip is in the URL if(strpos($url,'?') strpos($url, $url_strip.'=')) { // Lets clean up the url $url = preg_replace(/\?|$url_strip=/, , $url); } return $url; } My problem is that, how do I make the preg_replace stop when it encounters a in the URL? If anyone could shed some light on this it would be appreciated, - Regards, Scott -- 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] Html Books on php
Hi, I am a newbie. Could I get pointers to books on the web for PHP? Thanks for the help Natarajan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'ucfirst' function for text area strings?
On Tuesday 28 May 2002 23:58, Andre Dubuc wrote: Is there a way to get a function similar to 'ucfirst' to work with the first letters of a set of strings in textarea strings? ** Inputted strings: hi. i hope there is one. any ideas? Should appear: Hi. I hope there is one. Any ideas? ** Would it be possible to do a 'foreach' 'ucfirst' type of statement while reading a string and breaking it apart at punctuation marks? use explode() to break into sentences on whatever you deem to be a sentence boundary (period, exclamation mark, question mark, whatever). foreach() through the resulting array applying ucfirst(). Then join them all up again. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Patriotism is the virtue of the vicious. -- Oscar Wilde */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cannot add header infomation
I got it working.. Thanks to everyone that helped Drew Boillot [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, Anyone in the mood to help someone who doesn't really know what they are doing when it comes to PHP? I am tring to get NoCC Mail to work http://nocc.sourceforge.net/ on my website, and keep getting the warning, Warning: Cannot add header information - headers already sent by (output started at D:\Inetpub\wwwroot\imap\noccmail\conf.php:203) in D:\Inetpub\wwwroot\imap\noccmail\index.php on line 14 Warning: Cannot add header information - headers already sent by (output started at D:\Inetpub\wwwroot\imap\noccmail\conf.php:203) in D:\Inetpub\wwwroot\imap\noccmail\html\header.php on line 3 I am useing PHP 4.2.1 If you need any more infomation, let me know.. As I said i'm new at this.. Drew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server error when executing mail() function
Hi All, I've now fixed the problem myself. It appears as though the problem was in the 'sendmail_from' element of php.ini. Even though the address I gave on that line was a perfectly legitimate email address, once I changed it, it worked fine. The new address was longer than the old, so it wasn't a problem with the length. I have no idea why it happened, it's quite annoying that it did cos it would be loads better for me if it accepted the original one. Oh well. Cheers for all the help I received. Paul. - Original Message - From: Paul Cuthbertson To: [EMAIL PROTECTED] ; Tyler Longren Sent: Tuesday, May 28, 2002 10:27 AM Subject: Re: [PHP] Server error when executing mail() function I'm afraid all I get is: Warning: Server Error in d:\htdocs\scriptname.php on line 19 Line 19 being the mail() command. The script works fine on a different server. Any Ideas? Paul. - Original Message - From: Tyler Longren [EMAIL PROTECTED] To: Paul Cuthbertson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: 28 May 2002 16:14 Subject: Re: [PHP] Server error when executing mail() function Is 'Server Error' all you get? If there's more, please post the whole error message. ;-) thanks! tyler - Original Message - From: Paul Cuthbertson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 9:06 AM Subject: [PHP] Server error when executing mail() function Hi, I keep getting a 'Server Error' when executing the mail() function. I thought the problem was the SMTP server in php.ini, so I've tried several alternatives (including my Outlook smtp and free smtp servers). I'm starting to think that it's not that that's causing the problem. Is there anything else that can cause the same error? Info: OS: Win98 PHP Version: 4.1.2 Web Server: Apache/1.3.6 (Win32) Browser: MSIE 6.0 Regards, Paul Cuthbertson. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'ucfirst' function for text area strings?
On Tue, 28 May 2002, Andre Dubuc wrote: Is there a way to get a function similar to 'ucfirst' to work with the first letters of a set of strings in textarea strings? ** Inputted strings: hi. i hope there is one. any ideas? Should appear: Hi. I hope there is one. Any ideas? ** Would it be possible to do a 'foreach' 'ucfirst' type of statement while reading a string and breaking it apart at punctuation marks? What are you going to do about abbreviations? The General Electric Corp. was represented at the meeting. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dates
On Tue, 28 May 2002, Jeroen Timmers wrote: 2002-10-9 and 2002-11-16 Is there a function to see how many day's between thore date's is? (strtotime($date1) - strtotime($date2)) / 86400 miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Intermediate Searching... screen.
I have a part of my site that searches a large database and sometimes it takes more than a few seconds to return the results. When searches take longer, people get antsy and search again. To let them know that the search is working so they don't double efforts I'd like to have an intermediate Searching... screen. I don't have a good idea on how to do this and I'm looking for some ideas or directions. How do I show one thing while the search is running and another when the search is complete and also not loose the returned record set? -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Dates
Something like this.. $start = 2002-10-9; $end = 2002-11-16; $arStart = explode(-, $start); $arEnd = explode(-, $end); $startTime = date(U, mktime(0,0,0,$arStart[1], $arStart[2], $arStart[0])); $endTime = date(U, mktime(0,0,0,$arEnd[1], $arEnd[2], $arEnd[0])); $dif = $endTime - $startTime; // in seconds That will do it but you could simplfy it with some more advanced techniques. -Jared -Original Message- From: Jeroen Timmers [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 2:17 PM To: [EMAIL PROTECTED] Subject: [PHP] Dates i have two dates for example 2002-10-9 and 2002-11-16 Is there a function to see how many day's between thore date's is? Jeroen -- 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] Dates
PHP way: Use strtotime() to get a unix timestamp for each one. subtract smaller from larger and divide by number of seconds in a day. MySQL way: I assume these dates come from a database. Use a query like this: SELECT TO_DAYS(column_one) - TO_DAYS(column_two) AS Difference FROM table WHERE ... Then you'll have a column 'Difference' in your result that contains the difference between the two dates in days. ---John Holmes... - Original Message - From: Jeroen Timmers [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 2:16 PM Subject: [PHP] Dates i have two dates for example 2002-10-9 and 2002-11-16 Is there a function to see how many day's between thore date's is? Jeroen -- 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] 'ucfirst' function for text area strings?
Put a text box for each sentence. ---John Holmes... - Original Message - From: Miguel Cruz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 2:19 PM Subject: Re: [PHP] 'ucfirst' function for text area strings? On Tue, 28 May 2002, Andre Dubuc wrote: Is there a way to get a function similar to 'ucfirst' to work with the first letters of a set of strings in textarea strings? ** Inputted strings: hi. i hope there is one. any ideas? Should appear: Hi. I hope there is one. Any ideas? ** Would it be possible to do a 'foreach' 'ucfirst' type of statement while reading a string and breaking it apart at punctuation marks? What are you going to do about abbreviations? The General Electric Corp. was represented at the meeting. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php yes...I was just kidding. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mail() source code
On Tue, 28 May 2002, Manuel Lemos wrote: On 05/28/2002 08:27 AM, Anthony Rodriguez wrote: When mail() sends, via sendmail, an e-mail to an invalid address, it's returned to the envelope-sender (e.g.: the ISP), NOT returned to the from address, or the return-path address, etc. that are included with mail()'s 4th parameter. The 4th parameter is not for putting headers but rather to pass arguments to sendmail. That's the 5th parameter, I think. The 4th is for headers. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Intermediate Searching... screen.
Title: RE: [PHP] Intermediate Searching... screen. What you want to do is post the form, display a searching screen, and then on that same screen... well, like this, I think: form target=?= $PHP_SELF; ? input type=text name=foo input type=submit name=submit value=Submit /form ? if ($Submit) { echo Searching.br\n; go_go_gadget_query(); // above line takes a while but the aboev is already echoed so // they wait display_results(); } ? Regards, Ian Samuel -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 1:24 PM To: [EMAIL PROTECTED] Subject: [PHP] Intermediate Searching... screen. I have a part of my site that searches a large database and sometimes it takes more than a few seconds to return the results. When searches take longer, people get antsy and search again. To let them know that the search is working so they don't double efforts I'd like to have an intermediate Searching... screen. I don't have a good idea on how to do this and I'm looking for some ideas or directions. How do I show one thing while the search is running and another when the search is complete and also not loose the returned record set? -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- 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] Intermediate Searching... screen.
You could, in theory, submit your query to an intermediate file, which only displays the Searching screen, but is querying your database and throwing everything you need into hidden fields in a form. Then have that form have an onLoad submit to your results page. I did this with HTML submitting to Perl submitting to PHP until we got the PHP/DB problems worked out. Here's what I wrote: print htmlhead/headbody onload=\document.HiddenForm.submit()\ ; print Page is loading, please wait; print form name=\HiddenForm\ method=\POST\ action=\../../joinpoint/joinpoint.withimage.php\; print $hiddenData; print /form/body/html; $hiddenData contained all of the values, in hidden data form, that I was sending to my action script. Good luck! There is probably an easier way than this, but if no one else comes up with it, at least you have something. -Natalie -Original Message- From: Jeff Bearer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 2:24 PM To: Php-General (E-mail) Subject: [PHP] Intermediate Searching... screen. I have a part of my site that searches a large database and sometimes it takes more than a few seconds to return the results. When searches take longer, people get antsy and search again. To let them know that the search is working so they don't double efforts I'd like to have an intermediate Searching... screen. I don't have a good idea on how to do this and I'm looking for some ideas or directions. How do I show one thing while the search is running and another when the search is complete and also not loose the returned record set? -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- 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] Variable vs Constant
Wouldn't it be a lot easier to do that with arrays? miguel On Tue, 28 May 2002, HPS wrote: i am now working on a project which was developed by some others b4. As the project is a multi-language enabled, there is a PHP file (language file) which has all the setting , say $i_no_record_exists_msg = There is no record at the moment.; $i_no_search_result_msg = Sorry, your search yielded no results. Please revise your search query and try again.; $i_alert_pleasefillin = Please fill in the ; $i_email_to = To; $i_status_approve = Approve; $i_status_pendinguser = Pending; $i_status_publish = Publish; $i_status_checkin = Check In; . .. .. In this language file, over 500 variables are declared. And what i scare is 1. programmatically, should i change all these to CONSTANT? (coz all these values will never change) 2. if there is difference in declaring variable and constant (say, memory space required), how much harm it will ? 3. as this file would be included in the entire systemthe downside will be even more thx Billy Hugh Danaher [EMAIL PROTECTED] wrote in message 000701c20620$885cd2e0$017f@localhost">news:000701c20620$885cd2e0$017f@localhost... Billy, There must be a limit to the number of variables you can use in php but I haven't run up against a limit yet, and php seems to run as fast on my high variable count code as my more mundane code. Obviously, the advantage of using variables is that you can group your variables/constants in one area at the top of your code and when you need to change one of the constants (and you know you will need to do this eventually) you won't need to look for it in amongst your code. Not really an answer to your question but more of an observation on my part. I hope one of the more experienced will also pipe in. Good Luck Hugh - Original Message - From: Billy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 27, 2002 8:46 AM Subject: [PHP] Variable vs Constant what harm will it make if i declear a value as VARIABLE where i should make it as CONSTANT actually?? how about if i declear 100 values as VARIABLEs where all are CONSTANTs actually? thx HPS -- 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] (Unlink(file) == rm file) ? (ignore this mail):(explaindiffs);
On Tue, 28 May 2002, Jimmy Lantz wrote: (Unlink(file) == rm file) ? (ignore this mail):(explain diffs); Does PHP unlink function handle deletion of files equally as the rm command on the system in my case FreeBSD. Or does it involve caching/handling files in any different way? It just calls the OS unlink() function, which is presumably what rm does. Actually I just did a trace and that's exactly what rm does. rm of course has a whole lot of extra options, but they just affect which files it acts on. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Intermediate Searching... screen.
Search screens are a tricky prospect and none seem to work very well. However you could try one of the following techniques... Instead of the submit button initiating a search it initiates another script that displays the 'searching...' message and only after it has outputted that to the screen does it initiate the search. The last line in that script would be a redirect back to your results page. Another way to do it would be to set up a couple of Javascript functions. Echo one to open the 'searching...' screen prior to initiating the search. Then at the end of the script echo the other javascript function to close the 'searching.. ' screen. But I've implimted a version of this for an upload script and it didn't work so hot. Er.. umm.. anyone got any other bright ideas? -Kevin - Original Message - From: Jeff Bearer [EMAIL PROTECTED] To: Php-General (E-mail) [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 12:23 PM Subject: [PHP] Intermediate Searching... screen. I have a part of my site that searches a large database and sometimes it takes more than a few seconds to return the results. When searches take longer, people get antsy and search again. To let them know that the search is working so they don't double efforts I'd like to have an intermediate Searching... screen. I don't have a good idea on how to do this and I'm looking for some ideas or directions. How do I show one thing while the search is running and another when the search is complete and also not loose the returned record set? -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- 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] Imagecreate and/or GD library not activated
Hello everyone. I wrote a little code creating PNG images under Apache/PHP windows. As the code works fine, I need to transfer it onto the Linux platform. When I execute the code, PHP replies Fatal error: Call to undefined function: imagecreate(). I had libgd installed. I just added GD 1.8.4. The php.ini file says ;extension=gd.so. I removed the comma, restarted Apache. Does not work. I copied libgd.so in /etc/lib/php4 but did not change anything. Any idea? Thanks. Jean-Louis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function return
On Tue, 28 May 2002, W. Enserink wrote: I have a Q about functions. My function should return 2 values. What syntax should I use and how do I call these values outside the function? Are these values returned as en array or something? this is what I have now, - function myFunction($some_vars) { $max=count($some_vars); $some_value=($max/2); return($some_value $max); } function myFunction ($some_vars) { $max = count($some_vars); $some_value = ($max / 2); return array($some_value, $max); } list($x, $y) = myFunction($_SERVER); echo returned $x and $y; miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thread safe
On Mon, 27 May 2002, r wrote: In java servlets I used to use a synchronised block of code to make sure it was thread safe...how do i do this in PHP? Heres what should be thread safe { $r=select max(cno)+1 from MyTable; (then i insert into the table the new cno plus my name) insert into mytable ($r,'myname'); } How to do this and make sure its thread safe? More of a database issue. select ... for update is a good starting point as you search the manual of your particular database platform. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailing Archieve
On Tue, 28 May 2002, Uma Shankari T. wrote: Can anyone please tell me how to create a mailing archieve list 1) Get messages delivered to a PHP program. 2) Parse the messages. 3) Add them to the database. 4) Provide a front-end for querying the database. Which part are you having trouble with? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Missing functions??
On Tue, 28 May 2002, Weston Houghton wrote: I'm using the Mac OS X binary of PHP 4.2.1 provided by Mark Liyanage (http://www.entropy.ch/software/macosx/php/), and I am starting to notice some oddities, I was wondering if anyone else had seen these errors in other ports. I'm getting some base php functions that seem to be missing, such as: bindtextdomain textdomain Those are only available if PHP was built with gettext support, which is optional. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php's variables javascript
On Tue, 28 May 2002, burak delice wrote: I want to make a php that include javascript that use a php variable. Code is below: ? $size = GetImageSize (images/$resim); echo script language=\JavaScript\ wdth=;$size;echo;; echo /script; ? (I am calling that php file as below) http://localhost/Aksu/web/getimage.php?resim=K00.jpg But explore gives me an javascript error that syntax error. Why? and how can do my purpose? For one thing, wdth is a misspelling of width. What do you see when you view the source that gets sent to the browser? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Intermediate Searching... screen.
Vbulletin does this for their search. Anyone know how they do it? http://www.vbulletin.com/forum/search.php -Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: May 28, 2002 2:36 PM To: Jeff Bearer; Php-General (E-mail) Subject: Re: [PHP] Intermediate Searching... screen. Search screens are a tricky prospect and none seem to work very well. However you could try one of the following techniques... Instead of the submit button initiating a search it initiates another script that displays the 'searching...' message and only after it has outputted that to the screen does it initiate the search. The last line in that script would be a redirect back to your results page. Another way to do it would be to set up a couple of Javascript functions. Echo one to open the 'searching...' screen prior to initiating the search. Then at the end of the script echo the other javascript function to close the 'searching.. ' screen. But I've implimted a version of this for an upload script and it didn't work so hot. Er.. umm.. anyone got any other bright ideas? -Kevin - Original Message - From: Jeff Bearer [EMAIL PROTECTED] To: Php-General (E-mail) [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 12:23 PM Subject: [PHP] Intermediate Searching... screen. I have a part of my site that searches a large database and sometimes it takes more than a few seconds to return the results. When searches take longer, people get antsy and search again. To let them know that the search is working so they don't double efforts I'd like to have an intermediate Searching... screen. I don't have a good idea on how to do this and I'm looking for some ideas or directions. How do I show one thing while the search is running and another when the search is complete and also not loose the returned record set? -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- 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] Imagecreate and/or GD library not activated
check to see if gd is actually activated by using phpinfo() assuming you are using PHP4... /dkm - Original Message - From: LeTortorec, Jean-Louis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 2:35 PM Subject: [PHP] Imagecreate and/or GD library not activated Hello everyone. I wrote a little code creating PNG images under Apache/PHP windows. As the code works fine, I need to transfer it onto the Linux platform. When I execute the code, PHP replies Fatal error: Call to undefined function: imagecreate(). I had libgd installed. I just added GD 1.8.4. The php.ini file says ;extension=gd.so. I removed the comma, restarted Apache. Does not work. I copied libgd.so in /etc/lib/php4 but did not change anything. Any idea? Thanks. Jean-Louis -- 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] auto_increment
I think this is any easy question, but I couldn't find an answer in the php Black Book for PostgreSQL. Does anyone know the equivilant of auto_increment for PostgreSQL? This is the php code that I have: $query = CREATE table $tablename (id INT NOT NULL PRIMARY KEY, ip TEXT, customer TEXT, dslphone TEXT, date TEXT, vpivci TEXT); This creates the table, but when I need to add data to the Database, I have to specify a unique id each time. I need want the id to automatically increment each time data is added the the DataBase. Is there a way to do this by adding an auto_increment option to the id field when the table is first created? Thanks for any Help, -Elkan PHP version: 4.0.6 OS: RH 7.2 PostgreSQL: v.7.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiple variables
Hi, I got a table, which contains a lot of text-boxes. Each textbox has a name: Text1 Text2 Text3 etc. Is it possible to check if they are all set using a for-loop? I think of something like: for($i=1;$i10;$i++) { if(empty(Text+$i)) { do something... } } regards, Morten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] comment followed by ? fails to parse
If I write a comment line with // and I include in it ? then it fails to parse the rest of the page because (i'm guessing) the parser gets confused and goes off PHP mode. Is this normal? Shouldn't I be able to write literally ANYTHING on a comment line? Sample Code: ? //bla bla ? $var=1; ? Output: $var=1; ? cheers, thalis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] (Unlink(file) == rm file) ? (ignore this mail):(explain diffs);
Previously, Jimmy Lantz wrote: (Unlink(file) == rm file) ? (ignore this mail):(explain diffs); Does PHP unlink function handle deletion of files equally as the rm command on the system in my case FreeBSD. Or does it involve caching/handling files in any different way? It just uses the system call unlink() which is what rm does. That means the link is removed. If that's the only link to that file (inode), the file goes away. If there are multiple links, then only the link is removed and the file (inode) remains with the one or more other links. This is exactly what rm does, though. -dan -- The process for understanding customers primarily involves sitting around with other marketing people and talking about what you would to if you were dumb enough to be a customer. -Scott Adams, The Dilbert Principle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php