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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:33:59+00:00 2026-05-14T22:33:59+00:00

I have a CGI based form that I am working with and I would

  • 0

I have a CGI based form that I am working with and I would like to be able to include some PHP code in the generated results. However, when I do this, the PHP does not appear to get processed and just ends up being displayed in the resulting web page.

Is what I am doing actually possible or am I missing something?

Thanks.

  • 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-14T22:34:00+00:00Added an answer on May 14, 2026 at 10:34 pm

    No, that’s not possible. You could however, in a PHP script, include('http://url.to/cgi/script'); and then point your browser at the PHP script rather than the CGI script. This will cause PHP to open a new connection to the server, execute the CGI script, and then parse it’s output as if it were a PHP script.

    EDIT2: Here’s how you could do it with postdata including file uploads:

    // Edit to match your CGI URI:
    $url_to_cgi = "http://{$_SERVER['SERVER_NAME']}/cgi-bin/something.cgi";
    
    $curl = curl_init($url_to_cgi);
    curl_setopt($curl,CURLOPT_POST, true);
    curl_setopt($curl,CURLOPT_RETURNTRANSFER, true);
    
    // Pass POSTDATA along to the CGI script:
    $postdata = $_POST;
    
    // If we have file uploads, pass those along too:
    if(is_array($_FILES)) foreach($_FILES as $key => $file)
      $post[$key] = "@{$file['tmp_name']}";
    
    curl_setopt($curl,CURLOPT_POSTFIELDS, $postdata);
    
    $file = tempnam('/tmp','php-curl-');
    file_put_contente($file, curl_exec($curl);
    
    include($file);
    
    unlink($file);
    

    Please note that’s untested…

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

Sidebar

Related Questions

I have used this tutorial to make a website, but I would like that
I have a PHP script that runs as a CGI program and the HTTP
I have application that works using Perl's CGI::Fast . Basically mainloop of the code
I have a Perl-based CGI/Fast CGI web service and want to rate-limit clients by
I have a cgi script which takes form input, I want to facilitate the
I have a CGI script that prints the following on stdout: print Status: 302
I have a website cgi-bin program that is written in c++. Unfortunately the website
I have written a CGI script that creates an image dynamically using GET data.
I have a Windows CGI created with Delphi 2007 using CGIExpert that I need
I have a small cgi script that fetches and validates a configuration file for

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.