oobradersoo
-
Posts
18 -
Joined
-
Last visited
Posts posted by oobradersoo
-
-
could someone help me out am i right in saying i will need to use a for loop to output the answe code below:
(creating a function)
input 1 : 6
input 2 : 5
input 3 : 4
input 4 : 3
answer
666666
55555
4444
333
i do not know a lot i have been researching on internet for days an cant seem to cant anywhere. could someone help please
-
i have learned how to echo out information via arrays etc. ATM i am trying to learn to build functions .
-
i am wanting to learn how to build your own functions. i dont want to use str_repeat at all. sorry im a nub! how would you go about doing the loop?
-
i dont want to use "str_repeat".
could someone give me some ideas how to make my own function without using str_repeat
i am wanting the user to enter 4 numbers into 4 input boxes for example
input 1 : 6
input 2 : 5
input 3 : 4
input 4 : 3
answer
666666
55555
4444
333
-
hello there people does any one know how to store a group of variables inside 1 variable. so if i had ($1, $2, $3, $4 ........) i am wanting to store them in 1 variable like so $list
-
-
if you have 4 variables is there anyway to link them into one variable?
{
$number1
$number2
$number3
$number4
}
$wholenumber
-
there is a reason the form is like i have set it out. is there a way i can keep the form the same and do what i have asked?
-
i want the user to have on his screen
1 22 333 4444
-
"" Do you mean 4 input fields where you can enter in 4 numbers, and then repeat those 4 numbers how ever many times the number is? "" yes that's exactly what it is
theirs my code which i am wanting to change
<form action="form.php" method="POST"> <input type="hidden" name="id" value="1234" /> number 1:<input type="number" name="number1" value="<?php echo $number1;?>"/> <br> number 2:<input type="number" name="number2" value="<?php echo $number2;?>"/> <br> number 3:<input type="number" name="number3" value="<?php echo $number3;?>"/> <br> number 4:<input type="number" name="number4" value="<?php echo $number4;?>"/> <input type="submit" value="submit"/> </form> <?php if(null==($number1 && $number2 && $number3 && $number4)){ echo "Please fill in form above?"; } elseif(!(is_numeric($_POST['number1']) && is_numeric($_POST['number2']) && is_numeric($_POST['number3']) && is_numeric($_POST['number4']))){ echo "please put numbers in form"; } elseif(isset($_POST['number1']) && isset($_POST['number2']) && isset($_POST['number3']) && isset($_POST['number4'])){ echo "Answer: " . ($number1+$number2+$number3+$number4); } ?>
-
i get what your saying but if a user had 4 boxes to type in how can you tell it to echo out amount of times she has entered?
-
thanks mate
-
i have made a form which adding up each value which is entered. but i want to know if there is a way instead of adding up which is entered it will output it like i stated above. just asking for pointers really?
-
could some one help with:
creating a function to help you output each number, the number of times the number is … each on a separate line.
So if I entered numbers 2, 3, 4 and 5 in my form then the output would be:
2 2
3 3 3
4 4 4 4
5 5 5 5 5
-
if(null==($number1 && $number2 && $number3 && $number4)){echo "Please fill in form above?";}elseif(is_numeric($_POST['number1']) && is_numeric($_POST['number2']) && is_numeric($_POST['number3']) && is_numeric($_POST['number4'])){echo "please put numbers in form";}elseif(isset($_POST['number1']) && isset($_POST['number2']) && isset($_POST['number3']) && isset($_POST['number4'])){echo "answer:" . ($number1+$number2+$number3+$number4);}i want it to proceed to the last elseif!
-
not working still!
-
that don't work. atm That lines says “if all of the inputs are numeric then echo please put numbers in” but want to change if 1 is not numeric it outputs that
-
hello guys just a quick question i have made a html form with php embedded.
here is php code:
how could i change the code if 1 of the inputs is'nt numeric then it would echo a message saying
"insert numeric values"
at the minute it echos that if all numeric values are entered.
elseif(is_numeric($_POST['number1']) && is_numeric($_POST['number2']) && is_numeric($_POST['number3']) && is_numeric($_POST['number4'])){echo "please insert number";
creating your own function
in PHP Coding Help
Posted