Jump to content

Kristian_C

Members
  • Posts

    246
  • Joined

  • Last visited

Posts posted by Kristian_C

  1. Well, I'm not sure how to set up a custom error page with Apache, but I've done it with IIS. Someone else might know how to set up Apache, or you can ask your host to set it up for you.
    okay, ill ask :)->Kristian_C.
  2. The plan was to do like a msn thing, but in this case it seems to be harder since i really dont know so much about php yet as im still a neewbie, but maybe ill just do as you say and make it possible for every one to see who logs on. just have a little list over the 5last logins up in the corner of page or something like that.... if i then use your code, does it register the session it self? or must i do something? in case of that, what must i do?.And will it empty the session itself when a session is beeing emtpyed? in a easyer why, will it self delete from the db?..->Kristian_C.

  3. Server info : Operating system Linux Kernel version 2.6.9-42.0.3.ELsmp Machine Type i686 Apache version 1.3.36 (Unix) PERL version 5.8.7 PHP version 4.4.4 MySQL version 4.1.21-standard hope that helps.->Kristian_C.

  4. Hey guys/girls, have a problem that i cant figure out,<link rel="icon" href="frontstuff/favicon.ico" type="image/x-icon">tried that and it dident work also tried :<link rel="icon" href="frontstuff/favicon.ico" type="image/jpg">and i tried with the whole link on both, but nothing works?also had this one :<link rel="shortcut icon" href="frontstuff/favicon.ico" type="image/x-icon">but no, anyone knows what can be the problem?->Kristian_C

  5. Thanks, but how do i display etc an echo over at the other users screen if you understand what i meen?..The thing is how to display that a session starts, and i need to display at 1-20 users screen...Since the max limit of contacts are 20.if you can help me out with how to select from those sessions, then return it somehow with JS.Just need to understand how to return it actually, js i think i can sort out myself.in case you need some info to help :session name : brukernavn.contact table : kontakter.select from contacts will be :select * from kontakter where brukernavn=$brukernavn contacts = kontakt.....Hope you or someone else can help me figure this out :).->Kristian_C.

  6. Are you talking about creating a custom error page? Or displaying another version of the page if you get a 404 error?
    The main problem is just to add php to the error page. tried normal but seems like it dont work, so i dont think it is possible to use php.->Kristian_C
  7. Image maps just use html.etc :<img src="something" alt="" width="346" height="167" border="0" usemap="#test"><map name="test"> <area shape="circle" coords="87,86,43" href="#something" alt="Hey"> <area shape="circle" coords="240,129,23" href="#something" alt="Hey again"></map>->Kristian_C.

  8. Hey :)Is there a way to redirect, etc an include error? like :Warning: main(thatsite.php) [function.main]: failed to open stream: No such file or directory in ++++is there a way?->Kristian_C.

  9. I want my users to be able to see when their friends comes online. easy and simple... what i can do is to just have a system so the users can get a message when their friends logs on, but thats not something i want :) i want something more fanzy, and i know it is possible somehow..->Kristian_C.

  10. do you mean like, templated pages using includes?my way of doing it is to create a file called "templates.php" or something. have a few functions within it, mainly "writeHeader($title)" and "writeFooter()". The variable $title obviouslly to change the title of the page.then include templates.php, and run the functions where i want them.
    ERROR 404 and stuff like that, like if you open a link, and the site is down, you see : cant find server ++ those files are saved as .shtml .. i know it is possible to request IP/Browser/url +++ in those but then it must be like this :
    <!--#echo var="HTTP_REFERER" --><!--#echo var="REMOTE_ADDR" --><!--#echo var="REQUEST_URI" -->

    and i want to have like etc:

    <?$er=mysql_query("SELECT * FROM errors WHERE errortype='404'");$re=mysql_fetch_object($er);echo"$re->main";?><br><br><?echo"$re->errortext"?><br><br><br><br><br><br><?echo"$re->foot";?>

    Just dont know if im allowed to use regular php in there becouse i really dont know how .shtml operates..got any suggestions?.->Kristian_C.

  11. for the popup to contain the username etc. I imagine you'll either need to set it on page load, or use AJAX.the popup window would be fairly simple to create. There's an article on the javascript forum about centering a div; width and height. Then just use javascript timing to remove the popup after a number of seconds.
    Yeah, i can do the popup, and time it, was reading about it for a few days ago, but the problem is how to display the popup at the other users screen..like how to get the session thing, may just use sql/php tho, if it aint no other ways, but yeah.->Kristian_C.
  12. hehe, i dont want to see the user online, or i want but thats not a problem, i need popup window that closes after 3seconds or something when a user login to the site...I can use sql/php to do it but that whould take so long time with my skills :)...chould update a collum in the user table then make it go to another status after some seconds then show the popup while the time counts down... But i really dont have an idea of how to display the popup with the actual username ++ on the screen to the other guy..So thats the problem.. ->Kristian_C.

  13. Every thing depends on how long you are out of the site, if you login to a site then close the browser and open after 2minutes, then you should be able to use this code to get back in dont know if it is possible to have it longer, without useing cookies.well if you want to test :

    if(isset($_SESSION['username'])){header("Location: home.php");exit();}

    but if you want to have it last even longer i dont know...->Kristian_C.

  14. Yea, I have a register script (and a login script), but I them to be able to have a personal site, like you can at this forum. And I cannot do that with the one I have now...
    use :session_start();$username=$_SESSION['username'];on top of every page, then have a link to a php page like functions.php and have this code there :<?function erhanlogin(){if (empty($_SESSION['username'])){echo "<script LANGUAGE='JavaScript'>window.location='index.php';</script>";exit();}}erhanlogin();?>only include on the files where you need to be logged in tho.->Kristian_C.
  15. Not exactly what I was looking for Kristian.I meant to log in by typing in username and password, and the usernames and passwords should be in a database...
    Hmm, i just wrote the code you can use, i just hate writing html :) you will need to create a register script tho...but login script is there.->Kristian_C.
  16. Exactly. And limit the stuff only to what you know the application can handle. In other words: whitelist possibilities.
    so etc :
    if($_POST['login'] && $_POST['username'] && $_POST['password']){$username=$_POST['username'];$password=$_POST['password'];if(strlen($username =< 5) || strlen($username > 15)){echo"Invalid : Username";exit();}if(ereg('[^0-9^A-Za-z]', $username)){echo"Invalid : Username";exit();}$check=mysql_query("SELECT * FROM users WHERE username='$username'");$checkuser=mysql_num_rows($check);$checkpass=mysql_fetch_object($check);if($checkuser == 0){echo"No user with that name in the db";exit();}if($checkpass->password != $password){echo"Invalid : Password";exit();}if(ereg('[^0-9^A-Za-z]', $password)){echo"Invalid : Password";exit();}else{

    ------That whould then be safe? ->Kristian_C.

  17. Hey, im verry tired of getting so ugly shtml errors when etc page is offline ++and i wondered, is it possible to insert direct sql/php/html maybe js? is this possible or must it be runned another way then shtml files, if thats the case, how to do it?->Kristian_C.

×
×
  • Create New...