I placed your code (var_dump($explodedate)😉 on line 9 of my code and I still got the exact same error message. When I use the back arrow my event is getting posted to my calendar.

    That code wasn't meant to fix anything - it was meant to give you (and, subsequently, us) more information about the data. (I'm guessing you already knew this, of course, since you would have visited the manual page for [man]var_dump/man before blindly using it... right?)

    So, what was the output?

    EDIT: And yeah, placing the function call in the correct location helps, too.

      SueBee710;11007943 wrote:

      I placed your code (var_dump($explodedate)😉 on line 9 of my code and I still got the exact same error message. When I use the back arrow my event is getting posted to my calendar.

      Place it BEFORE the error. Place it on like Line 4, right after the explode. And tell me what it prints out.

        When I place it on line 4 my code does not run. At all.

          SueBee710;11007951 wrote:

          When I place it on line 4 my code does not run. At all.

          Then what's the error message PHP generates? PHP won't just refuse to run code without giving a reason why.

            SueBee710;11007951 wrote:

            When I place it on line 4 my code does not run. At all.

            It's because you misspelled your variable name. It's $explodeddate not $explodedate.

              <?php
              if(isset($_GET['date']) == TRUE) {
              $explodeddate = explode("-", $_GET['date']);
              var_dump($explodeddate);
              $month = $explodeddate[0];
              $year = $explodeddate[1];
              $numdays = date("t", mktime(0, 0, 0, $month, 1, $year)); // this is line 6
              
              }
              //And so on....
              

              Tha's what you need.

                Okay, let's start at square one. I am a Web Design Student at NGTC. I am in an advanced PHP and MySQL class and feel as lost as I did on the first go-round. I have created a calndar. When I try to add new events to the calendar, I get the error message originally posted. When I placed your (var_dump($explodedate); code into my code on line 4 I cannot enter a new item into my calendar. It doesn't do anything: no error message: NOTHING. When your code is NOT there, I can post the new event but get three error messages: all three the same but different lines: lline 6, line 13, and line 23. "mktime() expects parameter 6 to be long string given in C; ... \bar.php on line 6 (line 13, and view.php line 23)

                  Results:
                  array
                  0 => string '7' (length=1)
                  1 => string '' (length=0)

                    Ah. Thank you. Yes, your $_GET['date'] string is in the wrong format.

                    Put

                    echo $_GET['date'];

                    in place of the var_dump line and look at what it prints out.

                      Did you get that? I put your code in line 4 and got an array result.

                        So: it is in the wrong format. What would the correct format be, then?

                          Where are you getting your GET variables? And look at what echo $_GET['date']; prints out, you can put that code at the beginning of your php file right after the <?php

                            My GET variables are straight out of the course textbook for the assignment.

                              SueBee710;11007971 wrote:

                              This is now what I get:

                              7-

                              So.... You're receiving the GET variable in the wrong format. So the course textbook is giving you "7-"? I doubt it or the course textbooks is wrong...

                                Well, if I told you the name of the book...
                                it has had many errors, which is frustrating as I am trying to learn.
                                The book is "Practical PHP and MySQL, Building Eight Dynamic Web Applications" Jono Bacon. I copied the code right out of the book, made a few corrections, and everything works now except this one error.

                                  Could you post the code that sends the GET variables?

                                  In other words, how do you navigate to this page that we are talking about right now? Are you clicking on a link? Post the code of the page that has the link.