Regardless of how many break statements you take away (even
if only 1), case statements appear to be ignored after the
first match is made. I need a way to make the switch statement
continue evaluating case-matches, even after the first case
match is made. Further, it should allow one case
It seems like you can do something like this:
switch ($foo) {
case 'a':
if (do_a()) echo "a was done";
else print_menu(); // changes here
break;
case 'b':
if (do_b()) echo "b was done";
else print_menu(); // changes here
break;
case 'menu':
print_menu();
construct will return either 0 or 1 for even and odd rows, so
the proper color will be selected.
HTH, Stas
- Original Message -
From: Remon Redika [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 28, 2002 2:46 PM
Subject: [PHP] using variable ..help
I wanna do
Hi,
I've got a little problem with variable naming of object members. Here is my
situation: I've got a website form, whoms contents will be saved in a MySQL
table with two fields: name and value. The name could be anything like
bla-test, array[3]-test[4]-name...
Now I have a php script reading
I tried it but it is not successful. I think it is because I tried to
post to a https(SSL link).
You are correct.
If you want to use SSL, you're better off using cURL.
The above code would be about 100 X as large if it was trying to do all the
encryption and SSL interchanges to get an SSL
Hello,
Is it possible to set to null (or destroy) the session variables when I
close IE ?
Bye
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello,
Is it possible to set to null (or destroy) the session variables when I
close IE ?
Bye
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
How can I Include my php code code as variable and excute it ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
http://www.php.net/eval
- Original Message -
From: Alawi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 11:41 AM
Subject: [PHP] Include php code as variable
How can I Include my php code code as variable and excute it ?
--
PHP General Mailing List
In article 00d501c23ada$87050590$3404a8c0@alawi,
[EMAIL PROTECTED] (Alawi) wrote:
How can I Include my php code code as variable and excute it ?
include() can return a value, assignable to a variable. Some other ways to
get the content of a file (I assume that's why you're saying include
;
===
Tested it! It worked!
G stands for GET
You can use P or C for POST or COOKIE
The order of gpc is important the later overwites the former...see
docs(XCVIII. Variable Functions)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
The obvius and easy think is alwaiss the hard to find
My problem vas the of the BR tag, that I forgot, dummy issue but I made
The right adn working one now are
http://myadress/php/mypage.php?modo=123color=redsize=3
and to get
echo $_GET['modo'].BR;
echo $_GET['color'].BR;
echo
Besides my newbye status, I guess you are not update.
the $_GET is a must have when you use set globals to off, ( this is default
after 4.2.1), and must be maintained for security reasons.
Since I'm newbye I play with new and fresh version, and I can get details
that older phpers does not take
Because you HAVE to use it if you have register_globals OFF. Only when
register_globals is ON can you do what you thought is more efficient, but isn't.
Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/
Lord Loh. [EMAIL
http://myadress/php/mypage.php?modo=123color=redsize=3
is fine!
you can now use these variables like
$modo $color and $size;
Why bother with $_GET['modo']; ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
PLEASE don't tell the newbies to mess up their code! That is not
compatible with all versions of php! DO NOT USE THOSE!!! STICK TO YOUR
CURRENT GOOD CODE! Bother with them for security and compatibly.
Lord Loh. wrote:
http://myadress/php/mypage.php?modo=123color=redsize=3
is fine!
you
I have a column in my DB named username and i am trying to compare a session
ID called $username to the field in my DB called username. The way i had
done it before was SELECT * from tablename WHERE Tablename.username ==
$username, but this does not seem to be working is there a better way to
not exist.;
exit;
}
To check for blank fields simply ask ... WHERE username = ''.
-Kevin
- Original Message -
From: Tyler Durdin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 12:46 PM
Subject: [PHP] comparing a variable to value in DB
I have a column in my DB
I'm having a huge problem with getting variable variables to work.
Here's what the code looks like...
// This is set from a previous array...
/
$the_variablename[0] = processors;
// Now I include a file called
Nevermind!
I figured out the curly bracket syntax...
Doh! It was buried in the manual the whole time!
Dave
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi everyone,
Is there any way to hide my form submitted variables (like
passwords etc)
in the location
bar http://somedomain.org/checkpassword.php?
password=mypassword
or atleast show in an encypted form n the location bar.
form method=POST
HTH,
Axel Tietje
--
FLYnet FLYer
To: [EMAIL PROTECTED]
Subject: Re: [PHP] hiding submitted variable values in location bar of
browser !
Hi everyone,
Is there any way to hide my form submitted variables (like
passwords etc)
in the location
bar http://somedomain.org/checkpassword.php?
password=mypassword
or atleast show
Use the POST Method
Use MD5 encryption for additional security
=== MD5.js=
/*
* Convert a 32-bit number to a hex string with ls-byte first
*/
var hex_chr = 0123456789abcdef;
function rhex(num)
{
var str = ;
for(var j = 0; j = 3; j++)
str += hex_chr.charAt((num (j *
Use the POST Method
Use MD5 encryption for additional security
=== MD5.js=
/*
* Convert a 32-bit number to a hex string with ls-byte first
*/
var hex_chr = 0123456789abcdef;
function rhex(num)
{
var str = ;
for(var j = 0; j = 3; j++)
str += hex_chr.charAt((num (j *
I do have a multisite form. There are several fields on page 1 and several
on page 2.
Everything works fine exept of error handling. Which means if a user wants
to go back from step 2 to one and has already filled in some data in site 2
he will loose this data for sure. It is not possible to
Hi everyone,
Is there any way to hide my form submitted variables (like
passwords etc)
in the location
bar http://somedomain.org/checkpassword.php?
password=mypassword
or atleast show in an encypted form n the location bar.
/Chandu
On 9 Jul 2002 at 22:09, [EMAIL PROTECTED] wrote:
Is there any way to hide my form submitted variables (like
passwords etc)
in the location
bar http://somedomain.org/checkpassword.php?
password=mypassword
or atleast show in an encypted form n the location bar.
But why bother? Certainly you
On Tue, 9 Jul 2002 22:09:58 -0400 (EDT), you wrote:
Is there any way to hide my form submitted variables (like
passwords etc)
in the location
bar http://somedomain.org/checkpassword.php?
password=mypassword
or atleast show in an encypted form n the location bar.
You could use POST rather than
-Original Message-
From: Tom Beidler [mailto:[EMAIL PROTECTED]]
Sent: 03 July 2002 21:41
For the current issue I'm trying to unset some variables with
common names
and I would like to step through them with a loop. Here's
where I'm at to
give you an idea but the code doesn't
I'm wondering if this can be done, and if so, what's the proper way to do
it.
For the current issue I'm trying to unset some variables with common names
and I would like to step through them with a loop. Here's where I'm at to
give you an idea but the code doesn't work.
for ($i = 2; $i = 4;
You are on the right track with the reasoning:
$unsetA = level . $i . Name;
unset($$unsetA);
HTH
Bogdan
Tom Beidler wrote:
I'm wondering if this can be done, and if so, what's the proper way to do
it.
For the current issue I'm trying to unset some variables with common names
and I would
Hi,
Can someone tell me if it's possible to create variable names from
varaible names? I could work around this problem using some if/else
statements, but I'm interested to see if there's another solution.
I have 20 associative arrays all named compA, compB, compF, etc. The
user supplies a
I think so. Try using double dollar signs.
$name = food;
$$name = pizza;
print $food;
-Original Message-
Can someone tell me if it's possible to create variable names from
varaible names?
This message is
On Wednesday, June 26, 2002, at 01:04 PM, Lee P Reilly wrote:
Can someone tell me if it's possible to create variable names from
varaible names? I could work around this problem using some if/else
statements, but I'm interested to see if there's another solution.
Just try it.
for ($i = 0;
Thanks for the replies. I'm still having a litte trouble though...
Say I have an array called $compX, and given the letter 'X'... how can I
access the variable $compX using these methods?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
http://www.php.net/manual/en/language.variables.variable.php
On Wed, 26 Jun 2002, Lee P Reilly wrote:
Thanks for the replies. I'm still having a litte trouble though...
Say I have an array called $compX, and given the letter 'X'... how can I
access the variable $compX using these methods?
how can i use a variable stored in a vaiable in a if statement?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
From: Renaldo De Silva [EMAIL PROTECTED]
how can i use a variable stored in a vaiable in a if statement?
Check the manual info on variable variables:
http://www.php.net/manual/en/language.variables.variable.php
--
Lowell Allen
--
PHP General Mailing List (http://www.php.net/)
To
$var1 = Names;
$var2 = $var1;
Pradeep Dsouza
Naharonline.com
- Original Message -
From: Renaldo De Silva [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 19, 2002 4:14 AM
Subject: [PHP] using a variable stored in a variable.
how can i use a variable stored
How can I access the value of a variable whose name is stored in another
variable?
Example:
$field=artist;
How can I access the value of $artist ?
Thanks
Daniele
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-Original Message-
From: Daniele Baroncelli [mailto:[EMAIL PROTECTED]]
Sent: 13 June 2002 17:27
How can I access the value of a variable whose name is stored
in another
variable?
Example:
$field=artist;
How can I access the value of $artist ?
$$field
Cheers!
Mike
Echo $$field;
--John Holmes...
-Original Message-
From: Daniele Baroncelli [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Value of variable with name stored in another variable
How can I access the value of a variable whose
This is probably an easy answer, but I cannot seem to find it. Is it
possible to determine whether a variable is set with either $_POST or $GET
without having to do:
if(isset($_POST['foo']) || isset($_GET['foo']))
//do something
On Tue, Jun 11, 2002 at 09:06:34AM -0400, J. Anderson Scarbrough wrote:
possible to determine whether a variable is set with either $_POST or $GET
without having to do:
if(isset($_POST['foo']) || isset($_GET['foo']))
if ( isset($_REQUEST['foo']) ) {
--Dan
--
PHP classes
My understanding is that when passing a querystring to PHP via the URL with the GET
method, PHP will automatically create a variable with the name and value from the
querystring. I'm trying to do this and it's not working.
Here's my code from an online tutorial (angle braces replaced with
My understanding is that when passing a querystring to PHP via the URL
with the GET method, PHP will automatically create a variable with the
name and value from the querystring. I'm trying to do this and it's
not working.
Yes, if you have:
example.com/foo.php?id=33
In the old days,
: [PHP] Determine if variable is set
On Tue, Jun 11, 2002 at 09:06:34AM -0400, J. Anderson Scarbrough wrote:
possible to determine whether a variable is set with either $_POST or
$GET
without having to do:
if(isset($_POST['foo']) || isset($_GET['foo']))
if ( isset($_REQUEST['foo
By reading the manual section relevant to your specific database...
Igor Portnoy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello,
I am passing a variable to the new page, when user clicks on the link.
Something like that:
a href=showimage.php?ID=38img
at
http://www.phpbuilder.com/columns/ if you need more help...
Mikey
BTW - reply to the list
-Original Message-
From: Igor Portnoy [mailto:[EMAIL PROTECTED]]
Sent: 05 June 2002 19:59
To: Michael Davey
Subject: RE: [PHP] Re: Passing variable to new page and pulling the rest
of info
Should find enough code for displaying graphics (and sending by smtp) in
this code.
You'll find some session stuff too.
HTH
J
http://www.collegeSherbrooke.qc.ca/languesmodernes/postcard/index.html.phps
http://www.collegeSherbrooke.qc.ca/languesmodernes/postcard/display_image.phps
OK - couple of things first:
a) The PHP mailing list is for programmers of PHP looking for help making
their own scripts - not for people who want support for implementing someone
else's script. There is a link on the site where I found a copy of your
script offering support, this is where you
Ooops, now I feel silly - sent this to the wrong list!
Hangs head in shame! :-)
Michael Davey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
OK - couple of things first:
a) The PHP mailing list is for programmers of PHP looking for help making
their own
Is there a variable in PHP which will show the
directory of the document root? I have done a few searches and before I go
looking harder I thought I'd ask. My problem is that I am using both windows,
IIS and linux, Apache. I tried a few things like $document_root which didn't
seem to work
On Friday 17 May 2002 20:56, [EMAIL PROTECTED] wrote:
Is there a variable in PHP which will show the directory of the document
root? I have done a few searches and before I go looking harder I thought
I'd ask. My problem is that I am using both windows, IIS and linux, Apache.
I tried a few
$_SERVER[DOCUMENT_ROOT]
Jason Wong [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Friday 17 May 2002 20:56, [EMAIL PROTECTED] wrote:
Is there a variable in PHP which will show the directory of the document
root? I have done a few searches an
I am running mod PHP 4.0.6 with Apache
1.3x.
I am using session variables to pass various access
information. Everything works like a charm until I popup a new window
using Javascript. The session variable is set but to the wrong
value.
Has anyone else run into this issue or have any
Hi,
I somehow cannot unset Session variables. If I set for example
$_SESSION[error]=formcheck (the new style) and I want to unset it at the
end of the page (unset($_SESSION[error])), it's there again on the next
page.
Is there a special way to unset the new Session variables?
I am using
I somehow cannot unset Session variables. If I set for example
$_SESSION[error]=formcheck (the new style) and I want to unset it
at the end of the page (unset($_SESSION[error])), it's there again on
the next page.
Is there a special way to unset the new Session variables?
Seen as you used
Yes, always remember that unset() deletes the REFERENCE to the variable, not
the variable itself, so in the next page, when you session_start() again,
the reference is recreated to the still existing value.
So, session_unregister is fundamental to unregister the reference from the
session.
To
I want to do something along the lines of:
$type = basic;
$$type_user = jaxn;
echo $basic_user;
and have the output be jaxn.
I have tried everything I can think of, and I have looked in all my
books.
I know how to:
$type = basic;
$$type = jaxn;
echo $basic;
but this won't do what I need. I
On Friday 03 May 2002 02:43, Jackson Miller wrote:
I want to do something along the lines of:
$type = basic;
$$type_user = jaxn;
echo $basic_user;
and have the output be jaxn.
I have tried everything I can think of, and I have looked in all my
books.
I know how to:
$type = basic;
On Fri, 19 Apr 2002, Jeff Oien wrote:
Far better would be to put a placeholder in $body like and then just
do $body = ereg_replace('', $url, $body);
That's giving me a blank also. The form for changing the email is in a
password protected area where only two people are allowed. But
On Friday 19 April 2002 09:31, Jeff Oien wrote:
I have a script which retrieves the body of an email message from
a MySQL database to be sent to someone who applies using a form.
The script contains this:
$url = a
href=\http://$HTTP_HOST$SCRIPT_NAME\;http://$HTTP_HOST$SCRIPT_NAME/a;
$url =
On Friday 19 April 2002 09:31, Jeff Oien wrote:
I have a script which retrieves the body of an email message from
a MySQL database to be sent to someone who applies using a form.
The script contains this:
$url = a
href=\http://$HTTP_HOST$SCRIPT_NAME\;http://$HTTP_HOST$SCRIPT_NAME/a;
On Fri, 19 Apr 2002, Jeff Oien wrote:
Use eval().
I have $url (literally) embedded in some text in the database that is to be
sent as an email message. I'm using this and $url disappears with a blank
spot in the text:
eval(\$body = \$body\;);
I've tried variations and can't get it to
On Fri, 19 Apr 2002, Jeff Oien wrote:
Use eval().
I have $url (literally) embedded in some text in the database that is to be
sent as an email message. I'm using this and $url disappears with a blank
spot in the text:
eval(\$body = \$body\;);
I've tried variations and can't get
On Fri, 19 Apr 2002, Jeff Oien wrote:
Far better would be to put a placeholder in $body like and then just
do $body = ereg_replace('', $url, $body);
That's giving me a blank also. The form for changing the email is in a
password protected area where only two people are allowed. But I'll
Maybe you could use sessions like:
session_start();
session_register('verified');
$verified=0
Erich Kolb [EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I have developed a simple login script. Right now it will check a
submitted
username and password and
I have a script which retrieves the body of an email message from
a MySQL database to be sent to someone who applies using a form.
The script contains this:
$url = a href=\http://$HTTP_HOST$SCRIPT_NAME\;http://$HTTP_HOST$SCRIPT_NAME/a;
$url = addslashes($url);
$msg1 .= $body; //to be sent via
You can pass it using POST rather than GET-style arguments, but that will
require structuring your pages so that people use buttons to get from one
to the next, and it will only keep really dumb people from seeing the
variables.
Other than that, look at the manual's section on Sessions.
Good to hear from you again David,
On Wednesday, April 3, 2002, at 06:28 AM, DL Neil wrote:
If they are one and the same machine/server, then use 'debug' code to
reset options at the beginning of dev code (and remove it when the
routine is 'promoted' to prod).
Excellent idea. E_ALL for
Erik,
My two cents' (with allowance for inflation...)
If you're distributing code in cyberspace it's a good
idea to make it error free too, E_NOTICE or otherwise.
To get the maximum help when coding, and to ensure the minimum of
confusion for your users, I recommend:
1 set the dev server's
I got back quite a few responses on this list on the subject of having
variables that are not defined before they are used. That's
interesting -- it's nice to know that I can take shortcuts and conjure
them up on the fly, but I didn't realize that it was good practice to
declare the
On Monday, April 1, 2002, at 11:15 PM, Philip Olson wrote:
Good little programmers define variables before
using them, or at least before evaluating them.
Really? I'm not arguing with you, I'm curious: I thought that it was a
valued feature of newer scripting languages that they do not
++. That said, I love the
power that PHP provides as far as functionality is concerned.
just my 2 pfennigs...
-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 02, 2002 8:26 AM
To: Philip Olson
Cc: kip; [EMAIL PROTECTED]
Subject: Re: [PHP] Warning: Undefined
Hi,
i need to pass a variable by letting the user click on a link. Right now i
do it like: page.php?variable=value
However, i don´t want the variable, and it´s value to appear in the adress
bar of the browser. And i don´t want people to be able to pass the same
variable by reloading the
, April 02, 2002 8:26 AM
To: Philip Olson
Cc: kip; [EMAIL PROTECTED]
Subject: Re: [PHP] Warning: Undefined variable
On Monday, April 1, 2002, at 11:15 PM, Philip Olson wrote:
Good little programmers define variables before
using them, or at least before evaluating them.
Really? I'm
PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Tuesday, April 02, 2002 9:02 AM
Subject: [PHP] Passing a variable invisibly via a href?
Hi,
i need to pass a variable by letting the user click on a link. Right now i
do it like: page.php?variable=value
However, i don´t want the variable
[EMAIL PROTECTED]
Sent: Tuesday, April 02, 2002 9:02 AM
Subject: [PHP] Passing a variable invisibly via a href?
Hi,
i need to pass a variable by letting the user click on a link. Right now i
do it like: page.php?variable=value
However, i don´t want the variable, and it´s value
You could use a form and have a hidden vield that contains a value. The
user would have to click the submit button for the variable/value to carry
over though.
I thought about that. But i have two possible values (via two links) that
could be passed and i can´t really get it together. Two
That might not be such a good idea then.
Tyler
- Original Message -
From: Daniel Alsén [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Tuesday, April 02, 2002 9:11 AM
Subject: SV: [PHP] Passing a variable invisibly via a href?
You could use a form and have a hidden vield
PROTECTED]
Sent: Tuesday, April 02, 2002 4:02 PM
Subject: [PHP] Passing a variable invisibly via a href?
Hi,
i need to pass a variable by letting the user click on a link. Right now i
do it like: page.php?variable=value
However, i don´t want the variable, and it´s value to appear in the adress
Yes, there is a way to do it without using any forms. I may be able to
help you better if you could show me the relevant code -- I'm not sure
if what I have in mind is really applicable to what you want to do.
It´s not really advanced:
session_start();
session_register('text_size');
if
On Tuesday, April 2, 2002, at 10:28 AM, Daniel Alsén wrote:
I use the variable $change to set the text size in my stylesheet:
if (isset($text_size)) {echo $text_size;} else {echo 10; $text_size =
10;}
And i set the variable via a link:
a href=? echo $PHP_SELF; ??change=inc (or
Good little programmers define variables before
using them, or at least before evaluating them.
Really? I'm not arguing with you, I'm curious: I thought that it was a
valued feature of newer scripting languages that they do not require
declaration of variables. At least that's what
On Tuesday, April 2, 2002, at 03:27 PM, Philip Olson wrote:
If you're distributing code in cyberspace it's a good
idea to make it error free too, E_NOTICE or otherwise.
I got back quite a few responses on this list on the subject of having
variables that are not defined before they are
We are confusing one another :) I'm not talking
about declaring variables per se, but rather making
sure the variable exists before evaluating it. So:
$var = 'foobar';
if ($var == 'foobar')
That's fine, no need to do declare $var before this
in PHP. My words here simply mean to make sure
Hi,
As i know we don't need to define a variable before in PHP. But i have a
very strange case. In my server, i hosted a PHP website. When i update the
server from PHP3 to PHP4, problems came out. Most of the php pages didn't
work and display many warnings like that :
Warning: Undefined variable
maybe the reporting of warning is turn off for the php3 installation, but
turned on for the php4 installation.
-Original Message-
From: kip [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 02, 2002 12:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Warning: Undefined variable
Hi,
As i know
E_NOTICE all over
the place, it's not a good idea. More and more people are
learning to not do that.
On Tue, 2 Apr 2002, kip wrote:
Hi,
As i know we don't need to define a variable before in PHP. But i have a
very strange case. In my server, i hosted a PHP website. When i update the
server
I have error's enabled in php.ini. I keep getting Undefined variable when
I run a script that contains IF or ELSE IF's. Is this normal because the
variable hasn't been set at the beginning of the script ?
Yes. If the variable hasn't been defined previously you'll get a warning:
if ( $dd 2)
On Fri, 15 Mar 2002, Daniel Negron/KBE wrote:
Thank You Charlie. I also found out that I needed to put an symbol
infrom of the string. This stopped it from throwing me an error.
If($submit) blah blah blah
Better yet, use:
if (isset($submit)) blah blah blah
That explicitly checks to
PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 3:46 PM
To: Daniel Negron/KBE
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Undefined Variable in IF...ELSE IF ...ELSE IF
(NEWBIE ?)
On Fri, 15 Mar 2002, Daniel Negron/KBE wrote:
Thank You Charlie. I also found out that I needed
On Thursday 07 March 2002 19:21, Lars Torben Wilson wrote:
// The direct way:
$foo-{$test . '_foo'}();
Thanks Lars
This was what I was looking for, just couldn't remember the syntax
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi Nick!
http://www.php.net/manual/en/function.str-replace.php
Regards,
Jan
Nick Richardson [EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Been working on this one for quite awhile, and it's probably a fairly easy
solution, but i can't find it... so thought
-Original Message-
From: Phillip S. Baker [mailto:[EMAIL PROTECTED]]
Sent: 07 March 2002 05:52
for ($i=1; $i 12; $i++) {
echo state_$i; // This would print out either Yes No or Maybe.
}
Close -- it's actually:
echo ${state_$i};
(For the record, these are
Hi all
I get a variable that is set be a select box on a page.
I want to use this variable to call a function within a class that is based
on it's name.
so if $var = me
I want to call $class-me_function();
or if
$var = you
call
$class-you_function();
How can I use the variable as part
me_function() {
...
}
}
$class = new test();
$class-do($var);
Greets,
Edward
- Original Message -
From: Matt Williams [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, March 07, 2002 3:25 PM
Subject: [PHP] using a variable to a function call
Hi all
I
On Thu, 2002-03-07 at 06:25, Matt Williams wrote:
Hi all
I get a variable that is set be a select box on a page.
I want to use this variable to call a function within a class that is based
on it's name.
so if $var = me
I want to call $class-me_function();
or if
$var = you
I am not sure I can articulate this well.
But I will try.
I want to combine either two variables or a variable and string to bring up
the name of a previous variable name to display the data from the first.
So in the first part I will have a listing that will look like
type=radio name=state_1
701 - 800 of 980 matches
Mail list logo