I'm trying to get PHP to read the current URL to check for a word, in order to carry out a task.
Here is what I have so far, but it doesn't work.
I want PHP to look in the url for the word "form" and, if it exists, include that file. Otherwise, don't.
I'm doing this so that the JavaScript is loaded only when it's needed and not on every page.
Any help?
Thanks,
Phil.
Here is what I have so far, but it doesn't work.
Code:
<?php
if ($_GET['form']) {
include "includes/javascript.php";
}
?>
I want PHP to look in the url for the word "form" and, if it exists, include that file. Otherwise, don't.
I'm doing this so that the JavaScript is loaded only when it's needed and not on every page.
Any help?
Thanks,
Phil.