Jump to content

newrehmi

Members
  • Content Count

    35
  • Joined

  • Last visited

Community Reputation

2 Neutral

About newrehmi

  • Rank
    Newbie
  1. THanks alot!!!! that help me much!!
  2. hello there, I have some sort of problem with date in javascript... lemme just post my code here... var currDate = new Date();var currDateEnd = new Date(); currDateEnd = currDate;currDateEnd.setDate(currDate.getDate()+7); alert(currDate); //I tried alert currDate here, and looks like this object (currDate) value has been changed to the value of currDateEnd I know there's other way to surpass this problem, but I want to know first why this is happening... Thanks a lot, very much...
  3. newrehmi

    Basic Cms In Php

    true. sometime I paper-pencil it first, then draw it using CSS.
  4. okay guys, hello how are you: I want to simply try using ajax in my codeigniter system. This is what I am trying to do, I ll write the example first: function downloadText(url, callbackFunction){var XMLHttpRequestObject = false;if (window.XMLHttpRequest){XMLHttpRequestObject = new XMLHttpRequest();}else if (window.ActiveXObject){XMLHttpRequestObject = newActiveXObject("Microsoft.XMLHTTP");}if(XMLHttpRequestObject){XMLHttpRequestObject.open("GET", url);XMLHttpRequestObject.onreadystatechange = function(){if (XMLHttpRequestObject.readyState == 4 &&XMLHttpRequestObject.status == 200){c
  5. thanks btw guys =) just looking which practice is good as a php scripter, so that I didn't developed a bad habit which will troublesome me later on..
  6. sorry, i've corrected some part.. hope you can see it clearly. Obviously, the statement of the second case is outside of php script.
  7. hello there w3teachers and friends. I have some question. I believe that I actually have wrote like a several tens of thousand line of script. But, just a few weeks ago, I met some script that changed a bit of my belief. Well, simply let me make turn the question into some example: case 1: <?phpif($foo == "foo"){echo "<span>some statement is running</span>";}?> case 2:<?phpif($foo != "foo"){?><span>theres no running statement</span><?php}?> okay, the example script that has changed my belief is the second case. So, my question is:1. which example d
  8. urgh, guys, sorry for my mistake!. I mistakenly used the same variable with $comment. Duh... am so stupid... =_+ hahaI corrected the variable now. <?php$user = $_GET['user'];$content = $_GET['comment'];$date = $_GET['date'];$fopen = fopen('comment.xml','r+');while(!feof($fopen)) { $comment = $comment.fgets($fopen); } $thecomment = str_replace('</commentdata>','',$comment);$newcomment = $thecomment.'<comment><user>'.$user.'</user><content>'.$content.'</content><date>'.$date.'</date></comment></commentdata>';fwrite(fopen('comment.x
  9. thanks for the answer. yeah. i learned constructing DOM using javascript before (creating element, attribute, node and etc), but I wonder if there's a connection or relation with the tutorial you posted.edit:at the end of the tutorial, did this statement created a new .xml or just echo the xml structure, so i just use responseXML in ajax.echo $xmlDoc->saveXML(); Thanks.
  10. thanks for answering.below is what i meant by scattered, after I submit a new comment:Before submit: <?xml version="1.0" encoding="iso-8859-1"?><commentdata></commentdata> After submit: test<?xml version="1.0" encoding="iso-8859-1"?><commentdata><comment><user>test</user><content>test<?xml version="1.0" encoding="iso-8859-1"?><commentdata></commentdata></content><date>6/8/2011</date></comment></commentdata> it should be working like this (after indent): <?xml version="1.0" encoding="is
  11. hello there,I have a problem of assigning GET array into a variable, but, without an assignment and I use the array instead, it worked. Below is the example:The example i tried below is working: <?php$fopen = fopen('comment.xml','r+');while(!feof($fopen)) { $comment = $comment.fgets($fopen); }$thecomment = str_replace('</commentdata>','',$comment);$newcomment = $thecomment.'<comment><user>'.$_GET['user'].'</user><content>'.$_GET['comment'].'</content><date>'.$_GET['date'].'</date></comment></commentdata>';fwrite(fopen('comment.xml
  12. yes thanks. without your answer, i couldn't trigger my brain anything about it though, i don't know anything about cache.Thanks
  13. Thank you sooo much deirde's father. Now it relief me >,< for knowing what is the problem now.
  14. yeah that's my complete script, the function is called in this part (bold), please re-check: once I submitted a new value, it will call function get(). It worked all the times, but sometimes it fails. I wonder why.Thanks for your times
  15. hello,i've finally been able to make a change to some text using fwrite. But i detected some bug that i didn't understand. First before anything, this is my script: function send() { if (XMLHttpRequest) { var http = new XMLHttpRequest(); } else { var http = new ActiveXObject('Microsoft.XMLHTTP'); } var thetext = document.getElementById('ajax_texttoinsert').value; var date = new Date(); thetext += ', <i>written on '+date.getHours()+':'+date.getMinutes()+'</i>'; http.open('GET','ajax_server.php?thetext='+thetext,true); http.send(null); http.onreadystatechange = function() {
×
×
  • Create New...