Home>
There is the following code:
$.ajax
({
type: 'POST',
url: 'test.php',
data: option.stopImageNumber,
success:function(data)
{
alert(option.stopImageNumber);
}
})
The 'option.stopImageNumber' variable generates a random number each time. When this script is executed, the output from this variable is successfully displayed in 'alert(option.stopImageNumber);', but it cannot be retrieved by PHP. Please help to get number from this variable in PHP.
How can you indicate this?
Вадим2022-01-15 11:41:37because in the ajax request you didn't specify that option.stopImageNumber should be passed under the data key. Accordingly, in php you get this error
ArchDemon2022-01-15 11:29:48$option= $_POST['data']; When using this code, an error appears: Warning: Undefined array key "data" in
Вадим2022-01-15 11:27:09Something is not visible in php code
ArchDemon2022-01-15 11:09:45Related questions
- javascript : How can I transfer Recaptcha v2 for solution to another person
- javascript : Help with routine please
- javascript : js code execution protection
- javascript : Help get variable from ajax in php
- javascript : How to delete a row from a database table using Ajax, without reloading the page?
- javascript : How to restrict adding users
- javascript : How to send file to PHP server from JS?
- javascript : How to implement a limit on the number of adding customers to the site
- javascript : Is it a sin to use situational (==) instead of (===) and Function Declaration instead of Expression
@Vadim.. data: { 'data': option.stopImageNumber }
sousage12122022-01-15 13:04:18