View Single Post
Old 03-16-2005, 11:25 AM   #3 (permalink)
Terencentanio
 
True Techie

Join Date: Sep 2004

Posts: 110

Terencentanio

Send a message via AIM to Terencentanio Send a message via Yahoo to Terencentanio
Default

*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.
__________________
* Your high priced security consultant\'s plane ticket: $1500
* Your high priced security consultant\'s time: $200/hour
* RealSecure nodes all over your company: $200,000
* Getting owned by 0day: Priceless
Terencentanio is offline