Jump to content

4 Misc PHP Date Segments - Got Scriptz? Can I haz?


Jumpy09

Recommended Posts

I know I am suppose to search first, but I'm already behind schedule and could use some ease of mind.  I'm basically spending a good portion of my time spamming through Google and Forums to find what it is I need, and I decided to just toss most of it in a forum and see if anyone would be willing to either send me in the right direction or toss me a line and post the code.  I am seriously crammed right now and really could use the lifeline.

 

Here are the following things I am currently needing / working on:  Could I get these in the MM / DD / YYYY Format?

 

1. Date Script: Dynamic Drop Down which Automatically Changes based on date.  Year must be - 18 because the website I am working for isn't going to be intended for minors, even though it's not a pornographic site.

 

2. Age Script: Dynamic Script to find the difference between that date a user puts in and the current date to find an age.  It can be a script or SQL code, I'm having problems manipulating some of the functions I have found to do the job.

 

3. Zodiac Script: Dynamic Script to take specific birthdays and determine which Zodiac Sign it fits under.  Nothing too fancy needed, just for it to function.

 

4. Birthday Script:  If it's not too much to ask for, think I can snag a script which will alert people of birthdays coming up 5 days prior and stop alerting the day after?  It's not 100% Needed, but as far as what I am doing is basic php, mysql, and advanced html.    I'm kind of limited on what I can do.

 

Currently I think that is all I need.  I have the rest of the profile, profile update codes completed.  This date thing is giving me a headache, and I really don't want to have to go in and alter them every year.  I don't really need Month / Day, but if they came Dynamic, it would cut down a ton of code.  Of course I could always use a table for it, dynamic and short on code :P.

 

Oh, if anyone is really bored and wants to help me work on my website... That would be vastly appreciated.  No Payment can be made currently, but once the website is up and running we can work something out.  It's really a trust thing, I trust your code and you trust I will keep my word.  :P  Work would entitle scripting Functions based on what I need them to do and scripts which are a bit out of my league.  I'm wanting to code most of it specifically for the site, and some scripts I can use.. and others I can't.  This isn't needed, I just thought I would throw it out there.   

 

Thanks in advanced, and yes... I know "USE THE SEARCH".  I can't seem to find exactly what I need because there are literally millions of scripts all having to do something different with date() or dates.  So if you wish to flame, I understand and I promise not to hold it against you... I'll just annoy you by accepting everything you dish.  Most people on here are really helpful, so I don't see this being a problem.

 

 

 

I'll post that part in the Freelance Section.  I'm sure the birthday scripts have been written before, and just need direction to them if anyone knows.

 

If I can't get an answer in another hour, I'll ask a moderator to move my topic.... if they wouldn't mind.

 

I just saw php, never thought of putting it in the Freelance section.

 

Well how bout this?

 

    <%
    ' DYNAMIC DROP DOWN BOX FOR YEARS 
    ' PROGRAMMER: Anthony J. Biondo Jr.
    ' Website: http://www.chernoblechicken.c
    '     om
    '
    ' Description: Think about this. You hav
    '     e a school or business, and want a user 
    '     to input the year they worked there or a
    '     ttend classes. 
    ' I have scripted a simple solution to a
    '     llow a programmer to setup a start year 
    '     and the script will fill in the years. F
    '     or example: If my
    ' business started in 1978 and I wanted 
    '     to put a form out on the web that would 
    '     be there for surveys. The form would be 
    '     used year after year.
    ' I would have to remember to go back in
    '     the form each year and add the new year,
    '     for example 2000, 2001. This script will
    '     automatically make
    ' the updates for you. It seems like a s
    '     mall script, but think of how many hours
    '     are spent updating pages, and think of t
    '     he benefits of never 
    ' updating drop downs years again. 
    '
    ' SETUP VARIABLES
    	myStartYear = 1978		' YEAR To START COUNT FROM
    	myYearToday = year(now())	' THIS YEAR CALCULATED
    	respyear = myStartYear		' SETTING EQUAL To TEMP VARIABLE SO WE DON'T TRASH OUR STARTING VALUE
    ' CALCULATE THE DIFFERENCE IN YEARS AND 
    '     SET TO A TEMP VARIABLE
    yearDiff = int(myYearToday) - myStartYear
    response.write "<Select name='myYear'>"
    response.write "<OPTION value='0' selected>----</OPTION>"
    For i=0 To yearDiff
    	response.write "<OPTION value='"&respYear&"'>"&respYear&"</OPTION>"
    	respYear = respYear + 1
    next
    response.write "</Select>"
    %>

 

That is for the Year in ASP.  Unfortunately I am not running ASP.net on my computer.  So... I was looking for it in either Javascript or PHP.  Wouldn't the Month and Day be possible to do in a similar script?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.