Jump to content

pghutch

New Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by pghutch

  1. Well thanks to everyone's help I've gotten the previous and next to work.

    But I have one last question.

    I want my date formatted like this: Wednesday January 23, 2012

    Right now with the code below the date is outputting like this 2013-01-28.

     

    How can I output this <span class="datetxt"> <?php echo $_GET['date'];?></span> to this Wednesday January 23, 2012

     

    Here is the code.

     

     

    <?php echo '<h3 class="home-title">Schedule for Today<span class="date">';?>

     

    <a href="index.php?<?php echo date?>=<?php echo $previous_date;?>" > <img src="assets/images/lftarrow.png" width="28" height="12"> </a>

    <span class="datetxt"> <?php echo $_GET['date'];?></span>

    <a href="index.php?<?php echo date?>=<?php echo $next_date;?>" ><img src="assets/images/rtarrow.png" width="28" height="12"></a> </span></h3>

  2. OK here is where I am now. I appreciate all of the help.

    But still no dates are passed in the url....its blank, like this.

     

    The links look like this..../index.php?date=

     

    Heres my code

     

    <?php

    $date = isset($_GET['date']) ? $_GET['date'] : date('Y-m-d');

    $previous_date = date('Y-m-d', strtotime($date .' -1 day'));

    $next_date = date('Y-m-d', strtotime($date .' +1 day'));

    ?>

     

     

     

    <a href="index.php?<?php echo date?>=<?php echo $row->$previous_date;?>" > Previous </a>;?> Todays Date <a href="index.php?<?php echo date?>=<?php echo $row->$next_date;?>" > Next </a>;?>

  3. So I now have this. But the links don't go to the next or previous day.

     

    The links look like this /index.php?date=<?=$next_date;?>.

     

    Where they should actually pass a actual date instead of "<?=$next_date;?>."

     

    <?php

    $date = isset($_GET['date']) ? $_GET['date'] : date('Y-m-d');

    $previous_date = date('Y-m-d', strtotime($date .' -1 day'));

    $next_date = date('Y-m-d', strtotime($date .' -1 day'));

    ?>

     

    <a href="?date=<?=$previous_date;?>">Previous</a>

    <a href="?date=<?=$next_date;?>">Next</a>

  4. Well I am pretty new to PHP So any other code will hep me.

     

    Ive started with this but how do I add code to the actual

    labels here

     

    < Previous Day - Wednesday January 23, 2013 > Next Day

     

    What code goes on < Previous Day and > Next Day?

     

    Heres what I have so far

     

    <?php

    $date = isset($_GET['date']) ? $_GET['date'] : date('Y-m-d');

    $previous_date = date('Y-m-d', strtotime($date .' -1 day'));

    $next_date = date('Y-m-d', strtotime($date .' -1 day'));

    ?>

  5. I have a page where the day and date is displayed like this.

     

     

    < Previous Day - Wednesday January 23, 2013 > Next Day

     

     

    How do I make it so when the userclicks on < Previous Day link that they go to Tusday January 22, 2013 and when they lick on > Next Day they go to Thursday January 24, 2013 etc?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.