Re: [PHP] Re: Function size

2012-06-03 Thread Tony Marston
tamouse mailing lists wrote in message news:cahuc_t__sw-_yhrw4n4uqr-fa46+cebunzgehboaatrafla...@mail.gmail.com... On Tue, May 29, 2012 at 2:52 AM, Tony Marston t...@marston-home.demon.co.uk wrote: On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: A rule of thumb is no more than 50

Re: [PHP] Re: Function size

2012-06-03 Thread Tim Streater
On 03 Jun 2012 at 10:02, Tony Marston tonymars...@hotmail.com wrote: tamouse mailing lists wrote in message news:cahuc_t__sw-_yhrw4n4uqr-fa46+cebunzgehboaatrafla...@mail.gmail.com... There is a point: if you are unfamiliar with code, wading through screens and screens of a function to find

Re: [PHP] Re: Function size

2012-06-03 Thread Tony Marston
Tim Streater wrote in message news:d0.7c.45755.25a3b...@pb1.pair.com... On 03 Jun 2012 at 10:02, Tony Marston tonymars...@hotmail.com wrote: tamouse mailing lists wrote in message news:cahuc_t__sw-_yhrw4n4uqr-fa46+cebunzgehboaatrafla...@mail.gmail.com... There is a point: if you are

Re: [PHP] Re: Function size

2012-05-31 Thread tamouse mailing lists
On Tue, May 29, 2012 at 2:52 AM, Tony Marston t...@marston-home.demon.co.uk wrote: On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote:  A rule of thumb is no more than 50 lines per function, most much less. Back in the day when we didn't have nifty gui screens and an 24 line terminals

Re: [PHP] Re: Function size

2012-05-30 Thread Tony Marston
Ashley Sheridan a...@ashleysheridan.co.uk wrote in message news:1338326229.2616.31.camel@localhost.localdomain... On Tue, 2012-05-29 at 17:06 -0400, Paul M Foster wrote: On Tue, May 29, 2012 at 08:52:46AM +0100, Tony Marston wrote: On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote:

Re: [PHP] Re: Function size

2012-05-30 Thread Sebastian Krebs
Hi, Just want to throw my 2 cent in :) 2012/5/30 Tony Marston t...@marston-home.demon.co.uk Ashley Sheridan a...@ashleysheridan.co.uk wrote in message news:1338326229.2616.31.camel@localhost.localdomain... On Tue, 2012-05-29 at 17:06 -0400, Paul M Foster wrote: On Tue, May 29, 2012 at

Re: [PHP] Re: Function size

2012-05-30 Thread Paul M Foster
On Tue, May 29, 2012 at 11:40:25PM +0200, Matijn Woudt wrote: [snip] On Tue, May 29, 2012 at 11:06 PM, Paul M Foster pa...@quillandmouse.com wrote: [snip] I think a lot of coders try to be kewler than the next 18 guys who are gonna have to look at the code, so they use a lot of

RE: [PHP] Re: Function size

2012-05-30 Thread Steven Staples
Paul, Are you stating here that compression is a bad thing? That means you consider this nice: if ( action == A ) { doA(); } else if (action == B ) { doB(); } else { doC(); } Or perhaps flooded with comments that merely say the same as the code does? I'd go

Re: [PHP] Re: Function size

2012-05-30 Thread Paul M Foster
On Wed, May 30, 2012 at 04:31:12PM +0200, Sebastian Krebs wrote: [snip] If the functions were named properly you don't have to follow every execution path to the deepest deep. Or do you reading PHPs C-source, just because a wild substr() appeared? When you see a method loadFromFile() and

RE: [PHP] Re: Function size

2012-05-30 Thread admin
-Original Message- From: Paul M Foster [mailto:pa...@quillandmouse.com] Sent: Wednesday, May 30, 2012 10:54 AM To: php-general@lists.php.net Subject: Re: [PHP] Re: Function size On Wed, May 30, 2012 at 04:31:12PM +0200, Sebastian Krebs wrote: [snip] If the functions were named

[PHP] Re: Function size

