Jump to content

Change a variable from its url


didz666

Recommended Posts

Im still learning how to use php so sorry if this is a stupid question.

 

Is it possible to change a variable in a php using its url when calling it using ajax.

<?php
$variable   = '1';  //can i change it via the url to 2
?>
<script>
   $.ajax({
     type: 'POST',
     url: "http://mysite.co.uk/myphp.php?$variable=1",
     success: function (data){
     $("$mydiv").html(data);
      }
   });
</script>

any help would really be apreciated.

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/296572-change-a-variable-from-its-url/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.