Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7936071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:06:01+00:00 2026-06-03T22:06:01+00:00

This is my code; $script = $row[‘script’]; // $row is from database and the

  • 0

This is my code;

$script = $row['script']; 

   // $row is from database and the $row['script'] is exeactly the same with $script commented below.
  // $script ="global \$timedate;\$target =\$timedate->now();return \$target;";

return eval($script);

When I uncomment the $script, it will run correctly. However, if I commnent $script and load the value from $row[‘script’], the eval get error below:

 [12-May-2012 22:09:25 UTC] PHP Parse error:  syntax error, unexpected $end in C:\Users\iopen\Documents\IOPEN\Project\Clients\sugarcrm\hfcrmlocal\custom\modules\iopenwf\model\IOpenAction.php(56) : eval()'d code on line 3

Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:06:02+00:00Added an answer on June 3, 2026 at 10:06 pm

    Don’t use eval its a very bad idea.

    For experimenting purpose you can use stripslashes to remove most slashes issues

    class Test {
        function now() {
            return time ();
        }
    }
    
    $timedate = new Test ();
    $script = "global \$timedate;\$target =\$timedate->now();return \$target;";
    $script = stripslashes ( $script );
    var_dump ( eval ( $script ) );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my ruby+mechanize(nokogiri) script I use this piece of code: row.at_xpath('td[3]/div[1]/a/text()').to_s.strip on a forum
I have a python script the runs this code: strpath = sudo svnadmin create
I have this code: <script type=text/javascript> var maxLength=10; function charLimit(el) { if (el.value.length >
I have this code in userpage.php: <script langauge=JavaScript><!-- function newWindow(fileName,windowName) { msgWindow=window.open(fileName,windowName); } //--></script>
I have this code to show a map using the Virtual Earth API: <script
I have tryed to run this code in my console: script/plugin install git://github.com/apotonick/cells.git ...but
I have this code in a .html.erb file: <script src=http://connect.facebook.net/en_US/all.js#xfbml=1></script> <script> FB.Event.subscribe('edge.create', function(response) {
Say I have this code in my page: <script language=javascript> $(document).ready(function() { $(.test).click(function() {
I have this code: <div id=gll_select> <script> var caffe = $(#caffe).val(); $(#gll_select).load(<?php echo base_url()
I used this code for sending and returning result. <script type=text/javascript> $(document).ready(function() { $('.special').click(function(){

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.