[PHP] how to insert data in mysql
Hello I was wondering if anyone had a good tutorial on how To insert data from a form I created to the managers Table in my database. Im using mysql and php for this?
[PHP] Re: upload whole direcotry using ftp functions
was this an answer or a question ? Akhil Kodali [EMAIL PROTECTED] wrote in message news:Pine.LNX.4.44.0211091958120.10474-10;gdit.iiit.net... Hi, I there anyway to upload entire directory. -- AKHIL K 200101009 Room No. 15 BH-2 IIIT -- Look at me. My life has no meaning or direction, and I'm happy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Create associative array from comments by preg
I have comments like that : !-- comname1 --! value1 !-- end comname1 --! !-- comname2 --! value2 !-- end comname2 --! Now : How can me get associative array like this $var[comname1] = value1; $var[comname2] = value2; can any body help me to do that ?
Re: [PHP] Re: upload whole direcotry using ftp functions
Its a question. I want to know if there is any method to upload a directory, If yes, then how. On Sun, 10 Nov 2002, electroteque wrote: was this an answer or a question ? Akhil Kodali [EMAIL PROTECTED] wrote in message news:Pine.LNX.4.44.0211091958120.10474-10;gdit.iiit.net... Hi, I there anyway to upload entire directory. -- AKHIL K 200101009 Room No. 15 BH-2 IIIT -- Look at me. My life has no meaning or direction, and I'm happy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Function Problem
At 08:16 10.11.2002, conbud said: [snip] also I have the function wrong in my original question I have it as function db_conn($host,$user,$pass,$dab) { $db = mysql_connect($host, $user,$pass mysql_select_db($dab,$db); } and not function db_conn($host,$user,$pass,$dab) { $db = mysql_connect($host, $user,$pass)mysql_select_db($dab,$db); } [snip] mysql_select_db already opens a connection to the database; you don't need the mysql_connect() call afterwards. In your code you have mysql_select_db() as fourth parameter to mysql_connect(). While the fourth parameter is boolean and won't generate any error at runtime, it's use- and senseless. The 4th parameter on mysql_connect specifies if PHP should use an existing link, or create a new one. You should decide whether you want to go with mysql_select_db() or mysql_connect(). -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to insert data in mysql
Start by reading all the pages in this section: http://www.php.net/manual/en/tutorial.php Particularly the forms one. Now you should know heaps about PHP, variables, forms, etc etc. Now you need to insert that data into mysql through a PHP script. There are hundreds of tutorials on this... Kevin Yank gives away the first 4 chapters of his book on webmasterbase.com... http://www.WebmasterBase.com/subcats/53 Read Build your own Database Driven Website using PHP MySQL Part 1 thru to part 4 -- somewhere along the way he introduces MySQL, the theory behind relational databases, and how to insert and query a database. I know, it's a lot reading, but I don't think there's an easy way into this... I can give you an instant fix example of inserting data, but you won't understand how or why... to do what you want to achieve in the other posts, you really should get a firm grip at the start by doing a lot of reading. There's also some good starting points on phpbeginner.com, like: http://www.phpbeginner.com/columns/joel/mysql http://www.phpbeginner.com/columns/ray/db http://www.phpbeginner.com/columns/shobhan/guestbook http://www.phpbeginner.com/columns/scott/authentication etc etc Since you want to create users (managers), this will involve sessions and user management. The link I directed you to in an earlier email (http://www.WebmasterBase.com/article/319) will provide you with code you can easily adapt to suit. Justin on 10/11/02 9:19 AM, Karl James ([EMAIL PROTECTED]) wrote: Hello I was wondering if anyone had a good tutorial on how To insert data from a form I created to the managers Table in my database. Im using mysql and php for this? Creative Director http://Indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: upload whole direcotry using ftp functions
From the browser window, I believe you can only upload individual files to the server... you can do multiples at once, but you can't (IMHO) upload an entire directory off your desktop THROUGH your browser, to the server. You could .zip, .tar or .sit a folder of course, but then you'd have to uncompress on the server, which is possible for SOME compression types. Justin on 10/11/02 7:30 PM, AKHIL KODALI ([EMAIL PROTECTED]) wrote: Its a question. I want to know if there is any method to upload a directory, If yes, then how. On Sun, 10 Nov 2002, electroteque wrote: was this an answer or a question ? Akhil Kodali [EMAIL PROTECTED] wrote in message news:Pine.LNX.4.44.0211091958120.10474-10;gdit.iiit.net... Hi, I there anyway to upload entire directory. -- AKHIL K 200101009 Room No. 15 BH-2 IIIT -- Look at me. My life has no meaning or direction, and I'm happy Creative Director http://Indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] set_error_handler() Keeps Triggering Errors
At 06:34 10.11.2002, Monty said: [snip] When I use set_error_handler('error_function') in my scripts, errors are constantly being triggered that I've never seen before. If I comment the handler function out, the errors go away. I have the error reporting set very loosely: error_reporting (E_ERROR | E_USER_ERROR) - so not sure why it It's somewhere in the docs - can't remember where just now, I believe isomewhere in the user comments for error_handler: your error_handler gets _all_ type of error,warning,notice, regardless of the actual setting of error_reporting (which only decides if the error/warning/notice gets sent to the client or not). keeps triggering an error, because the error I keep getting is: Undefined variable: target This is the same error message no matter what script I run. I don't even use a variable named $target anywhere in any of my scripts, so, this is baffling. And this seems like an E_NOTICE error message, but, I'm only asking for E_ERROR and E_USER_ERROR notices. [snip] Might point to a dynamic variable named target: ?php error_reporting(E_ALL); $varname = 'target'; if ($$varname) { ; } ? gets me Notice: Undefined variable: target in /www/test/test.php on line 4 Do a grep for target on your source files. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] converting decimal to fraction and vice versa
At 05:45 10.11.2002, Michael P. Carel said: [snip] is there any way to convert decimal numbers to fraction and fraction to decimal format. i need to convert the inputed fractional value in the field before inserting it to the mysql database, such us 1/2 = 0.5 . [snip] ?php $in = '1/2'; eval(\$out = (double)$in;); echo $in = $out\n; ? Needs a lot of work before and after to check if things are right, but I believe you get the idea... -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to insert data in mysql
Hello hello I was wondering if anyone had a good tutorial on how To insert data from a form I created to the managers Table in my database. Im using mysql and php for this? check out http://www.hotscripts.com/PHP/Tips_and_Tutorials/Database-Related/ there are some good and simple tutorials cheers stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unique Identifier String
I am currently working on a mySQL site administration system and I need help on figuring out how I can create a 24 digit letter/number unique identifier string. I know that I can easily get a random number using a PHP function (I can remember it off the top of my head) but I also need to create random letters and then insert them into the number. Here are the steps of the process: 1. Create a 12 digit random number using a PHP function 2. Create 12 random letters 3. Insert the letters into the number, or the other way around Result: 1h5l79G05OP65kN61LPs1o6Z Out of the steps above, I am not sure how to do 2 and 3 and I would greatly appreciate it if someone could point out for me how to do them. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unique Identifier String
Hello, Sebastian A. [EMAIL PROTECTED] wrote: I am currently working on a mySQL site administration system and I need help on figuring out how I can create a 24 digit letter/number unique identifier string. I know that I can easily get a random number using a PHP function (I can remember it off the top of my head) but I also need to create random letters and then insert them into the number. Here are the steps of the process: 1. Create a 12 digit random number using a PHP function 2. Create 12 random letters 3. Insert the letters into the number, or the other way around Result: 1h5l79G05OP65kN61LPs1o6Z Out of the steps above, I am not sure how to do 2 and 3 and I would greatly appreciate it if someone could point out for me how to do them. This may not be the best way but you can do it this way: 1. Make sure that the number 1 above is in an array. Then, 2. Make an array of uppercase and lowercase letters, shuffle() them. 3. Get 12 from each. (i.e. by looping thru each and assigning it to another array, etc.) 4. array_merge() the two resulting arrays. 5. shuffle() again. Should work... - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MsWord html
Hi php-windows, Does anybody knows, what regexp can help me remove almost all M$ Word2000 HTML tags and styles? Let the Force Be with Yo! ;) -- The Same, Steel mailto:asergey;inbox.ru http://www.none.ru -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5 features?
well i read somewhere that the zend 2 engine was coming out in 4.3 which had proper OO capabilities including public and private and maybe even error exeption handlers but doesnt look good might have to wait a little longer in the mean time i'm starting to get my head around tomcat .. Maxim Maletsky [EMAIL PROTECTED] wrote in message news:20021109230110.6EC9.MAXIM;php.net... Try searching the list archives, particularly of PHP-DEV lists (but hesitate asking these questions there) -- Maxim Maletsky [EMAIL PROTECTED] On Sat, 9 Nov 2002 13:27:05 -0800 (PST) ed [EMAIL PROTECTED] wrote: Hi all. I was wondering if there are resources on the web that will help me get an idea of the changes and new features that will be in php5. I'm particularly interested in what's gonna be added or changed to php in regards to its OOP capabilities. I already love this language. I'm just looking forward to seeing in what areas it is going to be made even better. tia, --ed __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- 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] Unique Identifier String
And btw, you might want to check User Contributed Notes dated 04-Nov-2002 http://www.php.net/manual/en/function.rand.php Perhaps you can just add some if...else and you can have the 12-random-digit-12-random-letter-string that you're looking for. HTH, - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MsWord html
Hello, Steel [EMAIL PROTECTED] wrote: Hi php-windows, Wrong list :) Does anybody knows, what regexp can help me remove almost all M$ Word2000 HTML tags and styles? Perhaps, you can try this class instead: http://phpclasses.optip.com/browse.html/package/277.html ('Haven't use it though--I just know that it exists...) - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to insert data in mysql
Hello, Karl James [EMAIL PROTECTED] wrote: Hello I was wondering if anyone had a good tutorial on how To insert data from a form I created to the managers Table in my database. Im using mysql and php for this? I googled for how to insert data in mysql and I found this tutorial: http://www.ba814.sfsu.edu/tutorial/tutorial_insert.html Looks good. You might want to check it out. - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] enable CLI
I'm running PHP4 on Mac OS 10.2.1 using Marc Liyanage's binaries compiled with --disable-cli option .Is there any possibility to install an extension to enable CLI ? Thanks for your help . Pierre Vaudrey email [EMAIL PROTECTED]
[PHP] attachement
Hi, I wrote a php script that's supposed to enable me to attach files to an email. However, the attached files ends up being a mess of letters. Hallo becomes SGFsbG8=. That must have to do with encoding. Is that a common problem or do you need the entire script? Thanks, Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] attachement
Here is a PHP mail class that handles multiple attachments and several other functions: ?php /* * Notes from [EMAIL PROTECTED] 25 Mar 2000: * This library based idea of Dan Potter * Improvements: Multi attachmends in one e-mail, ability to post html plain trext, up to 3x speed improved. * USAGE - mimetype example for attacment * $m = new CMIMEMail($to,$from,$subject); * $m-mailbody(This is simply text,htmlbodyh1This is HTML text/h1); * $m-attach(example.html,text/html,$filebody); * $m-attachFile(resume.gif,image/gif); * $m-send(); * NOTE: if your system have chunk_split function use it. *** * To Do: * 1. Make quoted-printable encoder and use them in makebody; * 2. Generate right boundaries * 3. Fix bugs in SMTP send direct futction SMTPsend() */ function my_chunk_split($str) { $stmp = base64_encode($str); $len = strlen($stmp); $out = ; $done=0; while( $done$len ) { $out.=( $len-$done76)?substr($strp,$done, 76). \r\n:substr($strp,$done, $len-$done). \r\n; $done+=76; } return $out; } class CMIMEMail { var $to; var $from; var $cc; var $bcc; var $subject; var $priority; var $boundary = =_NextPart_000_0009_01BF95E9.CDFD2060; var $smtp_headers; var $filename_real; var $body_plain; var $body_html; var $atcmnt; var $atcmnt_type; function CMIMEMail($to,$from,$subject,$cc=,$bcc=,$priority=3) { $this-to=$to; $this-from=$from; $this-subject=$subject; $this-priority=$priority; $this-cc=$cc; $this-bcc=$bcc; } function mailbody( $plain, $html= ) { $this-body_plain=$plain; $this-body_html=$html; } function attach( $name, $content_type, $data ) { $this-atcmnt[$name]=$data; $this-atcmnt_type[$name]=$content_type; } function attachfile( $fname, $content_type ) { $name=ereg_replace( (.+/), ,$fname); $f=fopen($name, r); $fsz = filesize($name); $ftext = fread($f,$fsz); $this-attach($name,$content_type,$ftext); fclose($f); } function clear() { unset( $this-atcmnt ); unset( $this-atcmnt_type ); } function makeheader() { $out = From: .$this-from.\nReply-To: .$this-from. \n; if( $this-cc !=) $out .=Cc: .$this-cc.\n; if( $this-bcc !=) $out .=Bcc: .$this-bcc.\n; $out.= MIME-Version: 1.0\nContent-Type: multipart/mixed;\n boundary=\.$this-boundary. \\nX-Priority: .$this-priority. \n; return $out; } function makebody() { $boundary2= =_NextPart_001_0009_01BF95E9.CDFD2060; $out= ; $out= \n\n.$this-body_plain. \n\n; if( $this-body_html!= ) { $out.= --.$this-boundary. \nContent-Type: multipart/alternative;\n boundary=$boundary2\n\n; $out.= $body_plain\n--$boundary2\nContent-Type: text/plain\nContent-Transfer-Encoding: quoted-printable\n\n.$this-body_plain. \n\n--$boundary2\nContent-Type: text/html\n. Content-Transfer-Encoding: quoted-printable\n\n$this-body_html\n\n--$boundary2--\n; } else { # $out.= --.$this-boundary. \nContent-Type: text/plain\nContent-Transfer-Encoding: quoted-printable\n\n.$this-body_plain. \n\n--.$this-boundary. \n; $out.= --.$this-boundary. \nContent-Type: text/plain\nContent-Transfer-Encoding: quoted-printable\n\n.$this-body_plain. \n\n; } if( ISSET($this-atcmnt_type) ) { reset( $this-atcmnt_type); while( list($name, $content_type) = each($this-atcmnt_type) ) { $out.= \n--.$this-boundary. \nContent-Type: $content_type\nContent-Transfer-Encoding: base64\nContent-Disposition: attachment; filename=\$name\\n\n. chunk_split(base64_encode($this-atcmnt[$name])). \n; } } $out.= --.$this-boundary. --\n; return $out; } function send(){ mail( $this-to, $this-subject, $this-makebody(),$this-makeheader() ); } function sendto($email,$subj=#){ if( $subj==#) $subj= $this-subject; mail( $email, $subj, $this-makebody(),$this-makeheader() ); } function SMTPsend($host){ $errno=0;$errstr= ; // $f=fsockopen(127.0.0.1,25,$erno, $errstr); if(!$f) { $this-send(); } else { //SNMP commands Not finished yet echo fgets($f,512); fputs($f, HELO host.com\n); echo fgets($f,512); fputs($f, MAIL FROM: .$this-from. \n); echo fgets($f,512); fputs($f, RCPT TO: .$this-to). \n; echo fgets($f,512); fputs($f, data\n); echo fgets($f,512); fputs($f, From: .$this-from. \nTo: .$this-to. \n.$this-makeheader().$this-makebody(). \n\n.\n); fputs($f, quit\nexit); fclose($f); } } } ? . - Original Message - From: Oliver Witt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, November 10, 2002 7:31 AM Subject: [PHP] attachement Hi, I wrote a php script that's supposed to enable me to attach files to an email. However, the attached files ends up being a mess of letters. Hallo becomes SGFsbG8=. That must have to do with encoding. Is that a common problem or do you need the entire script? Thanks, Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
Re: [PHP] attachement
At 14:31 10.11.2002, Oliver Witt said: [snip] I wrote a php script that's supposed to enable me to attach files to an email. However, the attached files ends up being a mess of letters. Hallo becomes SGFsbG8=. That must have to do with encoding. Is that a common problem or do you need the entire script? [snip] It seems that you're encoding the file somehow - that's usual, even required if your file is a binary file (like a picture, or a formatted document). In your mail headers, you should see some MIME like Content-Type: multipart/alternative; boundary=GU4wuTSk68F (alternative could also read related - depends on the content, the multipart is the point here) which would tell the client browser that the next mail consists of a couple of separate parts, with a separator line as --GU4wuTSk68F. Next comes the message entity, which starts with such a separator line, and a set of MIME headers for the respective entity: --GU4wuTSk68F Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain You are receiving this message as a subscriber to the Just For You Network. To cancel, see the instructions at the end of this mail. That's the first part of the mail - it's plain text. The next part would be an image, and again starts with a boundary: --GU4wuTSk68F Content-Type: image/jpeg; name=sample.jpg Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=sample.jpg JVBERi0xLjMNJeLjz9MNCjE5OSAwIG9iag08PCANL0xpbmVhcml6ZWQgMSANL08gMjAy JVBERi0xLjMNJeLjz9MNCjE5OSAwIG9iag08PCANL0xpbmVhcml6ZWQgMSANL08gMjAyIA0vSCBb IDE2NDUgMjc0IF0gDS9MIDEwOTMzMSANL0UgNzg3MDYgDS9OIDMgDS9UIDEwNTIzMiAN IDE2NDUgMjc0IF0gDS9MIDEwOTMzMSANL0UgNzg3MDYgDS9OIDMgDS9UIDEwNTIzMiANPj4gDWVu [...] RHA0NjcxUFJGbzgtMTZsNDM= --GU4wuTSk68F The message should also end with a boundary, but most mail client's omit this... For more information consult RFC2045 ff about MIME ftp://ftp.rfc-editor.org/in-notes/rfc2045.txt Hope this helps, -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 10 Nov 2002 14:13:49 -0000 Issue 1696
php-general Digest 10 Nov 2002 14:13:49 - Issue 1696 Topics (messages 123642 through 123686): Re: HTML forms php 4.2.3 - how to get cvs fix applied 123642 by: Paul Nicholson Re: Errors and Logging Configuration Options: docref-root 123643 by: Paul Nicholson Re: Need MENTOR for Fantasy football project 123644 by: Justin French 123646 by: Bob Eldred Php | Architect Magazine? 123645 by: Nick Oostveen fopen() using non-standard port 123647 by: Tim Lan 123648 by: Khalid El-Kary 123653 by: Evan Nemerson date problem 123649 by: Michael P. Carel 123652 by: Maxim Maletsky converting decimal to fraction and vice versa 123650 by: Michael P. Carel 123665 by: Jason Wong 123674 by: Ernest E Vogelsinger Re: Automatic Colspan from database data 123651 by: Dhaval Desai 123657 by: Marco Tabini set_error_handler() Keeps Triggering Errors 123654 by: Monty 123673 by: Ernest E Vogelsinger Suggestions Please 123655 by: Mike Miller 123661 by: Justin French 123664 by: John Nichel Function Problem 123656 by: conbud 123658 by: Marco Tabini 123659 by: conbud 123660 by: conbud 123662 by: Maxim Maletsky 123663 by: conbud 123670 by: Ernest E Vogelsinger how to insert data in mysql 123666 by: Karl James 123671 by: Justin French 123675 by: elybis 123682 by: . Edwin Re: upload whole direcotry using ftp functions 123667 by: electroteque 123669 by: AKHIL KODALI 123672 by: Justin French Create associative array from comments by preg 123668 by: Alawi albaity Unique Identifier String 123676 by: Sebastian A. 123677 by: . Edwin 123680 by: . Edwin MsWord html 123678 by: Steel 123681 by: . Edwin Re: php5 features? 123679 by: electroteque enable CLI 123683 by: Pierre Vaudrey attachement 123684 by: Oliver Witt 123685 by: Rick Emery 123686 by: Ernest E Vogelsinger 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--- -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey, Reconfigure php without --enable-mbstr-enc-trans and that will fix the problem. HTH! ~Paul On Friday 08 November 2002 06:56 pm, andy wrote: I recently updated from 4.2.0 to 4.2.3 - since doing so values submitted to php from HTML forms using keys - value=foo[bar] - get truncated in php - example: if I submit [EMAIL PROTECTED] it will come out as eight13.com with a print_r($_POST) I found these bug reports which say what appears to be the same bug has been fixed in CVS: http://bugs.php.net/bug.php?id=20024 http://bugs.php.net/bug.php?id=19829 I'm wondering where to go from this point. I have a production server which I need this fixed on. Is my only choice to checkout the entire branch for the latest version 4.2.x? (I'm assuming its branched - I've not looked at any of this yet) Is there not a patch? Could I just checkout the applicable files? http://snaps.php.net/ wasn't avilable at the time of writing this - possibly it would have given me more information. Apache 1.3.20 php from source as module Mandrake 8 - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] www.webpowerdesign.net It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD4DBQE9zcldDyXNIUN3+UQRArDSAKCRyBACPvmlkvHv5335p5jzNijyQACXaRPA JTBavZvIutTMj9eHFdu+zA== =xhW8 -END PGP SIGNATURE- ---End Message--- ---BeginMessage--- -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Did you restart apache? HTH! ~Paul On Saturday 09 November 2002 03:14 pm, Stefan Schiller wrote: I updated my development-server -- FreeBSD 4.7-REALEASE, Apache/1.3.27 (Port-Build), PHP 4.2.3 (Port-Build) ...] After this I found http://www.php.net/manual/en/ref.errorfunc.php#ini.docref-root In the manual. I downloaded the manual and changed some config-item [httpd.conf] Alias /manual/ /X//manual/ [php.ini] docref_roof = /manual/php4_manual docref_ext = .html But I noticed no changes! - is this a future of php ?.?.? ?? - are some configure options needed for the build? - is it useful, how does it look like? [some more options out php.ini] error_reporting = E_ALL display_errors = On log_errors = On html_errors = On error_log = /XX/Y/Z/php.err docref_roof = /manual/php4_manual docref_ext = .html Best regards Stefan
Re: [PHP] attachement
Ernest E Vogelsinger schrieb: In your mail headers, you should see some MIME like Content-Type: multipart/alternative; boundary=GU4wuTSk68F (alternative could also read related - depends on the content, the multipart is the point here) which would tell the client browser that the next mail consists of a couple of separate parts, with a separator line as --GU4wuTSk68F. I had it set like this: $fp = fopen($file, r); $contents = fread($fp, $file_size); $encoded_file = chunk_split(base64_encode($contents)); fclose($fp); unset($header); $header = FROM:$name_abs$adresse_abs\n; $header.= MIME-version: 1.0\n; $header.= Content-type: multipart/mixed; ; $header.= boundary=\Message-Boundary\\n; $header.= Content-transfer-encoding: 7BIT\n; $header.= X-attachments: $file_name; $body = --Message-Boundary\n; $body .= Content-type: text/plain; charset=US-ASCII\n; $body .= Content-Disposition: inline; $body .= Content-transfer-encoding: 7BIT\n; $body .= Content-description: Mail message body\n\n; $body .= $text; $body.= \n\n--Message-Boundary\n; $body.= Content-type: $file_type; name=\$file_name\\n; $body.= Content-Transfer-Encoding: PLAINTEXT\n; $body.= Content-disposition: attachment; filename=\$file_name\\n\n; $body.= $encoded_file\n; $body.= --Message-Boundary--\n; That's the same as a friend of mine uses it. He's saying it's working fine... I'll try to do what you told me. Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Questions on PHP Variables
The fact that tutorials are outdated using old code is not a good reason to stick with it :) I agree totally. So I'm trying to use the $_Server variables but I continue to get this error: Parse error: parse error, expecting 'T_STRNG' or 'T_VARIABLE' or 'T_NUM_STRING' in blah, blah, blah on line 33. Here is the script that is doing this: ?php // File Name: auth04.php // Check to see if $PHP_AUTH_USER already contains info if (!isset($_SERVER[PHP_AUTH_USER])) { // If empty, send header causing dialog box to appear header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); exit; } else if (isset($_SERVER[PHP_AUTH_USER])) { // If non-empty, check the database for matches // connect to MySQL mysql_connect(hostname, username, password) or die (Unable to connect to database.); // select database on MySQL server mysql_select_db(dev_i2ii_com) or die (Unable to select database.); // Formulate the query $sql = SELECT * FROM users WHERE username='$_SERVER[PHP_AUTH_USER]' and password='$_SERVER[PHP_AUTH_PW]'; // Execute the query and put results in $result $result = mysql_query($sql); // Get number of rows in $result. 0 if invalid, 1 if valid. $num = mysql_numrows($result); if ($num != 0) { echo PYou're authorized!/p; exit; } else { header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } } ? -- The data base stuff hasn't been put in yet, I'm just trying to get the script to load cleanly before I trouble shoot the database connector side. Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Questions on PHP Variables
Don't use quotes around the array index inside a quoted string. -Rasmus On 10 Nov 2002, Ray Seals wrote: The fact that tutorials are outdated using old code is not a good reason to stick with it :) I agree totally. So I'm trying to use the $_Server variables but I continue to get this error: Parse error: parse error, expecting 'T_STRNG' or 'T_VARIABLE' or 'T_NUM_STRING' in blah, blah, blah on line 33. Here is the script that is doing this: ?php // File Name: auth04.php // Check to see if $PHP_AUTH_USER already contains info if (!isset($_SERVER[PHP_AUTH_USER])) { // If empty, send header causing dialog box to appear header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); exit; } else if (isset($_SERVER[PHP_AUTH_USER])) { // If non-empty, check the database for matches // connect to MySQL mysql_connect(hostname, username, password) or die (Unable to connect to database.); // select database on MySQL server mysql_select_db(dev_i2ii_com) or die (Unable to select database.); // Formulate the query $sql = SELECT * FROM users WHERE username='$_SERVER[PHP_AUTH_USER]' and password='$_SERVER[PHP_AUTH_PW]'; // Execute the query and put results in $result $result = mysql_query($sql); // Get number of rows in $result. 0 if invalid, 1 if valid. $num = mysql_numrows($result); if ($num != 0) { echo PYou're authorized!/p; exit; } else { header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } } ? -- The data base stuff hasn't been put in yet, I'm just trying to get the script to load cleanly before I trouble shoot the database connector side. Ray -- 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] Questions on PHP Variables
Uh, no. That makes it think it's a constant, which generates a notice. Rasmus Lerdorf wrote: Don't use quotes around the array index inside a quoted string. -Rasmus On 10 Nov 2002, Ray Seals wrote: The fact that tutorials are outdated using old code is not a good reason to stick with it :) I agree totally. So I'm trying to use the $_Server variables but I continue to get this error: Parse error: parse error, expecting 'T_STRNG' or 'T_VARIABLE' or 'T_NUM_STRING' in blah, blah, blah on line 33. Here is the script that is doing this: ?php // File Name: auth04.php // Check to see if $PHP_AUTH_USER already contains info if (!isset($_SERVER[PHP_AUTH_USER])) { // If empty, send header causing dialog box to appear header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); exit; } else if (isset($_SERVER[PHP_AUTH_USER])) { // If non-empty, check the database for matches // connect to MySQL mysql_connect(hostname, username, password) or die (Unable to connect to database.); // select database on MySQL server mysql_select_db(dev_i2ii_com) or die (Unable to select database.); // Formulate the query $sql = SELECT * FROM users WHERE username='$_SERVER[PHP_AUTH_USER]' and password='$_SERVER[PHP_AUTH_PW]'; // Execute the query and put results in $result $result = mysql_query($sql); // Get number of rows in $result. 0 if invalid, 1 if valid. $num = mysql_numrows($result); if ($num != 0) { echo PYou're authorized!/p; exit; } else { header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } } ? -- The data base stuff hasn't been put in yet, I'm just trying to get the script to load cleanly before I trouble shoot the database connector side. Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
Re: [PHP] attachement
At 15:27 10.11.2002, Oliver Witt said: [snip] I had it set like this: $fp = fopen($file, r); $contents = fread($fp, $file_size); $encoded_file = chunk_split(base64_encode($contents)); fclose($fp); ... $body.= \n\n--Message-Boundary\n; $body.= Content-type: $file_type; name=\$file_name\\n; $body.= Content-Transfer-Encoding: PLAINTEXT\n; $body.= Content-disposition: attachment; filename=\$file_name\\n\n; $body.= $encoded_file\n; $body.= --Message-Boundary--\n; [snip] You must not give PLAINTEXT as encoding when you have it base64... use: Content-Transfer-Encoding: base64 BTW, PLAINTEXT is not a MIME recognized encoding type. Excerpt from RFC2045: [snip] 5.2. Content-Type Defaults Default RFC 822 messages without a MIME Content-Type header are taken by this protocol to be plain text in the US-ASCII character set, which can be explicitly specified as: Content-type: text/plain; charset=us-ascii This default is assumed if no Content-Type header field is specified. It is also recommend that this default be assumed when a syntactically invalid Content-Type header field is encountered. In the presence of a MIME-Version header field and the absence of any Content-Type header field, a receiving User Agent can also assume that plain US-ASCII text was the sender's intent. Plain US-ASCII text may still be assumed in the absence of a MIME-Version or the presence of an syntactically invalid Content-Type header field, but the sender's intent might have been otherwise. 6.1. Content-Transfer-Encoding Syntax The Content-Transfer-Encoding field's value is a single token specifying the type of encoding, as enumerated below. Formally: encoding := Content-Transfer-Encoding : mechanism mechanism := 7bit / 8bit / binary / quoted-printable / base64 / ietf-token / x-token These values are not case sensitive -- Base64 and BASE64 and bAsE64 are all equivalent. An encoding type of 7BIT requires that the body is already in a 7bit mail-ready representation. This is the default value -- that is, Content-Transfer-Encoding: 7BIT is assumed if the Content-Transfer-Encoding header field is not present. [snip] Therefore, for plaintext headings you should use Content-type: text/plain Content-Transfer-Encoding: 7bit (or 8bit, depends) -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] attachement
Ernest E Vogelsinger schrieb: At 15:27 10.11.2002, Oliver Witt said: [snip] I had it set like this: $fp = fopen($file, r); $contents = fread($fp, $file_size); $encoded_file = chunk_split(base64_encode($contents)); fclose($fp); ... $body.= \n\n--Message-Boundary\n; $body.= Content-type: $file_type; name=\$file_name\\n; $body.= Content-Transfer-Encoding: PLAINTEXT\n; $body.= Content-disposition: attachment; filename=\$file_name\\n\n; $body.= $encoded_file\n; $body.= --Message-Boundary--\n; [snip] You must not give PLAINTEXT as encoding when you have it base64... use: Content-Transfer-Encoding: base64 BTW, PLAINTEXT is not a MIME recognized encoding type. Excerpt from RFC2045: [snip] 5.2. Content-Type Defaults Default RFC 822 messages without a MIME Content-Type header are taken by this protocol to be plain text in the US-ASCII character set, which can be explicitly specified as: Content-type: text/plain; charset=us-ascii This default is assumed if no Content-Type header field is specified. It is also recommend that this default be assumed when a syntactically invalid Content-Type header field is encountered. In the presence of a MIME-Version header field and the absence of any Content-Type header field, a receiving User Agent can also assume that plain US-ASCII text was the sender's intent. Plain US-ASCII text may still be assumed in the absence of a MIME-Version or the presence of an syntactically invalid Content-Type header field, but the sender's intent might have been otherwise. 6.1. Content-Transfer-Encoding Syntax The Content-Transfer-Encoding field's value is a single token specifying the type of encoding, as enumerated below. Formally: encoding := Content-Transfer-Encoding : mechanism mechanism := 7bit / 8bit / binary / quoted-printable / base64 / ietf-token / x-token These values are not case sensitive -- Base64 and BASE64 and bAsE64 are all equivalent. An encoding type of 7BIT requires that the body is already in a 7bit mail-ready representation. This is the default value -- that is, Content-Transfer-Encoding: 7BIT is assumed if the Content-Transfer-Encoding header field is not present. [snip] Therefore, for plaintext headings you should use Content-type: text/plain Content-Transfer-Encoding: 7bit (or 8bit, depends) -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ thanks you very much, that's it, it's working perfectly now!!! thx, Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Questions on PHP Variables
At 15:28 10.11.2002, Ray Seals said: [snip] Parse error: parse error, expecting 'T_STRNG' or 'T_VARIABLE' or 'T_NUM_STRING' in blah, blah, blah on line 33. Here is the script that is doing this: [...] $sql = SELECT * FROM users WHERE username='$_SERVER[PHP_AUTH_USER]' and password='$_SERVER[PHP_AUTH_PW]'; [snip] You need to put the array dereference in curly brackets: $sql = SELECT * FROM users WHERE username='{$_SERVER['PHP_AUTH_USER']}' and password='{$_SERVER['PHP_AUTH_PW']}'; Note that I used single quotes within the array - it's for the paranoid like me only, it's a few nanosecs faster :) -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange ....Date problem
Hi! If you try this in php: 2002-01-6 2002-01-10 returns true 2002-01-6 2002-01-9 returns false Jut a leading 0 in the date makes it false...this is really strange.. Any comments? _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP installation _ help needed
Hi people! I have MySQL working with ASP under win2000 and IIS. I have recently tried unsuccessfully to install PHP. Initially I started with zip binary distribution. I tested it with:- html head titlePHP Test/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#FF text=#00 ?php echo Hello Worldp; ? /body /html Couldn't be much simpler! Nothing worked but view source showed the above code. The implication being that the sever did not parse the code. I then deleted every thing and tried InstallShield with exactly the same result. I have reinstalled IIS - no change I have added PHP to the application mapping. I have given exec permissions to C:/PHP The setup instructions say that I must rename PHP TO PHP.INI in WINNT and that is all. Is this true. If not what precisely must I do? Failing the .INI question I think I have done everything in the OPINS. But you guys will know better. What have I missed? All thoughts gratefully appreciated Thanks Bob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Online Booking System/Framework question
Hi all, I wrote a site a while back which has a booking system for event guest lists. It was my first venture into PHP, and now that it needs some more work done on it (mainly making the site more open so people don't have to sign up until they book on the guest list) I really want to rework the back-end (making it object-oriented like I should have done in the first place, cutting down the number of database requests, getting rid of the JavaScript validation, etc.), and I want to obviously make the most use of any classes/frameworks that are already out there. I've been looking at CMS such as PostNuke, but most seem to be an overkill for what I need, and the aesthetic design is pretty specific so it has to fit into that. I've also looked at using ADODB, which seems pretty useful, and PEAR, which seems to do the same and a bit more, such as HTML templates. I can find many membership management systems, but as yet haven't found any open source booking systems - anyone know of any or should I bear this in mind and release one from the outcome of this development? Can anyone recommend frameworks/starting points/websites that could be useful to me? I seem to be going round in circles at the moment and don't want to go for one particular solution in case it's the 'wrong' one and I regret it later. Once I go for a particular solution, it's going to take a lot of learning, so I don't want to (and can't afford to) waste lots of time on the wrong one. The site is http://www.belugablues.com (there's no events on it at the moment - the content manager hasn't quite got round the concept of having to keep a site up-to-date, but will do :O) - you can log in using the username 'testing' and password '123123' Many thanks in advance for your advice and help, Steve Purkiss -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange ....Date problem
I think you should convert them to dates--otherwise the server compares them as strings. Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmers Check us out on the web at http://www.phparch.com On Sun, 2002-11-10 at 09:56, Dhaval Desai wrote: Hi! If you try this in php: 2002-01-6 2002-01-10 returns true 2002-01-6 2002-01-9 returns false Jut a leading 0 in the date makes it false...this is really strange.. Any comments? _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- 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] Questions on PHP Variables
Uh, no. Your problem is obvious: $sql = SELECT * FROM users WHERE username='$_SERVER[PHP_AUTH_USER]' and password='$_SERVER[PHP_AUTH_PW]'; You have double-quotes inside a double-quoted string. Like I said, don't use quotes around the array index inside a quoted string. So change the above to: $sql = SELECT * FROM users WHERE username='$_SERVER[PHP_AUTH_USER]' and password='$_SERVER[PHP_AUTH_PW]'; Constants are not expanded inside a quoted string, so that is the correct way to handle array indices if you want to keep them inside the quoted string. -Rasmus On Sun, 10 Nov 2002, Leif K-Brooks wrote: Uh, no. That makes it think it's a constant, which generates a notice. Rasmus Lerdorf wrote: Don't use quotes around the array index inside a quoted string. -Rasmus On 10 Nov 2002, Ray Seals wrote: The fact that tutorials are outdated using old code is not a good reason to stick with it :) I agree totally. So I'm trying to use the $_Server variables but I continue to get this error: Parse error: parse error, expecting 'T_STRNG' or 'T_VARIABLE' or 'T_NUM_STRING' in blah, blah, blah on line 33. Here is the script that is doing this: ?php // File Name: auth04.php // Check to see if $PHP_AUTH_USER already contains info if (!isset($_SERVER[PHP_AUTH_USER])) { // If empty, send header causing dialog box to appear header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); exit; } else if (isset($_SERVER[PHP_AUTH_USER])) { // If non-empty, check the database for matches // connect to MySQL mysql_connect(hostname, username, password) or die (Unable to connect to database.); // select database on MySQL server mysql_select_db(dev_i2ii_com) or die (Unable to select database.); // Formulate the query $sql = SELECT * FROM users WHERE username='$_SERVER[PHP_AUTH_USER]' and password='$_SERVER[PHP_AUTH_PW]'; // Execute the query and put results in $result $result = mysql_query($sql); // Get number of rows in $result. 0 if invalid, 1 if valid. $num = mysql_numrows($result); if ($num != 0) { echo PYou're authorized!/p; exit; } else { header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } } ? -- The data base stuff hasn't been put in yet, I'm just trying to get the script to load cleanly before I trouble shoot the database connector side. Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] set_error_handler() Keeps Triggering Errors
Hi Earnest. I found these user notes in the PHP manual, but, it's confusing and seems to be a bit contradictory: -[snip]- error_reporting() has no effect if you have defined your own error handler with set_error_handler() [Editor's Note: This is not quite accurate. E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR and E_COMPILE_WARNING error levels will be handled as per the error_reporting settings. All other levels of errors will be passed to the custom error handler defined by set_error_handler(). -[/snip]- PHP's error-handling seems to need to re-working. I just can't get this to work after having tried some other things I found online. All I want is for PHP to NOT report E_NOTICE errors, but, there seems to be no way to do this, even if I re-define the E_NOTICE constant vars. Thanks. From: [EMAIL PROTECTED] (Ernest E Vogelsinger) Newsgroups: php.general Date: Sun, 10 Nov 2002 10:42:05 +0100 To: Monty [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] set_error_handler() Keeps Triggering Errors At 06:34 10.11.2002, Monty said: [snip] When I use set_error_handler('error_function') in my scripts, errors are constantly being triggered that I've never seen before. If I comment the handler function out, the errors go away. I have the error reporting set very loosely: error_reporting (E_ERROR | E_USER_ERROR) - so not sure why it It's somewhere in the docs - can't remember where just now, I believe isomewhere in the user comments for error_handler: your error_handler gets _all_ type of error,warning,notice, regardless of the actual setting of error_reporting (which only decides if the error/warning/notice gets sent to the client or not). keeps triggering an error, because the error I keep getting is: Undefined variable: target This is the same error message no matter what script I run. I don't even use a variable named $target anywhere in any of my scripts, so, this is baffling. And this seems like an E_NOTICE error message, but, I'm only asking for E_ERROR and E_USER_ERROR notices. [snip] Might point to a dynamic variable named target: ?php error_reporting(E_ALL); $varname = 'target'; if ($$varname) { ; } ? gets me Notice: Undefined variable: target in /www/test/test.php on line 4 Do a grep for target on your source files. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Replacing X-Powered-By header?
I'm trying to replace the X-Powered-By header out of security concerns. I know it can't really hurt - just me being paranoid. Anyway, I'm using: header(X-Powered-By: somethingthatisntphp,true); But it has 2 headers. Is there any way to do this? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Replacing X-Powered-By header?
See the expose_php php.ini directive. On Sun, 10 Nov 2002, Leif K-Brooks wrote: I'm trying to replace the X-Powered-By header out of security concerns. I know it can't really hurt - just me being paranoid. Anyway, I'm using: header(X-Powered-By: somethingthatisntphp,true); But it has 2 headers. Is there any way to do this? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- 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] Performance through the 4.x-series
Hi there, did anyone do any Performance measurement through the php4.x-series? I've heard that the performance decreased from 4.0.x to 4.1.x to 4.2.x ... ? Are there any numbers or benchmarks for this? Thanks in advance, Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] An interesting (at least I think) test
Hey all, I was playing around this morning with a little test to decide whether string substitution is faster or slower than concatenation. I figured that, since printing variable values is one of the most common actions in a script finding which method is best would be important. I've been suspecting that string substitution was slower and have tried not to use it as a general rule of thumbs. I found it sort-of interesting that--at least according to my test--string substitution is significantly slower than concatenation by quite a bit (like 40%). Here's my script--let me know if you find any flaws that skew the results: ? $num_tries = 50; function print_microtime($t) { $t = explode (' ', $t); return number_format ($t[1]+$t[0], 10); } function print_microtime_diff($t1, $t2, $res) { $t1 = explode (' ', $t1); $t2 = explode (' ', $t2); $res = ($t2[1] + $t2[0]) - ($t1[1] + $t1[0]); return number_format ($res, 10); } $start = microtime(); $s = 'test string'; for ($i = 0; $i $num_tries; $i++) $a = 'test ' . $s . ' string'; $end = microtime(); echo Normal concatenation\n; echo 'Start: ' . print_microtime($start) . \n; echo 'End: ' . print_microtime($end) . \n; echo 'Diff: ' . print_microtime_diff ($start, $end, $diff1) . \n\n; $start = microtime(); $s = 'test string'; for ($i = 0; $i $num_tries; $i++) $a = test $s string; $end = microtime(); echo String substitution\n; echo 'Start: ' . print_microtime($start) . \n; echo 'End: ' . print_microtime($end) . \n; echo 'Diff: ' . print_microtime_diff ($start, $end, $diff2) . \n\n; echo 'Difference in timing: ' . ($diff2 - $diff1) . ' (' . number_format (($diff2 - $diff1) / $diff1 * 100, 2) . %)\n\n; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance through the 4.x-series
You have heard? There have been a number of performance improvements in many different areas of php actually. -Rasmus On Sun, 10 Nov 2002, Thomas Seifert wrote: Hi there, did anyone do any Performance measurement through the php4.x-series? I've heard that the performance decreased from 4.0.x to 4.1.x to 4.2.x ... ? Are there any numbers or benchmarks for this? Thanks in advance, Thomas -- 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] 2 questions about PHP download
Is it possible to use the PHP-extentions for Apahce with the PHP for the CGI version, while the version number matches? What is the md5-hash beneath the download for? Regards, Sumarlidi E. Dadason SED - Graphic Design _ Tel: 896-0376, 461-5501 E-mail: [EMAIL PROTECTED] website: www.sed.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 2 questions about PHP download
Is it possible to use the PHP-extentions for Apahce with the PHP for the CGI version, while the version number matches? Yes What is the md5-hash beneath the download for? To verify that the file you download (from a mirror, for example) matches the official tarball from www.php.net and hasn't been modified in some way. Check it with md5sum from the command line. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange ....Date problem
Why is it strange? By default strings are sorted alphabetically. 6 10 when sorted alphabetically. Convert your strings to numbers in some logical manner and compare numbers or easier, use strnatcmp() to compare the strings directly using a natural alphanumeric comparison. -Rasmus On Sun, 10 Nov 2002, Dhaval Desai wrote: Hi! If you try this in php: 2002-01-6 2002-01-10 returns true 2002-01-6 2002-01-9 returns false Jut a leading 0 in the date makes it false...this is really strange.. Any comments? _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- 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] attachement
see http://phpmailer.sourceforge.net -js Oliver Witt wrote: Hi, I wrote a php script that's supposed to enable me to attach files to an email. However, the attached files ends up being a mess of letters. Hallo becomes SGFsbG8=. That must have to do with encoding. Is that a common problem or do you need the entire script? Thanks, Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create associative array from comments by preg
Here's the code... -js $string = EOF !-- comname 1--! value 1 !-- end comname 1--! !-- comname 2--! value 2 !-- end comname 2--! EOF; preg_match_all('/!--\s*(.*)\s*--!\s*(.*)\s*!--\s*end\s*\\1\s*--!/i', $string, $matched); $array = array(); foreach ( $matched[1] AS $i = $m ) { $array[$m] = $matched[2][$i]; } Alawi albaity wrote: I have comments like that : !-- comname1 --! value1 !-- end comname1 --! !-- comname2 --! value2 !-- end comname2 --! Now : How can me get associative array like this $var[comname1] = value1; $var[comname2] = value2; can any body help me to do that ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Most current non-beta version, and bcc
Thanks to everyone who kindly responded with their views regarding whether or not PHP v.4.2.3. is a beta version or not a beta version. Because the opinions offered were so adamant and so contradictory, I contacted Zend. I just received the reply (below)... Hi Jill, Nice talking with you the other day and thanks for your follow-up email. PHP v. 4.2.3 is definitely not a beta version. I checked with Zev Suraski who is one of the developers of the Zend engine, the scripting language that powers PHP. At 09:16 PM 11/7/02 -0700, you wrote: At 02:38 PM 11/7/02 -0600, Jill S wrote: so again I'll ask - Are the 4.2.3 downloads at the top of the page at: http://www.php.net/downloads/ beta versions or non-beta versions? 4.2.3 is currently the latest stable released version of PHP. Yes, that means NOT BETA. Anything that makes it to the downloads page is stable code. 4.3.0 should be out soon, but is not yet considered stable. It has also passed the BETA state and is in its second pre-release final testing. If you want to get it you have to look at snaps.php.net or the CVS server. Code from these sources is under active development and at any given time may not even compile. (Not that it happens often.) I can understand why a hosting provider might not want to run them. On the other hand I switched to PHP4 at Beta 2 and never looked back. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Most current non-beta version, and bcc
Who in the world told you that 4.2.3 was beta? On Sun, 10 Nov 2002, Jill S wrote: Thanks to everyone who kindly responded with their views regarding whether or not PHP v.4.2.3. is a beta version or not a beta version. Because the opinions offered were so adamant and so contradictory, I contacted Zend. I just received the reply (below)... Hi Jill, Nice talking with you the other day and thanks for your follow-up email. PHP v. 4.2.3 is definitely not a beta version. I checked with Zev Suraski who is one of the developers of the Zend engine, the scripting language that powers PHP. At 09:16 PM 11/7/02 -0700, you wrote: At 02:38 PM 11/7/02 -0600, Jill S wrote: so again I'll ask - Are the 4.2.3 downloads at the top of the page at: http://www.php.net/downloads/ beta versions or non-beta versions? 4.2.3 is currently the latest stable released version of PHP. Yes, that means NOT BETA. Anything that makes it to the downloads page is stable code. 4.3.0 should be out soon, but is not yet considered stable. It has also passed the BETA state and is in its second pre-release final testing. If you want to get it you have to look at snaps.php.net or the CVS server. Code from these sources is under active development and at any given time may not even compile. (Not that it happens often.) I can understand why a hosting provider might not want to run them. On the other hand I switched to PHP4 at Beta 2 and never looked back. Rick -- 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] An interesting (at least I think) test
I think you shouldn't be care much about it as I would call it with one word - paranoia. I have made these tests long ago and some are even present on www.phpbeginner.com. Basically double quotes with one or two variables in it is faster. Then goes concatenation via single quotes and dot. But, the fastest of all is actually inline php (when you leave php with ? and return to it again ?php). Anyhow, these can rarely be of any importance to you as this makes really no big difference within the script. Assuming you learn how to use it -- you will save %0.001 percent of execution speed. Simply use single quotes all the time unless you need to stick variables into the string. -- Maxim Maletsky [EMAIL PROTECTED] On 10 Nov 2002 10:51:49 -0500 Marco Tabini [EMAIL PROTECTED] wrote: Hey all, I was playing around this morning with a little test to decide whether string substitution is faster or slower than concatenation. I figured that, since printing variable values is one of the most common actions in a script finding which method is best would be important. I've been suspecting that string substitution was slower and have tried not to use it as a general rule of thumbs. I found it sort-of interesting that--at least according to my test--string substitution is significantly slower than concatenation by quite a bit (like 40%). Here's my script--let me know if you find any flaws that skew the results: ? $num_tries = 50; function print_microtime($t) { $t = explode (' ', $t); return number_format ($t[1]+$t[0], 10); } function print_microtime_diff($t1, $t2, $res) { $t1 = explode (' ', $t1); $t2 = explode (' ', $t2); $res = ($t2[1] + $t2[0]) - ($t1[1] + $t1[0]); return number_format ($res, 10); } $start = microtime(); $s = 'test string'; for ($i = 0; $i $num_tries; $i++) $a = 'test ' . $s . ' string'; $end = microtime(); echo Normal concatenation\n; echo 'Start: ' . print_microtime($start) . \n; echo 'End: ' . print_microtime($end) . \n; echo 'Diff: ' . print_microtime_diff ($start, $end, $diff1) . \n\n; $start = microtime(); $s = 'test string'; for ($i = 0; $i $num_tries; $i++) $a = test $s string; $end = microtime(); echo String substitution\n; echo 'Start: ' . print_microtime($start) . \n; echo 'End: ' . print_microtime($end) . \n; echo 'Diff: ' . print_microtime_diff ($start, $end, $diff2) . \n\n; echo 'Difference in timing: ' . ($diff2 - $diff1) . ' (' . number_format (($diff2 - $diff1) / $diff1 * 100, 2) . %)\n\n; ? -- 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] fs functions unicode
Php file system functions seem to hate unicode paths or filenames. I was working on generic download script and it works fine for regular ascii(?) files but when i tried a unicode-named file it failed. $file1 = c:\blah\I've Sound [Air] $BD;$N;m(B(Lia).mp3 $file2 = c:\blah\bleh.mp3 readfile, fopen, filesize etc... fail on $file1, but succeed on $file2. consider the following: $fn = $_POST[filename]; $enfn = urlencode($_POST[filename]); header (Content-type: octet/stream); header (Content-disposition: attachment; filename=.basename($encfn).;); header (Content-Length: .filesize($fn)); //fails readfile($fn); //fails exit; is unicode support in filesystem functions non-existant or am i doing something wrong? is there a work around? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] enable CLI
I'm running PHP4 on Mac OS 10.2.1 using Marc Liyanage's binaries compiled with --disable-cli option .Is there any possibility to install an extension to enable CLI ? Thanks for your help . Pierre Vaudrey email [EMAIL PROTECTED]
[PHP] Re: attachement
Hello, On 11/10/2002 11:31 AM, Oliver Witt wrote: Hi, I wrote a php script that's supposed to enable me to attach files to an email. However, the attached files ends up being a mess of letters. Hallo becomes SGFsbG8=. That must have to do with encoding. Is that a common problem or do you need the entire script? You need to specify that the encoding is base64. You may want to try this class that is able to compose and send complex messages that include adding attachments, HTML messages with embedded images, message bodies with alternative text and HTML versions, etc.. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance through the 4.x-series
Sorry, yeah I've heard and I cannot prove it, therefore I ask. I didn't want to troll or similar, just curious about it. Are there any benchmarks through the different versions with a common-app or similar available? Regards, Thomas On Sun, 10 Nov 2002 08:08:04 -0800 (PST) Rasmus Lerdorf [EMAIL PROTECTED] wrote: You have heard? There have been a number of performance improvements in many different areas of php actually. -Rasmus On Sun, 10 Nov 2002, Thomas Seifert wrote: Hi there, did anyone do any Performance measurement through the php4.x-series? I've heard that the performance decreased from 4.0.x to 4.1.x to 4.2.x ... ? Are there any numbers or benchmarks for this? Thanks in advance, Thomas -- 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] An interesting (at least I think) test
I have made these tests long ago and some are even present on www.phpbeginner.com. Basically double quotes with one or two variables in it is faster. Then goes concatenation via single quotes and dot. But, the fastest of all is actually inline php (when you leave php with ? and return to it again ?php). Except concatenation is the fastest in my tests... But, yeah, it's probably not all *that* important. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance through the 4.x-series
Not that I know of. On Sun, 10 Nov 2002, Thomas Seifert wrote: Sorry, yeah I've heard and I cannot prove it, therefore I ask. I didn't want to troll or similar, just curious about it. Are there any benchmarks through the different versions with a common-app or similar available? Regards, Thomas On Sun, 10 Nov 2002 08:08:04 -0800 (PST) Rasmus Lerdorf [EMAIL PROTECTED] wrote: You have heard? There have been a number of performance improvements in many different areas of php actually. -Rasmus On Sun, 10 Nov 2002, Thomas Seifert wrote: Hi there, did anyone do any Performance measurement through the php4.x-series? I've heard that the performance decreased from 4.0.x to 4.1.x to 4.2.x ... ? Are there any numbers or benchmarks for this? Thanks in advance, Thomas -- 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] set_error_handler() Keeps Triggering Errors
On Sun, 10 Nov 2002 10:48:46 -0500, you wrote: Hi Earnest. I found these user notes in the PHP manual, but, it's confusing and seems to be a bit contradictory: It's simple: A user defined error handler cannot handle parse errors or compile time errors. That makes sense to me...if your script doesn't parse and can't complete the compile phase then how would you expect your custom function to be able to handle the error? It hasn't been compiled yet... I just can't get this to work after having tried some other things I found online. All I want is for PHP to NOT report E_NOTICE errors, but, there seems to be no way to do this, even if I re-define the E_NOTICE constant vars. The answer is in the editor's note that you quoted, two paragraphs after you snipped the quote: if (!($type error_reporting())) return; $type is the error code..i.e. the first parameter passed to your error handler. Add that line to the top of your error handling function and it will behave the way you expect. PHP's error reporting value is a bitmask...a combination of all of the error type constants that you want PHP to report. The line of code above takes the current error's bit value and does a bitwise AND with the error reporting level. If the result is 0, that means that the current error's bit value is not turned on in the current error reporting level. If this is so, then the line above will return from your error handling function without doing anything...effectively ignoring the error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP's mail() function doesn't work on my server
I have sendmail installed and the path to it in the php.ini is correct, when i try a file just containing the mail() function (no errors in that!) it starts sendmail but nothing gets sent! root 22508 0.0 0.2 3556 1520 pts/2S20:09 0:00 php test.php smmsp22509 0.0 0.2 3416 1440 pts/2S20:09 0:00 /usr/sbin/sendmail -t -i help!
[PHP] Global variables question
Hi, i got this project i'm building right now. It basically a core system to do adminsitrative modules for web sites. I got tons of classes that get created on call of a function like sql_setup(), frm_setup(). These functions create the objects from the classes so they can be used later in other objects...yada yada yada... Now my thing is, instead of always starting my method of an object with global sql_server; and global frm_builder, is there a way that these variables are declared as global automatically, just like i would get $_GET[], $_POST[] and so on, they are already global. I want to do this to simplify development since this project is going to be HUGE. And also it will facilitate debugging as i've been using global at a lot of places and when you forget one, PHP assumes the creation of a dummy variable messing up everything. I'm waiting for an anwser, thank you Mathieu Dumoulin Programmer / Analayst in web solutions Groupimage Comunications -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: upload whole direcotry using ftp functions
i seriously dont get it how are you suppose to use the ftp functions if the only way is via the browser uploader which goes to the server first anyway ?? Justin French [EMAIL PROTECTED] wrote in message news:B9F47504.16CA2%justin;indent.com.au... From the browser window, I believe you can only upload individual files to the server... you can do multiples at once, but you can't (IMHO) upload an entire directory off your desktop THROUGH your browser, to the server. You could .zip, .tar or .sit a folder of course, but then you'd have to uncompress on the server, which is possible for SOME compression types. Justin on 10/11/02 7:30 PM, AKHIL KODALI ([EMAIL PROTECTED]) wrote: Its a question. I want to know if there is any method to upload a directory, If yes, then how. On Sun, 10 Nov 2002, electroteque wrote: was this an answer or a question ? Akhil Kodali [EMAIL PROTECTED] wrote in message news:Pine.LNX.4.44.0211091958120.10474-10;gdit.iiit.net... Hi, I there anyway to upload entire directory. -- AKHIL K 200101009 Room No. 15 BH-2 IIIT -- Look at me. My life has no meaning or direction, and I'm happy Creative Director http://Indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] enable CLI
Le dimanche, 10 nov 2002, à 12:24 Europe/Paris, .: B i g D o g :. a écrit : The best way to enable cli is to re-configure php without apache and everything else you want. You mean 2 PHP implementation : one for Apache(existing) and a new one standalone ? I like to add --bindir to the configuration so i can put the executable in the /usr/local/bin directory for my cli programs.. This should work for you and create a cli executable program that you can use... On Sun, 2002-11-10 at 18:00, Pierre Vaudrey wrote: I'm running PHP4 on Mac OS 10.2.1 using Marc Liyanage's binaries compiled with --disable-cli option .Is there any possibility to install an extension to enable CLI ? Thanks for your help . Pierre Vaudrey email [EMAIL PROTECTED] -- .: B i g D o g :. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Would appreciate thoughts on session management
Hello, I'm about to implement session management, and I'm considering rolling my own instead of using PHP's. Specifically, I'm considering using hidden fields for persistent object properties because (1) I don't want cookies to be an issue, (2) I prefer not to have session IDs appear in a URL, and (3) I prefer not to use require a database just to store persistent properties. Are there drawbacks to storing persistent object properties as a serialized value in hidden fields that I'm missing? This is a newbie's first major web application, so I really appreciate your input. -- Charles Wiltgen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Online Booking System/Framework question
Lots of good ideas here: http://www.databaseanswers.com/data_models/index.htm olinux --- Steve Purkiss [EMAIL PROTECTED] wrote: Hi all, I wrote a site a while back which has a booking system for event guest lists. It was my first venture into PHP, and now that it needs some more work done on it (mainly making the site more open so people don't have to sign up until they book on the guest list) I really want to rework the back-end (making it object-oriented like I should have done in the first place, cutting down the number of database requests, getting rid of the JavaScript validation, etc.), and I want to obviously make the most use of any classes/frameworks that are already out there. I've been looking at CMS such as PostNuke, but most seem to be an overkill for what I need, and the aesthetic design is pretty specific so it has to fit into that. I've also looked at using ADODB, which seems pretty useful, and PEAR, which seems to do the same and a bit more, such as HTML templates. I can find many membership management systems, but as yet haven't found any open source booking systems - anyone know of any or should I bear this in mind and release one from the outcome of this development? Can anyone recommend frameworks/starting points/websites that could be useful to me? I seem to be going round in circles at the moment and don't want to go for one particular solution in case it's the 'wrong' one and I regret it later. Once I go for a particular solution, it's going to take a lot of learning, so I don't want to (and can't afford to) waste lots of time on the wrong one. The site is http://www.belugablues.com (there's no events on it at the moment - the content manager hasn't quite got round the concept of having to keep a site up-to-date, but will do :O) - you can log in using the username 'testing' and password '123123' Many thanks in advance for your advice and help, Steve Purkiss -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Would appreciate thoughts on session management
on 11/11/02 7:41 AM, Charles Wiltgen ([EMAIL PROTECTED]) wrote: Are there drawbacks to storing persistent object properties as a serialized value in hidden fields that I'm missing? This is a newbie's first major web application, so I really appreciate your input. Doesn't that mean you'd have to use forms for getting between each page? There are only three ways to pass a session ID around: 1. via the URL (GET) 2. via cookies 3. via a form (POST) If you categorically rule out 1 2, then you're left with 3. 3 means that every link across your site has to be a form submit. Yuk!!! Or have I misunderstood your question? Justin French Creative Director http://Indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fw: esayphp
Hi I have installed esayphp v 1.4.0.0 on my pc (windows 98) . How can I know the version of PHP and of mysql ? Thanks
Re: [PHP] Fw: esayphp
? phpinfo(); ? -- Maxim Maletsky [EMAIL PROTECTED] On Sun, 10 Nov 2002 22:42:59 - Iguider [EMAIL PROTECTED] wrote: Hi I have installed esayphp v 1.4.0.0 on my pc (windows 98) . How can I know the version of PHP and of mysql ? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fw: esayphp
thanks a lot - Original Message - From: Maxim Maletsky [EMAIL PROTECTED] To: Iguider [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, November 10, 2002 10:48 PM Subject: Re: [PHP] Fw: esayphp ? phpinfo(); ? -- Maxim Maletsky [EMAIL PROTECTED] On Sun, 10 Nov 2002 22:42:59 - Iguider [EMAIL PROTECTED] wrote: Hi I have installed esayphp v 1.4.0.0 on my pc (windows 98) . How can I know the version of PHP and of mysql ? Thanks __ Modem offert : 150,92 euros remboursés sur le Pack eXtense de Wanadoo ! Haut débit à partir de 30 euros/mois : http://www.ifrance.com/_reloc/w __ Modem offert : 150,92 euros remboursés sur le Pack eXtense de Wanadoo ! Haut débit à partir de 30 euros/mois : http://www.ifrance.com/_reloc/w -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql DECODE question
SELECT DECODE(ENCODE('password', 'sec'), 'sec') - password When I try: SELECT DECODE(ENCODE('password', 'sec'), 'SUBSTRING(secret,1,3)'); or without quotes around SUBSTRING function This does not produce the same output, i am not sure what the problem is. Ben __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Global variables question
At 21:49 10.11.2002, Mathieu Dumoulin said: [snip] Hi, i got this project i'm building right now. It basically a core system to do adminsitrative modules for web sites. I got tons of classes that get created on call of a function like sql_setup(), frm_setup(). These functions create the objects from the classes so they can be used later in other objects...yada yada yada... Now my thing is, instead of always starting my method of an object with global sql_server; and global frm_builder, is there a way that these variables are declared as global automatically, just like i would get $_GET[], $_POST[] and so on, they are already global. I want to do this to simplify development since this project is going to be HUGE. And also it will facilitate debugging as i've been using global at a lot of places and when you forget one, PHP assumes the creation of a dummy variable messing up everything. [snip] Hi Mathieu, to begin with, if this project is HUGE as you said, try to avoid globals as good as you can - they're absolze poison for the readability, stability, and scalability of any application that extends a single source file with a couple of lines. Of course this is only MHO, I'm sure others will chime in here. I am currently working on an application core that's expected to work with a nice number of objects, and it is not feasible here to have objects a) global and simply not possible to have every part of the application using its own reference to the object instance. What I did is to create a container for objects and wrap it into a class I call CCache. As soon as an object gets instantiated it registers itself with the cache (being uniquely identified by Type and ID). Any part of the application simply calls the systemwide cache object with type and ID to retrieve a reference to the specific object it needs just now. I did a performance profiling on this system, and retrieving an object reference from the cache needs approx. 0.001 msec. Just to tell you, not even the cache object is global - there is a public wrapper function around it to return a reference to the global cache object. Currently we have approx. 85,000 lines of code, and absolutely no global variable of our own... -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Would appreciate thoughts on session management
At 22:41 10.11.2002, Charles Wiltgen said: [snip] I'm about to implement session management, and I'm considering rolling my own instead of using PHP's. Hmm - NIH syndrome? (not invented here) Specifically, I'm considering using hidden fields for persistent object properties because (1) I don't want cookies to be an issue, (2) I prefer not to have session IDs appear in a URL, and (3) I prefer not to use require a database just to store persistent properties. [snip] As Justin already pointed out you make yourself stick to forms, not allowing any normal page be session-dependent - but that's only one of the drawbacks. The issue that would disturb me the most is data security - if you use the client browser to store object persistent data this opens up a whole world of possibilities to hack your data... Of course you could always check if the hidden fields are still ok, using some md5 or whetever, but why the hassle? If you don't want cookies (I too don't use them for a session and have disabled session cookies in our php.ini), PHP will transparently merge the session identifier into its output (as long as you don't use ob_gzhandler, that is). But why don't you like the session ID magled into links? prefer not to use a database - that's not the case with standard php sessions, they get written to a file somewhere. Just make sure that this somewhere is a) read/writable by apache b) not read/writable by anyone else and you are (relatively) secure. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Would appreciate thoughts on session management
Justin wrote... ...every link across your site has to be a form submit. Yuk!!! Yeah, yuk. I'm very silly and didn't realize this until after I'd posted. It's possible since links will be generated automatically, but yuk. Ernest wrote... Hmm - NIH syndrome? (not invented here) No, I'm far too lazy for that luxury. :^) If you don't want cookies (I too don't use them for a session and have disabled session cookies in our php.ini), PHP will transparently merge the session identifier into its output (as long as you don't use ob_gzhandler, that is). But why don't you like the session ID magled into links? Well, I'm still a newbie to PHP, and for some reason thought that all persistant data (not just the session ID) would have to be serialized into the links. Many thanks, Justin and Ernest, for straightening me out on PHP sessions -- my only excuse is that the otherwise very-helpful Professional PHP Programming barely discusses them. -- Charles Wiltgen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How good is PHP to ASP?
Hi all, I'm not too sure if this is the right place to get my answers but I really need to know this: How can I convince my clients that PHP is really good? I mean not a lot of non-programmers have heard of PHP language. Most of them only heard of things like C/C++, ASP and the like. So, how can I prove to them that PHP is a much better language to use? Can anyone point me to the right resources for me to show and prove to my clients? Thanks a lot and sorry if this is the wrong place to ask this question. Yours, Wee Keat Chin --- Don't find a fault; find a remedy
RE: [PHP] How good is PHP to ASP?
First off, I wouldn't go comparing one language to another as better (a jihad has broken out on another list between Perl and PHP, substituting belief for anything remotely resembling a civilized and intelligent discussion), but if you want to convince them about the merits of PHP, look up the news stories about Yahoo abandoning its own proprietary language for PHP. Also, if any of your clients have experience with Perl, you can use the comparison about regular expression handling there. You can also refer to http://www.php.net/usage.php for a description of the popularity of PHP. -Original Message- From: Wee Keat [Amorphosium] [mailto:weekeat;amorphosium.com] Sent: Sunday, November 10, 2002 6:42 PM To: PHP [General] Subject: [PHP] How good is PHP to ASP? Hi all, I'm not too sure if this is the right place to get my answers but I really need to know this: How can I convince my clients that PHP is really good? I mean not a lot of non-programmers have heard of PHP language. Most of them only heard of things like C/C++, ASP and the like. So, how can I prove to them that PHP is a much better language to use? Can anyone point me to the right resources for me to show and prove to my clients? Thanks a lot and sorry if this is the wrong place to ask this question. Yours, Wee Keat Chin --- Don't find a fault; find a remedy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] missing Parser Error ?
why PHP don't return a parse error here ? code case browse : $text = $myobject-browse();;; // some codes ... break; /code i guess syntax isn't correct or what do you think ?! Best regards Hatem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] missing Parser Error ?
At 02:51 11.11.2002, Hatem Ben said: [snip] why PHP don't return a parse error here ? code case browse : $text = $myobject-browse();;; // some codes ... break; /code i guess syntax isn't correct or what do you think ?! [snip] hmm - it's a little bit inefficient in terms of nanosecs, but syntactically correct. You simply have 18 successive empty statements... -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How good is PHP to ASP?
oh man you missed a great opportunity, through the last few days some one posted a message saying convince the boss containing a list of well-known websites running PHP, go check the list archive it will be available there _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 11 Nov 2002 02:14:57 -0000 Issue 1697
php-general Digest 11 Nov 2002 02:14:57 - Issue 1697 Topics (messages 123687 through 123738): Re: attachement 123687 by: Oliver Witt 123691 by: Ernest E Vogelsinger 123692 by: Oliver Witt 123708 by: Jonathan Sharp 123715 by: Manuel Lemos Re: Questions on PHP Variables 123688 by: Ray Seals 123689 by: Rasmus Lerdorf 123690 by: Leif K-Brooks 123693 by: Ernest E Vogelsinger 123698 by: Rasmus Lerdorf Strange Date problem 123694 by: Dhaval Desai 123697 by: Marco Tabini 123707 by: Rasmus Lerdorf PHP installation _ help needed 123695 by: Bob G Online Booking System/Framework question 123696 by: Steve Purkiss 123725 by: olinux Re: set_error_handler() Keeps Triggering Errors 123699 by: Monty 123719 by: Michael Sims Replacing X-Powered-By header? 123700 by: Leif K-Brooks 123701 by: Rasmus Lerdorf Performance through the 4.x-series 123702 by: Thomas Seifert 123704 by: Rasmus Lerdorf 123716 by: Thomas Seifert 123718 by: Rasmus Lerdorf An interesting (at least I think) test 123703 by: Marco Tabini 123712 by: Maxim Maletsky 123717 by: Marco Tabini 2 questions about PHP download 123705 by: SED 123706 by: Rasmus Lerdorf Re: Create associative array from comments by preg 123709 by: Jonathan Sharp Re: Most current non-beta version, and bcc 123710 by: Jill S 123711 by: Rasmus Lerdorf fs functions unicode 123713 by: Carlos enable CLI 123714 by: Pierre Vaudrey 123723 by: Pierre Vaudrey PHP's mail() function doesn't work on my server 123720 by: unknown Global variables question 123721 by: Mathieu Dumoulin 123731 by: Ernest E Vogelsinger Re: upload whole direcotry using ftp functions 123722 by: electroteque Would appreciate thoughts on session management 123724 by: Charles Wiltgen 123726 by: Justin French 123732 by: Ernest E Vogelsinger 123733 by: Charles Wiltgen Re: esayphp 123727 by: Iguider 123728 by: Maxim Maletsky 123729 by: Iguider mysql DECODE question 123730 by: Donahue Ben How good is PHP to ASP? 123734 by: Wee Keat [Amorphosium] 123735 by: John Meyer 123738 by: Khalid El-Kary missing Parser Error ? 123736 by: Hatem Ben 123737 by: Ernest E Vogelsinger 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--- Ernest E Vogelsinger schrieb: In your mail headers, you should see some MIME like Content-Type: multipart/alternative; boundary=GU4wuTSk68F (alternative could also read related - depends on the content, the multipart is the point here) which would tell the client browser that the next mail consists of a couple of separate parts, with a separator line as --GU4wuTSk68F. I had it set like this: $fp = fopen($file, r); $contents = fread($fp, $file_size); $encoded_file = chunk_split(base64_encode($contents)); fclose($fp); unset($header); $header = FROM:$name_abs$adresse_abs\n; $header.= MIME-version: 1.0\n; $header.= Content-type: multipart/mixed; ; $header.= boundary=\Message-Boundary\\n; $header.= Content-transfer-encoding: 7BIT\n; $header.= X-attachments: $file_name; $body = --Message-Boundary\n; $body .= Content-type: text/plain; charset=US-ASCII\n; $body .= Content-Disposition: inline; $body .= Content-transfer-encoding: 7BIT\n; $body .= Content-description: Mail message body\n\n; $body .= $text; $body.= \n\n--Message-Boundary\n; $body.= Content-type: $file_type; name=\$file_name\\n; $body.= Content-Transfer-Encoding: PLAINTEXT\n; $body.= Content-disposition: attachment; filename=\$file_name\\n\n; $body.= $encoded_file\n; $body.= --Message-Boundary--\n; That's the same as a friend of mine uses it. He's saying it's working fine... I'll try to do what you told me. Olli ---End Message--- ---BeginMessage--- At 15:27 10.11.2002, Oliver Witt said: [snip] I had it set like this: $fp = fopen($file, r); $contents = fread($fp, $file_size); $encoded_file = chunk_split(base64_encode($contents)); fclose($fp); ... $body.= \n\n--Message-Boundary\n; $body.= Content-type: $file_type; name=\$file_name\\n; $body.= Content-Transfer-Encoding: PLAINTEXT\n; $body.= Content-disposition: attachment; filename=\$file_name\\n\n; $body.= $encoded_file\n; $body.= --Message-Boundary--\n; [snip] You must not give PLAINTEXT as encoding when you have it base64... use: Content-Transfer-Encoding: base64 BTW, PLAINTEXT is not a MIME recognized
RE: [PHP] How good is PHP to ASP?
I've noticed this question a fair bit, having to convince clients and employers of a technology.. DO you guys really have that much trouble selling php?? I tend to leave the development environment out of conversations all together and talk product features, scalability, promotion etc I do this with both the PHP and ASP projects I build. If you really need to convince someone then there the kind of person people who would really only need a name to associate things to. This list was posted a few days ago... This list is designed to convice teh boss (no type-o). If your boss is a bandwagon kind of guy, afraid to take risks, this is for you- er- him. And you. Him in that he can read it, you in that if he accepts LAMP, you're life will be a much more joyous existance ;) - Apache: By far the most popular web server, with 60.54% market share. Its closest competitor, Microsoft's IIS, has 28.89%. If all variants of each server are counted, Apache's install base increases to 62.17%, while IIS manages 29.42%). Statistics are from http://www.netcraft.net/survey Apache users: Yahoo! Amazon.com AltaVista BBC mp3.com SlashDot HP W3C IBM Verizon FEMA Infoseek PHP: In April 2002, PHP overtook ASP as the #1 server-side scripting language on the internet. In April, PHP was used by 24% of the sites on the Internet. Over the past two years PHP has averaged a 6.5% monthly growth rate. Source: zend.com/news/zendpr.php?id=49 PHP users: Cisco CMG Vodafone Motorola Siemens Ericsson CBS Unilever Philips BMC NTT Air Canada Lufthansa OnVista Lycos Europe Deutsche Bank NASA W3C MySQL: It isn't as easy to determine which database a site uses, but here is a list of sites that do use MySQL, according to MySQL.com: Yahoo! Finance Texas Instruments U.S. Census Bureau NASA Omaha Steaks Slashdot Cross Media Marketing Corp Powell's Books Department of Academic Information Systems Avacom Net Services Blue World Communications CoreSense Ericsson handy.de mobile.de Nemo-Q Silicon Storage Technology, Inc. Virage Linux: I can't find a list for this... I figured these out by trying big sites that came to mind. I didn't encounter a single Microsoft site, but I did get a few *BSD sites, and several Solaris sites. FBI Google Amazon AltaVista Slashdot Verizon FEMA CNN Security: Here's a list of security companies/groups that run any LAMP component: Security Focus(LA) Symantec (L) CERT (LA) Packet Storm (A) FBI (L) OSVDB (LA) At Stake (LA) Netcraft (LA) TESO (L) Phenoelit (LA) Doxpara (LAP) NGS Software (LAMP) PivX (LAP) Grey Magic(LAMP) Phrack(AP) *** -Original Message- From: Wee Keat [Amorphosium] [mailto:weekeat;amorphosium.com] Sent: Monday, November 11, 2002 11:42 AM To: PHP [General] Subject: [PHP] How good is PHP to ASP? Hi all, I'm not too sure if this is the right place to get my answers but I really need to know this: How can I convince my clients that PHP is really good? I mean not a lot of non-programmers have heard of PHP language. Most of them only heard of things like C/C++, ASP and the like. So, how can I prove to them that PHP is a much better language to use? Can anyone point me to the right resources for me to show and prove to my clients? Thanks a lot and sorry if this is the wrong place to ask this question. Yours, Wee Keat Chin --- Don't find a fault; find a remedy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Submit hitting enter problem
What am I missing? My form does not submit when I hit enter in the text box. I do something approximately like this : form action=index.php?s=add method=post input type=text name=bongabe value=something ... input type=submit value=submit name=submit // Thanks in advance.
Re: [PHP] mysql DECODE question
SELECT DECODE(ENCODE('password', 'sec'), SUBSTRING(secret,1,3)); if you put quotes around substring function, mysql considere it as a string, so I think you shouldn't. After, are you sure that the correct table field name is the weirdthing encoded by this function : ENCODE('password', 'sec') ??? if so, show us, the script that allow you to record the password ? - Original Message - From: Donahue Ben [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 11, 2002 11:13 AM Subject: [PHP] mysql DECODE question SELECT DECODE(ENCODE('password', 'sec'), 'sec') - password When I try: SELECT DECODE(ENCODE('password', 'sec'), 'SUBSTRING(secret,1,3)'); or without quotes around SUBSTRING function This does not produce the same output, i am not sure what the problem is. Ben __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- 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 good is PHP to ASP?
You can also tell them that some 10 million websites run PHP, including the most popular one--Yahoo!. Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmers Check us out on the web at http://www.phparch.com On Sun, 2002-11-10 at 20:41, Wee Keat [Amorphosium] wrote: Hi all, I'm not too sure if this is the right place to get my answers but I really need to know this: How can I convince my clients that PHP is really good? I mean not a lot of non-programmers have heard of PHP language. Most of them only heard of things like C/C++, ASP and the like. So, how can I prove to them that PHP is a much better language to use? Can anyone point me to the right resources for me to show and prove to my clients? Thanks a lot and sorry if this is the wrong place to ask this question. Yours, Wee Keat Chin --- Don't find a fault; find a remedy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How good is PHP to ASP?
Search google.com for PHP case studies, also http://www.zend.com/links/links.php has a few links to sites about PHP vs. ASP. You might also enlighten them about the differences of open source and Microsoft licensing. Bottom line is if you have to make a product something it isn't to sell a client you shouldn't be using that technology. Jason On Sun, 2002-11-10 at 20:03, Marco Tabini wrote: You can also tell them that some 10 million websites run PHP, including the most popular one--Yahoo!. Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmers Check us out on the web at http://www.phparch.com On Sun, 2002-11-10 at 20:41, Wee Keat [Amorphosium] wrote: Hi all, I'm not too sure if this is the right place to get my answers but I really need to know this: How can I convince my clients that PHP is really good? I mean not a lot of non-programmers have heard of PHP language. Most of them only heard of things like C/C++, ASP and the like. So, how can I prove to them that PHP is a much better language to use? Can anyone point me to the right resources for me to show and prove to my clients? Thanks a lot and sorry if this is the wrong place to ask this question. Yours, Wee Keat Chin --- Don't find a fault; find a remedy -- 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] Submit hitting enter problem
on 11/11/02 12:44 PM, rija ([EMAIL PROTECTED]) wrote: input type=text name=bongabe value=something I think you need to use a textarea if you wish for the returns to be submitted. Cheers Justin French Creative Director http://Indent.com.au Web Developent Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Submit hitting enter problem
Thanks for your quick answer, But it doesn't change anything. textarea change my text box into big text area- So I always have to click on submit button to submit the form. - Original Message - From: Justin French [EMAIL PROTECTED] To: [EMAIL PROTECTED]; php [EMAIL PROTECTED] Sent: Monday, November 11, 2002 3:45 PM Subject: Re: [PHP] Submit hitting enter problem on 11/11/02 12:44 PM, rija ([EMAIL PROTECTED]) wrote: input type=text name=bongabe value=something I think you need to use a textarea if you wish for the returns to be submitted. Cheers Justin French Creative Director http://Indent.com.au Web Developent Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Submit hitting enter problem
Return key presses in a textarea will usually be converted into a newline (\n). Making your browser submit the form when you press enter is an HTML/Browser issue. You probably should look at a javascript solution because this is a client side problem. Jason On Sun, 2002-11-10 at 21:16, rija wrote: Thanks for your quick answer, But it doesn't change anything. textarea change my text box into big text area- So I always have to click on submit button to submit the form. - Original Message - From: Justin French [EMAIL PROTECTED] To: [EMAIL PROTECTED]; php [EMAIL PROTECTED] Sent: Monday, November 11, 2002 3:45 PM Subject: Re: [PHP] Submit hitting enter problem on 11/11/02 12:44 PM, rija ([EMAIL PROTECTED]) wrote: input type=text name=bongabe value=something I think you need to use a textarea if you wish for the returns to be submitted. Cheers Justin French Creative Director http://Indent.com.au Web Developent Graphic Design -- 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] h/1 tag
I'm doing some PHP work, and I've come across the h/1 tag. What, exactly, is this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Submit hitting enter problem
on 11/11/02 2:16 PM, rija ([EMAIL PROTECTED]) wrote: Thanks for your quick answer, But it doesn't change anything. textarea change my text box into big text area- So I always have to click on submit button to submit the form. Actually, I miss-read your question... do you WANT the form to be submitted when hitting return/enter??? And you find that this is not happening when you are in a text field??? Correct? This is a browser thing... I don't *think* there's anything in the standards to say when hitting enter should/shouldn't work -- i think it's something that each browser will do differently. There may be something you can do with javascript. Perhaps check out: http://www.w3.org/TR/1998/REC-html40-19980424/interact/forms.html Or find a similar form example on another site, and dig around thru the code to have a look how they did it. Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Submit hitting enter problem
Thanks for your quick answer, But it doesn't change anything. textarea change my text box into big text area- So I always have to click on submit button to submit the form. So? This doesn't have anything to do with PHP, it's dependant on the browser you are using. IE will do this for you sometimes, while most other browsers don't, I think. Please ask your question on a relevant list. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] h/1 tag
I'm doing some PHP work, and I've come across the h/1 tag. What, exactly, is this? It is probably just a typo for an h1 tag. It's nothing that PHP would create on its own. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Submit hitting enter problem
On Monday 11 November 2002 10:44, rija wrote: What am I missing? My form does not submit when I hit enter in the text box. I do something approximately like this : form action=index.php?s=add method=post input type=text name=bongabe value=something ... input type=submit value=submit name=submit What happens when ENTER is pressed depends on what browser you're using. Different browsers exhibit different behaviours, eg the old versions of Netscape (v4 and before) does not submit on ENTER. Also, put quotes around your attribute values eg: input type=text name=bongabe value=something -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The more I know men the more I like my horse. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] h/1 tag
Actually, it's a product of Microsoft Frontpage that a client sent me. -Original Message- From: John W. Holmes [mailto:holmes072000;charter.net] Sent: Sunday, November 10, 2002 9:33 PM To: 'John Meyer'; [EMAIL PROTECTED] Subject: RE: [PHP] h/1 tag I'm doing some PHP work, and I've come across the h/1 tag. What, exactly, is this? It is probably just a typo for an h1 tag. It's nothing that PHP would create on its own. ---John Holmes... -- 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] Unique Identifier String
What if you create an array of all the letters and numbers, then shuffle that array, implode it into a string and grab the first 24 characters? It should be fairly random, but not guaranteed unique. ---John Holmes... -Original Message- From: @ Edwin [mailto:copperwalls;hotmail.com] Sent: Sunday, November 10, 2002 6:22 AM To: Sebastian A. Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Unique Identifier String Hello, Sebastian A. [EMAIL PROTECTED] wrote: I am currently working on a mySQL site administration system and I need help on figuring out how I can create a 24 digit letter/number unique identifier string. I know that I can easily get a random number using a PHP function (I can remember it off the top of my head) but I also need to create random letters and then insert them into the number. Here are the steps of the process: 1. Create a 12 digit random number using a PHP function 2. Create 12 random letters 3. Insert the letters into the number, or the other way around Result: 1h5l79G05OP65kN61LPs1o6Z Out of the steps above, I am not sure how to do 2 and 3 and I would greatly appreciate it if someone could point out for me how to do them. This may not be the best way but you can do it this way: 1. Make sure that the number 1 above is in an array. Then, 2. Make an array of uppercase and lowercase letters, shuffle() them. 3. Get 12 from each. (i.e. by looping thru each and assigning it to another array, etc.) 4. array_merge() the two resulting arrays. 5. shuffle() again. Should work... - E -- 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] isset doesn't like -?
I don't know if this is a bug, or what, but I get an error when trying the following if ( isset($adodbobject-Fields('myresult') ) ) { // do something } PHP throws an error ( not warning ) saying: Parse error: parse error, expecting `','' or `')'' in /path/to/index.php on line 45 However, when I modify the isset to look like this: $_q = $adodbobject-Fields('myresult'); if ( isset($_q) ) { // do something } It works fine. Is this proper behavior for isset, or is this a php bug? I can't search google groups for -, or any other search engine for that matter. So it has been tough trying to see if anyone else gets this error. Many thanks! --Brian PS: what is the proper term for the - syntax? pointer? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] h/1 tag
H Frontpage creating bad code? ... say it ain't so! ---John Holmes... -Original Message- From: John Meyer [mailto:johnmeyer_1978;yahoo.com] Sent: Sunday, November 10, 2002 11:34 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] h/1 tag Actually, it's a product of Microsoft Frontpage that a client sent me. -Original Message- From: John W. Holmes [mailto:holmes072000;charter.net] Sent: Sunday, November 10, 2002 9:33 PM To: 'John Meyer'; [EMAIL PROTECTED] Subject: RE: [PHP] h/1 tag I'm doing some PHP work, and I've come across the h/1 tag. What, exactly, is this? It is probably just a typo for an h1 tag. It's nothing that PHP would create on its own. ---John Holmes... -- 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] Php | Architect Magazine?
Has anyone taken a look at this magazine yet (www.phparch.com)? I came across mention of it on Slashdot earlier today and it looks interesting. I am considering subscribing but wouldn't mind some feedback about the overall quality of the publication beforehand. Nick Oostveen It's new, the first issue isn't out yet. Give it a try when it comes out. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] confusion in session vars
did any one face a prob when session vars get mixed from a website to another when you use the same browser window ? No, did you? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Handling Errors Gracefully
Well, if you rule out ob_* and javascript, the best you can probably do is to just include() your error page or write a function to display it. You won't be redirected to the page, but it'll show up. ---John Holmes... -Original Message- From: Monty [mailto:monty3;hotmail.com] Sent: Saturday, November 09, 2002 5:43 PM To: [EMAIL PROTECTED] Subject: [PHP] Handling Errors Gracefully Is there any way to gracefully handle errors that happen after output to the screen has begun (the point where header(Location:) doesn't work) without using ob_ functions? I have a separate PHP page I'd like to display with the error if one happens using the error_handler() and trigger_error() functions. But, I can't make it work because if the error happens after output starts, I just get an error stating header() won't work. I'm also not sure of the best way to pass all the error data to the error page. Its too much for a $_GET. Anyone have any suggestions or links to articles that explain how this can be done?? Thanks a lot. Monty -- 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] isset doesn't like -?
I don't know if this is a bug, or what, but I get an error when trying the following if ( isset($adodbobject-Fields('myresult') ) ) { // do something } PHP throws an error ( not warning ) saying: Parse error: parse error, expecting `','' or `')'' in /path/to/index.php on line 45 However, when I modify the isset to look like this: $_q = $adodbobject-Fields('myresult'); if ( isset($_q) ) { // do something } It works fine. That's because isset() is expecting a variable, not a function. In your first example, you're trying to see if a function is set, not a variable. In your second example, you're doing it right... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset doesn't like -?
That's because isset() is expecting a variable, not a function. In your first example, you're trying to see if a function is set, not a variable. In your second example, you're doing it right... ---John Holmes... That actually makes sense once I thought about it, a function referencing a variable, or reference to a variable is in no way the same as a variable. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mcrypt under Win32?
Anyone out there know how to get the mcrypt functions running under Win32? Any help / how-to's / URLs will be greatly appreciated. - I have searched around the web and found a few things, but nothing that really gives any good information Thanks in advance for the help!!! //Nick Richardson // [EMAIL PROTECTED] --- Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] h/1 tag
Perhaps it has something to do with XML? A new coding scheme perhaps? Or perhaps a typo from XHTML-like syntax, which requires coding like br /, etc. with the trailing forward slash inside the tag. It could be that Microsoft has developed a new coding scheme using XML which has its own DTD or XML Schema. I'm not sure what it could be. You can go to Microsoft.com (this site gives me shivers) and dig through their site for how they syntax markup within their FrontPage application. - Darwin -Original Message- From: John Meyer [mailto:johnmeyer_1978;yahoo.com] Sent: Sunday, November 10, 2002 10:24 PM To: [EMAIL PROTECTED] Subject: [PHP] h/1 tag I'm doing some PHP work, and I've come across the h/1 tag. What, exactly, is this? -- 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] Re: Request entity too large (already seen the FAQ)
John W. Holmes wrote... But, thank you for posting the solution you did eventually find. That will be of assistance if anyone ever searches the archives before posting... Hey, I can dream, can't I?? I personally think more people would do that if something like... Ask your worst, but search the archives first! http://marc.theaimsgroup.com/?l=php-general ...appeared at the bottom of the messages. List Mom? -- Charles Wiltgen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php