Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by AyKay47

  1. I would actually assign both tasks to their own js functions, and call them via the event caller in your markup. however, to answer your question. <input name="s" id="s" onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" value="Email..." type="text" size="18" value="esc_html(<?php echo $var['default']; ?>)" name="esc_attr(<?php echo $opt; ?>)" id="esc_attr(<?php echo $opt; ?>)" class="mc_input"/>';
  2. I would simply echo a notification regardless if a match was found or not, letting the user know whether or not there was a match and if they must enter another account name, returning false won't "stop submission", really in this context, returning false won't do much of anything.
  3. you'll have to explain the return logic a little better, im not quite following. for the onsubmit event, simply loadXMLDoc(); is what you want, you don't need to return anything in the event caller, unless you plan on doing something with the return value. glancing at the code, it looks to be correct, except normally you would want to return true if the responseText returned a value, false otherwise.
  4. your ajax request is a little backwards, here is a skeleton that you can use as a guideline for your ajax request. <html> <head> <script type="text/javascript"> function loadXMLDoc() { var xmlhttp; 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("myDiv").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","ajax_info.txt",true); xmlhttp.send(); } </script> </head> <body> <div id="myDiv"><h2>Let AJAX change this text</h2></div> <button type="button" onclick="loadXMLDoc()">Change Content</button> </body> </html> whenever i see someone using the javascript way of making an ajax request, i always recommend using the jquery ajax API
  5. http.abort(); this aborts the request.
  6. it's funny that the U.S is run by 535 idiots, give or take.
  7. sure, you can use mysql's concat() function to append whatever you want to the field, however, doing this would simply be a waste of memory since it is not needed.
  8. concatenate it upon output, post the relevant code.
  9. no, you are reading the temp file and not doing anything with it, here is a rough skeleton of what you need to upload an image, you will need to look at some more information about this subject to fill in the blanks.. if(!empty($_FILES['photo'])) { if($_FILES['photo']['size'] > 0) { $fileName = $_FILES['photo']['name']; $tmpName = $_FILES['photo']['tmp_name']; $fileType = $_FILES['photo']['type']; $allowed_types = array("image/jpg","image/jpeg","image/gif","image/png"); //array to check for valid file type if(in_array($fileType,$allowed_types)) { //if the file is a valid type $image_path = "path/to/desired/location/" . $fileName; //path to write file if(move_uploaded_file($tmpName,$image_path)) { //if writing to path was successful echo "hurray"; } } } now I left a few things out, including the debugging of your script and perhaps one or two other checks that you can perform on your file before uploading, that is where you will have to fill in the blanks, typically,move_uploaded_file is used to upload a file to a specified path.
  10. so where exactly in this code are you uploading the file?
  11. the only reason it would be faster is because it is pulling less results, what you can do is limit the number of results that is returned using the limit keyword. SELECT Nom,Prenom FROM Etudiant WHERE Nom like '%$search%' OR Prenom like '%$search%' ORDER BY Nom LIMIT 100
  12. SELECT Nom,Prenom FROM Etudiant WHERE Nom like '%$search%' OR Prenom like '%$search%' ORDER BY Nom
  13. your query will weed out the duplicate values that are stored in the field "Nom", what exactly do you want your result set to be?
  14. http://www.gameinformer.com/b/news/archive/2011/12/29/anonymous-threatens-sony-with-robotic-voice-on-youtube.aspx
  15. str1 holds your php variable value, you will need to add that onto the querystring. xmlhttp.open("GET","getchemcom.php?q="+str&s=str1,true);
  16. by adding it to the querystring using AJAX as you have done, however, i do recommend jquery's Ajax API.
  17. the "stop online piracy act", basically gives the government control over what we view on the internet. http://www.freep.com/article/20120118/COL41/120118005/SOPA-PIPA-protest-Wikipedia-Google
  18. really, this could/should be done with your query, can you post the relevant class/method code.
  19. hey guys, I just wanted to write quickly and let you know that I like what the phpfreaks team has done to acknowledge these human rights intrusive bills, it hits home and proves a point, and most likely isn't too far off from what most social interactive websites would look like if one of these bills was passed. Well done.
  20. function arguments are separated by a comma, not a whole new set of parenthesis. function showprice(str,str1) and <select onchange="showprice(this.value,<?php echo $amt; ?>);" name='fid'>
  21. LOL very true though, last time I checked, this wasn't a communist country.
  22. http://us.php.net/manual/en/function.split.php means in version 5.3, the function is no longer available, and shouldn't be used, you should use preg_split instead.
  23. what exactly do you mean? beyond a simple copy paste?
×
×
  • 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.