ajax to php call
//Use $.ajax to call a server context (or URL, or whatever) to invoke a particular 'action'. What you want is something like:
$.ajax({ url: '/my/site',
data: {action: 'test'},
type: 'post',
success: function(output) {
alert(output);
}
});
//On the server side, the action POST parameter should be read and the corresponding value should point to the method to invoke, e.g.:
if(isset($_POST['action']) && !empty($_POST['action'])) {
$action = $_POST['action'];
switch($action) {
case 'test' : test();break;
case 'blah' : blah();break;
// ...etc...
}
}
//OR LEARN SOMTHING NEW https://api-tools.getlaminas.org/$.ajax({ url: '/my/site',
data: {action: 'test'},
type: 'post',
success: function(output) {
alert(output);
}
});
Also in PHP:
- check if date between two dates laravel eloquent
- executar comando linux php
- contain in php
- clear view laravel
- Illuminate\Contracts\Container\BindingResolutionException Target class [PagesController] does not exist.
- exception handling class php
- 500 Server Error on laravel
- 2 time between add php
- date compare php
- create project in laravel
- SERVER URL PHP
- error reporting in php
- decode_id php
- checking if a string contains a certain word
- composer require php '^5.4'
- best way to redirect with php
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/Users/marvinp/AppData/Local/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
- config cache clear with code
- Token capabilities in vault
- arduino create ip address from string
- best data structure in php for a unique values
- create auto image path folder in laravel 8
- check if object key exists in php
- array filter use key