Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by MDobleZ

  1. Yeah, I knew that much. But I didn't know it was still the case after I'd sent the variables with the js function. I thought that if I either opened or refreshed the php after executing this function I would see the variables echoed. In any case, I'll try to do what I was originally trying to do and see if it works. For the time being, I appologize to everyone for having wasted your time and thank you very much for your help.     

  2. I'm beginning to think the mistake is even more stupid than I'd thought, but based on some phps I'd created before I expected to see the echoed string if I opened the php itself. I thought that was a good way of checking if it was working. Am I wrong (and stupid)?

  3. This is what is echoed:
    Notice: Undefined index: q in /home/vol1/getfreehosting.co.uk/getfh_6562567/htdocs/chat/li.php on line 3

    Notice: Undefined index: r in /home/vol1/getfreehosting.co.uk/getfh_6562567/htdocs/chat/li.php on line 4
    query string is SELECT pass FROM chat WHERE nick='' 
    db return is

  4. As an amateur (a flagrant one), I try to avoid using anything unless I find it absolutely necessary, and until now, I had never had problems with javascript. I guess it's time for a change, but I would still like to know what is going wrong with the original code; I'm certain it has to be something silly.   

  5. You're right shadowing, that's what I meant, but adding "/" did not do it. It actually gave me an error message in the developer / network tab mentioned by teynon. I've already done this in the past with an almost identical code, so it has to be a stupid mistake. 

  6. I'm trying to do something which I've done before but for some reason (which has to be a silly one) it doesn't work now. This is the js: 


    var userName;

    var password;


    function logIn(){





    xmlhttp2=new XMLHttpRequest();







    (I know the variables are working, because if I add alert I see them.) And this is the php: 







    $result=mysql_query("SELECT pass FROM chat WHERE nick='$q'");


    echo $row[0];




    I know the function is working because if a change $_POST["q"] by $_POST["any nick"], it echoes the pass.
  7. html tags appear when I retrieve info from a table. This is my .js:


    function receive()


    var xmlhttp=false;

    xmlhttp=new XMLHttpRequest();





    if (xmlhttp.readyState==4 && xmlhttp.status==200)











    And this is my .php:








    $result=mysql_query("SELECT message FROM chat WHERE Id=1");


    echo $row[0];






    What am I doing wrong?



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