Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Yes, I know it looks like a bug in my code because I'm not able to write a test case that can reproduce it simply enough to report as a bug - hence why I am posting here. However, the behaviour I am describing surely suggests some kind of issue somewhere in PHP itself. My reasoning for this

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Robert Cummings
On Mon, 2007-01-22 at 16:36 +, David Mytton wrote: Yes, I know it looks like a bug in my code because I'm not able to write a test case that can reproduce it simply enough to report as a bug - hence why I am posting here. However, the behaviour I am describing surely suggests some kind

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
I added this in and it outputs 1 as I suspected - the function is being called only once. David Robert Cummings wrote: On Mon, 2007-01-22 at 16:36 +, David Mytton wrote: Yes, I know it looks like a bug in my code because I'm not able to write a test case that can reproduce it simply

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Roman Neuhauser
suggest that it is being executed multiple times, however, the back trace only reveals 1 call/execution. Not suprprising. This code outputs #0 f(1) called at [/usr/home/roman/tmp/scratch30:8] #0 f(2) called at [/usr/home/roman/tmp/scratch30:8] ?php function f($i) { debug_print_backtrace

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Jim Lucas
David Mytton wrote: Hi, I have come across what appears to be a bug in PHP, but one that I am having difficulty writing test code for. Also, the bug only happens on a Linux build of PHP - the code is working as expected on Windows. This is on both PHP 5.2.0 and the very latest snapshots:

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
At the very bottom of your function place another return with a string like return 'FOUND THE END OF FUNCTION'; now, echo the return of the function and see if it really the return function that you think it is that is returning false, or you are just hitting the end of the function. Jim

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-22 17:45:23 +: However, it seems this is actually being caused by some weirdness with mod_rewrite. Basically, if I use the rewritten URL e.g. example.com/section/addfriend/will/ which rewrites to index.php?cmd=section/addfriendusername=will I get this

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Roman Neuhauser wrote: Can we see your mod_rewrite configuration? RewriteCond, RewriteRule, all that jazz. There are a number of rules but the only one that is relevant for this page is: RewriteRule ^section/addfriend(/)?(.*)$ index.php?cmd=section/addfriendusername=$2 David -- PHP

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-22 18:48:27 +: Roman Neuhauser wrote: Can we see your mod_rewrite configuration? RewriteCond, RewriteRule, all that jazz. There are a number of rules but the only one that is relevant for this page is: RewriteRule ^section/addfriend(/)?(.*)$

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Roman Neuhauser wrote: Ok, what does RewriteLog contain for one such request? RewriteLogLevel 9. http://paste.lisp.org/display/35779 David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-22 19:28:29 +: Roman Neuhauser wrote: Ok, what does RewriteLog contain for one such request? RewriteLogLevel 9. http://paste.lisp.org/display/35779 As you can see, the processing doesn't stop when it hits the RewriteRule you thought was the only relevant

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-22 20:45:42 +: # [EMAIL PROTECTED] / 2007-01-22 19:28:29 +: Roman Neuhauser wrote: Ok, what does RewriteLog contain for one such request? RewriteLogLevel 9. http://paste.lisp.org/display/35779 As you can see, the processing doesn't stop when it

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Roman Neuhauser wrote: Bzzzt, I'm an idiot. It doesn't, of course. You're still missing [L] and that's what I was trying to point you at until the cat ran over my keyboard... Alright. So if the rewrite rules were (and they are): RewriteRule ^section/account(/)?$

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-22 19:56:58 +: Roman Neuhauser wrote: Bzzzt, I'm an idiot. It doesn't, of course. You're still missing [L] and that's what I was trying to point you at until the cat ran over my keyboard... Alright. So if the rewrite rules were (and they are):

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Roman Neuhauser wrote: append [L,NS] to all RewriteRules Done that, but the problem is still there - doesn't seem to have made any difference. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-22 21:17:04 +: Roman Neuhauser wrote: append [L,NS] to all RewriteRules Done that, but the problem is still there - doesn't seem to have made any difference. Can I see the rewrite log for a single request now? Please make sure it's only one request. --

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Roman Neuhauser wrote: Can I see the rewrite log for a single request now? Please make sure it's only one request. http://paste.lisp.org/display/35791 David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-22 22:03:30 +: Roman Neuhauser wrote: Can I see the rewrite log for a single request now? Please make sure it's only one request. http://paste.lisp.org/display/35791 Are you sure you added the NS flag? It looks like the RewriteRules are applied to the

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Jochem Maas
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-22 22:03:30 +: Roman Neuhauser wrote: Can I see the rewrite log for a single request now? Please make sure it's only one request. http://paste.lisp.org/display/35791 Are you sure you added the NS flag? It looks like the RewriteRules

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Robert Cummings
On Tue, 2007-01-23 at 02:43 +0100, Jochem Maas wrote: there is no way in hell that [a released version of] php is so borked that it's capable returning a value from a function and then going on to running code that occurs in the function after the return statement that returned the value.

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Jochem Maas
Robert Cummings wrote: On Tue, 2007-01-23 at 02:43 +0100, Jochem Maas wrote: there is no way in hell that [a released version of] php is so borked that it's capable returning a value from a function and then going on to running code that occurs in the function after the return statement

