[PHP] PCRE vs. POSIX-extended for regular expressions

2004-01-28 Thread SLanger
Hello The reaseon why PCRE is faster is because the POSIX standard demands to return the longest matching string which means POSIX checks all possible matches while PCRE simply returns the first valid match. In cases where there is no match both have to check all matches. The other thing is,

RE: [PHP] How to prevent duplicated values?

2004-01-28 Thread SLanger
Hello I think using UNIQUE is the way to go simply because of data integrety (= how do you spell this??? ; ) ) If you don't use UNIQUE and you are not write locking your table you might accidently get duplicate Values. UNIQUE is the only way to prevent duplicate data without a lot of hassle.

Re: [PHP] R: [PHP][PEAR] PEAR::DB_Common::nextId()

2004-01-16 Thread SLanger
Hello Not sure if you thought of it or if it even applies to you but when you use PEAR::DB::getOnce(SELECT LAST_INSERT_ID()); to retrieve the id do consider concurrent access to the database when using it for inserting stuff. Been there and its a hassle to resolve this little huge bug ; )

Re: [PHP] PHP IDE?

2003-12-15 Thread SLanger
Hello If you don't mind running a JVM you can use PHPEclipse with the Eclipse Framework. Additionally to the php plugin there are a lot of other plugins out there that can assist you. http://www.phpeclipse.org Regards Stefan Langer

Re: [PHP] Session Expiration Problem....

2003-12-04 Thread SLanger
Hello Have you considered breaking down your form into several smaller ones on seperate pages like a wizard? In each step you can save the entered data preventing it from being lost. In the end show the whole form with all data for verification by the user. Regards Stefan Langer

Re: [PHP] array problems

2003-11-28 Thread SLanger
$city = Ipswitch; $city_found = 0; $contentfile = fopen(content.txt, r); while (!feof($contentfile) $city_found == 0); { $my_line = fgets($contentfile, 16384); $content_array = explode(\t,$my_line); if ($content_array[0] == $city) { $city_found = 1;

[PHP] Re: Blessing an object

2003-11-27 Thread SLanger
Hello Just out of curiosity why do you need such a function? I'm no perl programmer and have very little knowledge of the language ... yet ; ) but the way you describe it it seems to me that you have a fundamentle design flaw in your script if you need to change types on the fly that are in

Re: [PHP] Intuitive Interfaces (was: Add Reply-To to this list(s))

2003-11-26 Thread SLanger
Hello Now that the discussion is coming around to be more on topic I have some stuff to add. First and most important: There is no such thing as INTUITIVE when it comes to interfaces. Every interface built for human machine interaction has to be learned by the human using it. So what we

Re: [PHP] intercepting URLs in a control-system

2003-10-17 Thread SLanger
Hello If you are using PHP as an Apachemodule you also have the option of using a url like http://example.com/index.php/test/test.html Apache will see that test.html is not available and will travel down the directory path til it gets to the index.php (which should exist BTW) and call that

Re: [PHP] 3 mins of your time please...logic problem

2003-09-25 Thread SLanger
A different approache for the captcha.. instead of using a blurred image use some text and than ask a question about the text like What does the 2nd word in the first line of the 4thparagraph say? Things to make sure: - Use enough texts so that guessing the correct word is not possible. - Use

[PHP] Antwort: Re: [PHP] 3 mins of your time please...logic problem

2003-09-25 Thread SLanger
I agree that an image captcha can not be cracked by a lot of people, allthough it has been done. (and it takes only one program being released to do the job : ) ) Somethings to keep in mind is that you should use passphrases made up of random letters and numbers preventing the automated system

RE: [PHP] How do I do this PERL in PHP?

2003-09-17 Thread SLanger
hello just a side note instead of ereg( '^$var(.*)$', $line, $matches ) use preg_match('/^'.$var.'(.*)$/', $line, $matches) since it is faster than ereg. Regards Stefan Langer

[PHP] Re: Problem sending HTML formated mail

2003-09-17 Thread SLanger
Hello Use a mail class to send your mail instead of mail. These classes have a lot of workarounds for mail() problems and are fairly easy to manage. I personally prefer phpmailer (http://phpmailer.sourceforge.net) but there are others. Just do a search through the archive for mail or mime

RE: [PHP] str_replace question

2003-09-10 Thread SLanger
preg_replace('/*\[a-z]+)[0-9]+(\)/', '$1$2', $String); Ok why not simply use reg_replace('/ques[0-9][0-9]/', '/ques/', $String); BTW preg regex are more powerfull since they support some stuff that the posix standard does not support. As far as I know lookbehinds and lookbacks and stuff like

Re: [PHP] adodb and php5

2003-09-09 Thread SLanger
Hello Did you compile mysql or any of the other databases into php5? As far as I know php5 does not come with mysql anymore because of some licence issues. So if you haven't compiled it yourself it shouldn't be available and hence not supported by adodb. Just a guess Regards Stefan Langer

[PHP] Re:[PHP] dynamical balancing text in two colums

2003-09-03 Thread SLanger
Hello Just asking why do you want to split at paragraphs? Couldn't you just simply look for a word boundary and then split the columns? You could exclude tags from the split meaning wordboundaries cannot be inside that way no breaking of tags. Since the result is checked by a human they can

Re: [PHP] Write RegExp-Vars in a function

2003-09-03 Thread SLanger
Hello Niels Use preg_replace_callback http://de.php.net/preg_replace_callback since it is faster than using the /e switch. Regards Stefan Langer

Re: [PHP] greedy preg

2003-08-14 Thread SLanger
preg_replace(|item.*?$file.*?/item|si,,$contents) news item titlefhh/title date1060205191/date texthhh/text filexml/news/1060205191.xml/file /item item titlefgjghjh/title date1060205186/date textfgjh/text filexml/news/1060205186.xml/file /item item

RE: [PHP] dev style guide

2003-08-14 Thread SLanger
Just a remark but isn't it pointless to use Hungariannotation in a language that is by default typeless??? Regards Stefan Langer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] arguments against moving site from Linux/Apache/PHP server toWindows/IIS/PHP needed

2003-07-24 Thread SLanger
Go with the costs. If you have a running system on apache + php + mysql see how much it costs to support that platform. Meaning how high are the costs to maintain it. Inclusive administration and deployment of apps. Then compare the costs of maintaining a IIS Windows PHP Mysql setup under the

[PHP] Antwort: RE: [PHP] Grabbing info from other Sites

2003-07-15 Thread SLanger
Hello Webservices is the use of SOAP over HTTP to bring a Service to the web. There are a lot more technologies involved like WSDL and UDDI but basically it is a way of providing the functionality of a programm/application to the web over a well defined interface. Since it is an additional

Re: [PHP] Grabbing info from other Sites

2003-07-14 Thread SLanger
Hello The only way I can imageine is using curl and doing standard post get requests. But this will put you at the mercy of the other dep. since a change in design may force a change in your logic. If you can, try to build a separate interface for your app which you can use to interface the

[PHP] Re: Regular Expression

2003-07-08 Thread SLanger
Hello If you simply want to check if the fields contains Po BOX simply use the stripos function or one of the other string functions. They should be faster than reg ex. If you still want to use reg ex I suggest using preg_match since it is faster than ereg. About your regex: It will not find

[PHP] Antwort: Re: [PHP] How can MD5 HAsh be passed to db as pwd? was a Re: [PHP] SecuringPHP code

2003-06-27 Thread SLanger
Set the column type of password to be a char(32). Then, pass the password through md5 to mysql to store it. To verify it, pass the password through md5 then compare it to what's in the database. This is true for your own authentication but I mean how to connect to the database using md5.

[PHP] Re: Securing PHP code

2003-06-26 Thread SLanger
One more thing, make sure the application is running on its own server meaning don't use a shared hosting enviroment that allows others to gain access to your directories. In this case even placing the file outside of docroot doesnot secure it in anyway since any other user can access it with

[PHP] How can MD5 HAsh be passed to db as pwd? was a Re: [PHP] Securing PHP code

2003-06-26 Thread SLanger
Hello Justin or Anybody else Store an MD5 of the password, that way you're comparing the two hashes, not two passwords... even if someone stumbles into your database, they'll only see the MD5'd password. A further step would be encryption, on which you will have to do a LOT of reading.

Re: [PHP] sessions and browser back[Scanned]

2003-06-26 Thread SLanger
As a suggestion can you simply redisplay your form on the error page and such avoid having to use the back button? This would also allow you to actually display the error at the place the error occurs. Another thing you might want to try is using a cache header that allows the browser to cache

RE: [PHP] calling functions in classes using text and graphic links

2003-06-25 Thread SLanger
Hello What you are asking isn't possible that way. You have to write a controller script that calls the appropriate functions on your object. Example: controller.php is the controller script A link on your page: a href=controller.php?action=someActionSome Action/a In controller.php you do

[PHP] Manners and Heritage

2003-06-24 Thread SLanger
Hello Everyone This is slightly off topic... so ignore or comment. Just wondering where does the term RTFM actually originate. And wouldn't it be better to say RTM or RTAM (thats Read the amazing Manual) since as a foreigner, that means non english native speaker, I can't see whats so f...ing

Re: [PHP] Write, Zip and Email

2003-06-24 Thread SLanger
I believe that there is a pure PHP class (does not rely on external programs) which allows you to work with zip archives. You can find it in the sources of phpMyAdmin its called zip.lib.php. It should be located in the libraries folder. Regards Stefan -- PHP General Mailing List

Re: [PHP] REGEX Question

2003-06-18 Thread SLanger
Hello Two things: First wouldn't it be faster to use strpos and substr if you simply have to find the literate !-- start_tag -- and !-- end_tag --. Second: If you use your regex and you have something like !-- start_tag -- This is some text to grasp!-- end_tag -- this is text I don't want !--

Re: [PHP] functions, opinion...

2003-06-17 Thread SLanger
Depends on the use of the function. (Output functions should produce output shouldn't they?!) Best option probably is to specifiy an argument that allows to choose wether to output or to return. If you return text you should return by reference to prevent unnecessary memory consumption.

Re: [PHP] PHP vs. jsp, advice please

2003-06-10 Thread SLanger
Hello Well here is my opinion on the two. I think it is a lot easier to get an app ready and running with PHP (especially database driven) than it is with JSP. The memory footprint of PHP is a lot lower than with JSP. Alone the JVM that needs to be loaded requires lots of resources. Also

Re: [PHP] Using register_globals

2003-06-05 Thread SLanger
One thing that hasn't been mentioned explicitly about register_globals turned to off is the readablity of the code and thus the reuse of code. When you use GET, POST, etc... everybody reading your script knows exactly where the data is coming from and can make a fairly good assumption to its

[PHP] RE: Cookie security

2003-06-03 Thread SLanger
[snip] Can I trust every browser to check for old cookies on startup and eliminate them? And still, even if I can, wouldn't the cookie be intact to read on the harddrive until the browser is started again? I was thinking about slicing the username and password strings in two, and storing the

[PHP] Re:[PHP] Chill out

2003-04-03 Thread SLanger
First of all I comply with all my previouse poster. For all the readers of this list I'd suggest to read the following article: How to ask questions the smart way at http://www.catb.org/%7Eesr/faqs/smart-questions.html It's an instruction booklet on how to ask questions on lists like this.

[PHP] RE: xml parse error?

2003-04-03 Thread SLanger
I might be mistaken but what you are getting is the normalized whitespaces inbetween your nodes, which is considered to be their content. Example: ... test test2/ /test Will return the following dom: test | --- / |

[PHP] Re: [Newbie] Password()

2003-03-31 Thread SLanger
Hello First of all NO there is no way of reversing the MySQL password function since it is a hash not an encryption. I think the real problem lies in your concern for security. Why hash the password or encrypt it in a database when you are sending it over the internet per email? A better way

Re: [PHP] Re: XML+XSLT or Smarty again??

2003-03-31 Thread SLanger
Hello Ok can't refrain from giving my opinion to this one. First of all I think separating presentation from business logic can be achived fairly simple with SMARTY and if your template code acutally contains business logic than you have not understood the concept of the template engine. The

Re: [PHP] Checkbox

2003-03-28 Thread SLanger
Hello From a usability standpoint showing a checkbox that cannot be unchecked renders the checkbox obsolete. The consquence is not to show a checkbox at all. If you need an uncheckable checkbox because of licence aggreements or something like that. Or privacydeclaration type checkbox. Make it

[PHP] open_basedir not expanding properly into subdirectories

2003-03-12 Thread SLanger
Hello Everyone I'm running PHP 4.1.2 (no I can't upgrade at the moment) and I'm running into a problem with open_basedir. The way I understand the open_basedir directive it allows only file access to the directory mentioned and its subdirectories. In my setting I have a directory setting in

[PHP] ICQ # validation

2003-03-04 Thread SLanger
if(ereg(^[0-9]{7,9}$, $_REQUEST[icqnumber])) { print(a-okay!); } else { print(error msg); } Although I'm not too familiar with regexp I'd say the code validates because the icq number you are providing actually confimrs to the pattern. The first seven to nine digits contain only

[PHP] Backticks and echo

2003-02-19 Thread SLanger
Hello everyone I reread the manual again on the topic of backticks and from that I have security / usabilitiy issue. Here is the issue: When I check formdata from a simple form I use regular expression to make sure the input confirms to certain guidlines before including them into my

Re: [PHP] when is OOP a good choice?

2003-02-13 Thread SLanger
Hello There isn't an easy answer to this but I guess the most important thing being that it is easier to maintain in big projects and this makes it more robust since you can test in a more modular way. Also it makes it easier to reuse code also this seems to be one of those urban legends. At

[PHP] Re: crypt()

2003-02-13 Thread SLanger
Hello 'salt' basically is the initialization sequence for the encryption. This makes the function use more random numbers since the salt will be different on different calls. At least it should be So in order for your crypt() to work you have to pass the same salt to both functions. To

Re: [PHP] Introduction

2003-02-01 Thread SLanger
Hello Julie Have you checked what is passed in your post / get request??? A Simple way of doing this is using a script similar to this one ?PHP while(list($key, $value) = each($_POST)) // use $_GET for get request { echo 'br'.$key.'='.$value; // this prints to

[PHP] Exclusion in Regex not working

2003-01-31 Thread SLanger
Hello Everyone This might be slightly offtopic since I'm not sure its php related but I'm working on a script where some inputdata is taken for further processing. For validation purposes I want to make sure certain chars are not part of the input. Basically stuff like $ * :; etc... So

[PHP] Re: domxml memberfunction not dom compliant??

2003-01-29 Thread SLanger
Hello As far as I rememeber according to DOM Level 2 Elementnodes contain Attributenodes but the Attributenode has no association with its Elementnode meaning you can't tell from an Attributenode which Elementnode it belongs to unless you remember it in your code. Thus an Attributenode is not

[PHP] Check for start_sessoin without causing header problems

2003-01-18 Thread SLanger
Hello I checked the PHP manual and couldn't find anything on this... When I call session_register() an implicit call to session_start() is executed. So if the session handling uses cookies to track the session and the call to session_register() is not before any output this will cause a

[PHP] All Request to the same script

2003-01-15 Thread SLanger
Hello Is it possible to send all incoming requests to the same script within PHP? In other words: How can I get http://mysite/script.php to point to the same script as http://mysite/anotherscript.php ? And is it possible to do send a request like http://mysite/someextrapathinfo to the same

Re: Re: [PHP] All Request to the same script

2003-01-15 Thread SLanger
Hello First of all thanks for the suggestion. I thought something along these lines. The disadvantage to this approach in my opinion is that I have to include the controller in all pages and it is therefor not possible to integrate pages which I do not control without breaking the concept of