Kaushal Shriyan wrote:
Hi ALL

I have a sample cgi-script

#!/usr/bin/perl

use CGI;

$cgi = new CGI;

for $key ( $cgi->param() ) {
       $input{$key} = $cgi->param($key);
}

check out the superglobals $_POST, $_GET and $_REQUEST:

<?php
var_dump($_POST, $_GET, $_REQUEST);
?>


print qq{Content-type: text/html


this header is outputted automatically.

<html><head><script type="text/javascript"
src="/domain.js"></script></head><body>
};


<?php
echo '
<html>
        <head>
                <script type="text/javascript" src="/domain.js"></script>
        </head>
        <body>';
?>


print qq{<script type="text/javascript">addHeader()</script>};

print qq{<table border="2" width="60%" align="center" cellspacing="1"
cellpadding="2">};
print qq{<tr><th>Key</th><th>Value</th>};

foreach $key (sort (keys %ENV)) {
       print "<tr><td>$key</td>", "<td>$ENV{$key}</td>", "</tr>";
}

echo "<ul>";
ksort($_GET);
foreach ($_GET as $key => $val) {
        echo "<li>{$key}: {$val}</li>";
}
echo "</ul>";


print qq{</table>};

print qq{<script type="text/javascript">addFooter()</script>};
print qq{</body></html>};

Can any one please help me in converting this to a php script

that should be enough help for anyone who can read/write perl ;-P


Which would be of great help

Thanks in Advance

Kaushal


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to