Re: [PHP] eval and HEREDOC

2010-07-21 Thread Sorin Buturugeanu
>>>> >>>> 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

Re: [PHP] eval and HEREDOC

2010-07-20 Thread Peter Lind
t;> >> echo $output; >> >> Jim >> >>> >>> Thanks again! >>> >>> -- >>> Sorin Buturugeanu >>> http://www.soin.ro >>> >>> >>> On Wed, Jul 21, 2010 at 12:49 AM, Daevid Vincent >>> wro

Re: [PHP] eval and HEREDOC

2010-07-20 Thread Sorin Buturugeanu
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: >>> >>>

Re: [PHP] eval and HEREDOC

2010-07-20 Thread lists
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

Re: [PHP] eval and HEREDOC

2010-07-20 Thread Sorin Buturugeanu
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

RE: [PHP] eval and HEREDOC

2010-07-20 Thread Daevid Vincent
> -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 >

[PHP] eval and HEREDOC

2010-07-20 Thread Sorin Buturugeanu
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

Re: [PHP] eval uquestion

2008-03-19 Thread Andrew Ballard
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

[PHP] eval uquestion

2008-03-19 Thread chetan rane
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

Re: [PHP] Re: PHP eval() fatal error

2007-08-27 Thread Richard Lynch
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

[PHP] Re: PHP eval() fatal error

2007-08-26 Thread Maarten Balliauw
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 =

Re: [PHP] PHP eval() fatal error

2007-08-26 Thread Richard Lynch
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

[PHP] Re: PHP eval() fatal error

2007-08-20 Thread M. Sokolewicz
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

Re: [PHP] PHP eval() fatal error

2007-08-20 Thread Stut
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

[PHP] PHP eval() fatal error

2007-08-20 Thread Maarten Balliauw
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); }

Re: [PHP] Eval To String

2005-12-07 Thread David Grant
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

RE: [PHP] Eval To String

2005-12-07 Thread Jay Blanchard
[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/)

[PHP] Eval To String

2005-12-07 Thread Shaun
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

RE: [PHP] eval();

2005-10-30 Thread Josh McDonald
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

Re: [PHP] eval();

2005-10-30 Thread Richard Lynch
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

Re: [PHP] eval();

2005-10-30 Thread John Taylor-Johnston
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

Re: [PHP] eval();

2005-10-30 Thread Jasper Bryant-Greene
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

Re: [PHP] eval();

2005-10-30 Thread John Taylor-Johnston
$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 --

Re: [PHP] eval();

2005-10-30 Thread Jasper Bryant-Greene
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

[PHP] eval();

2005-10-30 Thread John Taylor-Johnston
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

Re: [PHP] Eval string to array

2005-01-24 Thread Gerard Samuel
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

Re: [PHP] Eval string to array

2005-01-24 Thread Jochem Maas
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

[PHP] Eval string to array

2005-01-24 Thread Gerard Samuel
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', )

Re: [PHP] eval() with CONSTANTS

2004-05-20 Thread Tom Rogers
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

[PHP] eval() with CONSTANTS

2004-05-20 Thread Greg Donald
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

Re: [PHP] eval() question

2004-04-21 Thread OrangeHairedBoy
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

RE: [PHP] eval() question

2004-04-21 Thread Michael Sims
>> 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_

Re: [PHP] eval() question

2004-04-21 Thread OrangeHairedBoy
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

Re: [PHP] eval() question

2004-04-21 Thread Marek Kilimajer
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"

Re: [PHP] eval() question

2004-04-21 Thread OrangeHairedBoy
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

RE: [PHP] eval() question

2004-04-21 Thread Michael Sims
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

[PHP] eval() question

2004-04-21 Thread OrangeHairedBoy
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

Re[2]: [PHP] eval function

2003-08-23 Thread Tom Rogers
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

Re: [PHP] eval function

2003-08-23 Thread Matthias Wulkow
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

Re: [PHP] eval function

2003-08-23 Thread Matthias Wulkow
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

Re[2]: [PHP] eval function

2003-08-23 Thread Tom Rogers
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

Re: [PHP] eval function

2003-08-23 Thread Matthias Wulkow
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

Re: [PHP] eval function

2003-08-22 Thread Tom Rogers
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

[PHP] eval function

2003-08-22 Thread Matthias Wulkow
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

Re: [PHP] eval

2003-07-31 Thread Joona Kulmala
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

Re: [PHP] eval

2003-07-31 Thread Adrian
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]

[PHP] eval

2003-07-31 Thread Decapode Azur
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

Re: [PHP] Eval var from query

