944,138 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 466
  • PHP RSS
Oct 27th, 2009
0

Querystring $end error

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

PHP Syntax (Toggle Plain Text)
  1. <html>
  2. <body>
  3. <?
  4. $i=$_GET['day'];
  5. switch ($i) {
  6. case 1:
  7. include("2.php");
  8. break;
  9. case 2:
  10. include("3.php");
  11. break;
  12. case 3:
  13. include("4.php");
  14. break;
  15. default:
  16. //echo "page not found!!!!";
  17. }
  18. ?>
  19. <!--
  20. <? if($_GET['day']==1){ ?>
  21. <?php include("2.php") ?>
  22. <? }else if($_GET['day']==2){ ?>
  23. <?php include("3.php") ?>
  24. <? }else if($_GET['day']==3){ ?>
  25. <?php include("4.php") ?>
  26. <? }else if($_GET['day']==4){ ?>
  27. <?php include("5.php") ?>
  28. <? }else if($_GET['day']==5){ ?>
  29. <?php include("6.php") ?>
  30. <? }else if($_GET['day']==6){ ?>
  31. <?php include("7.php") ?>
  32. <? }else if($_GET['day']==5){ ?>
  33. <?php include("1.php") ?>
  34. <? }else if(!is_numeric($_GET['day']) || $_GET['day']<1){ ?>
  35. <!--invalid id (or page not found)--> -->
  36. <?php
  37. $d=date("D");
  38. switch ($d)
  39. {
  40. case "Mon":
  41. include("2.php");
  42. //echo "Today is Monday";
  43. break;
  44. case "Tue":
  45. include("3.php");
  46. //echo "Today is Tuesday";
  47. break;
  48. case "Wed":
  49. include("4.php");
  50. //echo "Today is Wednesday";
  51. break;
  52. case "Thu":
  53. include("5.php");
  54. //echo "Today is Thursday";
  55. break;
  56. case "Fri":
  57. include("6.php");
  58. //echo "Today is Friday";
  59. break;
  60. case "Sat":
  61. include("7.php");
  62. //echo "Today is Saturday";
  63. break;
  64. case "Sun":
  65. include("1.php");
  66. //echo "Today is Sunday";
  67. break;
  68. default:
  69. //echo "Wonder which day is this ?";
  70. }
  71. ?>
  72. </body>
  73. </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?
Similar Threads
Reputation Points: 15
Solved Threads: 0
Junior Poster
whitestream6 is offline Offline
169 posts
since Nov 2008
Oct 27th, 2009
-1
Re: Querystring $end error
You most likely forget a closing }.
Reputation Points: 235
Solved Threads: 193
Nearly a Posting Virtuoso
kkeith29 is offline Offline
1,315 posts
since Jun 2007
Oct 28th, 2009
0
Re: Querystring $end error
else if(!is_numeric($_GET['day']) || $_GET['day']<1){ ?>

no correspond }
Reputation Points: 10
Solved Threads: 0
Newbie Poster
iloveoct is offline Offline
2 posts
since Oct 2009
Oct 28th, 2009
0
Re: Querystring $end error
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.
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008
Oct 28th, 2009
-1
Re: Querystring $end error
put the break in the default and forgot the closing brace of last else if()
Last edited by network18; Oct 28th, 2009 at 5:36 am.
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: My head is going to explode if I can't fix this. PLEASE HELP
Next Thread in PHP Forum Timeline: Eloctronic Museum in php





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC