Hi all,
I've made an incredibly simple if statement. All it does is check if a URL parameter is a certain value, and according to that, display certain content.
PHP Code:
<?php $currentURL = "/userreview.php?reviewID=$reviewID"; $CommentingStatus = $_GET["comments"];
if ($CommentingStatus = "on") { echo "<a href='$currentURL&comments=off'>Turn Off Comments</a>"; } else if ($CommentingStatus = "off") { echo "<a href='$currentURL&comments=on'>Turn On Comments</a>"; } else { echo "Parameter 'Comments' must be set to either 'on' or 'off'."; }
?>
I don't know why that won't work. It always displays 'Turn Off Comments', even if comments are already off!
It's supposed to:
Check if 'comments' is on or off.
If the comments are off, ask to turn them on.
Else if the comments are on, ask to turn them off.
Simple? Apparently not...?
|