The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Date and inserting it in a database .
tudsy
post Oct 18 2016, 12:22 PM
Post #1


Advanced Member
****

Group: Members
Posts: 166
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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
tudsy
post Oct 18 2016, 02:51 PM
Post #2


Advanced Member
****

Group: Members
Posts: 166
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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Oct 18 2016, 07:05 PM
Post #3


Programming Fanatic
********

Group: Members
Posts: 1,587
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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 18 2016, 08:19 PM
Post #4


.
********

Group: WDG Moderators
Posts: 8,077
Joined: 10-August 06
Member No.: 7



QUOTE(tudsy @ Oct 18 2016, 09:51 PM) *

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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Oct 18 2016, 10:22 PM
Post #5


Programming Fanatic
********

Group: Members
Posts: 1,587
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



QUOTE(Christian J @ Oct 18 2016, 08:19 PM) *

QUOTE(tudsy @ Oct 18 2016, 09:51 PM) *

Is this code correct?

No, the onclick event calls client-side javascript. You can't call a server-side PHP function like that.
Good catch, It never occurred to me that he would try calling PHP from Javascript!

QUOTE(Christian J @ Oct 18 2016, 08:19 PM) *

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.
I agree.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th March 2019 - 01:20 PM