pass variable to a php file
-
Guys,
I am modifying the toolbox theme.
I wrote a ‘whatever.php’ file, and put it under:wp-content/themes/toolbox/php/whatever.php
Now, if I just include it in index.php, it works fine. When I try to pass variables however like this:
include(‘php/whatever.php?myvar=3’)
, it breaks down.
I understand (from the php manual) that I need to include the full path for this to work. However, attempts like:
include(‘https://mysite.com/wp-content/themes/toolbox/php/whatever.php?myvar=3’)
of course fail…
What am I doing wrong? Or is it simply not possible to do this – as I think I read?!
I know I could use global variables, but I don’t really want to.
Many thanks
D.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘pass variable to a php file’ is closed to new replies.