Help - Search - Members - Calendar
Full Version: Date and inserting it in a database .
HTMLHelp Forums > Programming > Server-side Scripting
tudsy
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.
tudsy
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
I use the 'mail' command. I have never used 'imap_mail' so I can't help this time.
Christian J
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.
CharlesEF
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.