Jump to content

Search the Community

Showing results for tags 'LOOP'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 22 results

  1. Hello there, I'm having an issue where my site won't stop reloading/refreshing when you initially go to any of the sites pages for the first time. It's like it gets stuck in a loop. It stops after you touch the screen a few times and/or go to another page. It seems to only be happening in Safari in mobile. I've been trying to figure out what might be causing this, but with no luck. Has anyone encountered this problem before? Or have any thoughts on what may be causing this? Here's a video of what happening: https://www.screenmailer.com/v/FQwkawa2W4kEmlg The link to the site is:
  2. Hi all, I would like to escape a loop if $mainRow's value has already been called. Here is what I have but it is not working. while ($stmt->fetch()) { $mail_main[] = $mainRow; $main_arr .= ''.$main_arr.', '.$mainRow.''; $main_arr_array = explode(",", $main_arr); if (in_array($mainRow, $main_arr_array, TRUE)){ continue; //break; } }
  3. I can not fix this script, because the output is not in sync. I have 3 arrays. 1) present column names. 2) prefix (fixed name). 3) suffix (uniqid value). Can someone explain how exactly I should create a foreach loop in a foreach loop with 3 arrays and fetching the field value from the get_result command as the the value it is related to. This would result in: <---->Present Column Name <-----> New Column Name <---->value1 <--------------------------------> value1_abcd <---->value2 <------------------------------> value2_abc
  4. This script shows the fetched data in a modify form. In the old situation I used rec_num wich was corresponding to the record number in the database.table For security reasons I added a uniqid column to the table. So not like under with an input hidden attribute for uniqid. If possible I would like it to be stored in a session variable. This is doable like above, but outside the foreach loop only the last value is stored. How to connect every single uniqid value (for multiple records!) to the separated rec_num without users being able to see
  5. I was try make loop in loop with array. it should be like: L1: T1&C1---L1: T2&C2---L1: T3&C3--- L2: T1&C1---L2: T2&C2---L2: T3&C3--- L3: T1&C1---L3: T2&C2---L3: T3&C3--- But I got other than that i thought, so what did i wrong?
  6. My goal is to loop with foreach through two variables. So I found this script; <?php $abc = array('Mark','Laura'); $add = array('cocktails','champagne'); $array = array($abc,$add); foreach ($array as list($arr1, $arr2)) { // echo '<br>'; echo '<br>'; echo $arr1; echo '<br>'; echo $arr2; } But the output is not wat is desired. It says: And I would rather have: Is there any function / command in the php array reference to do this or should other code be used?
  7. So I have this function that firsts asks the player, which player they are, then asks them a question. if they get it right their score increases by one, and an alert pops up that says correct. The problem is, after you answer a question, an alert pops up that says correct, and then another question pops up. No matter what your answer is nothing happens afterwards. Basically after everything happens, another question comes up but it shouldn't. Can anyone tell me if there is anything wrong with my code that might make this happen? function question(question, answer) { this.question = qu
  8. producttable : id | mid | pid | owgh | nwgh | 1 3 12 1.5 0.6 2 3 12 1.5 0.3 3 3 14 0.6 0.4 4 3 15 1.2 1.1 5 4 16 1.5 1.0 6 4 17 2.4 1.2 7 3 19 3.0 1.4 8 3 19 3.0 1.2 I need result in while loop as **below** : as per mysql query $sql = "SELECT pid,owgh,nwgh from produttable WHERE mid = 3 "; **RESULT I WANT AS BELOW :** Product Id | Old weight | New weight --------------------------------------- 12 1.5 0.6
  9. producttable : id | mid | pid | owgh | nwgh | 1 3 12 1.5 0.6 2 3 12 1.5 0.3 3 3 14 0.6 0.4 4 3 15 1.2 1.1 5 4 16 1.5 1.0 6 4 17 2.4 1.2 7 3 19 3.0 1.4 8 3 19 3.0 1.2 I need result in while loop as **below** : as per mysql query $sql = "SELECT pid,owgh,nwgh from produttable WHERE mid = 3 ";**RESULT I WANT AS BELOW :** Product Id | Old weight | New weight --------------------------------------- 12 1.5 0.6
  10. Hi everyone, I tried to make a video which will start at the beginning and star over again <video id="Video1" controls autoplay loop> <source src="VideoXYZ.mp4" type="video/mp4"> <source src="VideoXYZ" type="video/webm"> <source src="VideoXYZ" type="video/ogg"> Your Browser does not support the video tag </video> But I want to loop the video 5 or 7 times then it definitely stops until I refresh the page, and of course I don't have a clue how to make a timer to LOOP. First, is it possible to do this? if yes, how to do it? Thank y
  11. Basically what I am trying to do is, first you enter a number, which will be the number of time the loop should run. When all details entered, it should print out like a payslip for all entries, name, wage, marital status etc..Now the problem is, when I enter example 2 for the loop(numWorkers) at the last round, it will come up with some error in the line of nameWorker[i] = input.next(); Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 20. Also got some problem with the wage obviously im trying to send a double to the wageCalc method, but just cant get it running. Tried p
  12. Dear All; Need your help. I am programming students' roll call in ASP with SQL 2008 R2. There are about 100 students. By default option selected is 'Present' using drop down list. I tried to use radio buttons but only one button remains selected so I am using drop-down list ( How to select multiple radio buttons?). After selecting "Present", "Absent","Late" etc, how do I insert all 100( or whatever number) of rows in the SQL table simultaneously? How should I use "for", "loop" or any other method? Please guide. Regards DAMODAR
  13. Hi, I just started to study javascript and I came across in one of your page to the following notation: var text=""; The page is from w3school tutorial: http://www.w3schools.com/js/tryit.asp?filename=tryjs_loop_for_ex I do not understand what it means and why should be used in the loop of the above example. I tried to define var text; in its place but the result is: undefinedThe number is 0The number is 1The number is 2The number is 3The number is 4 The only difference is the world 'undefined' at the beginning of the first line. Many thanks in advance for your help
  14. function getPassword(){ var correct = "HTML5"; var guess = ""; while (guess != correct){ guess = prompt("Password?"); } // end while alert("You may proceed"); } Hey guys, I am a newbie, here, so it would be much appreciated if you guys could clarify this issue for me. As you can see the above javascript function (asking the user to enter the correct password after they click on the button or the loop will continue forever), my question is that, why do we need to set the "guess" variable's value to empty in this case, why don't we just leave it as undefined(v
  15. how can i loop a result from a php function to loop through each 'id'? like for all 'sid's, i want to use following function to get data... /* above this i calculate value for each $cqty */$cqty = $oqty + $inqty - $outqty;$camt = "select date, pqty, prate, pamt from stock stjoin purchase p on st.sid = p.sid where st.sid = $sidunion allselect date, -sqty, srate, samt from stock stjoin sales s on st.sid = s.sid where st.sid = $sidunion allselect null, oqty, oprice, oamt from stock where sid = $sidorder by date asc";$dataSet = array();$camtresult = mysqli_query($connect, $camt);while ($row =
  16. // * * * * * * * *Get all the vars * * * * * * *$name = filter_input(INPUT_POST, 'companyName', FILTER_SANITIZE_SPECIAL_CHARS); $contact = filter_input(INPUT_POST, 'contact', FILTER_SANITIZE_SPECIAL_CHARS);$phone = filter_input(INPUT_POST, 'phone', FILTER_SANITIZE_SPECIAL_CHARS);$email_from = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_SPECIAL_CHARS);$invNo = filter_input(INPUT_POST, 'invNO', FILTER_SANITIZE_SPECIAL_CHARS); $queryType = filter_input(INPUT_POST, 'typeOfQueryDropDownBox', FILTER_SANITIZE_SPECIAL_CHARS);$details = filter_input(INPUT_POST, 'details', FILTER_SANITIZE_SPECIAL_
  17. I need to loop through an array, in the order that the items appear, and get both the key of the item and its value. I know I can use foreach to loop through an array but as far as I know I can choose between the key and the value of the current item but not get both. Here's an example of an array: <?php$SampleArray = array(55 => "car","2" => "house","boat" => "boat",0 => "engine",666 => "website",);?> It would work somehow like this: loop($SampleArray){ echo key . " - " value . "n";} And the result would be something like:55 - car 2 - house boat - boat 0 -
  18. Hi, I have form that displaying report per week. First thing to do is choose what week then automatically display the date/shift that week ranges. here is my weekly_report.php <?php error_reporting(0); session_start(); ob_start(); date_default_timezone_set("Asia/Singapore"); include('connection.php'); ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><title>Weekly Report</title><head><link rel="stylesheet" type="text/css" href="op_report.css" /><script type="text/javascript" src="jquery.js">
  19. Hello! I wanna create a form that can send sms to multiple recipient, i've created a form that uses javascript to add or remove textbox dynamically, this code successfully send sms when i fill one recipient number, but fails to send more than one recipient, and as i try to make it send sms to more than one user by making it loop, i get this error, Can someone help? i want to know how do i make this form sends sms towards multiple user Warning: Invalid argument supplied for foreach() <script language="javascript"> function addRow(tableID) { var table = document.getElementById(tableID
  20. Hello everyone.There is a small problem with a drop-down form field I am trying to get work. I've this peace of code: <select name="pot"> <option value="0" selected="selected">1</option> <?php for($p=0.12; $p<=5; $p++){ ?> <option value="<?php echo $p ?>"></option> <?php } ?> </select> and what I get is this: <select name="pot"> <option value="0" selected="selected">1</option> <option value="0.12"></option> <option value="1.12"></option> <op
  21. Hello everyone,I recently created a blog on tumblr to showcase video contributions for a project I launched. I was intending to have the videos loop once played and I am struggling. I looked online and found all the appropriate codes to create loops and although the videos obediently follow instructions when played in my browser they refuse to loop once I embed them in the blog.I am very new to HTML and was advised to "use the Plain Text Editor to create or edit advanced post embeds or to control element formatting via HTML" I really don't know what that means. My blog sits here: www.thenonres
  22. <?php$sites = array(array(array("Google","http://www.google.com"), array("search engine","platform","news","weather") ), array(array("Youtube","http://www.youtube.com"), array("search engine","platform","news","video") ) ); $query = $_GET["query"];if (strlen($query) > 0) {$suggestions = "";for ($i=0; $i<count($sites); $i++) { if (strtolower($query) == strtolower(substr($sites[$i][0][0],0,strlen($query)))) { for ($j=0; $j<count($sites[$i][1]); $j++) if ($suggestions == "") { $suggestions = "<a href=".$sites[$i][0][1]." target='_blank'>".$sites[$i
  • Create New...