[PHP] parallel connections with php
i programmed a metasearchengine with php - it works but it is to slow. does someone know how to do parallel connections to searchengines ? Let s say i have 4 php scripts - each script gets data from a searchengine. I have included those 4 script in my resutl html page (via include..) - but i have the feeling that php includes the first script (which connect to searchengine 1) and after it got all data it includes the second script - gets the data and include then scritp 3..::: Does someone know hot to connect those 4 scripts parallel to the searchengines and not seriell? greetings Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] new line in forms?
You have probably had this question a few times, but can anyone tell me how to detect "new line's" or breaks in form fealds from both PC and Mac. And then replacing the "new line" with a so that I can use it for the web? Thanks in advance Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] converting str with \n to one line str??
When I use Javascript with PHP i run into one problem. When I get the data i need from the database it often has a lot of and \n (new lines) in it. The are no problem when converting a string to a Javascript string, but the \n are. The string has to be all in one line. example: var temp = <? echo $temp?> This is not working!! But this would : var temp = '<? echo $temp?>'; Can you help me please? thanks Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] error while reading google-search-results
For reading in and displaying a file $uri I use this short script: http://www.google.de?q=test'; echo implode('',file($uri)); ?> Of course this works well for almost every website, but I have problems reading in the results of google (for instance the URI above). The error message I get is: [07-Mar-2003 16:14:13] PHP Warning: file("http://www.google.de?q=test";) - Success in /var/www/test/getfile.php on line 20 [07-Mar-2003 16:14:13] PHP Warning: Bad arguments to implode() in /var/www/test/getfile.php on line 20 Does anyone know why this happens? I use PHP 4.23 and Apache 1.3.26 on Debian GNU/Linux 3.0. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [Fwd: Re: [PHP] error while reading google-search-results]
James Holden wrote: Welcome to a mine field of problems :-) 1. The url you have entered is invalid. Thats a good first check to make usually. Try /search?q=test to get that bit sorted. Ok, this was just a typo. :) 2. Google prevents known useragents from accessing it's content as it believes you are acting as a spider or a search engine stealing thier content. To counter this you need to use a new url capturing method and specifically set the name of the useragent. Use 'MSIE'. You can use curl, lwp etc to do this kind of thing. Curl is excellent, fast, highly configurable and execellent with secure connections. I heard about curl, but not about lwp. I can't find documentation for lwp on php.net. I must check out if I can use one of these. 3. I suggest you don't do this - they prevent it for a reason. It's part of a larger project and not especially related to google. The script should be able to read in any website and do some processing. One of its functions should (later) be to determine search engine positions. Is there a simple way to do this without reading in the search results of google (or other search engines)? Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] google-apis (was: error while reading google-search-results)
James wrote: LWP is a perl thing. Curl is probably the best thing to use. Have you tried using googles php api which they provide free? http://www.google.com/apis/ I had a look at the API, but I'm not sure if it's appropriate and easy to use with PHP. It's still beta and might change again (or maybe I've to pay for every query soon). Has anyone already used the api? Is it simple to (for instance) find out all listed pages of www.foo.com which are in the Top 1000? Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cleaning up HTML table structure
The following problem seems to be hard to solve: A PHP-Script reads in an HTML-File and removes linebreaks, tabs and not needed spaces. After that the script should reconstruct the table-structure this way (example): ... ... The next thing is that lines longer than for instance 80 chars ($maxlength) should be split up into several lines. Is there any good way to solve this? Regular expressions seem to be of limited use because the recursion of tables can be infinitely deep and the lines between must not not be longer than $maxlength and should have the appropriate number of spaces before it. Stepping through the string (the whole file is a string) with simple String-functions is very complicated either. I hope you can give me some hints how to find a (simple) solution for this problem. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cleaning up HTML table structure
Beau Hartshorne wrote: Jens, I would suggest that you try writing a script that keeps track of how many tags have been opened (look for "<"), versus how many tags have been closed ("[^>]*/>") on a line-by-line basis. Using that number, you should be able to indent the code properly. I need to count how often the important tags (table, tr, td) have been opened, but that's only a part of the solution. It doesn't make sense to count every < and > because most of the tags don't play a role (in the script I should write). Let us know what you've got so far. I solved the problem by first getting all position of the table, tr and td-tags. After that I go serially from the first to the last occurence of a tag and keep track how often it was opened and closed. Additionally I have a variable which counts the numbers of bytes I added to the text. After that I reduce the linelength to less than $maxlength chars. Jens PS: If you want a tool which really cleans up HTML you should use HTMLTidy of course. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [RegExp] extracting anchors
Hello, I want to extract the "name"-attribute of all anchors out of an HTML-source-code which don't have the "href"-attribute. I can use this code to get the "name"-attribute: preg_match_all('/]*?)name=[ \'\"](.*?)[ \'\"](.*?)>/is',$src,$ar); The name-attributes are now in $ar[2]. How can I exclude all links which have the href-attribute? I didn't find an easy way how to say that a string must _not_ be part of a pattern match. I hope you can give me some advise. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [RegExp] extracting anchors
Jome wrote: Jens Lehmann wrote: Hello, I want to extract the "name"-attribute of all anchors out of an HTML-source-code which don't have the "href"-attribute. I can use this code to get the "name"-attribute: preg_match_all('/]*?)name=[ \'\"](.*?)[ \'\"](.*?)>/is',$src,$ar); The name-attributes are now in $ar[2]. How can I exclude all links which have the href-attribute? I didn't find an easy way how to say that a string must _not_ be part of a pattern match. I hope you can give me some advise. This is one lousy solution but hey - it's a solution after all; you can simply remove all tags containing href before doing the preg_match_all()-call, something like this below should do it I think. $src = preg_replace('/]*?href=[^>]*?>/is', '', $src); This is of course a working solution, but I'm still interested if it can be done directly with just one regular expression. Thanks anyways. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] openssl_pkey_get_private() problem
Hi list, I have a problem with openssl_pkey_get_private which shows up like: -BEGIN Test-Script- $fp = fopen( "../signkeys/fp3-cert.pem", "r" ); $pubkey = fread( $fp, 65000 ); fclose( $fp ); $fp = fopen( "../signkeys/fp3-privkey.pem", "r" ); $privkey = fread( $fp, 65000 ); fclose( $fp ); echo "public key (read)\n"; $pubres = openssl_get_publickey( $pubkey ); while( $msg = openssl_error_string() ) { echo "openssl_error: '$msg'\n"; } var_dump( $pubres ); echo "private key (read)\n"; $privres = openssl_get_privatekey( $privkey, "flexpage" ); while( $msg = openssl_error_string() ) { echo "openssl_error: '$msg'\n"; } var_dump( $privres ); echo "public key (load)\n"; $pubres = openssl_get_publickey( "file://../signkeys/fp3-cert.pem" ); while( $msg = openssl_error_string() ) { echo "openssl_error: '$msg'\n"; } var_dump( $pubres ); echo "private key (load)\n"; $privres = openssl_get_privatekey( "file://../signkeys/fp3-privkey.pem", "flexpage" ); while( $msg = openssl_error_string() ) { echo "openssl_error: '$msg'\n"; } var_dump( $privres ); $data = "Hello World\n"; $rc_sign = openssl_sign( $data, $signature, $privres ); $rc_verify = openssl_verify( $data, $signature, $pubres ); var_dump( $rc_sign ); var_dump( $rc_verify ); $privkey = ""; openssl_pkey_export( $privres, $privkey, "flexpage" ); echo "exported private key\n"; var_dump( $privkey ); $privres = openssl_get_privatekey( $privkey, "flexpage" ); while( $msg = openssl_error_string() ) { echo "openssl_error: '$msg'\n"; } var_dump( $privres ); ?> -END Test-Script- -BEGIN Script-Output- public key (read) resource(6) of type (OpenSSL key) private key (read) openssl_error: 'error:0D09A0A3:asn1 encoding routines:d2i_PrivateKey:unknown public key type' openssl_error: 'error:0906700D:PEM routines:PEM_ASN1_read_bio:ASN1 lib' bool(false) public key (load) resource(7) of type (OpenSSL key) private key (load) resource(8) of type (OpenSSL key) bool(true) int(1) exported private key string(1751) "-BEGIN RSA PRIVATE KEY- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,04AB90E107EDE2D0 Wp5eYHn1LNTOayEC0vV33y2DbVRc89EeMonSX6IjHpaf3X9AhllU6wsnLbfqCsTk cJyrplaepX+x90OwDYSFqvT0LTT1mK/T9w4gInn4SHmgJbUjfeUSC7ZdTUFggjWf +JlxkdGcjiJZ99rYctRS3d0RgHBkrGyd7gLIsyuFp4Nt8RPGDcwmd5ksFl9Pp8kH BYbXtcqxkNg0lDn+DyrOM14bXdOvIRojYxsBHfXPn1aJDZUR5qna7CCZJTDz3b+G WYFwMrGu4XlmaDYY0ttPFXKW3h9cQkak2Dn8cJJCaZHRY6xzN0zhYEIT3ge4MLIL 3zoKxi9pw1pcW+JjvS6iWMzyWNIPnK6A5e2uiWOJFlVqPSx41tpvA81/mJRS+DL1 XLIKrWXyvTOKPJWLzSbBh+Ke1VpOD53MkBNb1Or9x2IH1OqYAbK0wqC/eP1pkx5D thgIYEAFC6VMHIT1JEyOpEFIvhqlDak26iM0iAEmX6lQx55mo3yHJT1p2eLvDPwX VEyFkVGyhMkfHGeVQyOFMEc5EtwO3an2Jiwelb8JsGbWPyupfK3k82jdNJXUIXrF Ez4KCb5p8HrbtTg1lAaZrrSmWAuhCdR/OekngKc3jkgPfSySNSs2pjF30sh1gvlc z+1JEAajtmK7qYz6b26RaZf7RZkahUUu2jUeCM3w9UHh5QVACkL6O3BrSCAXVxN3 pxI9vdzKvXTGz20iZvrMkwWbfFbPAK6HtcGhHyIiFgSTcl6j4p/rEaPYL23ZwyZx Vh6p9ihvAjRgf2XZes68SRF45zfWyylRzdfWNdLLXAsPTXurrhNlhK0uL0WgP7UX 986bIyx4hKDciS2euJzO9MGgBFbxlbIqZefTtvq00Th5RpUifFHUB5LR2uIknr6N u9DjLEYmguNechkxZddN1TY0NSvD9UnFl9ZIjKEhOisrkSpRfIirH76ubFoxUWtz Y5jbkdhIBj9If0TnnGp5EXQEyT4yr2o/kPiQnsktkK2dStOpWTp8hrKHN3w7hCnt cG31WnUcpdxVusFm3hKmQBEn/X+4D2NnF4M0zRCyKMutB9NmNUIjrSZYnNwt6tNN toVrz4HYNhEINIodGs/DBRlr9oHAUN/1Yf8Atlf8adA6y04UUhTVdexzeW260d4+ suqU1MTIJi986OYoaSYpH3B0zZSifI33fmpw8MeC679qAd2ryHAtHYKB5rCPiPrs L+XlGlK+dgwGaCsJltLiy9aEBBF4NXM/UYU13q3HSOxnobzcSdhqvUbOopKgDAfI iySSGtWUZINq6wxXhzcwI1ePiXeuSn8HCEEieketZXHOtITQ6cNYpR+vvEj+J4VC rkL8eBBzDLbFuzs7JPoKpe3vCgKBP8//KM7pc5AZ6F4OWI32TJ/N/Fo8znVP1g8A wzvuK2PUBv7pLKKxpvbl7dcDfRNOBcgQmqbXys8tDJ3g1kJeN34Q1pBsRKq9eXcQ SXIeSrywFnmn0JE40sdSzvTiEek/y4k/CFGQUy5DD+h7ryp8BORk3Cl1n/wM5td3 5lKHyvnECyAs+9yCQGOxgN0OQWp9/8c1IaI9rKpq+6jslAdP9v3upsBB3JImhGfc -END RSA PRIVATE KEY- " openssl_error: 'error:0E06D06C:configuration file routines:NCONF_get_string:no value' openssl_error: 'error:0E06D06C:configuration file routines:NCONF_get_string:no value' openssl_error: 'error:0E06D06C:configuration file routines:NCONF_get_string:no value' openssl_error: 'error:0E06D06C:configuration file routines:NCONF_get_string:no value' openssl_error: 'error:0E06D06C:configuration file routines:NCONF_get_string:no value' openssl_error: 'error:0E06D06C:configuration file routines:NCONF_get_string:no value' openssl_error: 'error:0E06D06C:configuration file routines:NCONF_get_string:no value' openssl_error: 'error:0D09A0A3:asn1 encoding routines:d2i_PrivateKey:unknown public key type' openssl_error: 'error:0906700D:PEM routines:PEM_ASN1_read_bio:ASN1 lib' bool(false) -END Script-Output- Is it a bug in PHP with new OpenSSL 0.9.7a or is it a my failure? Any help is nice, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Finding out which file is retrieved over HTTP
The following short script retrieves a file over HTTP: $url = 'http://www.example.com/'; implode('',file($url)); // or file_get_contents() Now I'd like to find out which file was really retrieved, for instance http://www.example.com/index.html. Is this possible and how? Background: I need to write a small link-checker (Intranet), which reads in all links within a file and then looks if they're broken and collects some information. Unfortunately I didn't find a simple, free link-checker that's why I write my own. It would be good to find out the "complete" url, because I want to collect the file-endings (.php,.html, ...). Another thing is that my script is recursive, so I need a function absolute_link() which takes a (possibly relative) path and an url to find out which page to go next. Example: $url = http://www.example.com/foo/bar/ Somewhere in the source code: ... ... My script reads in $path='../articles/page.html'. The function absolute_link($url, $path) should return 'http://www.example.com/foo/articles/page.html'. However $url could be http://www.example.com/foo/bar (bar can be file or dir here imho) or http://www.example.com/foo/bar/index.php and in any case absolute_link() should return the same. Of course this function is easier to implement if I always have something like http://www.example.com/foo/bar/index.php. Maybe there's already a useful function besides parse-url() I can use here. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Finding out which file is retrieved over HTTP
David Otton wrote: On Sun, 23 Mar 2003 21:21:39 +0100, you wrote: The following short script retrieves a file over HTTP: $url = 'http://www.example.com/'; implode('',file($url)); // or file_get_contents() Now I'd like to find out which file was really retrieved, for instance http://www.example.com/index.html. Is this possible and how? [...] I need to write a small link-checker (Intranet), which reads in all links within a file and then looks if they're broken and collects some information. Unfortunately I didn't find a simple, free link-checker that's why I write my own. It would be good to find out the "complete" url, because I want to collect the file-endings (.php,.html, ...). I really think this already exists. You should probably search a bit harder. Maybe there are good standalone-link-checkers, but I need to integrate it in an application and my customer has some special wishes. Anyways I finished writing the link-checker. A thing which seemed a bit confusing to me is that if I open a non-existing website (fopen('http://www.amazon.de/nonsensestuff')) I always get an error message "Success". It's the same thing if I use file(). The manual explains that fopen() returns false if the website could not be opened, that's why I don't know why this error message appears? Besides this "Success"-message is surely a very bad error message. I use PHP 4.2.3. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Finding out which file is retrieved over HTTP
Ernest E Vogelsinger wrote: At 20:48 25.03.2003, Jens Lehmann spoke out and said: [snip] To actually check on the HTTP status codes you need to run your own, either using cURL, or by doing your own stuff using fsockopen(). I tried using fsockopen(), but still experience a problem, I want to use the following script to retrieve both, the headers and the actual file: You need to transmit the "Host:" header so the web server has a chance to know which virtual host you want to reach. Ideally you would also tell the server what type of content you can handle (see below). Also note that the "correct" line ending for MIME headers is always CRLF ("\r\n"): $hostname = 'www.example.com'; $file = '/index.php'; $ip = gethostbyname($hostname); $fp = fsockopen($ip, 80, &$errno, &$errstr); if ($fp) { fputs( $fp, "GET ".$file." HTTP/1.0\r\n" . "Host: $hostname\r\n" . "Accept: text/html\r\n" . "Accept: text/plain\r\n\r\n" ); $src = ''; while (!feof ($fp)) $src .= fgets($fp, 4096); fclose ($fp); } This will get you the whole page, including all headers. Thank you! This works fine. I can use this for reading the HTTP-Status. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] open_basedir
Hello! My ISP is using the "open_basedir" restriction which (I think) is stopping me from using the function "fopen" to read a document on a different server. I have been in contact with the ISP and they want to allow me to use the fopen function for my purposes, but they have this restriction so it wouldn't be possible to use other owners scripts within the ISP:s server. Is there anything they could do to keep a higher security level (open_basedir restriction) but still allow me to read documents on other servers. Do you have any suggestions or solutions, please write me a mail. Thank you!! « - » « Jens Winberg ([EMAIL PROTECTED])» « Vanha Hämeentie 86» « 20540 Turku » « FINLAND » « GSM: 044-5997730 » « - » -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined index, Undefined variable, Undefined constant....
I'm having trouble with the newest version of PHP (4.2.2). For example in a page I'm using the following code: if ($_GET['action'] == "logout") { //do something } But I'm getting an error message that says: ...log_message reports: PHP Notice: Undefined index: action in Ealier (other versions of PHP) I have succesfully used the above code, but do I now have to rewrite the code like this: if (isset($_GET['action']) AND $_GET['action'] == "logout") { //do something } Or am I totally wrong? This was just one example when I'm getting the message "Undefined index" or " Undefined variable" etc. A lot of code which has previously worked is now giving me loads of headache since I have to rewrite everything. Please, I need some help. my email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RegExp for Forum-List-Code
Hi out there, I encountered a lot of problems while trying to convert a list in Forum-Code (like UBB-Code). [list] [*] item 1 [*] item 2 [*] item 3 [/list] should be converted to item 1 item 2 item 3 I converted the first one to [*] item 1 [*] item 2 [*] item 3 Now I need a Regexp for converting every [*] foo to foo. I started with $text = preq_replace('/\[\*\]([^(\[\*\])]*)/i','$1',$text); The RegExp starts from [*] and saves every char in $1 until [*] occurs again. That's fine, but what I need is a RegExp which starts from [*] and saves every char in $1 until [*] OR occurs in $text. I tested a lot, but didn't find a solution. I'd be glad about any help. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] W3C and PHP
>> ... If this is really what the W3C validator tells you you should file a bug > report, IMHO. Passing GET variables should be valid HTML ;-) Usually entities start with "&" and end with ";". The "entity" §ion doesn't end with ";" and is not defined, that's why it's not valid. Jens PS: Be aware of not writing something like header("Location: script.php?foo1=a&foo2=b"); or use $amp; in mails, which are send thorugh the PHP- mail-function. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RegExp for Forum-List-Code
That's what I thought, too. But it doesn't work. test.php: $text = ' [*] jusfj [*] ijusnf [*] jsf [*] jusdf '; $text = preg_replace('/\[\*\]([^(\[\*\])(<\/ul>)]*)/i','$1',$text); $text = htmlentities($text); Output: jusfj ijusnf jsf jusdf I tested some different things, which didn't work. Any more ideas are appreciated. Jens > untested: > > preq_replace('/\[\*\]([^(\[\*\])(<\/ul>)]*)/i','$1',$text); > > > > Jens Lehmann wrote: > > >Hi out there, > > > >I encountered a lot of problems while trying to convert a list > >in Forum-Code (like UBB-Code). > > > >[list] > >[*] item 1 > >[*] item 2 > >[*] item 3 > >[/list] > > > >should be converted to > > > > > >item 1 > >item 2 > >item 3 > > > > > >I converted the first one to > > > > > >[*] item 1 > >[*] item 2 > >[*] item 3 > > > > > >Now I need a Regexp for converting every [*] foo to foo. > > > >I started with > > > >$text = preq_replace('/\[\*\]([^(\[\*\])]*)/i','$1',$text); > > > >The RegExp starts from [*] and saves every char in $1 until [*] > >occurs again. That's fine, but what I need is a RegExp which starts > >from [*] and saves every char in $1 until [*] OR occurs in > >$text. I tested a lot, but didn't find a solution. I'd be glad about > >any help. > > > >Jens > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to find out the Bitsize of the Clients SSL Key ?
Hi again, how can i find out the keysize of the clients Browser (SSL). We have an area only for Users who are capable of 128bit SSL. IE 5.5 with only 56-Bits SSL says that the Server is Down !! So i have to check the keysize before the user tries to log in, but i fond no way... Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] variable declaration in class
Can anyone explain me why the following code causes the parse error "... unexpected * ... " ? class test { var $a = 2*10; } Of course I know why there's a parse error, but I don't know the reason why PHP doesn't allow this multiplication, although it allows a statement like e.g. var $a = 20. I'd be thankful if anyone could enlighten me. I'm using PHP 4.2. on Win2k. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Change the session timeout within a php-script
Hi, is it possible to change the session timeout from within a script. I can't change it in the *.ini-file because I have not the sufficient access rights. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Change the session timeout within a php-script
I think you understood me wrong. I don't want to change (or limit) the execution time of a script. I want to change the lifetime of a http session. Toby Butzon wrote: > set_time_limit($seconds) > Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Calling DB2 Stored Procedures
Are there any problems calling DB2's stored procedures from PHP once the connection to is set up? -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] includes slooooooow
Hi, i just finished my first really big project and when it went live the servers just flipped out, 100% CPU Load. Removing all includes and pasting all libraries together seemed to do the trick, CPU went back to normal. My Question: What can i do to speed up includes, i hate working on a file with 45 KB Sourcecode in it. Not to speak of pasting the libs to every single Script that makes use of them. I tested on a system with the Zend Optimizer installed, the Servers running the live application do not have the encoder, but i noticed the lags caused by the includes on the test system too. tks in advance! -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Classes and Kernel CPU Load?
I have Scripts that seem to cause imense Kernel (not user) CPU Load under Solaris, could this be caused by using classes? I already removed use of md5() and crypt() from the scripts no change so far. What else could cause an immense increase in Kernel CPU Load? tks Jens -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] isset and multiple selects
on 10.03.2001 10:10 Uhr, Alexander Lohse at [EMAIL PROTECTED] wrote: > Hi, > > is it a fact that: If I have multiple select with e.g. "pers[]" as > name, I cannot check for an isset($pers) if the user left the field > blank? > > I know it all works with textfields ... But in this case isset() > seems not work. There is also no entry in HTTP_POST_VARS for that. > > Or might this be a browserspecific problem? (MSIE 5 on Mac) > > Regards, Hi Alex, In a multiple select those values are stored in array. That array is you pers[]. In $HTTP_POST_VARS this will appear as this array, i.e. pers() To list the values in the multiple select do this: while(list($key,$value) = each(pers)) { echo("$key -> $value"); } or instead of echo you can assign those values newly or store them in a database for example. all the values look something like this in the array pers[0] = 1. multiple select pers[1] = 2. multiple select pers[2] = 3. multiple select pers[3] = 4. multiple select regards, Jens > > Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Passing string variable gets cut off
on 11.03.2001 16:16 Uhr, Fates at [EMAIL PROTECTED] wrote: > My strings are getting cut off when I pass to destination web page > > Example: > > Assign variable from database > $subcategory = mysql_result($result,$i,"subcategory"); > > Variable $subcategory is assigned "Graphic Editors" from database > (notice two words) > > Next I make a link and pass the variables to new page when person clicks > link > href='addupdate.php?category=$category&subcategory=$subcategory > > New page appears > The value of $subcategory is: Graphic It cut off everything after > Graphic, How do I fix that? > > > Yes, because there is a space in the word you want to submit over the URL. What you would need to do is: $subcategory = urlencode($subcategory);
Re: [PHP] Best way to pass SQL TEXT field via a link
Actually the best would be if you would remain in the page so you dont have to pass any variables along the url but just in a submit form to the current page. There you could include your addupdate.php with a trigger like and just ask that value of that field in an if-clause. if true just include the addupdate and execute it along. Hope that helps, Jens Nedal on 11.03.2001 18:12 Uhr, Fates at [EMAIL PROTECTED] wrote: > I'm trying to update an existing record based on a link that represents > the record to update. > > I have a link and I am passing variables that were assigned from a SQL > database to another php form page which will be used to update the > record. I'm passing variable like so: href='addupdate.php?name=$name&category=$category&description=$etc. > > This works fine for variables that contain values of only a few lines > but what about passing a couple paragraphs stored in variable > $description assigned via database value as TEXT. > > Would it be better just to pass the database record ID to the > destination page and then query the record in the destination form page > and populate the form with the current values and update the record or > is there another way I don't know about? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Quotes in inputfields & Reload
Hy everybody, Well here is the deal (Probably an easy one 8)) I have several inputfields and check if the are valid or have content. If an error occurs and the page reloads i simply echo the content of the fields back into the input fields, viola, wonderful. BUT if there are " eg. Quotes in those fields they suddenly read \" instead of " as they should 8( I guess that the parser is doing something to it there since " is a sensitive char in php. BUT how can i get the content to be reloaded correctly into the fields again. Here an example of how those fields look like tried it like this too, no difference: " size=40> thx in advance, Jens Nedal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mailing List
Seems that such "blasphemy" as unsubscribing is not allowed ;) Dear heathen, once you sold your soul to PHP you have to payback lifelong, dont forget that! No escape ;) Contacting the Admin should do the thing i guess. regards, Jens Nedal on 12.03.2001 13:49 Uhr, Harshdeep S Jawanda at [EMAIL PROTECTED] wrote: > > >> On Mon, Mar 12, 2001 at 11:59:37AM +1030, David Robley wrote: >>> On Mon, 12 Mar 2001 11:54, Thomas Anderson wrote: >>>> Ok, I've tried time and time again to unsubscribe from php.net's >>>> mailing list unisubscribe instructions but it doesn't work. So how do I >>>> get off the list? > > I suppose you must already have tried sending mail to > [EMAIL PROTECTED] by now. > > Just one small point: is the email address from which you send off your > unsubscription request the one at which you receive mail from this list? > > Another point to consider: it may be that you are subscribed to the list using > a redirecting email address. If that is the case, you'll have to send your > unsubscription email from that address. Could you check that up? > > -- > Regards, > Harshdeep Singh Jawanda. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Good Free PHP Editor?
About good editors with FTP inbuilt on the Windows side. Most of the FTP features are crap! Completly. The only Editor i know that works good with its inbilt FTP feature is BBEdit, but that again is another platform. BUT if you want a good combination on Windows side you could use Ultraedit and FTP-Netdrive. That programm maps FTP-Host to your Explorer and does all teh upload etc. So you just open and write and thats it. No messing around. regards, Jens on 12.03.2001 21:48 Uhr, Angerer, Chad at [EMAIL PROTECTED] wrote: > Yes I use it with NT and run into occasional memory management problems as > well. It is a great editor but has small issues that really can annoy a > person. Also the FTP engine blows. It can be most unpredictable. > > Chad > > -Original Message- > From: Simon Garner [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 12, 2001 2:43 PM > To: Boget, Chris; [EMAIL PROTECTED] > Subject: Re: [PHP] Good Free PHP Editor? > > > From: "Boget, Chris" <[EMAIL PROTECTED]> > >>> HomeSite is great. www.allaire.com >>> - not totally free I'm afraid, but there is an eval version. >>> - runs under Windows yes >>> - supports syntax highlighting for lots of languages >>> including HTML, PHP, >>> Perl, SQL, ASP (VB/JS). >>> - can edit multiple files yes >>> - shows line numbers in gutter on left hand side >>> - supports regular-expression based search & replace across multiple >>> files/directories >>> - nice interface. >> >> Has the worst memory management of any software I've ever used. >> I have to reboot at lest 10 times a day when I use it. The support >> forum on their site is filled with complaints on this issue. Their > response >> to this issue was not to fix the memory leak (or whatever it is) but to >> issue a warning when resources are getting dangerously low to give >> you the opportunity to save all your work before you reboot. Beyond >> that, their stance is "Well, if you don't like it, return it and we'll > give >> you a refund". >> If this wasn't the only piece of software that handled projects the way >> we needed, we'd have thrown out this piece of garbage software a *long* >> time ago. >> >> Chris >> > > > > Running under Win2K I can have HomeSite 4.5.1 open for weeks, working on 10+ > files, without any problems whatsoever. > > However, I used to run it under Win98 and it would crash 1-2 times per > day... > > > Regards > > Simon Garner > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Quotes in inputfields & Reload
Ah yeah, thx everybody That does it and i am a littel pissed since i can go over alllooott of code now to insert that. BATCH here i come! Jens on 12.03.2001 17:49 Uhr, PHPBeginner.com at [EMAIL PROTECTED] wrote: > hi Jens, > > PHP automatically escape the dangerous characters from the user input on > form submissions. > > there are several ways to escape that back : > > stripslashes() > urlencode() > htmlentities() > > read about these, they will soon become your solutions. > > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > PHPBeginner.com (Where PHP Begins) > [EMAIL PROTECTED] > www.phpbeginner.com > > > > > -Original Message- > From: Jens Nedal [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 12, 2001 7:24 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Quotes in inputfields & Reload > > > Hy everybody, > > Well here is the deal (Probably an easy one 8)) > I have several inputfields and check if the are valid or have content. > If an error occurs and the page reloads i simply echo the content of the > fields back into the input fields, viola, wonderful. > > BUT if there are " eg. Quotes in those fields they suddenly read \" instead > of " as they should 8( > > I guess that the parser is doing something to it there since " is a > sensitive char in php. BUT how can i get the content to be reloaded > correctly into the fields again. > > Here an example of how those fields look like > > > > tried it like this too, no difference: > " size=40> > > > thx in advance, Jens Nedal > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Oracle Fulltext indices?
Hi, everybody! Does Oracle offer a feature similar to MySQL's Fulltext-index? -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Multi-Step Script
on 14.03.2001 5:59 Uhr, Andrew V. Romero at [EMAIL PROTECTED] wrote: > Is it possible to use different parts of one php script for multiple > html forms? I am not seeing how people create multiple pages of html > forms with each form importing information from the previous form. > Right now, for each html form page I have, I create one php script to > handle it but it would be nice to have just one php script in which only > certain parts execute depending on have variables have assignments. One > way I was thinking of doing this is to have the html forms just keep > posting the information to itself whenever the submit button is hit and > then using a series of if else statements to evaluate where the program > is in relationship to the forms, would this type of system work? > What do you guys do? > -Andrew V. Romero > To reply personally, remove all numbers from address. > Like some mentioned, reverse-programming is kinda crucial for error checking. About FORMS, yes you can have multiple forms aslong as the dont mismatch, you can even assign names to the forms for them to remain distinct. like I think it might even be possible to get that formname and then see what you do with each form. The other way round with if statements or switches works well though. Jens Nedal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] update two frames at once?
Yes you can and there is even a neater script that does it. with thise you can update any amount of frames a t the same time. Just well i got to find it. msg back in a few. Jens Nedal on 12.03.2001 22:15 Uhr, Angerer, Chad at [EMAIL PROTECTED] wrote: > Yes you can.. use Javascript > > Look here.. http://www.virtualgeoff.com/junkyard/frames/multiple/ > > Chad > > -Original Message- > From: Michael George [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 12, 2001 3:06 PM > To: [EMAIL PROTECTED] > Subject: [PHP] update two frames at once? > > > Hello al! > > Is it possible to have two frames updated when cliking on one link? I have > a > page that is broken into 4 parts: > master title > section title > d section screen > i > r > . > > what I want is that when a link is clicked on in the directory (the left > column), I'd like to update the section title *and* the section screen... > > It seemed a cool layout at the time, but I'm thinking this isn't easily > possible and I might just have to incorporate a section title on the section > screen... But before I rewrite it, I thought I'd ask here. > > Thanks! > > -Michael > > P.S. I'd like to commend the regular posters to this list on being SOOO > informative and patient! Every small question to this list always > gets several useful answers, even when I've seen questions asked over > and again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Cannot destroy session cookie
Hi there, i'm having a little trouble with cleaning up sessions. I have a login page that sets a certain session variable that is used to determine wether a user is logged on. When the user has cookies turned on the application recognizes the running session an resumes it, that also happens on the login-page, i'd like to explicitly destroy the session before logging on, i tried unsetting the session variable, destroying the session, unsetting the session cookie, but nothing worked, the session is always continued with the same SessionID. What can i do to destroy the session? tks Jens -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] AW: SSL SSL SSL SSL -- READ THIS!!!!!!
No. Just point your links to https://www.yoursecureserver.com/dir/page.htm or, if your SSL is on another port, to https://www.yoursecureserver.com:otherportnumber/dir/page.htm. cu, Jens > -Ursprüngliche Nachricht- > Von: phpman [mailto:[EMAIL PROTECTED]] > Gesendet: Dienstag, 17. April 2001 22:56 > An: [EMAIL PROTECTED] > Betreff: SSL SSL SSL SSL -- READ THIS!! > > > How do I establish an SSL socket connection with PHP? > I have PHP compiled in an Apache Mod_SSL server. Do I need to compile PHP > with > some sort of open_ssl option? I have --enable-sockets in the command line. > Please help!!! > > -dave > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cannot destroy session cookie
> Why destroying it "before" a user logs in? Isn't it In case the user did not log out properly, his session would still be marked as valid & logged in > better to start the session "after" a successful login? starting works fine, restarting is the problem > And then destroying the session when the user logs out. You can't count on an explicit logout, never rely on the users, they just don't act like you want them to ;) cu Jens -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] getting sessions lifetime
Hi there! Is there a way to determine the session timeout of the currents servers PHP configuration, e.g. by reading values from the php.ini? i want to manage the timeout of the session myself, no matter what the server is set to, i want to try to hit a session page in a hidden frame just before the session would time out so that there won't be a session timeout. -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MySQL fulltext indices and phrase search
Hi there, is there a possibility to use MySQL's MATCH ... AGAINST to look for a string like "foo bar" ? if i MATCH keyname AGAINST ('foo bar') i get resuts that match foo or bar, but not both of them separated by a space. My guess is that the organization of the index doesn't allow this kind of search as it's based on single words , but maybe one of you has a better idea than to select the rows that contain both and hit those with LIKE '%foo bar%' -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP claims that class was defined twice
Hey there i noticed sometinh quite odd when trying to include a class definition: There are several classes in the project in question. Every class resides i a separate file that gets included. When i call the following method function mRenderPrintNav($client) { show_var("",get_declared_classes());//debugcode include($this->pApp->pPath."/".$this->pApp->pCommonPath."/layernav.cls.php"); //include the class definition $menu=new Menu; $this->mRenderNavWalk($client,&$menu); $menu->printMenu(); } PHP complains Fatal error: Cannot redeclare class menu in ..//_common/layernav.cls.php on line 3 ok i started checking if i include the file twice, ich wrote some chars before the first http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] gmtime?
Any reasons why there's no gmtime()-function in PHP? I'd like to hear your thoughts. Jens Lehmann -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gmtime?
> Did you see gmdate()? > http://www.php.net/manual/en/function.gmdate.php Yes, of course. I can do time()-date("Z") to have gmtime (or maybe) something better, but wouldn't it be better to have gmtime() implemented anyways? Please tell me if I missed something. Thank you. Jens Lehmann PS: date("U") and gmdate("U") return the same results -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gmtime?
> I don't know what gmtime() is supposed to do. But is gmmktime() similar? time() returns the number of seconds since the Unix Epoch to the current local time gmtime() should return the number of seconds since the Unix Epoch to the current GM-time Do you understand now? gmmktime() does exactly what I want if I don't pass arguments but since this behaviour is not documented it's probably confusing to a lot of people, isn't it? Jens Lehmann -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: displaying an image with header(... does not work
> Hi there, > > I am pulling out an image out of a mysql blob field. The image is there, I > can see it in mysqlfront. So I pull it out of the db store it into a > variable and then do a: > > header("Content-type: image/pjpeg"); > echo $picture; > > I do get a white screen and the browser is loading forever. I can not see > any error in that. Outputting text works, but not the image. > > Thanx for any help, > > Andy > Don't know if it's a typo, but it must be "image/jpeg" of course. Check your loops (if any) and your strings (esp. " and '). Maybe it's better to post the whole source in this case. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session question
> > Just be sure you call session_start() on any page you want to access > > session variables. > > > > I have to call this function on each page I use session variable or juste > once ? The statement is pretty clear. You've to call it once on each page you want to access session variables. > > > This assumes the latest version of PHP. The procedure is similar on > > older versions, you just have to use session_register(). > > From wich version session_start() is include ? Don't know what you want, but session_start() is part of PHP since version 4.0 Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Switch() ?????
> I have a script that switches. > switch($pid) > { > case 1: > break; > > case 2: > break; > } > > Now I'm doing a check in case 1 and if everything goes well, i want to > switch directly to case 2 while the script is runny. > > How would i do that ??? > Don't write "break;" in case 1. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Function Switch($pid) - NEED HELP
> I have a script that switches. > switch($pid) > { > case 1: > break; > > case 2: > break; > } > > Now I'm doing a check in case 1 and if everything goes well, i want to > switch directly to case 2 while the script is runny. > > How would i do that ??? > Please don't post the same question several times. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gmtime?
> I don't know what gmtime() is supposed to do. But is gmmktime() similar? > http://www.php.net/manual/en/function.gmmktime.php > -Kevin Sorry, my first answer was incorrect. gmmktime() does not do what I want. Do you have any other suggestion why we need/don't need gmtime()? Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can't get Apache and PHP to run together -each seems to work OK WinME
Maybe Apache and PHP have problems with the 2MHz-CPU. :-) I can only guess what may be the problem: 1. You didn't write phpinfo.php correctly. 2. phpinfo.php is in the wrong directory. I suggest this because if the apache-site comes up correctly and phpinfo.php does not it _might_ be a directory problem. Please try to put a test.html-file in your webserver-root and call it in your browser. Jens > I am not an advanced user but not incapable. Please bear with me for > any amateurishness. > > I am trying to get PHP to work with Apache. > I have a Windows ME PC, 2Mhz and 512 of RAM. > > I want it only to learn PHP and then test out a few things, using > MySQL too. > > I downloaded Apache version 1.3.24 and installed it plain and > simple.It starts up. > > I have also installed PHP version 4.2.1. I have also a version of > MySQL loaded (4.0.1) and that sits happily running under a > WinMySQLAdmin logo in the corner of the screen. > > I carefully followed the help files and looked up articles and books > for instructions for setting up the config file and have made changes > to "Apache" so the relevant sections now read like this. > (There seem only to be a few necessary changes)./ > > > QUOTE >ScriptAlias /cgi-bin/ "C:/Program Files/Apache > Group/Apache/cgi-bin/" > > # > # "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed > to whatever your ScriptAliased > # CGI directory exists, if you have that configured. > # > > AllowOverride None > Options None > Order allow,deny > Allow from all > > > > > ScriptAlias /php/ "C:/PHP/" > > > > # End of aliases. > > END QUOTE > > > and .. > > > QUOTE > > # > # AddType allows you to tweak mime.types without actually editing > it, or to > # make certain files to be certain types. > # > AddType application/x-tar .tgz > AddType application/x-httpd-php .php > AddType application/x-httpd-php .php3 > AddType application/x-httpd-php .php4 > AddType application/x-httpd-php .phtml > > Action application/x-httpd-php "/php/php.exe" > > END QUOTE > > With this done the Apache config tester says the syntax is OK and when > I access "localhost" (using IE6) up comes the Apache information page > saying it is running. > > But when I ask for "localhost/phpinfo.php" > (I have a phpinfo function written into a file with that extension) > I get an error 500 "internal configuration is wrong" message. > > > > Maybe it is PHP that is wrong?So I have checked all the changes > needed for installing PHP --- again after reading the php site and > looking a FAQs etc. > > I mean putting the php4tl file into Windows/System etc and PHP.ini > into Windows. (I used the Windows installer anyway and have again > carefully followed the changes needed to the INI file.) > > > > Still the problem. > > A PHP FAQ says that if you get a 500 error (internatl config problem) > it is worth testing with the command line: > > php.exe -i > > > so I did this in DOS. Reams of HTML stuff whizzed by. > According to the FAQ answer this means PHP is OK. > > So back to Apache. But that is as above. > > I tried Netscape version 2 and IE6 - both give the same answer. So > it is not the browser because I have tried different ones. > > It is not PHP because on the command line that works OK and shows > PHPINFO stuff. > > It is not Apache because it says it is running in the browser windows > when you call localhost. > > So - I am being driven slowly nuts with frustration. > > May I ask for any ideas? > > (I should add that I am a rank amateur trying to do all this so please > take it slowly). > > Regards from > Adrian Greeman > > > > Regards from > Adrian Greeman > > 52 Salterford Road, Tooting, London, SW17 9TF > > Phone +44 (0)20 8672 9661 > Mobile +44 (0)780 329 7447 > > Fax: I can receive these > on the computer > but only when present > - please phone first > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ini_set('register_globals',0) doesn't work
I tested ini_set('register_globals',0) and ini_set('register_globals','Off') for turning register_globals off. It doesn't work and it doesn't produce any notice, warning or error. Here's a quick example: $test"; ?> This prints out $test, what it shouldn't do with register_globals turned off. I tested this with PHP 4.1.2 and 4.2.1. Even if I start to doubt it is supposed to work according to the documentation. Can anyone tell me what I've done wrong? For some strange reason if I do echo ini_set('register_globals',0); it will print "10". For echo ini_set('register_globals','Off'); it will print "1Off". Jens PS: ini_set works fine with include_path and error_reporting -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ini_set('register_globals',0) doesn't work
Thank you for answer. I didn't expect ini_set('register_globals','Off') to work, that's why I had a look at the documentation. There should be PHP_INI_PERDIR, PHP_INI_SYSTEM but not PHP_INI_ALL in the table (so it's a mistake in the documentation). Anyway it may be possible to use this, if the variables are unset. This is overload of course, because the variables are first set (because of register_globals="On" in php.ini) and are unset if I call ini_set('register_globals','Off'), but this could be a nice "feature", making it easier to work with register_globals="Off" while other old projects still work. Do you consider this a good idea? Does anything except performance speak against doing this manually? Jens > register_globals affects things that happen before PHP parsing begins, so > by the time you get to your ini_set() it is too late. So no, that won't > work. You need to set it in your php.ini, httpd.conf or .htaccess. > > -Rasmus > > On Sun, 26 May 2002, Jens Lehmann wrote: > > > I tested ini_set('register_globals',0) and ini_set('register_globals','Off') > > for turning register_globals off. It doesn't work and it doesn't produce any > > notice, warning or error. > > > > Here's a quick example: > > > > > > > ini_set('register_globals',0); > > > > if(isset($test)) > > echo "$test"; > > > > ?> > > > > > > > > > > > > This prints out $test, what it shouldn't do with register_globals turned > > off. > > I tested this with PHP 4.1.2 and 4.2.1. Even if I start to doubt it is > > supposed to work according to the documentation. Can anyone tell > > me what I've done wrong? > > > > For some strange reason if I do > > > > echo ini_set('register_globals',0); > > > > it will print "10". For > > > > echo ini_set('register_globals','Off'); > > > > it will print "1Off". > > > > Jens > > > > PS: ini_set works fine with include_path and error_reporting > > > > > > > > -- > > 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] gmtime?
> > -Original Message- > > From: Jens Lehmann [mailto:[EMAIL PROTECTED]] > > Sent: 24 May 2002 20:31 > > > > time() returns the number of seconds since the Unix Epoch to > > the current > > local time > > > > gmtime() should return the number of seconds since the Unix > > Epoch to the > > current GM-time > > > > Do you understand now? > Uh, no, actually now I'm more confused! I can understand that you're confused. :-) Or am I? > As I understand it, a Unix timestamp is *always* the number > of seconds since 1-Jan-1970 GMT ("the Unix epoch"), and > so is always a GMT time. Imho no, because 1-Jan-1970 GMT is just the "starting point", the result depends on which timezone your server is located in. Please correct me if I'm wrong here! > Any function that converts between local time and a Unix > timestamp therefore has to take the current timezone (and > any daylight-savings rules) into account. This is why there > are two versions of mktime() and date(), but only one time(). > > Cheers! > > Mike > Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gmtime?
> > -Original Message- > > From: Jens Lehmann [mailto:[EMAIL PROTECTED]] > > Sent: 27 May 2002 12:48 > > > > > > -Original Message- > > > > From: Jens Lehmann [mailto:[EMAIL PROTECTED]] > > > > Sent: 24 May 2002 20:31 > > > > > > > > time() returns the number of seconds since the Unix Epoch to > > > > the current > > > > local time > > > > > > > > gmtime() should return the number of seconds since the Unix > > > > Epoch to the > > > > current GM-time > > > > > > > > Do you understand now? > > > > > Uh, no, actually now I'm more confused! > > > > I can understand that you're confused. :-) Or am I? > > > > > As I understand it, a Unix timestamp is *always* the number > > > of seconds since 1-Jan-1970 GMT ("the Unix epoch"), and > > > so is always a GMT time. > > > > Imho no, because 1-Jan-1970 GMT is just the "starting point", > > the result depends on which timezone your server is located in. > > Please correct me if I'm wrong here! > > Well, I'm not sure, because I think we're talking at cross purposes. I'm *still* not sure what you want gmtime() to achieve that's different from time(), because, as far as I can see, the two scenarios you describe above actually return the same value. Or, to put it another way, because a timestamp is *always in GMT*, it returns the time since 1-Jan-1970 00:00:00, full stop, period, end of story. In other words, timestamps operate in a single timezone, and it's up to anything else that works with a timestamp to do the timezone (and daylight-savings) corrections. (This is also why you get the anomaly of 23- and 25-hour days in areas which have daylight-savings timeshifts.) > > Let's take some detailed examples, and maybe you can explain what you're trying to get with your gmtime() (and why!): > > In a purely GMT zone, with local time 27-May-2002 12:00:00, the UNIX timestamp is 1022500800. > > In a nominally GMT zone, but with daylight-savings in effect (such as British Summer Time!), with local time 27-May-2002 13:00:00, the UNIX time stamp for this is also 1022500800. > > Likewise, in a GMT+0200 zone, a local time of 27-May-2002 14:00:00 also gives a timestamp of 1022500800. > > In fact, this same timestamp of 1022500800 also represents all of these local times: > > 27-May-2002 04:00 -0800 > 27-May-2002 07:00 -0500 > 27-May-2002 17:00 +0500 > 27-May-2002 23:00 +1100 > > and even such oddities as: > > 27-May-2002 21:30 (Western Australia / Northern Territory) > > Thus, given the timestamp of 1022500800, it's the job of date() to determine the correct timezone and daylight-savings offset and apply them before formatting the output; gmdate() just formats it without applying any offsets. Likewise, mkdate() and gmmkdate() translate the other way respectively with and without timezone correction. > > Forgive me if I've gone on at what seems like excessive length, but I just wanted to make sure we both know exactly what it is we're talking about! > > Cheers! > > Mike > @matt&mike: Thank you for your explanations. I'm a bit sorry for having asked such a question. The deeper I thought about it the more confused I was. I see now that there's no sense in a function like gmtime(). Sorry. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: accessing a mysql column by number
> Is there a way to access a column in Mysql just by using a number? Please refer to the MySQL-Documentation. A database doesn't have any predefined structure, so you're responsible for doing this. Can you explain why you need this "feature"? > Like if you had three columns called "column1", "column2", and > "column3" and I wanted to access column3 just by using the number 3 This could simply be done by using prefixes: $col = $prefix.$number Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: accessing a mysql column by number
Hi Rick, thanks for correcting me. (numeric order) I thought he just wants to select one col. (SELECT "3rd column" FROM table ... ) I didn't read your answer because it was not in the same thread (reading the news with MS Outlook Express), because the subject-line changed. Can you suggest me a newsreader which can manage this? I assume this is the wrong place to ask, so if you don't want to answer, please tell me where to find the answer. (I didn't find it in any FAQs.) Sorry for asking such a stupid question. Jens > Jens, > > A database does have a structure. The order in which the columns/fields are > defined is their numeric order. > Second, mysql_fetch_row() will accomplish what he needs. > Third, we answered this yesterday. > > -Original Message- > From: Jens Lehmann [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 28, 2002 8:18 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: accessing a mysql column by number > > > > > Is there a way to access a column in Mysql just by using a number? > > Please refer to the MySQL-Documentation. A database doesn't have > any predefined structure, so you're responsible for doing this. Can you > explain why you need this "feature"? > > > Like if you had three columns called "column1", "column2", and > > "column3" and I wanted to access column3 just by using the number 3 > > This could simply be done by using prefixes: > > $col = $prefix.$number > > Jens > > > > -- > 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] Finding linefeeds in Strings
String functions like explode, strpos or str_replace seem to fail when asked to work with "\n". What can i do to tokenize or explode a string by linefeeds? i replaced "\n" by another expression and it seems to work, but i'm curious if there's a mor elegant solution... cu Jens -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTTP_POST_VARS not picking up checkboxes that areunchecked
The thing can do is as follows: When i want check such empty boxes, i call up the $HTTP_POST_VARS just like you. BUT what i do next ist that while listing those vars i insert an if statement like if (!strstr($key,checkbox_name)) {echo ($error);} So i do a stringmatch with the key and the name... this way you can check all checkboxes if the have generic starting like check_01 check_02 so then you just ask if (!strstr($key,chec)) {echo ($error);} For strstr function see the manual if you dont know. Another way is as follows... And its probably the best!. You can start putting checkbox values into an array... like this " value="bla"> cb_ then represents the array and THIS array gets transported within the $HTTP_POST_VARS or rather exists as long as the page is up or reloaded. Inside the listing of $HTTP_POST_VARS you then just do another array listing for the cb_ array like this: while (list($key, $val) = each($HTTP_POST_VARS)) { if (strstr($key,'cb_')) { $v_ok=1; while (list($key, $val) = each($cb_)) { $v_liste.=' '.$val; $v_user_liste = eregi_replace("$val","",$user_liste); } } } The only backdrop is that you would have to initilaize those array elements with an '' before Works very nicely for me though.. since most checkbox elements are groups and get pulled out of a database. So the initializing is generic too ;) Maybe this helps, regards Jens on 19.06.2001 1:46 Uhr, Tom Beidler at [EMAIL PROTECTED] wrote: > I have a form with approximately 40 input fields. When a form is posted it > sends an email and then builds a tab delimited $txt entry for a text file on > the server. > > The problem is that if a checkbox is not checked, when it's not required, I > don't get a blank entry in my tab file for the checkbox input. I'm imploding > my HTTP_POST_VARS variable like so; > > reset($HTTP_POST_VARS); > while (list($var, $value) = each($HTTP_POST_VARS)) { > if (is_array($value)){ > $txt .= implode($value, "\t"); > $txt .= "\t"; > } > else{ > $txt .= "$value\t"; > } > } > $txt .= "end\n"; > $flsfile = fopen("text/fls.txt", "a"); > if ($flsfile){ > fputs($flsfile, "$txt"); > fclose($flsfile); > } > > Is there a way to send a blank value if the checkbox is not set? Should I > use a completely different strategy? Have I said Thank you enough to Rasmus > Lerdorf and whomever else was involved in resuscitating the list? > > Thanks Rasmus Lerdorf and all others involved for getting the list back up > and running. > > >>> .>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>> > Tom Beidler > Orbit Tech Services > 805.682.8972 (phone) > 805.682.5833 (fax) > [EMAIL PROTECTED] > http://www.orbittechservices.com/ >>> .>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>> > >
Re: [PHP] php and flash 5 books?
Could you tell me which book that ist? Maybe Title author and ISBN Number. I would be grateful for tha tinformation, thx! regards, Jens on 19.06.2001 17:30 Uhr, Jay Paulson at [EMAIL PROTECTED] wrote: > Anyone know of any good books that actually deal with php interfacing with > flash 5? I've found one book but just curious if there are others out > there... > > thanks, > jay >
Re: [PHP] Solution to "headers already sent" error.
Hy there 8) This one is easy... The thing IS that when you use the header statement there is absolutly NO OUTPUt like echo(); inside the PHP-brackets allowed AND NO OUTPUT allowed outside the PHP-Brackets, before the first header statement appears! Not even simple linebreaks or anything! So watch out for any linebreaks or tabs or spaces outside the php-brackets before the first header statment or any echo or print inside php-brackets before the first header-statement. regards, Jens on 19.06.2001 0:28 Uhr, Merio, Quinn at [EMAIL PROTECTED] wrote: > So, during the time the lists were down, i was banging my head over a > seemingly impossible error message. > > This was the error message: > > Warning: Cannot send session cache limiter - headers already sent > > What?! I exlaimed.. the first line in my page registered the session > variable i was using, so what was the deal. I turned out to be one measly > little space in front of my > If you are registering a session variable, it seems you cant have ANY > whitespace in the page before you register the session variable. > > Figured i would share that nugget, cus man did it ever drive me nuts, and i > saw no reference to it at all in the manuals. > > Quinn Merio > Vice President > Vir2lAlliance Inc. > www.vr2a.com >
RE: [PHP] edit xml with php?
> I am trying to edit this xml-file: Have a look at: http://ww.phpxml.org/ Bye Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] HTML in XML???
> Is there some way to include HTML tags in a XML doc??? Yes, if your HTML is wellformed -> XHTML > And is there a special php xml newsgroup?? http://www.onlamp.com/pub/a/php/php-xml-ml.html Bye Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
SV: [PHP] converting str with \n to one line str??
nl2br is not working in this case. It does put a with every new line, but it does not remove the new line. The string will still have the line changes and it will not work in Javascript. Jens -Oprindelig meddelelse- Fra: Artwithin [mailto:[EMAIL PROTECTED]] Sendt: 20. august 2001 20:09 Til: Jens Cc: [EMAIL PROTECTED] Emne: Re: [PHP] converting str with \n to one line str?? use nl2br() http://www.php.net/nl2br or, alternatively, use a regex to strip out the newlines hope this helps. - Original Message - From: Jens <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 20, 2001 11:15 Subject: [PHP] converting str with \n to one line str?? > When I use Javascript with PHP i run into one problem. When I get the data i > need from the database it often has a lot of and \n (new lines) in it. > The are no problem when converting a string to a Javascript string, but > the \n are. The string has to be all in one line. > > example: > I > am"; ?> > > var temp = <? echo $temp?> > > This is not working!! But this would : > > > > var temp = '<? echo $temp?>'; > > Can you help me please? > > thanks Jens > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
SV: [PHP] converting str with \n to one line str??
$temp = str_replace("\n","test",$temp) is doing the same thing. It is still a string in several lines if you look in the source :-( jens -Oprindelig meddelelse- Fra: Tyler Longren [mailto:[EMAIL PROTECTED]] Sendt: 20. august 2001 20:20 Til: Jens Cc: [EMAIL PROTECTED] Emne: Re: [PHP] converting str with \n to one line str?? You could use str_replace(). -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Mon, 20 Aug 2001 20:15:54 +0200 "Jens" <[EMAIL PROTECTED]> wrote: > When I use Javascript with PHP i run into one problem. When I get the > data i > need from the database it often has a lot of and \n (new lines) in > it. > The are no problem when converting a string to a Javascript string, > but > the \n are. The string has to be all in one line. > > example: > I > am"; ?> > > var temp = <? echo $temp?> > > This is not working!! But this would : > > > > var temp = '<? echo $temp?>'; > > Can you help me please? > > thanks Jens > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
SV: [PHP] converting str with \n to one line str??
Yes!! This was the solution... With str_replace you can use an array as the search argument. Like this $arrReplace = array ("\n","\r"); $temp = str_replace($arrReplace,"",$temp); $temp = addcslashes($temp,"'"); // just to make sure that the string will work as my JS string thanks for the help :-) jens -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sendt: 21. august 2001 09:31 Til: Jens Schødt; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Emne: RE: [PHP] converting str with \n to one line str?? just a thought - \r\n? try stripping out \r's as well. windows does \r\n (carriage return, line feed) for text, unix only \n's -Original Message- From: Jens Schodt [mailto:[EMAIL PROTECTED]] Sent: August 21, 2001 3:20 PM To: 'Tyler Longren' Cc: '[EMAIL PROTECTED]' Subject: SV: [PHP] converting str with \n to one line str?? $temp = str_replace("\n","test",$temp) is doing the same thing. It is still a string in several lines if you look in the source :-( jens -Oprindelig meddelelse- Fra: Tyler Longren [mailto:[EMAIL PROTECTED]] Sendt: 20. august 2001 20:20 Til: Jens Cc: [EMAIL PROTECTED] Emne: Re: [PHP] converting str with \n to one line str?? You could use str_replace(). -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Mon, 20 Aug 2001 20:15:54 +0200 "Jens" <[EMAIL PROTECTED]> wrote: > When I use Javascript with PHP i run into one problem. When I get the > data i > need from the database it often has a lot of and \n (new lines) in > it. > The are no problem when converting a string to a Javascript string, > but > the \n are. The string has to be all in one line. > > example: > I > am"; ?> > > var temp = <? echo $temp?> > > This is not working!! But this would : > > > > var temp = '<? echo $temp?>'; > > Can you help me please? > > thanks Jens > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
SV: [PHP] converting str with \n to one line str??
Allmost, but you have to look for the \r ass well! With str_replace you can use an array as the search argument. Like this $arrReplace = array ("\n","\r"); $temp = str_replace($arrReplace,"",$temp); $temp = addcslashes($temp,"'"); // just to make sure that the string will work as my JS string thanks for the help :-) jens -Oprindelig meddelelse- Fra: David Robley [mailto:[EMAIL PROTECTED]] Sendt: 21. august 2001 09:43 Til: Jens Schødt Cc: '[EMAIL PROTECTED]' Emne: Re: [PHP] converting str with \n to one line str?? On Tue, 21 Aug 2001 16:49, Jens Schodt wrote: > $temp = str_replace("\n","test",$temp) is doing the same thing. It is > still a string in several lines if you look in the source :-( > > jens > > -Oprindelig meddelelse----- > Fra: Tyler Longren [mailto:[EMAIL PROTECTED]] > Sendt: 20. august 2001 20:20 > Til: Jens > Cc: [EMAIL PROTECTED] > Emne: Re: [PHP] converting str with \n to one line str?? > > > You could use str_replace(). > > -- > Tyler Longren > Captain Jack Communications > [EMAIL PROTECTED] > www.captainjack.com > > > > On Mon, 20 Aug 2001 20:15:54 +0200 > > "Jens" <[EMAIL PROTECTED]> wrote: > > When I use Javascript with PHP i run into one problem. When I get the > > data i > > need from the database it often has a lot of and \n (new lines) > > in it. > > The are no problem when converting a string to a Javascript > > string, but > > the \n are. The string has to be all in one line. > > > > example: > > > I > > am"; ?> > > > > var temp = <? echo $temp?> > > > > This is not working!! But this would : > > > > > > > > var temp = '<? echo $temp?>'; > > > > Can you help me please? > > > > thanks Jens Regular expressions? There is an example for ereg_replace in the manual that does just this: $string = ereg_replace ("\n", "", $string); /* Get rid of any newline characters in $string. */ -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA "Yes, I have been reading Voltaire," Tom admitted candidly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problems benchmarking php Scripts
Hello together, I have been trying to benchmark the backend scripting for a flash online game, for this purpose i wrote another PHP Script that uses fopen to make exactly the same requests the flash movie would make with the same timing, and writes a log of the game session into a database. I run this script from the shell of a linux box using the php CGI binary, and start it for a couple of times, but somehow i rarely get more than 66 of those benchmark scripts started simultaneously, neither on one machine, nor on two machines together, so i guessed it has sth to do with my apache confguration, i set startservers and min and maxspare childs to a high value to prevent the httpds from crashing when there are more than 20 to be started in very short time and set maxrequests per child to 256, but none of these changes seem to affect the total number of scripts i can run. The mysql keeps spawning processes of itself and i can still connect to the database when i get to the max of running benchmark scripts, so there does not seem to be a limit of some kind there either. Sometime i get to start a hundred scripts or more, but they disappear in very short time. i have the outputs pointed to /dev/null when putting the scripts into the background (start with &), when i start a single one with output there are no error messages displayed. I also noticed when looking at the output of 'top' i see few httpd processes crashing saying , this happens more rarely when i heve enough httpds started before i start running the benchmark, but some still crash, i can't find any messages in log files saying what happened there. The benchmark scripts should log errors if there was no response from the server but i dont get any of those errors in the logs. thanks in advance Jens -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Simple Char Swapping in String crashes Webserver
Hey there i just managed something that i never accomplished beforei kill a httpd process from PHP, i run the following code $enc is a string and has an even length This silly lines of code make the apache child process crash, if i change it to it works well. what the hell is happening here? i run php 4.04pl1 as apache module under linux. -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Save As doesnt always work
Hello all, i tried to make the browser save a file by setting headers In this case the Browser (IE 5.5 W2K) just displays the content, http request T4 09/07 11:03:17 Server Data: GET http://iwonttell/ T4 09/07 11:03:17 Server ausgabe/auswertung.php HTTP/1.0{0D}{0A}Accept: T4 09/07 11:03:17 Server */*{0D}{0A}Accept-Language: de{0D}{0A}Authoriza T4 09/07 11:03:17 Server tion: Basic aWFdonteventhinkVtbTQy{0D}{0A}User-Ag T4 09/07 11:03:17 Server ent: Mozilla/4.0 (compatible; MSIE 5.5; Windows T4 09/07 11:03:17 ServerNT 5.0){0D}{0A}Host: www.rtl.de{0D}{0A}Proxy-C T4 09/07 11:03:17 Server onnection: Keep-Alive{0D}{0A}{0D}{0A} response T4 09/07 11:03:18 Server Data: HTTP/1.1 200 OK{0D}{0A}Date: Fri, 07 Sep 2001 0 T4 09/07 11:03:18 Server 9:03:49 GMT{0D}{0A}Server: Apache/1.3.19 (Unix) T4 09/07 11:03:18 ServerPHP/4.0.5{0D}{0A}X-Powered-By: PHP/4.0.5{0D} T4 09/07 11:03:18 Server {0A}Content-Disposition: attachment; filename=a T4 09/07 11:03:18 Server usgabe_2001-09-07{0D}{0A}Content-Description: S T4 09/07 11:03:18 Server pielerdaten IAA Special{0D}{0A}Connection: clos T4 09/07 11:03:18 Server e{0D}{0A}Content-Type: text/plain{0D}{0A}{0D} T4 09/07 11:03:18 Server {0A}2001-09-07;jens;auch;test{0A} and in this case (other Web-Server) it works (same browser) http request T4 09/07 11:06:22 Server Data: GET http://bigmama/projekte/rtl/formular/ausgab T4 09/07 11:06:22 Server e/auswertung.php HTTP/1.0{0D}{0A}Accept: image/ T4 09/07 11:06:22 Server gif, image/x-xbitmap, image/jpeg, image/pjpeg, T4 09/07 11:06:22 Server application/vnd.ms-excel, application/msword, a T4 09/07 11:06:22 Server pplication/vnd.ms-powerpoint, */*{0D}{0A}Accept T4 09/07 11:06:22 Server -Language: de{0D}{0A}Cookie: mailCookie=jens%40 T4 09/07 11:06:22 Server bigmama.rep{0D}{0A}User-Agent: Mozilla/4.0 (com T4 09/07 11:06:22 Server patible; MSIE 5.5; Windows NT 5.0){0D}{0A}Host: T4 09/07 11:06:22 Serverbigmama{0D}{0A}Proxy-Connection: Keep-Alive T4 09/07 11:06:22 Server {0D}{0A}{0D}{0A} response T4 09/07 11:06:22 Server Data: HTTP/1.1 200 OK{0D}{0A}Date: Fri, 07 Sep 2001 0 T4 09/07 11:06:22 Server 9:06:22 GMT{0D}{0A}Server: Apache/1.3.14 (Unix) T4 09/07 11:06:22 Server (SuSE/Linux) mod_throttle/3.0 mod_layout/1.0 T4 09/07 11:06:22 Server mod_fastcgi/2.2.2 mod_ssl/2.7.1 OpenSSL/0.9.6 P T4 09/07 11:06:22 Server HP/4.0.4pl1{0D}{0A}X-Powered-By: PHP/4.0.4pl1 T4 09/07 11:06:22 Server {0D}{0A}Content-Disposition: attachment; filena T4 09/07 11:06:22 Server me=ausgabe_2001-09-07{0D}{0A}Content-Descriptio T4 09/07 11:06:22 Server n: Spielerdaten IAA Special{0D}{0A}Connection: T4 09/07 11:06:22 Server close{0D}{0A}Content-Type: text/plain{0D}{0A} T4 09/07 11:06:22 Server {0D}{0A}2001-09-07;jens;test;test{0A}2001-09-07 T4 09/07 11:06:22 Server ;jens;test;test{0A}2001-09-07;jens;test;test T4 09/07 11:06:22 Server {0A}2001-09-07;jens;test;test{0A} The only difference i see is htaccess authentication on the second Server... The PHP Code used to pipe the file through the browser is $file=fopen("ausgabe_".strftime("%Y-%m-%d",$time).".csv", "r"); header("Content-type: text/plain"); header("Content-Disposition: attachment; filename="."ausgabe_".strftime("%Y-%m-%d",$time).""); header("Content-Description: Spielerdaten IAA Special"); fpassthru($file); Any ideas whats wrong here? thanks in advance -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] when logic fails, PHP randomly skips execution of lines
Hello everbody, I have noticed something quite strange, i have a piece of code that looks like, i removed some of it to make it readable: there are no statements in the code that would cause the termination of the method before reaching the last line, no return, die or whatever. This thing is part of a object method, which is called repeatedly. There absolutely NO way 'end' could be printed here without 'swp2' being printed, right, but it does. Also i have occurences of 'swap' without a matching 'end' or 'swp2', like this: (the garbage is the content of '$enc', removing it from the output causes the error to dissappear) -output- Begin swap: 0064277255621244332329528893584643078166114004540827;5>862126663:629;888;;58 664307819;fX$reJxre|"yuw%iVft$rhyuujlnnçm5wi(vkq#ch|ij&fj2 .25C18U8oej|kf!py~3364e\tj||whi(goxk07;2iYximee~%vo~2y82X:nebyif#qwuvwwg swp2: ft$rhyuujlnnçm5wi(vkq#ch|ij&fj2 .25C18U8oej|kf!py~3364e\tj||whi(goxk07;2iYximee~%vo~2y82X:nebyif#qwuvwwg0064 277255621244332329528893584643078166114004540827;5>862126663:629;888;;586643 07819;fX$reJxre|"yuw%iV end Begin swap: 0054716330009693653323102831238781328247354221531537080463:95@4734928:223572 1<2823<8\:nhig#gfM{vo#wsk rk)qkGwvpdudkm#mgg(zmnvppemskhrgC!lxtj3F06H;xokwzj3z33N:|fi|xd7v28TBegin swap: 0034211011257391046799446105509563315163822007167287673;775?=69<<91<;601553< 161375F8eqa"oe"ufd!sæItp{fny&nnwrr&uar%n~fnf1!3/6B92t2tv!keUvlio3g27k;senhQ) omy{0e65e;brfxV%wzdv7g70i2ýrfoY%jrni swp2: !sæItp{fny&nnwrr&uar%n~fnf1!3/6B92t2tv!keUvlio3g27k;senhQ)omy{0e65e;brfxV%wz dv7g70i2ýrfoY%jrni0034211011257391046799446105509563315163822007167287673;77 5?=69<<91<;601553<161375F8eqa"oe"ufd end Begin swap: 00549629613229801512122201313670455389527981851464=:2:4997727A;:21981;306703 59349588`7mlmkvmF!pkk{lgv"g}|hg%sþf"pk fhXexmeèqmf(nzc'ovJmyovzin|ukpk9B02G?qsuxtf1270gEnqwl34=5jK}f17=8vXzpmotn swp2: pkk{lgv"g}|hg%sþf"pk fhXexmeèqmf(nzc'ovJmyovzin|ukpk9B02G?qsuxtf1270gEnqwl34=5jK}f17=8vXzpmotn005 49629613229801512122201313670455389527981851464=:2:4997727A;:21981;306703593 49588`7mlmkvmF! end Begin swap: 002471894193230257221322567045301134119648109371:9=1>6238:5:52136656>3457011 4;bNmtpmjlÿn5sL)rG"hiMxyjeohf"xgz rn#dnBueoftgvqdsnk5omTqfth AnZjesh2#66H7erhruu#stj)z26@.9382qTwsqfkoöm5y22B6238:5:52136656>34570114;bNm tpmjlÿn5sL)rG"hiMxyjeohf"xgz r end Begin swap: 00547198053854516883507941428066511232699173281113A7>::84385:<7:0<>51<640:68 192521?3I9qnyN"ojlm)zcxupjm%ckl(qtRhv$o*"}qzu\15>6dYt|ujdznlpikxtx2581xPetv n8782uLifn{0x38G=rvxmvdxg swp2: pjm%ckl(qtRhv$o*"}qzu\15>6dYt|ujdznlpikxtx2581xPetvn8782uLifn{0x38G=rvxmvdxg 00547198053854516883507941428066511232699173281113A7>::84385:<7:0<>51<640:68 192521?3I9qnyN"ojlm)zcxu end-output- Multiple cases of malfunction in this output, After 2nd Begin: method was not executed properly, even though script continued afterwards. The next Blocks seem to miss either the \n before begin or the \n after end in the fourth block, swap and end are displayed while swp2 is not When i start to reduce the code by either removing $enc from the output or deleting the loops that manipulate the string before, the echos come in the right order and ammount... What can i do, nothing crashed so i dont have a gdb backtrace for an bug report. I cant provide all the code, neither can i reduce the code without the error do disappear The problem occured on PHP 4.04pl1 on Apache 1.3.x on Linux PHP 4.04 on Apache 1.3.x on Linux PHP 4.06 on Apache 1.3.x on W2K thanks Jens
[PHP] Generating UTF Files
Hello, I was asked to generate files in UTF-8 Format, where can i find infos on this? Is it a multi-byte charset? How do i use other charset in PHP? can i just switch to another charset and then make $a="a"; where a is the UTF reprensentation of 'a'? or will i have to mold bytes together myself using chr() ? thanks Jens Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 0 28 21 - 9 78 56-20 Telefax: 0 28 21 - 9 78 56-77 Mobil: 0172 - 8 73 11 73 [EMAIL PROTECTED] http://www.rosomm-partner.de
[PHP] Need Idea to make Backup
Hello, my idea is to make a backup of some paths of my laptop via PHP. I like to use a MySQL Datebase to trace which file was uploaded from which path and so on. Also it should be uses to look up it is nessasery to backup this file because it was changed since last time or not. All this files should be uploaded to the SERVER in a special folder where this files run to a tape backup machine. I hope some one can give me some ideas for this. Kind Regards Jens Geier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need Idea to make Backup
Hello Ashley, yes rsync is a good idea, but does this also work if there is only a internet conection to may SERVER ? Kind Regards Jens Geier "Ashley Sheridan" schrieb im Newsbeitrag news:1263377397.5952.60.ca...@localhost... > On Wed, 2010-01-13 at 10:53 +0100, Jens Geier wrote: > >> Hello, >> >> my idea is to make a backup of some paths of my laptop via PHP. >> >> I like to use a MySQL Datebase to trace which file was uploaded from >> which >> path and so on. >> >> Also it should be uses to look up it is nessasery to backup this file >> because it was changed since last time or not. >> >> All this files should be uploaded to the SERVER in a special folder where >> this files run to a tape backup machine. >> >> I hope some one can give me some ideas for this. >> >> Kind Regards >> Jens Geier >> >> >> >> > > > There's a few ways to go about doing this, but I reckon you should do > something similar to the following: > > > * schedule a cron job to run as often as you want the backup to be >done, and have the cron call a script > * the script can either be php and use your own code to create >copies of files and check file dates for backup purposes, or use >the rsync tool which pretty much does all of this for you >automatically > * update a database as you need. this can be done either from a >php script or directly via mysql on the console > > > If you do use PHP for this, you'll want to code it as a CLI script > rather than a web page script. On the whole it won't make much of a > difference, but obviously some global variables will change a bit. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need Idea to make Backup
"Ashley Sheridan" schrieb im Newsbeitrag news:1263391167.5952.62.ca...@localhost... > On Wed, 2010-01-13 at 14:57 +0100, Jens Geier wrote: > >> Hello Ashley, >> >> yes rsync is a good idea, but does this also work if there is only a >> internet conection to may SERVER ? >> >> Kind Regards >> Jens Geier >> >> "Ashley Sheridan" schrieb im Newsbeitrag >> news:1263377397.5952.60.ca...@localhost... >> > On Wed, 2010-01-13 at 10:53 +0100, Jens Geier wrote: >> > >> >> Hello, >> >> >> >> my idea is to make a backup of some paths of my laptop via PHP. >> >> >> >> I like to use a MySQL Datebase to trace which file was uploaded from >> >> which >> >> path and so on. >> >> >> >> Also it should be uses to look up it is nessasery to backup this file >> >> because it was changed since last time or not. >> >> >> >> All this files should be uploaded to the SERVER in a special folder >> >> where >> >> this files run to a tape backup machine. >> >> >> >> I hope some one can give me some ideas for this. >> >> >> >> Kind Regards >> >> Jens Geier >> > >> > There's a few ways to go about doing this, but I reckon you should do >> > something similar to the following: >> > >> > * schedule a cron job to run as often as you want the backup to be >> >done, and have the cron call a script >> > * the script can either be php and use your own code to create >> >copies of files and check file dates for backup purposes, or use >> >the rsync tool which pretty much does all of this for you >> >automatically >> > * update a database as you need. this can be done either from a >> >php script or directly via mysql on the console >> > >> > If you do use PHP for this, you'll want to code it as a CLI script >> > rather than a web page script. On the whole it won't make much of a >> > difference, but obviously some global variables will change a bit. >> > >> > Thanks, >> > Ash >> > http://www.ashleysheridan.co.uk >> > > > I don't understand what you mean? > > Ps, please try not to top-post. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > Hello Ashley, i try to make a backup from some paths of my local laptop harddrive to a folder on my server. Even if i'm not in the company. If i'm outside (this time i'm in China) i have to copy it through the Internet that is using http or ftp transport protocol. The start of the copy is when the user clicks to a buttom and start the backup process. Kind Regards Jens Geier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need Idea to make Backup
"Ashley Sheridan" schrieb im Newsbeitrag news:1263463572.5952.71.ca...@localhost... > On Thu, 2010-01-14 at 10:12 +0100, Jens Geier wrote: > >> "Ashley Sheridan" schrieb im Newsbeitrag >> news:1263391167.5952.62.ca...@localhost... >> > On Wed, 2010-01-13 at 14:57 +0100, Jens Geier wrote: >> > >> >> Hello Ashley, >> >> >> >> yes rsync is a good idea, but does this also work if there is only a >> >> internet conection to may SERVER ? >> >> >> >> Kind Regards >> >> Jens Geier >> >> >> >> "Ashley Sheridan" schrieb im Newsbeitrag >> >> news:1263377397.5952.60.ca...@localhost... >> >> > On Wed, 2010-01-13 at 10:53 +0100, Jens Geier wrote: >> >> > >> >> >> Hello, >> >> >> >> >> >> my idea is to make a backup of some paths of my laptop via PHP. >> >> >> >> >> >> I like to use a MySQL Datebase to trace which file was uploaded >> >> >> from >> >> >> which >> >> >> path and so on. >> >> >> >> >> >> Also it should be uses to look up it is nessasery to backup this >> >> >> file >> >> >> because it was changed since last time or not. >> >> >> >> >> >> All this files should be uploaded to the SERVER in a special folder >> >> >> where >> >> >> this files run to a tape backup machine. >> >> >> >> >> >> I hope some one can give me some ideas for this. >> >> >> >> >> >> Kind Regards >> >> >> Jens Geier >> >> > >> >> > There's a few ways to go about doing this, but I reckon you should >> >> > do >> >> > something similar to the following: >> >> > >> >> > * schedule a cron job to run as often as you want the backup to >> >> > be >> >> >done, and have the cron call a script >> >> > * the script can either be php and use your own code to create >> >> >copies of files and check file dates for backup purposes, or >> >> > use >> >> >the rsync tool which pretty much does all of this for you >> >> >automatically >> >> > * update a database as you need. this can be done either from a >> >> >php script or directly via mysql on the console >> >> > >> >> > If you do use PHP for this, you'll want to code it as a CLI script >> >> > rather than a web page script. On the whole it won't make much of a >> >> > difference, but obviously some global variables will change a bit. >> >> > >> >> > Thanks, >> >> > Ash >> >> > http://www.ashleysheridan.co.uk >> >> > >> > >> > I don't understand what you mean? >> > >> > Ps, please try not to top-post. >> > >> > Thanks, >> > Ash >> > http://www.ashleysheridan.co.uk >> > >> Hello Ashley, >> >> i try to make a backup from some paths of my local laptop harddrive to a >> folder on my server. Even if i'm not in the company. >> >> If i'm outside (this time i'm in China) i have to copy it through the >> Internet that is using http or ftp transport protocol. >> >> The start of the copy is when the user clicks to a buttom and start the >> backup process. >> >> Kind Regards >> Jens Geier > > The script needs to be set up on your local machine. I don't think HTTP > will help you much here, as that isn't great for transferring files > upstream I've found. Googling 'rsync ftp example' brings about over > 230,000 results, have you actually tried looking? > > Thanks, > Ash > http://www.ashleysheridan.co.uk > No, i have not. Because i also think that there will not a finish software. So i think i have to write something by my own. That is the reason i ask for ideas to do so. I just read here the following thread: [PHP] Read directory; store filenames found in mySQL table? That is something that is running in that direction in try to go. Kind Regards Jens Geier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need Idea to make Backup
"haliphax" schrieb im Newsbeitrag news:952625161001140625x31d03ed5oef8216064da13...@mail.gmail.com... > On Thu, Jan 14, 2010 at 5:45 AM, Ashley Sheridan > wrote: > >> On Thu, 2010-01-14 at 12:32 +0100, Jens Geier wrote: >> >> > "Ashley Sheridan" schrieb im Newsbeitrag >> > news:1263463572.5952.71.ca...@localhost... >> > > On Thu, 2010-01-14 at 10:12 +0100, Jens Geier wrote: >> > > >> > >> "Ashley Sheridan" schrieb im Newsbeitrag >> > >> news:1263391167.5952.62.ca...@localhost... >> > >> > On Wed, 2010-01-13 at 14:57 +0100, Jens Geier wrote: >> > >> > >> > >> >> Hello Ashley, >> > >> >> >> > >> >> yes rsync is a good idea, but does this also work if there is >> > >> >> only >> a >> > >> >> internet conection to may SERVER ? >> > >> >> >> > >> >> Kind Regards >> > >> >> Jens Geier >> > >> >> >> > >> >> "Ashley Sheridan" schrieb im >> Newsbeitrag >> > >> >> news:1263377397.5952.60.ca...@localhost... >> > >> >> > On Wed, 2010-01-13 at 10:53 +0100, Jens Geier wrote: >> > >> >> > >> > >> >> >> Hello, >> > >> >> >> >> > >> >> >> my idea is to make a backup of some paths of my laptop via >> > >> >> >> PHP. >> > >> >> >> >> > >> >> >> I like to use a MySQL Datebase to trace which file was >> > >> >> >> uploaded >> > >> >> >> from >> > >> >> >> which >> > >> >> >> path and so on. >> > >> >> >> >> > >> >> >> Also it should be uses to look up it is nessasery to backup >> > >> >> >> this >> > >> >> >> file >> > >> >> >> because it was changed since last time or not. >> > >> >> >> >> > >> >> >> All this files should be uploaded to the SERVER in a special >> folder >> > >> >> >> where >> > >> >> >> this files run to a tape backup machine. >> > >> >> >> >> > >> >> >> I hope some one can give me some ideas for this. >> > >> >> >> >> > >> >> >> Kind Regards >> > >> >> >> Jens Geier >> > >> >> > >> > >> >> > There's a few ways to go about doing this, but I reckon you >> should >> > >> >> > do >> > >> >> > something similar to the following: >> > >> >> > >> > >> >> > * schedule a cron job to run as often as you want the >> > >> >> > backup >> to >> > >> >> > be >> > >> >> >done, and have the cron call a script >> > >> >> > * the script can either be php and use your own code to >> create >> > >> >> >copies of files and check file dates for backup >> > >> >> > purposes, >> or >> > >> >> > use >> > >> >> >the rsync tool which pretty much does all of this for >> > >> >> > you >> > >> >> >automatically >> > >> >> > * update a database as you need. this can be done either >> from a >> > >> >> >php script or directly via mysql on the console >> > >> >> > >> > >> >> > If you do use PHP for this, you'll want to code it as a CLI >> script >> > >> >> > rather than a web page script. On the whole it won't make much >> > >> >> > of >> a >> > >> >> > difference, but obviously some global variables will change a >> bit. >> > >> >> > >> > >> >> > Thanks, >> > >> >> > Ash >> > >> >> > http://www.ashleysheridan.co.uk >> > >> >> > >> > >> > >> > >> > I don't understand what you mean? >> > >> > >>
Re: [PHP] Need Idea to make Backup
"Ashley Sheridan" schrieb im Newsbeitrag news:1263469507.5952.75.ca...@localhost... > On Thu, 2010-01-14 at 12:32 +0100, Jens Geier wrote: > >> "Ashley Sheridan" schrieb im Newsbeitrag >> news:1263463572.5952.71.ca...@localhost... >> > On Thu, 2010-01-14 at 10:12 +0100, Jens Geier wrote: >> > >> >> "Ashley Sheridan" schrieb im Newsbeitrag >> >> news:1263391167.5952.62.ca...@localhost... >> >> > On Wed, 2010-01-13 at 14:57 +0100, Jens Geier wrote: >> >> > >> >> >> Hello Ashley, >> >> >> >> >> >> yes rsync is a good idea, but does this also work if there is only >> >> >> a >> >> >> internet conection to may SERVER ? >> >> >> >> >> >> Kind Regards >> >> >> Jens Geier >> >> >> >> >> >> "Ashley Sheridan" schrieb im Newsbeitrag >> >> >> news:1263377397.5952.60.ca...@localhost... >> >> >> > On Wed, 2010-01-13 at 10:53 +0100, Jens Geier wrote: >> >> >> > >> >> >> >> Hello, >> >> >> >> >> >> >> >> my idea is to make a backup of some paths of my laptop via PHP. >> >> >> >> >> >> >> >> I like to use a MySQL Datebase to trace which file was uploaded >> >> >> >> from >> >> >> >> which >> >> >> >> path and so on. >> >> >> >> >> >> >> >> Also it should be uses to look up it is nessasery to backup this >> >> >> >> file >> >> >> >> because it was changed since last time or not. >> >> >> >> >> >> >> >> All this files should be uploaded to the SERVER in a special >> >> >> >> folder >> >> >> >> where >> >> >> >> this files run to a tape backup machine. >> >> >> >> >> >> >> >> I hope some one can give me some ideas for this. >> >> >> >> >> >> >> >> Kind Regards >> >> >> >> Jens Geier >> >> >> > >> >> >> > There's a few ways to go about doing this, but I reckon you >> >> >> > should >> >> >> > do >> >> >> > something similar to the following: >> >> >> > >> >> >> > * schedule a cron job to run as often as you want the backup >> >> >> > to >> >> >> > be >> >> >> >done, and have the cron call a script >> >> >> > * the script can either be php and use your own code to >> >> >> > create >> >> >> >copies of files and check file dates for backup purposes, >> >> >> > or >> >> >> > use >> >> >> >the rsync tool which pretty much does all of this for you >> >> >> >automatically >> >> >> > * update a database as you need. this can be done either >> >> >> > from a >> >> >> >php script or directly via mysql on the console >> >> >> > >> >> >> > If you do use PHP for this, you'll want to code it as a CLI >> >> >> > script >> >> >> > rather than a web page script. On the whole it won't make much of >> >> >> > a >> >> >> > difference, but obviously some global variables will change a >> >> >> > bit. >> >> >> > >> >> >> > Thanks, >> >> >> > Ash >> >> >> > http://www.ashleysheridan.co.uk >> >> >> > >> >> > >> >> > I don't understand what you mean? >> >> > >> >> > Ps, please try not to top-post. >> >> > >> >> > Thanks, >> >> > Ash >> >> > http://www.ashleysheridan.co.uk >> >> > >> >> Hello Ashley, >> >> >> >> i try to make a backup from some paths of my local laptop harddrive to >> >> a >> >> folder on my server. Even if i'm not in the company. >> >> >> >> If i'm outside (this time i'm in China) i have to copy it through the >> >> Internet that is using http or ftp transport protocol. >> >> >> >> The start of the copy is when the user clicks to a buttom and start >> >> the >> >> backup process. >> >> >> >> Kind Regards >> >> Jens Geier >> > >> > The script needs to be set up on your local machine. I don't think HTTP >> > will help you much here, as that isn't great for transferring files >> > upstream I've found. Googling 'rsync ftp example' brings about over >> > 230,000 results, have you actually tried looking? >> > >> > Thanks, >> > Ash >> > http://www.ashleysheridan.co.uk >> > >> No, i have not. >> >> Because i also think that there will not a finish software. >> >> So i think i have to write something by my own. >> That is the reason i ask for ideas to do so. >> >> I just read here the following thread: >> >> [PHP] Read directory; store filenames found in mySQL table? >> >> That is something that is running in that direction in try to go. >> >> Kind Regards >> Jens Geier > > But I've told you that the best tool to do it is rsync. This is a tool, > not a whole large peice of software with a GUI, etc. You use it in > conjunction with other software to achieve what you need. Have you even > looked up at what rsync is? > > Thanks, > Ash > http://www.ashleysheridan.co.uk > Hello Ashley, rsync looks like the right tool i need to use. But i need much MORE information about it. You have an idea where i can find a news group like this for rsync? Kind Regards Jens Geier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need Idea to make Backup
"Robert Cummings" schrieb im Newsbeitrag news:4b4f40d3.3010...@interjinn.com... > haliphax wrote: >> On Thu, Jan 14, 2010 at 5:45 AM, Ashley Sheridan >> wrote: >> >>> On Thu, 2010-01-14 at 12:32 +0100, Jens Geier wrote: >>> >>>> "Ashley Sheridan" schrieb im Newsbeitrag >>>> news:1263463572.5952.71.ca...@localhost... >>>>> On Thu, 2010-01-14 at 10:12 +0100, Jens Geier wrote: >>>>> >>>>>> "Ashley Sheridan" schrieb im Newsbeitrag >>>>>> news:1263391167.5952.62.ca...@localhost... >>>>>>> On Wed, 2010-01-13 at 14:57 +0100, Jens Geier wrote: >>>>>>> >>>>>>>> Hello Ashley, >>>>>>>> >>>>>>>> yes rsync is a good idea, but does this also work if there is only >>> a >>>>>>>> internet conection to may SERVER ? >>>>>>>> >>>>>>>> Kind Regards >>>>>>>> Jens Geier >>>>>>>> >>>>>>>> "Ashley Sheridan" schrieb im >>> Newsbeitrag >>>>>>>> news:1263377397.5952.60.ca...@localhost... >>>>>>>>> On Wed, 2010-01-13 at 10:53 +0100, Jens Geier wrote: >>>>>>>>> >>>>>>>>>> Hello, >>>>>>>>>> >>>>>>>>>> my idea is to make a backup of some paths of my laptop via PHP. >>>>>>>>>> >>>>>>>>>> I like to use a MySQL Datebase to trace which file was uploaded >>>>>>>>>> from >>>>>>>>>> which >>>>>>>>>> path and so on. >>>>>>>>>> >>>>>>>>>> Also it should be uses to look up it is nessasery to backup this >>>>>>>>>> file >>>>>>>>>> because it was changed since last time or not. >>>>>>>>>> >>>>>>>>>> All this files should be uploaded to the SERVER in a special >>> folder >>>>>>>>>> where >>>>>>>>>> this files run to a tape backup machine. >>>>>>>>>> >>>>>>>>>> I hope some one can give me some ideas for this. >>>>>>>>>> >>>>>>>>>> Kind Regards >>>>>>>>>> Jens Geier >>>>>>>>> There's a few ways to go about doing this, but I reckon you >>> should >>>>>>>>> do >>>>>>>>> something similar to the following: >>>>>>>>> >>>>>>>>> * schedule a cron job to run as often as you want the backup >>> to >>>>>>>>> be >>>>>>>>>done, and have the cron call a script >>>>>>>>> * the script can either be php and use your own code to >>> create >>>>>>>>>copies of files and check file dates for backup purposes, >>> or >>>>>>>>> use >>>>>>>>>the rsync tool which pretty much does all of this for you >>>>>>>>>automatically >>>>>>>>> * update a database as you need. this can be done either >>> from a >>>>>>>>>php script or directly via mysql on the console >>>>>>>>> >>>>>>>>> If you do use PHP for this, you'll want to code it as a CLI >>> script >>>>>>>>> rather than a web page script. On the whole it won't make much of >>> a >>>>>>>>> difference, but obviously some global variables will change a >>> bit. >>>>>>>>> Thanks, >>>>>>>>> Ash >>>>>>>>> http://www.ashleysheridan.co.uk >>>>>>>>> >>>>>>> I don't understand what you mean? >>>>>>> >>>>>>> Ps, please try not to top-post. >>>>>>> >>>>>>> Thanks, >>>>>>> Ash >>>>>>> http://www.ashleysheridan.co.uk >>>>>>> >>>>>> Hello Ashley, >>>>>> >&g
[PHP] RSYNC - who knows more?
Hello, as sugestet i tried backup by using RSYNC. It is working fine. But i have some more Questions for this software. Is here some one that can help me with it? Kind Regards Jens Geier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RSYNC - who knows more?
"Richard" schrieb im Newsbeitrag news:af8726441001170426m3261f222i1e0e638c9c45e...@mail.gmail.com... > Hi, > >> as sugestet i tried backup by using RSYNC. >> It is working fine. >> >> But i have some more Questions for this software. >> >> Is here some one that can help me with it? > > You might get better results with the documentation: > > http://samba.anu.edu.au/rsync/documentation.html > > At a glance there are links to mailing lists too. > > -- > Richard Heyes > HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 2nd > January) > Lots of PHP and Javascript code - http://www.phpguru.org Hello Richard, yes i see the links to the mailing lists, but i can not access them. Kind Regards Jens Geier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RSYNC - who knows more?
Hello Michael, usualy i like to make a backup of some Paths of my Laptop. So i think a rsnapshot should be a good idea. So i will have a look to your second Link you provide. Kind Regards Jens Geier "Michael Kubler" schrieb im Newsbeitrag news:4b542e73.8040...@gmail.com... > What is it you want to do? > Do you want to create a client for RSYNC, or maybe rsync to AmazonS3 > <http://jeremy.zawodny.com/blog/archives/007641.html> (which is > admittedly hard), or maybe use something like rsnapshot > <http://www.rsnapshot.org/> to have rsync + snapshot functionality, > which is great when you get a whole heap of corrupt data that gets > sync'd across, you can go back to an old snapshot instead of loosing > everything. > > Michael Kubler > *G*rey *P*hoenix *P*roductions <http://www.greyphoenix.biz> > Mobile : 0433483008 > > I believe in a better world. I support the Zeitgeist Movement > <http://www.zeitgeistsa.com>. > > > Jens Geier wrote: >> Hello, >> >> as sugestet i tried backup by using RSYNC. >> It is working fine. >> >> But i have some more Questions for this software. >> >> Is here some one that can help me with it? >> >> Kind Regards >> Jens Geier > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Fastest templating mechanism
Evert | Rooftop Solutions wrote: > Hi all, > > I'm working on a template system which works a bit like a text > translation block. The data looks for example like: > > beginblock > endblock > beginauthor > endauthor > > > The list is going to be very large, it will have several overlays and > not all pages need all items in the list. (usually just a fraction) > > What will be the smartest way to implement this? I need a low-memory > cost and fast solution > I can do it with a php script, like: > > $list = array( > 'beginblock' => '', > > etc. > > ); > > but this will use up too much memory. I could additionally do it with a > textfile, but if I need to loop through it at every lookup it will be > slow.. > > What are your suggestions? > > regards, > Evert > Have also a look at www.phpsavant.com. Different from smarty, its a lightweight object-oriented template engine. One neat feature is that you could add optionally your own custom markup compilers. Regards, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php-tidy
OOzy Pal schrieb: > I have php4 running on Ubuntu Feisty. I can see php5-tidy in the > Synaptic (Package Manager) but can not see php4-tidy or php-tidy. How > can I install php4-tidy for php4? > On linux: - download the source - untar and go to directory - /path/to/phpize - ./configure ( maybe --help ) - make - make install - enable the new extension in the php.ini - done hth Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL and SVN
Emil Edeholt schrieb: Hi all! Maybe slightly off topic, but I would like to know how you guys handle mysql structures between different computers (and for that matter from the developer desktop to the stable server). I work on my home and my office computer with the same php projects. I keep all my php files on svn, so I just update and commit the first and last thing I do when I switch computer. The problem is when I've made a change in the structure of my mysql tables. I usually try to save a dump and ssh it to my server and download and import it on the other computer. But that feels clumsy, and if I've made changes on both computers I have no simple way to merge the structures like I can in svn. How do you handle this in your projects? Best Regards Emil Edeholt Hi Emil, I use pear MDB2_Schema package to handle and manage my database structures. Another option would be http://dbdeploy.com/. There is also a pear proposal: http://pear.php.net/pepr/pepr-proposal-show.php?id=507. Both, very interesting components in the area of database deployment. Cheers, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SMTP
Diana schrieb: I dont know what I did but now I get this message Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" Do you have a smtp server running on localhost? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SESSION NOT WORKING
Balpo schrieb: >> Hi everyone, I'm having a problem moving my code to a linux >> computer. I won't post the whole code here, but an accurate example >> that reproduces exactly the error. >> >> // 1.php > $_SESSION['tree'] = "This is tree number one"; header("Location: >> 2.php"); ?> >> >> // 2.php > ?> >> >> session.auto_start = 1 >> >> I want to know why session.auto_start does not work on Linux. >> >> If you require the whole php.ini, I'll send it gladly Hi! Did you test with phpinfo() if the correct php.ini is used? regards, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Templates, PHP Frameworks, and DB Abstraction?
Jay Paulson wrote: I'd like to get some feedback on what the list thinks is a good template engine other than smarty. I like ezTemplate. (E_STRICT) I'd also like to do some quick prototyping using a PHP framework does anyone have any recommendations for one that is easy to pick up and run with? Seems to be a really difficult question imho :) Finally, does anyone have any suggestions for a good PHP database abstraction library? Depends on your environment, MDB2 is fine if you have to run php4, otherwise, I like Zend_Db (http://framework.zend.com/manual/en/zend.db.html) and also ezDatabase (http://ez.no/doc/components/view/latest/(file)/classtrees_Database.html) is worth a look. just my 0,2 €cents -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Templates, PHP Frameworks, and DB Abstraction?
Robert Cummings wrote: On Mon, 2006-07-03 at 08:37, Jens Kleikamp wrote: Jay Paulson wrote: I'd like to get some feedback on what the list thinks is a good template engine other than smarty. I like ezTemplate. (E_STRICT) YOU DO?? I hope it's changed then from the one used on a site I'm now maintaining. I find it to be a nightmare. You can't just move around blocks of content because the template's block structure requires you maintain the nesting association... thus you need to go back to the code every time you move a block of content to synch up the block declarations. Cheers, Rob. Hi Rob, Sorry, typo, I meant ezcTemplate. Maybe ezTemplate is a package within ezPublish 3.x cms, which I don´t know. ( not 100% sure ) The lately released ezcTemplate does the job very well, I didn´t experienced the issue you described. Cheers, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Frameworks - Opinion
Matt Todd wrote: In my experience with the other frameworks (primarily Wasp, CakePHP, Symfony, eZ Components, and Zend Framework), I've found that I was not satisfied with the quantity of low-quality code they advocate. I have a high standard for code quality, readability, maintainability, and (more generally) semantics. Because of this, I determined to build my own framework. This was a few months ago, and Canvas[1] was the result of my labor. I produced this framework while working on numerous projects at the university I work at. This allowed me to build an application concurrently with the framework and give it a good benchmark for usability, feature, performance, etc. Some of the features include pretty URLs and a fairly capable router, a simplistic implementation of the ActiveRecord pattern (with a very easy way to make adapters for your favorite flavor of RDBMS), incorporation of Smarty for its templating, and usage of the MVC pattern. (Of course, this list is hardly sorted by priority.) A quick sample of using the ActiveRecord implementation: class shoe extends Model {} $shoe = new shoe(); $shoe->find_by_color('green')->delete(); $shoe->find_by_id(12); $shoe->color = 'red'; $shoe->save(); $shoe->find_or_create_by_color('tangerine'); $shoe->find(array("where"=>array('color like ":color" or size > ":size", "color"=>"pink", "size"=>"11")))->all(); Do check it out. M.T. 1. http://c.anvas.es/ Please do not recommend stuff like this. It is a funky framework! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 Session length changed
Hi, we validate all incoming parameters and that includes checking if the phpsession ID is only numbers and letters and is 32 Bytes long. This worked for some PHP5 Servers but we just encountered an 5.1.2 that issued sessionIDs that were 26 Bytes long. I cant find any note about that in either of the PHP5 changelogs. Question : What lengths are valid for PHP Sesssions is it possible to encounter valid sessions with a length other than 26 and 32? PHPinfo : http://neu.karnevalservice.de/dbcTrade/phpinfo.php thanks Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imap_getmailboxes - how to understand the values of "attributes"?
Hello! For a small webmail-client I want to use the mailbox-attributes to make a difference between mailservers and their folder-handling. Unfortunately I don't understand the meaning of the attributes-value in detail. In PHP-manual I found that "Attributes is a bitmask". In comments/notes the bitmasks are described as: 1 LATT_NOINFERIORS 2 LATT_NOSELECT 4 LATT_MARKED 8 LATT_UNMARKED But when debugging with my mailservers/folders I received the following values: 1, 32, 40, 64. It would be great if anyone could help me with a short explanation how to sum up the bitmasks to get these values (or vice versa...). Thank you, kind regards, Jens smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] Encoding
Hi! Could you check the default encoding of your webserver (in httpd.conf)? I noticed that the charset-information in "meta-information" is ignored and the default-charset of the webserver is used. Kind regards, Jens JoXo CXndido de Souza Neto schrieb: > I am facing a trouble in my system in which i am not able to show ISO-8859-1 > encoding data. When i tried to use the follow meta tag it works in firefox > but still not working in IE. > > > > In firefox it shows: REMÉDIO PARA O GADO > > In IE it shows: REM?IOS PARA O GADO > > Could someone help me? > > Thanks in advance. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: auto download
Benjamin Adams wrote: I have three links. The code already auto selects one. I'm trying to take that one link and automaticly start the download. I tryed with header('location:$link'); but it tells me "Warning: Cannot modify header information" what would I use to start downloading? one of the link is another page so I need it to pop up in a new window. Thanks for any help Moin, You can´t start the browsers download dialog if you already sent any data. No header(), echo(), print() etc. Have a look at http://pear.php.net/package/HTTP_Download. cheers, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Linux distributions and tools for Linux/Apache/PHP/MySQL dev
Chris Lott wrote: I'm making the switch from Windows to Linux for mydesktop and development environment and would greatly appreciate suggestions for development tools on this platform. Ubuntu seems to be getting all the press, but suggestions about Linux distributions are welcome as well! c Just for editing php files under linux I found the eclipse plugin http://www.phpeclipse.de. Very nice screenshot: http://www.flickr.com/photo_zoom.gne?id=101196627&size=o Also it seems that there will be a more powerfull php environment for eclipse in the future by Zend and IBM. http://www.eclipse.org/proposals/php-ide/ - promising! :) Best Regards, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: APC and PHP 5.1.2
steve wrote: You know not what you ask!! I'm going to have to wait a bit before I do that. Currently using Apache 2, and the config files would need to be different, etc., so I'll have to choose a webserver I can take down for a longer time. :( What I did try was different versions of PHP (All using FastCGI & APC-dev) (if this even helps): 5.1.2 -- Failed 5.1.1 -- Failed 5.0.5 -- Success -steve-- On 3/2/06, Rasmus Lerdorf <[EMAIL PROTECTED]> wrote: It probably does. I have never tried it against the Fastcgi sapi. Try it with the Apache module version to rule this out. -Rasmus Your script works fine for me on linux, php 5.1.2 FastCGI + apc-dev. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Coding Practice: Use global $var or pass in by refernce
Mark Steudel wrote: I was wondering what the general rule on using the global driective versus passing in a variable by reference, why you should or shouldn't, etc. e.g. function () { global $db; $res =& $db->query( "SQL"); } or function ( &$db ) { $res =& $db->query( "SQL"); } or function foo () { $db = & $GLOBALS['database']; $res = & $db->query(); } or function foo () { $res = & $GLOBALS['database']->query(); } Just some more possibilities... cheers Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: APC and PHP 5.1.2
steve wrote: Thanks for that! It meant that I should look in other directions which helped me figure out the problem. Can you try again with: apc.optimization=1 Your script also seems to work on my sytem with optimization=1. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: APC and PHP 5.1.2
steve wrote: Really? Now I am confused on why I'd be having a problem and you aren't. I even deleted the php.ini file and made a new one that only contained this: extension=apc.so apc.optimization=1 and it still failed. At least I have it working without the second line. My phpinfo() has this as the configure line (why the quotes?): './configure' '--with-mysqli' '--with-pdo' '--with-cli' '--with-gd' '--with-dom' '--with-zlib' '--with-xml' '--with-openssl' '--enable-mbstring=all' '--enable-inline-optimization' '--enable-memory-limit' '--enable-exif' '--enable-fastcgi' '--enable-force-cgi-redirect' '--without-pear' Can you check yours? Maybe there is a conflict with the modules compiled in and APC's optimizer (though that sounds really strange). Maybe I'll try removing all of them and recompile and see what happens... ./configure \ --prefix=/usr/local/php5-fcgi \ --with-config-file-path=/etc/php5-fcgi \ --with-mysql=/usr \ --with-zlib \ --enable-fastcgi \ --enable-memory-limit \ --enable-force-cgi-redirect \ --enable-track-vars \ --without-pear \ --with-imap \ --with-imap-ssl \ --with-gd \ --enable-gd-native-ttf \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-freetype-dir=/usr \ --enable-pdo \ --enable-pdo_mysql \ --with-pdo_mysql \ --with-gettext \ --with-iconv \ --enable-mbstring=all \ --enable-mbregex \ --with-mime-magic=/usr/share/misc/file/magic.mime \ --with-dom \ --with-mcrypt hth, Jens -steve- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SVN PHP
Jon Morgan wrote: Hi. I'm trying to access SVN from PHP and as there seems to be no direct binding for it yet i've had a look at WebSVN source to try and list directories in a repository with the following code but it just doesn't return anything. It doesn't return anything whether re-directing or not (i..e. using >2&1). If I use the same method to call "svnlook author", etc. it work fine, the only problem is when using the "svn" command line program. $output = array (); $err = false; $cmd = "svn info http://172.16.0.32/svn/java/trunk >2&1"; if ($handle = popen($cmd, "r")) { $firstline = true; while(!feof($handle)) { $line = fgets($handle); if($firstline && $line == "") { $err = true; } $firstline = false; $output[] = rtrim($line); } pclose($handle); if(!$err) print $output; } Any help would be appreciated. Cheers, J. Maybe the svn pecl extension can help, http://pecl.php.net/package/svn cheers, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php