TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 09-05-2011, 09:48 AM   #1 (permalink)
The Visitor
 
Join Date: Sep 2011
Location: Eindhoven, Netherlands
Posts: 4
Thanks: 1
exangelus is on a distinguished road
Default eval() issue

Hey all,

I'm new here and like to join the community to ask & answer!
From the netherlands as a airline pilot student and part-time php programmer :)

At my current project I got a situation in which I call a method from a child class and the parameter's are also defined in a config file. So using the config file info I build up the correct argument order, the variables are defined before that. Now I wanna use eval() to call my method but I get the following error:

Quote:
A PHP Error was encountered

Severity: 4096

Message: Object of class Rapport could not be converted to string

Filename: controllers/rapport.php

Line Number: 62
The code:

PHP Code:
//argumenten ophalen
                
$arguments $rapportages[$rapportage]['arguments'];

                
//argumenten definen
                
foreach($arguments as $arg) {
                    $
$arg false;
                }
                
                
//daadwerkelijk bekende argument definen
                
$$sorteer_methode $sorteer_optie;
                
                
//argumentvolgorde maken voor eval()
                
$arg_order '';
                foreach(
$arguments as $arg) {
                    
$arg_order .= '$' $arg ', ';
                }
                
$arg_order substr($arg_order0, -2);
                
                
//functie aanroepen
                
eval("$this->$method($arg_order)"); 
$sorteer_optie is the argument I know and the others are already set false, this all seems ok but the eval() call doesn't work.
Think I need to escape it in some way but just putting a backward slash in front of $this won't work..

Thanks in advance!
exangelus is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Str _replace Issue Tim Dobson Absolute Beginners 2 03-05-2011 06:29 PM
Template Class Issue tego10122 Advanced PHP Programming 1 12-28-2010 07:08 PM
Frustrating PNG Issue on IE 6 aristoworks XHTML, HTML, CSS 5 11-10-2008 08:18 AM
eval remake TlcAndres Tips & Tricks 2 05-23-2008 10:41 AM
eval - seperate instace. TlcAndres Advanced PHP Programming 3 01-02-2008 08:30 PM


All times are GMT. The time now is 07:49 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design