• I am new to wordpress plugin and I have started a few lines of code. What I am wondering now is on how to create a URL that will listen for incoming data using GET method.

    I would like to have a URL like:

    http://www.mydomain.com/process.php

    This process.php file contains a php code that saves a value from the parameter.

    Example I have a javascript on the same website that call this URL like:

    http://www.mydomain.com/process.php?value=1&country=US

    Inside process.php is a simple script that will save the value to the table like:

    <?php
    $value = $_GET["value"];
    $country = $_GET["country"];
    
    $wpdb->insert( 'wp_mytable', array( 'value' => $value, 'country' => $country ), array( '%s', '%s' ) );
    ?>
  • The topic ‘How to create URL in plugin?’ is closed to new replies.