Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




How Do You Make A Date Change Automatically Every 3 Months Please?


I am making a site with PHP. I have a section of the site where I want to display a piece of text (a date). I want that piece of text to change 4 times a year (every three months).

How do you do this with PHP please?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Change Modified Date Automatically
on my website my index page is php, and I update some of the content on a daily basis, I use a news script, but this does not update the pages actual "Date Modified"

I want to be able to have this as always changing as my content is too, I dont want search engine spiders thinking that I do not update my content..

so rather than manually opening my pages then re-saving them is there any way to automatically do this?

How To Populate Selects With Years=>months=>days That Dynamically Change?
What I'm thinking of doing is in my admin page have three different selects. They will form the day of sales at my shop.

-YEAR- -MONTH- -DAY-

The years will have 2002 -> 2005 and the months will be the 12 months of the year of course but I need the number of days to change with the particular month selected.

Automatically Make Text Into A Link
how do I make php search through a $_POST[variable] for a certain set of string, lets say R1000000.  Then I would want to turn that string (R1000000) into a link
<a href=example.php?id="R1000000">R1000000</a>Then append that link back into the original $_POST[variable] replacing the R1000000, with the link version. I'm sure this is doable, I just have no idea where to start, regex?

Automatically Change To Display The Next Record
I have a page which displays a single record on a page each time from a mysql database. there are 10 records in total in the database.

What I would like to do, is rather than have the user click a link to display the next/previous record I would like the record to be displayed for a certain length of time (say 20 seconds) and then automatically move on to display the next record. When it has reached the last record, I would like it to loop round again from the start.
Any ideas on the best way to achieve this?

How To Automatically Make URLs Posted In A Forum Active Links?
I've been working on modifying a forum script for some time now and its almost ready to go. You can test it at http://www.designlaunchpad.com/forum if you like. The one additional feature I want to implement is the automatic creation of a link when someone posts a URL in their message. Most forums have this, is it that tough to add in? I'm pretty comfortable editing PHP and understanding what is happening where but I suck at authoring it. I checked the manual at php.net and tried searching this forum and google but keep running into dead ends. So can someone offer me some suggestions or point me toward some help?

Automatically Adding 90 Days To A Date?
I have a php script that processes a form and enters data into a mySQL database. Two of the fields that are entered are dates. One - when it was processed (I use the now() function) and one that would be an expiration date. I am using datetime field types in mySQL.

I need to automaticall add 90 days to the expiration date. Is there a way to do this that is easy like NOW() + 90 days or some thing.

Mkdir() How Do I Automatically Make A Index File And A Css File
using mkdir() how do i automatically make a index file and a css file. what i really mean is once the directory has been made how do i make it so i have a index and css file there, its just because im making a forum hosting service and i need all the files automatically set up in the directory. how can i do this?

How Do I Make The Date Appear Only Once Each Day?
I'm new to coding so pardon me if this is a simple questions. On my blog, I'm trying to get the date to appear once per day with all posts under that date appearing underneath the date. Does anyone know how I could accomplish this?

Change DATE Order
I like to enter a date in this format: 010103 (for day-month-year) To get it right in my database it has to be 030101 (y-m-d) otherwise it will show me 0000-00-00. How do I do that ? And if I do a SELCT. How to change the result 2003-01-01 to 01-01-03 on the screen.

How Can I Change A File's Date?
I think this must be easy but, alas, I can't find it!
Is there any function I can use to change a file's date/time?

Change Date Format
I would like to know how to change the date format in 31-JUL-2007 to 07-31-2007?

Make Today's Date Bold?
I'm currentlty studying on zend's calendar tutorials. How do I get today's date to be in bold? PHP Code:

Change Date String To Adapt To Existing
I need to change the date format from a table that got it's date from a different souce. This format looks like this: 6/1/2007 15:26:00 It needs to look like this 2007-06-01 15:26:00. What PHP function would i use for this and how would it be done? This is the last step to a month long project I have been working on and it needs to be completed very soon.

Change $row['date'] To $date
When writing the code to display the mysql_fetch_assoc results I'd like to remove the $row[''] portion and just leave it as a variable like this: $date, $numid, $text and on and on. For the life of me I can't remember how to do it... even though I know I looked at this last week sometime.

How To Make MYSQL Query To Sort The Articles By Date ??
I am developing a site using PHP and MYSQL where i can post articles. Each Article has features like author, date, data etc... I want to find out top 5 recent articles.

I store the date of an article in database as  $timeStamp = Date("F j, Y");

when i make a query to retrieve the latest article by date as:

$result = mysql_query("SELECT * FROM postData ORDER BY postDate DESC LIMIT 0, 5");

it doesn't give any output...

Get "Months Between" Using Only Months And Years
I'm planning a form that takes Work History detail. Of course two of fields in this form are "From" and "To". For this project, the client doesn't need to know the "From" Day, or the "To" Day. He just wants to capture from "2003-07" to "2006-09" for example.

