Jump to content

Installing A Simple Cgi Script!


cuco

Recommended Posts

Hi guys, I'm just trying to run a very simple cgi script using Perl. I placed my CGI script under the cgi-bin directory but I don't get anything. Here are the errors I got:

 

File does not exist: /home/empresa/public_html/public_html/cgi-bin/testform.cgi

File does not exist: /home/empresa/public_html/404.shtml

Premature end of script headers: /home/empresa/public_html/scgi-bin/testform.cgi

 

This last error I tried to see what would happen; no luck. I also don't understand why in the first error I get /public_html repeated twice??

 

I was just testing this really small script to see if it works!

 

Thanks for your help.

Link to comment
Share on other sites

Hi,

 

can you provide a link to the page - or a copy of the code calling the script.

 

It looks like you have the code incorrect, and have the public_html in twice when calling the script. Hence it cannot find the file. It then tries to call the 404 page - because it couldn't find the file - but that doesn't exist either.

Link to comment
Share on other sites

Yes sir, this solve the problem, thank you very much!! Now I have another problem. I'm trying to do a simple form that let users contact me via email. My form is here: www.empresasmilanes.com/contactenos.htm. This form calls a script called sendmail.php. The thing is that when you click submit, you get the php code displayed on the browser. I placed the .php file under public_html, is this correct??

 

Thanks...

Link to comment
Share on other sites

Did you create the sendmail.php page with a plain text editor?

 

The <?php part is not right

it is displayed as

 

<body>

<?<br>

$email = $_REQUEST['email'];<br>

 

It should be

 

<body>

<?php

$email = $_REQUEST['email'];

 

Also you cannot mix html like the <br>

inside of php code.

 

you can use echo("<br>");

Edited by TCH-Don
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...