N
N
nagge1012018-06-14 09:45:53
PHP
nagge101, 2018-06-14 09:45:53

How to process PHP input data?

Good day!)
I am very interested in such a thing as data processing through php.
I know that everything is done simply through $_get and post Request, but the point is that it is necessary to implement this simply for Input, which, by type of input, is numbers. Namely, you need to write that you can’t enter a number into it less than or equal to 0.
In fact, there is an if else construct, But I can’t figure out how to take the data from the field and do something further, help me !)))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kim, 2018-06-14
@kimono

I know everything is done simply via $_get and post Request

There is no other way to send data from the page to the server.
Only using links or forms.
Your task is solved on the frontend: + on the backend:
$num = $_GET['num'] ?? 0;
if ($num <= 0) {
    return false;
}

Y
Yan-s, 2018-06-14
@Yan-s

To solve your problem on the server, you first need to send data to it so that it can operate on them. Nothing else. Then the same $_GET, $_POST and if else are used, which, from your words, you know.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question