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 3495180
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:05:43+00:00 2026-05-18T12:05:43+00:00

What I have and want to do I have an input area . I

  • 0

What I have and want to do

  • I have an input area.

  • I have a JS script what reads the input area‘s innerHTML and encodes it using encodeURICompontent then sends the value to evaluate.php?code=+value;

  • I have an evaluate.php what GET‘s the code‘s value from the URL and returns an evaluated value using eval($code) to the javascript.

  • And at the end it puts the xmlHttp.responseText to a div.

But I get this error when the eval is executed:

Parse error: syntax error, unexpected ‘”‘, expecting T_STRING in /Applications/MAMP/htdocs/Apps/editor/includes/exe.php(5) : eval()’d code on line 1

Evaluate.php

if(isset($_GET["code"])){
    $e = $_GET["code"];
    echo eval($e);
}

The value what I try to evaluate is just:

echo "Hello World!";

Then this is looks like in $_GET["code"] as:

echo \"Hello World!\";
  • 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-05-18T12:05:44+00:00Added an answer on May 18, 2026 at 12:05 pm

    According to PHP’s documentation:

    eval() returns NULL unless return is
    called in the evaluated code, in which
    case the value passed to return is
    returned. If there is a parse error in
    the evaluated code, eval() returns
    FALSE and execution of the following
    code continues normally. It is not
    possible to catch a parse error in
    eval() using set_error_handler().

    So I think there may be a problem when you run echo eval($e).

    P.S. It’s best practice not to use double quotes in PHP unless a variable is contained within those quotes. For example, use "Hello, $name" and use 'Hello, Bob'.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text input field like text box or text area. I want
I have a scientific application for which I want to input initial values at
I have a codeigniter webform, I want to input city/state details from the user,
I have some problem. Dialog.dismiss() does not work. I want to input ip, username,
I want to have two input with one button for user to enter their
I am want to have a input box, where a user can add or
I want to have a form on my page take user input, a URL
I have two forms on one page and want to have the input boxes
I have an POCO object and based on the number input I want to
I'm new to jQuery and I want to have a input box from a

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.