Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Posts posted by RussellReal

  1. if its at the very top just set your logged in value to true..  I don't see the problem.. and ANYWAY you shouldn't leave your user on the same page as you posted to.. header("Location: whatever...");.. move them, back to the same page.. for all that matters.. aslong as if they press refresh they don't resend all the post information..

     

    AND you should never set a cookie with your user's password in it..

     

    also look into sessions, they're better for this :) cookies should be used for like.. nothing lolz. realistically though cookies really have no use whatsoever except maybe for php to asp communications or something.. but I still see no purpose.

     

    ^^ take that back actually.. I use a cookie to dynamically store user prefered titles for my users for my site.. but still that could be done with a session :)

  2. every 45 seconds through a command line would be no problem..you just use sleep or maybe even SSH you could do it.. but through an HTTP Request, its impossible without cron.. well not IMPOSSIBLE.. but its impossible to have it run exactly every 45 seconds..unless you have a page view at exact intervals 45 seconds apart..

  3. hello there :) I'm a runescaper.. or retired anyway, but I play time to time, RussellReal add me if you're interested :)

     

    SIDE NOTE!

     

    live search is usually every key or every other key or retriggered after a certain number of milliseconds..

     

    like.. 250 milisecond wait.. even if the guy types like 5000 characters per second.. hes only going to get 4 or so requests in that second.. you gotta figure if someone is typing that fast they know what they want already..

     

    and 4 queries per second if its ajax and returning something light like 40 bytes of data.. and all thats happening is 1 query.. I'm pretty sure you'll be alright :)

  4. @Ayon you missing the onreadystatchange code along with the readystate/status code which lets you know when you request is a) complete b) successful.

     

     

    function rate(type){

    if (window.XMLHttpRequest){mlhttp=new XMLHttpRequest();}

    else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}

    xmlhttp.onreadystatechange=function(){

        if (xmlhttp.readyState==4){

        if (xmlhttp.status==200){

    document.getElementById('rategood').innerHTML=xmlhttp.responseText;}

    else{alert('Request Complete - Status Not Successful');}}

    url="rel_rating.php?type=" + type;

    xmlhttp.open("GET",url,false);

    xmlhttp.send(null);}

     

    @seventheyejosh if there weren't people who rather do things themselves and learn those things no one could of made ur life easier by giving you the short-cut jquery.

     

    his javascipt is not asynchronous  meaning it will hang until it gets a response or fails

  5. just use it.. in Javascript there are only 2 scopes.. function variables and global variables, anything specified outside of a function will be available inside of a function.. everything specified inside of a function will be destroyed after the function exits.

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