Jump to content

Problem with wamp2.0i installation


Recommended Posts

Hi guys.

 

I've been using xampp (http://www.apachefriends.org/en/xampp-windows.html) for almost 2 years now and i didn't have any problem using it. My problem now is that my friend wants to use my code that runs fine with the xampp set up but when installed in wampp, it displays the lines below. The php files are placed inside "c:\wamp\www\myproj" folder. did i miss something? Here is the output showing my login.php file:

 

0) { $row = mysql_fetch_array($res); if ($row[1] == 3) { print_header(TITLE); show_login(); print "

 

Access Denied.

 

"; print_footer(); } else { // check if employee is logged in $sql2 = "SELECT activity, ip_address FROM users_online WHERE user_id='$row[0]'"; $res2 = mysql_query($sql2); // if employee is logged in already if (mysql_num_rows($res2) > 0) { $row2 = mysql_fetch_array($res2); $activity = $row2[0]; $ip_address = $row2[1]; // if last activity is greater than 60mins, let the user in. else, block the user if (time() > $activity + 1800) { // employee has not logged in yet. log him/her in $_SESSION['user_id'] = $row[0]; // update user in users online table $query2 = "UPDATE users_online SET activity = NOW() WHERE user_id='$_SESSION[user_id]' LIMIT 1"; // update employee's last logged in date and time $query3 = "UPDATE users SET last_login=now(), last_ip='{$_SERVER['REMOTE_ADDR']}' WHERE user_id='$_SESSION[user_id]' LIMIT 1"; if(@mysql_query($query2) && @mysql_query($query3)) { // redirect the user to ipharm add_sale page header('location: add_sale.php'); exit(); } } else { print_header(TITLE); show_login(); print "

Possible hacking attempt!!! That user is currently LOGGED IN at

$ip_address.

You will not be allowed to log in. Sorry for the inconvenience.

"; print_footer(); } // employee is not logged in yet } else { // employee has not logged in yet. log him/her in $_SESSION['user_id'] = $row[0]; // insert into users online table $query2 = "INSERT INTO users_online(user_id, session_id, activity, ip_address, user_agent) VALUES('$row[0]', '".session_id()."', ".time().", '{$_SERVER['REMOTE_ADDR']}', '{$_SERVER['HTTP_USER_AGENT']}')"; // update employee's last logged in date and time $query3 = "UPDATE users SET last_login=now(), last_ip='{$_SERVER['REMOTE_ADDR']}' WHERE user_id='$_SESSION[user_id]' LIMIT 1"; if(@mysql_query($query2) && @mysql_query($query3)) { // redirect the user to ipharm add_sale page header('location: add_sale.php'); exit(); } } mysql_free_result($res2); } } else { print_header(TITLE); show_login(); print "

 

Username and Password do not match.

 

"; print_footer(); } } else { print_header(TITLE); show_login(); print "

 

Cannot process query.

 

"; print_footer(); } mysql_free_result($res); } else { print_header(TITLE); show_login(); print "

 

Please fill up both fields!

 

"; print_footer(); } } else { print_header(TITLE); show_login(); print "

 

You need to be logged in to access these pages.

 

"; print_footer(); } } ?>

 

Thanks so much guys.

Link to comment
Share on other sites

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.