Jump to content

Network_ninja

Members
  • Posts

    94
  • Joined

  • Last visited

    Never

Everything posted by Network_ninja

  1. change this line: $sql = mysql_query("UPDATE members SET name='{$_POST['name']}', age='{$_POST['age']}, mf='{$_POST['mf']}', loc='{$_POST['loc']}' WHERE usr='{$_SESSION['usr']}'"); TO: $sql = mysql_query("UPDATE members SET name='$_POST[name]', age='$_POST[age]', mf='$_POST[mf]', loc='$_POST[loc]' WHERE usr='$_SESSION[usr]' ");
  2. You maybe is looking for a rich text editor. try this: http://www.tinymce.com/
  3. remove the <style> and <body> tags: body { font-family: verdana; } .banner{font-size: 58px; color: #fff;} .top{font-size: 18px; color: red; } .body {font-size: 25px; color: green;}
  4. what wud be the best ideal time to check? i am thinking if it is a good idea to run a serverside scripts to every seconds to check if time already expire?
  5. ok. i understand ur advice. but how will i do it that there is a clock showing or a countdown timer and automatically locks the question sets after time expire?
  6. Can someone show me the way? I am creating a online examination with time pressured. For example Part I of examination is only good for 20 mins. now if 20 mins is over it will be lock or good as submit. How will I do that? tnx everyone.
  7. make sure also that you have put return upon calling the function: <input type='submit' name='submit' value='Submit' onclick='return jsfunction()' />
  8. add this code after your alert. return false;
  9. this is the one I use and it's working. tnx for the reply, I was thinking that there is something like this is jquery but haven't found one. if(document done executing the script) { display the result } else { show a preloader }
  10. Tnx for the reply. Il try to read and read that link until I get it. The sample is very minimal, it's not very helpful though
  11. Simple jquery get method: jQuery(function ($) { $('.add_cashier').click(function (e) { var id = $(this).attr("id"); $('#basic-modal-content').modal(); $.get("ajax/cashier_entry.php?id="+id, function(data) { $("#basic-modal-content").html(data); }); return false; }); }); Hi that is my simple code to get data from cashier_entry.php and loads it in a div. My question is if it is still not ready to be load I want some preloader to display. Not just a blank page and waiting for the result to come out... Tnx in advance.
  12. Is there a way in php to not execute the whole script if there is error on the script? For example: <?php execute script here; .......... ........... [b] error encounter here[/b]. -> error is not logical execute script ............. ............. ?> I don't want to execute the above script... tnx everyone.
  13. tnx for the code. il try it out later.
  14. Is anyone have a handy code that will format a number? both decimal and thousand separator? eg. value = 1000.2532 result -> 1,000.25 tnx in advance
  15. read about php error reporting
  16. it's a notice. and it only means that you are accessing an uninitialize variable. eg... $_POST['username']
  17. what the version of your IE? it works fine in my IE6
  18. Just a wild guess. Is it a registration form or adding contents? and you would like to give warning to the user that if he/she navigates away from page the data will not be save? then you can use what nogray provided. and for undesired result you could add checking if the content has a content and fire the javascript: I'm talking about like this: <html> <head> <title>Untitled Document</title> <script type="text/javascript"> window.onbeforeunload = function(){ var txt = document.getElementById("content").value; if(txt != '') { return 'are you sure you want to leave?'; } } </script> </head> <body> Type content here: <input type="text" name="content" id="content"> </body> </html> Just a suggestion and wild guess. cheers!
  19. Did you try out the code? it's somewhat similar in your code. it's just that you are using AJAX and mine is Jquery-AJAX. As I experience if I use AJAX I cannot execute a javascript on the backend file, so I use the Jquery-AJAX. have a look at this page: http://www.w3schools.com/jquery/ajax_get.asp http://api.jquery.com/jQuery.get/ Hav nyc weekend!
  20. I also encounter that kind of scenario in one of my project so what I did is the first thing that I mention to you if possible. But if the case is similar to yours I used the code I provided to you. I am not pretty much sure why it cannot call a javascript that way, so most probably that will not also work.
  21. Ok... You can try out this code if you want. frontend.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.link1').click(function(){ var param = $(this).attr("id"); $.get("backend.php?param="+param, function(data) { $("#result").html(data); }); }); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $param = 'this is parameter'; echo "<a href='#' class='link1' id='$param'>Pls click me</a>"; ?> <div id="result"></div> </body> </html> backend.php <?php echo "The parameter you pass -- <b>". $_GET['param']."</b>"; echo "<script>alert('success');</script>"; ?> I tested out that code and it's working the way you wanted it to be.
  22. is it not possible to call the function after the script? e.g: <head> <script language='javascript'> function show_media_type(pub_type){ var url = "get_media.php?media_type=" + pub_type; http.open("GET", url, true); http.onreadystatechange = showmedia; http.send(null); alert('Hi'); } function confirm_media(){ if(http.readyState == 4){ document.getElementById('header').innerHTML = http.responseText; alert('Hi'); } } </script> </head>
  23. if you add this script your foo.html will be replace by bar.html ryt? but bar.html don't really exist in your directory. var stateObj = { foo: "bar" }; history.pushState(stateObj, "page 2", "bar.html");
  24. hello... follow up in my previous post.. I just get it on working. but my question is what if the user press F5? that page is not existing it will give a 404 error. what should I do?
×
×
  • 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.