ok here is my code. where do I have to place the code which replaces the tags?
<?
// checks if all the fields contain data
if (!$url) {
$Msg.="<b>- Target URL </b><br>";
}
if (!$text) {
$Msg.="<b>- News Text </b><br>";
}
if (!$title) {
$Msg.="<b>- News Title </b><br>";
}
if (!$users_file) {
$Msg.="<b>- Image </b><br>";
}
if ($Msg) {
echo "The data couldn't be submitted. You didn't insert data in the follwing fields:<br>
<br>
$Msg<br><br>Go back back and try again";
}
else {
if (isset($users_file)) {
echo "<B>Remote File Name:</B> $users_file<BR>";
echo "<B>Local File Name:</B> $users_file_name<BR>";
echo "<B>Local File Size:</B> $users_file_size<BR>";
if (isset($users_file_type)) {
echo "<B>Local File Type:</B> $users_file_type<P>"; }
// Change $doc_directory to your 'DocumentRoot'.
$doc_directory = "/home/xsibase.com/www/";
$my_file = "news_images/" . time() . "_" . $users_file_name;
$copy_path = $doc_directory.$my_file;
if ($users_file != "none") {
if(!copy($users_file, $copy_path)) {
echo "File upload failed!"; }
else { ?>Upload Complete.
<? } }
else { echo "<P>You must select a file to upload!<P>"; ?>
<A HREF="<? echo $PHP_SELF; ?>"><B>Back</B></A> to the Upload Form
<? } }
$username="x";
$password="x";
$database="x";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO news (picture_name,url,title,text) VALUES ('$my_file','$url','$title','$text')";
mysql_query($query);
mysql_close();
echo "<a href='http://xxx.net'> view result! </a>";