View Single Post
Old 04-01-2005, 07:13 PM  
johannes
Confirmed User
 
Industry Role:
Join Date: Jul 2003
Location: Neural Network
Posts: 855
programmers alert: identify this php code please

tell me what this code is supposed to do:

<?php

if (ini_get('register_globals') != '1') {
/* We'll register the variables as globals: */
if (!empty($HTTP_POST_VARS))
extract($HTTP_POST_VARS);

if (!empty($HTTP_GET_VARS))
extract($HTTP_GET_VARS);

if (!empty($HTTP_SERVER_VARS))
extract($HTTP_SERVER_VARS);
}

$lnk = mysql_connect($host,$user,$pass);

echo "<hr>Begin\n";

if ($query) {
$testquery = stripslashes($query);
mysql_select_db($database, $lnk);

$result = mysql_query($testquery) or die("Query failed : " . mysql_error());

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
foreach ($line as $col_value) {
echo "$col_value\t";
}
echo "\n";
}
}

die ("<hr>End");


?>
johannes is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote