Jump to content

rootKID

Members
  • Posts

    467
  • Joined

  • Last visited

Everything posted by rootKID

  1. sorry for late reply, well. the answer is simple. i am trying to develop it so the user (before login to the website), can check/uncheck a box that will seperate sessions and cookies, so if box checked, it will use cookies, and if not, sessions. for fun ...
  2. ohh... s-h-i-t...just realized that i checked the wrong database, and when i chose the right one, the users was empty... oops... anyways, i have now rechecked, and still doing the same thing, i just dont get it...the code is looking just fine in my eyes...
  3. well, the quotes helped alot... now its going into the page at least and loading, but im getting this error: (Error reading login-session coding base, or a wrong username/pass inserted...)..) and i have checked the database... it should be just fine... no ideas why its giving me that error... i have used session_start and ob_start on each and one file that was needed... so it should be giving me at least a session running for the sessions im trying to get out...
  4. ok, just quick... im getting this when trying to login: Unknown column 'e5035533a816cac4c54012281f58543d' in 'where clause' and this is my takelogin.php file: /*==========RUN LOGIN PROCEDURE===============*/$uname = sqlesc($_POST['username']); /*Form Names...*/$pass = sqlesc($_POST['password']); /*Form Names...*/if(isset($pass)){$passhash = md_5($pass); /*Securing The Data...*/}$query = "SELECT * FROM users WHERE username = $uname AND passhash = $passhash AND enabled = 'yes' AND status = 'confirmed'";$query_result = mysql_query($query)or die(mysql_error());//Running query to the DB...if(mysql_num_rows($query_result) == 1)/*if the DB returns somfthing, then run...*/{$row = mysql_fetch_array($query_result);$_SESSION['uid'] = $row['u_id'];$_SESSION['username'] = $row['username'];$_SESSION['pass'] = $row['passhash'];$_SESSION['status'] = $row['status'];$_SESSION['enabled'] = $row['enabled'];$_SESSION['email'] = $row['email'];$_SESSION['ip'] = $row['ip'];$_SESSION['class'] = $row['class'];$_SESSION['time_offset'] = $row['time_offset'];$_SESSION['dst_in_use'] = $row['dst_in_use'];$_SESSION['auto_correct_dst'] = $row['auto_correct_dst'];header('Refresh: 3; url=index.php');//with time delay...}else/*Error messeage...*/{$HTMLOUT .= "<center>Error reading login-session coding base, or a wrong username/pass inserted...</center>";header('Refresh: 3; url=index.php');//with time delay...}/*==========RUN LOGIN PROCEDURE===============*/ any ideas? Oo...
  5. as promissed, a little late. but here is the solution: if(!empty($_FILES['user_picture']))//allways form name...{$handle = new Upload($_FILES['user_picture']);//starting picture uploader..$id = mysql_insert_id();//id just given in the database...$handle->file_new_name_body = $id;//avatar with changed name...if ($handle->uploaded){ $handle->image_resize = true; $handle->image_ratio = false; //$handle->image_convert = gif;//a different pic format... $handle->image_x = 100; //Width in Pixels... $handle->image_y = 100; //Height in Pixels... $handle->Process('user_pics/'); $image = $handle->file_dst_name;//avatar with uploaded file name... //mysql_query("INSERT INTO users (user_avatar) VALUES ('$image')"); mysql_query("UPDATE users SET user_avatar = '$image' WHERE u_id = '$id'");}}//end empty statement...
  6. hello all. sorry for late reply, i have finded the solution.a pretty simple one also actually... but im in schools right now, so will post it here once i am home. in case someone in here wonna have the solution till later on with their own projects ...
  7. hmm... sorry, Download Link: http://www.mediafire.com/?ccec1ik5eiusqxw but you should know, its a file on 5000 lines...so open on your own risk, hehe ...
  8. ahh.. thanks alot!, might just work. one more question...if i would like JUST to have the id as the name, would that be possible?.. AND with the actual image format?... right now this is how its inserting into the DB: id=14... but i need it to be like this: id=14.jpg... and same thing would be needed on the image name..so if i wrote something like: $image = $handle->$id;//avatar with changed name... you think it would be working?... cos i still need the pic format into the DB itself, and the id number of the current user...wich so far has been a succes... just without the format...
  9. hello again, since im not sure this is php coding related, ill just go ahead and type in here.correct me if im wrong.. well, im using latest version of verot.net.its a script created for resize pictures and stuff like that, i have used it ALOT in the past.so i was thinking of using it for a project. and everything works just fine as i can see for now.all but the picture names. when i am uploading a picture, i would like to change the name to the user_id given in the database. i DO had succes with this also on the upload, but the trouble is with the picture.i just CANT in anyway and anyhow i try to change the freaking name once its moving to my server. its keeping the same name, and its pretty annoying -.-'... any ideas?...code below: if(!empty($_FILES['user_picture']))//allways form name...{$handle = new Upload($_FILES['user_picture']);//starting picture uploader..if ($handle->uploaded){ $handle->image_resize = true; $handle->image_ratio = false; //$handle->image_convert = gif;//a different pic format... $handle->image_x = 100; //Width in Pixels... $handle->image_y = 100; //Height in Pixels... $handle->Process('user_pics/'); $id = mysql_insert_id();//id just given in the database... //$image = $handle->file_dst_name;//avatar with real name... $image = $handle->file_new_name_body = $id;//avatar with changed name... (DOSENT WORK...) //mysql_query("INSERT INTO users (user_avatar) VALUES ('$image')"); mysql_query("UPDATE users SET user_avatar = '$image' WHERE u_id = '$id'");}}//end empty statement... thanks ALOT in advance!...
  10. ok...but localhost = website name... but IF i needed to use a different port, would it be the way i typed before?...
  11. ok, thanks...the MySql part with remote connection i allready knew, but what about port?...is that also in localhost?, like so: www.speed.scene.com:8080 (if port 8080)...?
  12. i liiiiiiiike cake, and i like funny sticky movies on youtube X)...

  13. hello again, since most of my websites are made in PHP.i would like to ask a maybe little kind of rookie question, if i have 2 servers, and wonna have the Database on the other, and the website on the other.what to do?... i know its possible... just, how?... do i replace the localhost with (examble) speed-scene.com?... (one of my websites)... or do i get it wrong again?... -thanks as usually.
  14. hmm... not sure if there is any trouble, but when i am creating passes with users and such, i useally run MD5 protection over the pass as a start, and after that, a SHA1 over it, just to make sure the security is fine before sending it into the user database. but as far as i can read (not the biggest PHP understander yet, so if anyone see me i got it wrong, please correct), then it seems fine to me...
  15. hmm.. not sure this one is gonna work: SELECT FROM 'table', $UserId you are proberly going to get an error i think...
  16. rootKID

    Loop problem

    hmm... im not quite into this, but tell me if im wrong, should the IMG echo not be (outside) the for if/else statement?...unless its the plan... but not sure, still having trouble understanding that kind of stuff when its coming to the part of loops and if/else statements......
  17. Yo W3S again... i have this little project of my own.its a little hard to explain, but also only a theory, so feel free to ask in to it... i have been watching a project called TBdev (its a torrent project, yes, but hear me out first...). i have been trying to see how they have builded up their login system with cookies. and to be more specific, their functions inside the main-file called bittorrent.php. anyways, i am kinda building my own functions for this to work, but im trying to build in a little different way then them... i think... here is my functions: function login_session($db_output, $update_user_db = 0){set_my_session( "uid" );//name the sessionset_my_session( "pass" );//name the sessionset_my_session( "stylesheet" );//name the sessionif ($update_user_db == '1'){ @mysql_query("UPDATE users SET last_login = ".TIME_NOW." WHERE id = $id");}}function set_my_session( $name ){CODE HERE...}function unset_my_session( $session_name ){unset($_SESSION['{$session_name}']);}function logout_session() {unset_my_session('uid');unset_my_session('pass');} now, as you see. then the login_session is the main function here to login with..now, this is my login file: $res = mysql_query("SELECT id, passhash, username, secret FROM users WHERE username = " . sqlesc($username) . " AND status = 'confirmed'");$row = mysql_fetch_assoc($res);login_session($row); now, as you see. im taking ALL my DB info out into the function. now here comes the part from where im a little lost, because now i need to build up the function that builds it.that would be the (set_my_session)... my point is to take ALL rows/data out FROM where the username are...so i can see WHAT the kind of data the user has.... BUT. as you see on the login_session, im trying to give them different names for Each and one, so i can see the difference on them...that is the way the TBdev project did it, and that was the thing that was giving into me mostly... so here comes the question...if i am going to take ALL the data out from DB, and i need to know the different name on each and one.is it possible to take the row/col name... like if one of the rows were named 'user_id', is it possible to use THAT name to the session?, and as you can see here at my project right now, do you think i can get it to work?... -thanks for advice if possible!... EDIT: and ohh, as you see... im also needing to UNSET the sessions again, that is where the names for the different sessions come into the picture, but give me some advice, because im pretty surtent that this one will work, just needing a little advice to go on with... -thanks!...
  18. ok.. will look into it, thanks ...
  19. first off, i know PHP...im educated in it... i also have wrote login systems before.. but the thing with the showing people who is logged in is a little new to me...and yes, i understand that many people will get pissed if i mess it up hehe ... but fact to point, thanks.. will test the table idea later, i allready had it in my mind... just needed to think on how to proceed with it...but thanks anyways ...
  20. hello w3schools once again.. was thinking..im building this new website with user-login's to the website.. is it possible to make a box that will show ALL logged in users within like 10 min or so?.. was just thinking about it...if yes, wonna give a clue about it?.. -thanks alot! ...
  21. rootKID

    now im pissed...

    Grrrrrr..... i really hate my own eyes for the time being... the mistake was the freaking content inside the css...i had a height on 100px instead of auto ...
  22. rootKID

    now im pissed...

    ok... i have been working on this thing for a month or so now..im really pissed and need some verification... the last post i posted what actually ALMOST fine.. the only trouble was my explore i suppose.. anyways.. now my explore is NOT my problem any longer.. but google chrome is at this point at an another project.. (pictures added..) i mean.. what?... this is my php file: function stdhead($sitename = '',$css_style = ''){$HTMLOUT = "";//Starting Variable...$HTMLOUT .= "<!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><meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1' /><link rel='shortcut icon' href='favicon.ico' /><title>$sitename</title><link rel='stylesheet' type='text/css' href='themes/1/$css_style.css'></head><body><a name='top'>";$HTMLOUT .= "<div id='header'>";$HTMLOUT .= "Header/Banner/Logo...";$HTMLOUT .= "</div>";//Ending Header...$HTMLOUT .= "<div id='statusbar'>";$HTMLOUT .= "StatusBar";$HTMLOUT .= "</div>";//Ending StatusBar...$HTMLOUT .= "<div id='menu'>";$HTMLOUT .= "<a href='index.php'>Index</a>";$HTMLOUT .= "<a href='#'>Index</a>";$HTMLOUT .= "<a href='#'>Index</a>";$HTMLOUT .= "<a href='#'>Index</a>";$HTMLOUT .= "<a href='#'>Index</a>";$HTMLOUT .= "</div>";//Ending Menu...$HTMLOUT .= "<div id='content'>";$HTMLOUT .= "Content";return $HTMLOUT;}//STDHEAD FUNCTION ENDS...function stdfoot(){$stdfoot = "";//Starting Variable...$stdfoot .= "</div>";//Ending Content...$stdfoot .= "<div id='footer'>";$stdfoot .= "Footer";$stdfoot .= "</div>";//Ending Footer...$stdfoot .= "</body></html>";return $stdfoot;}//STDFOOTER FUNCTION ENDS... and this is my CSS file: /* CSS Document */* {padding: 0em;margin: 0em;}html {width: 100%;}body {background-color:#2f2f2f; /*Original: 464646*/}#header {/*background: url('pics/head.jpg') top center no-repeat;*/height:100px;width:100%;background-color:#111111;color:#999;}#statusbar {/*background: url('pics/head.jpg') top center no-repeat;*/height:30px;width:100%;background-color:#222222;color:#999;}#menu {/*background: url('pics/head.jpg') top center no-repeat;*/height:30px;width:100%;background-color:#222222;color:#999;}#content {height:100px;width:100%;background-color:#333333;color: #ffffff;}#footer {height:auto;width:100%;background-color:#444444;color: #ffffff;} ideas?...
  23. hmm... weird... will try the margin/padding tomorrow, and see if its making any diffrence... and by the way... how would you get the boxes centered anyway if you did not use maring and padding?... just asking.. ..
  24. i added these 2 lines: <!DOCTYPE html><html xmlns='http://www.w3.org/1999/xhtml'> still dosent work's...and about the css... how would you else get them to the middle?... ive allways got told that to get a Divbox to the middle itself, then the star rule would be a margin/padding with both as auto... is that wrong maybe?...
  25. yoyo w3...ive been starting up on a project... but now the design is crap inside explore, and just finded out... this is how it SHOULD look like (notice the boxes are in the middle...): and this is how it IS looking right now.. : and that is the WRONG design.. i need the boxes to center in the middle...this is my setup skin: function stdhead($title = ""){global $MT;/*Stylesheet Mod...*/if($CURUSER){ $HWT['stylesheet'] = isset($CURUSER['stylesheet']) ? "{$CURUSER['stylesheet']}.css" : $MT['stylesheet'];}/*Stylesheet Mod...*/$HTMLOUT = "";/*Starting the variable...*/$HTMLOUT .= "<head><meta http-equiv='Content-Type' content='text/html'; charset='iso-8859-2' /><title>{$title}</title><link rel='shortcut icon' href='favicon.ico' /><link rel='stylesheet' href='styles/{$MT['stylesheet']}.css' type='text/css' /></head><body>";$HTMLOUT .= "<div id='header'>";$HTMLOUT .= "Header/Banner...";$HTMLOUT .= "</div>";$HTMLOUT .= "<div id='status_bar'>";$HTMLOUT .= "Stats...";$HTMLOUT .= "</div>";$HTMLOUT .= "<div id='menu'>";$HTMLOUT .= "Menu/Links...";$HTMLOUT .= "</div>";$HTMLOUT .= "<div id='main_content'>";$HTMLOUT .= "Content Place...";return $HTMLOUT;}function stdfoot(){$HTMLOUT = "";/*Starting the variable...*/$HTMLOUT .= "</div>";//Ending main_content...$HTMLOUT .= "<div id='footer_bar'>";$HTMLOUT .= "MightyTracker © 2013-2014";$HTMLOUT .= "</div>";//Ending Footer...$HTMLOUT .= "</body></html>";/*Local HTML Ending...*/return $HTMLOUT;} and this is my CSS: @charset "iso-8859-2";/* CSS Document */* {margin:auto;padding:auto;font-size:8pt;}body {background-color:#151515;color:#FFF;}#header { background-color:#111111; color:#FFF; width:1000px; height:100px;/*Configure for banner place...*/ position:relative; margin:auto; padding:auto;}#status_bar { background-color:#222222; color:#CCC; width:1000px; height:auto; margin:auto; padding:auto;}#menu { background-color:#333333; color:#FFF; width:99%; margin:auto; padding:auto; height:auto;}#main_content { background-color:#444444; color:#FFF; width:99%; height:auto; margin:auto; padding:auto;}#footer_bar { background-color:#333333; color:#FFF; width:99%; height:auto; margin:auto; padding:auto;} and im not sure what i have done wrong... but i have tried almost everything i think i could come up with... so asking here now...note that i also have tried position:relative... nofthing... its like its just ignoring the damn css in the explore... ideas?...
×
×
  • Create New...