*sigh* I've never done this on open forums:
all.php
PHP Code:
<?php
$dbhost = "localhost";
$dbname = "name";
$dbpass = "pass";
$dbuser = "user";
mysql_connect("$dbhost", "$dbuser", "$dbpass");
mysql_select_db("$dbname");
?>
index.php
PHP Code:
<?php
include("all.php");
$lralg = "SELECT * FROM images";
$res = mysql_query($lralg);
$hu = mysql_numrows($res);
$i=0;
while ($i < $hu) {
$hysa = mysql_result($res,$i,"location");
?>
<TABLE>
<TR>
<TD>
[img]<?php echo $locaton; ?>[/img]
</TD>
</TR>
</TABLE>
<?
$i++;
}
?>
/admin/index.php
PHP Code:
<?php
include("../all.php");
if(isset($_POST['submit']))
{
$location = $_POST['location'];
$add = "INSERT INTO images VALUES ('', '$location')";
if(mysql_query($add))
{
echo "Image added";
} else {
echo "Could not add image";
}
} else {
?>
<form method="POST" action="index.php">
Image location: <input type="text" name="location" value="/">
<input type="submit" name="submit" value="Add Image">
</form>
<?
}
?>
This is _VERY_ basic. You'll have to mod the HTML yourself. And /admin/ should be protected. And, you need to actually upload the image - the script doesn't do it for you.