473,669 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to do logout alert message ?

52 New Member
How to do logout alert message when i press on the logout image

[PHP]<a href="../logout.php" target="_top" onClick="return logout()" "MM_nbGroup('do wn','group1','l ogout','',1)""M M_nbGroup('down ','group1','log out','../button_images/logout_button_d own.png',1)" onMouseOver="MM _nbGroup('over' ,'logout','../button_images/logout_button_d own.png','../button_images/logout_button_d own.png',1)" onMouseOut="MM_ nbGroup('out')" ><img name="logout" src="../button_images/logout_button_u p.png" border="0" alt="Logout" onLoad="" > </a>
[/PHP]
[PHP]function logout()
{
var answer = confirm ("Do you really want to logout ?")
if (answer)
{
return true;
}
else
{
return false;
}
}[/PHP]

My onclick= "return logout()" on <a herf> gt problem as it cant be worked??
Wt can i do in order to have message when i press on the logout image.
Jul 24 '07 #1
10 4063
dafodil
392 Contributor
Put a semicolon after the logout()
Try this:
onclick= "return logout();"
Jul 24 '07 #2
chaos
52 New Member
Put a semicolon after the logout()
Try this:
onclick= "return logout();"
Still cannot
The function logout() did not work as it never pop out the confirm message
Jul 24 '07 #3
tscott
22 New Member
You could always put it on your logout.php and have it confirm, before the initial php logout.
And do a "<body onload="
Example:
[php]
<?php
echo "<script>";
echo "<body onload=confirm_ logout();>";
//Then logout would go here///
?>
[/php]
That should work just as good.
As doing it in the link as it does virtually the same as exit; if you don't confirm.

~Tyler
Jul 24 '07 #4
dafodil
392 Contributor
I saw you put it inside the php code... Are you sure you put that code inside the <script language="javas cript"> ..... </script>

Can I see whole your code for that
Jul 24 '07 #5
chaos
52 New Member
I saw you put it inside the php code... Are you sure you put that code inside the <script language="javas cript"> ..... </script>

Can I see whole your code for that
[PHP]
<?php session_start() ; ?>


<?php require_once('. ./Connections/conn.php'); ?>
<?php
function GetSQLValueStri ng($theValue, $theType, $theDefinedValu e = "", $theNotDefinedV alue = "")
{
$theValue = (!get_magic_quo tes_gpc()) ? addslashes($the Value) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValu e) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theV alue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValu e : $theNotDefinedV alue;
break;
}
return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_ SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "edit_profile") ) {
$updateSQL = sprintf("UPDATE user_profile SET id_no=%s, password=%s, access_type=%s, full_name=%s, email=%s, department=%s, contact_no=%s, hp_no=%s WHERE user_id=%s",
GetSQLValueStri ng($_POST['id_no'], "int"),
GetSQLValueStri ng($_POST['password'], "text"),
GetSQLValueStri ng($_POST['access_type'], "text"),
GetSQLValueStri ng($_POST['full_name'], "text"),
GetSQLValueStri ng($_POST['email'], "text"),
GetSQLValueStri ng($_POST['department'], "text"),
GetSQLValueStri ng($_POST['contact_no'], "double"),
GetSQLValueStri ng($_POST['hp_no'], "double"),
GetSQLValueStri ng($_POST['user_id'], "text"));

mysql_select_db ($database_conn , $conn);
$Result1 = mysql_query($up dateSQL, $conn) or die(mysql_error ());

$updateGoTo = "../admin/profile_updated _saved.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($update GoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf( "Location: %s", $updateGoTo));
}

$colname_edit_p rofile = "1";
if (isset($_SESSIO N['MM_Username'])) {
$colname_edit_p rofile = (get_magic_quot es_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SE SSION['MM_Username']);
}
mysql_select_db ($database_conn , $conn);
$query_edit_pro file = sprintf("SELECT * FROM user_profile WHERE user_id = '%s'", $colname_edit_p rofile);
$edit_profile = mysql_query($qu ery_edit_profil e, $conn) or die(mysql_error ());
$row_edit_profi le = mysql_fetch_ass oc($edit_profil e);
$totalRows_edit _profile = mysql_num_rows( $edit_profile);
?>
<?php
$access_type = $_SESSION['MM_UserGroup'];
?>

<html>
<head>
<script language="javas cript" type="text/javascript">
function logout()
{
var answer = confirm ("Do you really want to logout ?")
if (answer)
{
return true;
}
else
{
return false;
}
}
</script>
<title>QUALTY MANAGEMENT SYSTEM</title>
<meta http-equiv="Content-Type" content="text/html;">
<!--Fireworks MX 2004 Dreamweaver MX 2004 target. Created Wed Sep 13 14:53:43 GMT+0800 (Malay Peninsula Standard Time) 2006-->
<link href="../css/css.css" rel="stylesheet " type="text/css">
<script language="JavaS cript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++) x=MM_findObj(n, d.layers[i].document);
if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
}

