Location: PHPKode > projects > SiteX > admin/links_add.php
<?PHP
ob_start();
session_start();
include("../includes/globals.php.inc");
include("../includes/functions.php");
include("../lang/English.php");
if(strtolower($sxSetup['Language']) != 'english') include("../lang/".$sxSetup['Language'].".php");
include("../themes/$THEME_FOLDER/config.php.inc");
if((!userEditor())AND(!userAdmin()))  loginError($sxLang['LoginRequired']);
if((userEditor())AND(!$sxSetup['EditorRightsLinksAdd']))  loginError($sxLang['LoginRequired']);

if($Add)
{
	$query = "INSERT INTO $DB_Links (name, url, groupid) VALUES ('$name', '$link_url', '$category')";
	$result = mysql_query($query, $Link);
	header("Location: links.php?sxViewCat=$category&message=".$sxLang['MessageLinkAdded']);
	die();
}

$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>    
<div class="bodyWrapper">
   <h1 class="sxAdminHeading"><?PHP echo $sxLang['GeneralHeadingAdd'].' '.getComponentName("5"); ?></h1>
   <div class="sxAdminBreadcrumbs"><?PHP if(userAdmin()) { ?><a href="index.php"><?PHP echo $sxLang['AdminBreadcrumb']; ?><?PHP }?><?PHP if(userEditor()) { ?><a href="editor_index.php"><?PHP echo $sxLang['EditorBreadcrumb']; ?><?PHP }?></a> > <a href="links.php"><?PHP echo getComponentName("5").' '.$sxLang['GeneralHeadingManager']; ?></a> > <?PHP echo $sxLang['GeneralHeadingAdd'].' '.getComponentName("5"); ?></div>   
   <?PHP echoMessage($message); ?>
	<form name="sxFormLinksAdd" method="post" action="<?PHP echo $PHP_SELF; ?>">
	  <table border="0" cellspacing="2" cellpadding="5">
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['GeneralItemName']; ?></td>
		  <td><input name="name" style="width:300px;" type="text" maxlength="255" /></td>
		</tr>
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['GeneralItemURL']; ?></td>
		  <td><input name="link_url" style="width:300px;" type="text" value="http://" maxlength="255" /></td>
		</tr>
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['GeneralItemCategory']; ?></td>
		  <td><select name="category"><?PHP
			$query = "SELECT * FROM $DB_Links_Groups ORDER BY name ASC";
			$result = mysql_query($query, $Link) or queryError("23", mysql_error());
			while($ROW = mysql_fetch_object($result))
			{
				echo '<option value="' . $ROW->id . '"';
				
				if($sxCat == $ROW->id)
					echo ' selected';
				
				echo '>' . $ROW->name . '</option>';
			}
		   ?></select></td>
		</tr>
		<tr> 
		  <td>&nbsp;</td>
		  <td><input name="Add" type="submit" id="Add" value="<?PHP echo $sxLang['LinksButtonAdd']; ?>" class="sxButton" /></td>
		</tr>
	  </table>
	  </form>
  </div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX