Fatal Error Call To Undefined Function Eval
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PHP Error Undefined Functions [closed] up vote -1 down vote favorite 1 I am getting Error Undefined Function. Here is the code: $myvar = "@file_get_contents"; eval($myvar("http://someurlupdatehere.com")); The error I get is: Fatal error: Call to undefined function @file_get_contents() .. eval php share|improve this question edited May 13 '13 at 20:33 hakre 134k26216387 asked May 13 '13 at 20:15 Satch3000 10.2k62148247 closed as too localized by PeeHaa, Dejan Marjanovic, nice ass, hakre, George Cummins May 13 '13 at 20:32 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question. 3 Remove the error control operator lol –nice ass May 13 '13 at 20:17 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote accepted It looks really weird to me what you are trying to do. I tend to say "Don't use eval, don't do that!" ;) Anyway, here comes the right syntax: $myvar = "@file_get_contents"; eval("$myvar('http://someurlupdatehere.com');"); Or if you need the return value of file_get_contents() in a variable (what is likely, use this: $myvar = "@file_get_contents"; eval("\$file = $myvar('http://someurlupdatehere.com');"); echo $file; share|improve this answer answered May 13 '13 at 20:17 hek2mgl 76.1k885107 2 The right syntax is file_get_contents('http://someurlupdatehere.com');, no eval –nice ass May 13 '13 at 20:25 @OneTrickPony How can you say this, without knowing what OP is trying to do? Don't like such statements. –hek2mgl May 13 '13 at 20:47 If the OP is trying to do anything else that this question suggests, (s)he should update the Q accordingly. Otherwise my statement remains valid –nice ass May 13 '13 at 21:17 add a comment| up vote 3 down vote @file_get_contents() is not
that make connections all over the world. Join today Download & Extend Drupal Core Distributions Modules Themes Views PDFIssues Fatal error: Call to undefined function php_eval() Closed (fixed)Project:Views PDFVersion:7.x-1.x-devComponent:CodePriority:NormalCategory:Bug reportAssigned:UnassignedReporter:drupadawanCreated:April 3, 2012 - 13:35Updated:July 15, 2013 - 07:13 Log in or register to update this issue Jump to:Most recent attachment When trying to access the pdf-view page I get this error: Fatal error: Call to http://stackoverflow.com/questions/16530400/php-error-undefined-functions undefined function php_eval() in C:\wamp\www\drupac\sites\all\modules\views_pdf\views_pdf_template.php on line 476 (however I can see the pdf page using the 7.x-1.x-rc1 version)Files: CommentFileSizeAuthor #31 php_eval-1513490-31.patch298 byteskillua99 #28 views_pdf-undefined_index_function-1513490-28.patch971 bytespsicomante #16 views_pdf-1513490-16-conditionnal_php_eval.patch1019 bytesSimon Georges #13 conditional_php_eval-1513490-13.patch1.02 KBidflood #7 views_pdf-add_required_module_to_deps-1513490-7.patch298 bytesfirebird #5 views-pdf-fix-undefined-eval.patch684 bytesfarald Comments Comment #1 zorax CreditAttribution: zorax commented April 5, 2012 at 8:42am https://www.drupal.org/node/1513490 Same issue, I use Commerce PDF Invoice with. I can enter in the view UI, but can't generate a pdf Log in or register to post comments Comment #2 maddin2007 CreditAttribution: maddin2007 commented April 6, 2012 at 6:33pm I am not deep enough in Drupal, but a workaround is to use the standard eval-function from php ... works for me fine ... not to use the php_eval() from drupal. Just replace in the 2 lines in the views_pdf_template.php "php_eval" with "eval" and it works. (line 476 and line 506) Log in or register to post comments Comment #3 zorax CreditAttribution: zorax commented April 7, 2012 at 10:19am It works for me! thanks a lot!! Log in or register to post comments Comment #4 drupadawan CreditAttribution: drupadawan commented April 17, 2012 at 7:57am I don't know if there is a particular reason why the 'php_eval' is used instead of 'eval',
Errors Exceptions Generators References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Context options and parameters Supported Protocols and Wrappers Security Introduction General considerations Installed as CGI http://php.net/manual/en/function.eval.php binary Installed as an Apache module Session Security Filesystem Security Database Security Error Reporting Using Register Globals User Submitted Data Magic Quotes Hiding PHP Keeping Current Features HTTP authentication with PHP Cookies Sessions Dealing with XForms Handling file uploads Using remote files Connection handling Persistent Database Connections Safe Mode Command line usage Garbage Collection DTrace Dynamic fatal error Tracing Function Reference Affecting PHP's Behaviour Audio Formats Manipulation Authentication Services Command Line Specific Extensions Compression and Archive Extensions Credit Card Processing Cryptography Extensions Database Extensions Date and Time Related Extensions File System Related Extensions Human Language and Character Encoding Support Image Processing and Generation Mail Related Extensions Mathematical Extensions Non-Text MIME Output Process Control Extensions Other fatal error call Basic Extensions Other Services Search Engine Extensions Server Specific Extensions Session Extensions Text Processing Variable and Type Related Extensions Web Services Windows Only Extensions XML Manipulation Keyboard Shortcuts? This help j Next menu item k Previous menu item g p Previous man page g n Next man page G Scroll to bottom g g Scroll to top g h Goto homepage g s Goto search(current page) / Focus search box exit » « die PHP Manual Function Reference Other Basic Extensions Misc. Misc. Functions Change language: English Brazilian Portuguese Chinese (Simplified) French German Japanese Korean Romanian Russian Spanish Turkish Other Edit Report a Bug eval (PHP 4, PHP 5, PHP 7)eval — Evaluate a string as PHP code Description mixed eval ( string $code ) Evaluates the given code as PHP. Caution The eval() language construct is very dangerous because it allows execution of arbitrary PHP code. Its use thus is discouraged. If you have carefully verified that there is no other option than to use this construct,