07-26-2023, 04:24 PM
I want to add a custom php file to a WordPress to do a simple action.
So far I have in my theme `index.php` file:
<a href="myfile.php?size=md">link</a>
and the php is
<?php echo "hello world"; ?>
<?php echo $_GET["size"]; ?>
<?php echo "hello world"; ?>
The link, once clicked, displays:
hello world
Is WordPress taking over the `$_GET` function and I need to do some tricks to use it? What am I doing wrong?
**Edit**:
<?echo "hello world";?>
<?
if (array_key_exists('size', $_GET))
echo $_GET['size'];
?>
<?echo "end";?>
Ouputs :
hello world
So far I have in my theme `index.php` file:
<a href="myfile.php?size=md">link</a>
and the php is
<?php echo "hello world"; ?>
<?php echo $_GET["size"]; ?>
<?php echo "hello world"; ?>
The link, once clicked, displays:
hello world
Is WordPress taking over the `$_GET` function and I need to do some tricks to use it? What am I doing wrong?
**Edit**:
<?echo "hello world";?>
<?
if (array_key_exists('size', $_GET))
echo $_GET['size'];
?>
<?echo "end";?>
Ouputs :
hello world