Activity Stream
48,167 MEMBERS
6811 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
    Banned

    Default 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.

    PHP Code: 
                    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);
                    } 
    techdaemon Reviewed by techdaemon 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

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    Doxsters.net
    You mean like via a form?

    Need a Designer/Web Developer? Click Me

    MSN: PM me for it.
    Email(Preferred):timtamboy63@gmail.com

    "Power Corrupts. Absolute Power Corrupts Absolutely"

  4.     
    #3
    Banned
    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?

  5.     
    #4
    Member
    Website's:
    CodeSociety.net
    google html forums, u need an input box and a submit button you can also use $_GET variable google that as well

    changing ur url like site.com?getVarHere=2

    then process that in php

    $total = $_GET['getVarHere'];



  6.     
    #5
    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); 
                    }  




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

  7.     
    #6
    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.



  8.     
    #7
    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



  9.     
    #8
    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

  10.     
    #9
    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.

  11.     
    #10
    You can call me G
    see the example above... a for loop does the trick..



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

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