2003-07-14 Thread David Nicholson
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

Re: [PHP] Eval var from query

2003-07-14 Thread David Nicholson
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"

Re: [PHP] Eval var from query

2003-07-14 Thread Marco Tabini
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

[PHP] Eval var from query

2003-07-14 Thread Shawn McKenzie
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

Re: [PHP] Eval or $$ are they the same or is $$ safer

2003-06-11 Thread Leif K-Brooks
$$ 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]

Re: [PHP] Eval or $$ are they the same or is $$ safer

2003-06-11 Thread Shawn McKenzie
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

Re: [PHP] Eval or $$ are they the same or is $$ safer

2003-06-11 Thread Leif K-Brooks
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

[PHP] Eval or $$ are they the same or is $$ safer

2003-06-11 Thread Jason Lehman
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

Re: [PHP] eval error

2003-03-10 Thread Chris Hayes
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

Re: [PHP] eval error

2003-03-10 Thread Marek Kilimajer
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

[PHP] eval error

2003-03-10 Thread Alawi
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

Re: [PHP] eval challenge

2003-03-04 Thread neko
> 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

Re: [PHP] eval challenge

2003-03-04 Thread Dan Hardiker
> 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

Re: [PHP] eval challenge

2003-03-04 Thread neko
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

Re: [PHP] eval challenge

2003-03-04 Thread Dan Hardiker
> - 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

[PHP] eval challenge

2003-03-04 Thread neko
- 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

Re: [PHP] eval help

2003-03-03 Thread Ernest E Vogelsinger
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

[PHP] eval help

2003-03-03 Thread neko
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

Re: [PHP] eval problem

2002-07-02 Thread Greg Wineman
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

Re: [PHP] eval problem

2002-07-02 Thread Analysis & Solutions
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

Re: [PHP] eval problem

2002-07-02 Thread Greg Wineman
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

Re: [PHP] eval problem

2002-07-02 Thread Greg Wineman
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

Re: [PHP] eval problem

2002-07-02 Thread Analysis & Solutions
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

Re: [PHP] eval problem

2002-07-02 Thread Analysis & Solutions
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

[PHP] eval problem

2002-07-02 Thread Greg Wineman
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=

Re: [PHP] eval()

2002-05-20 Thread Bogdan Stancescu
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

Re: [PHP] eval()

2002-05-20 Thread Bogdan Stancescu
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

Re: [PHP] eval()

2002-05-20 Thread Miguel Cruz
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

[PHP] eval()

2002-05-20 Thread jtjohnston
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:

Re: [PHP] eval on php embedded html

2002-01-24 Thread Atanas Vassilev
> 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-

RE: [PHP] eval on php embedded html

2002-01-24 Thread Jon Haworth
> 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

[PHP] eval on php embedded html

2002-01-24 Thread DigitalKoala
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

[PHP] eval()

2002-01-20 Thread Kunal Jhunjhunwala
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.

Re: [PHP] eval on a form

2001-12-09 Thread Diego Pérez
> 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

[PHP] eval on a form

2001-12-09 Thread Paul Roberts
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

RE: [PHP] Eval()??? A variables contents?

2001-11-09 Thread Johnson, Kirk
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

Re: [PHP] Eval()??? A variables contents?

2001-11-09 Thread Christopher Raymond
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; > ?> >

Re: [PHP] Eval()??? A variables contents?

2001-11-09 Thread Chris Hobbs
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

Re: [PHP] Eval()??? A variables contents?

2001-11-09 Thread Kurt Lieber
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] Eval()??? A variables contents?

2001-11-09 Thread Christopher Raymond
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

Re: [PHP] Eval error

2001-08-16 Thread Pavel Jartsev
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++)

Re: [PHP] Eval error

2001-08-15 Thread Mark Maggelet
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

[PHP] Eval error

2001-08-15 Thread Felipe Coury
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

Re: AW: [PHP] eval() to string???

2001-01-24 Thread Steve Edberg
>-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

RE: [PHP] eval() to string???

2001-01-24 Thread indrek siitan
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 >==--

AW: [PHP] eval() to string???

2001-01-24 Thread Thomas Weber
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:

Re: [PHP] eval() to string???

2001-01-24 Thread Robert S. White
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 >

AW: [PHP] eval() to string???

2001-01-24 Thread Thomas Weber
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

[PHP] eval() to string???

2001-01-24 Thread [ rswfire ]
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...

Re: [PHP] eval() function

2001-01-14 Thread Rasmus Lerdorf
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

[PHP] eval() function

2001-01-14 Thread Adam Powell
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