Re: [PHP] opposite of quotemeta ?

2009-10-29 Thread Marc Steinert
Hi Matthew, you might have magic quotes enabled in your PHP installation. Have a look at http://php.net/manual/de/security.magicquotes.php about that topic. If you want to unescape the string, use the stripslashes-function (http://php.net/stripslashes). Greetings from Germany Marc

Re: [PHP] preg_replace

2009-06-05 Thread Marc Steinert
Hey Ben, to replace everything thats not alphanumeric, use the following statement: $output = preg_replace('/[^[:alnum:]]/', '', $input); Greetings from Germany Marc PS: Spaces are not alphanumeric ;) Ben Miller wrote: Oh yeah - not sure if spaces are considered alphanumeric or not, but I

Re: [PHP] PHP scalability problem

2009-05-27 Thread Marc Steinert
Have a look at APC. APC is a bytecode cache, that stores bytecode generated of your PHP scripts, so that your PHP code don't need be parsed every time the script is invoked. http://pecl.php.net/package/apc I was able to increase the performance of my PHP scripts dramatically. Greetings from

Re: [PHP] how to delete part of string

2009-05-23 Thread Marc Steinert
I guess you mean GET parameters instead of POST. $string = preg_replace('/^(.*?)id=/', 'id=', $_SERVER['QUERY_STRING']); Don't know, if that's exactly what you wanted. Greetings from Germany Marc Grega Leskovsek wrote: I have a POST string field and I want to skip some fields before id=

Re: [PHP] help with global not working

2009-05-13 Thread Marc Steinert
Maybe your code overwrites the variable anywhere? You should think about switching to a constant in that case by using define('TEST_MODE', true); [...] if (TEST_MODE) { [...] } else { [...] } Greetings from Germany Marc Joey wrote: Hello All, I am running into a problem after I moved a

Re: [PHP] Change color of anything in double/single quotes

2009-04-25 Thread Marc Steinert
from Germany Marc Steinert -- Synchronize and share your files over the web for free http://bithub.net/ My Twitter feed http://twitter.com/MarcSteinert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reflection question

2009-04-14 Thread Marc Steinert
Have a look at example #5 on http://de3.php.net/manual/en/language.oop5.reflection.php#language.oop5.reflection.reflectionmethod Greetings from Germany Marc Pulni4kiya wrote: Hi, everyone! I need to do the following: Let's say I have this class: class A { public function b(array $c, $d =

Re: [PHP] try - catch is not so clear to me...

2009-04-13 Thread Marc Steinert
Basically try-catch gives you the ability to handle errors outside a class or method scope, by the calling instance. This comes in handy, if you are programming in an object orientated way and thus enables you to seperate error handling from the rest of your functionality. Means, your methods do

Re: [PHP] syntax

2009-02-24 Thread Marc Steinert
Terion Miller wrote: $query .= WHERE stamp NOW()-7 ; I have no clue here on this Try $query .= WHERE stamp SUBDATE(NOW(), INTERVAL -7 DAY); instead. Marc -- http://bithub.net/ Synchronize and share your files over the web for free My Twitter feed

Re: [PHP] syntax

2009-02-24 Thread Marc Steinert
Marc Steinert wrote: Terion Miller wrote: $query .= WHERE stamp NOW()-7 ; I have no clue here on this Try $query .= WHERE stamp SUBDATE(NOW(), INTERVAL -7 DAY); instead. Marc Damn, hit the send-button too fast. Replace -7 with 7. Sry for spamming the list. -- http

Re: [PHP] RewriteRules

2009-01-12 Thread Marc Steinert
Jason Pruim schrieb: Now, on that site I have a few links... right now the likes are in the format of: HTTP://purl.raoset.com/design.php?purl=test112 What I would like is to have it read: HTTP://purl.raoset.com/test112/design Try the following rule (dunno, if it works for you, but you should

Re: [PHP] How can a script tell if there's a MySQL problem?

2009-01-09 Thread Marc Steinert
Brian Dunning schrieb: I have one server that's pretty busy and runs into Too many connections from MySQL from time to time, and needs to have MySQL restarted to clear it up. I've tried everything I can think of to have PHP take note of this error but continue executing with other stuff, but

Re: [PHP] setting up FTP account names via PHP

2009-01-05 Thread Marc Steinert
Merlin Morgenstern schrieb: Hello everybody, I am running a real estate site where I would like to enable bulk upload via real estate software that exports an xml file into an ftp account. In order to give every user unique access I would need to generate individual ftp name and passwords

Re: [PHP] Variable as an index

2008-12-21 Thread Marc Steinert
MikeP schrieb: I have tried putting the quotes all over and all I get is: 'Array[U]'. Try to avoid accessing the two-dimensional array $users inside a string. Use echo's ability to accept multiple parameters: echo 'trtd.', $users[$x]['U'], '/td'; Or by concating the string with

Re: [PHP] Variable as an index

2008-12-21 Thread Marc Steinert
German Geek schrieb: Why is the first method faster and uses less memory? Because the concatenation operator first reassembles a new string, stores it in memory then passes this newly created string to the echo function, if I'm not misstaken. -- http://bithub.net/ Synchronize and share

Re: [PHP] First PHP program

2008-12-13 Thread Marc Steinert
Anwarulhaq wrote: I am working on MS.net.But now i days i want to work on PHP. I dont know the basis of PHP. Can any one guide me how i have to start with PHP and which editor i should use. Also the links of useful sites for help in PHP. I shall be thankful. Since you've allready worked with