Re: [PHP] PHP Cache (was PHP load to high on server)
Did u tried memcached? http://www.danga.com/memcached/ Albert wrote: I wrote: I am running SuSE 9.2 (Kernel 2.6.8-24-default) with Apache 2.0.50 and PHP 4.3.8 (as an Apache module) on a Celeron 900 with 304MB RAM. This machine is used for testing. We have made some changes to our PHP application and now the machine is having trouble serving the pages. Apache is occupying almost 90% CPU usage. I have resolved this issue by removing a piece of code which reads a set of parameters from a database. It seems that the hard disk on the machine is quite slow, slowing down all database access with it... I now check if the parameters are set in the session, if it is I use them otherwise I read them from the database and save it as session variables. When it changes I simply remove it from the session so it forces an update. So far it is working quite well. I now want to go and take all the static stuff that the user will configure once in a life time and put it in the session and only update it when it changes instead of reading it from the database every five seconds or so. For this I don't want to use a disk based session handler. I want the session variables to remain in memory (about 20KB per user) as to speed up the whole process. I also want an opcode cache to cache the compiled pages on the server in an attempt to speed up the HTTP server. For this I wanted to use mmCache (actually I want to use Zend Performance Suite but first I need to prove that it is worth $ 1000 per CPU and from the stats on the mmCache site mmCache is faster...) but it seems that the mmCache project has been abandoned as there have been no work done on it since 2003. Can someone confirm this or recommend an alternate cache (doesn't have to be free but should break the bank) which will do what I want? Albert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me plz
suresh kumar wrote: hi, i am using 2 combo box one for country & another one for city.when i select country name from combo box their corresponding city names has to be changed in their corresponding combo box.i dont know how 2 implement this.pz give me some idea.its urgent. A.suresh Send instant messages to your online friends http://in.messenger.yahoo.com Hi Suresh Have a look at QuickForm ( PEAR Module), and make use of the HierSelect option. Have a look at the following page for more info: http://www.thelinuxconsultancy.co.uk/quickform.php Regards Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_SESSION saves all values but Class -- works on one server but not another?!
I have a gentoo server that doesn't save/restore the CLASS portion of a session, but it does retain other $_SESSION values. This code works fine on a debian box. WORKING BOX: [EMAIL PROTECTED]:/lockdown# php --version PHP 5.0.3 (cli) (built: Jan 5 2006 13:18:18) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.3, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.9, Copyright (c) 2003-2005, by Zend Technologies with Zend Optimizer v2.6.0, Copyright (c) 1998-2005, by Zend Technologies NOT WORKING BOX: vmware apache2-php5 # php --version PHP 5.0.5-pl3-gentoo (cli) (built: Dec 14 2005 15:44:04) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.5, Copyright (c) 1998-2004 Zend Technologies I've compared the php.ini files and can't find anything related to sessions that is different. In fact they're almost the same with a few minor exceptions that should have no effect that I can think of. Here is the code I'm executing: UserData array = \n"; print_r($UserData); //set the session variables: $_SESSION['login'] = true; $_SESSION['ie'] = (stristr($_SERVER['HTTP_USER_AGENT'],"MSIE")) ? true : false; $_SESSION['id'] = $UserData['id']; $_SESSION['username'] = $UserData['username']; $_SESSION['firstname'] = $UserData['firstname']; $_SESSION['lastname'] = $UserData['lastname']; $_SESSION['email'] = $UserData['email']; $_SESSION['foo']= '1234567890'; require_once('includes/classes/User.class.php'); $_SESSION['user'] = new User($UserData['id']); echo "_SESSION array = \n"; var_dump($_SESSION); echo "USERNAME = ".$_SESSION['user']->get_username()."\n"; exit; ?> Which properly results in this (as it's all on the same page): UserData array = Array ( [id] => 1 [firstname] => Daevid [lastname] => Vincent [email] => [EMAIL PROTECTED] ) _SESSION array = array(9) { ["login"]=> bool(true) ["ie"]=> bool(true) ["id"]=> string(1) "1" ["username"]=> string(6) "daevid" ["firstname"]=> string(6) "Daevid" ["lastname"]=> string(7) "Vincent" ["email"]=> string(17) "[EMAIL PROTECTED]" ["foo"]=> string(10) "1234567890" ["user"]=> object(User)#2 (24) { ["username:protected"]=> string(6) "daevid" ["firstname:protected"]=> string(6) "Daevid" ["lastname:protected"]=> string(7) "Vincent" ["email:protected"]=> string(17) "[EMAIL PROTECTED]" ... } } USERNAME = daevid Now I load a simple session loading test page with this code: SESSION TEST:"; var_dump($_SESSION); exit; ?> On the working box things are fine (obviously): SESSION TEST: array(9) { ["login"]=> bool(true) ["ie"]=> bool(true) ["id"]=> string(1) "1" ["username"]=> string(6) "daevid" ["firstname"]=> string(6) "Daevid" ["lastname"]=> string(7) "Vincent" ["email"]=> string(17) "[EMAIL PROTECTED]" ["foo"]=> string(10) "1234567890" ["user"]=> object(User)#1 (24) { ["username:protected"]=> string(6) "daevid" ["firstname:protected"]=> string(6) "Daevid" ["lastname:protected"]=> string(7) "Vincent" ["email:protected"]=> string(17) "[EMAIL PROTECTED]" ["timestamp:protected"]=> string(19) "-00-00 00:00:00" ... } } but on the broken box I see: SESSION TEST: array(9) { ["login"]=> bool(true) ["ie"]=> bool(true) ["id"]=> string(1) "1" ["username"]=> string(6) "daevid" ["firstname"]=> string(6) "Daevid" ["lastname"]=> string(7) "Vincent" ["email"]=> string(17) "[EMAIL PROTECTED]" ["foo"]=> string(10) "1234567890" ["user"]=> object(User)#1 (20) { ["username:protected"]=> string(0) "" ["firstname:protected"]=> string(0) "" ["lastname:protected"]=> string(0) "" ["email:protected"]=> string(0) "" ["timestamp:protected"]=> NULL ... } } Notice how the regular session info is there, but the "User" class is all empty or NULL. So SOME of the $_SESSION is working, but not the User class portion. This is completely baffling to me. Examining the /tmp/sess_* file shows this same data. Here is the session portion of php.ini on the broken box: [Session] ; Handler used to store/retrieve data. session.save_handler = files ; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. ; ; As of PHP 4.0.1, you can define the path as: ; ; session.save_path = "N;/path" ; ; where N is an integer. Instead of storing all the session files in ; /path, what this will do is use subdirectories N-levels deep, and ; store the session data in those directories. This is useful if you ; or your OS have problems with lots of files in one directory, and is ; a more efficient layout for servers that handle lots of sessions. ; ; NOTE 1: PHP will not create this directory structure automatically. ; You can use the script in the ext/session dir for that purpose. ; NOTE 2: See the section on garbage collection below if you choose to ; use subdirectorie
Re: [PHP] Validating Radio Buttons in two directions
HiFi: Thanks so much Tedd for the JavaScript. I will keep that snippet for use and study to improve my JS skills. Unfortunately I should have said that I need to stay away from JS in case the users have shut that down in their browsers. I know I can detect that and have them turn it on but I'm dealing with folks who are not technically adept and the survey is long. Given the length of the survey (over 100 questions) any additional hurdles will further lower the rate of return. So I really think I need to do this in PHP though I am open to suggestions here. Okay, no js. So, let's look at the problem. You have ten rows and ten columns -- that's 100 choices that can be recorded by a simple ten element array(10). For example, all radio button groups have ten possibilities. Let's say radio group-one has radio button three marked -- so, your array would be: array(1)=3 (means row one has button 3 selected) The second row has button 9 checked, the array would be: array(2)=9 (means row two has button 9 selected) And so on. The array has to be filled from the radio buttons. You do that from taking the values from each group and filling the array accordingly after the user submits the form. Be careful not to duplicate the names of the buttons. After the user clicks "Submit", you'll need to travel through the array checking each indexed value for duplication. To do this, start at the first index and if its value is greater than zero, then compare its value to all other values. If you find a duplication, then zero the offending value and repeat as necessary. When you travel all through the entire array using index 1 and find no duplications, then use index 2 (provided it's greater than zero) and repeat as necessary with all remaining indexes until the entire array has been removed of all duplicates. Repeat as necessary. If you find any duplicates whatsoever, then set a redo-flag=1. If redo-flag=1, then you repopulate the radio buttons with values from the array and present the form again to the user with a notice how to correctly do the survey. If redo-flag=0, then you have traveled all the way through the array with all indexes reporting a value greater than 0 and have found no duplications -- thus, your survey has been correctly reported. That's the way I would do it -- but, your mileage may vary. tedd -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] creating new class from wrapper class (OOP question)
In a image gallery I have to class'es: class GPicFilePicture extends GPicFileType class GPicFileMovie extends GPicFileType both of them are based on: abstract class GPicFileType In my code I need to create a new GPicFilePicture. To avoid duplicated code I've create a wrapper class: class GPicFile that does something like this: if (fileextension == "jpg") return new GPicFilePicture(); else return new GPicFileMovie(); so my PHP code looks like: $file = new GPicFile($filename); getFileDate() is implemented in both GPicFilePicture and GPicFileMovie. Now I try to do: $file->getFileDate(); I get an error saying: Call to undefined method GPicFile::getFileDate() Where am I going wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP 4.4.2 released!
Derick Rethans wrote: Hello! The PHP Development Team would like to announce the immediate release of PHP 4.4.2. This is a maintenance release that addresses a number of minor security problems and fixes a few regressions that shown up in PHP 4.4.1. All users of PHP 4 are recommended to upgrade to PHP 4.4.2. A separate release announcement is also available. For changes in PHP 4.4.2 since PHP 4.4.1, please consult the PHP 4 ChangeLog. Release Announcement: http://www.php.net/release_4_4_2.php Downloads:http://www.php.net/downloads.php#v4 Changelog:http://www.php.net/ChangeLog-4.php#4.4.2 regards, Derick I just installed the Windows binary and phpinfo still displays PHP Version 4.4.1-pl1 (as does phpversion) Under apache2handler, though, it says: Apache/2.0.55 (Win32) mod_ssl/2.0.55 OpenSSL/0.9.8a PHP/4.4.2 (I run php as an apache module on my home PC.) Have I done something wrong? -- * Chuck Anderson • Boulder, CO http://www.CycleTourist.com Integrity is obvious. The lack of it is common. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Interesting problem in PHP and Squirrelmail
On Wed, 2006-01-18 at 16:20, Mark wrote: > Robert Cummings wrote: > > > > The implementation is slightly more difficult than what I've just > > described, but simple enough :) > > It's truly ugly, don't you think? Actually I find it quite elegant, but maybe that's just me :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mcrypt
On Tue, January 17, 2006 7:05 pm, [EMAIL PROTECTED] wrote: > Since I'm running php under safe mode and the gpglib extension is not > installed in php at my isp gpg seems to be unavalible for me. Are > there anything else I can use with public/private keys that is as > safe/solid/hard to crack as gpg? The mcrypt extension is installed if > that helps, or are all those crypts using the same key for encryption > and decryption? (I've read a couple pages about the crypt algorithms > at wikipedia, but it didn't really help me) If you dig really deep for my name (probably not current email tho) and GPG in the PHP archvies, you'll find a long-running thread about using http://php.net/exec to run gpg WARNING: This exposes your data to 'ps' and 'top' and that ilk... Better to use http://php.net/popen once you've hammered out the "fun" parts... All the different crypts are using different algorithms -- that's rather the whole point of them all having different names and stuff. :-) I'm not sure any of them are similar enough to GPG to be useful, but I *think* you could use some of them to generate key-pairs not unlike GPG and then use them in a similar way to GPG... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Cache (was PHP load to high on server)
On Wed, January 18, 2006 9:37 am, Albert wrote: > For this I wanted to use mmCache (actually I want to use Zend > Performance > Suite but first I need to prove that it is worth $ 1000 per CPU and > from the > stats on the mmCache site mmCache is faster...) but it seems that the > mmCache project has been abandoned as there have been no work done on > it > since 2003. Errr. I wouldn't really trust stats on mmCache site saying mmCache is faster, unless you can corraborate them with independent unbiased sources. Ditto for stats on Zend site! More importantly, you can still (I assume) try the Zend Cache for free for 30 days or whatever it is. Prediction: Zend Cache will probably at least double the overall speed of your application. There are MANY factors that go into that prediction, and your PHP usage may be anamolous in some way I'm missing. But for what you describe, I'm predicting 200% performance improvement. YMMV NAIAA IANAL -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP load to high on server
On Tue, January 17, 2006 11:18 pm, Albert wrote: > The page having the heaviest load uses 5 simultaneous sessions - they > refresh every 5 seconds. Even with just one connection there are 16 > Apache > threads running all occupying between 5 and 20% of CPU. Are you saying that you have a page that chews up 5 HTTP connections, and each uses PHP heavily, and you reload that page every 5 seconds? Maybe you shouldn't do that... Stretch it out to 10 seconds and see where your load goes. Find out which of the 5 sessions is most expensive (slowest). Can you cache the results of that one? How about the second slowest? Can you cache ANYTHING to make the application faster? > Does anyone have an idea of what I can do (short of recoding)? Oh. Well, with no recoding you can: #1. Buy more hardware, and build a server farm. #2. Buy the Zend Cache #3. Install some other Cache product (most of which aren't as good/fast/solid as Zend Cache, imho) Disclosure: I was formerly employed by Zend and am at least as biased as anybody else on this list, if not more so. :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SimpleXML
On Wed, January 18, 2006 3:49 pm, Jay Paulson wrote: > I'm a noob when it comes to parsing an XML file. I have a really > simple > file that I'm getting back from a SOAP service that I need to parse. > I > figure SimpleXML would be great! However, I'm having problems getting > the > name attribute for each column element. The XML is below along with > the > code I'm using to parse it. > > $xml = << > > CE > C > 1 > 2006-01-18 > > > CE > D > 1 > 2006-01-18 > > > CE > E > 5 > 2006-01-18 > > > XML; > > $xml = simplexml_load_string($xml); > print_r($xml); > foreach ($xml->record as $record) { foreach ($xml->record as $key => $record){ echo $key, ": \n"; > list($k, $v) = each($xml->record->$key->attributes()); > echo "{$k} = {$v}"; > echo "{$key} key / {$value} value"; > } > } -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image handling advice needed
On Wed, January 18, 2006 2:10 am, William Stokes wrote: > I need to build an image 'library'. The library will consist mostly of > images taken with digital cameras. Since unedited digicam pics will > most > likely be too big for web usage they need to be edited automatically > so that > they can be put to a web page. > > I'am trying to deside between two options. To resize (=scale down) the > images once they are uploaded to server and store the smaller file or > upload > and store the original BIG file and scale it to thumbnail once it's > viewed. > Any opinnions about this. > > I think that if the disk space is not an issue I could upload the > original > file. But are there performance issues if the thumbnails are created > "on the > fly" if there are hundreds of pics? The question isn't the number of pics, but how many times your server gets pounded on... Or are you planning on scaling down hundreds of pics on *ONE* page on the fly? For sure, don't do that. Or, you can do it, but cache the results of the thumbnails you displayed, so you only have to really scale them in PHP the first time. The real question is: Why do you need / want the original large picture? What use do you have for it? Storage space for hundreds of digital camera images is pretty predictable -- You could figure out exactly how much drive space you need. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse string
Simple XML *should* give you all the info somewhere in its data structures. If not, there are at least 2 or 3 other XML parsers that have been built s extensions to PHP over the years. Plus there is at least one XML parser in PEAR, and probably one or more in PECL. A quick search on http://php.net will find them. If all else fails, and you're really really stuck with no XML parsers due to brain-dead web-hosting, it should take you about an hour to hack a script to use http://php.net/explode and/or http://php.net/preg_match_all to get the info you want, *IF* the XML is predictable. It is NOT recommended that you do this, but here is a start if you really have no way to get a real XML parser on-board: $string = '[insert your XML here]'; preg_match_all('/<(a-z)+\\s*(([a-z]+)="([^"]*)"\\s*)*\\s*\\/>/isU', $string, $matches); var_dump($matches); You may want to find and download "The Regex Coach" program to help you learn/understand Regular Expressions. On Wed, January 18, 2006 12:12 pm, Ron Eggler (Paykiosks) wrote: > Hi, > > I need to parse a String like pasted below for all information > (values) > those are included like 'var=value'. How can I do that? Are there any > XML-parsing functions available those'd fit for that job? I've ust > found > that one (http://ca.php.net/simplexml) but it seems like i could use > it > only for exctracting the 'terms' cause they're in the format that > simplexml > expects. > Thank you for every help! > > [String] > > > > icon="https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; > /> > icon="https://www.pinsprepaid.com/image.aspx?name="; /> > icon="https://www.pinsprepaid.com/image.aspx?name="; /> > icon="https://www.pinsprepaid.com/image.aspx?name=PlayPhone-200x100.gif"; > /> > icon="https://www.pinsprepaid.com/image.aspx?name=PayGo_200_100.gif"; > /> > icon="https://www.pinsprepaid.com/image.aspx?name="; /> > icon="https://www.pinsprepaid.com/image.aspx?name="; /> > icon="https://www.pinsprepaid.com/image.aspx?name="; /> > icon="https://www.pinsprepaid.com/image.aspx?name=c59-BoostMobile.gif"; > /> > icon="https://www.pinsprepaid.com/image.aspx?name=cing-blue.gif"; /> > icon="https://www.pinsprepaid.com/image.aspx?name=pageplus.gif"; /> > icon="https://www.pinsprepaid.com/image.aspx?name=c29-t-mobile_ticketlogo.gif"; > /> > icon="https://www.pinsprepaid.com/image.aspx?name=unefon_logo.gif"; /> > icon="https://www.pinsprepaid.com/image.aspx?name=verizon.gif"; /> > icon="https://www.pinsprepaid.com/image.aspx?name=Virgin+Mobile > +200x100.gif" /> > distributor="EWI" > discontinued="false" cardtype="PIN" transactionType="PURC"> >region="Optional Services (test)" amount="5" wholesalePrice="4.5" > icon="https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; > upc="870368000420"> > roamingRate="" > numberOfMin=""/> > > > Refer to the Reconex brochure for complete terms and conditions. > > > > distributor="EWI" > discontinued="false" cardtype="PIN" transactionType="PURC"> >region="Optional Services (test)" amount="10" wholesalePrice="9" > icon="https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; > upc="870368000437"> > roamingRate="" > numberOfMin=""/> > > > Refer to the Reconex brochure for complete terms and conditions. > > > > distributor="EWI" > discontinued="false" cardtype="PIN" transactionType="PURC"> >region="Regional Refill (test)" amount="52.99" wholesalePrice="47.7" > icon="https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; > upc="870368000413"> > roamingRate="" > numberOfMin=""/> > > > Refer to the Reconex brochure for complete terms and conditions. > > > > distributor="EWI" > discontinued="false" cardtype="PIN" transactionType="PURC"> >region="Regional Starter (test)" amount="39" wholesalePrice="35.1" > icon="https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; > upc="870368000406"> > roamingRate="" > numberOfMin=""/> > > > Refer to the Reconex brochure for complete terms and conditions. > > > > [/String] > -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: parse string
Hi Ron, Not aware of an existing function for that task... but - since it looks like all the value are strictly in quotes (="value") - if you know all the 'var's ahead of time (such as 'carrier') then you could extract the data fairly easily going through the data line by line checking with strpos and using substr to get the values... it'll take some work, but it'll do the job... Cheers, Ben -Original Message- From: Ron Eggler (Paykiosks) [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 18, 2006 2:12 PM To: php-general@lists.php.net Subject: parse string Hi, I need to parse a String like pasted below for all information (values) those are included like 'var=value'. How can I do that? Are there any XML-parsing functions available those'd fit for that job? I've ust found that one (http://ca.php.net/simplexml) but it seems like i could use it only for exctracting the 'terms' cause they're in the format that simplexml expects. Thank you for every help! [String] https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; /> https://www.pinsprepaid.com/image.aspx?name="; /> https://www.pinsprepaid.com/image.aspx?name="; /> https://www.pinsprepaid.com/image.aspx?name=PlayPhone-200x100.gif"; /> https://www.pinsprepaid.com/image.aspx?name=PayGo_200_100.gif"; /> https://www.pinsprepaid.com/image.aspx?name="; /> https://www.pinsprepaid.com/image.aspx?name="; /> https://www.pinsprepaid.com/image.aspx?name="; /> https://www.pinsprepaid.com/image.aspx?name=c59-BoostMobile.gif"; /> https://www.pinsprepaid.com/image.aspx?name=cing-blue.gif"; /> https://www.pinsprepaid.com/image.aspx?name=pageplus.gif"; /> https://www.pinsprepaid.com/image.aspx?name=c29-t-mobile_ticketlogo.gi f" /> https://www.pinsprepaid.com/image.aspx?name=unefon_logo.gif"; /> https://www.pinsprepaid.com/image.aspx?name=verizon.gif"; /> https://www.pinsprepaid.com/image.aspx?name=Virgin+Mobile +200x100.gif" /> https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; upc="870368000420"> Refer to the Reconex brochure for complete terms and conditions. https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; upc="870368000437"> Refer to the Reconex brochure for complete terms and conditions. https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; upc="870368000413"> Refer to the Reconex brochure for complete terms and conditions. https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; upc="870368000406"> Refer to the Reconex brochure for complete terms and conditions. [/String] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Drop down directory structure list box
On Wed, January 18, 2006 1:21 pm, Jay Blanchard wrote: > [snip] >>Does anyone know what the best way to list a directory dialog box or >>directory drop down list in >>Php? Files on the desktop, or up on the server? >> The script I'm writing has a form that asks the user where his >>files are and I don't want the >>user to have to remember the whole directory path in order to type >> it. >> >>Sean >> >> >> > u can also usethis will open the > Explorer dialog box for select files. > [/snip] > > Along these same lines, does anyone know how to make the file dialog > start > in a specific directory? I saw this the other day but forgot where. I > clicked browse and the dialog popped up pointed to My Pictures (which > at > least works for most Windblows users). I meant to look at the code, > but > didn't Yikes! If it *DOES* work, you've probably got yet another security problem in Windows. Suppose, for example, that I do something like this: http://example.com/"; method="post" enctype="multipart/form-data"> What's your name? Who's your daddy? Now, the unsuspecting user will be HANDING me the file I shouldn't have without ever seeing anything about it. Even if it "only" lets you pick the directory, but not the file, it probably exposes too much information about my desktop for my tastes. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Interesting problem in PHP and Squirrelmail
On Wed, January 18, 2006 2:36 pm, Mark wrote: > Here's a point of debate, should this sort of behavior be allowed? Of course it should be allowed! It's a standard computer science technique! There are entire branches of mathematics / science devoted to recursive graph theory. Whole *BOOKS* written about it. Go here and you'll find WAAY more info than you ever wanted to now: http://info.com/cyclic+graph :-) > If > it is > allowable, how does one support it in any sort of serialized > methodology? The most common solution was already posted. I'm sure that there are more in the textbooks. If it helps any, Common Lisp routinely dumps out cyclic data structures and reads them back in as text files. Of course, in Common Lisp, all the data structures are considered fair game for self-modification as source code, since source code and data have the same internal structure, so that's not exactly the norm in CS... :-) > I > have a few ideas but none very pretty. I'm pretty sure it causes > problems > in regular PHP as these sorts of pages sometimes have problems anyway. The kind of problem a recursive mistake causes is usually pretty obvious and easy to fix. You spiral into an infinite loop and slam the CPU and your computer turns into a door-stop until you kill that process. It's pretty unlikely that the current remaining bugs in SquirrelMail (which I use every day, btw) are caused by this, imho. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SimpleXML
I'm a noob when it comes to parsing an XML file. I have a really simple file that I'm getting back from a SOAP service that I need to parse. I figure SimpleXML would be great! However, I'm having problems getting the name attribute for each column element. The XML is below along with the code I'm using to parse it. $xml = << CE C 1 2006-01-18 CE D 1 2006-01-18 CE E 5 2006-01-18 XML; $xml = simplexml_load_string($xml); print_r($xml); foreach ($xml->record as $record) { list($k, $v) = each($xml->record->$key->attributes()); echo "{$k} = {$v}"; echo "{$key} key / {$value} value"; } } The results I get are as follows: 0 = BUSINESS_UNIT column key / C value 0 = BUSINESS_UNIT column key / 1 value 0 = BUSINESS_UNIT column key / 2006-01-18 value 0 = BUSINESS_UNIT column key / CE value 0 = BUSINESS_UNIT column key / D value 0 = BUSINESS_UNIT column key / 1 value 0 = BUSINESS_UNIT column key / 2006-01-18 value 0 = BUSINESS_UNIT column key / CE value 0 = BUSINESS_UNIT column key / E value 0 = BUSINESS_UNIT column key / 5 value 0 = BUSINESS_UNIT column key / 2006-01-18 value -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Interesting problem in PHP and Squirrelmail
Robert Cummings wrote: > On Wed, 2006-01-18 at 15:36, Mark wrote: >> >> [-- CLIPPED --] >> >> Here's a point of debate, should this sort of behavior be allowed? If it >> is allowable, how does one support it in any sort of serialized >> methodology? I have a few ideas but none very pretty. I'm pretty sure it >> causes problems in regular PHP as these sorts of pages sometimes have >> problems anyway. > > Yes it should be allowed, yes you can serialize it. Look at PHP's > serializer. You'll notice they track recursive structures and properly > unserialize them. One way to do it is to unroll objects into a single > lookup. When you FIRST encounter an object assign it a unique ID (make > it a property on the object that is unlikely to collide with any other), This was that "but nove very pretty" options I was thinking about. > add the object to the lookup with the UID as the key and continue > serializing, the next time you encounter the object, you know you're > recursing and so in your serializer you have a special marker that > indicates the current object points to an existing serialized object > with the given UID. Then you move onto the next item. Your unserializer > will then be able to traverse the serialized data and as it comes across > objects it can create the same lookup and when it hits the recurse > marker it will know to create a reference to the original. > > The implementation is slightly more difficult than what I've just > described, but simple enough :) It's truly ugly, don't you think? > > HTH, > Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Interesting problem in PHP and Squirrelmail
On Wed, 2006-01-18 at 15:44, Robert Cummings wrote: > > Yes it should be allowed, Actualy was just thinking about how I didn't allow this in JavaScript... you might want to make it an option as a second parameter to recurse. I know in JavaScript any DOM element references the entire DOM tree and you never ever want to serialize the whole DOM *lol* -- or do you? ;) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Interesting problem in PHP and Squirrelmail
On Wed, 2006-01-18 at 15:36, Mark wrote: > > [-- CLIPPED --] > > Here's a point of debate, should this sort of behavior be allowed? If it is > allowable, how does one support it in any sort of serialized methodology? I > have a few ideas but none very pretty. I'm pretty sure it causes problems > in regular PHP as these sorts of pages sometimes have problems anyway. Yes it should be allowed, yes you can serialize it. Look at PHP's serializer. You'll notice they track recursive structures and properly unserialize them. One way to do it is to unroll objects into a single lookup. When you FIRST encounter an object assign it a unique ID (make it a property on the object that is unlikely to collide with any other), add the object to the lookup with the UID as the key and continue serializing, the next time you encounter the object, you know you're recursing and so in your serializer you have a special marker that indicates the current object points to an existing serialized object with the given UID. Then you move onto the next item. Your unserializer will then be able to traverse the serialized data and as it comes across objects it can create the same lookup and when it hits the recurse marker it will know to create a reference to the original. The implementation is slightly more difficult than what I've just described, but simple enough :) HTH, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Interesting problem in PHP and Squirrelmail
I am working on an XML serializer module for PHP. It will allow session information to be stored as XML in the database. While this sounds like self promotion, and it probably is a bit, it is needed to make sense of why I am doing this. Anyway, the XML stream is so that I can use PHP session data outside of PHP. I'm working on a PostgreSQL function to extract the PHP session information when it is stored as this format of XML. Anyway, to make a long story short, I was crashing badly with certain pages in squirrelmail. I suspected it was endlessly recursing over a few variables. Not the immediate predecessor either, but a couple back which would be hard to find unless you scanned the recursion stack. So, I added this capability in the serializer, and low and behold, I found that squirrelmail was using a self referencing hierarchy. Which looked something like this: messages->1126708752->544->entities->4->parent->entities Where the "messages" variable had an item "1126708752" which had an item "544" etc. etc. The first "entities" variable was in fact the same pointer as the second "entities" pointer in the chain. Here's a point of debate, should this sort of behavior be allowed? If it is allowable, how does one support it in any sort of serialized methodology? I have a few ideas but none very pretty. I'm pretty sure it causes problems in regular PHP as these sorts of pages sometimes have problems anyway. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me pllzzzzzz
Whatever Suresh, I know as a beginer you are facing this problems. I would suggest that you check standalone htm version of php document. The dynamic combo script can be located at http://www.weberdev.com/get_example.php3?count=4074&mode=text This site has 1000s of FREE ready to use PHP,MySQL scripts. Check out and list can saved from future urgent requests :) Thanks, Richard Correia On 1/18/06, suresh kumar <[EMAIL PROTECTED]> wrote: > > hi, >i am having 2 combo box one for city & another one > for country,when i select particular country say > "india" their corresponding cities will be displayed > in city combobox as "delhi,bangalore.",when i > select "Australia" thier cities like > "perth,brisbane"will be displayed.plz help me > itz very urgent. >A.suresh > > Send instant messages to your online friends http://in.messenger.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
[PHP] URL -> stream context
So I've been poring over the docs for the new stream stuff, and it looks pretty nifty, except... I'd really like to be able to just hand a URL to PHP like: http://php.net/manual/en/ref.stream.php And let PHP figure out how to create a stream context out of that, and which port to use, and how to do the GET to start things off, so I can just read my data. In other words, I'm greedy, and I want *BOTH* the simplicity of fopen() *and* the flexiblity of adding filters and all the fun new stuff. I don't want to have to tear apart the URL myself and mess with sending 'GET ...' and 'host: ...' Did I miss a stream_url_to_context() function somewhere?... Not just parse_url() -- That will tear apart the URL, but then I have to do all the work that's buried in fopen() Bigger Picture: I have an old class that will take an array of HTTP URLs, and fsockopen them, set them non-blocking, and then fread() each in turn, and gather an array of results. The class has a 'timeout' parameter that limits how long it will wait for all this to happen. Each result set is marked as complete or incomplete. Complete results may be cached, for however long you choose in another setting. If results are incomplete, the cached version is used, no matter how obsolete. (This is for a search engine.) Blah, blah, blah. Anyway, I'd *LIKE* to be able to just allow *ANY* URL to be passed in, and have some nifty stream function, not unlike fopen(), that will take care of the grotty details of doing whatever it takes to get the data, but let me set the socket non-blocking and read them asynchronously. I feel like I must be missing something fundamentally simple here in all this stream stuff, but it's sure not obvious what I'm missing in the docs. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Drop down directory structure list box
[snip] >Does anyone know what the best way to list a directory dialog box or >directory drop down list in >Php? The script I'm writing has a form that asks the user where his >files are and I don't want the >user to have to remember the whole directory path in order to type it. > >Sean > > > u can also usethis will open the Explorer dialog box for select files. [/snip] Along these same lines, does anyone know how to make the file dialog start in a specific directory? I saw this the other day but forgot where. I clicked browse and the dialog popped up pointed to My Pictures (which at least works for most Windblows users). I meant to look at the code, but didn't -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Drop down directory structure list box
Sugrue, Sean wrote: Does anyone know what the best way to list a directory dialog box or directory drop down list in Php? The script I'm writing has a form that asks the user where his files are and I don't want the user to have to remember the whole directory path in order to type it. Sean u can also usethis will open the Explorer dialog box for select files. sumeet shroff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Drop down directory structure list box
Does anyone know what the best way to list a directory dialog box or directory drop down list in Php? The script I'm writing has a form that asks the user where his files are and I don't want the user to have to remember the whole directory path in order to type it. Sean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parse string
Hi, I need to parse a String like pasted below for all information (values) those are included like 'var=value'. How can I do that? Are there any XML-parsing functions available those'd fit for that job? I've ust found that one (http://ca.php.net/simplexml) but it seems like i could use it only for exctracting the 'terms' cause they're in the format that simplexml expects. Thank you for every help! [String] https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; /> https://www.pinsprepaid.com/image.aspx?name="; /> https://www.pinsprepaid.com/image.aspx?name="; /> https://www.pinsprepaid.com/image.aspx?name=PlayPhone-200x100.gif"; /> https://www.pinsprepaid.com/image.aspx?name=PayGo_200_100.gif"; /> https://www.pinsprepaid.com/image.aspx?name="; /> https://www.pinsprepaid.com/image.aspx?name="; /> https://www.pinsprepaid.com/image.aspx?name="; /> https://www.pinsprepaid.com/image.aspx?name=c59-BoostMobile.gif"; /> https://www.pinsprepaid.com/image.aspx?name=cing-blue.gif"; /> https://www.pinsprepaid.com/image.aspx?name=pageplus.gif"; /> https://www.pinsprepaid.com/image.aspx?name=c29-t-mobile_ticketlogo.gif"; /> https://www.pinsprepaid.com/image.aspx?name=unefon_logo.gif"; /> https://www.pinsprepaid.com/image.aspx?name=verizon.gif"; /> https://www.pinsprepaid.com/image.aspx?name=Virgin+Mobile +200x100.gif" /> https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; upc="870368000420"> Refer to the Reconex brochure for complete terms and conditions. https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; upc="870368000437"> Refer to the Reconex brochure for complete terms and conditions. https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; upc="870368000413"> Refer to the Reconex brochure for complete terms and conditions. https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif"; upc="870368000406"> Refer to the Reconex brochure for complete terms and conditions. [/String]
Re: [PHP] help me pllzzzzzz
On Wed, 2006-01-18 at 11:11, John Nichel wrote: > Jay Blanchard wrote: > > [snip] > >i am having 2 combo box one for city & another one > > for country,when i select particular country say > > "india" their corresponding cities will be displayed > > in city combobox as "delhi,bangalore.",when i > > select "Australia" thier cities like > > "perth,brisbane"will be displayed.plz help me > > itz very urgent. > > [/snip] > > > > > > H, is everything you do urgent? > > I think he and I must have the same boss. At least you don't write help emails in stupid speak. Every time I see plz and itz and 2 I want to go find a big brick... well nevermind. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Cache (was PHP load to high on server)
http://eaccelerator.net/HomeUk Actually, is the former mmCache with a new team of developers and some impovements. The last known version of mmCache I've played with one week ago core dumped the httpd on ./apachectl stop. The last stable version of eAccelerator (0.9.3, I think) works like a charm with PHP 4.4.2 / Apache 1.3.4 Stefan Albert wrote: I also want an opcode cache to cache the compiled pages on the server in an attempt to speed up the HTTP server. For this I wanted to use mmCache (actually I want to use Zend Performance Suite but first I need to prove that it is worth $ 1000 per CPU and from the stats on the mmCache site mmCache is faster...) but it seems that the mmCache project has been abandoned as there have been no work done on it since 2003. Can someone confirm this or recommend an alternate cache (doesn't have to be free but should break the bank) which will do what I want? Albert
Re: [PHP] help me pllzzzzzz
You need to build JavaScript logic for that. Try searching on JavaScript developer sites and mailing lists. This has nothing to do with PHP -- unless you are dynamically building the JavaScript. -- Anas Mughal On 1/18/06, suresh kumar <[EMAIL PROTECTED]> wrote: > > hi, >i am having 2 combo box one for city & another one > for country,when i select particular country say > "india" their corresponding cities will be displayed > in city combobox as "delhi,bangalore.",when i > select "Australia" thier cities like > "perth,brisbane"will be displayed.plz help me > itz very urgent. >A.suresh > > Send instant messages to your online friends http://in.messenger.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Anas Mughal
Re: [PHP] PHP Cache (was PHP load to high on server)
on your *nix cmdline type this: pear install apc (if you don't have pear installed then you should fix that first ;-) now read here about how to use it: http://php.net/apc I love it even though it crashes when caching the opcodes of certain class files (php5 files that make use of __get()/__set() to retrieve [sub-]objects). take note that APC does 2 things: 1. op code caching 2. manage some shared memory (a central place where you can stick stuff that needs to be read again and again and again; but doesn't need updating very often) by all means come back if you get stuck or have specific issues ( I can't garantee I will be able to help - I'm only a little further down the apc road than you**) rgds, Jochem ** the internals mailing list archive can attest to the ammount of times I have badgered Rasmus about APC ;-) (Rasmus cowrote APC btw) Albert wrote: I wrote: I am running SuSE 9.2 (Kernel 2.6.8-24-default) with Apache 2.0.50 and PHP 4.3.8 (as an Apache module) on a Celeron 900 with 304MB RAM. This machine is used for testing. We have made some changes to our PHP application and now the machine is having trouble serving the pages. Apache is occupying almost 90% CPU usage. I have resolved this issue by removing a piece of code which reads a set of parameters from a database. It seems that the hard disk on the machine is quite slow, slowing down all database access with it... I now check if the parameters are set in the session, if it is I use them otherwise I read them from the database and save it as session variables. When it changes I simply remove it from the session so it forces an update. So far it is working quite well. I now want to go and take all the static stuff that the user will configure once in a life time and put it in the session and only update it when it changes instead of reading it from the database every five seconds or so. For this I don't want to use a disk based session handler. I want the session variables to remain in memory (about 20KB per user) as to speed up the whole process. I also want an opcode cache to cache the compiled pages on the server in an attempt to speed up the HTTP server. For this I wanted to use mmCache (actually I want to use Zend Performance Suite but first I need to prove that it is worth $ 1000 per CPU and from the stats on the mmCache site mmCache is faster...) but it seems that the mmCache project has been abandoned as there have been no work done on it since 2003. Can someone confirm this or recommend an alternate cache (doesn't have to be free but should break the bank) which will do what I want? Albert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP load to high on server
Hello, The same problem I've had on a FreeBSD 4.11 box, running Apache 1.3.3 and PHP 4.3.5. From time to time, httpd went to 90%+ (I supposed it was a memory leak or smth). After upgrading Apache to 1.3.4 and PHP to 4.4.2, everything smoothed down and we got no more 90+% httpd, even on heavy load. If possible, try to downgrade/upgrade PHP and/or Apache (eventually on a test machine). Regards, Stefan From: Jochem Maas Sent: Mi 18.01.2006 18:59 To: Adi Cc: Albert; PHP List Subject: Re: [PHP] PHP load to high on server Adi wrote: Run some tracer apps on your code...could be some wild loops of some sort? Never the less, ZEND debugger with the module should do the jobit will tell you which files/functions etc are runningnice tool to track execution time etc... On 1/18/06, Albert <[EMAIL PROTECTED]> wrote: Hi I am running SuSE 9.2 (Kernel 2.6.8-24-default) with Apache 2.0.50 and PHP 4.3.8 (as an Apache module) on a Celeron 900 with 304MB RAM. This machine is used for testing. We have made some changes to our PHP application and now what changes? DB related per chance? doing any queries on tables that are not indexed properly? or maybe your app creates tons of objects? (in which case you might look at being able to clone objects rather than init new ones where possible). the machine is having trouble serving the pages. Apache is occupying almost 90% CPU usage. My Apache log configuration is: %a %b %H %r %>s %t %T %X %a : Remote IP %b : Size of response %H : Protocol %r : Request %>s : Last status of request %t : Time of request %T : Time to serve %X : Connection status after serving request In the log below the last character after the timestamp indicates the following: X : Connection terminated before end serving request + : Connection might not be terminated - : Connection terminated As you will notice almost all the statuses is connection might not have been terminated. The page having the heaviest load uses 5 simultaneous sessions - they refresh every 5 seconds. Even with just one connection there are 16 Apache threads running all occupying between 5 and 20% of CPU. Does anyone have an idea of what I can do (short of recoding)? TIA Albert From our Apache log: 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:29 +] 1 X 192.168.x.x 1845 HTTP/1.1 GET /msgMon.php?h=3D1024&w=3D1280 HTTP/1.1 200 [17/Jan/2006:16:16:28 +] 2 + 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 [17/Jan/2006:16:16:29 +] 1 + 192.168.x.x 2839 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:29 +] 2 + 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:31 +] 1 + 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:31 +] 1 + 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 [17/Jan/2006:16:16:33 +] 0 + 192.168.x.x 429 HTTP/1.1 GET /display_background.php HTTP/1.1 200 [17/Jan/2006:16:16:32 +] 2 + 192.168.x.x 178 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:33 +] 3 + 192.168.x.x 3325 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:33 +] 3 + 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 [17/Jan/2006:16:16:33 +] 3 X 192.168.x.x 1249 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:33 +] 4 + 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:34 +] 3 + 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 [17/Jan/2006:16:16:37 +] 1 + 192.168.x.x 431 HTTP/1.1 GET /display_background.php HTTP/1.1 200 [17/Jan/2006:16:16:35 +] 3 + 192.168.x.x 2823 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:35 +] 4 + 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 [17/Jan/2006:16:16:39 +] 0 + 192.168.x.x 1845 HTTP/1.1 GET /msgMon.php?h=3D768&w=3D1024 HTTP/1.1 200 [17/Jan/2006:16:16:37 +] 3 + 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:38 +] 3 X 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 [17/Jan/2006:16:16:39 +] 2 X 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 [17/Jan/2006:16:16:39 +] 2 + 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:39 +] 3 + 192.168.x.x 2828 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:39 +] 3 + 192.168.x.x 429 HTTP/1.1 GET /display_background.php HTTP/1.1 200 [17/Jan/2006:16:16:42 +] 2 + 192.168.x.x 178 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:43 +] 2 + 192.168.x.x 3325 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:43 +] 3 + 192.168.x.x 1260 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:43 +] 3 + 192.168.x.x 1845 HTTP/1.1 GET /msgMon.php?h=3D1024&w=3D1280 HTTP/1.1 200 [17/Jan/2006:16:16:43 +] 3 +
RE: [PHP] PHP Cache (was PHP load to high on server)
I wrote: > I am running SuSE 9.2 (Kernel 2.6.8-24-default) with Apache 2.0.50 and PHP > 4.3.8 (as an Apache module) on a Celeron 900 with 304MB RAM. This machine > is used for testing. We have made some changes to our PHP application and > now the machine is having trouble serving the pages. Apache is occupying > almost 90% CPU usage. I have resolved this issue by removing a piece of code which reads a set of parameters from a database. It seems that the hard disk on the machine is quite slow, slowing down all database access with it... I now check if the parameters are set in the session, if it is I use them otherwise I read them from the database and save it as session variables. When it changes I simply remove it from the session so it forces an update. So far it is working quite well. I now want to go and take all the static stuff that the user will configure once in a life time and put it in the session and only update it when it changes instead of reading it from the database every five seconds or so. For this I don't want to use a disk based session handler. I want the session variables to remain in memory (about 20KB per user) as to speed up the whole process. I also want an opcode cache to cache the compiled pages on the server in an attempt to speed up the HTTP server. For this I wanted to use mmCache (actually I want to use Zend Performance Suite but first I need to prove that it is worth $ 1000 per CPU and from the stats on the mmCache site mmCache is faster...) but it seems that the mmCache project has been abandoned as there have been no work done on it since 2003. Can someone confirm this or recommend an alternate cache (doesn't have to be free but should break the bank) which will do what I want? Albert -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 2006/01/18 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP load to high on server
Adi wrote: Run some tracer apps on your code...could be some wild loops of some sort? Never the less, ZEND debugger with the module should do the jobit will tell you which files/functions etc are runningnice tool to track execution time etc... On 1/18/06, Albert <[EMAIL PROTECTED]> wrote: Hi I am running SuSE 9.2 (Kernel 2.6.8-24-default) with Apache 2.0.50 and PHP 4.3.8 (as an Apache module) on a Celeron 900 with 304MB RAM. This machine is used for testing. We have made some changes to our PHP application and now what changes? DB related per chance? doing any queries on tables that are not indexed properly? or maybe your app creates tons of objects? (in which case you might look at being able to clone objects rather than init new ones where possible). the machine is having trouble serving the pages. Apache is occupying almost 90% CPU usage. My Apache log configuration is: %a %b %H %r %>s %t %T %X %a : Remote IP %b : Size of response %H : Protocol %r : Request %>s : Last status of request %t : Time of request %T : Time to serve %X : Connection status after serving request In the log below the last character after the timestamp indicates the following: X : Connection terminated before end serving request + : Connection might not be terminated - : Connection terminated As you will notice almost all the statuses is connection might not have been terminated. The page having the heaviest load uses 5 simultaneous sessions - they refresh every 5 seconds. Even with just one connection there are 16 Apache threads running all occupying between 5 and 20% of CPU. Does anyone have an idea of what I can do (short of recoding)? TIA Albert From our Apache log: 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:29 +] 1 X 192.168.x.x 1845 HTTP/1.1 GET /msgMon.php?h=3D1024&w=3D1280 HTTP/1.1 200 [17/Jan/2006:16:16:28 +] 2 + 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 [17/Jan/2006:16:16:29 +] 1 + 192.168.x.x 2839 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:29 +] 2 + 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:31 +] 1 + 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:31 +] 1 + 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 [17/Jan/2006:16:16:33 +] 0 + 192.168.x.x 429 HTTP/1.1 GET /display_background.php HTTP/1.1 200 [17/Jan/2006:16:16:32 +] 2 + 192.168.x.x 178 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:33 +] 3 + 192.168.x.x 3325 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:33 +] 3 + 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 [17/Jan/2006:16:16:33 +] 3 X 192.168.x.x 1249 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:33 +] 4 + 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:34 +] 3 + 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 [17/Jan/2006:16:16:37 +] 1 + 192.168.x.x 431 HTTP/1.1 GET /display_background.php HTTP/1.1 200 [17/Jan/2006:16:16:35 +] 3 + 192.168.x.x 2823 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:35 +] 4 + 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 [17/Jan/2006:16:16:39 +] 0 + 192.168.x.x 1845 HTTP/1.1 GET /msgMon.php?h=3D768&w=3D1024 HTTP/1.1 200 [17/Jan/2006:16:16:37 +] 3 + 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:38 +] 3 X 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 [17/Jan/2006:16:16:39 +] 2 X 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 [17/Jan/2006:16:16:39 +] 2 + 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:39 +] 3 + 192.168.x.x 2828 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:39 +] 3 + 192.168.x.x 429 HTTP/1.1 GET /display_background.php HTTP/1.1 200 [17/Jan/2006:16:16:42 +] 2 + 192.168.x.x 178 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:43 +] 2 + 192.168.x.x 3325 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:43 +] 3 + 192.168.x.x 1260 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:43 +] 3 + 192.168.x.x 1845 HTTP/1.1 GET /msgMon.php?h=3D1024&w=3D1280 HTTP/1.1 200 [17/Jan/2006:16:16:43 +] 3 + 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 [17/Jan/2006:16:16:46 +] 0 + 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 [17/Jan/2006:16:16:44 +] 1 + 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 [17/Jan/2006:16:16:46 +] 1 + 192.168.x.x 2807 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:46 +] 1 + 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 [17/Jan/2006:16:16:48 +] 0 + 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1
Re: [PHP] help me pllzzzzzz
suresh kumar wrote: hi, i am having 2 combo box one for city & another one for country,when i select particular country say "india" their corresponding cities will be displayed in city combobox as "delhi,bangalore.",when i select "Australia" thier cities like "perth,brisbane"will be displayed.plz help me itz very urgent. hire a ([EMAIL PROTECTED](*#% programmer? because we are here to help you not write your whole project for you. I'll tell you what I do when things are urgent (I think John's boss is a client of mine because 'urgent' occurs 20 times a day)... I go here: http://www.yahoo.com or here: http://www.google.com or here: http://php.net or here: http://beeblex.com then I type something relevant into a search box, hit send and start reading (nice side effect of reading is that you learn that words like 'please', for instance, don't contain any 'z's but it does contain a number of vowels) click below for approx 586,000 pages related to your urgent problem: http://www.google.com/search?num=100&q=dynamic+combo+boxes+php A.suresh rgd, A. Raving Loon. Send instant messages to your online friends http://in.messenger.yahoo.com we let it go because its a yahoo ad ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: header data being inserted into message
That did not work, however what does seem to work is changing all my \r\n to just \n ... which I found after going over the php docs again at http://www.php.net/manual/en/function.mail.php ... "Note: If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with RFC 2822." ... we're using FreeBSD 4.11-STABLE so that must be in the category of one of the "poor quality Unix mail transfer agents" Thanks for the input! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 18, 2006 11:29 AM To: ET Support Subject: RE: [PHP] RE: header data being inserted into message what you're showing indicates that an MTA is getting confused about the structure of the message and putting the message-id into the body, rather than header. you need to have a cr/lf (null line) between the header and the body, otherwise the/an MTA can get things mixed up. so, when you exit your bcc loop write out (another) "\n". Original Message > Date: Wednesday, January 18, 2006 10:52:10 AM -0400 > From: ET Support <[EMAIL PROTECTED]> > To: Richard Correia <[EMAIL PROTECTED]> > Cc: php-general@lists.php.net > Subject: RE: [PHP] RE: header data being inserted into message > > Hi Richard, > > Thanks for the response, however I do not want to have to use any > special classes or other software... I want to get it working just > using the basic php functions, which should be possible as far as I > understand the php documentation... if I keep finding that I can't > get it working then maybe I'll go to majordomo2. > > Anyone else have some advice for me here? > > Thanks, > Ben > > -Original Message- > From: Richard Correia [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 17, 2006 12:37 PM > To: ET Support > Cc: php-general@lists.php.net > Subject: Re: [PHP] RE: header data being inserted into message > > > Hey, > > You can use the readymase mailer class from > http://www.weberdev.com/get_example-462.html > > and > > http://www.weberdev.com/get_example-3724.html > > Thanks > Richard > > > On 1/17/06, ET Support <[EMAIL PROTECTED]> wrote: > Hello all, > > I am having a problem using PHP's mail function to send mail via > BCC to multiple recipients. Here's my code; > -- > $get_emails = pg_exec($dbh,"SELECT email FROM mailing_list WHERE > conf = 1"); $count = pg_numrows($get_emails); > $bcc_count = $envelope_count = 0; > $bcc_limit = 200; > $subject = $body = 'test message'; > $from = '[EMAIL PROTECTED]'; > $header = "From: $from\r\n"; > for($x = 0; $x < $count; $x++) { >$email = pg_result($get_emails,$x,0); >if($bcc_count >= $bcc_limit) { >if($x > 0) { >$envelope_count++; >mail($from,$subject,$body,$headers); >} >$headers = $header . "Bcc: $email\r\n"; >$bcc_count = 1; >} else { >$headers .= "Bcc: $email\r\n"; >$bcc_count++; >} > } ># send the last envelope > mail($from,$subject,$body,$headers); > -- > > The problem is that for some recipients they get a message body > like this; > > -- > Message-Id: < [EMAIL PROTECTED]> > Date: Mon, 16 Jan 2006 17:06:40 + (GMT) > > test message > -- > > Any idea why those headers are being inserted into the message body > and how that can be prevented? > > Thanks, > Ben King > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- End Original Message -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] help me pllzzzzzz
I have a combo php javascript to do that. Trying to dig it up. Send email to [EMAIL PROTECTED] and ill have it separated by then. -Original Message- From: Dan Parry [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 18, 2006 10:18 AM To: 'John Nichel'; php-general@lists.php.net Subject: RE: [PHP] help me pllzz Or my sense of sailing to deadlines :) -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: 18 January 2006 16:11 To: php-general@lists.php.net Subject: Re: [PHP] help me pllzz Jay Blanchard wrote: > [snip] >i am having 2 combo box one for city & another one > for country,when i select particular country say > "india" their corresponding cities will be displayed > in city combobox as "delhi,bangalore.",when i > select "Australia" thier cities like > "perth,brisbane"will be displayed.plz help me > itz very urgent. > [/snip] > > > H, is everything you do urgent? I think he and I must have the same boss. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ NOD32 1.1370 (20060118) Information __ This message was checked by NOD32 antivirus system. http://www.eset.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] help me pllzzzzzz
Or my sense of sailing to deadlines :) -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: 18 January 2006 16:11 To: php-general@lists.php.net Subject: Re: [PHP] help me pllzz Jay Blanchard wrote: > [snip] >i am having 2 combo box one for city & another one > for country,when i select particular country say > "india" their corresponding cities will be displayed > in city combobox as "delhi,bangalore.",when i > select "Australia" thier cities like > "perth,brisbane"will be displayed.plz help me > itz very urgent. > [/snip] > > > H, is everything you do urgent? I think he and I must have the same boss. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ NOD32 1.1370 (20060118) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me pllzzzzzz
Jay Blanchard wrote: [snip] i am having 2 combo box one for city & another one for country,when i select particular country say "india" their corresponding cities will be displayed in city combobox as "delhi,bangalore.",when i select "Australia" thier cities like "perth,brisbane"will be displayed.plz help me itz very urgent. [/snip] H, is everything you do urgent? I think he and I must have the same boss. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] help me pllzzzzzz
[snip] i am having 2 combo box one for city & another one for country,when i select particular country say "india" their corresponding cities will be displayed in city combobox as "delhi,bangalore.",when i select "Australia" thier cities like "perth,brisbane"will be displayed.plz help me itz very urgent. [/snip] H, is everything you do urgent? Anyhow, you want JavaScript for this, not PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP load to high on server
Run some tracer apps on your code...could be some wild loops of some sort? Never the less, ZEND debugger with the module should do the jobit will tell you which files/functions etc are runningnice tool to track execution time etc... On 1/18/06, Albert <[EMAIL PROTECTED]> wrote: > > Hi > > > > I am running SuSE 9.2 (Kernel 2.6.8-24-default) with Apache 2.0.50 and PHP > 4.3.8 (as an Apache module) on a Celeron 900 with 304MB RAM. This machine > is > used for testing. We have made some changes to our PHP application and now > the machine is having trouble serving the pages. Apache is occupying > almost > 90% CPU usage. > > > > My Apache log configuration is: > > %a %b %H %r %>s %t %T %X > > %a : Remote IP > > %b : Size of response > > %H : Protocol > > %r : Request > > %>s : Last status of request > > %t : Time of request > > %T : Time to serve > > %X : Connection status after serving request > > > > In the log below the last character after the timestamp indicates the > following: > > X : Connection terminated before end serving request > > + : Connection might not be terminated > > - : Connection terminated > > > > As you will notice almost all the statuses is connection might not have > been > terminated. > > > > The page having the heaviest load uses 5 simultaneous sessions - they > refresh every 5 seconds. Even with just one connection there are 16 Apache > threads running all occupying between 5 and 20% of CPU. > > > > Does anyone have an idea of what I can do (short of recoding)? > > > > TIA > > > > Albert > > > > From our Apache log: > > 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 > > [17/Jan/2006:16:16:29 +] 1 X > > 192.168.x.x 1845 HTTP/1.1 GET /msgMon.php?h=3D1024&w=3D1280 HTTP/1.1 200 > > [17/Jan/2006:16:16:28 +] 2 + > > 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 > > [17/Jan/2006:16:16:29 +] 1 + > > 192.168.x.x 2839 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:29 > > +] 2 + > > 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 > > [17/Jan/2006:16:16:31 +] 1 + > > 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 > > [17/Jan/2006:16:16:31 +] 1 + > > 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 > > [17/Jan/2006:16:16:33 +] 0 + > > 192.168.x.x 429 HTTP/1.1 GET /display_background.php HTTP/1.1 200 > > [17/Jan/2006:16:16:32 +] 2 + > > 192.168.x.x 178 HTTP/1.1 GET /selObject.php HTTP/1.1 200 > > [17/Jan/2006:16:16:33 +] 3 + > > 192.168.x.x 3325 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 > > [17/Jan/2006:16:16:33 +] 3 + > > 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 > > [17/Jan/2006:16:16:33 +] 3 X > > 192.168.x.x 1249 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:33 > > +] 4 + > > 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 > > [17/Jan/2006:16:16:34 +] 3 + > > 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 > > [17/Jan/2006:16:16:37 +] 1 + > > 192.168.x.x 431 HTTP/1.1 GET /display_background.php HTTP/1.1 200 > > [17/Jan/2006:16:16:35 +] 3 + > > 192.168.x.x 2823 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:35 > > +] 4 + > > 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 > > [17/Jan/2006:16:16:39 +] 0 + > > 192.168.x.x 1845 HTTP/1.1 GET /msgMon.php?h=3D768&w=3D1024 HTTP/1.1 200 > > [17/Jan/2006:16:16:37 +] 3 + > > 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 > > [17/Jan/2006:16:16:38 +] 3 X > > 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 > > [17/Jan/2006:16:16:39 +] 2 X > > 192.168.x.x 3711 HTTP/1.1 GET /display_menu.php HTTP/1.1 200 > > [17/Jan/2006:16:16:39 +] 2 + > > 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 > > [17/Jan/2006:16:16:39 +] 3 + > > 192.168.x.x 2828 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:39 > > +] 3 + > > 192.168.x.x 429 HTTP/1.1 GET /display_background.php HTTP/1.1 200 > > [17/Jan/2006:16:16:42 +] 2 + > > 192.168.x.x 178 HTTP/1.1 GET /selObject.php HTTP/1.1 200 > > [17/Jan/2006:16:16:43 +] 2 + > > 192.168.x.x 3325 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 > > [17/Jan/2006:16:16:43 +] 3 + > > 192.168.x.x 1260 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:43 > > +] 3 + > > 192.168.x.x 1845 HTTP/1.1 GET /msgMon.php?h=3D1024&w=3D1280 HTTP/1.1 200 > > [17/Jan/2006:16:16:43 +] 3 + > > 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 > > [17/Jan/2006:16:16:46 +] 0 + > > 192.168.x.x 3279 HTTP/1.1 GET /display_target_information.php HTTP/1.1 200 > > [17/Jan/2006:16:16:44 +] 1 + > > 192.168.x.x 216 HTTP/1.1 GET /selObject.php HTTP/1.1 200 > > [17/Jan/2006:16:16:46 +] 1 + > > 192.168.x.x 2807 HTTP/1.1 GET /gd.php HTTP/1.1 200 [17/Jan/2006:16:16:46 > > +] 1 + > > 192.168.x.x 13353 HTTP/1.1 GET /validation.php HTTP/1.1 200 > > [17/Jan/2006:16:16:48 +] 0 + > > 192.168.x.
[PHP] help me pllzzzzzz
hi, i am having 2 combo box one for city & another one for country,when i select particular country say "india" their corresponding cities will be displayed in city combobox as "delhi,bangalore.",when i select "Australia" thier cities like "perth,brisbane"will be displayed.plz help me itz very urgent. A.suresh Send instant messages to your online friends http://in.messenger.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me plz
If this is on the same web page, your question has nothing to do with PHP - look into, i.e., JavaScript. suresh kumar wrote: hi, i am using 2 combo box one for country & another one for city.when i select country name from combo box their corresponding city names has to be changed in their corresponding combo box.i dont know how 2 implement this.pz give me some idea.its urgent. A.suresh Send instant messages to your online friends http://in.messenger.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help me plz
hi, i am using 2 combo box one for country & another one for city.when i select country name from combo box their corresponding city names has to be changed in their corresponding combo box.i dont know how 2 implement this.pz give me some idea.its urgent. A.suresh Send instant messages to your online friends http://in.messenger.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: header data being inserted into message
Hi Richard, Thanks for the response, however I do not want to have to use any special classes or other software... I want to get it working just using the basic php functions, which should be possible as far as I understand the php documentation... if I keep finding that I can't get it working then maybe I'll go to majordomo2. Anyone else have some advice for me here? Thanks, Ben -Original Message- From: Richard Correia [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 17, 2006 12:37 PM To: ET Support Cc: php-general@lists.php.net Subject: Re: [PHP] RE: header data being inserted into message Hey, You can use the readymase mailer class from http://www.weberdev.com/get_example-462.html and http://www.weberdev.com/get_example-3724.html Thanks Richard On 1/17/06, ET Support <[EMAIL PROTECTED]> wrote: Hello all, I am having a problem using PHP's mail function to send mail via BCC to multiple recipients. Here's my code; -- $get_emails = pg_exec($dbh,"SELECT email FROM mailing_list WHERE conf = 1"); $count = pg_numrows($get_emails); $bcc_count = $envelope_count = 0; $bcc_limit = 200; $subject = $body = 'test message'; $from = '[EMAIL PROTECTED]'; $header = "From: $from\r\n"; for($x = 0; $x < $count; $x++) { $email = pg_result($get_emails,$x,0); if($bcc_count >= $bcc_limit) { if($x > 0) { $envelope_count++; mail($from,$subject,$body,$headers); } $headers = $header . "Bcc: $email\r\n"; $bcc_count = 1; } else { $headers .= "Bcc: $email\r\n"; $bcc_count++; } } # send the last envelope mail($from,$subject,$body,$headers); -- The problem is that for some recipients they get a message body like this; -- Message-Id: < [EMAIL PROTECTED]> Date: Mon, 16 Jan 2006 17:06:40 + (GMT) test message -- Any idea why those headers are being inserted into the message body and how that can be prevented? Thanks, Ben King [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image handling advice needed
William Stokes wrote: Hello, I need to build an image 'library'. The library will consist mostly of images taken with digital cameras. Since unedited digicam pics will most likely be too big for web usage they need to be edited automatically so that they can be put to a web page. I'am trying to deside between two options. To resize (=scale down) the images once they are uploaded to server and store the smaller file or upload and store the original BIG file and scale it to thumbnail once it's viewed. Any opinnions about this. I think that if the disk space is not an issue I could upload the original file. But are there performance issues if the thumbnails are created "on the fly" if there are hundreds of pics? Will - do a bit of both. upload and store the original in fullsize (and _without_ any compression or whatever). then have a script (or set of them, depending or your needs) that doesn't just blindly resample a requested image according some given criteria (set in either the script or the from the request) but first check it's 'own' cache for previously resampled files ... if it finds a valid file in 'its cache' then just spit it out; otherwise generate the requested image file (manipulating/resampling however you like) and save it to the cache (most likely to disk) and also output the image data. this effectively gives you one time resampling with some added bonuses: 1. when the underlying extension (e.g. GDlib) is upgraded you can clear your image cache and have all your images regenerated automatically using the improved routines (e.g. crisper resamping) 2. when the client wants all the images on the site to be a different tint/size/ratio/format/etc you can change you image generation scripts, clear the image cache and bingo - 'fixed' images. below is a class I use to store images I cache in the manner I described above. using it is quite simple [if you don't want it to use values of named REQUEST args as the basis of the unique cache identifier (i.e. the filename) then you'll have to do some hacking]: // create the object $ic = ImageCache('/dev/shm/site-image-cache'); // read up on /dev/shm !!! // set out an array of REQUEST arguments. e.g. imagine the following url // "./showimg.php?id=12345&size=big" - how you use the actual REQUEST argument values // to generate an non-existant image is up to you. $cacheArgs = array('size', 'id') // use the image cacher to determine the generated name of the cached image file. $ic->genCacheFileName( $cacheArgs, 'jpeg', 'some-prefix' ); // determine a set of files with which to check the file modification // time against (at least 1 is required) $files = array('/path/to/your/original/image/file.jpg'); // check the cache if (!$ic->checkCache($files)) { // do some stuff to create an image // use the value from $ic->getCacheFilePath() // as the path+filename under which to store the // new image } // show cache image. $ic->showImage(); cacheDir = $cDir; $this->dirSep = defined('DIR_SEP') ? DIR_SEP: '/'; // just to be safe we define this if it does not exist. if (!defined('WEBROOT')) { define('WEBROOT', realpath($_SERVER['DOCUMENT_ROOT'])); } } function genCacheFileName( $args = array(), $type = '', $prefix = '' ) { /* name/val pair delimiter in the string that results in the hash for the cache id */ $qHashMark = '%~^*'; $args = (array)$args; natsort($args); $qry = array(); foreach ($args as $arg) { if (($val = $this->getR( $arg, false )) !== false) { $qry[] = "{$arg}=".str_replace($qHashMark,'',$val); } } //var_dump(WEBROOT . $_SERVER['PHP_SELF'] .'-:-'. join($qHashMark, $qry)); $hash = md5(WEBROOT . $_SERVER['PHP_SELF'] .'-:-'. join($qHashMark, $qry)); if (!in_array($type, $this->validTypes)) { if ($type == 'jpg') { $type = 'jpeg'; } else { $type = 'png'; } } $this->cacheFileType = $type; if (!$prefix) { $prefix = 'cacheimg'; } return ($this->cacheFileName = "{$prefix}_{$hash}.{$type}"); } function getCacheFilePath() { return $this->cacheDir . $this->dirSep . $this->cacheFileName; } /* Return true if the cache file is younger than the source file(s), * false otherwise. * * the (array of) files passed to this function should be complete paths, * not just filesnames. */ function checkCache( $files = array() ) { $cacheState = true; $cf = $this->getCacheFilePath(); $mTime= is_readable($cf) ? filemtime($cf): 0; $lastModified = gmdate("D, d M Y H:i:s ", $mTime)."GMT"; $files= (array) $files; if (!count($files) || !$mTime) { $cacheState
[PHP] mcrypt
Is it possible to set the key length for mcrypt with the cipher Blowfish? Specifically to lets say 128 bits? mcrypt_get_key_size returns int but is it bytes bits? Maybe I could do with openssl? Ideas and thoughts very welcome. Thanks, Scott
Re: [PHP] Image handling advice needed
At 04:10 AM 1/18/2006, William Stokes wrote: Hello, I need to build an image 'library'. The library will consist mostly of images taken with digital cameras. Since unedited digicam pics will most likely be too big for web usage they need to be edited automatically so that they can be put to a web page. I'am trying to deside between two options. To resize (=scale down) the images once they are uploaded to server and store the smaller file or upload and store the original BIG file and scale it to thumbnail once it's viewed. Any opinnions about this. I think that if the disk space is not an issue I could upload the original file. But are there performance issues if the thumbnails are created "on the fly" if there are hundreds of pics? Thanks for your advice -Will Will, Before you go too far, have you looked at Gallery or Gallery2? Miles -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.371 / Virus Database: 267.14.18/230 - Release Date: 1/14/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Validating Radio Buttons in two directions
Tuesday, January 17, 2006, 11:33:18 PM, HiFi Tubes wrote: > Thanks to all of you who responded. Yes, I am doing the grid --basically > 100 radio buttons, that is ten comments that must be ranked from 1 to 10. Ugh. If you absolutely can't use Javascript, here's an idea: Present this question by itself as two lists: on top an unordered list of options, on bottom an ordered list (initially empty). Each item will have a set of links (icons maybe) to place this item next (if in the top list) or move up/down or remove the item (if in the ordered list). The user would click the links to move around the choices until he/she is ready to submit that question: add items: _eggs_ , _milk_ 1 candy _remove_ 2 3 -- 1 candy _remove_ _down_ 2 eggs _remove_ _up_ _down_ 3 milk _remove_ _up_ The nice thing is, each page you generate would be a valid response so you, nor the user, has to worry about, eg. submitting two items in 3rd place. It would also be /much/ simpler for the user to rearrange items since he/she no longer has the burden of renumbering each choice. You could potentially add Javascript onto this setup so that the movement would be updated purely on the page or with only a minimal XMLHTTPRequest call. Another idea: just require Javascript and save yourself reinventing the wheel. http://www.phpsurveyor.org/index.php is a mature survey system with ranking question types and nice data export options. Steve -- http://mrclay.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image handling advice needed
On 1/18/06, William Stokes <[EMAIL PROTECTED]> wrote: > I'am trying to deside between two options. To resize (=scale down) the > images once they are uploaded to server and store the smaller file or upload > and store the original BIG file and scale it to thumbnail once it's viewed. > Any opinnions about this. Why not scaled them once and for all (first option)? are you going to need them in BIG size on the server or anything else? -ahmed
Re: [PHP] FW: error de php!
On 1/18/06, Miguel Guirao <[EMAIL PROTECTED]> wrote: > $this->$NumDias = $unixtime2 - $unixtime1; <--- This is the line 44 hmm wasn't it supposed to be $this->NumDias? (with no $ before the propery name) -ahmed
Re: [PHP] Re: Using GPG in Safe Mode
[EMAIL PROTECTED] wrote: Hi Edwin! Thanks for the tips but my ISP hasn't given me root. I'm very sad to hear gpg from cli won't work under safe mode. Are there any 100% php implementations of GPG I could use? (because I guess that is the only way that is left?) /Emil If you are using gnupg comand line, there is not way on PHP-safe mode. The only way that i know to wrap around this problem it's install pecl extension package there is a way. if gpg binary is in safe_mode_exec_dir -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image handling advice needed
Hello, I need to build an image 'library'. The library will consist mostly of images taken with digital cameras. Since unedited digicam pics will most likely be too big for web usage they need to be edited automatically so that they can be put to a web page. I'am trying to deside between two options. To resize (=scale down) the images once they are uploaded to server and store the smaller file or upload and store the original BIG file and scale it to thumbnail once it's viewed. Any opinnions about this. I think that if the disk space is not an issue I could upload the original file. But are there performance issues if the thumbnails are created "on the fly" if there are hundreds of pics? Thanks for your advice -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php