function MM_validateForm () { //v4.0
var i,p,q,nm,test,n um,min,max,erro rs='',args=MM_v alidateForm.arg uments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj( args[i]);
if (val) { nm=val.name; if ((val=val.value )!="") {
if (test.indexOf(' isEmail')!=-1) { p=val.indexOf(' @');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val) ;
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf(' inRange') != -1) { p=test.indexOf( ':');
min=test.substr ing(8,p); max=test.substr ing(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+er rors);
document.MM_ret urnValue = (errors == '');
}

function MM_preloadImage s() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!= 0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_nbGroup(even t, grpName) { //v6.0
var i,img,nbArr,arg s=MM_nbGroup.ar guments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbO ver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbO ver.length; i++) {
img = document.MM_nbO ver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}
//-->
</script>
</head>
<body bgcolor="#fffff f" onLoad="MM_prel oadImages('../button_images/Login_button_do wn.png','../button_images/Home_button_dow n.png','../button_images/Edit_Profile_bu tton_down.png', '../button_images/Staff_Record_bu tton_down.png', '../button_images/Feedback_button _down.png','../button_images/Change_Request_ button_down.png ','../button_images/logout_button_d own.png')">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" >
<!-- fwtable fwsrc="add_staf f_page_layout.p ng" fwbase="add_sta ff.gif" fwstyle="Dreamw eaver" fwdocid = "1867439519 " fwnested="0" -->
<tr>
<td><img src="../image_add_staff/spacer.gif" width="137" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="52" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="237" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="70" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="70" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="70" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="70" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="70" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="24" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>

<tr>
<td colspan="2"><a href="../main.php"><img name="layout_r1 _c1" src="../images/layout_r1_c1.gi f" width="189" height="80" border="0" alt=""></a></td>
<td height="80" colspan="7" valign="bottom" background="../images/bg.gif"><table width="611" border="0" cellspacing="0" cellpadding="0" >
<tr valign="bottom" >
<td width="200"><sp an class="white_te xt"> <span class="login_ti tle_text"> </span></span></td>
<td width="200">&nb sp;</td>
<td width="211" align="right" class="white_te xt" >
<?php if(isset($_SESS ION['MM_Username']))
{
echo "Welcome, ";
?>
<span class="login_ti tle_text">
<?php
echo $_SESSION['MM_Username'];
echo "!";
}
?>
</span> </td>
</tr>
</table></td>
<td><img src="../images/spacer.gif" width="1" height="80" border="0" alt=""></td>
</tr>
<tr>
<td colspan="9"><sp an class="user_id" ><?php
$hourdiff = "8"; // hours difference between server time and local time
$timeadjust = ($hourdiff * 3600);
$date = date("l, d F Y h:i a",time() + $timeadjust);
print ("$date");
?></span>&nbsp;</td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="8" border="0" alt=""></td>
</tr>
<tr>
<td height="50" colspan="3"><ta ble width="426" height="50" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="138"><sp an class="title">< a href="../main.php"><stro ng>
<?php if(isset($_SESS ION['MM_Username']))
{
?>
</strong></a><img src="../images/Editptofile.jpg " width="150" height="50">
<?php
}
?>
</span></td>



<td class="title">& nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table></td>
<td><img name="add_staff _r3_c4" src="../image_add_staff/add_staff_r3_c4 .gif" width="70" height="50" border="0" alt=""></td>
<td><img name="add_staff _r3_c5" src="../image_add_staff/add_staff_r3_c5 .gif" width="70" height="50" border="0" alt=""></td>
<td><img name="add_staff _r3_c6" src="../image_add_staff/add_staff_r3_c6 .gif" width="70" height="50" border="0" alt=""></td>
<td><img name="add_staff _r3_c7" src="../image_add_staff/add_staff_r3_c7 .gif" width="70" height="50" border="0" alt=""></td>
<td><img name="add_staff _r3_c8" src="../image_add_staff/add_staff_r3_c8 .gif" width="70" height="50" border="0" alt=""></td>
<td><img name="add_staff _r3_c9" src="../image_add_staff/add_staff_r3_c9 .gif" width="24" height="50" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="50" border="0" alt=""></td>
</tr>
<tr>
<td width="137" height="90"><im g src="../image_add_staff/add_staff2.jpg" width="137" height="90"></td>
<td height="432" colspan="8" rowspan="3" valign="top">
<br>
<br> <a href="../index.php"><str ong><span class="white_te xt">
</span></strong></a><a href="../main.php"><stro ng>
<?php if(isset($_SESS ION['MM_Username']))
{
?>
</strong></a><br>
<form action="<?php echo $editFormAction ; ?>" method="POST" name="edit_prof ile" id="edit_profil e" onSubmit="MM_va lidateForm('ful l_name','','R', 'email','','Ris Email','contact _no','','RisNum ','hp_no','','R isNum','passwor d','','R');retu rn document.MM_ret urnValue">
<table width="663" border="1" cellpadding="0" cellspacing="0" bordercolor="#E FEFEF">
<tr>
<td width="100" bgcolor="#D6D6D 6" class="medium_b ody_text_bold"> <br>
Department:</td>
<td valign="middle" bgcolor="#E1E1E 1" class="medium_b ody_text"><br>
<span class="medium_t itle_bold"><?ph p echo $row_edit_profi le['department']; ?></span> <input name="departmen t" type="hidden" id="department " value="<?php echo $row_edit_profi le['department']; ?>"></td>
</tr>
<tr>
<td width="100" bgcolor="#D6D6D 6" class="medium_b ody_text_bold"> <br>
User Id: </td>
<td valign="middle" bgcolor="#E1E1E 1" class="medium_b ody_text"><br>
<span class="medium_t itle_bold"><?ph p echo $row_edit_profi le['user_id']; ?></span> <input name="user_id" type="hidden" id="user_id" value="<?php echo $row_edit_profi le['user_id']; ?>"></td>
</tr>
<tr>
<td width="100" bgcolor="#D6D6D 6" class="medium_b ody_text_bold"> <br>
Password:</td>
<td valign="middle" bgcolor="#E1E1E 1" class="medium_b ody_text">
<br>
<input name="password" type="password" id="password" value="<?php echo $row_edit_profi le['password']; ?>" >
<span class="dot">*</span></td>
</tr>
<tr>
<td width="100" bgcolor="#D6D6D 6" class="medium_b ody_text_bold"> <br>
Access Type: </td>
<td valign="middle" bgcolor="#E1E1E 1" class="medium_b ody_text"><br>
<span class="medium_t itle_bold"><?ph p echo $row_edit_profi le['access_type']; ?></span> <input name="access_ty pe" type="hidden" id="access_type " value="<?php echo $row_edit_profi le['access_type']; ?>"></td>
</tr>
<tr>
<td width="100" bgcolor="#D6D6D 6" class="medium_b ody_text_bold"> <br>
Full Name: </td>
<td valign="middle" bgcolor="#E1E1E 1" class="medium_b ody_text">
<br>
<input name="full_name " type="text" id="full_name" value="<?php echo $row_edit_profi le['full_name']; ?>" maxlength="30">
<span class="dot">*</span></td>
</tr>
<tr>
<td width="100" bgcolor="#D6D6D 6" class="medium_b ody_text_bold"> <br>
Email:</td>
<td valign="middle" bgcolor="#E1E1E 1" class="medium_b ody_text">
<br>
<input name="email" type="text" id="email" value="<?php echo $row_edit_profi le['email']; ?>" maxlength="40">
<span class="dot">*</span></td>
</tr>
<tr>
<td width="100" bgcolor="#D6D6D 6" class="medium_b ody_text_bold"> <br>
Office no: </td>
<td valign="middle" bgcolor="#E1E1E 1" class="medium_b ody_text">
<br>
<input name="contact_n o" type="text" id="contact_no " value="<?php echo $row_edit_profi le['contact_no']; ?>" maxlength="8">
<span class="dot">*</span></td>
</tr>
<tr>
<td width="100" bgcolor="#D6D6D 6" class="medium_b ody_text_bold"> <br>
Handphone no: </td>
<td valign="middle" bgcolor="#E1E1E 1" class="medium_b ody_text">
<br>
<input name="hp_no" type="text" id="hp_no" value="<?php echo $row_edit_profi le['hp_no']; ?>" maxlength="8">
<span class="dot">*</span></td>
</tr>
<tr>
<td width="100" bgcolor="#D6D6D 6"></td>
<td valign="middle" bgcolor="#E1E1E 1">
<input name="id_no" type="hidden" id="id_no3" value="<?php echo $row_edit_profi le['id_no']; ?>">
<br>
<input type="submit" name="Submit" value="Save"> </td>
</tr>
</table>
<input type="hidden" name="MM_update " value="edit_pro file">
</form>
<?php
}
?> <br> </td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="90" border="0" alt=""></td>
</tr>
<tr>
<td width="137" height="309" valign="top"><t able width="137" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>
<?php if(!isset($_SES SION['MM_Username']))
{
?> <a href="../index.php" target="_top" onClick="MM_nbG roup('down','gr oup1','Login',' ../button_images/Login_button_do wn.png',1)" onMouseOver="MM _nbGroup('over' ,'Login','../button_images/Login_button_do wn.png','../button_images/Login_button_do wn.png',1)" onMouseOut="MM_ nbGroup('out')" ><img src="../button_images/Login_button_up .png" alt="Login" name="Login" width="103" height="23" border="0" onload=""></a>
<table border="0" cellpadding="0" cellspacing="0" >
<tr>
<td></td>
</tr>
</table>
<?php
}
?></td>
</tr>
<tr>
<td>
<?php if(isset($_SESS ION['MM_Username']))
{
?> <a href="../main.php" target="_top" onClick="MM_nbG roup('down','gr oup1','Home','. ./button_images/Home_button_dow n.png',1)" onMouseOver="MM _nbGroup('over' ,'Home','../button_images/Home_button_dow n.png','../button_images/Home_button_dow n.png',1)" onMouseOut="MM_ nbGroup('out')" ><img name="Home" src="../button_images/Home_button_up. png" border="0" alt="Home" onLoad=""></a><a href="../main.php"></a>

<?php
}
?> </td>
</tr>
<tr>
<td>
<?php if(isset($_SESS ION['MM_Username']))
{
?> <a href="edit_prof ile.php" target="_top" onClick="MM_nbG roup('down','gr oup1','EditProf ile','../button_images/Edit_Profile_bu tton_down.png', 1)" onMouseOver="MM _nbGroup('over' ,'EditProfile', '../button_images/Edit_Profile_bu tton_down.png', '../button_images/Edit_Profile_bu tton_down.png', 1)" onMouseOut="MM_ nbGroup('out')" ><img name="EditProfi le" src="../button_images/Edit_Profile_bu tton_up.png" border="0" alt="Edit Profile" onLoad=""></a>
<?php
}
?> </td>
</tr>
<tr>
<td>
<?php if(isset($_SESS ION['MM_Username']))
{
?> <a href="../view_records.ph p" target="_top" onClick="MM_nbG roup('down','gr oup1','ChangeRe quest','../button_images/Change_Request_ button_down.png ',1)" onMouseOver="MM _nbGroup('over' ,'ChangeRequest ','../button_images/Change_Request_ button_down.png ','../button_images/Change_Request_ button_down.png ',1)" onMouseOut="MM_ nbGroup('out')" ><img name="ChangeReq uest" src="../button_images/Change_Request_ button_up.png" border="0" alt="Change Request" onLoad=""></a>
<?php
}
?></td>
</tr>
<tr>
<td align="left">
<?php if ($access_type == "Admin")
{
?> <a href="../admin/view_staff_reco rd.php" target="_top" onClick= "MM_nbGroup('do wn','group1','S taffRecord','../button_images/Staff_Record_bu tton_down.png', 1)" onMouseOver="MM _nbGroup('over' ,'StaffRecord', '../button_images/Staff_Record_bu tton_down.png', '../button_images/Staff_Record_bu tton_down.png', 1)" onMouseOut="MM_ nbGroup('out')" ><img name="StaffReco rd" src="../button_images/Staff_Record_bu tton_up.png" border="0" alt="Staff Record" onLoad=""></a>
<?php
}
?> </td>
</tr>
<tr>
<td align="left"> <?php if ($access_type == "Staff" || $access_type == "super_user ")
{
?> <a href="feedback. php" target="_top" onClick="MM_nbG roup('down','gr oup1','FeedBack ','../button_images/Feedback_button _down.png',1)" onMouseOver="MM _nbGroup('over' ,'FeedBack','../button_images/Feedback_button _down.png','../button_images/Feedback_button _down.png',1)" onMouseOut="MM_ nbGroup('out')" ><img name="FeedBack" src="../button_images/Feedback_button _up.png" border="0" alt="FeedBack" onLoad=""></a>
<?php
}
?> </td>
</tr>
<tr>
<td><?php if(isset($_SESS ION['MM_Username']))
{
?>
<a href="../logout.php" target="_top" onClick="return logout();""MM_n bGroup('down',' group1','logout ','../button_images/logout_button_d own.png',1)" onMouseOver="MM _nbGroup('over' ,'logout','../button_images/logout_button_d own.png','../button_images/logout_button_d own.png',1)" onMouseOut="MM_ nbGroup('out')" ><img name="logout" src="../button_images/logout_button_u p.png" border="0" alt="Logout" onLoad=""></a>

<?php
}
?></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
<br></td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="309" border="0" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="33" border="0" alt=""></td>
</tr>
<tr>
<td colspan="9"><im g name="add_staff _r7_c1" src="../image_add_staff/add_staff_r7_c1 .gif" width="800" height="30" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="30" border="0" alt=""></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_resu lt($edit_profil e);
?>
[/PHP]
Jul 24 '07 #6
dafodil
392 Contributor
How can we help you correct your code. The code has missing parts.
Unless you show us all we can do is imagine what the error could possibly be.
Jul 24 '07 #7
chaos
52 New Member
<?php session_start() ; ?>


<?php require_once('. ./Connections/conn.php'); ?>
<?php
function GetSQLValueStri ng($theValue, $theType, $theDefinedValu e = "", $theNotDefinedV alue = "")
{
$theValue = (!get_magic_quo tes_gpc()) ? addslashes($the Value) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValu e) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theV alue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . date("Y-d-m",strtotime($t heValue)) . "'" : "NULL";
break;
case "time":
$theValue = ($theValue != "") ? "'" . date("H:i:s",st rtotime($theVal ue)) . "'" : "NULL";
break;
case "datetime":
$theValue = ($theValue != "") ? "'" . date("Y-d-m H:i:s",strtotim e($theValue)) . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValu e : $theNotDefinedV alue;
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"] == "change_timetab le")) {
$insertSQL = sprintf("INSERT INTO feedback (user_id, full_name, `date`, `time`, `year`, topic, comments) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueStri ng($_POST['user_id'], "text"),
GetSQLValueStri ng($_POST['full_name'], "text"),
GetSQLValueStri ng($_POST['date'], "text"),
GetSQLValueStri ng($_POST['time'], "text"),
GetSQLValueStri ng($_POST['year'], "text"),
GetSQLValueStri ng($_POST['topic'], "text"),
GetSQLValueStri ng($_POST['comments'], "text"));

mysql_select_db ($database_conn , $conn);
$Result1 = mysql_query($in sertSQL, $conn) or die(mysql_error ());

$insertGoTo = "../admin/feedback_saved. php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insert GoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf( "Location: %s", $insertGoTo));
}

$colname_sessio n_detect = "1";
if (isset($_SESSIO N['MM_Username'])) {
$colname_sessio n_detect = (get_magic_quot es_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SE SSION['MM_Username']);
}
mysql_select_db ($database_conn , $conn);
$query_session_ detect = sprintf("SELECT * FROM user_profile WHERE user_id = '%s'", $colname_sessio n_detect);
$session_detect = mysql_query($qu ery_session_det ect, $conn) or die(mysql_error ());
$row_session_de tect = mysql_fetch_ass oc($session_det ect);
$totalRows_sess ion_detect = mysql_num_rows( $session_detect );
?>
<?php
$access_type = $_SESSION['MM_UserGroup'];
?>

<html>
<head>
<title>QUALTY MANAGEMENT SYSTEM</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--Fireworks MX 2004 Dreamweaver MX 2004 target. Created Wed Sep 13 14:53:43 GMT+0800 (Malay Peninsula Standard Time) 2006-->
<link href="../css/css.css" rel="stylesheet " type="text/css">
<script language="JavaS cript" type="text/JavaScript">
function logout()
{
var answer = confirm ("Do you really want to logout ?")
if (answer)
{
return true;
}
else
{
return false;
}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++) x=MM_findObj(n, d.layers[i].document);
if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
}

