hey, I have this php script which runs off of a html form so my staff can post screenshots about games.
Please note that because this is vb come things come out a little weird like with the links and stuff but hopefully you'll get it, thanks.
<?
$id = $HTTP_POST_VARS['id'];
$screenshot = $HTTP_POST_FILES['userfile']['name'];
$comment = $HTTP_POST_VARS['comment'];
if (is_uploaded_file($HTTP_POST_FILES['userfile'])) {
copy($HTTP_POST_FILES['userfile'], "D:www<a href="http://www.flashstand.comimagesscreenshots\tmp" target="_blank">[url]www.flashstand.comimagesscreenshots\tmp[/url]</a>");
} else {
echo "Possible file upload attack: filename '$HTTP_POST_FILES[userfile]'.";
}
move_uploaded_file($_FILES['userfile']['tmp_name'], "D:www<a href="http://www.flashstand.comimagesscreenshots" target="_blank">[url]www.flashstand.comimagesscreenshots[/url]</a>");
$db = mysql_pconnect("localhost", " ", " ");
if (!$db)
{
echo "<b>Could not connect to database, try again later.</b>";
exit;
}
mysql_select_db("news");
$query = "insert into revscreenshots (id,screenshot,comment) values ('$id', '$screenshot', '$comment')";
print" $screenshot uploaded and saved to database!";
?>
Now, would this eniterly work... would it upload the image, put the image path in mysql, put the comment in a database and the id (that comes off the form)?
Thanks,
Mike