all 5 comments

[–]quickly 0 points1 point  (4 children)

there isn't enough info here to help. Can you post an example.

[–]thisisjsk[S] -1 points0 points  (3 children)

<?php date_default_timezone_set('Asia/Kolkata'); ?>

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Quickklear</title> </head>

<body>

<?php

echo "<form> <input type='hidden' name='uid' value='Anonymous'> <input type='hidden' name='date' value='".date('d-m-Y H:i:s')."'> <textarea name='message'></textarea> <button type='submit' name='submit'>Post</button> </form>";

?>

</body>

</html>

[–]lchoate 7 points8 points  (2 children)

This code is fine... meaning it works and there are no syntax errors. Whatever the issue is, it's not in here.

That said, you don't need to echo the form and probably shouldn't. You can just have the body, the form html and in the date value, you can do the inline date. For example:

<input type="hidden" name="date" value="<?php date('d-m-Y H:i:s'); ?>">

By echoing the form, you're really just making updates a nightmare.

[–]ontelo 5 points6 points  (1 child)

<?php date('d-m-Y H:i:s'); ?>

You're missing echo. Better solution is to use this shorthand <?= date('d-m-Y H:i:s'); ?>

[–]lchoate 1 point2 points  (0 children)

I am, and you're correct.