SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2007
    Location
    London, United Kingdom
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question PHP date and time question

    Hi

    I am trying to create a date input field which is hidden on one of my forms - which would instead of allowing you to input anything would read the date and time from the server and then post that result along with the rest of the form data back to me, like a time stamp. Could anyone explain to me how this might be done, or what code i require?

    Many Thanks

    Mark Stille

  2. #2
    SitePoint Evangelist barbara1712's Avatar
    Join Date
    Apr 2007
    Location
    India
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $date1=date('m-d-Y H:i:s'); 
    <input type="text" value="<?=$date1?>" readonly />
    Barbara

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2007
    Location
    London, United Kingdom
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by barbara1712 View Post
    PHP Code:
    $date1=date('m-d-Y H:i:s'); 
    Where do I put the PHP code in the HTML page and do I put it between <?php> tags?

    thanks

    Mark

  4. #4
    SitePoint Evangelist barbara1712's Avatar
    Join Date
    Apr 2007
    Location
    India
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok.Simply write following

    <input type="text" value="<?=date('m-d-Y H:i:s');?>" readonly />
    Barbara

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2007
    Location
    London, United Kingdom
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by barbara1712 View Post
    Ok.Simply write following
    Hi Barbara

    Thanks for the quick reply, your solution worked great!

    I have made a form that is designed for mobile phones and I now need some php code that would be able to log the mobile number and phone browser info etc.

    Do you know of any script that might perform this function?

    Many thanks

    Mark Stille


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •