Querystring $end error

Reply

Join Date: Nov 2008
Posts: 54
Reputation: whitestream6 is an unknown quantity at this point 
Solved Threads: 0
whitestream6 whitestream6 is offline Offline
Junior Poster in Training

Querystring $end error

 
0
  #1
Oct 27th, 2009
This is my code - which displays different articles and produces articles as http://www.mysite.com/testpage.php?test=1

  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?
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,227
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso
 
-1
  #2
Oct 27th, 2009
You most likely forget a closing }.
Google is your friend.

Use [code] tags.

If you have found a solution to your problem, please mark the thread as SOLVED.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: iloveoct is an unknown quantity at this point 
Solved Threads: 0
iloveoct iloveoct is offline Offline
Newbie Poster
 
0
  #3
Oct 28th, 2009
else if(!is_numeric($_GET['day']) || $_GET['day']<1){ ?>

no correspond }
------------------------------------------------------------------
http://www.funnysayings.us
Many funny sayings in this fantastic site! Large collection of funny sayings! Read and use these funny sayings to liven up your day!
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro
 
0
  #4
Oct 28th, 2009
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.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 528
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 62
network18 network18 is online now Online
Posting Pro
 
-1
  #5
Oct 28th, 2009
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.
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC