j634 Posted August 12, 2009 Share Posted August 12, 2009 Hi all, I have been testing this log on script on local host with wamp server and it worked. After I uploaded it to Bravenet hosting the script stopped working. There are no error messages the page just refreshes and I am unable to log in. Here is the log in script: <?php require("settings.php"); require("lib/mysql.lib"); include ("change_lang.php"); $sval = ""; if($action == "submit"){ $db = c(); $r = q("select id,status from members where login='$login' and pswd='$pswd'"); if(e($r)) $es = "Invalid password!"; else{ $ff = f($r); switch($ff[status]){ case 0: $sval = "confirm"; break; case 1: setcookie("auth",$ff[id],time()+2500000); setcookie("pass",$pswd,time()+2500000); q("update profiles set ldate='".strtotime(date("d M Y H:i:s"))."' where id='$ff[id]'"); d($db); header("Location: profile.php"); break; case 2: $sval = "contact"; break; } } d($db); } include("_header.php"); if($sval == ""){ ?> <center> <div id="center_content"> <div class="center_top_bg"></div> <div class="center_bg"> <b><font size=4><?php echo LOGIN?> </font></b><br> <p><?php echo LOGIN1?></p> <p><br> </p> <table width="250" border="0" cellspacing="0" cellpadding="0"> <form action="login.php?action=submit" method="post"> <?php if($es != "" && $action == "submit") echo "<tr><td colspan=2><b><font color=C00000>$es</td></tr>"; ?> <tr> <td><?php echo FORGOT2?></td> <td> <input type="text" name="login" value="<?php echo $username; ?>" class=cmn> </td> </tr> <tr> <td><?php echo LOGIN2?></td> <td> <input type="password" name="pswd" value="<?php echo $password; ?>" class=cmn> </td> </tr> <tr> <td colspan="2"> <div align="center"> <input type="submit" value="Sign in"> </div></td> </tr> </form> </table> <br> <?php echo LOGIN3?> <a href="forgot.php"><?php echo HERE?></a> <?php echo LOGIN4?><br><br> <?php echo LOGIN5?> <a href="register.php"><?php echo HERE?></a> <?php echo LOGIN6?> <br><br> (<?php echo FORGOT4?> <a href="contact.php"><?php echo FORGOT5?></a>.) <?php } if($sval == "confirm"){ ?> <?php echo LOGIN7?><br> <?php echo LOGIN8?><br> <?php echo LOGIN9?><br> <?php } if($sval == "contact"){ ?> <?php echo LOGIN10?> <? echo $login ?>,<br> <?php echo LOGIN11?><br> <?php echo FORGOT4?> <a href=contact.php><?php echo FORGOT5?></a> <?php } ?> <div class="clear"></div> </div> <div class="center_bottom_bg"></div> </div> <?PHP include("_footer.php"); ?> Here is the lib script that handles the database connection etc... <?php if (!$mysq_lib_loaded) { function c(){ global $db_host, $db_login, $db_pswd; $db=mysql_connect($db_host,$db_login,$db_pswd); return $db; } function q($q_str){ global $db_name; $r = mysql_db_query($db_name,$q_str); return $r; } function d($db){ // mysql_close($db); } function e($r) { if(@mysql_numrows($r)) return 0; else return 1; } function f($r){ return mysql_fetch_array($r); } function nr($r){ return mysql_num_rows($r); } $dv=c(); $rv=q("select * from sysvars"); while($va = f($rv)) {${$va["name"]}=$va["value"];}; d($dv); function piurl($url) { if (strstr($url, "http://")) $ur=$url; else $ur=$ROOT_HOST."pictures/$url"; return $ur; }; $mysq_lib_loaded=1; } ?> I am at a loss after upload that it does not work anymore. Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/169855-solved-log-on-script-not-working-after-upload/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.