Re: [PHP] evaluating a variable

2003-12-22 Thread Brad Pauly
On Mon, 2003-12-22 at 12:36, Carey Baird wrote: Hey, I have stored the name of a function as a variable. I have then passed the variable to another function as follows: //put function name in a variable $contentfunction = newsadmincontent(); //pass variable to another function

Re: [PHP] evaluating a variable

2003-12-22 Thread Matt Matijevich
try eval($contentfunction); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] evaluating a variable

2003-12-22 Thread Carey Baird
December 2003 19:43 To: Carey Baird Cc: php-gen Subject: Re: [PHP] evaluating a variable On Mon, 2003-12-22 at 12:36, Carey Baird wrote: Hey, I have stored the name of a function as a variable. I have then passed the variable to another function as follows: //put function name in a variable

RE: [PHP] evaluating a variable

2003-12-22 Thread Matt Matijevich
[snip] Eval ($contentfunction); gave me a parse error: Parse error: parse error in /home/pickled/public_html/main/inc/html.php(145) : eval()'d code on line 1 [/snip] try to add a semicolon to the end of the variable $contentfunction = newsadmincontent();; -- PHP General Mailing List

RE: [PHP] evaluating a variable

2003-12-22 Thread Brad Pauly
On Mon, 2003-12-22 at 12:43, Carey Baird wrote: Eval ($contentfunction); gave me a parse error: Parse error: parse error in /home/pickled/public_html/main/inc/html.php(145) : eval()'d code on line 1 $$contentfunction didnt output anything Any other ideas? What are you trying to do

Re: [PHP] evaluating a variable

2003-12-22 Thread John W. Holmes
Carey Baird wrote: Hey, I have stored the name of a function as a variable. I have then passed the variable to another function as follows: //put function name in a variable $contentfunction = newsadmincontent(); Take off the parenthesis... $contentfunction = 'newsadmincontent'; To call the

Re: [PHP] evaluating a variable

2003-12-22 Thread Brad Pauly
On Mon, 2003-12-22 at 13:09, John W. Holmes wrote: Carey Baird wrote: Hey, I have stored the name of a function as a variable. I have then passed the variable to another function as follows: //put function name in a variable $contentfunction = newsadmincontent(); Take off the

RE: [PHP] evaluating dynamic variable

2003-09-02 Thread Jay Blanchard
[snip] I'm having trouble evaluating a dynamic variable. I want to check if the variable $_POST[resolutions$i] is an empty string, as you'll see from the code. However, every way I've tried to check the variable so far (including empty() and eval()) always returns a null value, even when the

Re: [PHP] evaluating dynamic variable

2003-09-02 Thread Matt Matijevich
this worked for me. ? $entries = 20; for ($i=1; $i=$entries; $i++) { if(isset($_POST[resolutions$i]) $_POST[resolutions$i] !== ''){ echo Hello $ibr /; } } ? html body form method=POST input type=hidden name=resolutions1 value=etefgtE / input type=hidden name=resolutions3

RE: [PHP] evaluating dynamic variable

2003-09-02 Thread Chris W. Parker
Steve Goodman mailto:[EMAIL PROTECTED] on Tuesday, September 02, 2003 12:54 PM said: Can someone recommend a way to reliably evaluate this variable? 1. (not positive on this point so correct me if I'm wrong) you shouldn't compare with !==. Instead us !=. 2. What does the following do?

RE: [PHP] evaluating dynamic variable

2003-09-02 Thread Chris W. Parker
Chris W. Parker on Tuesday, September 02, 2003 1:29 PM said: 1. (not positive on this point so correct me if I'm wrong) you shouldn't compare with !==. Instead us !=. Ok, turns out I'm wrong on that. I guess I should go look it up!! -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] evaluating dynamic variable

2003-09-02 Thread Stephen Goodman
singular, not plural. Thanks for the help everyone . -Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 02, 2003 3:29 PM To: Stephen Goodman; [EMAIL PROTECTED] Subject: RE: [PHP] evaluating dynamic variable Steve Goodman mailto:[EMAIL PROTECTED

Re: [PHP] evaluating dynamic variable

2003-09-02 Thread CPT John W. Holmes
From: Stephen Goodman [EMAIL PROTECTED] When I run the code you've attached, with $i iterating up to 3, I get three 'empty!', even if $resolution1 should be 'not empty!'. It seems like the $i in $_POST[resolutions.$i] is not getting parsed into a value, and php is looking for a key