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
Solved

I need to change this into CGI please help Urgent

Posted on 2004-10-19
7
188 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
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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
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 the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

861 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