Jump to content

aHMAD_SQaLli

Members
  • Content Count

    36
  • Joined

  • Last visited

Everything posted by aHMAD_SQaLli

  1. hello if there is just the first function it run very good but if I add the second I get the message in Firefox " TypeError: event.target is undefined " (function(){ document.getElementById("ta").onclick = function(){ ta(); }; function ta(){ var tav = document.getElementById("ta").value, ta = document.getElementById("ta"); ta.setAttribute('style','height:200px;') } })(); window.onclick = function(event) { var tav = document.getElementById("ta").value, ta = document.getElementById("ta"); if (! event.target.matches('#ta')) { if( tav == "" ){ ta.setAttribute('style','height:25px;'); } else if( tav !== "" ){ ta.setAttribute('style','height:200px;'); } } } (function(){ document.getElementById("close").onclick = function(){hide_notify();}; function hide_notify(){ var notify = document.getElementById("notify"); notify.parentElement.removeChild(notify); } })(); I'm still new in JavaScript so I have no idea what is going on ! thanks.
  2. thanks for the code ! and thank you for highlighting this problem, actually I'm still new in PHP/MySQLi and this test website will not be published, it's just for improve my coding skills.
  3. Hello I'm trying to check if 2 values exist in the database using php, Google didn't help... I need something like this : if($stmt = mysqli_prepare($db_connect,'QUERY TO CHECK IF USERNAME AND EMAIL EXIST')){ mysqli_stmt_bind_param($stmt, "ss", $user,$email); mysqli_stmt_execute($stmt); /* if username exist echo username exist if email exist echo email exist */ } else{/*error*/} thanks !
  4. Hello The Internet is full with Responsive design tutorials, but a could not find any helpful adaptive design tutorial, so if someone know how to create a adaptive design or a useful tutorial please help. Have a Good Day !
  5. Thanks, that was helpful, but I should run this manually, is there any way to be 100% auto .
  6. Hello I want to make a SQL row to be deleted after one day, or week, or every row older than on week automatically, how can it be done ? Have a good day.
  7. Hello I Googled Responsive vs Adaptive design , and almost all results recommend using Responsive design and say that Adaptive design has a lots Cons. But... I noticed that famous websites like Google, Facebook, Yahoo, Youtube and many more use Adaptive Design, so I'm wandering Why they use Adaptive design if the majority say that responsive is better ? Thanks !
  8. Thanks, again one more thing, what can I add to the code to display the time offsets, like : (GMT +1:00 hours ) Brussels, Paris ... ? .
  9. Hello How can I create a user friendly timezone select menu using PHP, like the one in General account setting of PHPFreaks. thanks !
  10. Thanks for the detailed explain it really make more sense, and I know about jQuery but I just prefer to use Javascript because I'm still learning. sorry if I'm asking to much but, can you give me a better code example if it's possible, I'll be Very Thankful, still new with JavaScript.
  11. Hello I have this Ajax code witch working good, but I'm not really good at javascript I just started 1 month ago, so I'm not sure if this code is perfect or not, or is there any way to improve this AJAX code. HTML/AJAX <input type="text" id="text_1" /> <button name="js_btn_func" id="js_btn_func" onclick="ajax()" > Execute JavaScript / AJAX Function </button> <div id="success_2"></div> <div id="result_2"></div> <div id="error_2"></div> <script> try { var results_area_2 = document.getElementById("result_2"); var error_area_2 = document.getElementById("error_2"); var success_area_2 = document.getElementById("success_2"); function ajax(str) { var xhttp; var str = document.getElementById("text_1").value; if (str == "") { document.getElementById("result_2").innerHTML = ""; return; } xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { results_area_2.innerHTML = xhttp.responseText; success_area_2.innerHTML = ('Success: Script is <b>ON</b>'); } } xhttp.open("POST", "action.php?name="+str, true); xhttp.send(); } } catch(e){ alert('An error has occurred: '+e.message) error_area_2.innerHTML = ('Error: Script is <b>OFF</b>'); } </script> PHP <?php $random_query = mt_rand(1, 9999); if (isset($_REQUEST["name"])){ $q = $_REQUEST["name"]; echo "Hello <b>$q</b>! random number : $random_query "; } ?> Thanks in advance.
  12. Hello sorry if the English is not good Is there any way to get client's timezone or hours difference using PHP and JAVASCRIPT so the time is displayed based on the client's timezone, because I've created a small PHP script and when I upload it to the server, the time was displayed based on the server's timezone. Thank's in advance, Have a good day.
  13. Thanks Jacques1, I know about isset(), the code that I wrote is just for short example. I like the code that you provided, short and effective, Thanks !
  14. Thanks but, what is <?= str_rot13(Pyhfgre Shpx) ?> I'm still a beginner.
  15. Hello sorry if the question is not proper / clear. which one of these two ways is better to validate. <?php # using a variable $query = $_POST['query']; $ok = FALSE; if ( $query = 'php' ){ $ok = TRUE;} else { $ok = FALSE;} if ( $ok = TRUE; ){ // more code } # direct way $query = $_POST['query']; if ( $query = 'php' ){ // more code } else { // more codes } ?> Thanks in advance.
  16. Hello I heard that some websites use Java or C++ or Python with PHP in the same time, if some know how it's done please answer these 3 questions: 1. How can we run PHP and Java or C++ or Python in the same time. 2. How the variables are passed between them. 3. Wich one is better, Java or C++ or Python . Thanks all.
  17. Hello sorry for the English if it's bad... I'm going to use facebook as an example, if I uploaded my profile picture 1.9Mb 1920x1200, and then I went to the home page, in the top blue navbar I will find that the profile picture size is just 2.24Ko and it's resolution is 36x36. so I'm wondering how this can be done using php ? Thanks
×
×
  • 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.