S
S
step-olga2015-10-13 01:06:53
PHP
step-olga, 2015-10-13 01:06:53

How to assign a value to a variable from GET?

Good day!
There is a form on the index.php page, the POST method passes the values ​​to the /php/script.php script, the script writes the values ​​to the database, and redirects the same values ​​to the script at the root using the GET method

header('Location: /otvet.php?name='.$value.'&name2='.$value2.'&name3='.$value3);

The trouble is that the otvet.php script gives an empty value of the variables (((
Can anyone explain to me what the problem is?
PS Everything worked fine on the hosting, but it refuses on the local server ((((

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kim, 2015-10-13
@kimono

Maybe so?

header('Location: /otvet.php?'.http_build_query([
'name' => $_POST['name'],
'name2' => $_POST['name2'],
'name3' => $_POST['name3'],
]));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question