Jump to content

Beffic

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Beffic's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. setcookie('USER_ID',$Result2['ID'],time()+60*60*24);
  2. I only posted it here because the only place the cookies aren't being read from is when I have it in the java frame.
  3. Okay so I added a javascript function to make my like easier by opening a new window with the following code. <Script Language="JavaScript"> function SomeCommand() { var load = window.open('URL','','scrollbars=yes,menubar=no,height=400,width=300,resizable=yes,toolbar=no,location=no,status=no'); } </Script> <a href=javascript:SomeCommand()></a> Now the java code seems to work and all but when I open the file it doesn't seem to find the cookie in the window mode. But when I open the same file in the browser it finds the cookie and I can proceed. Without the cookie I cannot because it's a login cookie. So is there any idea why it wont read the cookie in window mode but it will in browser? Here is what the cookie is doing. Just in case you are curious. And I know sessions are better but that is not what I am asking for. Thanks. <?php if(!isset($_COOKIE['USER_ID'])) die('Not logged in, please <a href=index.php>go back</a>'); ?>
  4. Wow!!! Thanks!!!! I got it now and I understand ajax 50% more! Thanks again guys!
  5. Okay, so I think I understand a little better but would I have to change the ajax_read to a ajaxrequest.open since it's not reading a text file anymore but from a database?
  6. Yeah, I am completely new to ajax and it probably makes no sence but I learn more when I can take a code and edit it myself. But I need a place to start from... It's how I learned php.
  7. Well changing "intUpdate = setTimeout("ajax_read('chat.txt?x=" + ms + "')", waittime)" to "intUpdate = setTimeout("ajax_read(mysql_query("SELECT *FROM Chat"))", waittime)" doesn't seem to work.
  8. Okay, I'll try to be a little more clear. How can I change the request used in this frame from a txt request so that instead I can retrieve the chat information from a mysql database instead?
  9. How can I change the request in here from the chat.txt file to a mysql request? function ajax_read(url) { if(window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest(); if(xmlhttp.overrideMimeType){ xmlhttp.overrideMimeType('text/xml'); } } else if(window.ActiveXObject){ try{ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ } } } if(!xmlhttp) { alert('Giving up Cannot create an XMLHTTP instance'); return false; } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState==4) { document.getElementById("chatwindow").innerHTML = xmlhttp.responseText; zeit = new Date(); ms = (zeit.getHours() * 24 * 60 * 1000) + (zeit.getMinutes() * 60 * 1000) + (zeit.getSeconds() * 1000) + zeit.getMilliseconds(); intUpdate = setTimeout("ajax_read('chat.txt?x=" + ms + "')", waittime) } } xmlhttp.open('GET',url,true); xmlhttp.send(null); }
×
×
  • 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.