Ga naar inhoud

Vreemde 404 Error na PHP session-login


anoniem

Aanbevolen berichten

Hello everyone, Can anybody help me with the following problem: I'm working on a site that uses a login procedure that validates two kinds of users: advertisers and subscribers. It uses session to remember both users. The problem is that whenever I'm logged in as a subscriber every activated link gives an 'HTTP 404 - File Not Found'-error, even when I give each link an 'absolute' path. The weird thing is that it doesn't do this when logged in as an advertiser even though the PHP/source code is identical to the 'subscriber'-login, minus the session-name and the login-redirects. Both logins and all the other related content are situated in the same directory (/Content), except for one - wiz_advert_setmaincat2.php (/Wizards). I found that this is the only file that can be approached when logged on as a subscriber. Here are the source codes of the discussed files: The subscriber login file, 'abo_login.php'> <?php // Copyright (c) Interakt Online 2001 // http://www.interakt.ro/ require("./../../adodb/adodb.inc.php"); require("./../../Connections/klussenbank_con.php"); ?><?php $Rs_set_index_cat=$klussenbank_con->Execute("SELECT * FROM categorieen WHERE type = 'MAIN'") or DIE($klussenbank_con->ErrorMsg()); $Rs_set_index_cat_numRows=0; $Rs_set_index_cat__totalRows=$Rs_set_index_cat->RecordCount(); ?><?php $Repeat1__numRows = -1; $Repeat1__index= 0; $Rs_advert_cat_sel_numRows = $Rs_advert_cat_sel_numRows + $Repeat1__numRows; ?><?php // *** Start the session session_start(); $UserVerified="../wizards/wiz_advert_leden_zoek_reacties.php?klantnummer=$KT_Username"; if ($KT_Username!=NULL){ header ("Location: $UserVerified"); exit; } else {} ?><?php // *** Start the session session_start(); // *** Validate request to log in to this site. $KT_LoginAction = $PHP_SELF; if ($QUERY_STRING!="") $KT_LoginAction .= "?".$QUERY_STRING; if (isset($klantnummer)) { $KT_valUsername=$klantnummer; $KT_fldUserAuthorization=""; $KT_redirectLoginSuccess="../wizards/wiz_advert_leden_zoek_reacties.php?klantnummer=$klantnummer"; $KT_redirectLoginFailed="abo_login_failed.php"; $KT_rsUser_Source="SELECT klantnummer, wachtwoord "; if ($KT_fldUserAuthorization != "") $KT_rsUser_Source .= "," . $KT_fldUserAuthorization; $KT_rsUser_Source .= " FROM abonnees WHERE klantnummer='" . $KT_valUsername . "' AND wachtwoord='" . $wachtwoord . "'"; $KT_rsUser=$klussenbank_con->Execute($KT_rsUser_Source) or DIE($klussenbank_con->ErrorMsg()); if (!$KT_rsUser->EOF) { // username and password match - this is a valid user $KT_Username=$KT_valUsername; session_register("KT_Username"); if ($KT_fldUserAuthorization != "") { $KT_UserAuthorization=$KT_rsUser->Fields($KT_fldUserAuthorization); } else { $KT_UserAuthorization=""; } session_register("KT_UserAuthorization"); if (isset($accessdenied) && false) { $KT_redirectLoginSuccess = $accessdenied; } $KT_rsUser->Close(); session_register("KT_login_failed"); $KT_login_failed = false; header ("Location: $KT_redirectLoginSuccess"); exit; } $KT_rsUser->Close(); session_register("KT_login_failed"); $KT_login_failed = true; header ("Location: $KT_redirectLoginFailed"); exit; } ?> <html> <head> <title>Welkom op Klussenbank.nl</title> <link rel="stylesheet" href="../css/style.css" type="text/css"> <script language="JavaScript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.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.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_showHideLayers() { //v3.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; } obj.visibility=v; } } function MM_validateForm() { //v4.0 var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; 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') { if (isNaN(val)) errors+='- '+nm+' must contain a number.n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (val<min || max<val) 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'+errors); document.MM_returnValue = (errors == ''); } //--> </script> </head> <body bgcolor="#FFFFFF" background="../images/bgtop.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="1" bgcolor="#FFFFFF" colspan="3"> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> </tr> <tr> <td width="1" bgcolor="#FFFFFF"> <img src="../images/spacer.gif" width="1" height="1" alt=""> </td> <td width="100%"> <table width="765" border="0" cellspacing="0" cellpadding="0" bgcolor="#990000"> <tr> <td > <img src="../images/top_01.gif" width="319" height="78"></td> <td > <img src="../images/top_02.gif" width="405" height="78"></td> <td > <img src="../images/top_03.gif" width="41" height="78"></td> </tr> </table> <table width="675" height="21" border="0" cellspacing="0" cellpadding="0" bgcolor="#FF6600"> <tr> <td align="right"> <!-- hier begint gedeelte voor de mainlinks - 'laag 1' --> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FF6600"> <?php include ("../toplinks.inc"); ?> </table> <!-- einde gedeelte voor de mainlinks - 'laag 1' --> </td> </tr> </table> </td> </tr> </table> <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="3" colspan="3"> <img src="../images/spacer.gif" width="1" height="3" alt=""></td> </tr> <tr> <td width="1" height="100%" bgcolor="#FFFFFF"> <img src="../images/spacer.gif" width="1" height="1" alt=""> </td> <td width="180" bgcolor="#CC9966" valign="top"> <img src="../images/bgleft2.jpg" width="180" height="185" alt=""> <!-- hier begint gedeelte voor sublinks - 'laag 2' --> <div id="leftlink" style="position:absolute; left:10; top:120; width:165px; visibility:visible; z-index:1;; overflow: visible; height: 195px"> <?php include ("../leftlinks.inc"); ?> </div> <!-- einde gedeelte voor sublinks - 'laag 2' --> </td> <td width="99%" bgcolor="#FFCC99" valign="top"> <img src="../images/bgcontent.jpg" width="363" height="365" alt="" hspace="100"> <!-- hier begint het content gedeelte van de pagina --> <div id="content" style="position:absolute; left:200px; top:148px; width:520px; visibility:visible; z-index:1;; overflow: visible; height: 265px"> <form name="advert_login_form" method="post" action="<?php echo $KT_LoginAction?>"> <table width="520" border="1" cellspacing="0" cellpadding="1" bgcolor="#99CCFF" bordercolor="#000000" align="center"> <tr bgcolor="#990000" bordercolor="#990000"> <td colspan="2"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="5"><b><font size="2" color="#FFFFFF">ABONNEES - KLUSSENBANK.NL</font></b></font></div> </td> </tr> <tr bgcolor="#FFCC99" bordercolor="#FFCC99"> <td colspan="2"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b><font color="#000000" size="2">&nbsp;INLOGGEN - ADVERTENTIE-APPLICATIE</font></b></font></div> </td> </tr> <tr bordercolor="#FFE1C4" bgcolor="#FFE1C4"> <td width="308" align="left" valign="middle" height="19"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1">&nbsp;Uw toegangscode:</font></b></td> <td width="300" valign="middle" height="19"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input type="text" name="klantnummer" size="30" maxlength="100" style="font-family: Verdana; font-size: 8 pt; border: 1 solid #808080"> </font></td> </tr> <tr bordercolor="#FFE1C4" bgcolor="#FFE1C4"> <td width="308" align="left" valign="middle"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1">&nbsp;Uw wachtwoord:</font></b></td> <td width="300" valign="middle"> <input type="password" name="wachtwoord" maxlength="250" size="30" style="font-family: Verdana; font-size: 8 pt; border: 1 solid #808080"> </td> </tr> <tr bgcolor="#990000" bordercolor="#990000" align="center" valign="middle"> <td colspan="2"> <div align="center"><font size="2"><b><font face="Tahoma"> <input type="image" border="0" name="submit" src="../images/wiz_btns/volgende.gif" width="97" height="28" align="middle" onClick="MM_validateForm('wachtwoord','','R');return document.MM_returnValue"> </font></b></font></div> </td> </tr> </table> </form> <br> </div> <!-- einde content gedeelte van de pagina --> </td> </tr> </table> </body> </html> <?php $Rs_set_index_cat->Close(); ?> The 'advertiser'-login, 'advert_login.php> <?php // Copyright (c) Interakt Online 2001 // http://www.interakt.ro/ require("./../../adodb/adodb.inc.php"); require("./../../Connections/klussenbank_con.php"); ?><?php $Rs_set_index_cat=$klussenbank_con->Execute("SELECT * FROM categorieen WHERE type = 'MAIN'") or DIE($klussenbank_con->ErrorMsg()); $Rs_set_index_cat_numRows=0; $Rs_set_index_cat__totalRows=$Rs_set_index_cat->RecordCount(); ?><?php $Repeat1__numRows = -1; $Repeat1__index= 0; $Rs_advert_cat_sel_numRows = $Rs_advert_cat_sel_numRows + $Repeat1__numRows; ?><?php // *** Start the session session_start(); $UserVerified="./../wizards/wiz_advert_titels.php?usernaam=$KT_Usrname"; if ($KT_Usrname!=NULL){ header ("Location: $UserVerified"); exit; } else {} ?><?php // *** Start the session session_start(); // *** Validate request to log in to this site. $KT_LoginAction = $PHP_SELF; if ($QUERY_STRING!="") $KT_LoginAction .= "?".$QUERY_STRING; if (isset($usernaam)) { $KT_valUsername=$usernaam; $KT_fldUserAuthorization=""; $KT_redirectLoginSuccess="./../wizards/wiz_advert_titels.php?usernaam=$usernaam&wachtwoord=$wachtwoord"; $KT_redirectLoginFailed="advert_login_failed.php"; $KT_rsUser_Source="SELECT usernaam, wachtwoord "; if ($KT_fldUserAuthorization != "") $KT_rsUser_Source .= "," . $KT_fldUserAuthorization; $KT_rsUser_Source .= " FROM adverteerder WHERE usernaam='" . $KT_valUsername . "' AND wachtwoord='" . $wachtwoord . "'"; $KT_rsUser=$klussenbank_con->Execute($KT_rsUser_Source) or DIE($klussenbank_con->ErrorMsg()); if (!$KT_rsUser->EOF) { // username and password match - this is a valid user $KT_Usrname=$KT_valUsername; session_register("KT_Usrname"); if ($KT_fldUserAuthorization != "") { $KT_UserAuthorization=$KT_rsUser->Fields($KT_fldUserAuthorization); } else { $KT_UserAuthorization=""; } session_register("KT_UserAuthorization"); if (isset($accessdenied) && false) { $KT_redirectLoginSuccess = $accessdenied; } $KT_rsUser->Close(); session_register("KT_login_failed"); $KT_login_failed = false; header ("Location: $KT_redirectLoginSuccess"); exit; } $KT_rsUser->Close(); session_register("KT_login_failed"); $KT_login_failed = true; header ("Location: $KT_redirectLoginFailed"); exit; } ?> <html> <head> <title>Welkom op Klussenbank.nl</title> <link rel="stylesheet" href="../css/style.css" type="text/css"> <script language="JavaScript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.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.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_showHideLayers() { //v3.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; } obj.visibility=v; } } function MM_validateForm() { //v4.0 var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; 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') { if (isNaN(val)) errors+='- '+nm+' must contain a number.n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (val<min || max<val) 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'+errors); document.MM_returnValue = (errors == ''); } //--> </script> </head> <body bgcolor="#FFFFFF" background="../images/bgtop.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="1" bgcolor="#FFFFFF" colspan="3"> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> </tr> <tr> <td width="1" bgcolor="#FFFFFF"> <img src="../images/spacer.gif" width="1" height="1" alt=""> </td> <td width="100%"> <table width="765" border="0" cellspacing="0" cellpadding="0" bgcolor="#990000"> <tr> <td > <img src="../images/top_01.gif" width="319" height="78"></td> <td > <img src="../images/top_02.gif" width="405" height="78"></td> <td > <img src="../images/top_03.gif" width="41" height="78"></td> </tr> </table> <table width="675" height="21" border="0" cellspacing="0" cellpadding="0" bgcolor="#FF6600"> <tr> <td align="right"> <!-- hier begint gedeelte voor de mainlinks - 'laag 1' --> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FF6600"> <?php include ("../toplinks.inc"); ?> </table> <!-- einde gedeelte voor de mainlinks - 'laag 1' --> </td> </tr> </table> </td> </tr> </table> <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="3" colspan="3"> <img src="../images/spacer.gif" width="1" height="3" alt=""></td> </tr> <tr> <td width="1" height="100%" bgcolor="#FFFFFF"> <img src="../images/spacer.gif" width="1" height="1" alt=""> </td> <td width="180" bgcolor="#CC9966" valign="top"> <img src="../images/bgleft2.jpg" width="180" height="185" alt=""> <!-- hier begint gedeelte voor sublinks - 'laag 2' --> <div id="leftlink" style="position:absolute; left:10; top:120; width:165px; visibility:visible; z-index:1;; overflow: visible; height: 195px"> <?php include ("../leftlinks.inc"); ?> </div> <!-- einde gedeelte voor sublinks - 'laag 2' --> </td> <td width="99%" bgcolor="#FFCC99" valign="top"> <img src="../images/bgcontent.jpg" width="363" height="365" alt="" hspace="100"> <!-- hier begint het content gedeelte van de pagina --> <div id="content" style="position:absolute; left:200px; top:148px; width:520px; visibility:visible; z-index:1;; overflow: visible; height: 265px"> <form name="advert_login_form" method="post" action="<?php echo $KT_LoginAction?>"> <table width="520" border="1" cellspacing="0" cellpadding="1" bgcolor="#99CCFF" bordercolor="#000000" align="center"> <tr bgcolor="#990000" bordercolor="#990000"> <td colspan="2"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="5"><b><font size="2" color="#FFFFFF">ADVERTEERDERS - KLUSSENBANK.NL</font></b></font></div> </td> </tr> <tr bgcolor="#FFCC99" bordercolor="#FFCC99"> <td colspan="2"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b><font color="#000000" size="2">&nbsp;INLOGGEN - ADVERTENTIE-APPLICATIE</font></b></font></div> </td> </tr> <tr bordercolor="#FFE1C4" bgcolor="#FFE1C4"> <td width="308" align="left" valign="middle" height="19"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1">&nbsp;Uw gebruikersnaam:</font></b></td> <td width="300" valign="middle" height="19"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input type="text" name="usernaam" size="30" maxlength="100" style="font-family: Verdana; font-size: 8 pt; border: 1 solid #808080"> </font></td> </tr> <tr bordercolor="#FFE1C4" bgcolor="#FFE1C4"> <td width="308" align="left" valign="middle"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1">&nbsp;Uw wachtwoord:</font></b></td> <td width="300" valign="middle"> <input type="password" name="wachtwoord" maxlength="250" size="30" style="font-family: Verdana; font-size: 8 pt; border: 1 solid #808080"> </td> </tr> <tr bgcolor="#990000" bordercolor="#990000" align="center" valign="middle"> <td colspan="2"> <div align="center"><font size="2"><b><font face="Tahoma"> <input type="image" border="0" name="submit" src="../images/wiz_btns/volgende.gif" width="97" height="28" align="middle" onClick="MM_validateForm('wachtwoord','','R');return document.MM_returnValue"> </font></b></font></div> </td> </tr> </table> </form> <br> </div> <!-- einde content gedeelte van de pagina --> </td> </tr> </table> </body> </html> <?php $Rs_set_index_cat->Close(); ?> Right, the 'setmaincat2'-page> <?php // Copyright (c) Interakt Online 2001 // http://www.interakt.ro/ require("./../../adodb/adodb.inc.php"); require("./../../Connections/klussenbank_con.php"); ?><?php $Rs_advert_main__MMColParam = "1"; if (isset($HTTP_GET_VARS["usernaam"])) {$Rs_advert_main__MMColParam = $HTTP_GET_VARS["usernaam"];} ?><?php $Rs_advert_main__MMColParam2 = "1"; if (isset($HTTP_GET_VARS["wachtwoord"])) {$Rs_advert_main__MMColParam2 = $HTTP_GET_VARS["wachtwoord"];} ?><?php session_start(); // Copyright (c) Interakt Online 2001 // http://www.interakt.ro/ require("./../../adodb/adodb.inc.php"); require("./../../Connections/klussenbank_con.php"); ?><?php $Rs_advert_cat_sel=$klussenbank_con->Execute("SELECT * FROM categorieen WHERE type = 'MAIN'") or DIE($klussenbank_con->ErrorMsg()); $Rs_advert_cat_sel_numRows=0; $Rs_advert_cat_sel__totalRows=$Rs_advert_cat_sel->RecordCount(); ?><?php $Rs_advert_main=$klussenbank_con->Execute("SELECT * FROM advertenties, adverteerder WHERE user = '" . ($Rs_advert_main__MMColParam) . "' AND adverteerder.wachtwoord='" . ($Rs_advert_main__MMColParam2) . "'") or DIE($klussenbank_con->ErrorMsg()); $Rs_advert_main_numRows=0; $Rs_advert_main__totalRows=$Rs_advert_main->RecordCount(); ?><?php $Rs_set_index_cat=$klussenbank_con->Execute("SELECT * FROM categorieen WHERE type = 'MAIN'") or DIE($klussenbank_con->ErrorMsg()); $Rs_set_index_cat_numRows=0; $Rs_set_index_cat__totalRows=$Rs_set_index_cat->RecordCount(); ?><?php // *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters // create the list of parameters which should not be maintained $MM_removeList = "&index="; if ($MM_paramName != "") $MM_removeList .= "&".strtolower($MM_paramName)."="; $MM_keepURL=""; $MM_keepForm=""; $MM_keepBoth=""; $MM_keepNone=""; // add the URL parameters to the MM_keepURL string reset ($HTTP_GET_VARS); while (list ($key, $val) = each ($HTTP_GET_VARS)) { $nextItem = "&".strtolower($key)."="; if (!stristr($MM_removeList, $nextItem)) { $MM_keepURL .= "&".$key."=".urlencode($val); } } // add the URL parameters to the MM_keepURL string if(isset($HTTP_POST_VARS)){ reset ($HTTP_POST_VARS); while (list ($key, $val) = each ($HTTP_POST_VARS)) { $nextItem = "&".strtolower($key)."="; if (!stristr($MM_removeList, $nextItem)) { $MM_keepForm .= "&".$key."=".urlencode($val); } } } // create the Form + URL string and remove the intial '&' from each of the strings $MM_keepBoth = $MM_keepURL."&".$MM_keepForm; if (strlen($MM_keepBoth) > 0) $MM_keepBoth = substr($MM_keepBoth, 1); if (strlen($MM_keepURL) > 0) $MM_keepURL = substr($MM_keepURL, 1); if (strlen($MM_keepForm) > 0) $MM_keepForm = substr($MM_keepForm, 1); ?> <html> <STYLE TYPE="text/css"> <!-- input {font-family: Verdana; font-size: 8pt;} select {font-family: Verdana; font-size: 8pt;} textarea {font-family: Verdana; font-size: 8pt;} .NewsHeading {font-weight:bold; font-size:8pt; color:#0070FF;} .LinkHeading {font-weight:bold; font-size:10pt; color:#FFFFFF;} .LinkDisabled {color:#999999;} .LinkBreak {color:#A9A9A9;} --> </STYLE> <head> <title>Welkom op Klussenbank.nl</title> <link rel="stylesheet" href="../css/style.css" type="text/css"> <script language="JavaScript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.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.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_showHideLayers() { //v3.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; } obj.visibility=v; } } //--> </script> <script language="JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); // --> </script> </head> <body bgcolor="#FFFFFF" background="../images/bgtop.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <?php if ($KT_Usrname==NULL){ echo " <div id="cnt" style="position:absolute; left:200px; top:122px; width:520; height:40px; z-index:2"> <div align="center"><font face="Verdana" size="2" color="black"><b>U wilt een gratis advertentie plaatsen?</b><br> <br> <a href="../content/advert_login.php" style="color:#990000;">Login</a> als u al eerder een advertentie heeft geplaatst of <br> kies een categorie om een nieuwe advertentie te plaatsen.</font></div> </div> ";} else { echo " "; } ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="1" bgcolor="#FFFFFF" colspan="3"> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> </tr> <tr> <td width="1" bgcolor="#FFFFFF"> <img src="../images/spacer.gif" width="1" height="1" alt=""> </td> <td width="100%"> <table width="765" border="0" cellspacing="0" cellpadding="0" bgcolor="#990000"> <tr> <td > <img src="../images/top_01.gif" width="319" height="78"></td> <td > <img src="../images/top_02.gif" width="405" height="78"></td> <td > <img src="../images/top_03.gif" width="41" height="78"></td> </tr> </table> <table width="675" height="21" border="0" cellspacing="0" cellpadding="0" bgcolor="#FF6600"> <tr> <td align="right"> <!-- hier begint gedeelte voor de mainlinks - 'laag 1' --> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FF6600"> <?php include ("../toplinks.inc"); ?> </table> <!-- einde gedeelte voor de mainlinks - 'laag 1' --> </td> </tr> </table> </td> </tr> </table> <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="3" colspan="3"> <img src="../images/spacer.gif" width="1" height="3" alt=""></td> </tr> <tr> <td width="1" height="100%" bgcolor="#FFFFFF"> <img src="../images/spacer.gif" width="1" height="1" alt=""> </td> <td width="180" bgcolor="#CC9966" valign="top"> <img src="../images/bgleft2.jpg" width="180" height="185" alt=""> <!-- hier begint gedeelte voor sublinks - 'laag 2' --> <div id="leftlink" style="position:absolute; left:10; top:120; width:165; visibility:visible; z-index:1;; overflow: visible"> <?php include ("../leftlinks.inc"); ?> </div> <!-- einde gedeelte voor sublinks - 'laag 2' --> </td> <td width="100%" bgcolor="#FFCC99" valign="top"> <img src="../images/bgcontent.jpg" width="363" height="365" alt="" hspace="100"> <!-- hier begint het content gedeelte van de pagina --> <div id="content" style="position:absolute; left:200; top:200; width:520; visibility:visible; z-index:1;; overflow: hidden; background-image: url(../images/login_bg1.jpg); layer-background-image: url(../images/login_bg1.jpg); height: 176; border: 1px none #000000"> <table width="558" border="0" cellspacing="0" cellpadding="2"> <tr> <td> <div align="center"><font face="Verdana" size="2" color="#660000"><b>&nbsp;<br> Selecteer een Hoofdcategorie</b></font></div> </td> </tr> </table> <form name="form1" method="post" action=" <?php if ($KT_Usrname==NULL){ echo "wiz_advert_inschrijf_form.php"; } else { echo "../content/advert_nieuw_form.php"; } ?>"> <table width="558" border="0" cellspacing="0" cellpadding="2"> <tr> <td> <div align="center"> <select name="cat_select"> <?php if ($Rs_advert_cat_sel__totalRows > 0){ $Rs_advert_cat_sel__index=0; $Rs_advert_cat_sel->MoveFirst(); WHILE ($Rs_advert_cat_sel__index < $Rs_advert_cat_sel__totalRows){ ?> <OPTION VALUE="<?php echo $Rs_advert_cat_sel->Fields("main_categorie")?>"> <?php echo $Rs_advert_cat_sel->Fields("titel");?> </OPTION> <?php $Rs_advert_cat_sel->MoveNext(); $Rs_advert_cat_sel__index++; } $Rs_advert_cat_sel__index=0; $Rs_advert_cat_sel->MoveFirst(); } ?> </select> <input type="submit" name="Submit" value="OK"> <input type="hidden" name="id" value="<?php echo $Rs_advert_main->Fields("id")?>"> <input type="hidden" name="user" value="<?php echo $Rs_advert_main->Fields("user")?>"> <input type="hidden" name="naam" value="<?php echo $Rs_advert_main->Fields("naam")?>"> <input type="hidden" name="email" value="<?php echo $Rs_advert_main->Fields("email")?>"> </div> </td> </tr> </table> </form> </div> <!-- einde content gedeelte van de pagina --> </td> </tr> </table> </body> </html> <?php $Rs_advert_cat_sel->Close(); ?> <?php $Rs_advert_main->Close(); ?> <?php $Rs_set_index_cat->Close(); ?> In advance I thank everybody for their help. DJ Adema Webdeveloper GoMotion BV http://www.gomotion.nl
Link naar reactie
Bedankt voor de snelle respons. Het spijt me, Omdat ik deze vraag ook op een Engelstalig forum had gesteld en geen zin had om alles te vertalen, heb ik alles geknipt en geplakt. Ik kan niet specifiek aangeven op welke lijn(en) het mis gaat, omdat de source-code in principe foutloos werkt; vandaar de 'ellenlange' stukken code. Dan maar de delen die er het meest toe doen (kan alsnog uit de hand lopen ;-)): De 'abonnee-login', hier wordt de abonnee gecontroleerd op klantnummer en wachtwoord, waarvan het klantnummer opgeslagen wordt in een sessie genaamd $KT_Username: <?php // Copyright (c) Interakt Online 2001 // http://www.interakt.ro/ require("./../../adodb/adodb.inc.php"); require("./../../Connections/klussenbank_con.php"); ?><?php $Rs_set_index_cat=$klussenbank_con->Execute("SELECT * FROM categorieen WHERE type = 'MAIN'") or DIE($klussenbank_con->ErrorMsg()); $Rs_set_index_cat_numRows=0; $Rs_set_index_cat__totalRows=$Rs_set_index_cat->RecordCount(); ?><?php $Repeat1__numRows = -1; $Repeat1__index= 0; $Rs_advert_cat_sel_numRows = $Rs_advert_cat_sel_numRows + $Repeat1__numRows; ?><?php // *** Start the session session_start(); $UserVerified="../wizards/wiz_advert_leden_zoek_reacties.php?klantnummer=$KT_Username"; if ($KT_Username!=NULL){ header ("Location: $UserVerified"); exit; } else {} ?><?php // *** Start the session session_start(); // *** Validate request to log in to this site. $KT_LoginAction = $PHP_SELF; if ($QUERY_STRING!="") $KT_LoginAction .= "?".$QUERY_STRING; if (isset($klantnummer)) { $KT_valUsername=$klantnummer; $KT_fldUserAuthorization=""; $KT_redirectLoginSuccess="../wizards/wiz_advert_leden_zoek_reacties.php?klantnummer=$klantnummer"; $KT_redirectLoginFailed="abo_login_failed.php"; $KT_rsUser_Source="SELECT klantnummer, wachtwoord "; if ($KT_fldUserAuthorization != "") $KT_rsUser_Source .= "," . $KT_fldUserAuthorization; $KT_rsUser_Source .= " FROM abonnees WHERE klantnummer='" . $KT_valUsername . "' AND wachtwoord='" . $wachtwoord . "'"; $KT_rsUser=$klussenbank_con->Execute($KT_rsUser_Source) or DIE($klussenbank_con->ErrorMsg()); if (!$KT_rsUser->EOF) { // username and password match - this is a valid user $KT_Username=$KT_valUsername; session_register("KT_Username"); if ($KT_fldUserAuthorization != "") { $KT_UserAuthorization=$KT_rsUser->Fields($KT_fldUserAuthorization); } else { $KT_UserAuthorization=""; } session_register("KT_UserAuthorization"); if (isset($accessdenied) && false) { $KT_redirectLoginSuccess = $accessdenied; } $KT_rsUser->Close(); session_register("KT_login_failed"); $KT_login_failed = false; header ("Location: $KT_redirectLoginSuccess"); exit; } $KT_rsUser->Close(); session_register("KT_login_failed"); $KT_login_failed = true; header ("Location: $KT_redirectLoginFailed"); exit; } ?> Dan de 'adverteerders-login', hier wordt de adverteerder gecontroleerd op usernaam en wachtwoord, waarvan de usernaam opgeslagen wordt in een sessie genaamd $KT_Usrname: <?php // Copyright (c) Interakt Online 2001 // http://www.interakt.ro/ require("./../../adodb/adodb.inc.php"); require("./../../Connections/klussenbank_con.php"); ?><?php $Rs_set_index_cat=$klussenbank_con->Execute("SELECT * FROM categorieen WHERE type = 'MAIN'") or DIE($klussenbank_con->ErrorMsg()); $Rs_set_index_cat_numRows=0; $Rs_set_index_cat__totalRows=$Rs_set_index_cat->RecordCount(); ?><?php $Repeat1__numRows = -1; $Repeat1__index= 0; $Rs_advert_cat_sel_numRows = $Rs_advert_cat_sel_numRows + $Repeat1__numRows; ?><?php // *** Start the session session_start(); $UserVerified="./../wizards/wiz_advert_titels.php?usernaam=$KT_Usrname"; if ($KT_Usrname!=NULL){ header ("Location: $UserVerified"); exit; } else {} ?><?php // *** Start the session session_start(); // *** Validate request to log in to this site. $KT_LoginAction = $PHP_SELF; if ($QUERY_STRING!="") $KT_LoginAction .= "?".$QUERY_STRING; if (isset($usernaam)) { $KT_valUsername=$usernaam; $KT_fldUserAuthorization=""; $KT_redirectLoginSuccess="./../wizards/wiz_advert_titels.php?usernaam=$usernaam&wachtwoord=$wachtwoord"; $KT_redirectLoginFailed="advert_login_failed.php"; $KT_rsUser_Source="SELECT usernaam, wachtwoord "; if ($KT_fldUserAuthorization != "") $KT_rsUser_Source .= "," . $KT_fldUserAuthorization; $KT_rsUser_Source .= " FROM adverteerder WHERE usernaam='" . $KT_valUsername . "' AND wachtwoord='" . $wachtwoord . "'"; $KT_rsUser=$klussenbank_con->Execute($KT_rsUser_Source) or DIE($klussenbank_con->ErrorMsg()); if (!$KT_rsUser->EOF) { // username and password match - this is a valid user $KT_Usrname=$KT_valUsername; session_register("KT_Usrname"); if ($KT_fldUserAuthorization != "") { $KT_UserAuthorization=$KT_rsUser->Fields($KT_fldUserAuthorization); } else { $KT_UserAuthorization=""; } session_register("KT_UserAuthorization"); if (isset($accessdenied) && false) { $KT_redirectLoginSuccess = $accessdenied; } $KT_rsUser->Close(); session_register("KT_login_failed"); $KT_login_failed = false; header ("Location: $KT_redirectLoginSuccess"); exit; } $KT_rsUser->Close(); session_register("KT_login_failed"); $KT_login_failed = true; header ("Location: $KT_redirectLoginFailed"); exit; } ?> Alvast bedankt voor de hulp en een goed weekend! Djurre Adema GoMotion BV http://www.gomotion.nl
Link naar reactie
Met alle respect, maar het wordt er niet echt duidelijker op. Ik zie sowieso een aantal "vreemde" variabelen her en der opduiken met telkens andere namen ($KT_username, $username, $KT_usrname, $KT_valUsername, enz.) dus dat maakt het geheel ook al niet helderder. Het is voor mij in ieder geval geen doen om jouw code te doorgronden (heb er ook niet echt zin in als ik eerlijk moet zijn :wink:), dus misschien moet je op strategische plekken in de code even wat echo's plaatsen om te kijken of variabelen wel goed gevuld zijn, wat de location-header-string is (ipv meteen redirecten). En dan stukje bij beetje je eigen (?) code proberen te ontrafelen. ps. "Het idee achter de aanpak vormt de basis voor succes"? grapje zeker? :wink:
Link naar reactie

Om een reactie te plaatsen, moet je eerst inloggen

Gast
Reageer op dit topic

×   Geplakt als verrijkte tekst.   Herstel opmaak

  Er zijn maximaal 75 emoji toegestaan.

×   Je link werd automatisch ingevoegd.   Tonen als normale link

×   Je vorige inhoud werd hersteld.   Leeg de tekstverwerker

×   Je kunt afbeeldingen niet direct plakken. Upload of voeg afbeeldingen vanaf een URL in

  • Populaire leden

    Er is nog niemand die deze week reputatie heeft ontvangen.

  • Leden

    Geen leden om te tonen

×
×
  • Nieuwe aanmaken...