Citefy-Landing_page/Models/HomeModel.php
// Public function to submit the form
Public function to submit the form
Public function to submit the form
public function submitForm() {
        $this->formErrors = false; 
        $sql = 'INSERT INTO cl_preSignups (email, signupTime) values (?, ?)';
        $sqlData = array($this->userEmail, (new DateTime())->getTimestamp());
        global $queriesModel;
        $statement = $queriesModel->pdoStatement($sql, $sqlData);
        if ($statement->errorCode() != "00000") { 
            $this->submissionErrors = true;
        } else {
            $this->submissionSuccessful = true;
        }
    }
public function submitForm ( ) { $ this -> formErrors = false ; $ sql = 'INSERT INTO cl_preSignups (email, signupTime) values (?, ?)' ; $ sqlData = array ( $ this -> userEmail , ( new DateTime ( ) ) -> getTimestamp ( ) ) ; global $ queriesModel ; $ statement = $ queriesModel -> pdoStatement ( $ sql , $ sqlData ) ; if ( $ statement -> errorCode ( ) != " 00000 " ) { $ this -> submissionErrors = true ; } else { $ this -> submissionSuccessful = true ; } }
Public function to submit the form
Public function to submit the form
// Resetting errors to false // Creating mysql statement and the data to go into it // Execute the query // Checking if the statement was successful