Is there a Record Insertion Form Wizard in Security or Data Assist or do I have to use the Dream Weaver one? To make that admin page with radio buttons?
I made a page with the record insertion form wizard from Dream Weaver to register the admin, but how do I get as a Admin after login on the main admin page I made with all links instead of the profile page where the normal users are being directed to?
Or do I have to make a link on the profile page where everybody ends up after login now with a link ADMINISTRATOR that can only be used with access permission for a admin to get on that page?
Hope this is what you are explaining:
<?php require_once('Connections/connlogregdb1.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO users (userEmail, userPassword, userFirstname, userFamilyName, isAdmin) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['userEmail'], "text"),
GetSQLValueString($_POST['userPassword'], "text"),
GetSQLValueString($_POST['userFirstname'], "text"),
GetSQLValueString($_POST['userFamilyName'], "text"),
GetSQLValueString(isset($_POST['isAdmin']) ? "true" : "", "defined","1","0"));
mysql_select_db($database_connlogregdb1, $connlogregdb1);
$Result1 = mysql_query($insertSQL, $connlogregdb1) or die(mysql_error());
$insertGoTo = "users_LogIn.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<title>Administration</title><h1>Administration</h1>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">UserEmail:</td>
<td><input type="text" name="userEmail" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">UserPassword:</td>
<td><input type="text" name="userPassword" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">UserFirstname:</td>
<td><input type="text" name="userFirstname" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">UserFamilyName:</td>
<td><input type="text" name="userFamilyName" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">IsAdmin:</td>
<td><input type="checkbox" name="isAdmin" value="" ></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Insert record"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
Thanks!