Jump to content
MakeWebGames

Fathom

Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by Fathom

  1. Try: curl -H "Accept: */*" kv.mydomain.com/cron_munite.php?code=mycode Technically that should solve the accept header assuming your webserver doesn't do any wierd behaviour. The suggested code means that cURL will accept any mime type in reply and then the server knows it can send "anything" back. The 406 error would occur, for example, if you sent Accept: text/* (accept text files only) and an image was to be returned which would have mime image/png (not a text file). However that seems unlikely, do you have any unusual server config or .htaccess files (if applicable) ? Maybe you could try setting a user-agent (I put my user agent in here). curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.127 Safari/533.4" kv.mydomain.com/cron_munite.php?code=mycode If that works you could try setting other user agents and maybe have a "secret" user agent as well as your "mycode" if you feeling security conscious. If you don't have any custom server config or php code that checks headers and could throw a 406 http error (on your cron_munite.php) you may want to move host. Edit: NB: I didnt test
  2. It is very likely that nothing is technically wrong. This is how sessions should work: they only work on the (sub)domain they are set in. This means that the browser/user does not have any session information when you go to domain.com (even if they logged in at http://www.domain.com/login because that session is set for the www subdomain). Hence the browser has two seperate sessions and you can login to two accounts using domain.com and http://www.domain.com Quick note, I don't use php so have to excuse any mistake I make. I would imagine that if you create the session from domain.com (i.e point login form to http://domain.com/login) it may solve your problems. Alternatively you can set the domain of the session to domain.com, there must be some way to do this in php... However this is not an ideal solution. In http(/the web) the pages http://www.domain.com/page and domain.com/page are considered to be different - even if they are infact identical. Therefore if people are using both www and the higher level domain.com they will cache two copies of each page/image. You will notice with most large websites that all requests to domain.com/page are forwarded (301) automatically to http://www.domain.com/page (even if it leads to a 404). This forwarding will usually only need to be done once for each user so is at little cost - and you make a saving if you enable caching/if modified. Of course if you have links on your site pointing to domain.com/page then forwarding willl occur frequently, which is unwanted. You will want to do this with your server not php, google will be your friend here. There are other benefits such as a gain for SEO (as you are removing duplicate content and all outside links will go (perhaps via a forward but search engines are smart) to one page). I can't comment on Dayo's suggestion as I don't know how it works in php but my solution could be carried out as well for reasons I explained. I'm not sure how a cookie would stop multiple accounts? A flash cookie maybe for detection. Also you can not fully trust the key/values stored in cookies, which might have implications given your code.
  3. Haunted Dawg, obviously you need to rename the functions and divs for both mine and Djkanna's to work on the same page correctly :).
  4. Using JQuery to query the server every second to get the time? Maybe it is short code but doesn't make it good/clever in any stretch of the imagination-do you get free bandwidth? Why make your server get hit like that? That is a real no imo. You can improve Djkanna's abit to let javascript do the logic (I assuming his works!) and keep time more accurately.   <span>This Server Time</span><p id="stime"></p> <script> var sdate = new Date('<?php echo date("F j, Y, g:i:s a"); ?>'); var diff = sdate.getTime() - new Date().getTime(); function serverTime() { sdate.setTime(new Date().getTime()+diff); if(sdate.getHours() >= 12) { var sabr = 'PM'; } else { var sabr = 'AM'; } document.getElementById('stime').innerHTML='Time: '+sdate.getHours()+'.'+sdate.getMinutes()+'.'+sdate.getSeconds()+sabr; setTimeout('serverTime()',1000); } serverTime(); </script>   Edit: (edit2: removed edit as it doesnt show 24hr)
×
×
  • Create New...