Results 1 to 10 of 10
Hybrid View
-
7th Nov 2010, 02:18 PM #1OPBanned
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($name, chr(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
-
7th Nov 2010, 02:20 PM #2MemberWebsite's:
Doxsters.netYou 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"
-
7th Nov 2010, 02:27 PM #3OPBanned
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?
-
7th Nov 2010, 02:22 PM #4MemberWebsite's:
CodeSociety.netgoogle 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'];
-
7th Nov 2010, 02:24 PM #5You 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($name, chr(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
-
7th Nov 2010, 02:28 PM #6MemberWebsite's:
CodeSociety.net
-
7th Nov 2010, 02:30 PM #7MemberWebsite's:
CodeSociety.netPoint proven
take a look at this tech
http://php.net/manual/en/control-structures.for.php
-
7th Nov 2010, 02:30 PM #8You can call me G
My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz
-
7th Nov 2010, 02:28 PM #9
-
7th Nov 2010, 02:29 PM #10You 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
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
themaCreator - create posts from...
Version 3.47 released. Open older version (or...