function YY_checkform() { //v4.71
//copyright (c)1998,2002 Yaromat.com
var a=YY_checkform. arguments,oo=tr ue,v='',s='',er r=false,r,o,at, o1,t,i,j,ma,rx, cd,cm,cy,dte,at ;
for (i=1; i<a.length;i=i+ 4){
if (a[i+1].charAt(0)=='#' ){r=true; a[i+1]=a[i+1].substring(1);} else{r=false}
o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
v=o.value;t=a[i+2];
if (o.type=='text' ||o.type=='pass word'||o.type== 'hidden'){
if (r&&v.length==0 ){err=true}
if (v.length>0)
if (t==1){ //fromto
ma=a[i+1].split('_');if( isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
} else if (t==2){
rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx .test(v))err=tr ue;
} else if (t==3){ // date
ma=a[i+1].split("#");at= v.match(ma[0]);
if(at){
cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
dte=new Date(cy,cm,cd);
if(dte.getFullY ear()!=cy||dte. getDate()!=cd|| dte.getMonth()! =cm){err=true};
}else{err=true}
} else if (t==4){ // time
ma=a[i+1].split("#");at= v.match(ma[0]);if(!at){err=t rue}
} else if (t==5){ // check this 2
if(o1.length)o1 =o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
if(!o1.checked) {err=true}
} else if (t==6){ // the same
if(v!=MM_findOb j(a[i+1]).value){err=tr ue}
}
} else
if (!o.type&&o.len gth>0&&o[0].type=='radio') {
at = a[i].match(/(.*)\[(\d+)\].*/i);
o2=(o.length>1) ?o[at[2]]:o;
if (t==1&&o2&&o2.c hecked&&o1&&o1. value.length/1==0){err=true}
if (t==2){
oo=false;
for(j=0;j<o.len gth;j++){oo=oo| |o[j].checked}
if(!oo){s+='* '+a[i+3]+'\n'}
}
} else if (o.type=='check box'){
if((t==1&&o.che cked==false)||( t==2&&o.checked &&o1&&o1.value. length/1==0)){err=true }
} else if (o.type=='selec t-one'||o.type==' select-multiple'){
if(t==1&&o.sele ctedIndex/1==0){err=true}
}else if (o.type=='texta rea'){
if(v.length<a[i+1]){err=true}
}
if (err){s+='* '+a[i+3]+'\n'; err=false}
}
if (s!=''){alert(' The required information is incomplete or contains errors:\t\t\t\t \t\n\n'+s)}
document.MM_ret urnValue = (s=='');
}
//-->
</script>
</head>
<body >
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" >
<!-- fwtable fwsrc="add_staf f_page_layout.p ng" fwbase="add_sta ff.gif" fwstyle="Dreamw eaver" fwdocid = "1867439519 " fwnested="0" -->
<tr>
<td><img src="../image_add_staff/spacer.gif" width="137" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="52" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="237" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="70" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="70" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="70" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="70" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="70" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="24" height="1" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>

