Jump to content

freebsdntu

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Everything posted by freebsdntu

  1. thank you for your help,northern rock. I know how to do the database stuff,for your code,when you echo the data from mysql,where would it go?I guess it would go to the addmessage.php,right?What I would like to achieve is to echo the data to message.php,the page where the add message form is in. Anyway,I would try it and see.
  2. Any hints? I am stuck at this problem
  3. thank you for your kind reply,but after fetching it, how do I display it? Ok, there is a document called comments.php, in which the form is included, there is also a document called addmessage.php, which does the logic, what I am thinking of is there is a header("Location:comments.php") statement at the end of addmessage.php, which means that user will be redirected back to the addmessage.php page, and the comment he has just posted would appear in the addmessage.php, very much like the behavior of my space add comment functionality, right? So my problem is how do I insert the message posted to addmessage.php document.
  4. Hi, I am quite a newbie in php, I am trying to write a comments system in php, you know, like the add comment functionality in msn space. I have done with the forms, quite simple form with just nickname and comment, and I know how to get the form input from user in php. Now the problem is how do I display the newly posted message? Like the one in msn space? I guess to achieve that, I have to modify the page, I have thought of using dom approach, but what if the form page is a php page, not html page? Ad there is no dom -> loadPHPFile() function. I wish you guys can figure out what i am trying to explaining. All hints are greatly appreciated! Thank you very much!
  5. thank you for your kind reply,phpQuestioner. Actually I have read that tutorial, my concern is still on what went wrong in my codes. Hope you guys can give me some hints.
  6. Hello, everybody, I am a newbie here, a newbie to javascript as well. I would like to write a small clock that counts and displays like this:hour:minute:second. I got the display, yet the problem is that the clock does not count, I used the setTimeout method, I have no idea what went wrong, hope you guys can give me some hints. Thank you! Here are the codes clock.html <html> <head> <title> Javascript Clock </title> <script type = "text/javascript" src = "clock.js"> </script> </head> <body onload = 'setTimeout("clock()",1000)'> <div id = "time"> </div> </body> </html> clock.js var now = new Date(); var hour; var minute; var second; function clock() { hour = now.getHours(); minute = now.getMinutes(); second = now.getSeconds(); display_time(hour,minute,second); } function display_time(h,m,s) { var time = ""; if (h < 10) time += "0"; time += h; time += ":"; if (m < 10) time += "0"; time += m; time += ":"; if (s < 10) time += "0"; time += s; document.getElementById("time").innerHTML = time; }
×
×
  • 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.