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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:31:52+00:00 2026-06-08T18:31:52+00:00

I am making a web server using webpy and right now I have a

  • 0

I am making a web server using webpy and right now I have a simple form and a special class I wrote. I want the user to be able to write in code to the form and if the input is a function call, to call the function the user submitted, else do anything with the input if it’s not a function call. I believe this would have to be achieved somewhere in the template file? any help would be appreciate

  • 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-08T18:31:53+00:00Added an answer on June 8, 2026 at 6:31 pm

    If I understand correctly, you’re looking for a way to run client-submitted code on the server, getting input from a form.

    So assuming you have a form template that looks something like this (note the name of the textarea element):

    <form method="POST">
    <textarea name="code" />
    <input type="submit">
    </form>
    

    you will want to add a POST method to your page class to handle the input and run the code:

    class MyPage:
        def POST(self):
            data = web.input()
            eval(data.code)
    

    This is not something you should do with a form that is accessible to anybody you don’t trust completely, as it gives the ability to run any code they want on your web-server (e.g. they could easily try and delete all the files on the server). But if you’re ok with the security risks or just playing around, be sure to read the docs for Pythons eval to see the other arguments you can pass to it.

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

Sidebar

Related Questions

I'm making a simple web server using PHP and sockets. Everything is working fine
How would i go about making a web server believe that i am using
When making a call to a web service running on a server using HTTPS
I'm making simple http post request using libcurl to index.php file on my web
I'm using Tornado web server and want to take advantage of static caching for
I want to start using OAuth to call my web server apis. Preferably I
I have a jsp servlet application. I am using tomcat5.5 as web server and
i am using WSS 2.0 with sharepoint portal server 2003. i am making web
I am making an iphone application which has user information on a web server.
I'm making an application (web based) using flex and i have a requirment to

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.