Jump to content

PC Nerd

Members
  • Posts

    1,122
  • Joined

  • Last visited

    Never

Everything posted by PC Nerd

  1. well if you have a timeout on your cookie ( when you set it...... ) then simply reset the timout time, to 5 minutes before its set......... so that its automatically deleted on the page refresh..... you could even automatically relocate to eg index.php?message=logut then on index.php, add a popup to say "you are logged out" , if $_GET['message'] == "logout" etc. gdlk
  2. what i do is logg every page a user visits. simply adding their user ID, time, and IP, and pagename to the database. so what might be an idea, is to simply add code ( include?) at the begining of each page, that stats its name, eg $Session['pg_referer'] = "Thing.php"; then you can simply test that variabel to equal your page. gdlk
  3. ok, i only get $password, and bot the database retreival one. also, it gets to the sle, and passes the if. thanks
  4. um, makes no difference, im still not getting no password from the database thanks, anything else i should try?
  5. ok,, here is the full code: i know that the SQL is going to be unique, becauase i already have a script that ensures that a username is unique.... so therefore the pasword may be the same for some users, but its the different users. etc, so its not that, however i now know that the query isnt returning a password field, so its the query not working. $Game_Status = "Testing"; $username = $_POST['User_Name']; $password = $_POST['Password']; $valid = $_POST['Valid']; #echo "Username: {$username}<br>Password: {$password}<br>Valid: {$valid}<br><br>"; //echo out the values to see if they are being sent. $Error = ""; $Error1 = ""; $Error2 = ""; $Error3 = ""; $Error4 = ""; if($username != "" && $password != "" && $valid != "") { require('inc_files/Login_Pics.inc'); $img = "B_A-Login_".$_POST['IMG_Valid']; $Image_Validate = $IMAGES["$img"]; if($_POST['Valid'] == $Image_Validate) { $DB_Login_SQL = "SELECT User_Name, `Password`, User_ID, Account_Type FROM general_stats WHERE User_Name = '".$User_Name."' LIMIT 1"; $Login_Query = mysqli_query($DB_Server, $DB_Login_SQL); echo mysqli_error($DB_Server); if($Login_Query != 0 && !empty($Login_Query)) { $DB_Login = mysqli_fetch_array($Login_Query); echo $DB_Login["User_ID"]; echo $DB_Login["User_Name"]; echo $DB_Login["Password"]; if($Game_Status['Game_Status'] != 'Online') { if($DB_Login['Account_Type'] != 'Moderator' && $DB_Login['Account_Type'] != 'Administration') { echo $DB_Login['Account_Type']; #echo "<script language = 'JavaScript' type = 'text/javascript'>\n"; #echo "window.location = 'file2.php';\n"; #echo "<script>"; } } if($password == $DB_Login['Password']) { require("inc_files/include.inc"); echo "<script language = 'JavaScript' type = 'text/javascript'>\n"; echo "window.location = 'file.php?Login_ID=".$Login['Login_ID']."&User_ID=".$DB_Login['User_ID']."&User_Name=".$DB_Login['User_Name']."'\n"; echo "</script>"; } else { $Error = True; $Error4 = True; } } else { $Error = True; $Error3 = True; } } else { $Error = True; $Error2 = True; } } else { $Error = True; $Error1 = True; } so i think that the query isnt actually returning anythihng...... how do i echo every set variable / array in a poage. i know ive done it before. i want to see it the query is returning a mysqli_object, or if its returning a Boolean fail value. could someone help me to do this. thanks for all your help
  6. $Password is set, like $User_Name etc. right at the begining of the script: $Password = $_POST['Password']; etc. and i know its passing properly, becauase the two conditions befor this if...... test if its emtpy, and if the image validate is correct. thanks
  7. hi guys. i have a login script ( yes the same one still). and now ithe if, is always returning false $DB_Login_SQL = "SELECT User_Name, `Password`, User_ID, Account_Type FROM general_stats WHERE User_Name = '".$User_Name."'"; $Login_Query = mysqli_query($DB_Server, $DB_Login_SQL); echo mysqli_error($DB_Server); if($Login_Query != 0 && !empty($Login_Query)) { $DB_Login = mysqli_fetch_array($Login_Query); echo $DB_Login["User_ID"]; echo $DB_Login["User_Name"]; echo $DB_Login["Password"]; if($Game_Status['Game_Status'] != 'Online') { if($DB_Login['Account_Type'] != 'Moderator' && $DB_Login['Account_Type'] != 'Administration') { echo $DB_Login['Account_Type']; #echo "<script language = 'JavaScript' type = 'text/javascript'>\n"; #echo "window.location = 'redirection_locaiton';\n"; #echo "<script>"; } } if($password == $DB_Login['Password']) { require("inc_files/B_A-Login.inc"); echo "<script language = 'JavaScript' type = 'text/javascript'>\n"; echo "window.location = 'file.php?Login_ID=".$Login['Login_ID']."&User_ID=".$DB_Login['User_ID']."&User_Name=".$DB_Login['User_Name']."'\n"; echo "</script>"; } else { $Error = True; $Error4 = True; } } else { $Error = True; $Error3 = True; } Its the if, returning error 4. ive noticed that when the $DB_Login values are echoed near the begining, they dont return anything. however its wierd, becauase the fetech_array statement, doesnt return any error either. I know its some thing wiht the script, becauase when i use mysqli_error later on, it doesnt retuen anything, but this is always returning false, therefore, the script never logs you in.
  8. bump does anyone know how to setup this, or evensuggest s internet resource? thanks
  9. hi guys, im new to usingvisual basic 2005 (and in know this isnt eh forum to post question about it). but i wanted to create a "support desk" style program, which connects to a mysql database. ive had little luck in finding a reliable and easy to use tutorial on how to setup mysql to do this ( as i understadn i would need to user a plugin and ODBC). if anyone here has done it, is doing it, or somply knows where to look, could you let me know how to do this connection. thanks for your help and understanding, yours, PC Nerd
  10. um well if its a shared host ,ie, like no root access to php.ini, then you can use the .htaccess file to customise things like your php version if they offer different versions etc. in the time or date functions, is there actually a part where you can get the timezone....... in which you could simply conver the timzone? gdlk
  11. um a) wouldnt know, b) huh? godaddy? lol, thanks guys
  12. ok, wel firstly, id actually code it, and wouldnt rely on the server, becauae it doesnt record theusername etc from memory. what id do is: login and create the session or whatever. then what i do is have another table, with all page requests. then there is a include file at the begining of every page: include("check_login.php"); include("log_page.php"); also in the login section, i have a login tbale, with ID, in and out, and user etc. so in oage logging, you can simply add that persons UserName, User_ID, IP, Login id, so you can tell which session.... all of this. and only with a few require and tbales in a database. if you ned more info on how to do this, contact me through my email from my profile. good luck.
  13. ok: echo "<a .........../var_name=".$variable."'>"; that shoudl work
  14. i sort of need to do the same thing ,but through visual basic ( thats another story) what my host says is that you either need a static IP, and they can allow that through their firewall, or ican use SSH tunneling please dont ask what either mean, i havent really looked into either, but though tthose things might help you with your site. good luck
  15. well id do .... $records = array(); $same = 0; select * from table while $row = mysqli_fetch_array{ $records[] = $row } select * from table while $row = mysql_fetch_array($query) { foreach $row as $field => $value { foreach($records as $record) if($row[$field] == $record[field]) { $same = 1; } if($same == 0) { break; } } if($same == 1) { delete_duplicate($row['id']); } $records[] = $row } what it does is loops through every field in the database and checks every field in each row, against all the other rows......... then if all the fields are the same then call a function that you create, that deltes the duplicate howver thats only rough, dont rely on it though
  16. qnother thign you miught want to add is stuff like when they logged in and out. you could do this in a database, i do it on my site, and so i can see if they are regulars, or only on ocaisionally, and how long theyve been on forin total. i beleive thats what counts how long youve been in in this forum....
  17. AddHandler application/x-httpd-php5 .php i added that into the ".htaccess" file i think its like a custom extension of the php.ini file, so that you can specify different things to do with the serer and stuf. thanks
  18. ok, no problem, thanks anyway ill leave this open, in case anyone knows of a way to do it.
  19. hi guys, im relativly new to CSS, and have started sing it on my site........ except that i can ony see the color in IE7. my code is below. body {background-color: "#004400"; color: "#ffaa00"; font-size: "12";} ................ thats the bit that defines the background color and stuff is it simply that im using the wrong syntax, or is it my browsers ive been testing in firefox, opera, IE7 and mozilla, all different browsers, and the same result.......... all my widths etc in the CSS are working, just not the color if anyone needs the full style sheet, let me know, or go to http://www.battleages2.com/B_A-CSS.css thankyou
  20. ok, greatm thnks for your help.. is there any other way, to go it gloablly, like an event handeler or something liek: on mysqli_error() mysqli_ = 0; to cancel anything using mysqli_.......... if there is an error cauased by =it, and to possibly set it to mute "@" the error? cani do it that way? like in my ini file, or .htaccess on my login with my host etc.? thanks
  21. so will mysql_close actually cancel all mysql stuff, or will the rest of the functions eg the rest of the queries, actually get a no connection error, or whatever.? thanks for your help,
  22. ok, got it. the server was configured to run mysqli only on v5 and i have v4.4.6, so i sinply had to edit my .htaccess file, so it used php v5 thanks for your help
×
×
  • 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.