My problem is, without using the entire date string "2003-07-07 / 2006-09-01" how does one go about accurately determining the number of months between the two year/month pairs? Is this possible, or do I have to capture the full date?

No Libphp4.so File Created In Make Intstall Or Make.
I have done a make, and a make install on the 4.3.6 version, using
/usr/local/etc/php as the directory I make from. However, no matter what
I do, I do not see a php4lib.so that has been created. The documentation
I recieved (an IBM source) says that the following has to be added to the
httpd.conf file :

LoadModule php4_modulelib/apache/libphp4.so
..
..
..
AddModule mod_php4.c

here is the output from my make install :

[root@mail php]# make install
Installing PHP SAPI module: cgi
Installing PHP CGI into: /usr/local/bin/
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - already installed: 1.1
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR - already installed: 1.3.1
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] DB - already installed: 1.6.2
[PEAR] HTTP - already installed: 1.2.2
[PEAR] Mail - already installed: 1.1.3
[PEAR] Net_SMTP - already installed: 1.2.3
[PEAR] Net_Socket - already installed: 1.0.1
[PEAR] XML_Parser - already installed: 1.0.1
[PEAR] XML_RPC - already installed: 1.1.0
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
program: phpextdist

Print Last 6 Months
I know you can get the current month using data("m"); How can I output the last 6 months (numeric value "m" and text representation "M") from the current month including the current month. Have tried a few solutions but falling down when current month is for example 2 it should print out:

2- Feb
1 - Jan
12 - Dec
11 - Nov
10 - Oct
9 - Sept

PHP Numbers To Months?
I'm creating a calendar type thing. The variable $month will be a value ranging from 1-12. I need somehow to translate 1, the first month, in january - 2 into february - 3 into march etc.

It auto increases so i cant just change the value to jan, feb. $month has to server two purposes and i dont know how to get it to turn "1" into "january".

Months Dropdown
I'm looking to do a dropdown with the months in the year starting with this month and going on for 12 months, ie. the selected month is April 2007 and the last month is March 2008, does anyone know how to do this using PHP?

Last 3 Months Dropdown
I need to come up with something that will take the current month, for example this month is april.
It would create a drop down list like

Feb 1 - feb 30
march 1 - march 30
April 1 - April 30
Basically the last 3 months, including this one.
Then I am going to need to save the month as the value, so I can pass it to the script so I know what date ranges I am looking for.
I can't think of a logical way to do this, and still account for the fact that some months have 29 days, some have 30, and some have 31.

Months Diference Between Timestamps
How can I get the enlapsed months, complete months between two timestamps (Unix timestamps)? is there any function that'll help me ? or what aproach should I use?

MYSQL - Select XX Months
I have a database set up, with one of the fields is a month -

"200611" = November 2006
"200610" = October 2006
"200609" = September 2006

I was wondering, I know how to sort descending etc.. - Is there a way,
to (add to an existing search criteria).. select all records in the
last XX months..

IE, If I only wanted the last 2 months, it will only select records in
October & November 2006....

or September also - if I want 3 months...

(I have records going back to April 2006)

Im guessing the 'unique' function will be used, but im not sure how to
select XX months.....

Display 11 Consecutive Months
I need to display 11 consecutive months from any given month so something like $current_ month + 11 would give me Nov 2002-Oct 2003. Code:

Number Of Months Between 2 Dates?
i have my dates in timestamp in mysql, please provide code to get the number of months between these 2 days, i've already been searching on the internet for hours.

Storing Months In Mysql 4
I'm using PHP 4 and MySQL 4. I want to store the month and year
as a single row but I am having difficulty figuring out the best data
type to use. I suppose I could use 'DATE' and then always have the day
value be equal fto 1, but I figure there's a more elegant approach. I
leave it to on e of you experts to recommend one.

Drop Down List With Months
I am trying to create a drop down list that has December 2006 as the first option and then goes up month and years till the current month and year (September 2007).

Days Based On Months
I am trying to modify some code so that the days dropdown has the correct amount of days for each month( Jan - 31 days, Feb 28, etc). I managed to get it so the correct days appear however it lists all the days. Code:

List All Months Since YYYY-MM-DD
How can I print in a list format, all the dates since 2006-12-01 up to today, for for example

December 2006
Janurary 2007
February 2007
March 2007
April 2007

and then as we get into a new month, it would be added onto the bottom. I'm sure ive asked this before but I cant seem to find the post or example I saved.

Finding Months With Data
I have a simple 'blog' database table containing content with the posted date entered as date (yyyy-mm-dd).  Some months there will be many items, some months there may be none.

Can I generate a list of months where there is at least one item, without lots of separate queries? If so, how?

Drop Down List Of Months
I am trying to create a drop down list with 12 months as the contents. I need to be able to determine what the latest month is and then put the 11 months before into it (in the correct order). For example, it is September 2007 obviously at the moment, so that will need to be the last and latest month in the list. The other 11 will be in reverse order going back to August 2006.

Calculate Years And Months Of Service
I have each employees hire date stored in date format in MySQL (YYYY-MM-DD) and would like to calculate how many years and months of service they have.  The output would be like: Years of Service: 7 yr and 2 mo How would I go about doing this calculation?

