Jump to content
Larry Ullman's Book Forums

Michel G.

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Michel G.

  • Rank
    Newbie
  1. Thanks a lot for the reference to the manual, even though I need some time to master expressions like "new DateTime" or "DateInterval". Is this related to OOP? Or in the "QuickPro" guide?...
  2. I'm having the following issue to build-up a liturgical calendar; the mistake is related to the daylight saving time, which adds 1h and makes my whole construction invalid: <?php $date = strtotime('09-05-2013'); echo "Date: ".$date."<br />"; // May 9th, 2013 is the effective date of Ascension //The year can be easily extracted from the date $year = date('Y', $date); echo "Year: ".$year."<br />"; // The date of Easter can be easily extracted thanks to the corresponding php-native "easter_date" function $easter = easter_date($year); // The ascension is 39 days after
  3. I was posting a question on this forum when I found the fix to my problem! Now, I propose to share it with our community. Let's say that I have 2 php pages on my web site: page1.php page2.php On page1.php, I make a link to page2.php through the $_GET method: localhost:8888/page2.php?id=6&name=tintin When I try to access page2.php through this link, Safari tells me that opening the page is impossible. I get the same error message when I reload it. If I copy this link and I paste it again in the url box of Safari, the page opens normally and the $_GET values are captured normall
  4. After having almost finished learning the "Quickstart" version of the book, I recently bought the "Quickpro". I just had a look at the index, and I'm a little bit surprised not to find any mention of CMS as a widespread application of php/mySQL. Can you recommend a book dealing with this topic? Something like "Understand WordPress php/mySQL background"
  5. I'm very surprised: I recently received php code written on a PC with a link containing backslash: <?php include_once('include\dbConnect.php'); ?> (...) This code didn't work (the table content was not displayed). Once I replaced the backslash with slash, the code worked again well. Maybe obvious for most of you, but it is something I had never heard about! Now, I wonder what the "slashed" code would give on a PC?
  6. Thanks a lot! At this time, the shortest one for my purpose is the following: $year = substr($date,-4); In the future, I'll further consider alternatives.
  7. I would like to retreive the year from a date I enter (and which is not necessarily the date of the day!). For instance, I enter something like "$date = '15-09-2010';" How can I retrieve "2010" from this declaration?
×
×
  • Create New...