[PHP] new to classes, need help
I'm trying to get my head around php classes. I want to write a small php file (call it genericly uniquepagesomething.php) that will call the pagemaker.class. For example Apples3.php that calls pagemaker.class. In pagemaker.class, it will look up page 3 of the topic apples from a table and get the text file. It will also look up the proper template to use. pagemaker.class will then insert the text file into the template and print it out to the browser. Here is what I have cobbled together so far from various things i've read. - uniquepagesomething.php require("pagemaker.class"); $pagemaker = new pagemaker; $pagemaker->find($findpage, $pagesomething); $pagemaker->make("pagesomething"); ?> - pagemaker.class class pagemaker var $Host = ""; // Hostname of our MySQL server. var $Database = ""; // Logical database name on that server. var $User = ""; // User und Password for login. var $Password = ""; var $Link_ID = 0; // Result of mysql_connect(). var $Query_ID = 0; // Result of most recent mysql_query(). var $Record = array(); // current mysql_fetch_array()-result. var $Row; // current row number. var $Errno= 0; // error state of query... var $Error= ""; function find($findpage,$pagesomething) { $this->$findpage=$pagesomething; //fix this to split the topic and page number $this->$Query_String="select tmplt, image, file, desc from pages where "; //fix this too $this->connect(); # printf("Debug: query = %sn", $Query_String); $this->Query_ID = mysql_query($this->Query_String,$this->Link_ID); $this->Row = 0; $this->Errno = mysql_errno(); $this->Error = mysql_error(); if (!$this->Query_ID) { $this->halt("Invalid SQL: ".$Query_String); } return $this->Query_ID; } function halt($msg) { printf("Database error: %s\n", $msg); printf("MySQL Error: %s (%s)\n", $this->Errno, $this->Error); die("Session halted."); } function connect() { if (0 == $this->Link_ID ) { $this->Link_ID=mysql_connect($this->Host, $this->User, $this->Password); if (!$this->Link_ID) { $this->halt("Link-ID == false, connect failed"); } if (!mysql_query(sprintf("use %s",$this->Database),$this->Link_ID)) { $this->halt("cannot use database ".$this->Database); } } } find(); ?> Is this going anywhere in the right direction? any comments are welcome Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail Server Setup
Hi I want to provide the mailing facility to my clients in my deomain . For that , what are the basic requirements , and how can I do that . Any suggestion is highly appreciated. Thanks Trilochan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL vs PostgreSQL
Youy are unlikely to egt balanced asvice on this in the MySQL or Postgress lists -after all those people have already made thier decision. I haven't used Postgress much - but basically... Mysql - available on loads of hosting packages, very large user base. PostgreSQL - better adherance to ANSII standards, resulting in more portable code. Implements VIEWS, subselects and foriegn keys. Mysql is faster (as long as you don't need the missing features) It is better established, and things like subselects are being worked on, foriegn keys are already partially implemented. The docs for both projects have sections on camparing to the other (I think they both cheat a bit and compare thier newest version to a slighlty older version of the other project) Sean Rick Emery wrote: You accidentally published this to the wrong email list. I assume you meant to send this to the MySQL email list. - Original Message - From: "Miro Kralovic" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 23, 2002 9:10 AM Subject: [PHP] MySQL vs PostgreSQL Hi, I'm just deciding which DB to use for my projects and I'm not clear with one thing... When considering a database for web, is MySQL good enough? I read it only supports table locking, which is not very satisfying in such a multiuser environment as the internet.. Based on your experience, what are pros and cons of MySQL and why most of you prefer to use MySQL to PostgreSQL, which is aparently more powerful.. Thanks for your opinions.. Miro.. -- 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] another preg_replace issue
yet another regex question how could i change the value within the quotes with preg_replace php_value upload_max_filesize "5M" i am trying to edit the value of a htaccess file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unable to match dollar sign in preg_match
> -Original Message- > From: John W. Holmes [mailto:[EMAIL PROTECTED]] > Sent: 24 December 2002 00:44 > > If you want to use some of PHP's special characters in your > expression, Don't you mean "preg's special characters"? Or even "PHP special characters which are also preg special characters", as it's this duality of specialness that leads to the necessity of double-escaping! > such as $, you must escape it twice. For example: > > $matchme = "\$example"; > if (preg_match("/\$example/", $matchme)) { > > will not be matched because PHP interprets the \$ and passes it as $. > Instead, you must do this: > > if (preg_match("/\\\$example/", $matchme)) { This is the main reason I prefer to use *single*-quoted strings whenever possible in preg_ calls -- the above could more legibly be written as: if (preg_match('/\$example/', $matchme)) { This is an instance where I'd even tend to prefer to write single-quoted strings concatenated to bare variables, rather than using double-quoted strings and variable-interpolation: if (preg_match('/\$'.$example.'\./', $matchme)) { rather than if (preg_match("/\\\$$example\\./", $matchme)) { Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unable to match dollar sign in preg_match
> -Original Message- > From: John W. Holmes [mailto:[EMAIL PROTECTED]] > Sent: 24 December 2002 00:44 > > I don't know. I just got that from reading the manual. The very first > user comment on the preg_match page. Sorry, misread this before and took the explanation below as John replying to chrisbolt -- but actually, it's John *quoting* chrisbolt, isn't it? In which case, I'll chip in further with: > > chrisbolt at home dot com > 12-Mar-2000 03:23 > > If you want to use some of PHP's special characters in your > expression, > such as $, you must escape it twice. For example: $ is both a PHP special character in double-quoted strings, and a special character in preg pattern matches (meaning "start of string or line") -- so it first has to be escaped for preg, giving \$, and then the \ and the $ each have to be escaped for the PHP double-quoted string giving "\\\$". Basically, if you put your pattern in a double-quoted string, every time you want to pass a \ to preg (say as an escape for a special character such as ., or as part of a character class such as \d) you have to assess whether it needs escaping for PHP, leading to a double backslash in the PHP string. The safest strategy is just to double it every time, as this will always be de-escaped by PHP to a single \ in the string which is then passed to preg. If you use single-quoted strings for your preg pattern, you don't get this problem as the only character that needs escaping for PHP is then the single quote itself! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unable to match dollar sign in preg_match
John W. Holmes wrote: I don't know. I just got that from reading the manual. The very first user comment on the preg_match page. to put a literal dollar sign in a regex it has to be escaped \$ to put a backslash in a double quoted string you have to escape it \\$ in order to put a literal dollar sign in a double quoted string you have to escape it \\\$ or you can use sinlgle quotes - where you only have to escape the dollar sign once to mark it a a literal dollar sign and not an end string/line placeholder preg_match('/\$example/' , $matchme)) Sean chrisbolt at home dot com 12-Mar-2000 03:23 If you want to use some of PHP's special characters in your expression, such as $, you must escape it twice. For example: $matchme = "\$example"; if (preg_match("/\$example/", $matchme)) { will not be matched because PHP interprets the \$ and passes it as $. Instead, you must do this: if (preg_match("/\\\$example/", $matchme)) { --- Don't forget to check the manual. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Randall Perry [mailto:[EMAIL PROTECTED]] Sent: Monday, December 23, 2002 4:07 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Unable to match dollar sign in preg_match Hokay, that works, but what's with the triple backslashes? preg_match ("/^.*_\%split\%_$(\d*\.\d*)/", $data, $match); Should be preg_match ("/^.*_\%split\%_\\\$(\d*\.\d*)/", $data, $match); ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- Randall Perry sysTame Xserve Web Hosting/Co-location Website Development/Promotion Mac Consulting/Sales http://www.systame.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Server Setup
Trilochan said: > Hi > > I want to provide the mailing facility to my clients in my deomain . For > that , what are the basic requirements , and how can I do that . > > Any suggestion is highly appreciated. > It's pretty simple. Check out http://www.postfix.org. Postfix is extremely stable, fast, and easy to configure. Read all the documentation available on the site, and if you want, purchase Blum's Postfix book through Amazon.com or BN.com. Regards, Anthony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Images not stored in Databases
Hiya, I have had help from a very useful person on storing images in databases, and basically now I don't want to do this. But I may end up storing a lot of pictures, and don't want to mess around. Is there a script or class, that is as simple as storing in a database, that will handle possibly millions of pictures, and given a picture will return the URL where it is stored? I suppose I could build one myself, but I can see it being quite difficult, with problems such as maximum number of files in directories etc. I have had a look at a few PHP pages, but cannot find anything suitable. Any help would be great. Have a great Christmas. Love, Steve XX -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Images not stored in Databases
How will the picture make it into the db? Will they be uploaded by users? I had to create an upload script for a sight that puts the picture in the users directory on the webserver and then stored the path to the picture in the db so when the web page is displayed, the tag is something like this "> . Picture1 just holds the physical address such as /users/eddie/myhouse.jpg. That way, the db isn't huge. Is that what you mean? Eddie -Original Message- From: Steve Vernon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 24, 2002 8:57 AM To: [EMAIL PROTECTED] Subject: [PHP] Images not stored in Databases Hiya, I have had help from a very useful person on storing images in databases, and basically now I don't want to do this. But I may end up storing a lot of pictures, and don't want to mess around. Is there a script or class, that is as simple as storing in a database, that will handle possibly millions of pictures, and given a picture will return the URL where it is stored? I suppose I could build one myself, but I can see it being quite difficult, with problems such as maximum number of files in directories etc. I have had a look at a few PHP pages, but cannot find anything suitable. Any help would be great. Have a great Christmas. Love, Steve XX -- 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] Images not stored in Databases
Hiya. Yeh sorry I should of mentioned, using an upload script. And then I shrink them (or grow) using GD. I understand I could give everyone a directory, but everyone would only have one picture, so a waste of time. What would make more sense, and to ignore the limit on number of items in a directory, is to have directories like a-z and directories inside them of a-z till there can be over a million stored. And then create a random combination and try and place it in one of the root directories. Is there a sctript that organises huge numbers of pictures in directories? Also everyone logs in using there email address, not a username, so I would prefer not to have to give them usernames! THanks, Steve > How will the picture make it into the db? Will they be uploaded by users? > I had to create an upload script for a sight that puts the picture in the > users directory on the webserver and then stored the path to the picture in > the db so when the web page is displayed, the tag is something like this > "> . Picture1 just holds the > physical address such as /users/eddie/myhouse.jpg. That way, the db isn't > huge. > > Is that what you mean? > > Eddie > > -Original Message- > From: Steve Vernon [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 24, 2002 8:57 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Images not stored in Databases > > > Hiya, > I have had help from a very useful person on storing images in > databases, and basically now I don't want to do this. But I may end up > storing a lot of pictures, and don't want to mess around. > > Is there a script or class, that is as simple as storing in a database, > that will handle possibly millions of pictures, and given a picture will > return the URL where it is stored? I suppose I could build one myself, but I > can see it being quite difficult, with problems such as maximum number of > files in directories etc. > > I have had a look at a few PHP pages, but cannot find anything > suitable. > > Any help would be great. > > Have a great Christmas. > > Love, > > Steve > XX > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] forum?
do you know freeware forum in php I can easly use? thanks. fatih ustundag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] forum?
www.google.com www.hotscripts.com - Original Message - From: "Fatih Üstündað" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Tuesday, December 24, 2002 2:51 PM Subject: [PHP] forum? > do you know freeware forum in php I can easly use? > > thanks. > fatih ustundag > > -- > 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] forum?
On Tue, 2002-12-24 at 09:51, Fatih Üstündağ wrote: > do you know freeware forum in php I can easly use? Phorum http://phorum.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] forum?
phpBB2 www.phpbb.com Or do what another poster suggested and google for it Andrew - Original Message - From: "Fatih Üstündað" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Tuesday, December 24, 2002 2:51 PM Subject: [PHP] forum? > do you know freeware forum in php I can easly use? > > thanks. > fatih ustundag > > -- > 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] forum?
http://www.yabbse.org - Original Message - From: "Fatih Üstündað" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Tuesday, December 24, 2002 9:51 AM Subject: [PHP] forum? > do you know freeware forum in php I can easly use? > > thanks. > fatih ustundag > > -- > 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] Images not stored in Databases
I think you should first research what the limit of files is in the directory where you want to place the files. Then just create some structure that you start with a directory called "1" and store the file there. If the limit of directory "1" is reached just let your script automaticly create a seconde directory and start storing there. Of course you should keep record of wich image is located where. Maybe you should name the uploaded images the same as the users email address. As far as I know it is no problem to have a filename with an @ in it so I think this is the best way to make sure you don't have conflicts with filenames. Is that what you mean? Greetz, Gilles - Original Message - From: "Steve Vernon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 24, 2002 3:27 PM Subject: Re: [PHP] Images not stored in Databases > Hiya. > > Yeh sorry I should of mentioned, using an upload script. And then I > shrink them (or grow) using GD. > > I understand I could give everyone a directory, but everyone would only > have one picture, so a waste of time. > > What would make more sense, and to ignore the limit on number of items > in a directory, is to have directories like a-z and directories inside them > of a-z till there can be over a million stored. And then create a random > combination and try and place it in one of the root directories. Is there a > sctript that organises huge numbers of pictures in directories? > > Also everyone logs in using there email address, not a username, so I > would prefer not to have to give them usernames! > > THanks, > > Steve > > > > How will the picture make it into the db? Will they be uploaded by users? > > I had to create an upload script for a sight that puts the picture in the > > users directory on the webserver and then stored the path to the picture > in > > the db so when the web page is displayed, the tag is something like this > > "> . Picture1 just holds the > > physical address such as /users/eddie/myhouse.jpg. That way, the db isn't > > huge. > > > > Is that what you mean? > > > > Eddie > > > > -Original Message- > > From: Steve Vernon [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, December 24, 2002 8:57 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Images not stored in Databases > > > > > > Hiya, > > I have had help from a very useful person on storing images in > > databases, and basically now I don't want to do this. But I may end up > > storing a lot of pictures, and don't want to mess around. > > > > Is there a script or class, that is as simple as storing in a > database, > > that will handle possibly millions of pictures, and given a picture will > > return the URL where it is stored? I suppose I could build one myself, but > I > > can see it being quite difficult, with problems such as maximum number of > > files in directories etc. > > > > I have had a look at a few PHP pages, but cannot find anything > > suitable. > > > > Any help would be great. > > > > Have a great Christmas. > > > > Love, > > > > Steve > > XX > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] forum?
http://www.phpbb.com/ is the best free one I have seen. Greetz, Gilles - Original Message - From: "Fatih Üstündað" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Tuesday, December 24, 2002 3:51 PM Subject: [PHP] forum? > do you know freeware forum in php I can easly use? > > thanks. > fatih ustundag > > -- > 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] forum?
www.invisionboard.com - Original Message - From: "Fatih Üstündað" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Tuesday, December 24, 2002 9:51 AM Subject: [PHP] forum? : do you know freeware forum in php I can easly use? : : thanks. : fatih ustundag : : -- : 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] Can't set time zone
I can't seem to set the time zone of my server in the mod_php4 binary. When I run this file: "; echo "Local: " . date( "D, j M Y H:i:s" ) . ""; echo "Z: " . date( "Z" ) . ""; echo "O: " . date( "O" ) . ""; echo "T: " . date( "T" ) . ""; echo "Env: " . getenv("TZ"); ?> ...I get this output in the web browser: GMT: Tue, 24 Dec 2002 14:14:51 Local: Tue, 24 Dec 2002 14:14:51 Z: 0 O: + T: GMT Env: US/Eastern I asked on the mailing list for my OS (FreeBSD) and someone else who was using the same version of the same OS (FreBSD 4.7-Stable) and the same mod_php4 version (FreeBSD's port of PHP 4.2.3) was not experiencing this issue. His output was: GMT: Tue, 24 Dec 2002 15:14:40 Local: Tue, 24 Dec 2002 09:14:40 Z: -21600 O: -0600 T: CST Env: I've noticed two major changes here. The TZ environment variable is defined on my system but not his. (Both of us have time zones defined when we look in uname -a.) My mod_php4 binary believes that it is GMT (instead of EST) while his believes that it is in CST (which is correct). Can anyone offer any suggestions on how to fix this? Or even clues of what might be the cause? Thanks in advance, Jaime -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL vs PostgreSQL
Both databases work well for what they are intended to do. Either database will have good basic performance, however PostgreSQL has had more advanced features and stability in the past some of which MySQL has worked on gaining. Last I heard there was still issues with complex operations and table locking with MySQL (I don't use MySQL anymore). If you use persistent connections PostgreSQL performance will equal, be greater than or slighly less than MySQL performance (depending on what you are doing). There are also other database choices available for example Firebird (open source version of Interbase), and many others. Asking what is the best database generally is an answer that can't easily be answered, especially on mailing lists without causing enthusiastic believers of a database to become over stimulated. You should take into consideration what databases are available to you, are you using your own server so you have (near) total control, are you using shared hosting so are limited by what your hosting provider supplies? Additionally consider the ability for the database to scale, ease of management, support, and documentation quality. Both PostgreSQL and MySQL have excellent online help communities and both have excellent documentation. With that said, for my purposes I prefer PostgreSQL, I like the performance and the stability I have seen from PostgreSQL, I develop intranet applications that need to do complex reporting while providing data entry services at the same time. Weigh everyones opinions, also consider deploying both and doing some of your own testing to see which will work best for you, it takes a while but it will give you more concrete information. Jason > Youy are unlikely to egt balanced asvice on this in the MySQL or > Postgress lists -after all those people have already made thier decision. > > I haven't used Postgress much - but basically... > > > Mysql - available on loads of hosting packages, very large user base. > > PostgreSQL - better adherance to ANSII standards, resulting in more > portable code. > Implements VIEWS, subselects and foriegn keys. > > Mysql is faster (as long as you don't need the missing features) > It is better established, and things like subselects are being worked > on, foriegn keys are already partially implemented. > > The docs for both projects have sections on camparing to the other (I > think they both cheat a bit and compare thier newest version to a > slighlty older version of the other project) > > Sean > > > Rick Emery wrote: > > You accidentally published this to the wrong email list. I assume you meant to >send this > > to the MySQL email list. > > > > - Original Message - > > From: "Miro Kralovic" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Monday, December 23, 2002 9:10 AM > > Subject: [PHP] MySQL vs PostgreSQL > > > > > > > >>Hi, > >> > >>I'm just deciding which DB to use for my projects and I'm not clear with one > >>thing... When considering a database for web, is MySQL good enough? I read > >>it only supports table locking, which is not very satisfying in such a > >>multiuser environment as the internet.. > >> > >>Based on your experience, what are pros and cons of MySQL and why most of > >>you prefer to use MySQL to PostgreSQL, which is aparently more powerful.. > >> > >>Thanks for your opinions.. > >>Miro.. > >> > >> > >> > >>-- > >>PHP General Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating my own External Module for PHP
Hello, I have a little question to which I hope to find an anwser in here. Currently, I have a big script which receives approx 1.5 million hits every day. Since this script does some common calculations that underlying scripts use, I want to rewrite this into C and initially make it an external module for beta testing and then eventually compile it directly into PHP. Now, I got this really good book, Web Application Development with PHP by Ratschiller and Gerken. It has a complete chapter devoted to "hacking the core of PHP" which shows how to create extensions. Now, they describe 2 common ways of hacking the core... making a shared object (which is what I want at this point) , or compiling the extension right into the core. They decribe how to make your extension with ~/ext/ext_skel , but they don't describe which steps to take when you only want to make a shared object... the only thing they say is "at this point, you should have a new PHP binary or a .so file" ... but they never gave any indication how to chose... they just asume you want a new php binary or sth. Now, can anyone provide me with a few brief description (a few steps) how to make your own dynamically loadable module in PHP? Thanks in advance. Regards, Leon Mergen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What happened with zend engine version 2?
I believed that PHP V4.3 should include the Zend engine version 2 since there was two alpha releases for PHP-4.3.0 with Zend engine version 2 -PHP-4.3.0-dev-zend2-win32-alpha1 -PHP-4.3.0-dev-zend2-win32-alpha2 I'm waiting for Zend engine version 2. Where could I read information about future releases? I think the Zend engine version 2 provides much better coding facilities so I would preciate if anybody could answer my questions. Thanks /Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
At 08:04 AM 12/24/02 +0300, sport4ever wrote: maybe there is something wrong with php.ini notice that I faced with this problem just after I upgraded to (PHP 4.2.1), (Apache2), everything was great before! The last I heard PHP + Apache2 is pretty much experimental, and not recommended for production servers. Unless you plan on working to debug the combination of programs, you should be using Apache 1.3 if you want to use PHP. There are a few combinations of versions that work together, but unless you are willing to put a lot of extra effort and study into using Apache 2, stick with 1.3 until the PHP developers announce Apache 2 support. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
I have found this to be very true with RedHat 8 (includes Apache2.0.40, and php 4.2.2). While RedHat 8.0 isn't really ready for a production server, apache2 and php definitly are not. You have to bend over backwards to get some things working correctly if at all. Plus there are still some stability issues with RH 8. As far as my production servers go apache 1.3 and RH 7.3 for now. On Tue, 24 Dec 2002 00:02:49 -0700 Rick Widmer <[EMAIL PROTECTED]> wrote: > At 08:04 AM 12/24/02 +0300, sport4ever wrote: > > >maybe there is something wrong with php.ini > >notice that I faced with this problem just after I upgraded to (PHP > >4.2.1),(Apache2), everything was great before! > > The last I heard PHP + Apache2 is pretty much experimental, and not > recommended for production servers. Unless you plan on working to > debug the combination of programs, you should be using Apache 1.3 if > you want to use PHP. > > There are a few combinations of versions that work together, but > unless you are willing to put a lot of extra effort and study into > using Apache 2, stick with 1.3 until the PHP developers announce > Apache 2 support. > -- Tom Woody Systems Administrator Don't throw your computer out the window, throw the Windows out of your computer! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] forum?
Another good one: fudforum: http://fud.prohost.org/ Regards, Philip On Tue, 24 Dec 2002, [windows-1254] Fatih Üstündað wrote: > do you know freeware forum in php I can easly use? > > thanks. > fatih ustundag > > -- > 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] What happened with zend engine version 2?
That was never the plan. It is scheduled for PHP 5 sometime in the next 6-12 months. -Rasmus On Tue, 24 Dec 2002, Erik Franzén wrote: > I believed that PHP V4.3 should include the Zend engine version 2 since > there was two alpha releases for PHP-4.3.0 with Zend engine version 2 > > -PHP-4.3.0-dev-zend2-win32-alpha1 > -PHP-4.3.0-dev-zend2-win32-alpha2 > > I'm waiting for Zend engine version 2. Where could I read information about > future releases? > > I think the Zend engine version 2 provides much better coding facilities so > I would preciate if anybody could answer my questions. > > Thanks > > /Erik > > > > -- > 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] Problem with Include
I've heard that RH8 decided to disable short tags in their default php.ini If this is true, the people at RedHat deserve a good spanking. Talk about being irresponsible! Regards, Philip On Tue, 24 Dec 2002, Tom Woody wrote: > I have found this to be very true with RedHat 8 (includes Apache2.0.40, > and php 4.2.2). While RedHat 8.0 isn't really ready for a production > server, apache2 and php definitly are not. You have to bend over > backwards to get some things working correctly if at all. Plus there > are still some stability issues with RH 8. > > As far as my production servers go apache 1.3 and RH 7.3 for now. > > On Tue, 24 Dec 2002 00:02:49 -0700 > Rick Widmer <[EMAIL PROTECTED]> wrote: > > > At 08:04 AM 12/24/02 +0300, sport4ever wrote: > > > > >maybe there is something wrong with php.ini > > >notice that I faced with this problem just after I upgraded to (PHP > > >4.2.1),(Apache2), everything was great before! > > > > The last I heard PHP + Apache2 is pretty much experimental, and not > > recommended for production servers. Unless you plan on working to > > debug the combination of programs, you should be using Apache 1.3 if > > you want to use PHP. > > > > There are a few combinations of versions that work together, but > > unless you are willing to put a lot of extra effort and study into > > using Apache 2, stick with 1.3 until the PHP developers announce > > Apache 2 support. > > > > > -- > Tom Woody > Systems Administrator > > Don't throw your computer out the window, > throw the Windows out of your computer! > > > -- > 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] Creating my own External Module for PHP
Just run phpize in your directory and then do a ./configure && make If your config.m4 was correct you should now have a modules/foo.so in your dir. -Rasmus On Tue, 24 Dec 2002, Leon Mergen wrote: > Hello, > > I have a little question to which I hope to find an anwser in here. > Currently, I have a big script which receives approx 1.5 million hits every > day. Since this script does some common calculations that underlying scripts > use, I want to rewrite this into C and initially make it an external module > for beta testing and then eventually compile it directly into PHP. > > Now, I got this really good book, Web Application Development with PHP by > Ratschiller and Gerken. It has a complete chapter devoted to "hacking the > core of PHP" which shows how to create extensions. > > Now, they describe 2 common ways of hacking the core... making a shared > object (which is what I want at this point) , or compiling the extension > right into the core. They decribe how to make your extension with > ~/ext/ext_skel , but they don't describe which steps to take when you only > want to make a shared object... the only thing they say is "at this point, > you should have a new PHP binary or a .so file" ... but they never gave any > indication how to chose... they just asume you want a new php binary or sth. > > Now, can anyone provide me with a few brief description (a few steps) how to > make your own dynamically loadable module in PHP? > > Thanks in advance. > > Regards, > > Leon Mergen > > > > -- > 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] extracting text
Okay guys heres the question: say i have a line of text like: [blah], [rah] PH33r Us! [moo] how can I extract all the text in the brackets and set it as a var, im totally stuck, my idea was to use strstr() but that wouldnt work as all the tags were not at the end :( - CS
[PHP] objects within arrays
Hi, I'm really struggling with this - I'm writing a simple webmail client for myself (because they've blocked the common ones at work hehe) Anyway, as soon as I tried to access.. $header = imap_header($inbox,$msgID); $header->from['mailbox']; ... I get nothing. I did a print_r on that, and I got.. Array ([0] = StdClass Object([personal] = "blah" ); etc... so how do I access the data within the Object bit? a simple $header->from['personal'] refuses to output anything. Sorry to be a pain again, I know this is simple language stuff but I can't find it in the manual. :) Beth Gore -- http://www.habitformer.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] objects within arrays
Big guess but I think maybe: $header[0]->from['mailbox']; Also I suggest you turn your PHP Error Level up to E_ALL in your php.ini file (or temporarly at the top of your scripts with error_reporting (E_ALL);, this will help debug programs like this :)) Andrew - Original Message - From: "Beth Gore" <[EMAIL PROTECTED]> To: "PHP General List" <[EMAIL PROTECTED]> Sent: Tuesday, December 24, 2002 6:42 PM Subject: [PHP] objects within arrays > Hi, > > I'm really struggling with this - I'm writing a simple webmail client > for myself (because they've blocked the common ones at work hehe) > > Anyway, as soon as I tried to access.. > > $header = imap_header($inbox,$msgID); > > $header->from['mailbox']; > > ... I get nothing. > > I did a print_r on that, and I got.. > > Array ([0] = StdClass Object([personal] = "blah" ); etc... > > so how do I access the data within the Object bit? a simple > $header->from['personal'] refuses to output anything. > > Sorry to be a pain again, I know this is simple language stuff but I > can't find it in the manual. :) > > Beth Gore > -- > http://www.habitformer.co.uk > > > > -- > 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] extracting text
> say i have a line of text like: [blah], [rah] PH33r Us! [moo] > > how can I extract all the text in the brackets and set it as a var, im > totally stuck, my idea was to use strstr() but that wouldnt work as all > the > tags were not at the end :( Assuming you want to replace [foo] with the value in $foo, you can use something like this: $str = "this [foo] is a [test] okay?"; $foo = "crap_foo"; $test = "crap_test"; $nstr = preg_replace("/\[([a-z]+)\]/ie",'\$$1',$str); echo $str . "---" . $nstr; No error checking, so if $foo doesn't exist, you'll get a warning and empty string inserted. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] exif functions
Happy Holidays! I am having a problem using the exif_thumbnail() function. All I want to do is to view the embedded thumbnails in some jpg files taken by digital cameras. I have tried the examples in the docs, but they don't seem to work. Can someone give me some tips on using this function? Thanx. -Dade __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] objects within arrays
This didn't work. Apparently from[] returns an array of objects, however I have no idea how to access the object within the array. print_r gives this: Array ( [0] => stdClass Object ( [personal] => Beth Gore [mailbox] => bethanoia [host] => habitformer.co.uk ) ) I've tried this: echo $header->from->mailbox."@".$header->from->host; which doesn't report an error at all, even with full error reporting.. ... breaking news.. just cracked it. echo $header->from[0]->mailbox."@".$header->from[0]->host; Bascially the array of objects is the whole [0] => stdClass thing.. AGGH!! Always doing this. Thanks anyway :) Beth Gore -- http://www.habitformer.co.uk Andrew Brampton wrote: Big guess but I think maybe: $header[0]->from['mailbox']; Also I suggest you turn your PHP Error Level up to E_ALL in your php.ini file (or temporarly at the top of your scripts with error_reporting (E_ALL);, this will help debug programs like this :)) Andrew - Original Message - From: "Beth Gore" <[EMAIL PROTECTED]> To: "PHP General List" <[EMAIL PROTECTED]> Sent: Tuesday, December 24, 2002 6:42 PM Subject: [PHP] objects within arrays Hi, I'm really struggling with this - I'm writing a simple webmail client for myself (because they've blocked the common ones at work hehe) Anyway, as soon as I tried to access.. $header = imap_header($inbox,$msgID); $header->from['mailbox']; ... I get nothing. I did a print_r on that, and I got.. Array ([0] = StdClass Object([personal] = "blah" ); etc... so how do I access the data within the Object bit? a simple $header->from['personal'] refuses to output anything. Sorry to be a pain again, I know this is simple language stuff but I can't find it in the manual. :) Beth Gore -- http://www.habitformer.co.uk -- 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] What happened with zend engine version 2?
After I posted the first message, I read something about PHP 5 at www.zend.com and suspected that is was about the new Zend Engine. I must have missed it totally! I was planning to code on a new website during my christmas holiday and now that chance is gone because the functionality in the new Zend Enginge is exactly what I miss. I also read on Zend.com that there are some decisions to make about some major changes i.e private members variables or not. I guess I have to switch to Linux and get a CVS-copy for PHP 5, if it exists? Maybe a Win32-binary? Does it exist and if it exists, what status does it have? Can you write code that will work when the final version is finished with minor changes, or are major changes on the agenda? And secondly, I have to face the fact that I cannot get the Zend Engine version 2 in a runtime environment for at least 6 month. You can be sure that I'm longing for it... :) "Rasmus Lerdorf" <[EMAIL PROTECTED]> skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > That was never the plan. It is scheduled for PHP 5 sometime in the next > 6-12 months. > > -Rasmus > > On Tue, 24 Dec 2002, Erik Franzén wrote: > > > I believed that PHP V4.3 should include the Zend engine version 2 since > > there was two alpha releases for PHP-4.3.0 with Zend engine version 2 > > > > -PHP-4.3.0-dev-zend2-win32-alpha1 > > -PHP-4.3.0-dev-zend2-win32-alpha2 > > > > I'm waiting for Zend engine version 2. Where could I read information about > > future releases? > > > > I think the Zend engine version 2 provides much better coding facilities so > > I would preciate if anybody could answer my questions. > > > > Thanks > > > > /Erik > > > > > > > > -- > > 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] Creating my own External Module for PHP
Hey! That worked! Thanks Rasmus! Grtz, Leon Mergen "Rasmus Lerdorf" <[EMAIL PROTECTED]> schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Just run phpize in your directory and then do a ./configure && make > If your config.m4 was correct you should now have a modules/foo.so in your > dir. > > -Rasmus > > On Tue, 24 Dec 2002, Leon Mergen wrote: > > > Hello, > > > > I have a little question to which I hope to find an anwser in here. > > Currently, I have a big script which receives approx 1.5 million hits every > > day. Since this script does some common calculations that underlying scripts > > use, I want to rewrite this into C and initially make it an external module > > for beta testing and then eventually compile it directly into PHP. > > > > Now, I got this really good book, Web Application Development with PHP by > > Ratschiller and Gerken. It has a complete chapter devoted to "hacking the > > core of PHP" which shows how to create extensions. > > > > Now, they describe 2 common ways of hacking the core... making a shared > > object (which is what I want at this point) , or compiling the extension > > right into the core. They decribe how to make your extension with > > ~/ext/ext_skel , but they don't describe which steps to take when you only > > want to make a shared object... the only thing they say is "at this point, > > you should have a new PHP binary or a .so file" ... but they never gave any > > indication how to chose... they just asume you want a new php binary or sth. > > > > Now, can anyone provide me with a few brief description (a few steps) how to > > make your own dynamically loadable module in PHP? > > > > Thanks in advance. > > > > Regards, > > > > Leon Mergen > > > > > > > > -- > > 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] upload_max_filesize hack
hi guys i've managed to edit a htaccess file which will allow to override the upload_max_filesize ini setting which cannot be edited in php itself hope this helps, shure its a hack there could be anything with M in it, i'm terrible at regex, so if anyone would like to add to it go ahead. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: upload_max_filesize hack
i just cleaned it up a bit "Electroteque" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hi guys i've managed to edit a htaccess file which will allow to override > the upload_max_filesize ini setting which cannot be edited in php itself > hope this helps, shure its a hack there could be anything with M in it, i'm > terrible at regex, so if anyone would like to add to it go ahead. > >$filename = ".htaccess"; > $fd = fopen ($filename, "r+"); > flock($fd, LOCK_EX); > while (!feof($fd)) { > $size="3M"; //whatever value u like in a defines > $fpos = ftell($fd); > $c = fgetc($fd); > if ($c == "M"){ > ftruncate($fd, $fpos-2); > fseek($fd, -3, SEEK_CUR); > fwrite($fd,'"'.$size.'"'); > } > } > flock($fd, LOCK_UN); > fclose ($fd); > ?> > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exif functions
You are getting the error because the function has not been defined.. The manual contains this information: Note: This function is only available in PHP when compiled using --enable-exif. Its functionality and behaviour has changed in PHP 4.2 Try recompling PHP with --enable-exif on the command line, this should solve your problem. Jason On Tue, 2002-12-24 at 13:20, Dade Register wrote: > Thanx for replying. Here's all the info: > PHP 4.2.2 > Unix - FreeBSD 4.6-STABLE > http://kidz.homeip.net/php.php > That link is a phpinfo() with all the info if this is > not enuf info. > > The images are taken with a Kidak DX3700 digital > camera. Should be using EXIF 2.0 or so. I'm pretty > sure they have thumbnails. That's what Kodak says. > > The error I get is as follows: > Fatal error: Call to undefined function: > exif_thumbnail() in /usr/home/dade/kidz/pics/image.php > on line 3 > > That is the exif_thumbnail() function line. I am > pretty sure I am doing it right. Look @ > http://kidz.homeip.net/pics/image.phps > > I'm trying to call it like this: > http://kidz.homeip.net/pics/image.php?file=test.jpg > > Do you think that will work? > Thanx for the help. > > -Dade > --- Jason Sheets <[EMAIL PROTECTED]> wrote: > > Do you get any error messages? Are you sure the > > pictures have > > thumbnails on them? Please elaborate on your > > explanation how it is > > failing. > > > > What version of PHP are you running, is it on > > windows or Unix/Linux? > > > > Jason > > On Tue, 2002-12-24 at 12:20, Dade Register wrote: > > > Happy Holidays! > > > > > > I am having a problem using the exif_thumbnail() > > > function. All I want to do is to view the embedded > > > thumbnails in some jpg files taken by digital > > cameras. > > > I have tried the examples in the docs, but they > > don't > > > seem to work. Can someone give me some tips on > > using > > > this function? Thanx. > > > > > > -Dade > > > > > > __ > > > Do you Yahoo!? > > > Yahoo! Mail Plus - Powerful. Affordable. Sign up > > now. > > > http://mailplus.yahoo.com > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: > > http://www.php.net/unsub.php > > > > > __ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Greetings
Merry Christmas! Joseph Ross Lee POPS Inc (People Organization Process and Solutions) Phone: 8077232 Mobile:+639189363808 5L WestGate Tower, Madrigal Business Park, Investment Drive, Ayala Alabang, Muntinlupa City, Metro Manila, Philippines -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Greetings
Indeed, Merry Christmas to all! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with comma in mail form
I have a fairly simple mail form which gets email, subject and message and posts to itself. Your Email Address: Subject: Message: if(isset($message)) { echo $message; } ?> It then use mail() function to send a email. mail( $admin_email, $subject, $message, "From: $email" ); Problem is the message gets truncated if there is a comma in the message after the comma. Has anyone had this problem, got a solution to it. Regards, Ben * Ben Edwards +44 (0)117 9400 636 * * Critical Site Builderhttp://www.criticaldistribution.com * * online collaborative web authoring content management system * * Get alt news/views films online http://www.cultureshop.org * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php