Jump to content

will71110

Members
  • Posts

    15
  • Joined

  • Last visited

Previous Fields

  • Languages
    Java, JavaScript, Python, SQL, XHTML, HTML5, LSL

Profile Information

  • Location
    Sumter, SC USA

will71110's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Got it...I needed this.value...no form needed
  2. Quick Question....How do I get the value of my text in the text box as I am typing it in??? This doesn't seem to work. I keep getting undefined as the value for this.form.value <input type="text" name="in" value="Name" onkeyup="q('sc/liveurl.php', 'changeme', this.form.value)">
  3. Get rid of the quotes => mysql_connect($host, $username, $password) or die("cannot connect");
  4. WOW.... OK, figured it out. My problem was that I wasn't pulling the config file from the parent folder. I needed to do ../includes/config.inc. I was missing the ../ . Good to go now
  5. Thank you for your replies. There are dummy inputs. I get the statement "Nothing found" returned from the users.php page through the AJAX because of the echo "Nothing Found: ". mysql_error();. For some reason $results isn't getting the SQL query. I'm also suppose to see the what the SQL error, but that doesn't seem to output anything. It seems like mysql functions aren't doing what they are suppose to.
  6. Hello. I am experimenting with PHP and MYSQL because I am new at it. I am trying to use AJAX to create a query into a database that I have. It isn't working. I'm sure I've made a mistake but I cant seem to find it. Someone please look over my code and see if there is something I am missing. I know my database is working because I use it to log in. It has to be in my code. The results I get from this is blank. The AJAX does call on the PHP correctly because I do get an echo back, but only because the $results isn't working. query/users.php <?phpinclude('includes/config.inc');$sql = "SELECT * FROM user";$result = mysql_query($sql,$con);if($result){echo "Username <br>";}else{echo "Nothing Found: ". mysql_error();}while($row = mysql_fetch_array($result)){echo $row['username'];echo "<br>";}mysql_close($con);?> /includes/config.ini //Real info has been removed for security <?php$hostname = 'hostname';$dbname = 'databank';$username = 'username';$password = 'password';$con = mysql_connect($hostname, $username, $password) or DIE('Connection failed');mysql_select_db($dbname, $con) or DIE("Database isnt available");?> admin.php <?phpsession_start();include('includes/config.inc');if (!isset($_SESSION['username'])) {header('Location: index.php');}?><script type="text/javascript">function q(url){if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("q").innerHTML=xmlhttp.responseText; } }xmlhttp.open("GET",url,true);xmlhttp.send();}</script><HTML><head><link rel="stylesheet" type="text/css" href="../css/secure.css"><title>Admin Page</title></head><body><table> <tr> <td class='seven'></td> <td class='fi'>Welcome: <?php echo $_SESSION['username']?> </td> <td class='fi'><a href="logout.php">Logout</a></td> </tr></table>This is the ADMIN page<br><input value="Get Users" type="submit" onclick="q('query/users.php')"><div id="q"></div></body></HTML>
  7. Spoke to soon.. I figured it out.. I used: <SOURCE>llSay(&amp;quot;hello world&amp;quot;,0)</SOURCE> Works like a champ
  8. Ok, I have an interesting problem. I'm using AJAX to pull information from in an XML file. Every thing works, however, quotes are giving me issues. I have the: <SOURCE>llSay("hello world",0)</SOURCE> as one of my elements in the XML. When I pass this in my javascript to the HTML, the source ends up looking like this: <input value="x" onchange="checkState('d4', this, 'llSay(" hello world",0)' ,'its triggered by the state')"> and I need it to look like this: <input value="x" onchange="checkState('d4', this, 'llSay("hello world&quot,0)' ,'its triggered by the state')> so I tried this: <SOURCE>llSay("hello world",0)</SOURCE> and I end up with: <input value="x" onchange="checkState('d4', this, 'llSay("hello world",0)' ,'its triggered by the state')"> What can I do to the XML file to make it pass " as it. I tried \" but I end up with \" as the results.
  9. will71110

    AJAX

    Well I figured out that Chrome caches content for around 20 mins. After the 20 mins, my content will update. I'm still new at this so make a link that is time stamped is beyond me currently. Hopefully soon I'll get a better understanding of this and can do like you said justsomeguy.
  10. will71110

    AJAX

    So I have this project I'm suppose to be doing. It's to make a web page using AJAX to update a page every 5 seconds, stop/start when a button is pushed, and dynamically update when the back end XML is updated. The problem I have is that it isn't updating (FTP) right after I change the XML. It takes like 5 to 10 mins for it to actually update. here is the code: <script type="text/javascript">var z = 0;var repeatIDfunction halter(url){ if (repeatID){ clearInterval(repeatID) repeatID = null document.getElementById('ChangeMe').innerHTML = "Message paused"; } else{ loadXMLdoc(url) }}function loadXMLdoc(url) { var xmlhttp var txt if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("microsoft.XMLHTTP"); } repeatID = window.setInterval(function() { xmlhttp.open("GET", url, true); xmlhttp.send(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { x = xmlhttp.responseXML.documentElement .getElementsByTagName('message'); if (z < x.length) { xx = x[z].getElementsByTagName("content") txt = xx[0].firstChild.nodeValue z += 1 if (z == x.length){ z = 0 } } } document.getElementById('ChangeMe').innerHTML = txt; } }, 1000);}</script> Is it in my script or is my browser doing something it's not suppose to??
  11. I was trying to see what the variable repeatID would be after it was ran through the clearinterval(). When I do clearinterval(repeatID), what does repeatID equal now so I can use it to test with a If Statement. Forcing it to be null works but I like to keep my scripts as small as possible. Actually after looking over my code again, repeadID is not an standard variable, isn't it? I guess the way I made this is the best way to accomplish the script.
  12. Ok I may have figured this out, but is this the best way to do this? I know repeatID has to contain something after the clearInterval, but I cant seem to figure out what. if (repeatID){clearInterval(repeatID)repeatID = null}else{sample()}}function sample(){repeatID = setInterval(function() {...}, 5000);}
  13. Quick question about the clearInterval() function. How can I detect by variable that the function has stopped and cleared? In my examples, how can I use var repeatID to detect this outcome? The first part works when it's running, but I cant get this to start the function back up again. function example{if (repeatID){clearInterval(repeatID)}else{sample()}}function sample(){repeatID = setInterval(function() {...}, 5000);}
  14. Is there away to do this automatically when a new month begins? I was told a trigger could do it, but this trigger would run every time there is an update to the cell. I don't think that is a very good way to accomplish this as it could cause a lot of overhead.
  15. Hello all, This is my first posting on the forums. Here is my question: I want to reset an entire column to zero monthly. Is the possible using Oracle SQL Express 11g? I looked for a way to do it in the Oracle SQL Developer, but I didn't find away to easily do it there. This is for a school project. One of the columns in the table is called monthly sales. That is the column that I want to reset to zero on the 1st of the month. Thanks in advance if anyone can answer this for me.
×
×
  • Create New...