Jump to content

syntax error, unexpected T_VARIABLE


gaugeboson

Recommended Posts

syntax error, unexpected T_VARIABLE on line 12

 

<?php

 

include("config.php");

 

if(isset($_GET['id']) == TRUE) {
  if(is_numeric($_GET['id']) == FALSE) {
    header("Location: " . $config_basedir);
   }
   $validforum = $_GET['id'];
   }
   else {
     header("Location:" $config_basedir);
  }
  require("header.php");

Link to comment
https://forums.phpfreaks.com/topic/91009-syntax-error-unexpected-t_variable/
Share on other sites

oops  ;D

 

<?php

 

include("config.php");

 

if(isset($_GET['id']) == TRUE) {

  if(is_numeric($_GET['id']) == FALSE) {

    header("Location: " . $config_basedir);

  }

  $validforum = $_GET['id'];

  }

  else {

    header("Location:" $config_basedir);

  }

  require("header.php");

 

it is the line: header("location: " $config_basedir);

Should be...

 

<?php

include("config.php");

if (isset($_GET['id'])) {
  if (!is_numeric($_GET['id'])) {
    header("Location: " . $config_basedir);
  }
  $validforum = $_GET['id'];
} else {
  header("Location:" . $config_basedir);
}
require("header.php");

?>

I do have a value there: http://127.0.0.1/sites/forums/

 

When I input the period as you recommended I get the 404 error, and it links to that url.  Whereas the code was written for viewforum, which should come up through localhost/viewforum.php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.