Jump to content

Q695

Members
  • Posts

    783
  • Joined

  • Last visited

Everything posted by Q695

  1. Is there a way to run a check on the server to see how long it takes for the page to get built, then print it to the screen? I tried searching for it online for a few minutes, but it wasn't able to be found. All I'm finding on there is how to optimize the pages, but I want a simple time check performed on the page loading
  2. You tell me what I'm going to use, because there's no good tutorial out there that I can find for some reason.
  3. Aww, long polling to use it as a listener, unless they just join the chat Is there a way to do long polling within jquery technology working with the data possibly changing every time? What would I post for the server side JavaScript, and client side JavaScript?
  4. I'm confused how to get the chat object to work with the pushes/pulls, and don't know where I'm going wrong. Here's the basics of what I need to know without reloading the page: how do I push new data to the server how do I push new data to the client how do I not rebuild the data client has every time I may need to know more, but that's what I know I need to be able to do so far.
  5. Jquery Ajax? is there a good online tutorial?
  6. I've been trying to figure out how chat apps work all afternoon to do dynamic data in HTML loading. Can someone please tell me where I'm going wrong for the code flow in this script: <script> function submitchat{ if (form1.uname.value=='' || form1.msg.value==''){ alert("fill out whole form"); return; } var uname=form1.uname.value; var msg=form1.msg.value; var xmlhttp= new XMLHttpRequest(); xmlhttp.onreadystatechange = function(){ if (xmlhttp.readyState==4 && xmlhttp.status=200){ document.getElementById('chatlogs').innerHTML=xmlhttp.responseText; alert("message sent"); } xmlhttp.open('GET', '?page=3.2&uname='+uname+'&msg='+msg, true); xmlhttp.send(); } </script> <form name="form1"> enter your chat name<input type="text" name="uname"> message: <textarea name="msg"></textarea> <br> <div id="chatlogs">Loading Chat Logs...</div> <a href="#" onclick="">send</a> </form> <?php $uname = $_REQUEST['uname']; $msg = $_REQUEST['msg']; if ($msg!='' && $uname!=''){ $chat=" INSERT INTO chat ( `uname` , `msg` ) VALUES ( '$uname', '$msg' )"; $result = mysql_query($chat, $con) or die (sql_death($chat)); }
  7. Someone points their form without data required for the PDO to the page the form is on. When it's not set, it automatically sets the value to null. Sorry about the redundant posting, it was a slow server that I'll blame ;)
  8. Someone showed me a while ago this trick for loading variables, but it creates an error when you go to the page initially: $fname = $_POST['fname'] ? $_POST['fname'] : null; How do I write the short hand to run correctly?
  9. it doesn't explain the different symbols on a cheat sheet.
  10. lol had a pdo quoting error. What does :variable name mean, compared to $variable mean in this pdo tutorial: http://www.phpeveryday.com/articles/PDO-Insert-and-Update-Statement-Use-Prepared-Statement-P552.html
  11. What's wrong with the query, I'm not getting errors outputted: // configuration $dbtype = "MySQL"; $dbhost = "localhost"; $dbname = "eagle"; $dbuser = "root"; $dbpass = ""; // database connection $conn = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass); // query $sql = "INSERT INTO member_data (fname, mname, lname, street, apt, city, state, zip, email, number, job, awarded) VALUES (:fname, :mname, :lname, :street, :apt, :city, :state, :zip, :email, :number, :job, :awarded) "; echo $sql; $q = $conn->prepare($sql); $q->execute(array(':fname'=>$fname, ':mname'=>$mname, ':lname'=>$lname, ':street'=>$street, ':apt'=>$apt, ':city'=>$city, ':state'=>$state, ':zip'=>$zip, ':email'=>$email, ':number'=>$number, ':job'=>$job, ':awarded'=>$awarded )); How do I run an or die to output the error?
  12. lol, running a while on an insert
  13. Working from this tutorial with PDO: http://www.phpeveryday.com/articles/PDO-Insert-and-Update-Statement-Use-Prepared-Statement-P552.html Since you said to PDO it, what am I doing wrong: // configuration $dbtype = "MySQL"; $dbhost = "localhost"; $dbname = "eagle"; $dbuser = "root"; $dbpass = ""; // database connection $conn = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass); $title = 'PHP AJAX'; // query $sql = "INSERT INTO member_data WHERE fname = ?, mname = ?, lname = ?, street = ?, apt = ?, city = ?, state = ?, zip = ?, email = ?, number = ?, job = ?, awarded = ?"; $q = $conn->prepare($sql); $q->execute(array($title)); I created the database from the variable names.
  14. What is wrong with the injection preventer (array function) seen below: //injection prevention if (isset($_GET)){ if (!is_array($_POST)){ foreach( $_POST as $key => $value){ $_POST["$key"]=mysql_real_escape_string($value) ; } } else {//here while (is_array($key)){ foreach( $_POST as $key => $value){ $_POST["$key"]=mysql_real_escape_string($value) ; echo $key; } } }
  15. example: you have a file cabinet, then you reach for a folder pull the folder half way out, and see only half the folder pull the folder the rest of the way out, you can see the whole folder problem: How do I make the div visible only up to the point it's pulled out? What I have: style="width:100%; height:100%; overflow:hidden;"
  16. I have a nested div within another div, and it bubbles from the first div tag to the 2nd div tag for some reason.
  17. In JavaScript I'm trying to: take a tone generated by a tone generator manipulate the tone (the only thing that will be on the whole page for sound) in several ways at the same time produce the tone in its manipulated form What I understand: the tone is generated by startTone( tone ) computer speaker manipulation What I need to do: make the product of startTone() manipulatable
  18. This is the tone generator script from that page, and I want to load it into a page variable: http://jsfiddle.net/WH7Kf/61/ Would it be easier to grab the sounds from the whole page to manipulate them as I want to?
  19. I'm a beginner for JavaScript, and intermediate for PHP
  20. I'm looking to load startTone( frequency ) into a variable so that I can manipulate the volume level of it instead of the generic 100%.
  21. That doesn't work, so how do I target the volume of everything on the page? Think how windows can target everything on your computer.
  22. Now that I have a sliding div function working, how do I turn off a function call when working within the inner div tag?
  23. Got it: use function A to call function B use function B to call function A
×
×
  • 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.