changing old script - register globals - how to convert?
From: kevin bailey (kbailey_at_freewayprojects.com)
Date: 01/31/05
- Next message: Kevin Haryett: "PHP_SELF incorrect on WIMP shared host"
- Previous message: Geoff Berrow: "Re: similar pages ..."
- Next in thread: Gunter Ganscher: "Re: changing old script - register globals - how to convert?"
- Reply: Gunter Ganscher: "Re: changing old script - register globals - how to convert?"
- Reply: jblanch: "Re: changing old script - register globals - how to convert?"
- Reply: Jerry Sievers: "Re: changing old script - register globals - how to convert?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 31 Jan 2005 00:48:36 +0000
this old script was written when
register globals was 'on'.
now i need to convert it to run on a server with a php 4.3.6 - do i just
convert the relevant variables from
$posted_variable to $_POST['posted_variable']
i realise that many of the variables are internal to the scrit so will not
be altered.
i'm slightly concerned because some of the script refers to variables which
are used as streams and used to upload image files.
thanks for any pointers,
kev
here are the scripts from
http://www.onlamp.com/pub/a/onlamp/2002/05/09/webdb2.html?page=1
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Browse Upload Files</title>
</head>
<body bgcolor="white">
<?php
include 'db.inc';
$query = "SELECT id, shortName, mimeName FROM files";
if (!($connection = @ mysql_pconnect($hostName,
$username,
$password)))
showerror();
if (!mysql_select_db("files", $connection))
showerror();
if (!($result = @ mysql_query ($query, $connection)))
showerror();
?>
<h1>Image database</h1>
<h3>Click here to
upload an image.</h3>
<?php
require 'disclaimer';
if ($row = @ mysql_fetch_array($result))
{
?>
<table>
<col span="1" align="right">
<tr>
<th>Short description</th>
<th>File type</th>
<th>Image</th>
</tr>
<?php
do
{
?>
<tr>
<td><?php echo "{$row["shortName"]}";?></td>
<td><?php echo "{$row["mimeName"]}";?></td>
<td><?php echo "<img src=\"view.php?file={$row["id"]}\">";?></td>
</tr>
<?php
} while ($row = @ mysql_fetch_array($result));
?>
</table>
<?php
} // if mysql_fetch_array()
else
echo "<h3>There are no images to display</h3>\n";
?>
</body>
</html>
- Next message: Kevin Haryett: "PHP_SELF incorrect on WIMP shared host"
- Previous message: Geoff Berrow: "Re: similar pages ..."
- Next in thread: Gunter Ganscher: "Re: changing old script - register globals - how to convert?"
- Reply: Gunter Ganscher: "Re: changing old script - register globals - how to convert?"
- Reply: jblanch: "Re: changing old script - register globals - how to convert?"
- Reply: Jerry Sievers: "Re: changing old script - register globals - how to convert?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|