WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Kewl Date Example
Categories : PHP, HTML and PHP, Date Time, CSS, Beginner Guides Click here to Update Your Picture
tedd sperling
Date : Mar 09th 2006
Grade : 1 of 5 (graded 4 times)
Viewed : 13262
File : 4352.zip
Images : No Images for this code example.
Search : More code by tedd sperling
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

The following is simply a cool way to show a date.
Cut/paste as you neeed, but the code will run "as-is"
I have used the css ID "mydate" to position the date
display as needed. Move as you may.

To see a working example, please review:

http://www.xn--ovg.com/kewl_date

tedd


--- copy below "as-is" ----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
    <title>Stuff by tedd</title>   
<style type="text/css">         
#mydate
    {
    position: absolute;
    top: 10em;
    left: 10em;   
    }
       
table.date
    {
    font-size: small;    /*1em; */
    font-family: verdana, arial, helvetica, sans-serif;
    margin:auto;
    }

table.date th
    {
    font-weight:normal;
    text-align:center;
    }

table.date th.day
    {
    padding-right:0.5em;
    }

table.date th.month
    {
    padding:0.5em;
    }

table.date td
    {
    vertical-align:top;
    text-align:center;
    background:#CAD6E2;
    padding:0.4em;
    }   
</style>   
</head>

<body>

    <h1>tedd's kewl date</h1>
   
    <?php
   
        $date
= date('Y\-\ m\-\ d');       
       
$date = str_replace(" ", "", $date);
        echo(
"Date: " . $date. "<br/>" );
   
?>

    <div id="mydate">
       
        <table class="date" cellspacing="2" cellpadding="0">
        <tr>
        <th></th>
           
            <?php               
           
for ($i = 1; $i <= 12; $i++)
                {
                echo(
"<th class=\"month\">" . date("M", mktime(0, 0, 0, $i+1, 0, 0 )));
                }
           
?>
               
        </tr>
        <tr>
            <th class="day">
           
            <?php                 
           
echo(date('Y') . "</th>");               
            for (
$i = 1; $i <= 12; $i++)
                {
                echo(
"<td>");
                if(
date('m') == $i)
                    {
                    echo(
date('j'));
                    }
                echo(
"</td>");                   
                }               
           
?>
           
        </tr>
        </table>                               
   
    </div>

</body>
</html>



Simple PHP control CSS Calendar
Categories : PHP, HTML and PHP, Calendar, Date Time, CSS
Find if a year is leap.
Categories : PHP, Date Time, Beginner Guides, Data Validation
Count Number Of weeks in Month
Categories : PHP, Date Time, Beginner Guides
How to Create a Shoutbox Using PHP & MySQL
Categories : PHP, MySQL, Web Applications, Beginner Guides, HTML and PHP
Newbie Notes #9 - Hyperlinking a post
Categories : PHP, Java Script, HTML and PHP, Beginner Guides
Dynamic CSS generation for multiple website colouring schemes.
Categories : PHP, CSS, HTML and PHP
Simple Javascript CSS Digital Clock
Categories : Java Script, Date Time, CSS, Beginner Guides, Web Design
PHP based HTML rabbing Tools
Categories : PHP, HTML and PHP, Tag Extractors, Regexps, Beginner Guides
If you want to create select buttons featuring current date this example will show you how...
Categories : Date Time, HTML and PHP, PHP
Creates three SELECT form fields: Month, Day, and Year. You give it a string which will be used to make the name for the three fields, and a number of seconds to use as the default date. If you give it blank for this value, the current date is used.
Categories : HTML and PHP, PHP, Date Time
How to preset a text string in a textarea input field
Categories : HTML, HTML and PHP, PHP, Beginner Guides
CSS style switcher
Categories : PHP, CSS, HTML and PHP, Arrays, Sessions
Using PHP im HTML image tags
Categories : PHP, HTML and PHP, Graphics, Beginner Guides
PHP alternating the colors of table rows with style.
Categories : PHP, HTML and PHP, CSS
Customizable Calendar Class
Categories : HTML and PHP, Date Time, PHP, PHP Classes, Calendar
 Ioannis Cherouvim wrote :1629
Try refactoring your code using some http://www.weberdev.com/for loops.