Jump to content

Search the Community

Showing results for tags 'uniserv'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I have a php login script which checks the user and displays the page without any issues on my production server which is on internet. The same php script is not working when i run it locally, am using win xp, UNISERV(Like XAMPP, WAMP). i have tested the database, it is working fine. I have tested sample session programs, it is creating the session in the tmp folder. But when I run login.php, it just give me blank page. Can someone help. Pl find my code below: <?php // login.php include_once 'common.php'; include_once 'db2.php'; session_start(); $uid = isset($_POST['uid']) ? $_POST['uid'] : $_SESSION['uid']; $pwd = isset($_POST['pwd']) ? $_POST['pwd'] : $_SESSION['pwd']; if(!isset($uid)) { ?> <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test - Login</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <head> <style type="text/css"> <!-- .style1 { font-size: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; } .style3 { font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; } body { background-color: #D7F0FF; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> </head> <body> <h1 class="style1"> <br><br>Exceltron Site -Testing Login Required </h1> <span class="style3"><br> You <strong>must login to access this area </strong>of the site. <br> <br> If you are not a registered user, please contact your Admin to sign up for instant access!</span> <p><form method="post" action="<?=$_SERVER['PHP_SELF']?>"> <span class="style3">User ID: <input type="text" name="uid" size="12" /> <br> <br /> Password:</span> <input type="password" name="pwd" SIZE="12" /> <br> <br /> <input type="submit" value="Login" /> </form></p> </body> </html> <?php exit; } $_SESSION['uid'] = $uid; $_SESSION['pwd'] = $pwd; dbConnect("exceltron"); $sql = "SELECT * FROM user WHERE userid = '$uid' AND password = '$pwd'"; $result = mysql_query($sql); if (!$result) { error('A database error occurred while checking your '. 'login details.\\nIf this error persists, please '. 'contact you@example.com.'); } if (mysql_num_rows($result) == 0) { unset($_SESSION['uid']); unset($_SESSION['pwd']); ?> <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> Access Denied </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> <!-- .style1 { font-size: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; } .style3 { font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; } --> </style> </head> <body> <br/> <br/> <h1 class="style1"> Access Denied </h1> <p class="style3">Your user ID or password is incorrect, or you are not a registered user on this site. To try logging in again, click <a href="<?=$_SERVER['PHP_SELF']?>">here</a>. To access, please contact our Admin !</a>.</p> </body> </html> <?php exit; } $username = mysql_result($result,0,'fullname'); $_SESSION['user'] = mysql_result($result,0,'userid'); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.