Calculate Future Months [Reference Correction]
that ref fails for me after being googlegroupbeta'd... hopefully,
try this: http://groups.google.com/groups?th=613f743e0cf622f3

Selecting Rows Between Dates (years And Months)
How do I query the database to select all the data from say, March 2007? There is a "date" column .

How To Change One Page To Change All?
i need to know how to create a page where i only have to change one thing on one page so it changes that text or image on every page of my site. in other words i want to be able to create a template, so if i do want to vchange something in the duture, i only have to change on page, instead of changing each individual page.

PHP Add Crontab Automatically
I need to create an install file, the purpose is that user don't have to go to CPANEL and add CRON JOBS manually. I need one file, that add CRON JOBS automatically without log into CPANEL.

Here is my function :

function addLynxCron() {
$time = time();
//dump crontab list to text file
$command1 = "crontab -l > ./tempCronLynx$time.txt &";
exec($command1);
chmod ("./tempCronLynx.txt", 0777);
$forFile = "";
$url = $_SERVER['SERVER_NAME'];
$path = $_SERVER['PHP_SELF'];
$cronCommand1 = "lynx -dump */15 * * * * http://$url/cron.php";
$cronCommand2 = "lynx -dump */15 * * * * http://$url/email_cron.php";
$forFile .="$cronCommand1";
$forFile .="$cronCommand2";
$fp2=fopen("./tempCronLynx2$time.txt", "w");
fwrite($fp2, $forFile);
fclose($fp2);
//create new cron jobs
$command1 = "crontab tempCronLynx2$time.txt ";
exec($command1);
echo "crontab successfully added.";
}

The function above is not working...

when I check the file tempCronLynx2$time.txt is correctly written with the
cron jobs I want. But it failed when added the new cron jobs using that files

$command1 = "crontab tempCronLynx2$time.txt ";
exec($command1);

anyone please help with this problems...

Run Program Automatically
I want to create the option for my clients to create their own e-mail address. When I do this in Telnet, I have to run the command 'vadduser' It then asks me for a username, I want to assign this automatically. (1,2,3,4 etc etc)

It then asks me for a password, I want this to be something the user has already given in a form (before the script was run). It then has to be retyped. Those two things can be done automatically. It then asks if I want to assign a disk quota (YES) and then asks for the number of megabytes (1) That's it. Are there any examples available of how to do this?

Best Way To Automatically Log Out After Certain Time
What is the best practice for automatically logging out users after certain amount time after the last page request?

Is this a php job or a javascript job? It seems that javascript can't be relied on, and that php might have to store something in a database.

Perhaps the php version could use a $_session var. I could be reset every page request and compared. But then that wouldn't change the browser display. Maybe a mixture of php and javascript?

Automatically Add Slashes
Is there a function that automatically adds the extra slashes needed for html inside echo statements and such? It's a real pain to go back and edit. There has to be an easier way besides using template systems.

Automatically Thumnailing
I am writing a PHP script that can automatically thumnailing an image.

How To Automatically End A Session ?
how to automatically end a session ? i want the session to end automatically instead of the user clicking on log out ? how do i run session_destroy(); automatically ?

Automatically Update .zip?
Is there a way to make a dynamic zip file that updates along with changes to a folder? I have a folder with about 75 images that grows/changes every other day,and I'd like to offer them as a download. My problem is that I don't want to waste time manually doing this, so is there a PHP way to do it (or any other language, if not PHP)?

Automatically Adding 1
I have created a database for a house points system. Everything is working fine, but there is one thing I can't do. I want to be able to click a link, and for the person to have 1 point added to them. It goes like this so far: Code:

How Do I Reduce An Image Automatically?
I did a script that generates a thumb of the normal image( is not well a thumb, why the image is great ), but the matter is that I catch the image size, I multiply by 70 and divide for 100 to generate an image a little smaller of the original. That I happens wanted this image was generated with a maximum size.

Example: If I have an image with 1536px and do that process, she stays with 1075px. But I wanted her to get at most with 500px. How Could I do that?( If I decrease the 70 the smaller images stay very small )

Looping Through Incrementing Automatically
Before I ask its propably best to show you my code PHP Code:

Automatically Check Email Acc
I am still looking for a script (preferably PHP) that automatically POPs (checks) my email account every 20 minutes and sits serverside.

How To Automatically Link And Shorten Url??
I know how to automatically link the url. I saw the past log and figured it out. PHP Code:

Automatically Linking URL's
When somebody enters info into a form on my page how do I make the script I am using automatically make URL's into links?

Automatically Print The Corresponding Value In The Same Page
i have 5 sets of text boxes in the table. what i was thinking to happen is like, when i input something in the text box 1, and hit a certain key (tab-key or whatever key), it'll automatically check the database, and when it reaches it's corresponding value, the value will be printed out in the same page i'm accessing.. and then, i can type again to fill other text boxes.


Copyright © 2005-08 www.BigResource.com, All rights reserved