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?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Last Modified Date
Is there any way to access the last modified date of a page off your own domain?
Displaying Modified Date Of A URL File
I want to display a web page with links to various documents and display the date each document was last modified next to the link. I've found the filemtime command and that works quite nicely for "local" files. However, filemtime doesn't work if the file(s) are refered to by their URLs (which is how I need to do it). A comment on the manual page (http://www.php.net/manual/function.filemtime.php3) refers to having to use "Socket Operations" but the link posted with that comment doesn't work (it just goes to a page saying the website has been rearranged).
Modified Date For Alternative File
Is there a way to add the last modified date for an alternative file into another one? My problem is that when I use getlastmod it is looking at the date on a file that controls headers/background etc for the page, but not the file that is accessed during modification of the data. Is there any way to add a line of code to get the modified date from the data file?
Deleting Files In A Folder Modified Before Certain Date
I use a cache system that requires creation of files in a folder . Now , what i need to know is how can i delete files created say 3 days ago. So that the cache remains fresh. The directory contains around 20,000 files , about 10,000 are generated each day (if they dont exist) So getting info about the each file after using opendir will cause the server to slow down.
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?
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.
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.
Change Date Format
I would like to know how to change the date format in 31-JUL-2007 to 07-31-2007?
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.
Using Last-Modified
I want to use Last-Modified in a php script, but it doesn't seem to work somehow. i use the following code where $FileDate is a formated date like: Sun, 06 Nov 1994 08:49:37 GMT (RFC 822, updated by RFC 1123) if($HTTP_IF_MODIFIED_SINCE==$FileDate) { header("Status: 404 Not Modified"); die(); } header("Last-modified: ".$FileDate); header("Content-type: ".$FileType); print $FileData; somehow the server doesn't send the header, or the browser doesn't sent the If-Modified-Since header. I know for a fact that $HTTP_IF_MODIFIED_SINCE is the right variable to compare with. I use apache under linux (and mysql), am i forgetting something or do i have to set something in my conf file ?
Last Modified
I'm using a very simple Java Script that tells you the date and time the file was last modified. Code:
Getting The Last Modified Row In Mysql Db
Hello. I'm not sure if this should go in the MySQL forum but Oh well. Anyways I've got my webpage to display everything in my Databases table. I've use the following code-> <?php $linkID = @mysql_connect("localhost", "INSERT YOUR DB USERNAME HERE", "INSERT YOUR DB PASSWORD HERE"); mysql_select_db("INSERT YOUR DB NAME HERE", $linkID); $resultID = mysql_query("SELECT ibf_members.id, ibf_members.name, ibf_members.email FROM ibf_members", $linkID); print "<table border=1><TR><TH>ID</TH>"; print "<TH>Name</TH><TH>Last Name</TH></TR>"; while ($row = mysql_fetch_row($resultID)) { print "<TR>"; foreach ($row as $field) { print "<TD>$field</TD>"; } print "</TR>"; } print "</table>"; mysql_close($linkID); ?> But I want it to display the row that was modified last. I've searched through my php book and looked at all the commands it offers but I didn't find anything that would relate to what I want to happen. So I just want to know what the function is to display -- or at least dump the last modified row into a variable.
Another Last Modified Question
So a while back I started parsing .htm/.html files as php so I could include some php code snippets within my pages while appearing as static pages. With that I recently found that I no longer generate any cache headers. I did some research and found that I can include : <?php header("Last-Modified: " . gmdate("D, d M Y H:i:s", getlastmod()) . " GMT");?> at the top of every page. I then validate this with a header check tool online with a few pages I was testing on. While the last modified date does show now it NEVER returns a 304 which is the entire purpose of this. It is ALWAYS 200. Here is an example of my output from the test : #1 Server Response: http://www.foo.com/test.htm HTTP Status Code: HTTP/1.1 200 OK Date: Wed, 27 Dec 2006 07:24:39 GMT Server: Apache/1.3.36 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.2 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.27 OpenSSL/0.9.7a X-Powered-By: PHP/4.4.2 Last-Modified: Wed, 27 Dec 2006 07:15:07 GMT Connection: close Content-Type: text/html Now, shouldn't this be returning 304 to me after it has been cached locally on my machine? Second question - is it worth creating an etag along with this? What about some of the other cache controls out there? Basically, my only reason for this currently is to comply a little better and save some bandwith. My pages rarely change, but when they ARE updated I would like places like Google to know about it.
Get The TIME A File Was Modified ??
1st step - I can get the "current time" - $tr=time(); echo "TIME = $tr<BR>"; RESULT "TIME = 1135860780" OK... I CAN get the last time a file was last modified :- echo "FILe - '$file'<BR>"; if (file_exists($file)) { $ta=date ("F d Y H:i:s.", filemtime($file)); echo "The file was last modified: $ta<BR>"; } RESULT = "The file was last modified: July 30 2005 03:05:20." However - My problem.... i am having a problem - Converting the time shown above - into a UNIX timestamp... $taw = date('d/m/Y H:i:s', $ta) ; echo "Time Modified = '$taw'<BR>"; $taw=strtotime('$ta'); echo "Time Modified = '$taw'<BR>"; $taw=strtotime($ta); echo "Time Modified = '$taw'<BR>"; But the result I get is :-
If-modified-since HTTP Compliant!
is there a HTTP-compliant implementation of If-Modified-Since-, If-Match, If-None-Match, If-Range and so on? I want my PHP-script to act exactly as if it was a static HTML-page delivered directly from Apache. I think this isn't easy to implement, especially if you take also weak and strong validators into account.
Show When The Page Has Been Last Modified
1. I have php script that will show when the page has been last modified. How do I link it on my home page. The link that I am using now does not work. Here is the link: <? include("updatepage.php"); ?> 2. I have a php forum. When I link it this way <a href="xxxxx/index.php"> it brings up the source code. When I link it this way <a href="xxxxxx/"> it brings up the dir. When I link it this way <a href="http://xxx/xxxxx/index.php"> it works. How do I get it to work with this linking <a href="xxxxxx/index.php">
Header Last Modified Time
For some reason, when you view the http header info for my .php pages, it does not show a last modified date and time. So, thinking that I could create one, I tried this: <?php header("Last-Modified: ".filectime($_SERVER['PHP_SELF']); ?> but it doesn't work. Does anyone know how to do what I am trying to do?
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.
What Should I Use To Set Up Modified "Calendar" Form?
I have events that take place every Monday, Wednesday, Saturday, and Sunday, and I want to generate my copy--which is the same for most events--and my printed schedule from a php form. My plan is to first generate a form that lists pulldown boxes for each of those days in the next month--I could specify the month, but I don't think that fits my bill, and then utilize the pulldowns to set the events. However, I'm not sure where to begin to return just the days I need...should I use getdate() as my basis for this? From what I'm reading, it seems right, but I'm not sure.
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.
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 )
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.
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.
Automatically Detecting Tables In A Db
Is it possible to write a script that, when provided with a database, it will return all the tables names? I will go onto try and put together a script that will not only output the table names but also output the sql code required to CREATE the table (i.e. CREATE TABLE example (exampleid auto_increment not null primary key integer, name text, email text);) - Is this pretty simple to do? Are there any free scripts online that would do this?
Automatically Creating Pages
I was wondering how to , when a page gets filled up too much with comments by visitors, add the next batch of messages on a new page. For example, you know how this forum has a minimum post length for each page and then starts putting the newly created posts on a new page: how do you do that?
Add Backslashes To Every HTML Automatically?
Is it possible to add backslashes to every HTML and PHP special character automatically? There are many functions that do this partially, like "addslashes", and "quotemetadata", but isn't there a single function that does does it all?
Treemenu Append Automatically
Here i got a problem to append my treemenu file automatically. this mean that the user haven't need to click the main title of menu to display their subtitle(allow the user to done other funtions on it).
Automatically Reshuffling The IDs In MySQL?
Everytime I make a new table, I would firstly declare an ID field. (yeah I guess thats the root of the problem.) Take for example, we have 5 entries. If I delete entry 3, then the IDs will still be... 1 2 4 5 instead of getting the favoured 1,2,3,4 How, or what should I do to prevent this? I don't see any default ID fields in MySQL...is there any?
How To Automatically Display From A List Box?
I am working on a PHP/HTML form which supports End User queries. I need the user to select a combination of Airline and corresponding place of Origin. i,e Delta - Madison, Dallas, Atlanta KLM - Amsterdam, Houston, Detroit Brit - New York, London, Seattle I have a list of Airlines in a list box. The moment the user selects an Airline(Delta) from the List box, the list box below it needs to have (Dallas, Atlanta, Madison) as its options. How is this done? How do I use a listbox selection as a trigger an automatically start the next activity?
Automatically Send Email
Is it possible in php to automatically send an email out on someone's birthday? I mean without anyone clicking a button to do so? If so, please let me know.
Automatically Determine A Swf Dimensions
I am not sure whether you are actually able to retrieve the dimensions of a flash game from code. But is done seem that Miniclip.com are able to do it, but I am still not sure whether the dimensions are being retrieved from the database or not. Code:
|