Date and inserting it in a database . |
Date and inserting it in a database . |
tudsy |
Oct 18 2016, 12:22 PM
Post
#1
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Hi
I have a problem with inserting the current date and time into a database from a script. $datetime=strtotime($MYSQLDateResponse); $dateof =date("Y-m-d-H-I-s",$datetime); Thanks. This post has been edited by tudsy: Oct 18 2016, 12:22 PM |
tudsy |
Oct 18 2016, 02:51 PM
Post
#2
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Hi
The problem has been solved. Thanks. A new problem. Is this code correct? <a id= 'download' href="" onclick="Send_Email();"><p align='center' id='dlink'></p></a> and the function is as follows: <?php function Send_Email(){ $to = "tudsy@ecovib2d.com.au"; $subject = "Graphic"; $message = $_POST['email'].' has bought a graphic'; $header = " From ECOVIB2D :"; imap_mail($to,$subject,$message,$header); $to = $_POST['email']; $subject= "Graphic"; $message = 'To '.$_POST['email'].' Thank you for buying a graphic'; $header = " From ECOVIB2D: "; imap_mail($to,$subject,$message,$header); }; ?> The variable $email is found in a form. Thanks. |
CharlesEF |
Oct 18 2016, 07:05 PM
Post
#3
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
I use the 'mail' command. I have never used 'imap_mail' so I can't help this time.
|
Christian J |
Oct 18 2016, 08:19 PM
Post
#4
|
. Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 |
Is this code correct? No, the onclick event calls client-side javascript. You can't call a server-side PHP function like that. Frankly I'm surprised that you make mistakes like that. Client-side and server-side are fundamental distinctions that you absolutely need to understand before writing any PHP. |
CharlesEF |
Oct 18 2016, 10:22 PM
Post
#5
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Is this code correct? No, the onclick event calls client-side javascript. You can't call a server-side PHP function like that. Frankly I'm surprised that you make mistakes like that. Client-side and server-side are fundamental distinctions that you absolutely need to understand before writing any PHP. |
Lo-Fi Version | Time is now: 27th April 2024 - 02:11 AM |