Solved

I need to change this into CGI please help Urgent

Posted on 2004-10-19
7
191 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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

756 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