0

I have a web page that uses cookies. I am trying to adapt it to process parameters that are on the URL. I added the php shown below, but I the page shows up as containing only the DOCTYPE.

php is enabled and working within html pages (I have another page where I succesfully rewrite the META tag). Seems to me this should work so I probably have a basic misunderstanding. Can someone help? Thanks.

<!DOCTYPE HTML>
<?php
if ( $_GET("rID") == "auth" ){
   setcookie("rID","auth");  
   setcookie("authCode", $_GET("authCode"));  
   setcookie("GP_UID", $_GET("GP_UID"));  
}
?>
<html>
<head>...
LenB
  • 1,126
  • 2
  • 14
  • 31
  • `$_GET` is an array, not a function. You use square brackets `[` and `]` to access arrays and parenthesis to run a function. – Jonathan Kuhn May 12 '15 at 15:58

1 Answers1

2

You have a syntax error here:

if ( $_GET("rID") == "auth" ){
          ^--- here

Should be:

if ( $_GET["rID"] == "auth" ){

Make sure you've got errors turned on in development. PHP will tell you when you make an error.

Community
  • 1
  • 1
Halcyon
  • 57,230
  • 10
  • 89
  • 128