2012-05-29 Thread Tony Marston
On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: A rule of thumb is no more than 50 lines per function, most much less. Back in the day when we didn't have nifty gui screens and an 24 line terminals (yay green on black!), if a function exceeded one printed page, it was deemed too

Re: [PHP] Re: Function size

2012-05-29 Thread Paul M Foster
On Tue, May 29, 2012 at 08:52:46AM +0100, Tony Marston wrote: On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: A rule of thumb is no more than 50 lines per function, most much less. Back in the day when we didn't have nifty gui screens and an 24 line terminals (yay green on

Re: [PHP] Re: Function size

2012-05-29 Thread Ashley Sheridan
On Tue, 2012-05-29 at 17:06 -0400, Paul M Foster wrote: On Tue, May 29, 2012 at 08:52:46AM +0100, Tony Marston wrote: On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: A rule of thumb is no more than 50 lines per function, most much less. Back in the day when we didn't have

Re: [PHP] Re: Function size

2012-05-29 Thread Matijn Woudt
On Tue, May 29, 2012 at 11:06 PM, Paul M Foster pa...@quillandmouse.com wrote: OMG in alpha order?! At best, I might group them together by function type, with some comment notation in the file. But not alpha order. I prefer not to have forward declares in my files, so I generally arrange

[PHP] Re: Function size

2012-05-25 Thread Tedd Sperling
On May 24, 2012, at 4:48 PM, tamouse mailing lists wrote: Yes, I think that is *exactly* the criterion-- not a mystery or an emergent thing, really, was a pretty expicit reasoning--being able to see/scan the entire function on one page (or now in one screenful) makes it much easier to see

[PHP] Re: Function size

2012-05-24 Thread tamouse mailing lists
On May 23, 2012 9:14 AM, Tedd Sperling t...@sperling.com wrote: Hi gang: On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: A rule of thumb is no more than 50 lines per function, most much less. Back in the day when we didn't have nifty gui screens and an 24 line terminals (yay

Re: [PHP] Re: Function size

2012-05-24 Thread Ashley Sheridan
On Thu, 2012-05-24 at 15:48 -0500, tamouse mailing lists wrote: On May 23, 2012 9:14 AM, Tedd Sperling t...@sperling.com wrote: Hi gang: On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: A rule of thumb is no more than 50 lines per function, most much less. Back in the day

[PHP] Re: function

2012-05-04 Thread Jim Giner
Ron Piggott ron.pigg...@actsministries.org wrote in message news:499A66F0FB394E1DB44F7E0C011CF11C@RonPiggottPC... I need to access a FUNCTION I programmed within a different FUNCTION. Are these able to be passed like a variable? Or are they able to become like a $_SESSION variable in nature?

Re: [PHP] Re: function within a class function

2010-06-21 Thread Gary .
On Mon, Jun 21, 2010 at 10:49 AM, Pete Ford wrote: On 21/06/10 00:45, Rick Pasotto wrote: I think that's right - doesn't the manual describe this sort of thing about using callback functions that are class members? Yes.

[PHP] Re: Function parameters and arrays

