Размер файла: 1.59Kb
<?php
require_once('includes/db.php');
require_once('includes/config.php');
require_once('includes/auth.php');
require_once('includes/header.php');
$error = '';
$message = '';
if(isset($_POST['add']))
{
if($_POST['name'] != '')
{
mysql_query('INSERT INTO advertising_links(name, url) VALUES ("' . $_POST['name'] . '", "' . $_POST['url'] . '")');
$message = SECTION_ADDED . " '$_POST[name]'.";
}
else
{
$error = EMPTY_NAME_FIELD;
}
}
?>
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="addbg"><td align="center" background="images/t5.gif"><font color="#FFFFFF"></font>
<font class="header">
Добавить ссылку
</font></td>
</tr></table><br>
<div align="center">
<font class="succ">
<?php echo $message; ?>
</font><br>
</div>
<div align="center">
<font class="error">
<?php echo $error; ?>
</font><br>
</div>
<br>
<table align="center" width="99%" border="0" cellspacing="1" cellpadding="3">
<form action="" method="post">
<tr class="addbg"><td width="20%">
Название
</td><td width="80%">
<input type="text" name="name" value="" style="width:100%;">
</td>
</tr>
<tr><td>
URL
</td><td>
<input type="text" name="url" value="" style="width:100%;">
</td>
</tr>
<tr><td colspan="2" align="center">
<br>
<input type="submit" name="add" value="<?php echo ADD; ?>" class="button">
<input type="submit" name="cancel" value="<?php echo CANCEL; ?>" class="button">
</td></tr>
</form>
</table>
<br><br>
<?php
require_once('includes/footer.php');
?>