<tr>
<td colspan="2"><a href="../main.php"><img name="layout_r1 _c1" src="../images/layout_r1_c1.gi f" width="189" height="80" border="0" alt=""></a></td>
<td height="80" colspan="7" valign="bottom" background="../images/bg.gif"><table width="611" border="0" cellspacing="0" cellpadding="0" >
<tr valign="bottom" >
<td width="200"><sp an class="white_te xt"> <span class="login_ti tle_text"> </span></span></td>
<td width="200">&nb sp;</td>
<td width="211" align="right" class="white_te xt" >
<?php if(isset($_SESS ION['MM_Username']))
{
echo "Welcome, ";
?>
<span class="login_ti tle_text">
<?php
echo $_SESSION['MM_Username'];
echo "!";
}
?>
</span> </td>
</tr>
</table></td>
<td><img src="../images/spacer.gif" width="1" height="80" border="0" alt=""></td>
</tr>
<tr>
<td colspan="9"><sp an class="user_id" ><?php
$hourdiff = "8"; // hours difference between server time and local time
$timeadjust = ($hourdiff * 3600);
$date = date("l, d F Y h:i a",time() + $timeadjust);
print ("$date");
?></span>&nbsp;</td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="8" border="0" alt=""></td>
</tr>
<tr>
<td height="50" colspan="3"><ta ble width="426" height="50" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="137" height="50"><im g name="feedback" src="../images/feedback.gif"></td>
<td width="158"><im g name="layout_r3 _c9" src="../images/layout_r3_c9.gi f"></td>

