php-calendar

Reply

Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: php-calendar

 
0
  #11
Mar 6th, 2009
Nevermind! To decipher that 'string', you should atleast be in 3rd grade.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 58
Reputation: rohnni is an unknown quantity at this point 
Solved Threads: 0
rohnni rohnni is offline Offline
Junior Poster in Training

Re: php-calendar

 
0
  #12
Mar 6th, 2009
  1. <html>
  2. <head>
  3. <title>Calendar: Add</title>
  4. <META HTTP-EQUIV="refresh" content="1;URL=../../calendar.php">
  5. <LINK rel="stylesheet" type="text/css" name="style" href="../../calendar.css">
  6. </head>
  7. <body bgcolor="#FFFFFF" text="#000000">
  8. <?php
  9.  
  10. function getMaxKey($db)
  11. {
  12. $maxKey = 0;
  13. $sortby = "event_key";
  14. $result = $db->getall();
  15. foreach ($result as $item) {
  16. $key = $item["event_key"];
  17. if ($key > $maxKey) $maxKey = $key;
  18. }
  19. return $maxKey;
  20. }
  21. include ("../../ffdb.inc.php");
  22. $db = new FFDB();
  23. if (!$db->open("../calendar")) {
  24. $schema = array(array("event_key", FFDB_INT, "key"), array("event_name",
  25. FFDB_STRING), array("event_description", FFDB_STRING), array("event_submitted_by",
  26. FFDB_STRING), array("event_month", FFDB_STRING), array("event_day", FFDB_INT),
  27. array("event_year", FFDB_INT));
  28. if (!$db->create("calendar", $schema)) {
  29. echo "Error creating database\n";
  30. return;
  31. }
  32. }
  33. if (!file_exists("key.dat")) {
  34. $newKey = getMaxKey($db);
  35. $newFile = fopen("key.dat", "w") or die("Can't open file");
  36. fwrite($newFile, $newKey);
  37. fclose($newFile);
  38. }
  39. else {
  40. $fileread = fopen("key.dat", "r") or die("Can't open file");
  41. $data = (int)fread($fileread, 10);
  42. fclose($fileread);
  43. $data++;
  44. $fileread = fopen("key.dat", "w") or die("Can't open file");
  45. fwrite($fileread, $data);
  46. fclose($fileread);
  47. }
  48. $event = stripslashes($event);
  49. $description = stripslashes($description);
  50. $submitted = stripslashes($submitted);
  51. $event = htmlentities($event, ENT_QUOTES);
  52. $submitted = htmlentities($submitted, ENT_QUOTES);
  53. $record["event_key"] = $data;
  54. $record["event_name"] = $event;
  55. $record["event_description"] = $description;
  56. $record["event_submitted_by"] = $submitted;
  57. $record["event_month"] = $month;
  58. list($record["event_day"]) = sscanf($day, "%d");
  59. list($record["event_year"]) = sscanf($year, "%d");
  60. echo ("");
  61. {
  62. echo $addedTable;
  63.  
  64. else
  65. {
  66. echo ("go back and add event");
  67. }
  68. }
  69. ?>
  70. </body>
  71. </html>

Parse error: syntax error, unexpected T_ELSE in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\calendar\admin\calAdd.php on line 64
Last edited by peter_budo; Mar 6th, 2009 at 10:51 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: php-calendar

 
0
  #13
Mar 6th, 2009
Whats wrong with you???
Use Code Tags...
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 58
Reputation: rohnni is an unknown quantity at this point 
Solved Threads: 0
rohnni rohnni is offline Offline
Junior Poster in Training

Re: php-calendar

 
0
  #14
Mar 7th, 2009
Originally Posted by Shanti Chepuru View Post
Whats wrong with you???
Use Code Tags...
how to use code tags?
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 83
Reputation: ahmksssv is an unknown quantity at this point 
Solved Threads: 7
ahmksssv ahmksssv is offline Offline
Junior Poster in Training

Re: php-calendar

 
0
  #15
Mar 7th, 2009
Originally Posted by rohnni View Post
  1. <html>
  2. <head>
  3. <title>Calendar: Add</title>
  4. <META HTTP-EQUIV="refresh" content="1;URL=../../calendar.php">
  5. <LINK rel="stylesheet" type="text/css" name="style" href="../../calendar.css">
  6. </head>
  7. <body bgcolor="#FFFFFF" text="#000000">
  8. <?php
  9.  
  10. function getMaxKey($db)
  11. {
  12. $maxKey = 0;
  13. $sortby = "event_key";
  14. $result = $db->getall();
  15. foreach ($result as $item) {
  16. $key = $item["event_key"];
  17. if ($key > $maxKey) $maxKey = $key;
  18. }
  19. return $maxKey;
  20. }
  21. include ("../../ffdb.inc.php");
  22. $db = new FFDB();
  23. if (!$db->open("../calendar")) {
  24. $schema = array(array("event_key", FFDB_INT, "key"), array("event_name",
  25. FFDB_STRING), array("event_description", FFDB_STRING), array("event_submitted_by",
  26. FFDB_STRING), array("event_month", FFDB_STRING), array("event_day", FFDB_INT),
  27. array("event_year", FFDB_INT));
  28. if (!$db->create("calendar", $schema)) {
  29. echo "Error creating database\n";
  30. return;
  31. }
  32. }
  33. if (!file_exists("key.dat")) {
  34. $newKey = getMaxKey($db);
  35. $newFile = fopen("key.dat", "w") or die("Can't open file");
  36. fwrite($newFile, $newKey);
  37. fclose($newFile);
  38. }
  39. else {
  40. $fileread = fopen("key.dat", "r") or die("Can't open file");
  41. $data = (int)fread($fileread, 10);
  42. fclose($fileread);
  43. $data++;
  44. $fileread = fopen("key.dat", "w") or die("Can't open file");
  45. fwrite($fileread, $data);
  46. fclose($fileread);
  47. }
  48. $event = stripslashes($event);
  49. $description = stripslashes($description);
  50. $submitted = stripslashes($submitted);
  51. $event = htmlentities($event, ENT_QUOTES);
  52. $submitted = htmlentities($submitted, ENT_QUOTES);
  53. $record["event_key"] = $data;
  54. $record["event_name"] = $event;
  55. $record["event_description"] = $description;
  56. $record["event_submitted_by"] = $submitted;
  57. $record["event_month"] = $month;
  58. list($record["event_day"]) = sscanf($day, "%d");
  59. list($record["event_year"]) = sscanf($year, "%d");
  60. echo ("");
  61. {
  62. echo $addedTable;
  63.  
  64. else
  65. {
  66. echo ("go back and add event");
  67. }
  68. }
  69. ?>
  70. </body>
  71. </html>

Parse error: syntax error, unexpected T_ELSE in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\calendar\admin\calAdd.php on line 64


Hi....
The below code having one wrong if condition....u need to open on if conition ....u can not open { for echo....
echo ("");
{
    echo $addedTable;

else 
{
    echo ("go back and add event");
}
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,205
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 486
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: php-calendar

 
0
  #16
Mar 8th, 2009
Originally Posted by rohnni View Post
how to use code tags?
As you been already instructed in PM's that you so blatantly ignored
[code]YOUR CODE HERE[/code]
OR
[code=php]YOUR CODE HERE[/code]
where php can be replaced by name of any programming language as necessary.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC