Activity Stream
48,167 MEMBERS
61738 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 10 of 10

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1.     
    #1
    You can call me G
    assuming that u accept a post field number via the form:

    PHP Code: 
    $count = (int)($_POST['number']); //changed the value to integer type casted...

    for($i 0$i $count$i++){
    if (@
    write_file($namechr(0), 0)) { 
                        
    clearstatcache(); 
                        
    printf(lang(381), $html_name); 
                        unset(
    $list[$v]); 
                        
    $time filemtime($name); while (isset($list[$time])) { $time++; } 
                        
    $list[$time] = array('name' => $name"size" => bytesToKbOrMbOrGb(filesize($name)), "date" => $time); 
                    }  

    Gaurav Reviewed by Gaurav on . PHP help! How can I run/execute this in php based on user input? For example I will let a user define the number, then I want this to be executed X times where X is the number he entered. if (@write_file($name, chr(0), 0)) { clearstatcache(); printf(lang(381), $html_name); unset($list); $time = filemtime($name); while (isset($list)) { $time++; } $list = array('name' => $name, "size" => bytesToKbOrMbOrGb(filesize($name)), "date" => $time); } Rating: 5



    My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    CodeSociety.net
    Quote Originally Posted by gunda316 View Post
    assuming that u accept a post field number via the form:

    PHP Code: 
    $count $_POST['number'];

    for(
    $i 0$i $count$i++){
    if (@
    write_file($namechr(0), 0)) { 
                        
    clearstatcache(); 
                        
    printf(lang(381), $html_name); 
                        unset(
    $list[$v]); 
                        
    $time filemtime($name); while (isset($list[$time])) { $time++; } 
                        
    $list[$time] = array('name' => $name"size" => bytesToKbOrMbOrGb(filesize($name)), "date" => $time); 
                    }  

    Give a man a fish; you have fed him for the day. Teach a man to fish; and you have fed him for a lifetime.



  4.     
    #3
    Member
    Website's:
    CodeSociety.net
    Quote Originally Posted by techdaemon View Post
    yes. to make it simpler, how can I execute something like echo "I love you<br />"; X times where X is the number the user entered via a form?
    Point proven

    take a look at this tech
    http://php.net/manual/en/control-structures.for.php



  5.     
    #4
    You can call me G
    Quote Originally Posted by immortalxx View Post
    Give a man a fish; you have fed him for the day. Teach a man to fish; and you have fed him for a lifetime.
    lol.. he needs to add teh form with the fields.. so there's still stuff he has to do on his own.. basically he needed to know abt the looping not accepting values from forms..



    My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz

  6.     
    #5
    Banned
    Quote Originally Posted by gunda316 View Post
    assuming that u accept a post field number via the form:

    PHP Code: 
    $count = (int)($_POST['number']); //changed the value to integer type casted...

    for($i 0$i $count$i++){
    if (@
    write_file($namechr(0), 0)) { 
                        
    clearstatcache(); 
                        
    printf(lang(381), $html_name); 
                        unset(
    $list[$v]); 
                        
    $time filemtime($name); while (isset($list[$time])) { $time++; } 
                        
    $list[$time] = array('name' => $name"size" => bytesToKbOrMbOrGb(filesize($name)), "date" => $time); 
                    }  

    Thanks!! This really helped.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

BE SOCIAL