<td width="131" colspan="3" class="title">< img name="team" src='../images/team2.gif'></td>
</tr>
</table></td>
<td><img name="add_staff _r3_c4" src="../image_add_staff/add_staff_r3_c4 .gif" width="70" height="50" border="0" alt=""></td>
<td><img name="add_staff _r3_c5" src="../image_add_staff/add_staff_r3_c5 .gif" width="70" height="50" border="0" alt=""></td>
<td><img name="add_staff _r3_c6" src="../image_add_staff/add_staff_r3_c6 .gif" width="70" height="50" border="0" alt=""></td>
<td><img name="add_staff _r3_c7" src="../image_add_staff/add_staff_r3_c7 .gif" width="70" height="50" border="0" alt=""></td>
<td><img name="add_staff _r3_c8" src="../image_add_staff/add_staff_r3_c8 .gif" width="70" height="50" border="0" alt=""></td>
<td><img name="add_staff _r3_c9" src="../image_add_staff/add_staff_r3_c9 .gif" width="24" height="50" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="50" border="0" alt=""></td>
</tr>
<tr>
<td width="137" height="90"><im g src="../image_add_staff/add_staff2.jpg" width="137" height="90"></td>
<td height="432" colspan="8" rowspan="3" valign="top" background="../images/ist2_1265261_ye llow_notebook_o n_white.gif">
<div align="right">< br>
<a href="admin_vie w_all_feedback_ comments.php">
<?php if ($access_type == "Admin")
{
?>
View User Feedback Record</a> <?php
}
?>
&nbsp; <a href="../index.php"><str ong><span class="white_te xt">
<?php if(isset($_SESS ION['MM_Username']))
{

?>
</span></strong></a><a href="my_feedba ck_comments.php ">View My Feedback Record</a> <br>
<br>
</div>
<form action="<?php echo $editFormAction ; ?>" method="POST" name="change_ti metable" id="change_time table" onSubmit="YY_ch eckform('change _timetable','to pic','#q','0',' Please enter a Topic *','textarea',' 1','1',' Please enter a comments or request *');return document.MM_ret urnValue">
<br>
<table width="663" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width="123"><di v align="center"> </div></td>
<td width="49"><div align="center"> </div></td>
<td width="131"><di v align="center"> </div></td>
<td width="90"><div align="center"> </div></td>
<td width="90"><div align="center"> </div></td>
<td width="90"><div align="center"> </div></td>
<td width="90"><div align="center"> </div></td>
</tr>
<tr>
<td colspan="3" rowspan="2" valign="top"><d iv align="left">Na me of Requesting Officer: <strong><?php echo $row_session_de tect['full_name']; ?>
<input name="full_name " type="hidden" id="full_name" value="<?php echo $row_session_de tect['full_name']; ?>">
</strong></div></td>
<td colspan="2" rowspan="2" valign="top"><d iv align="left">St aff ID: <strong><?php echo $row_session_de tect['user_id']; ?>
<input name="user_id" type="hidden" id="user_id" value="<?php echo $row_session_de tect['user_id']; ?>">
</strong></div></td>
<td valign="top"><d iv align="right">D ate:
<strong> </strong> </div></td>
<td><strong>
&nbsp;&nbsp;
<?php $date = date("d/m/Y", mktime()); ?>
<?php echo $date; ?>
<input name="date" type="hidden" id="date2" value="<?php echo $date; ?>">
</strong></td>
</tr>
<tr>
<td valign="top"><d iv align="right">T ime: </div></td>
<td><strong>
&nbsp;&nbsp;
<?php
$timezone=+8;//YOu will probably pull this value from the database. I used -6 because I live in Iowa ;)
$time=time();//It is a timestamp of the event. You will also pull this from the DB
$gmttime= gmdate("H:i", $time);
$convertedtime= date("H:i",strt otime("$timezon e hours",strtotim e($gmttime)));
echo $convertedtime ;
?>
</strong>hours
<input name="time" type="hidden" id="time" value="<?php echo $convertedtime ; ?>"></td>
</tr>
<tr>
<td colspan="7"><di v align="center"> </div>
<div align="center">
<hr noshade>
</div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div></td>
</tr>
<tr>
<td colspan="7"><di v align="left"><b r>
<br>
<br>
<br>
&nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;Topic:<br >
&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;
<input name="topic" type="text" id="topic" size="20" maxlength="100" >
<span class="dot">*<s trong>
<?php $year = date("Y", mktime()); ?>
<input name="year" type="hidden" id="year2" value="<?php echo $year; ?>">
</strong></span></div> <div align="right"> </div> <div align="right"></div> <div align="right"></div></td>
</tr>
<tr>
<td colspan="7"><di v align="center"> </div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div></td>
</tr>
<tr bgcolor="#F0F0F 0">
<td colspan="7"><di v align="center"> </div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div>
<div align="center"> </div></td>
</tr>
<tr valign="bottom" >
<td colspan="7"><hr noshade></td>
</tr>
<tr valign="bottom" >
<td colspan="5" valign="top"><b r>
&nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;Commen ts / Request :<br>
&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;
<textarea name="comments" cols="40" rows="5" id="textarea">P lease enter your comments here.</textarea>
<br>
&nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;<br>
<br></td>
<td colspan="2" align="center" valign="middle" >&nbsp;</td>
</tr>
</table>
<br>
<br>
&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;
<input type="submit" name="Submit" value="Submit">
<br>
<br>
<input type="hidden" name="MM_insert " value="change_t imetable">
</form> <br>
<?php
}
?></td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="90" border="0" alt=""></td>
</tr>
<tr>
<td width="137" height="309" align="center" valign="middle" ><table width="137" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>
<?php if(!isset($_SES SION['MM_Username']))
{

?>
<a href="../index.php" target="_top" onClick="MM_nbG roup('down','gr oup1','Login',' ../button_images/Login_button_do wn.png',1)" onMouseOver="MM _nbGroup('over' ,'Login','../button_images/Login_button_do wn.png','../button_images/Login_button_do wn.png',1)" onMouseOut="MM_ nbGroup('out')" ><img src="../button_images/Login_button_up .png" alt="Login" name="Login" width="103" height="23" border="0" onload=""></a>
<?php
}
?>
</td>
</tr>
<tr>
<td>
<?php if(isset($_SESS ION['MM_Username']))
{
?>
<a href="../main.php" target="_top" onClick="MM_nbG roup('down','gr oup1','Home','. ./button_images/Home_button_dow n.png',1)" onMouseOver="MM _nbGroup('over' ,'Home','../button_images/Home_button_dow n.png','../button_images/Home_button_dow n.png',1)" onMouseOut="MM_ nbGroup('out')" ><img name="Home" src="../button_images/Home_button_up. png" border="0" alt="Home" onLoad=""></a>
<?php
}
?>
</td>
</tr>
<tr>
<td>
<?php if(isset($_SESS ION['MM_Username']))
{
?>
<a href="edit_prof ile.php" target="_top" onClick="MM_nbG roup('down','gr oup1','EditProf ile','../button_images/Edit_Profile_bu tton_down.png', 1)" onMouseOver="MM _nbGroup('over' ,'EditProfile', '../button_images/Edit_Profile_bu tton_down.png', '../button_images/Edit_Profile_bu tton_down.png', 1)" onMouseOut="MM_ nbGroup('out')" ><img name="EditProfi le" src="../button_images/Edit_Profile_bu tton_up.png" border="0" alt="Edit Profile" onLoad=""></a>
<?php
}
?></td>
</tr>
<tr>
<td>
<?php if(isset($_SESS ION['MM_Username']))
{
?>
<a href="../view_records.ph p" target="_top" onClick="MM_nbG roup('down','gr oup1','ChangeRe quest','../button_images/Change_Request_ button_down.png ',1)" onMouseOver="MM _nbGroup('over' ,'ChangeRequest ','../button_images/Change_Request_ button_down.png ','../button_images/Change_Request_ button_down.png ',1)" onMouseOut="MM_ nbGroup('out')" ><img name="ChangeReq uest" src="../button_images/Change_Request_ button_up.png" border="0" alt="Change Request" onLoad=""></a>
<?php
}
?></td>
</tr>
<tr>
<td align="left">
<?php if ($access_type == "Admin")
{
?>
<a href="../admin/view_staff_reco rd.php" target="_top" onClick= "MM_nbGroup('do wn','group1','S taffRecord','../button_images/Staff_Record_bu tton_down.png', 1)" onMouseOver="MM _nbGroup('over' ,'StaffRecord', '../button_images/Staff_Record_bu tton_down.png', '../button_images/Staff_Record_bu tton_down.png', 1)" onMouseOut="MM_ nbGroup('out')" ><img name="StaffReco rd" src="../button_images/Staff_Record_bu tton_up.png" border="0" alt="Staff Record" onLoad=""></a>
<?php
}
?>
</td>
</tr>
<tr>
<td align="left"><? php if(isset($_SESS ION['MM_Username']))
{
?>
<a href="feedback. php" target="_top" onClick="MM_nbG roup('down','gr oup1','FeedBack ','../button_images/Feedback_button _down.png',1)" onMouseOver="MM _nbGroup('over' ,'FeedBack','../button_images/Feedback_button _down.png','../button_images/Feedback_button _down.png',1)" onMouseOut="MM_ nbGroup('out')" ><img name="FeedBack" src="../button_images/Feedback_button _up.png" border="0" alt="FeedBack" onLoad=""></a>
<?php
}
?>
</td>
</tr>
<tr>
<td><?php if(isset($_SESS ION['MM_Username']))
{
?>
<a href="../logout.php" target="_top" onClick="return logout();""MM_n bGroup('down',' group1','logout ','../button_images/logout_button_d own.png',1)" onMouseOver="MM _nbGroup('over' ,'logout','../button_images/logout_button_d own.png','../button_images/logout_button_d own.png',1)" onMouseOut="MM_ nbGroup('out')" ><img name="logout" src="../button_images/logout_button_u p.png" border="0" alt="Logout" onLoad=""></a>
<?php
}
?></td>
</tr>
<tr>

