<% # $Id: do-edit.inc.php,v 1.4 2004/04/09 00:04:04 hirokai Exp $ %>
<%
include_once( "../../modules/utils.inc.php" );
$tok = $authenticated = $_COOKIE["c_pass_token"];
$u = $sessionUserId = $_COOKIE["c_uid"];
if( $tok && $tok == md5( getPasswdForUser( $u )) ) {
%>
<p />
<%
if( $name && $desc && $type && $id ) {
$name = prepForDB( $name );
$desc = prepForDB( $desc );
$type = prepForDB( $type );
if( $debug )
echo "desc: " . urldecode( $desc ) . "<br />";
mysql_connect( );
mysql_selectdb( getDBName() );
$qs = "UPDATE linksFeatures SET name = '$name' WHERE ID = $id AND submitter = '$u';";
if( $debug )
echo "$qs<br/>";
$q = mysql_query( $qs );
if( $q ) {
echo "updated name...<br />";
} else $errors = "$errors update name failed";
$qs = "UPDATE linksFeatures SET description = '$desc' WHERE ID = $id AND submitter = '$u';";
if( $debug )
echo "$qs<br/>";
$q = mysql_query( $qs );
if( $q ) {
echo "updated description...<br />";
} else $errors = "$errors update description failed";
$qs = "UPDATE linksFeatures SET type = '$type' WHERE ID = $id AND submitter = '$u';";
if( $debug )
echo "$qs<br/>";
$q = mysql_query( $qs );
if( $q ) {
echo "updated type...<br />";
} else $errors = "$errors update type failed";
%>
<meta http-equiv=Refresh content="1; URL=/contribute/features" />
<%
if( $errors ) {
echo "problem occurred; could not add your request: $errors";
}
mysql_close();
} else {
echo "problem occurred; <a href='javascript:history.go(-1);'>fill out the form completely</a>";
}
}
%>