Re: [PHP] php function on php.net

2003-07-24 Thread Chris Shiflett
--- Merlin [EMAIL PROTECTED] wrote: Unfortunatelly this is not what I mean. Have a look on this: http://www.globosapiens.net/hially A php page is redirecting this 404 error to another page, but I would like to have the URL stay the same like it is done on php.net Then don't redirect to

[PHP] php function on php.net

2003-07-22 Thread Merlin
Hi there, I am wondering how on php.net the search for functions is done. You can add any function just behind the php.net like php.net/phpinfo and it will point you right through it. I know how to redirect this as a 404 error in apache to another file, but then the url is changing. In the

Re: [PHP] php function on php.net

2003-07-22 Thread David Nicholson
Hello, This is a reply to an e-mail that you wrote on Tue, 22 Jul 2003 at 21:15, lines prefixed by '' were originally written by you. Hi there, I am wondering how on php.net the search for functions is done. You can add any function just behind the php.net like php.net/phpinfo and it will

[PHP] function is_executable

2003-07-10 Thread Gilberto Garcia Jr.
Hey guys, I made a class to work with file upload. I used the php function is_executable. and in php 4.2.x it works ok, on linux and on windows. Last week I update my php to 4.3.x and this function stop work. In fact I got this error. undefinied function. Does anyone can help? thanks

Re: [PHP] function is_executable

2003-07-10 Thread Mark
From the manual: is_executable() became available with Windows in PHP version 5.0.0. Not sure what the problem might be if you're using linux. --- Gilberto Garcia Jr. [EMAIL PROTECTED] wrote: Hey guys, I made a class to work with file upload. I used the php function is_executable

[PHP] function doesn't return value

2003-06-28 Thread anders thoresson
Hi, After a new user has filled in a form to register for my site, I check that she has entered the same password twice by calling a homemade function. Like this: $u_pwd = validate_password($_POST['u_pwd'],$_POST['u_pwd1']); And the function looks like this: function

Re: [PHP] function doesn't return value

2003-06-28 Thread Jason Wong
On Sunday 29 June 2003 02:53, anders thoresson wrote: After a new user has filled in a form to register for my site, I check that she has entered the same password twice by calling a homemade function. Like this: $u_pwd = validate_password($_POST['u_pwd'],$_POST['u_pwd1']); And the

Re: [PHP] function doesn't return value

2003-06-28 Thread anders thoresson
AFAIK in PHP, if you don't specifically return something from a function, the function will not return anything. True. I'm so frustrated over here that I miss the most obvious things. Thank's. Strange thing is that it worked at my localhost, though. -- anders thoresson -- PHP General Mailing

RE: [PHP] function doesn't return value

2003-06-28 Thread electroteque
try return true; -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Sunday, June 29, 2003 5:37 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] function doesn't return value On Sunday 29 June 2003 02:53, anders thoresson wrote: After a new user has filled in a form

[PHP] php function system() on win2k srv /iis

2003-06-26 Thread user
Hello, I performed some tests using the backticks operator and the system() call. This is my.php : ? /*---*/ header(Pragma: no-cache); // HTTP/1.0 header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1

