21, 2010 at 12:49 AM, Daevid Vincent dae...@daevid.com
wrote:
-Original Message-
From: Sorin Buturugeanu [mailto:m...@soin.ro]
Sent: Tuesday, July 20, 2010 2:11 PM
To: php-general@lists.php.net
Subject: [PHP] eval and HEREDOC
Hello,
I am having trouble with a part of my
[mailto:m...@soin.ro]
Sent: Tuesday, July 20, 2010 2:11 PM
To: php-general@lists.php.net
Subject: [PHP] eval and HEREDOC
Hello,
I am having trouble with a part of my templating script. I'll
try to explain:
The template itself is HTML with PHP code inside it, like:
div
Hello,
I am having trouble with a part of my templating script. I'll try to explain:
The template itself is HTML with PHP code inside it, like:
div?=strtoupper($user['name']);?/div
And I have the following code as part of the templating engine:
$template = file_get_contents($file);
$template
-Original Message-
From: Sorin Buturugeanu [mailto:m...@soin.ro]
Sent: Tuesday, July 20, 2010 2:11 PM
To: php-general@lists.php.net
Subject: [PHP] eval and HEREDOC
Hello,
I am having trouble with a part of my templating script. I'll
try to explain:
The template itself
wrote:
-Original Message-
From: Sorin Buturugeanu [mailto:m...@soin.ro]
Sent: Tuesday, July 20, 2010 2:11 PM
To: php-general@lists.php.net
Subject: [PHP] eval and HEREDOC
Hello,
I am having trouble with a part of my templating script. I'll
try to explain:
The template
:
-Original Message-
From: Sorin Buturugeanu [mailto:m...@soin.ro]
Sent: Tuesday, July 20, 2010 2:11 PM
To: php-general@lists.php.net
Subject: [PHP] eval and HEREDOC
Hello,
I am having trouble with a part of my templating script. I'll
try to explain:
The template itself
:
-Original Message-
From: Sorin Buturugeanu [mailto:m...@soin.ro]
Sent: Tuesday, July 20, 2010 2:11 PM
To: php-general@lists.php.net
Subject: [PHP] eval and HEREDOC
Hello,
I am having trouble with a part of my templating script. I'll
try to explain:
The template itself is HTML
HI All
I have the follwoing code
function cleanufx($str){
return ucase($str);
}
$value=xyz;
$var =ufx;
$fn=clean$var($value);
$val =eval($fn;);
echo $val;
can anyone tell me what is wrong in this as the eval is returning 0 (false);
--
Have A pleasant Day
Chetan. D. Rane
On Wed, Mar 19, 2008 at 3:22 PM, chetan rane [EMAIL PROTECTED] wrote:
HI All
I have the follwoing code
function cleanufx($str){
return ucase($str);
}
$value=xyz;
$var =ufx;
$fn=clean$var($value);
$val =eval($fn;);
echo $val;
can anyone tell me what is
When re-writing this example to a form of create_function, the same
problem occurs:
?php
$code = ' return 12*A+; '; // Clearly incorrect code :-)
$returnValue = 0;
// Evaluate formula
try {
$temporaryCalculationFunction = @create_function('', $code); // E_ERROR
here
if
On Mon, August 27, 2007 12:59 am, Maarten Balliauw wrote:
Now let's repeat my question: is there any way to gracefully evaluate
specific code, eventually catch an error and respond to that, without
using parsekit() or launching another process to get this done?
I missed that you had an E_ERROR
On Mon, August 20, 2007 8:54 am, Maarten Balliauw wrote:
Here's the thing: I'm trying to do some dynamic code compilation
within
PHP using eval(). The code I'm trying to compile raises an E_ERROR
(Fatal).
Here's a simple example:
?php
$code = ' $returnValue = 12*A+; '; // Clearly
Here's the thing: I'm trying to do some dynamic code compilation within
PHP using eval(). The code I'm trying to compile raises an E_ERROR (Fatal).
Here's a simple example:
?php
$code = ' $returnValue = 12*A+; '; // Clearly incorrect code :-)
$returnValue = 0;
eval($code);
?
Now, I'd like
Maarten Balliauw wrote:
Here's the thing: I'm trying to do some dynamic code compilation within
PHP using eval(). The code I'm trying to compile raises an E_ERROR (Fatal).
Here's a simple example:
?php
$code = ' $returnValue = 12*A+; '; // Clearly incorrect code :-)
$returnValue = 0;
Maarten Balliauw wrote:
Here's the thing: I'm trying to do some dynamic code compilation within
PHP using eval(). The code I'm trying to compile raises an E_ERROR (Fatal).
Here's a simple example:
?php
$code = ' $returnValue = 12*A+; '; // Clearly incorrect code :-)
$returnValue = 0;
Hi,
Is it possible to return the result of eval function to a string rather than
outputting directly to the browser?
Thanks for your advice
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[snip]
Is it possible to return the result of eval function to a string rather than
outputting directly to the browser?
Thanks for your advice
[/snip]
Yes.
You're welcome.
The first freakin' example in TFM http://www.php.net/eval is this;
?php
$string = 'cup';
$name = 'coffee';
$str = 'This
Shaun
Shaun wrote:
Is it possible to return the result of eval function to a string rather than
outputting directly to the browser?
ob_start();
eval('$eval = evil;');
$output = ob_get_clean();
Cheers,
David Grant
--
David Grant
http://www.grant.org.uk/
--
PHP General Mailing List
I need to generate embedded php within in a mysql record. $contents is
the actual contents of that record.
?php
$contents = div class=\indent\ style=\font-size: 16px; font-family:
arial,helvetica; font-weight: bold;\About the Project/div
?php echo \hello world\; ?;
echo eval($contents);
?
I
On Sun, 2005-10-30 at 21:16 -0500, John Taylor-Johnston wrote:
I need to generate embedded php within in a mysql record. $contents is
the actual contents of that record.
?php
$contents = div class=\indent\ style=\font-size: 16px; font-family:
arial,helvetica; font-weight: bold;\About the
?php
$contents = div class=\indent\ style=\font-size: 16px; font-family:
arial,helvetica; font-weight: bold;\About the Project/div
?php echo \hello world\; ?;
echo eval($contents);
?
eval() expects PHP code, not HTML with embedded PHP code. Try this
(untested):
eval( ? $contents ?php );
On Sun, 2005-10-30 at 21:24 -0500, John Taylor-Johnston wrote:
?php
$contents = div class=\indent\ style=\font-size: 16px; font-family:
arial,helvetica; font-weight: bold;\About the Project/div
?php echo \hello world\; ?;
echo eval($contents);
?
eval() expects PHP code, not HTML with
eval( ? $contents ?php );
However, if eval() is the answer, you're probably asking the wrong
question. You should take a hard look at your code and think of a better
way to do what you need to do.
Back to the drawing board? It is either store my html+embedded code in a
mysql record, or in
On Sun, October 30, 2005 8:51 pm, John Taylor-Johnston wrote:
eval( ? $contents ?php );
However, if eval() is the answer, you're probably asking the wrong
question. You should take a hard look at your code and think of a
better
way to do what you need to do.
Back to the drawing board? It
: Re: [PHP] eval();
On Sun, October 30, 2005 8:51 pm, John Taylor-Johnston wrote:
eval( ? $contents ?php );
However, if eval() is the answer, you're probably asking the wrong
question. You should take a hard look at your code and think of a
better way to do what you need to do.
Back
Im trying to evaluate a string representation of the output of
var_export(),
as an array.
To make a long story short, Im using curl to fetch another php page,
that uses var_export to echo out php data structures.
The fetched data via curl, is a string. Something like -
array ( 'foo' = 'bar', )
Gerard Samuel wrote:
Im trying to evaluate a string representation of the output of
var_export(),
as an array.
To make a long story short, Im using curl to fetch another php page,
that uses var_export to echo out php data structures.
The fetched data via curl, is a string. Something like -
array
Jochem Maas wrote:
Gerard Samuel wrote:
Im trying to evaluate a string representation of the output of
var_export(),
as an array.
To make a long story short, Im using curl to fetch another php page,
that uses var_export to echo out php data structures.
The fetched data via curl, is a string.
How can I eval() an HTML template to make a CONSTANT be evaluated
properly?
Previously I have been using regular $variables in my HTML templates.
Today I decided to make one of the $variables a CONSTANT only to find it
would not parse out as it's defined value. It is instead treated as
regular
Hi,
Friday, May 21, 2004, 8:26:30 AM, you wrote:
GD How can I eval() an HTML template to make a CONSTANT be evaluated
GD properly?
GD Previously I have been using regular $variables in my HTML templates.
GD Today I decided to make one of the $variables a CONSTANT only to find it
GD would not
I would like to use eval() to evaluate another PHP file and store the output
of that file in a string.
So, let's say, for example, that I have a file called colors.php which
contains this:
pColors: ? echo Red, Yellow, Green, Blue; ?/p
Then, in another file, I have this:
$file =
OrangeHairedBoy wrote:
I would like to use eval() to evaluate another PHP file and store the
output of that file in a string.
You could use output buffering to do this a bit more easily, I think:
ob_start();
include('colors.php');
$colors = ob_get_contents();
ob_end_clean();
--
PHP General
While that is an awesome idea, I don't think it will work for me.
There's two reasons why. First, colors.php is actually stored in a MySQL
server.
Second, before the PHP code inside colors.php I want to be able to replace
data inside that file. For example:
$file = str_replace( Green , Orange ,
OrangeHairedBoy wrote:
I would like to use eval() to evaluate another PHP file and store the output
of that file in a string.
So, let's say, for example, that I have a file called colors.php which
contains this:
pColors: ? echo Red, Yellow, Green, Blue; ?/p
Then, in another file, I have this:
Marek,
OK...that worked...kinda, but it doesn't pass the output to $colors. It
echos it. I need the output to be passed to $colors.
Lewis
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
OrangeHairedBoy wrote:
I would like to use eval() to evaluate another PHP file
OrangeHairedBoy wrote:
I would like to use eval() to evaluate another PHP file and store
the output of that file in a string.
You could use output buffering to do this a bit more easily, I think:
ob_start();
include('colors.php');
$colors = ob_get_contents();
ob_end_clean();
While that
Thanks Michael Marek! It worked! :)
Michael Sims [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
OrangeHairedBoy wrote:
I would like to use eval() to evaluate another PHP file and store
the output of that file in a string.
You could use output buffering to do this a bit more
Hallo Tom,
am Samstag, 23. August 2003 um 05:14 hast Du Folgendes gekritzelt:
TR This should do it:
TR eval('${content.$databasepagename}[$i]();');
I'm afraid to say it, but it does not :-(
Yesterday I was also trying to find some manual pages about eval()
which would explain me the syntax.
Hi,
Saturday, August 23, 2003, 10:01:54 PM, you wrote:
MW Hallo Tom,
MW am Samstag, 23. August 2003 um 05:14 hast Du Folgendes gekritzelt:
TR This should do it:
TR eval('${content.$databasepagename}[$i]();');
MW I'm afraid to say it, but it does not :-(
MW Yesterday I was also trying to find
Hallo Tom,
am Samstag, 23. August 2003 um 17:50 hast Du Folgendes gekritzelt:
TR This works for me, what error message do you get? Make sure you use
TR single quotes in the eval otherwise the string will get substituted
TR before eval gets a look at it.
TR ?php
TR $contentarray =
Hallo Tom,
am Samstag, 23. August 2003 um 17:50 hast Du Folgendes gekritzelt:
TR Hi,
TR Saturday, August 23, 2003, 10:01:54 PM, you wrote:
MW Hallo Tom,
MW am Samstag, 23. August 2003 um 05:14 hast Du Folgendes gekritzelt:
TR This should do it:
TR eval('${content.$databasepagename}[$i]();');
Hi,
Sunday, August 24, 2003, 2:32:01 AM, you wrote:
MW That's the error I find in the apache-log. On the screen, I get
MW nothing but a white page. By the way I have error_reporting(E_ALL);
MW but I never get errors reported...
MW PHP Fatal error: Call to undefined function: () in
Hi php-general,
I have a question about eval();
I'm having multiple pagenames I store in a database. I also have a lot
of functions starting with content and then the name of the pages
taken from the database. Ex: pagenames = about,download functions =
contentAbout(), contentDownload().
Now I
Hi,
Saturday, August 23, 2003, 8:38:32 AM, you wrote:
MW Hi php-general,
MW I have a question about eval();
MW I'm having multiple pagenames I store in a database. I also have a lot
MW of functions starting with content and then the name of the pages
MW taken from the database. Ex: pagenames =
Is it possible to put PHP code in eval ?
Or just vars ?
?php
$string = 'The result of ?php $a=2; $b=3; $c=$a+$b; echo $a + $b is $c;
?';
eval ($string);
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
PHP-Code:
eval('?'.$string)
Vars:
eval('$string='.str_replace('','\\',$string).';');
Is it possible to put PHP code in eval ?
Or just vars ?
?php
$string = 'The result of ?php $a=2; $b=3; $c=$a+$b; echo $a + $b is $c;
?';
eval ($string);
?
Decapode Azur wrote:
Is it possible to put PHP code in eval ?
Or just vars ?
?php
$string = 'The result of ?php $a=2; $b=3; $c=$a+$b; echo $a + $b is $c;
?';
eval ($string);
?
It should go like:
[code]
eval('$var = The result of; $a=2; $b=3; $c = $a + $b; $var .= $a + $b is $c;');
[/code]
How can I evaluate a var that is from a text field of a database? Example:
MySQL field `name` = hi my name is $name
In my script I have:
$name = Shawn;
After fetching a query result as an associative array I have the contents of
the `name` field in $data
If I echo $data I get: hi my name is
On Mon, 2003-07-14 at 15:03, Shawn McKenzie wrote:
How can I evaluate a var that is from a text field of a database? Example:
Hi Shawn--
Have you looked at eval?
http://www.php.net/eval.
Cheers,
Marco
--
php|architect -- The Magazine for PHP Professionals
NOW AVAILABLE IN PRINT! Get
Hello,
This is a reply to an e-mail that you wrote on Mon, 14 Jul 2003 at 20:03,
lines prefixed by '' were originally written by you.
How can I evaluate a var that is from a text field of a database?
Example:
MySQL field `name` = hi my name is $name
In my script I have:
$name = Shawn;
Hello,
This is a reply to an e-mail that you wrote on Mon, 14 Jul 2003 at 20:15,
lines prefixed by '' were originally written by you.
eval($data)
returns Parse error: parse error, unexpected T_STRING in
C:appsapache2htdocstestquery.php(23) : eval()'d code on line 1
What are the exact contents
Is $$ the same as eval or is it different and my main question is, is it
safer to use to for processing form data?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Use $$ unless you need to use eval. Easier to read, faster to process.
Also safer if you don't validate form data.
Jason Lehman wrote:
Is $$ the same as eval or is it different and my main question is, is it
safer to use to for processing form data?
--
The above message is encrypted with
Can you expand on this? I haven't found a ref to the $$ except for variable
variables. $$ What does it do? How is it used?
Thanks!
Shawn
Leif K-Brooks [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Use $$ unless you need to use eval. Easier to read, faster to process.
Also safer
$$ is perfectly explained in the variable variables section.
Shawn McKenzie wrote:
Can you expand on this? I haven't found a ref to the $$ except for variable
variables. $$ What does it do? How is it used?
Thanks!
Shawn
Leif K-Brooks [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
what problem I want to use eval in my script but its generate this error :
Parse error: parse error, unexpected T_LNUMBER in
C:\Projects\phpmag\admin\functions\admin_cont.php(22) : eval()'d code on line 4
Parse error: parse error, unexpected T_LNUMBER in
try
echo \$all_types_list .= \$all_types_list\;;
there should be a syntax error
Alawi wrote:
what problem I want to use eval in my script but its generate this error :
Parse error: parse error, unexpected T_LNUMBER in C:\Projects\phpmag\admin\functions\admin_cont.php(22) : eval()'d code on line
At 12:54 10-3-03, you wrote:
what problem I want to use eval in my script but its generate this error :
Parse error: parse error, unexpected T_LNUMBER in
C:\Projects\phpmag\admin\functions\admin_cont.php(22) : eval()'d code on line 4
eval (\$all_types_list .= \$all_types_list\;);
For those
- define a string that has a function call in it (that returns a string)
that at the time of declaration is not in scope, eg
$str = this is the name : \$node-getName(); // $node is _not_ defined
currently, so we can't escape out
then, later on in the code, this string will be passed to a
- define a string that has a function call in it (that returns a string)
that at the time of declaration is not in scope, eg
$str = this is the name : \$node-getName(); // $node is _not_ defined
currently, so we can't escape out
Ya have 2 options really (from my perspective):
1. Place in
Thanks for your time, Dan.
Currently, I'm using defined tags for replacing info from my CMS, eg:
$str = ofa-core:siteMapLink/
Then I have a function that has all the objects in scope, and can perform
the necessary replacements.
I am prototyping some stuff with smarty, but so far have yet to
Currently, I'm using defined tags for replacing info from my CMS, eg:
$str = ofa-core:siteMapLink/
Then I have a function that has all the objects in scope, and can
perform the necessary replacements.
ok ... what would ofa-core:siteMapLink/ represent?
The output of $ofa-core-siteMapLink();?
ok ... what would ofa-core:siteMapLink/ represent?
The output of $ofa-core-siteMapLink();?
If your using XML throughout - have you looked at XSLT transformations?
It's just a symbolic name - the output is created from a few different
objects within the CMS, but it was such a commonly used set
Hi guys,
My current task involves passing a string into a function that is able to
reference variables defined within that function for the final output. The
idea is that a function iterates through objects and eval's the string so
that the objects data (name etc) is substituted in the string.
At 14:47 03.03.2003, neko said:
[snip]
$someVar = brtesting for node - wootah, \$evalTestArr[TAG_PAGENAME]
then in some other function that gets passed this string
...
$evalTestArr[TAG_PAGENAME] = hello anna marie gooberfish!;
$str = $someVar;
Hello,
Could someone offer some insight on eval(); I am fairly new at this.
I would like to evaluate numerous variables from a form submission with a
loop, but I can;t even get on to work:
I.e.
He are the variables from my form
wins_1=7
losses_1=0
sort_1=1
wins_2=7
losses_2=4
sort_2=2
On Tue, Jul 02, 2002 at 10:19:59PM -0400, Greg Wineman wrote:
He are the variables from my form
wins_1=7
losses_1=0
sort_1=1
wins_2=7
losses_2=4
sort_2=2
wins_3=7
losses_3=4
sort_3=3
$counter=1;
$wins=eval(\$wins_.$counter);
eval() is overkill and can be dangerous.
I'd use
On Tue, Jul 02, 2002 at 10:45:27PM -0400, Analysis Solutions wrote:
$var = $wins_$counter;
Oops. Forgot to escape the $:
$var = \$wins_$counter;
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
This doesn't seem to work. Here's my demo.
?
$wins_1=7;
$losses_1=0;
$sort_1=1;
$wins_2=4;
$losses_2=4;
$sort_2=2;
$wins_3=3;
$losses_3=4;
$sort_3=3;
$wins = 0;
for ($counter=1; $counter=3; $counter++) {
$var = $wins_$counter;
$wins = $wins + $$var;
echo($wins);
}
?
This returns 000,
hmm... I must be doing something wrong. This is still returning 000
?
$wins_1=7;
$losses_1=0;
$sort_1=1;
$wins_2=4;
$losses_2=4;
$sort_2=2;
$wins_3=3;
$losses_3=4;
$sort_3=3;
$wins = 0;
for ($counter=1; $counter=3; $counter++) {
$var = \$wins_$counter;
$wins = $wins + $$var;
On Tue, Jul 02, 2002 at 11:19:22PM -0400, Analysis Solutions wrote:
Oops. Forgot to escape the $:
$var = \$wins_$counter;
Oops. Forgot my promise to myself to always test things before posting.
I had a sinking feeling my initial posting would come back to haunt me,
but I JUST
You da man. Thanks
Analysis Solutions [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Tue, Jul 02, 2002 at 11:19:22PM -0400, Analysis Solutions wrote:
Oops. Forgot to escape the $:
$var = \$wins_$counter;
Oops. Forgot my promise to myself to
I know I'm not doing this right, but ..
What I want to do is display the value of $q1 through $q3.
How? I can't get eval() to do it, can I?
for ($i = 1; $i = 3; $i++)
{
$x= eval (\$q.$i);
echob$x/b\n;
echobrinput type=\hidden\ name=\a.$i.\ value=\\\n;
}
John
--
PHP General Mailing List
On Mon, 20 May 2002, jtjohnston wrote:
I know I'm not doing this right, but ..
What I want to do is display the value of $q1 through $q3.
How? I can't get eval() to do it, can I?
for ($i = 1; $i = 3; $i++)
{
$x= eval (\$q.$i);
echob$x/b\n;
echobrinput type=\hidden\ name=\a.$i.\
for ($i = 1; $i = 3; $i++) {
$x= $q$i;
$val=$$x;
echob$val/b\n;
echobrinput type=\hidden\ name=\a.$i.\ value=\\\n;
}
jtjohnston wrote:
I know I'm not doing this right, but ..
What I want to do is display the value of $q1 through $q3.
How? I can't get eval() to do it, can I?
for ($i = 1; $i
Sorry, please change line 2 with $x=q$i.
Bogdan
Bogdan Stancescu wrote:
for ($i = 1; $i = 3; $i++) {
$x= $q$i;
$val=$$x;
echob$val/b\n;
echobrinput type=\hidden\ name=\a.$i.\ value=\\\n;
}
jtjohnston wrote:
I know I'm not doing this right, but ..
What I want to do is display the
hi folks,
i'm having a problem using eval.
i have some html code interdispersed with php code (proper statement not
just variables) in a database. when i fetch the code and display it using :
$reg_adv_html=addslashes($reg_adv_html);
eval(\$reg_adv_html = \$reg_adv_html\;);
So, either:
? if ($radiobutton1 == on) { print selected; } ?
Or
? if ($radiobutton1 == on) print selected; ?
I found it very convenient for in-html coding to use the following
structure:
input blabla bla ? echo($radiobutton1 == on ? selected : );?
--
PHP General Mailing List
Hey
Does anybody know if its wise to use eval() ? I know Vbulletin uses it.. but
there is something about it I just cant digest.. it seems to be a very
powerfull function which can be very easily exploited... anyone else have
any thoughts?
Regards,
Kunal
--
PHP General Mailing List
Hi
I'm trying to pre-fill a form ( the data is passed via sessions or from
another script).
i have some check boxes on the form that i would like checked if the
variable is present.
any ideas
Paul Roberts
[EMAIL PROTECTED]
--
PHP General Mailing List
Hi
I'm trying to pre-fill a form ( the data is passed via sessions or from
another script).
i have some check boxes on the form that i would like checked if the
variable is present.
any ideas
Hi Paul:
I think that you can use JavaScript or VBScript to check the variable
and
PHP Gurus:
I have one for you. I'm sure there is a simple solution, but I'm having
difficulty finding it.
Let's say I have:
$content = ?PHP Query_Database( $category );?;
If I use ?PHP echo $content; ?, it doesn't evaluate that content. What am
I doing wrong here?
Is there an
On Friday 09 November 2001 11:51 am, Christopher Raymond wrote:
Let's say I have:
$content = ?PHP Query_Database( $category );?;
If I use ?PHP echo $content; ?, it doesn't evaluate that content. What am
I doing wrong here?
What you're doing doesn't make any sense. If it were to work, it
I just asked a similar question yesterday. The answer is, conveniently
enough, eval().
One trick from the php.net page on the function is to do somehting like
this:
$content = ?PHP Query_Database( $category );?;
echo eval (?$content);
Christopher Raymond wrote:
PHP Gurus:
I have one for
on 11/9/01 2:01 PM, Kurt Lieber at [EMAIL PROTECTED] wrote:
What you're doing doesn't make any sense. If it were to work, it would look
like the following:
?PHP ?PHP Query_Database( $category );? ; ?,
or something similar. I think what you want to do is:
?php
$content =
http://www.php.net/manual/en/function.eval.php
Kirk
-Original Message-
From: Christopher Raymond [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 1:11 PM
To: PHP List
Subject: Re: [PHP] Eval()??? A variables contents?
on 11/9/01 2:01 PM, Kurt Lieber at [EMAIL
Felipe Coury wrote:
Hi,
I am a beginner in PHP and I am trying to do the following: I have a form in
a page that has 3 fields: email_1, email_2 and email_3. I am trying to send
e-mail to those people, if the fields are filled. Relevant part of code:
?php
for ($i = 1; $i = 6; $i++) {
Hi,
I am a beginner in PHP and I am trying to do the following: I have a form in
a page that has 3 fields: email_1, email_2 and email_3. I am trying to send
e-mail to those people, if the fields are filled. Relevant part of code:
?php
for ($i = 1; $i = 6; $i++) {
$eval = '\$email =
lots of things:
1) variables in single-quoted strings aren't evaluated so you don't
need to escape the $ in $email
2) php uses . not + for concatenation.
3) try it like this:
eval('$email = $email_'.$i.';');
or
eval(\$email = \$email_$i;);
4) you can save yourself the trouble by using arrays
I want to evaluate some PHP code to a string. How can I do this?
$php_code = "echo 'hello';"
I would like to evaluate the code to "hello" in another string...
try
eval("\$php_code;");
-Ursprngliche Nachricht-
Von: [ rswfire ] [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 24. Januar 2001 15:36
An: [EMAIL PROTECTED]
Betreff: [PHP] eval() to string???
I want to evaluate some PHP code to a string. How can I do this?
$php_code = &q
6:20
An: [EMAIL PROTECTED]
Betreff: Re: [PHP] eval() to string???
How is this going to help me?
I want to evaluate the code in $php_code to *another* string...
- Original Message -
From: Thomas Weber
To: Php-General
Sent: Wednesday, January 24, 2001 10:14 AM
Subject: AW: [PHP] eval() t
Hi,
I want to evaluate the code in $php_code to *another* string...
you have to do it through output buffering:
ob_start();
eval($php_code);
$another_string=ob_get_contents();
ob_end_clean();
Rgds,
Tfr
--== [EMAIL PROTECTED] == http://tfr.cafe.ee/ == +372-50-17621 ==--
--
-Ursprngliche Nachricht-
Von: Robert S. White [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 24. Januar 2001 16:20
An: [EMAIL PROTECTED]
Betreff: Re: [PHP] eval() to string???
How is this going to help me?
I want to evaluate the code in $php_code to *another* string...
From
Hi, in my application I am making a lot of use of the eval() function,
however I was wondering if this is going to cause any extra load. Does it
do anything like load in the PHP engine again or anything? We just added it
in and the load on our web servers went up... so I was wondering if I
Yes, eval() is expensive.
On Sun, 14 Jan 2001, Adam Powell wrote:
Hi, in my application I am making a lot of use of the eval() function,
however I was wondering if this is going to cause any extra load. Does it
do anything like load in the PHP engine again or anything? We just added it
96 matches
Mail list logo