Jump to content

BkJim

Members
  • Posts

    16
  • Joined

  • Last visited

BkJim's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thank's DaveJ. That's what I was looking for. Thank's again.
  2. Hi every one,I am using textarea to insert data, but every time I press <ENTER> key, I get n on display and line doesn't change.Exp : Today. <ENTER> tomorrow.On display : Today.ntomorrow.I also try nl2br($_POST['article']) on PHP file and I get same result.How can I solve this ?Thank's in advance. index.htm article.js article.php
  3. Hi i have the same kind of requirement. I am not able to understand clearly what you are saying. up to adding an hidden iframe is ok. what do u meant by "submit the form normally to that iframe" ? do you mean to say submit the form through the iframe or something else. how can we submit the request to the iframe which is on the same page. can u provide some more explanation. if possible some sample code. It will be so much help full to me. Thanking you so much. Hi, I am looking for same explanation. Thank you so much.
  4. Hi every one,I am trying to upload text and image using getXMLHttpRequest, but I have no idea ofthe best way to process. Some help would be apreciated.Thank's. Html file JavaScript file PHP file
  5. I was trying this var message = "";xhr.send("id="+id+"&message="+message); And it worked. But your way is logical and BEST. I think everything is on control. Thank you so much JustSomeGuy for your time and patient.
  6. I know de point of this forum man and you probably right about GET but why it did work with no changing id ? Now, what about message on the next line. xhr.send("id="+id+"&message="+message); I guess it need some thing empty like this var message = ""; Ok I will let you know soon. Thanks.
  7. Ok, you right. But don't forget minichat.php is displaying on index.php so this is the line with error in minichat.php $response = mysql_query("SELECT * FROM message WHERE (user_id = '".$_POST['id']."')"); And error message ( ! ) Notice: Undefined index: id in C:wampwwwminichatminichat.php on line 14 Look, you have tables and all pages. Why don't you try to see what is going on ? That is all I have.
  8. Around line 14. Of course I am calling with user_id in WHILE loop.
  9. In index.php <?phpwhile ($data = mysql_fetch_array($req_mem)) { echo '<div id="refdiv'.$data['user_id'].'" style="height: 100px; width: 200px; overflow: auto; background-color: #CCCCCC; border: 1px solid #555555;"></div> <input type="text" id="message'.$data['user_id'].'" style="width: 200px;" /> <input type="button" value="Envoyer" onclick="submitChat('.$data['user_id'].');" /><script type="text/javascript">setInterval("refreshChat('' . $data['user_id'] . '')", 2000);</script>';}?> And error message ( ! ) Notice: Undefined index: id in C:wampwwwminichatindex.php on line 14
  10. That is what I did. Inside the WHILE.
  11. Error message. Notice : Undefined index. It doesn't walk.
  12. Yes I know but every thing is Ok when div ID is not variable. When div ID is variable, nothing walks any more.
  13. Ok I am trying this function refreshChat(id){ var xhr = getXMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) { document.getElementById('rafdiv'+id).innerHTML = xhr.responseText; // Données textuelles récupérées } }; xhr.open("GET", "minichat.php", true); xhr.send(null);}var mytimer = setInterval(function() {refreshChat(id)}, 2000); But it doesn't walk at all.
  14. Thanks, But the problem is that Ajax doesn't understand English that way. I try setInterval but it doesn't walk with changing ID. I would appreciate if some one else can help.
  15. I am printing the hole page of minichat.php on index.php with div. <div id="refdiv'.$data['user_id'].'" style="height: 100px; width: 200px; overflow: auto; background-color: #CCCCCC; border: 1px solid #555555;"></div> inside WHILE. That is the raison why I am asking for refresh. How to do that, you have my code.
×
×
  • Create New...