</tr>
</table> <br>
<img src="../images/box_write_revie w.gif" width="100" height="100"></td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="309" border="0" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="33" border="0" alt=""></td>
</tr>
<tr>
<td colspan="9"><im g name="add_staff _r7_c1" src="../image_add_staff/add_staff_r7_c1 .gif" width="800" height="30" border="0" alt=""></td>
<td><img src="../image_add_staff/spacer.gif" width="1" height="30" border="0" alt=""></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_resu lt($session_det ect);
?>
Jul 24 '07 #8
dafodil
392 Contributor
After reviewing your code:

you forgot to put the semicolon in this statement:
var answer = confirm ("Do you really want to logout ?");


cheers
Jul 24 '07 #9
chaos
52 New Member
After reviewing your code:

you forgot to put the semicolon in this statement:
var answer = confirm ("Do you really want to logout ?");


cheers
It still cant be worked, no confirm message pop out.
Jul 24 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2241
by: Phil Powell | last post by:
class LoginSessionGenerator extends MethodGenerator { function LoginSessionGenerator() {} /** * Logout * * @access public */ function &logout() { // STATIC VOID METHOD
4
7805
by: Chris Stegeman | last post by:
Hello there, On my site people have to log in and automatically start a session. An authorized login grants access to other pages and MySQL data. However when the user waits to long, the server ends the session, without a proper logout. The user can't see that he is logged out, hits a button and gets mutiple errors because MySQL is no longer available. Is there a way to to warn the user a minute before the session is ended? I just...
2
3466
by: Jon Natwick | last post by:
I'm trying to add a dynamically created logout link on my pages. The link to the logout page will show if the user is logged in. I put a placeholder on the aspx page and then dynamically create the link, if the user is logged. So far, so good. It's working. Aspx
6
7544
by: Kevin Yu | last post by:
is it possible to for user to click a logout button to logout and when the user want to get into the system again, the user have to login again? Kevin
6
7037
by: chaos | last post by:
HELLO ,All ANYONE know how to do the alert message for logout.Example "Yes" OR "NO" in the message box. <td><?php if(isset($_SESSION)) { ?> <strong><a href="../logout.php">Logout</a></strong> <?php } ?>
1
14050
by: shrik | last post by:
hi everybody. I have following problem. There are two pages. index.jsp and main.jsp in my application Index.jsp contains logging interface in . It submits password and userid to loginform bean. following are entries in struts-config.xml file <action input="index.jsp" name="loginform" path="/login" scope="session" type="com.myapp.struts.loginaction"> <forward name="success" path="/main.jsp"/>
3
4993
by: kpg* | last post by:
Hi all, I want to perform the same action the the loginstatus control does to logout a user programatically, but I can't seem to find a 'logout' method in any of the membership classes. The user gets authenticated using the login control and the build-in database, but there are times when I want to logout the user and send them back to the login page. At this point the "isAuthenticated" method should return false.
1
3324
by: Kandiman | last post by:
Hiya, i made a asp page, and one of my divs (as a include) is as below. the problem is if the main page is resubmitted, i get logged out again?... heres the code.. i think its on the value=true for the hidden textbox on the logout sub.. but how do i get round this? can i not change the value onclick? <div id=Rightbody> <!--<form id="RightBodyForm" name="RightbodyForm" method="post" action="Guestbook2.asp">--> <% Response.Expires...
10
4810
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey Jones, then login as David Smith the Welcome message below will show "Welcome Davey". And it will be Davey's information that is accessible - not David Smith's. So something is amiss but I don't know what. (BTW, this login script is based on the...
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8894
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8587
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2029
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.