0

This is my code - which displays different articles and produces articles as http://www.mysite.com/testpage.php?test=1

<html>
<body>
<?
$i=$_GET['day'];
switch ($i) {
case 1:
    include("2.php");
    break;
case 2:
    include("3.php");
    break;
case 3:
    include("4.php");
    break;
default:
    //echo "page not found!!!!";
}
?>
<!--
<? if($_GET['day']==1){ ?>
 <?php include("2.php") ?>
<? }else if($_GET['day']==2){ ?>
 <?php include("3.php") ?>
<? }else if($_GET['day']==3){ ?>
 <?php include("4.php") ?>
 <? }else if($_GET['day']==4){ ?>
 <?php include("5.php") ?>
 <? }else if($_GET['day']==5){ ?>
 <?php include("6.php") ?>
 <? }else if($_GET['day']==6){ ?>
 <?php include("7.php") ?>
 <? }else if($_GET['day']==5){ ?>
 <?php include("1.php") ?>
<? }else if(!is_numeric($_GET['day']) || $_GET['day']<1){ ?>
<!--invalid id (or page not found)--> -->
<?php
$d=date("D");
switch ($d)
{
case "Mon":
    include("2.php");
  //echo "Today is Monday";
  break;
case "Tue":
    include("3.php");
  //echo "Today is Tuesday";
  break;
case "Wed":
    include("4.php");
  //echo "Today is Wednesday";
  break;
case "Thu":
    include("5.php");
  //echo "Today is Thursday";
  break;
case "Fri":
    include("6.php");
  //echo "Today is Friday";
  break;
case "Sat":
    include("7.php");
  //echo "Today is Saturday";
  break;
case "Sun":
    include("1.php");
  //echo "Today is Sunday";
  break;
default:
  //echo "Wonder which day is this ?";
}
?>
</body>
</html>

However, I get this error:
Parse error: syntax error, unexpected $end in C:\www\vhosts\mylocalhostsite\testing.php on line 73

I have tried for myself to fix it, but keep getting the $end error repeatedly, anyone else done this type of PHP and managed to find a fix for this?

5
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by network18
0

Why so many opening and closing tags for PHP?

Get rid of all the unneeded tags, indent your code and missing braces will be more easy to spot.

-1

put the break in the default and forgot the closing brace of last else if()

Edited by network18: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.