Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php receive post

// Send data trough e.g. AJAX in JavaScript

$.ajax({
    type: "POST",
    url: 'example.php',
    data: { "num1": 1, "num2": 2},
    contentType: "application/json; charset=utf-8",
    dataType: "JSON",
    async: false
})

// You would receive it like this:
  
$num1 = $_POST["num1"];
$num2 = $_POST["num2"];

$sum = $num1 + $num2;
echo $sum;

// Would output: 3
Comment

PREVIOUS NEXT
Code Example
Php :: php tomorrow 
Php :: php artisan queue table 
Php :: read line by line php 
Php :: merge array 
Php :: stdclass not found laravel 
Php :: hoew to store a cookie php 
Php :: change field name in validation laravel 8 
Php :: upgrade php7 to php 8 xampp 
Php :: laravel update from 7 to 8 
Php :: Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1 
Php :: get post by meta value 
Php :: Error: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. 
Php :: how to create shortcode with php 
Php :: Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in 
Php :: laravel append parameter to links 
Php :: check duplicate data in array php 
Php :: get data of url php 
Php :: woocommerce php product gallery change to carousel 
Php :: laravel pluck example 
Php :: php function crop image 
Php :: laravel migration integer 
Php :: Laravel How do I get distinct values from the table along with the count of how many rows there are containing that value 
Php :: adding data dynamically to empty array in php 
Php :: laravel read csv file 
Php :: ubuntu apache php version 
Php :: laravel collection average 
Php :: Termlaravel validation exists array rules 
Php :: wordpress admin redirecting to http 
Php :: php post variables to another page with submit button php 
Php :: has password argon2i 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =