I have a registration form that loads into a dava.csv file (code below). I want to add a time/date stamp so that each time someone registers, the last column in the spreadsheet shows the time/date. I've tried several things but all have failed and the form stops working. I'm taking classes this fall on programming but need to do this now, unfortunately. Any help? :confused:
[PHP] <?php
@extract($ POST);
if(is_writable( 'data.csv'))
{
$fp = fopen('data.csv ','a');
$content = "\"$fRSVP\",\"$ fRepName\",\"$f RepTitle\",\"$f Lunch\",\"$fPre fix\",\"$fFirst Name\",\"$fLast Name\",\"$fTitl e\",\"$fCompany \",\"$fAddress\ ",\"$fCity\",\" $fProvince\",\" $fPostalCode\", \"$fTelephone\" ,\"$fFax\",\"$f Email\r\n"
fwrite($fp,$con tent);
fclose($fp);
header("Locatio n: return URL");
}
else
{
echo'File is not writable';
}
?>
[/PHP]
8 4557
Do you mean like: - $DateTime = strftime("%d/%m/%Y %H:%M:%S", time());
(gives you e.g. 04/08/2006 00:13:15) and then adding $DateTime to your string?
Ronald :cool:
Banfa 9,065
Recognized Expert Moderator Expert - $DateTime = strftime("%d/%m/%Y %H:%M:%S", time());
You don't need that call to time, if you leave it out PHP assumes NOW - $DateTime = strftime("%d/%m/%Y %H:%M:%S");
I was going to suggest
Where do I place the date stamp? Yesterday I tried putting it after email and before the /r/n but caused the form to stop working. I want the date stamp to appear at the end of each row (each row contains one registrant).
Thanks!
This almost worked - the form functioned but I got a () as a result - at least I'm closer.
\",$today()\r\n ";
If $today is your string holding the date/time-stamp, you don't specify the parentheses, just $today
Ronald :cool:
",\"$datetime=n ow()\",\r\n";
This is now working but gives me the info in seconds. However, I can use Excel to translate for the date. Still don't know how to get both the date & time except to repeat the code and use Excel for time translation for the second entry. I suspect there is a better way.
Just figured out that the code works perfectly for time/date just by choosing the right cell formatting in Excel. YIPEEEEEEEEF! TTFN.
Well, Good Luck!
Ronald :cool:
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Don |
last post by:
Hi all,
With regards to the following, how do I append the datetimestamp to
the filenames in the form? The files are processed using the PHP
script that follows below.
Thanks in advance,
Don
Following running on client-side:
|
by: Des |
last post by:
I am trying to write a date and time stamp to a file
Date("d-m-y") is ok but time(void) gives me 1124528448
Can I format time into a H:M:S format
Desmond.
|
by: Mike Charney |
last post by:
Is there a way to check a files date and time stamp from VBA in access.
I have a need check a date stamp on a file that I am importing.
Thanks in advance,
Mike
m charney at dunlap hospital dot org
|
by: phried1 |
last post by:
I have created a form and inserted the following tables:
Date Entered
Time Entered
Date Modified
Time Modified
Essentially how and where can I have these dates and times recorded so when the user creates a new record that date and time stamp is populating as well as if the user modifies the data, that date and time stamp is populationg.
Whereby if the record was created yesterday, and the user modified the record today, i would see...
|
by: Susan Bricker |
last post by:
Greetings. I have a report (actually all of my reports in an MDB) that
I want to date/time stamp at the bottom.
Previously, I had used the builtin function of Now(). I thought that
would give me a date and time value in the format: "month day, year
hour:minutes:seconds". However, I noticed that only the date was
printing (e.g.; January 23, 2006). This is in Access 2000.
BTW ... The way I display the date/time stamp in a text field...
| |
by: pob |
last post by:
I currently have a procedure that loops thru a recordset to determine
what files need to be loaded to my database. The naming convention of
the files has always been accounts.txt, namelist.txt, etc. Within the
procedure I also validate that the file loaded to the server was loaded
within the current day. Everything has run smooth for quite some time
using this method.
Now the vendor has told me he has choice, but to the send the file...
|
by: SilentThunderer |
last post by:
Hey folks,
Let me start out by letting you know what I'm working with. I'm building an application in VB 2005 that is basically a userform that employees can use to "Clock in". The form allows the employee to enter their UserID and select "Login" or "Logout" and then click a submit. When the submit button is clicked, I want the application to dum the NT Userename, UserID, status (Login or Logout) and a date/time stamp into an MS Access...
|
by: Shane |
last post by:
I'm writing a program for renaming my picture files, and I want to use
the picture time stamp as a prefix to the file names. I can get the
time stamp, but it is extraordinarily slow! I have about 250 pictures
in the directory. In debug mode, I can populate the names in a
listview in less than two seconds. If I add a column with the time
stamp as a string, the listview takes about 70 seconds to populate in
debug mode. I haven't made and...
|
by: trytobreak |
last post by:
Hi All,
I am a network administrator in a fairly large software company and I
would like to write myself a small utility, which would connect (one
by one) to all machines on the network and get their current date and
time stamps.
This is mostly because of coming DST changes and having hundreds of
machines on the network, I don't want to connect remotely to every and
each server to see if the time is correct.
|
by: 6afraidbecause789 |
last post by:
Hi - I am using a Date/Time Picker popup form for users to choose a a
date and time for use on a separate entry form. The date/time on the
entry form is actually entered automatically as a date/time stamp when
a user enters a record. So, the popup form is only necessary when a
user needs to change the date/time.
To make this more user-friendly...there will be times when a user will
be away from the computer, and therefore, will 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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |