Solved

I need to change this into CGI please help Urgent

Posted on 2004-10-19
7
178 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now