2008-09-18 Thread Frank Stanovcak
Actually Stut pointed out that I was calling both dimmensions when my sorry butt should only have been referencing the second one. I had everything over expanded so I could see where the code was breaking. Thank you everyone for the help! That was fantastic! Frank Frank Stanovcak [EMAIL

[PHP] Re: Function-return-array idea

2008-01-16 Thread Shawn McKenzie
I'm sure I'm a pea-brain, but this caught my attention. So you execute the fetchObjects() method which could return a large number of objects, then you reference a method of the 0th one. I didn't test, but why not use: $object-fetchObjects(0)-method(); Where fetchObjects($id) returns the object

Re: [PHP] Re: Function variables in classes

2007-11-02 Thread Jochem Maas
Paul van Haren wrote: OK guys, thanks for all your inputs. Based on your guidance, I have tested the following code with a series of variations: class foobar { function bar2 () { echo Yep, in bar2() right now\n; }

[PHP] Re: Function variables in classes

2007-11-01 Thread Sebastian Hopfe
It seems to be a PHP Bug, because normaly it should very well. but you can solve this problem, by a workarround. using eval($a.();); instead of $a(); in the class. Best regards Sebastian Paul van Haren [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Hi there, I'm trying to

[PHP] Re: Function variables in classes

2007-11-01 Thread Paul van Haren
Thanks, this helps. The code now works. In case this is truely a bug in PHP, where should I log it? Anything that I should do to make sure that it gets followed up? Regards, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Function variables in classes

2007-11-01 Thread Sebastian Hopfe
I think you should log it, because it seems to be, and you found this error. Regard Sebastian Paul van Haren [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Thanks, this helps. The code now works. In case this is truely a bug in PHP, where should I log it? Anything that I

Re: [PHP] Re: Function variables in classes

2007-11-01 Thread Nathan Nobbe
On 11/1/07, Sebastian Hopfe [EMAIL PROTECTED] wrote: I think you should log it, because it seems to be, and you found this error. i would not consider this a bug. what paul is asking about is the variable function syntax in php. http://www.php.net/manual/en/functions.variable-functions.php

Re: [PHP] Re: Function variables in classes

2007-11-01 Thread Jochem Maas
Sebastian Hopfe wrote: I think you should log it, because it seems to be, and you found this error. it's not a bug - especially because nobody has bothered to mention the php version. I'm guessing that it's being run on a version php5, in which case the fatal error seems correct - you have a

Re: [PHP] Re: Function variables in classes

2007-11-01 Thread Nathan Nobbe
On 11/1/07, Jochem Maas [EMAIL PROTECTED] wrote: Sebastian Hopfe wrote: I think you should log it, because it seems to be, and you found this error. it's not a bug - especially because nobody has bothered to mention the php version. this issue has the same implications in php4 and php5,

Re: [PHP] Re: Function variables in classes

2007-11-01 Thread Robert Cummings
On Thu, 2007-11-01 at 16:10 +0100, Jochem Maas wrote: I've completely lost track of the state of the exact OO rules in any given version of php5) Haha, you too eh!? BTW, I finally bothered to download PHP 5.2.4 last night and checked it out. This is the first time I've seen a speed improvement

Re: [PHP] Re: Function variables in classes

2007-11-01 Thread Jochem Maas
Robert Cummings wrote: On Thu, 2007-11-01 at 16:10 +0100, Jochem Maas wrote: I've completely lost track of the state of the exact OO rules in any given version of php5) Haha, you too eh!? BTW, I finally bothered to download PHP 5.2.4 last night and checked it out. This is the first time

Re: [PHP] Re: Function variables in classes

2007-11-01 Thread Robert Cummings
On Thu, 2007-11-01 at 17:16 +0100, Jochem Maas wrote: Robert Cummings wrote: On Thu, 2007-11-01 at 16:10 +0100, Jochem Maas wrote: I've completely lost track of the state of the exact OO rules in any given version of php5) Haha, you too eh!? BTW, I finally bothered to download PHP

Re: [PHP] Re: Function variables in classes

2007-11-01 Thread Paul van Haren
OK guys, thanks for all your inputs. Based on your guidance, I have tested the following code with a series of variations: class foobar { function bar2 () { echo Yep, in bar2() right now\n; } public function foo2

[PHP] Re: function - action

2007-08-03 Thread Daniel Macedo
Ralph Kutschera escreveu: Hallo! I'm working on a project, where we distinguish between functions and actions in design, although in PHP both are implemented as functions. Is there a chance that PHP can use the word action as function? E.g.: public function doSomething() { } public

[PHP] Re: Function Overloading

2005-12-18 Thread joshua may
Labunski wrote: 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

[PHP] Re: function 'another_mail' with authentication

2005-10-24 Thread Manuel Lemos
Hello, on 10/24/2005 10:57 PM Etienne Finet said the following: Can anyone give me a clue on how to change this script so it can be used with basic SMTP authentication? SMTP authentication is not that simple. There are several authentication methods and you need to establish an

[PHP] Re: function MAX with WHERE

2005-07-25 Thread Mark Rees
Jesús Alain Rodríguez Santos [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have someting like this: $test = mysql_query(SELECT MAX(dato) AS datos FROM tabla WHERE campo_mes = '$mes'); $test_m = mysql_fetch_array($test); $test_mes = $test_m['datos']; print $test_mes where

[PHP] Re: function problem

2005-01-03 Thread Viktor Popov
Hi, thank you for your reply! I'll consider carefully this holes. Thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: function problem

2005-01-03 Thread Viktor Popov
Hi, Thank you for your reply! I have changed the function like this: function doReg($fname1=,$family1=,$company1=, $MOL1=, $dannum1=, $bulstat1=, $phone1=, $email1=, $username1=, $password1=, $payment1=, $maillist1=, $Addr1=, $City1=, $zipcode1=, $Country1=, $shippingName1=, $shippingFamily1=,

Re: [PHP] Re: function problem

2005-01-03 Thread Richard Lynch
If you were trying to use the result from mysql_pconnect() as the second optional argument to mysql_query() in your function, be sure you declare it 'global' inside the function. Read PHP docs on variable scope if this is what tripped you up. If not, I have no idea why the database is not

[PHP] Re: function problem

2005-01-02 Thread Greg Beaver
Hi Viktor, Viktor Popov wrote: Hi, I'm trying to do the following but I don't have any success. Could you help me here... I have this code in mu page: ?php include script/functions.php; require 'script/common.inc'; $valid = TRUE; if (isset ($_POST['submit'])) { foreach($_POST as $key=$value) {

[PHP] Re: function problem

2004-09-04 Thread Torsten Roehr
Matthias Bauw [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm having a problem with a php application; I have two files: one is ccadduser wich adds users to a controlcenter that I am currently designing for a website. In that ccaduserfile I call for a function

Re: [PHP] Re: function problem

2004-09-04 Thread Andre Dubuc
On Saturday 04 September 2004 03:42 pm, Torsten Roehr wrote: Matthias Bauw [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm having a problem with a php application; I have two files: one is ccadduser wich adds users to a controlcenter that I am currently designing for a

[PHP] Re: Function Get Error

2004-09-03 Thread Torsten Roehr
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I write this function to delete directory and file but when i 've a directory not empty i get error The code that i write is this: I receive this warning: Warning: rmdir(cartella): Directory not empty in

[PHP] Re: Function Problem

2004-09-01 Thread Jasper Howard
the checkpermission(); function should be run before php can pharse anything farther down the script, try putting an exit; after the header() statement. -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292

[PHP] Re: Function Mail

2004-08-08 Thread Torsten Roehr
Juan Pablo Herrera [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi everybody, I have a cuestion about the features on function mail. I think that it send the email one to one address. Is it ok?. Regards, Juan Pablo Hi Juan Pablo, the manual says: mail() automatically mails the

[PHP] Re: Function that creates a class instance with a given name

2004-06-29 Thread Maris
Found the solution: function create_car($params){ global $smarty; $car = new Car(Jeep sWrangler,black); $smarty-register_object($params[id], $car); } Maris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there! I am trying to make a PHP function create_object that would

[PHP] Re: function for string to array (map)?

2004-06-18 Thread Aidan Lister
No, because that's not a standard format. You'll have to write your own function (as you've done). If you're looking to store an array as a string, look at serialize() Pete Forman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there a standard function that converts a string to

[PHP] Re: function for backing up mysql

2004-04-14 Thread Kim Steinhaug
Take a look at phpclasses.org Last week there also came another class especially made for backups aswell if I recall. -- -- Kim Steinhaug -- There are 10 types of people when it comes to binary numbers: those who understand

[PHP] RE: function imagecreatefromjpeg pb

2004-04-11 Thread Cosas minovela
about GD, Warning: imagecreatefromjpeg(): '/var/www/html/datos/2004/02/crio25.jpg' is not a valid JPEG file. how can i solve it please? image pass the EOF and BOF test, so this is not the problem :) here you got the image with problems , i'm sorry about the content of image...

[PHP] Re: Function to check a valid date

2004-03-20 Thread Ben Ramsey
Your likely to find many ways to do this and many functions with many lines of code that do many variations of what you want. Can I use the word many many more times? Such is the way with programming. Here's my take on it. Pull all your values into one long string: $date_string =

[PHP] Re: Function to check a valid date

2004-03-20 Thread Tom Reed
Try this: http://us4.php.net/checkdate -Tom Reed [EMAIL PROTECTED] Chris Bruce [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello all, I was going to build a function to check whether a selected date exists, but thought that I would see if anyone has done this type of thing already

[PHP] Re: function only available if PHP4 compiled using --enable-exif

2004-02-07 Thread Ben Ramsey
If you're on Windows, you should see a file by the name of php_exif.dll in your PHP\extensions directory. It should've come with the distribution. Depending on the way your php.ini file is set up, you may either leave this file in its current location, or you may need to copy it to your

[PHP] Re: function only available if PHP4 compiled using --enable-exif

2004-02-07 Thread Paul Furman
Thanks. I could have sworn I searched php.ini for exif. I had to do both of the below to make it work. Ben Ramsey wrote: php.ini [extension_dir = c:\PHP\extensions] [uncomment] extension=php_exif.dll -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: Function for crypt and decript.

2004-01-23 Thread Jas
[EMAIL PROTECTED] wrote: Hi all, are in PHP, functions for crypt and decrypt string? I would to use this function in my script in PHP, how can I use this? I need of an example for use this and a list of this function. Thanks in advance. base64_decode() and base64_encode()

[PHP] Re: Function Problem (Long-ish)

2004-01-13 Thread David Robley
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hi List, I have a self-made function that uses a MySql statement something like this: Function MyFunc(){ sql = mysql_query(select * from table where somefield=\somevar\){ while(blah blah){ $var =blah blah; } } return

[PHP] Re: Function returns

2004-01-11 Thread DvDmanDT
Well... Definitly depends on what kind of function it is... However, instead of echoing in a function, most ppl recommend echo do_it(), were do_it() is function do_it() { return Hi; } There are many builtin functions without a return value, simply cause they don't need to, or there's no real

[PHP] Re: function problems...

2003-12-03 Thread Jas
Nevermind, I got it to work... cheers Jas wrote: I call this function it checks a session variable then displays 1 of 3 menus... for some reason it will only display the first menu regardless of the results of my decoded session var. Any help or just a new pair of eyes would help. Thanks in

[PHP] Re: function that appends dollar symbol

2003-11-23 Thread zerof
Please, see: http://www.php.net/manual/en/function.localeconv.php and http://www.php.net/manual/en/function.setlocale.php - zerof - Joffrey Leevy [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] The money_format function does not do it for me. Is there a simple php

[PHP] Re: Function disabled.

2003-11-21 Thread Pedro Faria
Hi, you have to use *ini_get* function and not *function_exists* because it is a restriction on PHP.INI. Try: ? if (eregi('rmdir',ini_get('disable_functions'))) echo rmdir Function exists; else echo rmdir Function DOES NOT exists; ? []s Pedro Faria. On Fri, 21 Nov 2003 18:58:12

[PHP] RE: function help redirect help

2003-10-27 Thread Frank Tudor
$payment = 1; function payment(){ global $payment; if ($payment == 0); header (location:test_page.html); } global $payment; elseif ($payment == 1) { header (location:test_page2.html); } __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search

[PHP] RE: function help redirect help

2003-10-27 Thread Frank Tudor
Here is what Ihave I am getting a elseif parse error. Is there something I'm leaving out? Frank code --- $payment = 1; function payment(){ global $payment; if ($payment == 0); header (location:test_page.html); } global $payment; elseif ($payment == 1) { header

RE: [PHP] RE: function help redirect help

2003-10-27 Thread Gregory Kornblum
Remove the second 'global $payment;'. Regards. -Gregory -Original Message- From: Frank Tudor [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 2:01 PM To: 1PHP Subject: [PHP] RE: function help redirect help Here is what Ihave I am getting a elseif parse error

[PHP] RE: function help simple redirect

2003-10-27 Thread Frank Tudor
Sorry I'm getting this error message Parse error: parse error, unexpected T_ELSEIF __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] RE: function help redirect help

2003-10-27 Thread Chris Shiflett
--- Frank Tudor [EMAIL PROTECTED] wrote: I am getting a elseif parse error. Let me clean up your code a bit, and hopefully the error will stand out. function payment() { global $payment; if ($payment == '0'); header ('Location: http://example.org/test_page.html'); } global

[PHP] Re: function help simple redirect

2003-10-27 Thread DvDmanDT
$payment = 1; function payment(){ global $payment; if ($payment == 0){ header (Location: test_page.html); } elseif ($payment == 1) { header (Location: test_page2.html); } } -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com ## Please, if you are using

Re: [PHP] RE: function help redirect help

2003-10-27 Thread Frank Tudor
I made the changes but I am getting: Parse error: parse error, unexpected T_ELSEIF I did take the second global statement out after I cut and pasted your code and modified the urls so now here is what it looks like (the whole thing). Frank ?PHP $payment = 1; function payment() {

Re: [PHP] RE: function help redirect help

2003-10-27 Thread Chris Shiflett
--- Frank Tudor [EMAIL PROTECTED] wrote: function payment() { global $payment; if ($payment == '0'); header ('Location: http://ftudor/test/test_page.html'); } elseif ($payment == '1') { header ('Location: http://ftudor/test/test_page2.html'); } Your code looks

Re: [PHP] Re: function help simple redirect

2003-10-27 Thread Frank Tudor
This one worked (kinda) I have no more errors but it doesn't do the redirect (hmmm)?? So now here is what it looks like: I am putting in the $payment=1; so it will automatically go to test_page2.html but it just sits there. Is there a headers thing already going on blocking this? I know

Re: [PHP] Re: function help simple redirect

2003-10-27 Thread Chris Shiflett
--- Frank Tudor [EMAIL PROTECTED] wrote: I am putting in the $payment=1; so it will automatically go to test_page2.html but it just sits there. [snip] header ('Location: http://ftudor/test/test_page2.html'); What happens when you type it into your browser manually?

RE: [PHP] Re: function help simple redirect

2003-10-27 Thread Pablo Gosse
On Monday, October 27, 2003 11:26 AM, Frank Tudor wrote: This one worked (kinda) I have no more errors but it doesn't do the redirect (hmmm)?? ?PHP $payment = 1; function payment(){ global $payment; if ($payment == 0){ header ('Location: http://ftudor/test/test_page.html'); }

Re: [PHP] RE: function help redirect help

2003-10-27 Thread DvDmanDT
Can you see the problem(s) now? Never underestimate the benefits of writing clean code. :-) Hehe, you should see my code.. function dp_neg($v1,$v2){ $neg = ((substr((string)$v1,0,1)==-)||((substr((string)$v2,0,1)==-))); $bneg= ((substr((string)$v1,0,1)==-)((substr((string)$v2,0,1)==-)));

Re: [PHP] Re: function help simple redirect

2003-10-27 Thread Frank Tudor
I get my ugly purple test page :) Frank --- Chris Shiflett [EMAIL PROTECTED] wrote: --- Frank Tudor [EMAIL PROTECTED] wrote: I am putting in the $payment=1; so it will automatically go to test_page2.html but it just sits there. [snip] header ('Location:

RE: [PHP] Re: function help simple redirect

2003-10-27 Thread Frank Tudor
Oh?!?! Sweet! thanks... let me try that and get back to the group :) --- Pablo Gosse [EMAIL PROTECTED] wrote: On Monday, October 27, 2003 11:26 AM, Frank Tudor wrote: This one worked (kinda) I have no more errors but it doesn't do the redirect (hmmm)?? ?PHP $payment = 1;

RE: [PHP] Re: function help simple redirect

2003-10-27 Thread Frank Tudor
Shit! payment(); WORKS! Thank for teach me how to do a function guys!!! Frank --- Frank Tudor [EMAIL PROTECTED] wrote: Oh?!?! Sweet! thanks... let me try that and get back to the group :) --- Pablo Gosse [EMAIL PROTECTED] wrote: On Monday, October 27, 2003 11:26 AM, Frank

Re: [PHP] RE: function help redirect help

2003-10-27 Thread Chris Shiflett
--- DvDmanDT [EMAIL PROTECTED] wrote: Can you see the problem(s) now? Never underestimate the benefits of writing clean code. :-) Hehe, you should see my code.. Yes, very messy and disorganized. Is this an admission of guilt, a cry for help, or what? Chris = My Blog

[PHP] Re: Function/globalizing

2003-03-16 Thread Joel Colombo
Try: somewhere global define : $encryptiontechnique = 'ENCRYPT ALGORITHM'; function encryptPassword($password, $salt='') { global $encryptiontechnique; if ($salt === '') { $salt = $encryptiontechnique; } // CODE.. } Joel Colombo Liam Gibbs [EMAIL PROTECTED] wrote in

[PHP] Re: function getting redeclared

2003-02-18 Thread Greg Beaver
Hi Erik, You may want to re-investigate using nested functions for this purpose, it seems a bit illogical. The main reason is that it clutters up the source. If you want a private function, use docblock tag @access private to let other users know that it should not be accessed directly, or wait

[PHP] Re: Function returning a reference - how ?!?

2002-12-21 Thread Kyle Gibson
I'll try. /* This function instantiates and returns a new Parent class. */ function createParent() { return new Parent; } /* $p is a reference of the Parent object created by createParent(). */ $p = createParent(); I believe the problem occurs here. $p becomes a reference to the

[PHP] Re: function/class for updating multiple-tables automatically?

2002-12-16 Thread Thomas Seifert
oh, some addendum, I would need it for MySQL if its dependend. Thomas On Mon, 16 Dec 2002 21:46:34 +0100 [EMAIL PROTECTED] (Thomas Seifert) wrote: Hi folks, I'm looking for a function or class which is able to automatically update multiple tables. The hard thing on this is, I only want

[PHP] Re: function args declared by-reference, with default value?

2002-11-25 Thread Derick Rethans
Nick Eby wrote: true or false: when declaring a function, a given argument can be declared to pass by reference, or can be declared to have a default value, but never both. i.e., you can only write one of: function foo($param) function foo($param = bar) but never the equivalent of: function

Re: [PHP] Re: Function Problem

2002-11-10 Thread Ernest E Vogelsinger
At 08:16 10.11.2002, conbud said: [snip] also I have the function wrong in my original question I have it as function db_conn($host,$user,$pass,$dab) { $db = mysql_connect($host, $user,$pass mysql_select_db($dab,$db); } and not function

[PHP] Re: Function Problem

2002-11-09 Thread conbud
also I have the function wrong in my original question I have it as function db_conn($host,$user,$pass,$dab) { $db = mysql_connect($host, $user,$pass mysql_select_db($dab,$db); } and not function db_conn($host,$user,$pass,$dab) { $db = mysql_connect($host, $user,$pass)mysql_select_db($dab,$db); }

Re: [PHP] Re: Function Problem

2002-11-09 Thread Maxim Maletsky
you need to return $db: function db_conn($host,$user,$pass,$dab) { $db = mysql_connect($host, $user,$pass mysql_select_db($dab,$db); return $db; } and then use $db = db_conn(,,,); or make it global: function db_conn($host,$user,$pass,$dab) { blobal $db; $db = mysql_connect($host, $user,$pass

Re: [PHP] Re: Function Problem

2002-11-09 Thread conbud
huh I thought I tried that befoer and it didnt work but this time it worked good, thanks everyone. Also whats the difference between $globals['$variable'] and just global -Lee Maxim Maletsky [EMAIL PROTECTED] wrote in message news:20021110082455.7C29.MAXIM;php.net... you need to return $db:

[PHP] Re: function()

2002-11-05 Thread Joshua E Minnie
First of all, you can't echo that variable in the manner you are trying. Try this instead: [lib.inc] function test_func($param1) { return $param1; } [main.php] ?php // option 1 $num = test_func(123); echo $num; // option 2 echo test_func(123); ? HTH _ / Joshua Minnie

[PHP] Re: Function: return multple values

2002-09-23 Thread Ivo
You can only as an array: function calculate_money($sum) { // some hanky panky calculations $myArr[] = $type; $myArr[] = $amount; return $myArr; } or shorter: function calculate_money($sum) { return array($type, $amount); } Faisal Abdullah [EMAIL PROTECTED] wrote in message

[PHP] Re: Function search utility

2002-08-02 Thread Lars Olsson
It still works...try http://www.php.net/mysql or http://www.php.net/fopen for example... /lasso ([EMAIL PROTECTED]) Brian V Bonini wrote: There used to be a utility that let you search php functions from the address bar in your browser by simply appening PHP to the function name eg, php

RE: [PHP] Re: Function search utility

2002-08-02 Thread Brian V Bonini
Nope, it was this http://www.php.net/tips.php that I was thiking of But thanks, I didn't know you could do that ;-) -Brian -Original Message- From: Lars Olsson [mailto:[EMAIL PROTECTED]] Sent: Friday, August 02, 2002 2:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Function

[PHP] Re: function for finding one character in a string?

2002-07-18 Thread Richard Lynch
I have been looking around in the PHP function listing for a function that can find or match one character from a string. I thought it would be something like post_str() or something but never found anything close to that. I get the idea of post and str from the SQL command. I did check the

[PHP] Re: Function needed

2002-06-09 Thread Austin Marshall
Gaylen Fraley wrote: I am in need of a function/script that will take a directory and search all filenames, recursively down, for a given file. Can anyone point me to a source? Thanks. $result=`grep -r 'expression' ./`; -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Re: Function needed

2002-06-09 Thread Jason Wong
On Sunday 09 June 2002 17:17, Austin Marshall wrote: Gaylen Fraley wrote: I am in need of a function/script that will take a directory and search all filenames, recursively down, for a given file. Can anyone point me to a source? Thanks. $result=`grep -r 'expression' ./`; This

Re: [PHP] Re: Function needed

2002-06-09 Thread Chris Hewitt
$result=`ls -R | grep 'expression' ./`; HTH Chris Jason Wong wrote: On Sunday 09 June 2002 17:17, Austin Marshall wrote: Gaylen Fraley wrote: I am in need of a function/script that will take a directory and search all filenames, recursively down, for a given file. Can anyone point me to a

Re: [PHP] Re: Function needed

2002-06-09 Thread Gaylen Fraley
This resricts to *nix and can be disallowed due to security constraints, but thanks anyway. I just wrote my own PHP routine. -- Gaylen PHP KISGB v4.0.5 Guest Book http://www.gaylenandmargie.com/phpwebsite/ Chris Hewitt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL

[PHP] Re: Function Switch($pid) - NEED HELP

2002-05-25 Thread Jens Lehmann
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

[PHP] Re: function over loading?

2002-05-12 Thread Smileyq
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Kris Vose) wrote: Can you practice function over-loading in php? Kris No you cannot overload in PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Re: function over loading?

2002-05-12 Thread Jason Murray
Can you practice function over-loading in php? No you cannot overload in PHP. You can achieve the same effect (having the same function do something else in a different circumstance) by making parameters optional: ? Function functionName($param1, $param2 = ) { ... } ?

Re: [PHP] Re: function over loading?

2002-05-12 Thread Rasmus Lerdorf
Well, not in the procedural sense, but you can do method and property overloading on objects. See http://php.net/overload -Rasmus On Sun, 12 May 2002, Smileyq wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Kris Vose) wrote: Can you practice function over-loading in php?

Re: [PHP] Re: function over loading?

2002-05-12 Thread Miguel Cruz
On Sun, 12 May 2002, Smileyq wrote: [EMAIL PROTECTED] (Kris Vose) wrote: Can you practice function over-loading in php? No you cannot overload in PHP. In a particularly masochistic project, we achieved function overloading by creating a global array $F that linked public to hidden names of

[PHP] Re: function returning true or errors

2002-04-18 Thread Julio Nobrega Trabalhando
function custom_function() { if ($error == 0) { return true; } else { return Error!; } } if (custom_function() != Error!) { echo Success; } else { echo Error; } Also, you could still return false on your custom_function(), if before the return you

Re: [PHP] Re: function returning true or errors

2002-04-18 Thread Robert Cummings
I think this is more along the lines of what was wanted :) function custom_function() { if( $problem1 ) { return 'Problem 1 occured!'; } elseif( $problem2 ) { return 'Problem 2 occured!'; } elseif( ... ) { ... } return true; } if(

  1   2   >