Just wondering if any of you knew of a way to trap the <!-- #BeginDate
format:Am1 -->April 4, 2006<!-- #EndDate --> (Dreamweaver's
Auto-Update-on-Save Date Code) into a PHP variable and still have the
Date update on save? Or really any way to have a variable with the
updated date stored when the file is saved is what i'm looking for,
this just seemed like a possible solution.
Something to the effect of:
<?php
$saved_date = '<!-- #BeginDate format:Am1 -->April 4, 2006<!-- #EndDate
-->';
?>
or
<?php
$saved_date = ' ?> <!-- #BeginDate format:Am1 -->April 4, 2006<!--
#EndDate --> <?php ';
?>
But Dreamweaver skips over the code when it's embedded in the php in
the first example, and the second i'm sure would cause a compile error. 5 8041
<? ob_start();?><!-- #begin dreamweaver stuff --><?
$date=ob_get_clean() ?>
Though, its sketchy that dreamwaver will parse the stuff. I've never
gotten it to work reliably, sometimes it works, sometimes it doesn't.
I just stick a 'last updated' variable at the top of the file or very
bottom so i don't forget. You could also using the 'last modified'
file attribute, but that might be altered by other things. mb*******@gmail.com wrote: Just wondering if any of you knew of a way to trap the <!-- #BeginDate format:Am1 -->April 4, 2006<!-- #EndDate --> (Dreamweaver's Auto-Update-on-Save Date Code) into a PHP variable and still have the Date update on save?
Why bother? Just use the file system functions:
$saved_date = date('F j, Y', filectime(__FILE__));
Cheers,
NC
On Tue, 04 Apr 2006 20:47:10 -0700, NC wrote: Just wondering if any of you knew of a way to trap the <!-- #BeginDate format:Am1 -->April 4, 2006<!-- #EndDate --> (Dreamweaver's Auto-Update-on-Save Date Code) into a PHP variable and still have the Date update on save?
Why bother? Just use the file system functions:
$saved_date = date('F j, Y', filectime(__FILE__));
But you probably want to use filemtime not filectime. The date of the
last save, not the date the file was created on.
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer http://www.gphpedit.org | PHP editor for Gnome 2 http://www.andyjeffries.co.uk | Personal site and photos
ah! exactly what i was looking for, but i wasn't even aware of the
filetime commands. thanks.
Andy Jeffries wrote: On Tue, 04 Apr 2006 20:47:10 -0700, NC wrote: Why bother? Just use the file system functions:
$saved_date = date('F j, Y', filectime(__FILE__)); But you probably want to use filemtime not filectime.
You're right... Where was my head? :)
The date of the last save, not the date the file was created on.
On this one, though, I think you're a bit off... On most Unix systems,
there is no such thing as file creation time. There is only the time
of last file change; a file is considered changed when its inode data
(permissions, owner, group, etc.) is changed.
Cheers,
NC This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Richard Hollenbeck |
last post by:
I'm trying to write some code that will convert any of the most popular
standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan
1908) and compare the first with the second and...
|
by: Gale |
last post by:
OK...I hope I explain this clearly:
I have a report to run everyday for the previous day's work. In the
main table, I have the date auto populate with =date()-1 that
will give me the...
|
by: buck |
last post by:
I'm working on a helpdesk database - does anyone know how to auto enter
the date in a new record; would it be soemthing like iif field is null
auto enter?
|
by: Edwin Knoppert |
last post by:
I would like to instruct a grid which autofill's the columns to exclude time
or date from a date field when date or time is 0.
Date and time can be stored in a date field, my grid shows for...
|
by: musosdev |
last post by:
Hi guys
I'm having a problem with DateTime.Now.ToShortDateString().
It works fine, but I've got 2 servers (development and production), and
while the production server works perfectly and...
|
by: rashidaa |
last post by:
How can I auto increment date in MS Access.
I have a form in which I collect following data
Range: From >> to
Start Date:
Now I wish to populate/append a table after I specify the start date...
|
by: bml337 via AccessMonster.com |
last post by:
I need to create a supervisory log for my clients. The log table has the
following fields date, checkbox and notes. now for the tricky part... one
log is weekly and should be generated every...
|
by: dozingquinn |
last post by:
Hello,
Is there any way to auto populate the user defined date range into a report? I currently have the criteria "Between And " for a date range field. This prompts the user to enter a date...
|
by: awojciehowski |
last post by:
I am working with a database now and need some guidance.
I am attempting to input an auto calculation. I have the ability to enter a date in a text box on a form. I want to be able to have...
|
by: disney86 |
last post by:
I am setting up Forms in Access 08. I have a form which when opened will auto insert the current time and current date. I need to be able to allow the user to set up paramaters to auto select a...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |