[PHP] manual : Call-time pass-by-reference has been deprecated
Hi, If Call-time pass-by-reference has deprecated so long ago, why are the instructions on how to do it still in the manual? http://www.php.net/manual/en/html/functions.arguments.html#functions.arguments.by-reference At least it should point out that it has been deprecated. Bruce _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- 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] PHP-JavaScript
Hi, A little trick I did to get the text from a textbox in a form ( for user comments ) without the user having to submit it was to use javascript to append the textbox contents to a url ( GET METHOD ) when the user clicked on a link, which pointed to a redirect script which extracted the textbox contents then redirected the user to the link requested. Hopefull this will give you some ideas. [page.html] script LANGUAGE=JavaScript !-- function modifyurl (theurl,textvar,thepagename) { // do validation here on textvar, textvalue, etc. then proceed with: theurl.href=redirect_script.php?requestedpage= + thepagename + textvalue= + escape(textvar); } // -- /script form name=thetextform onSubmit=return false; input type=text name=textvariable size=30 maxlength=45 /form a href=/another_page.html onClick=modifyurl(this, thetextform.textvariable.value, 'another_page') [redirect_script.php] ...and here on the redirect page I would do validation of the variables/form_contents etc., insert it into a db, and then redirect: ? switch ($requestedpage) { case another_page: Header(Location: http://www.site.com/path/to/another_page.html;); //Redirect browser break; case ... } Cheers, Bruce _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- 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] replace nested custom html tags
Hi, Anyone have any ideas on how I could modify the following to work on nested tags? The regex replaces custom tags [i] [u] [b] with real tags. The Regex takes any of the characters in the class \[([ubi])\] then non greedily matches any character (.*?) then matches the result of the first reference from the character class \[\/(\\1)\]/ . It then replaces the [u]stuff[/u] to ustuff/u etc. Everthing works fine, except when the tags are nested. I'm actually suprised that you can use a reference ( eg: \\1 ) in the pattern and not only in the replacement. There does not seam to be any mention of that anywhere. The use of references in the pattern does not appear to be related in any way the the problem. echo preg_replace (/\[([ubi])\](.*?)\[\/(\\1)\]/msi,\\1\\2/\\1, [b] [u] underlined and bold [/u] [/b] [i] italic [/i]); The output:( it doesn't replace the nested [u] [/u] ): b [u] underlined and bold [/u] /b i italics /i Thanks, Bruce _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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] preg_replace() substrings NOT IN tags
Hi, I'm trying to figure out a regex that would match substrings in a string that are NOT inside tags. In the example below I try to replace the substring 'paris' with a href=\http://www.somehost.com;paris/a but it also matches 'paris' in the image name. * this does not work: $url = http://www.somehost.com;; $needle = paris; $haystack = img src=\/images/3_im_paris_tower.jpg\ paris trip; $regex=($needle).*?[^]; echo preg_replace (/$regex/, a href=\$url\\\1/a ,$haystack); An even simpler example of what I am trying to do is as follows: Match 'a' in the following string if it is followed by ( zero or more of *any* character, then NOT a '' ) * this does not work ( using regex ASSERTIONS ) * it matches the 'a' before the '' ... which I don't want ) $haystack = adbc|abc ; $regex=(a(?=.*?)(?!)); Thanks in advance for your help, Bruce _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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]