Location: PHPKode > scripts > Startpage > startpage/edit.php
<?
//***************************************************
//	Startpage v1.1 by Matthijs Draijer
//	
//	Use of this script is free, as long as
//	it's not commercial and you don't remove
//	my name.
//
//***************************************************

include ("config.php");
include ("functions.php");
include ("PageTop.php");
include ("language_uk.php");
echo '<center>'. NL;
connect_db();

$id = $_REQUEST[id];
$url = $_POST[url];
$title = $_POST[title];

if(isset($_POST[submit])) {
	$InsertQuery = "UPDATE $cfgTableData SET $cfgDataURL = '". AddSlashes($url) ."', $cfgDataTitle = '". AddSlashes($title) ."' WHERE $cfgDataID = $id";
	
	if(mysql_query($InsertQuery)) {
		echo "<b>$title</b> $lngEditSucces";
	} else {
		echo "$lngEditError <b>$title</b>.";
	}
	echo "<META HTTP-EQUIV='Refresh' CONTENT='2; URL=index.php'>". NL;
} elseif($id != "") {
	$LinkQuery = "SELECT * FROM $cfgTableData WHERE $cfgDataID = $id";
	$FindLink = mysql_query($LinkQuery);
	$Results = mysql_fetch_array($FindLink);
	$url = $Results[$cfgDataURL]; 
	$title = $Results[$cfgDataTitle];
	
	if(isset($_POST[get_title]))	$title = PageTitle($url);
	
	showEditForm ($title, $url, $id);
} else {	
	$LinkQuery = "SELECT * FROM $cfgTableData";
	$FindLink = mysql_query($LinkQuery);
	
	while($Results = mysql_fetch_array($FindLink))	echo "<a href='$_SERVER[PHP_SELF]?id=$Results[$cfgDataID]'>$Results[$cfgDataTitle]</a><br>". NL;
}

echo '</center>'. NL;
include ("PageBottom.php");
?>
Return current item: Startpage