bev Posted October 24, 2008 Share Posted October 24, 2008 I want to change the code below from using an email address to login to using company name to login. What would I change here. <? $Level=""; include($Level."includes/global_inc.php"); if($_GET[act]=="a"){ $msg="Registered Successfully!!";} if($_POST[btnSubmit]=="Submit") { $select=mysql_query("select * from user_registration where email='$_POST[email]' and pword='$_POST[password]'"); $num=mysql_num_rows($select); if($num==1) { $sel=mysql_fetch_object($select); if($sel->approval==1) { $_SESSION[uid]=$sel->id; $_SESSION[uemail]=$sel->email; echo "<script>window.location.href='memberpage.php'</script>"; } elseif($sel->approval==2) { $_SESSION[aid]=$sel->id; $_SESSION[aname]=$sel->email; echo "<script>window.location.href='wornadmin.php'</script>"; } else { $msg="User Not Activated"; } } else { $msg="Invalid User Name & Password"; } } ?> <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"> <html> <link rel="stylesheet" href="includes/style.css" type="text/css" /> <head> <title>WORN PANTY GIRLS</title> <meta name="description" content="PANTY DESIRE - Hourly Updated FREE Panty Galleries"> <meta name="keywords" content="panty, panties, upskirt, legs, ass, girls, free, pictures"> <!--<style type="text/css"> <!-- * {padding: 0; margin: 0;} body {font: 11px Verdana, Arial, sans-serif;} a {font-family: Verdana, Arial, sans-serif; color: #3366FF; text-decoration: none;} a:hover {text-decoration: underline;} .block {margin: auto; width: 900px; } .block img {margin: 2px; float: center; width: 135px; height: 175px; border: 1px solid #A73E9D;} .footer {margin: auto; width: 790px; font: 11px Verdana, Arial, sans-serif; color: black} h1 {margin-bottom: 0px; font: bold 25px Verdana, Arial, sans-serif; color: #09C;} h3 {font: bold 17px Verdana, Arial, sans-serif; color: #09C;} body { scrollbar-face-color: #660033; scrollbar-highlight-color: #CC0099; scrollbar-shadow-color: #330000; scrollbar-3dlight-color: #330000; scrollbar-arrow-color: #CC0099; scrollbar-track-color: #B22763; scrollbar-darkshadow-color: #1B1E25; } a.topup:link, a.topup:visited { FILTER: DropShadow(Color=#660033, OffX=1, OffY=1, Positive=1); FONT-SIZE: 18pt; COLOR: #ffffff; HEIGHT: 12px; font-weight:bolder; text-decoration: none } a.topup:active, a.topup:hover { text-decoration: underline; .style1 {color: #660033} .style14 { font-size: 36px; font-family: IronMan; } #Layer1 { position:absolute; left:53px; top:381px; width:932px; height:26px; z-index:1; } .style15 {color: #000000} </style>--> <script type="text/javascript"> <!-- document.cookie='atref=noref$#; path=/;' // --> </script> <script language="JavaScript" src="Banner%20Rotator/magicimage.js" type="text/javascript"> </script> </head> <body bgcolor='#FF77A5' leftMargin="0" topMargin="0" marginwidth="0" marginheight="0"> <SCRIPT language=JavaScript> /* Milonic DHTML Website Navigation Menu Written by Andy Woolley, e-mail menu3@milonic.com Copyright 2002 (c) Milonic Solutions Ltd. All Rights Reserved. You may use this menu on your web site free of charge as long as you place a link to http://www.milonic.co.uk/menu and copyright notices remain in place. Commercial support contracts are available on request if you cannot comply with the above rules. */ // Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/ </SCRIPT> <SCRIPT language=JavaScript src="menu%20script/menu_array.js" type=text/javascript></SCRIPT> <SCRIPT language=JavaScript src="menu%20script/mmenu.js" type=text/javascript></SCRIPT> <table width="100%" align="center" cellpadding="0" cellspacing="0"> <? include($Level."includes/top.php"); ?> <tr> <td background="http://www.wornpantygirls.com/images/bar-dwn.jpg"> </td> <td bgcolor="#CC6699"><div align="center"> <table width="100%" bordercolor="#CC99FF"> <tr> <? include($Level."includes/left.php"); ?> <td width="44%" valign="top"><div align="center"> <table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td><form name="login" action="" method="post"> <table width="100%" border="0" cellspacing="2" cellpadding="2" class="stylet16"> <tr> <td align="center"><table width="100%" border="0" cellspacing="7" cellpadding="2" class="stylet16"> <tr> <td colspan="2" class="style26"> </td> </tr> <tr> <td colspan="2" class="style26"> </td> </tr> <tr> <td colspan="2" class="style26"> </td> </tr> <tr> <td colspan="2" class="style26"> </td> </tr> <tr> <td colspan="2" class="style26"><?=$msg?><?=$useralready?></td> </tr> <tr> <td colspan="2" class="style23">Login Form : </td> </tr> <tr> <td width="42%" align="right">User ID :</td> <td width="58%"><input type="text" name="email" value="<?=$_POST[email]?>"> </td> </tr> <tr> <td align="right">Password : </td> <td><input type="text" name="password" value="<?=$_POST[password]?>"></td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" name="btnSubmit" value="Submit" onClick="return logincheck();"> </td> </tr> </table> <table width="100%" border="0" cellspacing="7" cellpadding="2" class="stylet16"> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> </table></td> </tr> </table> </form></td> </tr> </table> </div></td> <td width="29%"><center> </center> </tr> <tr> <td height="21" colspan="3"><table width="100%"> </table></td> </tr> </table> <? include($Level."includes/bottom.php");?> </div></td> <td background="http://www.wornpantygirls.com/images/bar-dwn.jpg"> </td> </tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/129991-change-login/ Share on other sites More sharing options...
DeanWhitehouse Posted October 24, 2008 Share Posted October 24, 2008 What? You want us to look through your code and change it for you. Ask in the freelance section. Quote Link to comment https://forums.phpfreaks.com/topic/129991-change-login/#findComment-673914 Share on other sites More sharing options...
darkfreaks Posted October 24, 2008 Share Posted October 24, 2008 i believe she wants to know how she would change her code to select the company_name instead of the email in the database. if you try to change it it messes up the whole code and im done looking thru it. Quote Link to comment https://forums.phpfreaks.com/topic/129991-change-login/#findComment-673932 Share on other sites More sharing options...
bev Posted October 24, 2008 Author Share Posted October 24, 2008 darkfreaks was looking at the code. Asked me to put up that post. I guess so he would not look like the dumb_ss that he wants to call everyone else. Not a pleasant person to try and work with at all. Very rude.. darkfreaks Learn how to just say you cant do something instead of telling others they are stupid. Quote Link to comment https://forums.phpfreaks.com/topic/129991-change-login/#findComment-673954 Share on other sites More sharing options...
Lee-Bartlett Posted October 24, 2008 Share Posted October 24, 2008 Im dumb and all that, no nothing really, cant you just change the varibles to match the relevent db collum? Only try to help if its stupid. Quote Link to comment https://forums.phpfreaks.com/topic/129991-change-login/#findComment-673958 Share on other sites More sharing options...
runnerjp Posted October 24, 2008 Share Posted October 24, 2008 well first i would creat session to get company name instead of email $_SESSION[uemail]=$sel->email; <? $Level=""; include($Level."includes/global_inc.php"); if($_GET[act]=="a"){ $msg="Registered Successfully!!";} if($_POST[btnSubmit]=="Submit") { $select=mysql_query("select * from user_registration where company_name='$_POST[company_name]' and pword='$_POST[password]'"); $num=mysql_num_rows($select); if($num==1) { $sel=mysql_fetch_object($select); if($sel->approval==1) { $_SESSION[uid]=$sel->id; $_SESSION[uemail]=$sel->email; echo "<script>window.location.href='memberpage.php'</script>"; } elseif($sel->approval==2) { $_SESSION[aid]=$sel->id; $_SESSION[aname]=$sel->email; echo "<script>window.location.href='wornadmin.php'</script>"; } else { $msg="User Not Activated"; } } else { $msg="Invalid User Name & Password"; } } ?> <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"> <html> <link rel="stylesheet" href="includes/style.css" type="text/css" /> <head> <title>WORN PANTY GIRLS</title> <meta name="description" content="PANTY DESIRE - Hourly Updated FREE Panty Galleries"> <meta name="keywords" content="panty, panties, upskirt, legs, ass, girls, free, pictures"> <!--<style type="text/css"> <!-- * {padding: 0; margin: 0;} body {font: 11px Verdana, Arial, sans-serif;} a {font-family: Verdana, Arial, sans-serif; color: #3366FF; text-decoration: none;} a:hover {text-decoration: underline;} .block {margin: auto; width: 900px; } .block img {margin: 2px; float: center; width: 135px; height: 175px; border: 1px solid #A73E9D;} .footer {margin: auto; width: 790px; font: 11px Verdana, Arial, sans-serif; color: black} h1 {margin-bottom: 0px; font: bold 25px Verdana, Arial, sans-serif; color: #09C;} h3 {font: bold 17px Verdana, Arial, sans-serif; color: #09C;} body { scrollbar-face-color: #660033; scrollbar-highlight-color: #CC0099; scrollbar-shadow-color: #330000; scrollbar-3dlight-color: #330000; scrollbar-arrow-color: #CC0099; scrollbar-track-color: #B22763; scrollbar-darkshadow-color: #1B1E25; } a.topup:link, a.topup:visited { FILTER: DropShadow(Color=#660033, OffX=1, OffY=1, Positive=1); FONT-SIZE: 18pt; COLOR: #ffffff; HEIGHT: 12px; font-weight:bolder; text-decoration: none } a.topup:active, a.topup:hover { text-decoration: underline; .style1 {color: #660033} .style14 { font-size: 36px; font-family: IronMan; } #Layer1 { position:absolute; left:53px; top:381px; width:932px; height:26px; z-index:1; } .style15 {color: #000000} </style>--> <script type="text/javascript"> <!-- document.cookie='atref=noref$#; path=/;' // --> </script> <script language="JavaScript" src="Banner%20Rotator/magicimage.js" type="text/javascript"> </script> </head> <body bgcolor='#FF77A5' leftMargin="0" topMargin="0" marginwidth="0" marginheight="0"> <SCRIPT language=JavaScript> /* Milonic DHTML Website Navigation Menu Written by Andy Woolley, e-mail menu3@milonic.com Copyright 2002 (c) Milonic Solutions Ltd. All Rights Reserved. You may use this menu on your web site free of charge as long as you place a link to http://www.milonic.co.uk/menu and copyright notices remain in place. Commercial support contracts are available on request if you cannot comply with the above rules. */ // Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/ </SCRIPT> <SCRIPT language=JavaScript src="menu%20script/menu_array.js" type=text/javascript></SCRIPT> <SCRIPT language=JavaScript src="menu%20script/mmenu.js" type=text/javascript></SCRIPT> <table width="100%" align="center" cellpadding="0" cellspacing="0"> <? include($Level."includes/top.php"); ?> <tr> <td background="http://www.wornpantygirls.com/images/bar-dwn.jpg"> </td> <td bgcolor="#CC6699"><div align="center"> <table width="100%" bordercolor="#CC99FF"> <tr> <? include($Level."includes/left.php"); ?> <td width="44%" valign="top"><div align="center"> <table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td><form name="login" action="" method="post"> <table width="100%" border="0" cellspacing="2" cellpadding="2" class="stylet16"> <tr> <td align="center"><table width="100%" border="0" cellspacing="7" cellpadding="2" class="stylet16"> <tr> <td colspan="2" class="style26"> </td> </tr> <tr> <td colspan="2" class="style26"> </td> </tr> <tr> <td colspan="2" class="style26"> </td> </tr> <tr> <td colspan="2" class="style26"> </td> </tr> <tr> <td colspan="2" class="style26"><?=$msg?><?=$useralready?></td> </tr> <tr> <td colspan="2" class="style23">Login Form : </td> </tr> <tr> <td width="42%" align="right">User ID :</td> <td width="58%"><input type="text" name="email" value="<?=$_POST[company_name]?>"> </td> </tr> <tr> <td align="right">Password : </td> <td><input type="text" name="password" value="<?=$_POST[password]?>"></td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" name="btnSubmit" value="Submit" onClick="return logincheck();"> </td> </tr> </table> <table width="100%" border="0" cellspacing="7" cellpadding="2" class="stylet16"> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> <tr> <td class="style26"> </td> </tr> </table></td> </tr> </table> </form></td> </tr> </table> </div></td> <td width="29%"><center> </center> </tr> <tr> <td height="21" colspan="3"><table width="100%"> </table></td> </tr> </table> <? include($Level."includes/bottom.php");?> </div></td> <td background="http://www.wornpantygirls.com/images/bar-dwn.jpg"> </td> </tr> </table> </body> </html> that should do it .. well iv called your posts ect company_name.. and i would change select * from user_registration where company_name='$_POST[company_name]' ... where company_name to what ever it is in your db Quote Link to comment https://forums.phpfreaks.com/topic/129991-change-login/#findComment-673962 Share on other sites More sharing options...
darkfreaks Posted October 24, 2008 Share Posted October 24, 2008 ha that will not work runner i tried that and tried changing ->email to ->company_name and it dont work Quote Link to comment https://forums.phpfreaks.com/topic/129991-change-login/#findComment-673979 Share on other sites More sharing options...
runnerjp Posted October 24, 2008 Share Posted October 24, 2008 dang it hard to know when you cant test it on the server really aint it... i take it theres more file then just this one then Quote Link to comment https://forums.phpfreaks.com/topic/129991-change-login/#findComment-673983 Share on other sites More sharing options...
darkfreaks Posted October 24, 2008 Share Posted October 24, 2008 yeah and the whole code runs on globals *bangs head* Quote Link to comment https://forums.phpfreaks.com/topic/129991-change-login/#findComment-673987 Share on other sites More sharing options...
runnerjp Posted October 24, 2008 Share Posted October 24, 2008 oh crap... sounds like a script rewrite would be faster lol Quote Link to comment https://forums.phpfreaks.com/topic/129991-change-login/#findComment-674001 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.