Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WHY PERL RETURN ALL DE CODE 1

Status
Not open for further replies.

Aresti

Programmer
Jul 3, 2008
2
HI I AM WRITTING A HTML WITH JAVASCRIPT, IT RETURNS SOMETHING FROM A PL, THE THING I DONT KNOWS IS WHY IT IS RETURNING ALL THE CODE INSTEAD OF THE PART I PUTED TO BE PRINTED
HERE IS THE WEBSITE
HERE IS THE PERL CODE

#!/usr/bin//perl
use CGI qw:)standard);

use DBI;




$nombre = param ('nombre');


require "config.pl";

$dbh = bdatos();




$sth = $dbh->prepare("select * from clientesCA where nombre = '$nombre';");




$sth->execute;
my ($id,$nombre1,$direccion) = $sth->fetchrow();
print header;
print "Content-type: text/html\n\n";
print<<clientes;
<table style="border: 1px solid #000000">
<tr>
<td>
$id
</td>
<td>
$nombre1
</td>
<td>
$direccion
</td>
</tr>
</table>
clientes
 
I seem to remember from other posts this can happen if it's not in the CGI bin directory - instead of getting executed, it just gets served up like a HTML page. Perhaps one of the Apache gurus here can give you a more accurate answer?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
by default it will only run in the cgi-bin directory.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
More than likely the script is in the wrong folder, just move it to where CGI scripts should be run from or change the folder it is in to have execution permissions and see if it works. Many servers tell you to put scripts in the cgi-bin but in reality many also allow you to run them from anywhere just by changing the folders permissions. I guess they just don't want their customers to know that.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Thanks, In fact the problem was that the script was not on the correct folder...,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top