Solved

I need to change this into CGI please help Urgent

Posted on 2004-10-19
7
196 Views
Last Modified: 2013-12-25
If it is wrote in perl how do I include it in an html page to call it

the  script

if(isset($account)) {
$contents = file_get_contents("bia.dat");
if (strpos($contents, $account) === false) {
$alert2 = "";

}
else {
$alert2 = "Alert Account Exists";
   echo $alert2;
}
}


this is what i had in the html page

<?php $ip = "12233432"; $account ="6763364"; include ("check.php") ?>

Thanks
0
Comment
Question by:hewtluca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 12351933
Your script is neither Perl nor PHP nor shell script.

It seems to be a combination of all three, hence it won't run.

First you need to decide which language you want to use, then we can work on how to call it.

If you really want Perl, then you call it via SSI or CGI.
0
 
LVL 2

Author Comment

by:hewtluca
ID: 12351965
Uh..... It is a php script .... I know for sure!!! I wrote it.  And it is what I do for a living. I just did not put <?php ?>

All I want is to have it changed into cgi I am a Php programmer not CGI

Thanks,

Hewt
0
 
LVL 48

Expert Comment

by:Tintin
ID: 12352677
I'm sure PHP doesn't use === for comparisons.  I think you meant ==

To turn it into a CGI script, you just need to add a MIME header to the output,:

Content-Type:  text/html

Make sure you have a blank lline after the header.

Not familar with PHP, but I assume you do

echo "Content-Type:  text/html\n\n"
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Accepted Solution

by:
mrielf earned 500 total points
ID: 12386507
You can include perl with SSI (server side include)
see: http://www.htmlgoodies.com/beyond/ssi.html

Include ssi in your shtml file

<!--#exec cgi="/cgi-bin/script.pl?account=6763364" -->

0
 
LVL 5

Expert Comment

by:mrielf
ID: 12386510
0
 
LVL 13

Expert Comment

by:StormyWaters
ID: 12389279
>>  I'm sure PHP doesn't use === for comparisons.  I think you meant ==

=== returns true if the values are equal and of the same type.

http://us2.php.net/manual/en/language.operators.comparison.php
0
 
LVL 48

Expert Comment

by:Tintin
ID: 12390712
Shows you how much I know about PHP.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to count occurrences of each item in an array.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question