Hiển thị kết quả từ 1 đến 6 / 6
  1. #1
    Tham gia
    08-08-2004
    Bài viết
    4
    Like
    0
    Thanked 0 Times in 0 Posts

    Hàm kiểm tra dữ liệu nhập vào kiểu Date/Time trong PHP

    Các đại ca cho mình hỏi trong PHP hàm kiểm tra dữ liệu nhập vào kiểu Date/Time là hàm gì vậy?
    Xin cám ơn
    Quote Quote

  2. #2
    Tham gia
    23-02-2003
    Location
    Melbourne
    Bài viết
    5,201
    Like
    0
    Thanked 24 Times in 18 Posts
    Chă'c là ..... if .... else wa' . Bạn thử mở Manual ra xem phần Date/Time đi.

  3. #3
    Tham gia
    31-03-2003
    Location
    Nhà
    Bài viết
    327
    Like
    0
    Thanked 1 Time in 1 Post
    Kiểm tra? Dữ liệp nhập thế nào chứ?

  4. #4
    Tham gia
    08-08-2004
    Bài viết
    4
    Like
    0
    Thanked 0 Times in 0 Posts
    Tức là khi người nhập dữ liệu sai định dạng ngày tháng năm thì không cho Update vào CSDL

  5. #5
    Tham gia
    29-02-2004
    Location
    TPHCM
    Bài viết
    78
    Like
    0
    Thanked 1 Time in 1 Post
    You will have got 3 forms, it used to input: date, month and year!

    Validate a date/time
    int checkdate (int month, int day, int year)

    Returns true if the date given is valid; otherwise returns false. Checks the validity of the date formed by the
    arguments. A date is considered valid if:
    • year is between 0 and 32767 inclusive
    • month is between 1 and 12 inclusive
    • Dayis within the allowed number of days for the given month. Leap years are taken into consideration.
    Or Compare it with time()

  6. #6
    Tham gia
    31-03-2003
    Location
    Nhà
    Bài viết
    327
    Like
    0
    Thanked 1 Time in 1 Post
    Hix, lỡ nó chọn ngày 30-2 thì sao huh? Cái đó còn đỡ, lỡ 29-2?

Bookmarks

Quy định

  • Bạn không thể tạo chủ đề mới
  • Bạn không thể trả lời bài viết
  • Bạn không thể gửi file đính kèm
  • Bạn không thể sửa bài viết của mình
  •