Note : Try this code : Download Find Greatest Number Script
<?PHP
$inputs = array();
if (isset($_POST['submit'])) { //to check if the form was submitted
$value = isset($_POST['input0'])? $_POST['input0'] : null;
for($count = 1; $value != null; $count++){
array_push($inputs, $value);
$value = isset($_POST['input'.$count])? $_POST['input'.$count] : null;
}
}
var_dump($inputs);
?>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<!-- to take multiple inputs copy the below line and change name="input" attribute -->
Enter input 1: <input type="text" name="input0" value="" /><br />
Enter input 2: <input type="text" name="input1" value="" /><br />
Enter input 3: <input type="text" name="input2" value="" /><br />
Enter input 4: <input type="text" name="input3" value="" /><br />
Enter input 5: <input type="text" name="input4" value="" /><br />
Enter input 6: <input type="text" name="input5" value="" /><br />
Enter input 7: <input type="text" name="input6" value="" /><br />
Enter input 8: <input type="text" name="input7" value="" /><br />
Enter input 9: <input type="text" name="input8" value="" /><br />
Enter input 10: <input type="text" name="input9" value="" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
<?php
$max = $inputs[0]; //this variable to store values to array
$count = 1; //this variable to run the loop 10 times
while ($count < 10) //here it is Terminate condition
{
if ($max < $inputs[$count])
{
$max = $inputs[$count];
}
$count++;
}
echo "$max is greatest <br/>";
?>
+ comments + 1 comments
I'm getting a max_input_vars error message.
I understand there's a php.ini setting that can change this starting with version 5.3.9 however, I'm running version 5.1.6.
When I view the configuration information for my 5.1.6 server it shows max_input_vars value is 1000.
My question is: Even though I'm running 5.1.6, I see this setting from phpinfo() but it's not in the php.ini file. Does this mean that the value is hard coded in this version of PHP and can't be changed?By the way,can you use java code to recognise bar code in webpages?My teacher gives me this assignment,please help me.
Post a Comment
Give your reviews about this blog. Leave your comments. what do you think about this post?
Comments Description is given below:
1) I love to read comments, but do not spam.
2) Like this blog and also tweet its posts.
3) You can use some xHTML tags.
4) All Comments are Do Follow, Please try to use blog professionally.
5) Mention Your Name below the comment.
6) You can also suggest for improvement.
7) Do not forget to subscribe Samee Articles blog.
---------------------------------------
Thanks for visiting QWC.Me.
==========================================
For free guidelines contact me on SEO Expert | Samee Ullah Feroz is online there.
==========================================
Best Regards