Hey, I'm trying to write some code that will enable me to choose whether or not to include a file.
Basically I'd like it so that if someone clicked on a link like this...
http://www.iamsparticus.co.uk/archives/randomfile.php
it would include the main body of the text and the extra part
however if they clicked something like this
http://www.iamsparticus.co.uk/archives/randomfile.php?commentonly=1
they'd open the page with only the extra part.
The way I have imagined this is by creating the php page with the extra bit always there... then putting in a code line that says if commentonly=1 include a file.
this is the code I came up with but it doesn't work, anyone want to help me and tell me why?
<?php
if $commentonly=1 {
echo (comment);
} else {
include("/path/to/my/web/included.txt");
}
?>
Thanks very much