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
Not sure if this will show anything but try turning on error reporting with:
at the top of your page before any other code.
Edit:
From the OP comments:
I usually discover errors like these only when they begin to defy everything I know about a language or an environment.