As Matt pointed out, you'll need to echo
the the result. Like:
<?php echo $_GET['data']; ?>
If your server is setup to use PHP shorthand statements you might also be able to use
<?= $_GET['data'] ?>
题
I am trying to get data (data) from the following URL.
http://www.example.dk/page/?data=1
I use the following code for getting the data to the wordpress page:
<?php $_GET['data']; ?>
But I don't get the data to the page. Isn't it the normal way to get data from URL with php?
解决方案
As Matt pointed out, you'll need to echo
the the result. Like:
<?php echo $_GET['data']; ?>
If your server is setup to use PHP shorthand statements you might also be able to use
<?= $_GET['data'] ?>