Re: [PHP] Function returning but continues execution

2007-01-22 Thread Robert Cummings
On Tue, 2007-01-23 at 03:01 +0100, Jochem Maas wrote: Robert Cummings wrote: On Tue, 2007-01-23 at 02:43 +0100, Jochem Maas wrote: there is no way in hell that [a released version of] php is so borked that it's capable returning a value from a function and then going on to running code

Re: [PHP] Function Misbehaving

2006-11-23 Thread Jochem Maas
Beginners beware ... small, potential head-fryer coming up... Richard Lynch wrote: I personally would use is_null($url) to test if it was NULL. isset() is not the weapon of choice for that, imho... No idea if that will fix it as I've never tried to use isset() to test for NULL and have no

[PHP] Function Misbehaving

2006-11-15 Thread Programmer
The following function is a basic user auth prep procedure for multiple pages. If the url desired is different than the default a url is supplied. This function works most of the time flawlessly; except, on some pages when the url has a value that was passed, the function still thinks url is

RE: [PHP] Function Misbehaving

2006-11-15 Thread Programmer
is happing inside the php code? Thanks, Jeremy Schreckhise M.B.A. -Original Message- From: Programmer [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 15, 2006 10:53 AM To: php-general@lists.php.net; 'Brandon Stewart' Subject: [PHP] Function Misbehaving The following function is a basic

Re: [PHP] Function Misbehaving

2006-11-15 Thread Tom Chubb
not that it has been redirected and only what is happing inside the php code? Thanks, Jeremy Schreckhise M.B.A. -Original Message- From: Programmer [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 15, 2006 10:53 AM To: php-general@lists.php.net; 'Brandon Stewart' Subject: [PHP

[PHP] php function like javas setTimeout??

2006-11-14 Thread brian debottari (sin7)
I have a site that does the following: You fill out a form with client info, click process, it moves to another page that calls a few php functions i wrote (sending client welcome email, adding client details to database and a few other things). What I want the page to do is delay some of

Re: [PHP] php function like javas setTimeout??

2006-11-14 Thread Jochem Maas
brian debottari (sin7) wrote: I have a site that does the following: You fill out a form with client info, click process, it moves to another page that calls a few php functions i wrote (sending client welcome email, adding client details to database and a few other things). What I want the

Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-13 Thread BBC
BBC wrote: What types of images are these? JPG, PNG, GIF? Its jpg. Look... I don't know exactly what your point, I'm just asking you about the function to resolve the size of image like the codes below: if (file_exists($img_path)){ list($width,$height) = getimagesizes($img_path); }else{

Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-11 Thread BBC
BBC wrote: Hi all. I'm having a problem regarding image handling. Sometimes an image can be showed in browser normally (in my computer) but when I upload it into my site that image is not valid, so there is an issue in my getimagesizes() function. Is there any function to recover

Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-11 Thread BBC
At 12:49 AM -0700 9/10/06, BBC wrote: Hi all. I'm having a problem regarding image handling. Sometimes an image can be showed in browser normally (in my computer) but when I upload it into my site that image is not valid, so there is an issue in my getimagesizes() function. Is there any

Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-11 Thread tedd
At 11:40 PM -0700 9/10/06, BBC wrote: At 12:49 AM -0700 9/10/06, BBC wrote: Hi all. I'm having a problem regarding image handling. Sometimes an image can be showed in browser normally (in my computer) but when I upload it into my site that image is not valid, so there is an issue in my

Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-11 Thread Christopher Weldon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 BBC wrote: BBC wrote: Hi all. I'm having a problem regarding image handling. Sometimes an image can be showed in browser normally (in my computer) but when I upload it into my site that image is not valid, so there is an issue in my

Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-11 Thread BBC
What types of images are these? JPG, PNG, GIF? Its jpg. Look... I don't know exactly what your point, I'm just asking you about the function to resolve the size of image like the codes below: if (file_exists($img_path)){ list($width,$height) = getimagesizes($img_path); }else{ $width = $ height =

Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-11 Thread Christopher Weldon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 BBC wrote: What types of images are these? JPG, PNG, GIF? Its jpg. Look... I don't know exactly what your point, I'm just asking you about the function to resolve the size of image like the codes below: if (file_exists($img_path)){

[PHP] FUNCTION TO CHECK IMAGE

2006-09-10 Thread BBC
Hi all. I'm having a problem regarding image handling. Sometimes an image can be showed in browser normally (in my computer) but when I upload it into my site that image is not valid, so there is an issue in my getimagesizes() function. Is there any function to recover such problem? I used

Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-10 Thread tedd
At 12:49 AM -0700 9/10/06, BBC wrote: Hi all. I'm having a problem regarding image handling. Sometimes an image can be showed in browser normally (in my computer) but when I upload it into my site that image is not valid, so there is an issue in my getimagesizes() function. Is there any

Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-10 Thread Christopher Weldon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 BBC wrote: Hi all. I'm having a problem regarding image handling. Sometimes an image can be showed in browser normally (in my computer) but when I upload it into my site that image is not valid, so there is an issue in my getimagesizes()

[PHP] function does not exist

2006-08-25 Thread Chris Boget
I'm getting the following error all throughout my PHP log: [warning] [Unknown][0]: Unknown(): Unable to call () - function does not exist I'm not sure it's going to survive the mailing but it appears to be a tab character after the 'call' and before the '()'. I've spent days (not

Re: [PHP] function does not exist

2006-08-25 Thread Robert Cummings
On Fri, 2006-08-25 at 11:43 -0400, Chris Boget wrote: I'm getting the following error all throughout my PHP log: [warning] [Unknown][0]: Unknown(): Unable to call () - function does not exist I'm not sure it's going to survive the mailing but it appears to be a tab character after the

Re: [PHP] function does not exist

2006-08-25 Thread Steve Edberg
At 11:43 AM -0400 8/25/06, Chris Boget wrote: I'm getting the following error all throughout my PHP log: [warning] [Unknown][0]: Unknown(): Unable to call () - function does not exist I'm not sure it's going to survive the mailing but it appears to be a tab character after the 'call' and

Re: [PHP] Php function to Set focus On A form Field

2006-04-26 Thread Joe Wollard
PHP can't do that for you but Javascript can. Here's roughly 3 million (no joke) examples of what you'd like to accomplish: http://www.google.com/search?q=javascript+focus+first+input On 4/26/06, marvin hunkin [EMAIL PROTECTED] wrote: Hi. is there any php or java script function, where i can

[PHP] Re: Php function to Set focus On A form Field

2006-04-26 Thread Philipp Kopf
marvin hunkin schrieb: Hi. is there any php or java script function, where i can embed into my php or html file, to set focus on to the first form field, like a text box, to go to that field first, and not to go to the link or button first. if there are any tips, tricks, or links or code

RE: [PHP] Re: Php function to Set focus On A form Field

2006-04-26 Thread Ing. Edwin Cruz
PROTECTED] Enviado el: Miércoles, 26 de Abril de 2006 01:42 a.m. Para: php-general@lists.php.net Asunto: [PHP] Re: Php function to Set focus On A form Field marvin hunkin schrieb: Hi. is there any php or java script function, where i can embed into my php or html file, to set focus

[PHP] Php function to Set focus On A form Field

2006-04-25 Thread marvin hunkin
Hi. is there any php or java script function, where i can embed into my php or html file, to set focus on to the first form field, like a text box, to go to that field first, and not to go to the link or button first. if there are any tips, tricks, or links or code examples, how to fix this

Re: [PHP] function by reference

2006-04-11 Thread tedd
, what I don't get is this: ?php $a = 10; echo($a br/); ref1($a); echo($a br/); $a = 10; echo($a br/); ref2($a); echo($a br/); $a = 10; echo($a br/); ref3($a); echo($a br/); ? ?php function ref1

Re: [PHP] function by reference

2006-04-11 Thread Martin Alterisio
The ampersand before the function name indicates that the function returns a reference instead of a copy of the variable, for example: ?php function max($var1, $var2) { if ($var1 $var2) return $var1; else return $var2; } $global1 = 10; $global2 = 9; $maxglobal = max($global1

Re: [PHP] function by reference

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 10:42 am, tedd wrote: ?php function ref3($a) { $a--; } ? I believe this one will only matter if you are RETURNING a value. And only really matter if that value is an object... -- Like Music? http://l-i-e.com

Re: [PHP] function by reference

2006-04-11 Thread tedd
The ampersand before the function name indicates that the function returns a reference instead of a copy of the variable, for example: ?php function max($var1, $var2) { if ($var1 $var2) return $var1; else return $var2; } $global1 = 10; $global2 = 9; $maxglobal = max($global1

Re: [PHP] function by reference

2006-04-11 Thread Chris
tedd wrote: The ampersand before the function name indicates that the function returns a reference instead of a copy of the variable, for example: ?php function max($var1, $var2) { if ($var1 $var2) return $var1; else return $var2; } $global1 = 10; $global2 = 9; $maxglobal

Re: [PHP] function by reference

2006-04-11 Thread Martin Alterisio \El Hombre Gris\
(the Zend engine) handles its internal, you shouldn't rely on this in your code. http://www.zend.com/zend/art/ref-count.php tedd wrote: The ampersand before the function name indicates that the function returns a reference instead of a copy of the variable, for example: ?php function max

Re: [PHP] function by reference

2006-04-11 Thread Robert Cummings
On Tue, 2006-04-11 at 23:15, Martin Alterisio El Hombre Gris wrote: Well, it was a bad example to begin with, first of all max() is already defined in php, I should at least checked that before posting. Second, I forgot PHP (the Zend engine) has an interesting way of handling variables,

Re: [PHP] function by reference

2006-04-10 Thread tedd
It's the same thing for the most part... ?php $a = 'f_a'; call_user_func( $a, $p1, $p2, $p3 ) ? Cheers, Rob. Rob: No way dude -- that was too easy! Boy, am I in love with this language -- it gives you plenty of shovels to dig yourself in as deep as you want. Thanks Rob. tedd --

Re: [PHP] function by reference

2006-04-10 Thread Robert Cummings
and it will invoke the function matching the variable's value. Some of this stuff can be really useful for doing backwards compatibility with older versions of PHP: ?php function my_slowass_ctype_alpha( $chars ) { return eregi( '^[[:alpha:]]+$, $chars ); } if( function_exists( 'ctype_alpha

Re: [PHP] function by reference

2006-04-10 Thread tedd
Boy, am I in love with this language -- it gives you plenty of shovels to dig yourself in as deep as you want. *lol*. personally I prefer the other format which was what I tried to illustrate with my original example: Oh, you illustrated it very well. I looked intently at it and learned

Re: [PHP] function by reference

2006-04-10 Thread Richard Lynch
?php function foo { echo Hi;} $bar = 'foo'; $bar(); ? On Sun, April 9, 2006 1:17 pm, tedd wrote: Hi gang: Not that I have an immediate need for this, but in other languages one can access a function by reference (in other words, it's address -- such as call(function address) ). In php, one

Re: [PHP] function by reference

2006-04-10 Thread Ray Hauge
: $a = f_a(); And then, where I could use call_user_func($a); (or something similar) and the function would do it's thing -- anything like that? Thanks tedd --- Rob's suggestion follows. Like the following? ?php function f_a() { echo 'a'; } function f_b

Re: [PHP] function by reference

2006-04-10 Thread Ray Hauge
I believe you're thinking more of the C++ style of returning by reference. This article should help explain how references work, and how to return references... most specifically check the Returning References section. http://www.php.net/manual/en/language.references.php HTH -- Ray Hauge

[PHP] function by reference

2006-04-09 Thread tedd
it's thing -- anything like that? Thanks tedd --- Rob's suggestion follows. Like the following? ?php function f_a() { echo 'a'; } function f_b() { echo 'b'; } function f_c() { echo 'c'; } $map = array ( 'a' = 'f_a', 'b' = 'f_b', 'c' = 'f_c', ); $map['a'](); $map['b

Re: [PHP] function by reference

2006-04-09 Thread Robert Cummings
On Sun, 2006-04-09 at 14:17, tedd wrote: Hi gang: Not that I have an immediate need for this, but in other languages one can access a function by reference (in other words, it's address -- such as call(function address) ). In php, one can pass a variable by reference by simply using the

Re: [PHP] GD Library or PHP Function

2006-03-24 Thread tedd
On Wed, March 22, 2006 9:18 pm, brian dichiara wrote: Is there a way to check to see if a JPEG or PDF is color or black/white? Like a function or something? There does not appear to be a built-in function that does that... I don't know of any either, but that's the reason when I put an

[PHP] GD Library or PHP Function

2006-03-23 Thread brian dichiara
Is there a way to check to see if a JPEG or PDF is color or black/white? Like a function or something? Thanks for any help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] GD Library or PHP Function

2006-03-23 Thread Richard Lynch
On Wed, March 22, 2006 9:18 pm, brian dichiara wrote: Is there a way to check to see if a JPEG or PDF is color or black/white? Like a function or something? There does not appear to be a built-in function that does that... However, this hack should work: function image_is_color($image){

[PHP] Function-returning array { OR } declare array at top of functions file?

2006-03-21 Thread Michael Hulse
Hi, I just wanted to know if it is wrong, or non-standard, for me to set-up functions that just return an array... example: function vert_links_array(): function vert_links_array() { return array( '1' = array(S_MANCOM,'start.php?page=productsamp;

Re: [PHP] Function-returning array { OR } declare array at top of functions file?

2006-03-21 Thread Michael Hulse
On Mar 21, 2006, at 2:35 PM, Michael Hulse wrote: Any suggestions? I am a self-taught php dude, so please don't laugh if this is a silly question. You know, the more I think about, the more I think I need to learn about PHP classes... Seems like I would just be able to define the array from

Re: [PHP] Function-returning array { OR } declare array at top of functions file?

2006-03-21 Thread Michael Hulse
On Mar 21, 2006, at 3:48 PM, Michael Hulse wrote: ... any good links for learning more about classes? This seems like a good tutorial to start with: http://www.phpfreaks.com/tutorials/48/0.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Onclick event and PHP function

2006-02-15 Thread Alain Roger
Hi, I have some link on which if user click, should do the following things: - open a particular page - setup to sessions some particular variable value however, PHP function should be declared before HTML headers. so i was thinking about something like that ?php function vardef($lg

Re: [PHP] Onclick event and PHP function

2006-02-15 Thread Richard Collyer
Hello, Your getting confused between server side and client side. PHP CANNOT be run on the client side which is what Javascript is. In this case all you are doing is calling that php function twice one for eng and once for fre. Instead try using mydomain.com/setlang?=eng as a link which calls

Re: [PHP] Onclick event and PHP function

2006-02-15 Thread Gerry Danen
] wrote: Hi, I have some link on which if user click, should do the following things: - open a particular page - setup to sessions some particular variable value however, PHP function should be declared before HTML headers. so i was thinking about something like that ?php function

Re: [PHP] Onclick event and PHP function

2006-02-15 Thread tedd
Alain, have you tried cookies? On http://www.lily-gallery.com/ you will see 2 colored dots (bottom left) that allows for alternate page colors. Once a user chooses one, I remember his choice with a cookie. I use the cookie to control a style sheet. Gerry I didn't realize that he was wanting

Re: [PHP] Onclick event and PHP function

2006-02-15 Thread Gerry Danen
Pretty much the same technique I am using, tedd. I may have even used your example as inspiration... :) At the top of each page, I use $currentstylecolor = isset( $_COOKIE['currentstyle'] ) ? $_COOKIE['currentstyle'] : brown; // brown = default style $currentstyle = /skins/style_ .

[PHP] PHP function called by onclick

2006-02-12 Thread Alain Roger
Hi, I have a link in my web page and when user click on this link, i would like to execute a PHP function with a parameter. how can i do it ? ex : ?php function lang($language) { $lg = $language; } ? ... A href=?php lang(eng);?test/A but this does not work :-( thanks for help. Alain

Re: [PHP] PHP function called by onclick

2006-02-12 Thread Chris Shiflett
Alain Roger wrote: I have a link in my web page and when user click on this link, i would like to execute a PHP function with a parameter. You'll need to initiate a new request. Browsers don't execute PHP code. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com

Re: [PHP] PHP function called by onclick

2006-02-12 Thread Paul Novitski
At 11:46 AM 2/12/2006, Alain Roger wrote: I have a link in my web page and when user click on this link, i would like to execute a PHP function with a parameter. how can i do it ? If you're using PHP in the usual way as a server-side script, it doesn't run in the same time-frame as user

[PHP] function preg_match()

2006-01-25 Thread Denyl Meneses Guillén
When I try to use preg_match(), I get this... Fatal error: Call to undefined function preg_match() in /usr/home/www/library/defines.php on line 25 I have php5.0.4 ,web server Apache (Linux) . as I can solve it? Thanks, Denyl. -- This message has been scanned for viruses and dangerous

Re: [PHP] function preg_match()

2006-01-25 Thread Denyl Meneses Guillén
[EMAIL PROTECTED] To: Denyl Meneses Guillén [EMAIL PROTECTED]; php-general@lists.php.net Sent: Wednesday, January 25, 2006 7:56 AM Subject: RE: [PHP] function preg_match() [snip] When I try to use preg_match(), I get this... Fatal error: Call to undefined function preg_match() in /usr/home/www

Re: [PHP] function preg_match()

2006-01-25 Thread David Grant
Denyl, You need to call the person responsible for maintaining your box. Denyl Meneses Guillén wrote: sorry , what is PCRE ? Regular Expression Functions (Perl-Compatible) I looking my configuration with phpinfo() and not exist PCRE or similar . That's because someone disabled it in the

Re: [PHP] function preg_match()

2006-01-25 Thread John Nichel
, Denyl. - Original Message - From: Melanie Maddix [EMAIL PROTECTED] To: Denyl Meneses Guillén [EMAIL PROTECTED]; php-general@lists.php.net Sent: Wednesday, January 25, 2006 7:56 AM Subject: RE: [PHP] function preg_match() [snip] When I try to use preg_match(), I get this... Fatal error

Re: [PHP] function preg_match()

2006-01-25 Thread Richard Correia
Hey Denyl, Simple workaround ... you can use ereg_replace insted of preg_replace http://www.weberdev.com/get_example.php3?Function=ereg-replace You can sort out your PCRE installation/configuration later. Thanks, Richard On 1/26/06, Denyl Meneses Guillén [EMAIL PROTECTED] wrote: When I try

Re: [PHP] function preg_match()

2006-01-25 Thread Denyl Meneses Guillén
now already I can see the light thanks for your help, Denyl. - Original Message - From: John Nichel [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Wednesday, January 25, 2006 8:30 AM Subject: Re: [PHP] function preg_match() Denyl Meneses Guillén wrote: sorry , what

Re: [PHP] Function Overloading

2005-12-18 Thread Labunski
Thank you very much. This is exactly what I wanted to do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Function Overloading

2005-12-18 Thread David Tulloh
PHP doesn't natively support function redefining. Functions with variable length arguments are a different ballgame in PHP. Have a look at func_num_args[1] and the other functions in the Function handling section of the manual. 1: http://php.net/func_num_args Labunski wrote: PHP does not

[PHP] Function Overloading

2005-12-17 Thread Labunski
PHP does not support function overloading. So, is there any other way of getting a number of parameters(variables) passed to a function? aka. function fruits($apple, $banana, $kiwi, $grape){ #should (somehow) output 4 } OK. if it was an array, than I could use count($array), but now I'm

Re: [PHP] Function Overloading

2005-12-17 Thread tg-php
If all you want to do is pass an unknown number of arguments to a function, this looks like it demonstrates what you're doing: ?php function foo() { $numargs = func_num_args(); echo Number of arguments: $numargs\n; } foo(1, 2, 3);// Prints 'Number of arguments: 3' ? Found

Re: [PHP] Function that convert national characters into ASCII

2005-10-24 Thread Robin Vickery
On 10/19/05, Wiktor [EMAIL PROTECTED] wrote: Hi, Is there a function that will convert any european special characters into standard ASCII letters eg. polish ogonki into a,e,o or german umlauts into ue,oe...? The recode functions are probably your best bet:

[PHP] function 'another_mail' with authentication

2005-10-24 Thread Etienne Finet
Can anyone give me a clue on how to change this script so it can be used with basic SMTP authentication? TNX, Etienne ? function another_mail($to,$subject,$headers,$message) { // Could get this from the php ini? $from=[EMAIL PROTECTED]; list($me,$mydomain) = split(@,$from); // Now look up the

[PHP] function to compare ip addr to a ip range

2005-10-13 Thread Bosky, Dave
Does anyone have a function that will check if an ip address falls with a starting/ending ip address range Thanks, Dave ** HTC Disclaimer: The information contained in this message may be privileged and confidential

Re: [PHP] function to compare ip addr to a ip range

2005-10-13 Thread Greg Donald
On 10/13/05, Bosky, Dave [EMAIL PROTECTED] wrote: Does anyone have a function that will check if an ip address falls with a starting/ending ip address range #!/usr/bin/php ?php $ip = '10.0.0.1'; $ip2 = '10.0.0.2'; $ip3 = '10.0.0.3'; $ip = abs( ip2long( $ip ) ); $ip2 = abs( ip2long( $ip2 ) );

Re: [PHP] function to compare ip addr to a ip range

2005-10-13 Thread tg-php
You could try converting to long IP addresses and comparing that way: ?php // To actually get the long IP address that you can use in http:// // you sometimes need to use something like printf(%u\n, ip2long($ip)); // See also: http://us3.php.net/manual/en/function.ip2long.php $startip =

Re: [PHP] function to compare ip addr to a ip range

2005-10-13 Thread Richard Lynch
On Thu, October 13, 2005 9:26 am, Bosky, Dave wrote: Does anyone have a function that will check if an ip address falls with a starting/ending ip address range If you are using PostgreSQL, it has a built-in IP address data type which almost for sure does this. :-) Maybe what you want to do is

Re: [PHP] onChange js running a php function

2005-10-12 Thread Richard Lynch
selection in a select menu, that would send the value for the select menu to a php function. can that be done? Yes, but... You can do it with XmlHttpRequest, or even just changing your location in JavaScript. But... A) This doesn't really make any difference to the PHP code -- It's all in the JS

[PHP] onChange js running a php function

2005-10-11 Thread Dan McCullough
for the select menu to a php function. can that be done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] onChange js running a php function

2005-10-11 Thread tg-php
event run when I change my selection in a select menu, that would send the value for the select menu to a php function. can that be done? ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com

Re: [PHP] onChange js running a php function

2005-10-11 Thread Brent Baisley
change my selection in a select menu, that would send the value for the select menu to a php function. can that be done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search

[PHP] function not returning anything via return$

2005-10-01 Thread nalopaleaahu
The transformation is not returning anything new, just the comment segment as it was before sending it to rdfpic2html. I am trying to modify http://www.ozhiker.com/electronics/pjmt/ PJMT's JPEG.php to transform http://jigsaw.w3.org/rdfpic/ rdfpic xml in the comment segment of jpegs and return

Re: [PHP] function not returning anything via return$

2005-10-01 Thread Jasper Bryant-Greene
[EMAIL PROTECTED] wrote: rdfpic2html( $rdfpicdata ); Shouldn't that be: $rdfpicdata = rdfpic2html( $rdfpicdata ); Since you haven't defined rdfpic2html as receiving its argument by reference... -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/ --

Re: [PHP] function with argument of type array

2005-07-29 Thread Jochem Maas
Marcus Bointon wrote: On 28 Jul 2005, at 12:07, André Medeiros wrote: On Thu, 2005-07-28 at 11:08 +0200, marc serra wrote: Hi, i want to know if it is possible to create a function and declare that one of its arguments is array type. In fact i want to do something like this function

Re: [PHP] function with argument of type array

2005-07-29 Thread Marcus Bointon
On 29 Jul 2005, at 08:19, Jochem Maas wrote: unless String is a class you defined that won't work at all. basic data types cannot be hinted (e.g. bool, int, string, float) There's been quite a bit about this on php-internals. It seems to be because PHP doesn't differentiate between these

Re: [PHP] function with argument of type array

2005-07-29 Thread Jochem Maas
Marcus Bointon wrote: On 29 Jul 2005, at 08:19, Jochem Maas wrote: unless String is a class you defined that won't work at all. basic data types cannot be hinted (e.g. bool, int, string, float) There's been quite a bit about this on php-internals. It seems to be because PHP doesn't

[PHP] function with argument of type array

2005-07-28 Thread marc serra
Hi, i want to know if it is possible to create a function and declare that one of its arguments is array type. In fact i want to do something like this function test(String $litteral, array $foo){ . } I got an error when i do something like this. Can you help me please? Thx, Marc --

<    1   2   3   4   5   6   7   8   9   >