RE: [PHP] function re-defined | WorkAround? [and some more Q's]

2003-06-05 Thread Ford, Mike [LSS]
-Original Message- From: esctoday.com | wouter van vliet [mailto:[EMAIL PROTECTED] Sent: 04 June 2003 16:11 I'm working on quite a large website with a lot of php pages.. And a lot of includable functions (modules).. Sometimes one of those modules gets included twice accidently

[PHP] function re-defined | WorkAround? [and some more Q's]

2003-06-05 Thread esctoday.com | wouter van vliet
Folks, I'm working on quite a large website with a lot of php pages.. And a lot of includable functions (modules).. Sometimes one of those modules gets included twice accidently and then it generates an error .. of course.. This made me wonder of there's any way to prevent the function from being

Re: [PHP] function re-defined | WorkAround? [and some more Q's]

2003-06-05 Thread CPT John W. Holmes
I'm working on quite a large website with a lot of php pages.. And a lot of includable functions (modules).. Sometimes one of those modules gets included twice accidently and then it generates an error .. of course.. This made me wonder of there's any way to prevent the function from being

[PHP] Function result is an array

2003-05-31 Thread Dustin Mitchell
I briefly tried searching the archives for this, but there aren't any handy keywords, so I didn't find anything. Why can't I do this: $year = getdate($timestamp)['year']; (syntax error) while I can do this: $temp = getdate($timestamp); $year = $temp['year']; and is there a way to combine the

Re: [PHP] Function result is an array

2003-05-31 Thread Evan Nemerson
IMHO the function()[] syntax should be allowed, but it isn't. You could use list() or extract(), but then you'd wind up with a lot more date than you want. What I've been doing is creating a function, then calling when needed. For example: function array_get_value($array, $index) {

Re: [PHP] Function result is an array

2003-05-31 Thread Ernest E Vogelsinger
At 06:23 31.05.2003, Evan Nemerson said: [snip] IMHO the function()[] syntax should be allowed, but it isn't. You could use list() or extract(), but then you'd wind up with a lot more date than you want. What I've been doing is creating a function, then

Re: [PHP] function for $array

2003-03-21 Thread Marek Kilimajer
I would use foreach instead of for, your function does not guarantie checking all elements and also checks elements that might not have been set. pei_world wrote: I want to use the following function the test the array elements, if all element is number return true, otherwise false; but the

[PHP] function for $array

2003-03-20 Thread pei_world
I want to use the following function the test the array elements, if all element is number return true, otherwise false; but the command marked, it print out only the first char of every strings in the array; can help? ie: ++0++ for 0.234 function check_int_float($array){ $result=true;

Fw: [PHP] function for $array

2003-03-20 Thread Kevin Stone
- Original Message - From: pei_world [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 20, 2003 4:30 PM Subject: [PHP] function for $array I want to use the following function the test the array elements, if all element is number return true, otherwise false

[PHP] Function/globalizing

2003-03-16 Thread Liam Gibbs
I have a function, such as this: function encryptPassword($password, $salt = $encryptiontechnique) { } $encryptiontechnique is defined, obviously outside the function. How is it possible to make $encryptiontechnique global so that this will work?

[PHP] Function or GD problem?

2003-03-16 Thread Nate
Function or GD problem... I have a strange problem here, hoping someone can help. The following code works great but when I make it into a function it doesn't error but it gives a RED X image. PHP: ?php include(functions.inc.php); $size = getimagesize(uploads/$src); if ($size[2]==2) {

Re: [PHP] Function or GD problem?

2003-03-16 Thread Hugh Danaher
In the receiving page, change your link from an img src= tag to an a href= then see what the error message says. Hugh - Original Message - From: Nate [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 16, 2003 2:55 PM Subject: [PHP] Function or GD problem? Function or GD

Re: [PHP] Function or GD problem?

2003-03-16 Thread Nate
in message news:[EMAIL PROTECTED] In the receiving page, change your link from an img src= tag to an a href= then see what the error message says. Hugh - Original Message - From: Nate [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 16, 2003 2:55 PM Subject: [PHP] Function

Re: [PHP] Function or GD problem?

2003-03-16 Thread Hugh Danaher
PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 16, 2003 3:59 PM Subject: Re: [PHP] Function or GD problem? Hi, thanks for your help but im not sure what you mean. My image php page is http://www.maxamplify.com/maxgallery/admin/test.php?src=img.jpg This contains the exact same code I posted below

[PHP] Function returns an array of objects...

2003-02-27 Thread Amit Snyderman
so i have a function that creates objects (with member variables) and pushes those objects onto the array. after adding all of the objects, the function then returns the array... i'm having trouble accessing the members of each object in the array...i'm trying to do something like this: class

Re: [PHP] Function returns an array of objects...

2003-02-27 Thread Tom Rogers
Hi, Friday, February 28, 2003, 4:24:54 PM, you wrote: AS so i have a function that creates objects (with member variables) and AS pushes those objects onto the array. after adding all of the objects, AS the function then returns the array... AS i'm having trouble accessing the members of each

[PHP] function to discover if value is already in array

2003-02-21 Thread JJ Harrison
Here is an example array: array( array(1,2), array(2,3), array(3,1) ) now suppose I get some form inputs with the value 1 and 1. I am trying to find a way to figure out if the first coloumn is already in the table and if so just add the second coloumn to the first. I

Re: [PHP] function to discover if value is already in array

2003-02-21 Thread Ray
On Friday 21 February 2003 09:08, you wrote: Here is an example array: array( array(1,2), array(2,3), array(3,1) ) now suppose I get some form inputs with the value 1 and 1. I am trying to find a way to figure out if the first coloumn is already in the table

Re: [PHP] function to discover if value is already in array

2003-02-21 Thread 1LT John W. Holmes
Here is an example array: array( array(1,2), array(2,3), array(3,1) ) now suppose I get some form inputs with the value 1 and 1. I am trying to find a way to figure out if the first coloumn is already in the table and if so just add the second coloumn to the

[PHP] function getting redeclared

2003-02-18 Thread Erik Price
Hi, I have a problem where I am getting the following error, and I was wondering if anyone has seen this one before and can help me out. Fatal error: Cannot redeclare isvalidphonenumber() (previously declared in /home/bluekomo/public_html//classes/Registrant.class:360) in

RE: [PHP] function getting redeclared

2003-02-18 Thread Ford, Mike [LSS]
-Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: 18 February 2003 15:14 I have a script, registration.php, which calls require_once on the Registrant.class file mentioned in the above error message. The Registrant::setPhone() method is called more than once.

Re: [PHP] function getting redeclared

2003-02-18 Thread Erik Price
On Tuesday, February 18, 2003, at 10:27 AM, Ford, Mike [LSS] wrote: I have a script, registration.php, which calls require_once on the Registrant.class file mentioned in the above error message. The Registrant::setPhone() method is called more than once. Since it is called more than once,

[PHP] function problem

2003-02-14 Thread Peter Gumbrell
I have a function below which populates a select list, based on the query string and the field name. It then prints a string: function populate_selects($query_name, $db_field, $link, $string) { $result = mysql_query($query_name, $link) or die (Could not execute query.); while ($columns =

Re: [PHP] function problem

2003-02-14 Thread Kevin Stone
Exactly where does $option_block get put into $string? -Kevin - Original Message - From: Peter Gumbrell [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Friday, February 14, 2003 4:11 PM Subject: [PHP] function problem I have a function below which populates a select list

RE: [PHP] function problem

2003-02-14 Thread Peter Gumbrell
$option_block; /SELECT input type=hidden name=vendor_select value=v INPUT TYPE=Submit NAME=Submit Value=Submit /FORM EOVS; -Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 6:41 PM To: Php-General Subject: Re: [PHP] function problem

Re: [PHP] function problem

2003-02-14 Thread Nicholas Wieland
On 2003.02.15 00:11 Peter Gumbrell wrote: [...] $option_block .= OPTION name='vendor1' [...] Are you sure it's a scope problem ? You haven't instantiated any $option_block variable when the loop starts, so you're concatenating a string to a bunch of uninitialized memory :) I can't run your

[PHP] Function to make a select box

2003-02-04 Thread Leonard Burton
Greetings, In several scripts that I have written I have had to have a similar select box. It will select from a table an auto number field and a name field (like an id # and a customer name) and then it will display the name on the screen and the variable posted will be the auto #. Could

Fwd: Re: [PHP] Function to make a select box

2003-02-04 Thread Chris Hayes
Date: Tue, 04 Feb 2003 22:02:12 +0100 To: Leonard Burton [EMAIL PROTECTED] From: Chris Hayes [EMAIL PROTECTED] Subject: Re: [PHP] Function to make a select box Could anyone offer any suggestions? The following function prints a blank select box. $result= select auto, '$field' from '$table

[PHP] Function Stack

2003-02-01 Thread Joshua Moore-Oliva
Is there any way to access the Function Stack from php? I would really like it for debugging, ala java style or C debugging style, where I could get a list of function like From afunction line 83 From bfunction line 179 From cfunction line 345 Error here.. If I could somehow access the

Re: [PHP] Function Stack

2003-02-01 Thread Matt
- Original Message - From: Joshua Moore-Oliva [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 01, 2003 7:08 AM Subject: [PHP] Function Stack Is there any way to access the Function Stack from php? Not built in, but you could manually add statement to do it yourself

Re: [PHP] Function Stack

2003-02-01 Thread Michael Sims
On Sat, 1 Feb 2003 07:08:05 -0500, you wrote: Is there any way to access the Function Stack from php? Starting with PHP 4.3.0 you can use debug_backtrace(), which returns an array of caller stack information. You might want to build a wrapper around it which formats the information the way you

[PHP] Function to catch all mySQL errors?

2003-01-04 Thread Jeff Lewis
I know that mySQL errors are caught in mysql_error() and I find that function extremely useful (kudos!). However, I have several queries in a few scripts of mine but am wondering if anyone has written a small function that catches errors and outputs them. What I mean is lets say I have a block of

RE: [PHP] Function to catch all mySQL errors?

2003-01-04 Thread Adam Plocher
Message- From: Jeff Lewis [mailto:[EMAIL PROTECTED]] Sent: Sat 1/4/2003 6:43 PM To: [EMAIL PROTECTED] Cc: Subject: [PHP] Function to catch all mySQL errors? I know that mySQL errors are caught in mysql_error() and I

RE: [PHP] Function to catch all mySQL errors?

2003-01-04 Thread Michael J. Pawlowsky
Also if you dont want ot to break you need to add the @ operator in front Mike *** REPLY SEPARATOR *** On 04/01/2003 at 6:47 PM Adam Plocher wrote: This encoded message has been converted to an attachment. How about something like this.. function runquery($query) {

Re[2]: [PHP] Function to catch all mySQL errors?

2003-01-04 Thread Tom Rogers
); AP } AP return $query; AP } AP -Original Message- AP From: Jeff Lewis [mailto:[EMAIL PROTECTED]] AP Sent: Sat 1/4/2003 6:43 PM AP To: [EMAIL PROTECTED] AP Cc: AP Subject: [PHP] Function to catch all mySQL errors

Re: [PHP] Function misfunction - 2

2002-12-31 Thread Marek Kilimajer
You forgot global $adb; at the beginning of your function, or use $sth = $GLOBALS['adb']-prepare($query); Martin S wrote: NOW what am I doing wrong?? function setCurrentDevGroup($devID) { $query = SELECT dev_group FROM tracking WHERE (computer = $devID); $sth =

Re: [PHP] Function misfunction - 2

2002-12-31 Thread Martin S
Marek Kilimajer wrote: You forgot global $adb; at the beginning of your function, or use $sth = $GLOBALS['adb']-prepare($query); Nope sorry, I've just edited it from my post here. It is in the function. /Martin S. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Function misfunction - 2

2002-12-31 Thread Jason Wong
On Tuesday 31 December 2002 20:02, Martin S wrote: Marek Kilimajer wrote: You forgot global $adb; at the beginning of your function, or use $sth = $GLOBALS['adb']-prepare($query); Nope sorry, I've just edited it from my post here. It is in the function. Hmm, whenever you post code to the

Re: [PHP] Function misfunction - 2

2002-12-31 Thread Martin S
Jason Wong wrote: On Tuesday 31 December 2002 20:02, Martin S wrote: Marek Kilimajer wrote: You forgot global $adb; at the beginning of your function, or use $sth = $GLOBALS['adb']-prepare($query); Nope sorry, I've just edited it from my post here. It is in the function. Hmm,

Re: [PHP] Function misfunction - 2

2002-12-31 Thread Jason Wong
On Tuesday 31 December 2002 20:48, Martin S wrote: This is the function which should return e.g. printers for $lookuptable. But doesn't. function setCurrentDevGroup($devID) { global $adb; $query = SELECT dev_group FROM tracking WHERE (computer = $devID);

Re: [PHP] Function misfunction - 2

2002-12-31 Thread Martin S
Jason Wong wrote: On Tuesday 31 December 2002 20:48, Martin S wrote: This is the function which should return e.g. printers for $lookuptable. But doesn't. function setCurrentDevGroup($devID) { global $adb; $query = SELECT dev_group FROM tracking WHERE

Re: [PHP] Function misfunction - 2

2002-12-31 Thread Jason Wong
of $lookuptable (in the global scope) is changed when you call your function then you have to do something like: ?php function doo($dah, $dee, $etc) { global $lookuptable; $lookuptable = Hello world; } doo(1, 2, 3); echo $lookuptable; // prints Hello world ? More examples

Re: [PHP] Function misfunction - 2

2002-12-31 Thread Martin S
Jason Wong wrote: If you want it so that the value of $lookuptable (in the global scope) is changed when you call your function then you have to do something like: ?php function doo($dah, $dee, $etc) { global $lookuptable; $lookuptable = Hello world; } doo(1, 2, 3

Re: [PHP] Function misfunction - 2

2002-12-31 Thread Marek Kilimajer
so you want $lookuptable=setCurrentDevGroup($devID); switch($lookuptable) { ... Martin S wrote: Jason Wong wrote: On Tuesday 31 December 2002 20:48, Martin S wrote: This is the function which should return e.g. printers for $lookuptable. But doesn't. function

Re: [PHP] Function misfunction - 2

2002-12-31 Thread Andrew Wallace
Um where is $lookuptable set? Seems like you should have: $lookuptable = setCurrentDevGroup($this-ComputerID); $query = SELECT name FROM $lookuptable WHERE (ID=$this-ComputerID); echo $lookuptable; // gives an empty string. andy Martin S wrote: NOW what am I doing wrong?? function

[PHP] function misfunction

2002-12-30 Thread Martin S
I'm trying to redo a db lookup into a function. The function is placed in a class called tracking and declared thus: function setCurrentDevGroup($devID) { // start original routine $query = SELECT dev_group FROM tracking WHERE (computer =

Re: [PHP] function misfunction

2002-12-30 Thread Michael Sims
On Mon, 30 Dec 2002 14:48:13 +0100, you wrote: function setCurrentDevGroup($devID) { // start original routine $query = SELECT dev_group FROM tracking WHERE (computer =

Re: [PHP] function misfunction

2002-12-30 Thread Jason Wong
On Monday 30 December 2002 22:07, Michael Sims wrote: On Mon, 30 Dec 2002 14:48:13 +0100, you wrote: function setCurrentDevGroup($devID) { // start original routine $query = SELECT dev_group FROM tracking WHERE (computer =

Re: [PHP] function misfunction

2002-12-30 Thread Marek Kilimajer
Besides what Michael and jason said, you seem not have the $tracking initialized (it is not an object). You need to call $tracking=new tracking(); somewhere in your code. Martin S wrote: I'm trying to redo a db lookup into a function. The function is placed in a class called tracking and

Re: [PHP] function misfunction

2002-12-30 Thread Martin S
Jason Wong wrote: On Monday 30 December 2002 22:07, Michael Sims wrote: On Mon, 30 Dec 2002 14:48:13 +0100, you wrote: function setCurrentDevGroup($devID) { // start original routine $query = SELECT dev_group FROM tracking WHERE (computer =

[PHP] Function misfunction - 2

2002-12-30 Thread Martin S
NOW what am I doing wrong?? function setCurrentDevGroup($devID) { $query = SELECT dev_group FROM tracking WHERE (computer = $devID); $sth = $adb-prepare($query); if($sth) { $res = $sth-execute();

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

2002-12-21 Thread Tim Molendijk
Hi all, I came across the following weird situation. I don't get it, I hope some of you can explain the logic of it all. [begin code]--- ?php /* Define class Parent. Its constructor sets an instance of Child in property $child and passes itself to Child's

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

2002-12-21 Thread reynardmh
change your createParent function to return by reference: function createParent() { return new Parent; } it returns 'two' and 'two' for me Regards, - reynard Hi all, I came across the following weird situation. I don't get it, I hope some of you can explain the logic of it all. [begin

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

2002-12-21 Thread Tim Molendijk
Wow!! You're my king! Thanks, that syntax is completely new to me! Great, another thing learned today! :) Cheers mate! [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... change your createParent function to return by reference: function createParent() {

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

2002-12-21 Thread Tom Rogers
Hi, Sunday, December 22, 2002, 1:43:27 PM, you wrote: TM Wow!! You're my king! Thanks, that syntax is completely new to me! TM Great, another thing learned today! :) TM Cheers mate! You have setup a recursive reference there with child, I don't know if this causes bad things to happen in php?

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

2002-12-16 Thread Thomas Seifert
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 to give it some predefined arrays which define the table-structures (and maybe aliases for some fields) and on execution it only gets some field-names and

Re: [PHP] Function passed as argument to function

2002-12-01 Thread Jeffrey B. Ferland
For reference, see http://autocracy.homelinux.org/template.php and http://autocracy.homelinux.org/error.php Unless you have a good reason to do otherwise please post your code here. People would be less inclined to help if they have to go about clicking on links to see what your problem

RE: [PHP] Function passed as argument to function

2002-12-01 Thread John W. Holmes
[snip] 2) How did you conclude that? Did you check that list_writings(poetry)/list_writings($poetry) gives the correct result? IE echo list_writings(poetry)/list_writings($poetry) ? list_writings(poetry) simply spits out the output. 'echo list_writings(poetry)' was not designed as the

[PHP] Function passed as argument to function

2002-11-30 Thread Jeffrey B . Ferland
std_layout(Title here, list_writings(poetry)) both std_layout and list_writings are user-defined functions. std_layout() echo's the two arguments that it takes at select points in its execution. I want to the output of list_writings() to be an argument for std_layout(). -Jeff SIG: HUP --

Re: [PHP] Function passed as argument to function

2002-11-30 Thread Jason Wong
On Sunday 01 December 2002 03:54, Jeffrey B.Ferland wrote: std_layout(Title here, list_writings(poetry)) both std_layout and list_writings are user-defined functions. std_layout() echo's the two arguments that it takes at select points in its execution. I want to the output of list_writings()

Re: [PHP] Function passed as argument to function

2002-11-30 Thread Jeffrey B . Ferland
On Saturday 30 November 2002 03:14 pm, you wrote: On Sunday 01 December 2002 03:54, Jeffrey B.Ferland wrote: std_layout(Title here, list_writings(poetry)) both std_layout and list_writings are user-defined functions. std_layout() echo's the two arguments that it takes at select points in

Re: [PHP] Function passed as argument to function

2002-11-30 Thread Jason Wong
On Sunday 01 December 2002 04:43, Jeffrey B.Ferland wrote: For reference, see http://autocracy.homelinux.org/template.php and http://autocracy.homelinux.org/error.php Unless you have a good reason to do otherwise please post your code here. People would be less inclined to help if they have to

[PHP] calling a php function

2002-11-26 Thread Adrian Partenie
Hello, Can I call a php function using forms in the same way as I do for a javascript function? (in the same page, not with php_self). ?php function() {... } ? form method=post action=function() . /form Thanks, Adrian

Re: [PHP] calling a php function

2002-11-26 Thread John Nichel
No, you can't. PHP is run on the server side. JavaScript is client side. Adrian Partenie wrote: Hello, Can I call a php function using forms in the same way as I do for a javascript function? (in the same page, not with php_self). ?php function() {... } ? form method=post

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

2002-11-25 Thread Nick Eby
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 foo($param = bar)

[PHP] Function Problem

2002-11-09 Thread conbud
Hey Im trying to create a fucntion in an include file function db_conn($host,$user,$pass,$dab) { $db = mysql_connect($host, $user,$pass)mysql_select_db($dab,$db); } In the page ide use: require('func.inc.php'); db_conn($host,$user,$pass,$dab); $result = mysql_query(select * FROM

Re: [PHP] Function Problem

2002-11-09 Thread Marco Tabini
Either add global $db; as the first line of the function or change your function call to: $db = db_conn($host,$user,$pass,$dab); I assume that $host, $user, $pass and $dab actually contain some correct values. Marco -- php|architect - The magazine for PHP Professionals The

Re: [PHP] Function Problem

2002-11-09 Thread conbud
Hey, Of course they do, they work if I put the echo in the function its self, but I dont need the echo in the function. - Lee Marco Tabini [EMAIL PROTECTED] wrote in message news:1036911387.23753.1054.camel;localhost.localdomain... Either add global $db; as the first line of the function or

[PHP] function()

2002-11-05 Thread Francisco Vaucher
Hi to all, I have a problem with function() and some variables. The issue is this I declare the function, suppose: function test_func($param1) { echo $param1; } when I call the function like; ?php test_func(123)? works OK! But if I try something like this: ?php test_func(123);

Re: [PHP] function()

2002-11-05 Thread Jason Wong
On Tuesday 05 November 2002 23:56, Francisco Vaucher wrote: This doesn't work. I need to get some variables values out of the function. Is there a way to make te variables defined in the function 'global' ? So I can use them after the function call. Declare them as global: ? doo(123);

Re: [PHP] function()

2002-11-05 Thread Justin French
Hi, this is the common way to do things: ? // declare function function test($param) { $param = $param + 4; return $param; } // option 1 -- prints 48 $param = test(44); echo $param; // option 2 -- prints 59 echo test(55); ? I *think* you can also make param part of the

Re: [PHP] function()

2002-11-05 Thread Justin French
Doesn't 'global' only get variables from outside the function into it OP (I think) wanted the variables within the function to work outside it. Justin on 06/11/02 2:44 AM, Jason Wong ([EMAIL PROTECTED]) wrote: On Tuesday 05 November 2002 23:56, Francisco Vaucher wrote: This doesn't

Re: [PHP] function()

2002-11-05 Thread Rasmus Lerdorf
Is there a way to make te variables defined in the function 'global' ? So I can use them after the function call. Just make them global inside the function. They don't need to exist in the global symbol table before the call for this. try this little test: ?php function foo

RE: [PHP] function()

2002-11-05 Thread Martin Towell
FYI: 'global' is two way eg: ? function test() { global $foobar; $foobar = Hello World; } test(); echo $foobar; ? will work. -Original Message- From: Justin French [mailto:justin;indent.com.au] Sent: Wednesday, November 06, 2002 11:49 AM To: [EMAIL PROTECTED] Subject: Re: [PHP

Re: [PHP] function()

2002-11-05 Thread Jason Wong
On Wednesday 06 November 2002 08:48, Justin French wrote: Doesn't 'global' only get variables from outside the function into it OP (I think) wanted the variables within the function to work outside it. Kind of. What it really does is 'link' the global'ed variable into the global scope.

[PHP] function to update mysql tables?

2002-10-16 Thread Simon De Deyne
Hi, I'm not sure if this is entirely php related, but I was wondering if there is a PHP function or a way to automatically update one table with values from another more extended table (automatically checking the common columns) and inserting new rows if they don't exist in the first table

[PHP] Function to remember costs.

2002-10-11 Thread Steve Jackson
I am having difficulty passing details to a form. I need to somehow pass a variable cost to a form. The cost is made up of items in a cart (details taken from a Mysql DB) and a shipping cost. I then have a function written to display the credit card form (which needs to be passed to a secure

RE: [PHP] Function to remember costs.[Scanned]

2002-10-11 Thread Michael Egan
of the hidden field. Michael Egan -Original Message- From: Steve Jackson [mailto:[EMAIL PROTECTED]] Sent: 11 October 2002 11:47 To: PHP General Subject: [PHP] Function to remember costs.[Scanned] I am having difficulty passing details to a form. I need to somehow pass a variable cost

[PHP] Function is_readable doesn't work correctly

2002-10-08 Thread Rudolf Wolf
Hello. I have compiled PHP 4.2.3 with Apache 2.0.42 and my problem is, that the function is_readable doesn't work as I expected. It is allways returning false and not check the current permission to file. For example: ?php if (is_readable(owner.php)) echo READABLE; else echo

RE: [PHP] Function is_readable doesn't work correctly

2002-10-08 Thread David Freeman
?php if (is_readable(owner.php)) echo READABLE; else echo UNREADABLE; include (owner.php); ? According to the manual, the results of is_readable() is cached. So, if you've been testing this and have both readable and unreadable you may have the wrong one cached.

[PHP] Function: return multple values

2002-09-23 Thread Faisal Abdullah
Hi people. Is it possible to return multiple values in a function. For instance, i want to do something like this: function calculate_money($sum) { // some hanky panky calculations return $type; return $amount; } Thanks! Sincerely, Faisal __ -- PHP

RE: [PHP] Function: return multple values

2002-09-23 Thread Jon Haworth
Hi Faisal, Is it possible to return multiple values in a function. For instance, i want to do something like this: function calculate_money($sum) { // some hanky panky calculations return $type; return $amount; } You have to return the values in an array, and use list() to break

[PHP] Re: PHP function for searching words in a string?

2002-09-18 Thread yasin inat
Example 1. Find the string of text php // the i after the pattern delimiter indicates a case-insensitive search if (preg_match (/php/i, PHP is the web scripting language of choice.)) { print A match was found.; } else { print A match was not found.; } Example 2. find the

[PHP] Function expects string but receiving array Warming??

2002-09-03 Thread Jean-Christian Imbeault
I get the following warning which makes no sense to me. Warning: header() expects parameter 1 to be string, array given in /www/htdocs/jc/administration/edit_products/show_products.php on line 96 It's true that I am passing at an array to the function, but what I don't understand is why the

Re: [PHP] Function expects string but receiving array Warming??

2002-09-03 Thread Justin French
You are trying to set a header() using methods not supported. But the really interesting bit is that you appear to be using it NOT for sending HTTP headers, but for setting header information on a TABLE read http://php.net/header ...this isn't what it does. ? function header_row($values)

Re: [PHP] Function expects string but receiving array Warming??

2002-09-03 Thread Chris Wesley
like this: header(array(ID,Name,Maker's Code,Maker Name,Label Name,Product Type)); header() is a PHP function. You're calling it with an invalid arguement. (I think you're just calling the function you want by the wrong name, tho.) function header_row($aH) { Try calling header_row(), instead

Re: [PHP] Function expects string but receiving array Warming??

2002-09-03 Thread Jean-Christian Imbeault
Justin French wrote: But the really interesting bit is that you appear to be using it NOT for sending HTTP headers, but for setting header information on a TABLE Oops!! I had defined my own function called header() without even stopping to think there was already a PHP header()

[PHP] Re: Numbers to Roman Numerals - Native PHP Function?

2002-08-26 Thread Richard Lynch
Does anyone know if there is a native function within PHP to convert numbers to roman numerals? I could easily write a little convertor, but I was hoping there was an simple function - although I couldn't seem to find anything like that in the manual. If http://php.net/printf doesn't do it,

[PHP] Numbers to Roman Numerals - Native PHP Function?

2002-08-25 Thread Dave at Sinewaves.net
Does anyone know if there is a native function within PHP to convert numbers to roman numerals? I could easily write a little convertor, but I was hoping there was an simple function - although I couldn't seem to find anything like that in the manual. Dave -- PHP General Mailing List

[PHP] Function search utility

2002-08-02 Thread Brian V Bonini
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 mail I thikn it might of been an IE only thing... I can't remember were I originally got it form and can not find it again, does anyone know?

<    1   2   3   4   5   6   7   8   9   >