>>>>
>>>> I think there must be a solution, but I'm missing something here ..
>>>
>>>
>>> Check out the ob_* functions
>>>
>>> You could do this
>>>
>>> ob_start();
>>>
>>> include &q
t;>
>> echo $output;
>>
>> Jim
>>
>>>
>>> Thanks again!
>>>
>>> --
>>> Sorin Buturugeanu
>>> http://www.soin.ro
>>>
>>>
>>> On Wed, Jul 21, 2010 at 12:49 AM, Daevid Vincent
>>> wro
utput = ob_get_clean();
>
> echo $output;
>
> Jim
>
>>
>> Thanks again!
>>
>> --
>> Sorin Buturugeanu
>> http://www.soin.ro
>>
>>
>> On Wed, Jul 21, 2010 at 12:49 AM, Daevid Vincent
>> wrote:
>>>
>>>
p://www.soin.ro
>
>
> On Wed, Jul 21, 2010 at 12:49 AM, Daevid Vincent
> wrote:
>>
>> > -Original Message-
>> > From: Sorin Buturugeanu [mailto:m...@soin.ro]
>> > Sent: Tuesday, July 20, 2010 2:11 PM
>> > To: php-general@lists.php.net
>> &g
Vincent 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 w
> -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
>
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:
And I have the following code as part of the templating engine:
$template = file_get_contents($file);
$template = "return <<
If in the HTML file (te
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 anyo
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. Ra
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_ERR
When re-writing this example to a form of "create_function", the same
problem occurs:
$temporaryCalculationFunction = @create_function('', $code); // E_ERROR
here
if ($temporaryCalculationFunction === FALSE) {
$returnValue = '#N/A';
} else {
$returnValue =
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:
>
> $code = ' $returnValue = 12*A+; '; // Clearly inco
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:
Now, I'd like to catch the error made by eval:
// ...
try {
eval($code);
} catch (Exception
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:
Now, I'd like to catch the error made by eval:
// ...
try {
eval($code);
} catch (Exception
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:
Now, I'd like to catch the error made by eval:
// ...
try {
eval($code);
} catch (Exception $ex) {
var_dump($ex);
}
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 (htt
[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 General Mailing List (http://www.php.net/)
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
ne
Subject: Re: [PHP] eval();
On Sun, October 30, 2005 8:51 pm, John Taylor-Johnston wrote:
> eval( " ?> $contents
>>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
On Sun, October 30, 2005 8:51 pm, John Taylor-Johnston wrote:
> eval( " ?> $contents
>>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
eval( " ?> $contents
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 an html
On Sun, 2005-10-30 at 21:24 -0500, John Taylor-Johnston wrote:
>
> >>$contents = " >>arial,helvetica; font-weight: bold;\">About the Project
> >>";
> >>echo eval($contents);
> >>?>
> >>eval() expects PHP code, not HTML with embedded PHP code. Try this
> >>(untested):
> >>
> >>eval( " ?> $contents
$contents = "arial,helvetica; font-weight: bold;\">About the Project
";
echo eval($contents);
?>
eval() expects PHP code, not HTML with embedded PHP code. Try this
(untested):
eval( " ?> $contents
Scary. But it works.
Shouldn't that error because of the unexpected ?> and example?
John
--
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.
>
> $contents = " arial,helvetica; font-weight: bold;\">About the Project
> ";
> echo eval($contents);
> ?>
>
> I get thi
I need to generate embedded php within in a mysql record. $contents is
the actual contents of that record.
$contents = "arial,helvetica; font-weight: bold;\">About the Project
";
echo eval($contents);
?>
I get this error:
Parse error: parse error in /var/www/html2/test.php(4) : eval()'d code
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. Some
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
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', )
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 no
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 t
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
>> 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_
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
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:
Colors:
Then, in another file, I have this:
$file = file_get_contents( "colors.php"
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.
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
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:
Colors:
Then, in another file, I have this:
$file = file_get_contents( "colors.php" );
$colors = eval( $f
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
/usr/lo
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".$databasepagena
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> $contentarray = array(1=>'testpag
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 tryin
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 synta
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: pagena
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 w
Decapode Azur wrote:
Is it possible to put PHP code in eval ?
Or just vars ?
$string = 'The result of ';
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]
Just a question, what are you really trying to d
PHP-Code:
eval('?>'.$string)
Vars:
eval('$string="'.str_replace('"','\\"',$string).'";');
> Is it possible to put PHP code in eval ?
> Or just vars ?
> $string = 'The result of >';
> eval ($string);
?>>
--
Adrian
mailto:[EMAIL PROTECTED]
Is it possible to put PHP code in eval ?
Or just vars ?
';
eval ($string);
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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 conte
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"
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 y
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 i
$$ 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]
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 s
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
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
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 tho
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 li
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
C:\Projects\phpmag\admin\functions\admi
> ok ... what would 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 of data requests
> Currently, I'm using defined tags for replacing info from my CMS, eg:
>
> $str = ""
>
> Then I have a function that has all the objects in scope, and can
> perform the necessary replacements.
ok ... what would represent?
The output of $ofa-core->siteMapLink();?
If your using XML throughout - h
Thanks for your time, Dan.
Currently, I'm using defined tags for replacing info from my CMS, eg:
$str = ""
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 see how it
benefits ov
> - 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. Plac
- 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
At 14:47 03.03.2003, neko said:
[snip]
>$someVar = "testing 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
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.
Cu
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 pr
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 JU
hmm... I must be doing something wrong. This is still returning 000
"Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Tue, Jul 02, 2002 at 10:45:27PM -0400, Analysis & Solutions wrote:
>
> >$var = "$wins_$counter";
>
> Oops. F
This doesn't seem to work. Here's my demo.
This returns 000, it should return 743
"Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Tue, Jul 02, 2002 at 10:19:59PM -0400, Greg Wineman wrote:
> >
> > He are the variables from my for
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
sq
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 dangero
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
wins_3=
Sorry, please change line 2 with $x="q$i".
Bogdan
Bogdan Stancescu wrote:
> for ($i = 1; $i <= 3; $i++) {
> $x= "$q$i";
> $val=$$x;
> echo"$val\n";
> echo"\n";
> }
>
>
>
> jtjohnston wrote:
>
>> I know I'm not doing this right, but ..
>>
>> What I want to do is display the value of $q1 through
for ($i = 1; $i <= 3; $i++) {
$x= "$q$i";
$val=$$x;
echo"$val\n";
echo"\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 <= 3; $i++)
>{
>$x= eval ("\$q".$i
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);
> echo"$x\n";
> echo"\n";
> }
eval() is for runni
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);
echo"$x\n";
echo"\n";
}
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
> So, either:
>
>
>
> Or
>
>
I found it very convenient for in-html coding to use the following
structure:
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-
> value="reg1" ?>>
You either need to remove the opening {, or put a corresponding } at the end
of the if() statement.
So, either:
Or
HTH
Jon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECT
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\";");
$reg
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 (http://www.
> 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 varia
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 (http://www.ph
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
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:
>
> ; ?>,
>
> or something similar. I think what you want to do is:
> $content = query_database($category);
> echo $content;
> ?>
>
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 = "";
echo eval ("?>$content");
Christopher Raymond wrote:
>
> PHP Gurus:
>
> I have one for you. I'm sure there is a
On Friday 09 November 2001 11:51 am, Christopher Raymond wrote:
> Let's say I have:
>
> $content = "";
>
>
> If I use , 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 would look
like the following:
; ?>,
or som
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 = "";
If I use , it doesn't evaluate that content. What am
I doing wrong here?
Is there an equivalent to JavaScript's eval($commands) function?
TIA,
Ch
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:
>
> for ($i = 1; $i <= 6; $i++)
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
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:
The code complains about an error in line eval( $eval );:
Parse
>-Ursprüngliche 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
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 >==--
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:
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() to string???
> try
>
try
eval("\$php_code;");
-Ursprüngliche 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
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...
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
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 shou
98 matches
Mail list logo