Procházet zdrojové kódy

Added readme.md file

master
Nikola Ignjatovic před 5 roky
rodič
revize
2f040f461a
1 změnil soubory, kde provedl 15 přidání a 38 odebrání
  1. 15
    38
      README.md

+ 15
- 38
README.md Zobrazit soubor

@@ -19,33 +19,25 @@ When the WAMP is installed, click the WAMP server icon > Apache > httpd.conf, th
Go to (http://176.104.105.124:3000/diligent/diligent-site.git/), clone this repository to www folder of WAMP server and run a website from a browser with localhost:defined_port/index.php (ex: localhost:8080/index.php)



First of all, this project contains the following file types:

1. Type of file which sends an email

1. ##contact_form.PHP## - sends email from homepage contact form and

1. ## job_apply.PHP## which sends email from apply form),

1. Type of file which is included in every single page

1. header.php which is included in the top of the body and

2. footer.php which is included in the bottom of the body
1. Type of file which sends an email
1. **contact_form.PHP** - sends email from homepage contact form and
1. **job_apply.PHP** which sends email from apply form),

1. Regular type of PHP file (the rest).
1. Type of file which is included in every single page

1. **header.php** which is included in the top of the body and

2. **footer.php** which is included in the bottom of the body

Sending email
1. Regular type of PHP file (the rest).

**Sending email**

This project uses PHPMailer 5.2.0

This project utilizes PHPMailer 5.2.0

For email sending, needed to make an instance of PHPMailer and use method ##send## from that class.

For email sending, needed to make an instance of PHPMailer and use method *send* from that class.

Before that, needed to setup email:

@@ -66,9 +58,6 @@ Sending email
$mail->SetFrom("sender@gmail.com", "Sender"); //set email which sends a message





#add attachment to email

$resume_file = $_FILES["resume-file"];
@@ -81,37 +70,25 @@ Sending email

$type = substr( $resume , 6 , strpos($resume, ";") - 5); // type of document

$mail->AddStringAttachment(base64_decode($data), $resume_name, $encoding, $type); //add attacment



$mail->AddStringAttachment(base64_decode($data), $resume_name, $encoding, $type); //add attachment


$mail->Subject = "Subject"; //add subject



$mail->Body = "Message"; //add message



$mail->AddAddress('reciever@gmail.com', "Reciever"); //add email which recieves message

$mail->IsHtml(true); //enable html message instead of text


$mail->send(); //send email ```

$mail->send(); //send email

```



When 'resume-file' is sent using POST method, it can be found in $_FILES array, but other parameters can be found in $_POST array


When 'resume-file' is sent using POST method, it can be found in $_FILES array, but other parameters can be found in $_POST array

When input (type file is used) in html form, need to add enctype="multipart/form-data" and setup:
When input (type file is used) in html form, need to add enctype="multipart/form-data" and setup:

contentType: false, cache: false, processData:false, url: "myscript.PHP?call=upload" ('?call=upload' added after script name) in ajax submit

@@ -125,4 +102,4 @@ For checking validation of file, needed to use (https://www.freeformatter.com/ht

Every single page uses keywords (diligent, software, development, company, it, and specific words for that domain). It is located in meta (keywords) in the head of the document

In order to use google captcha in html form, needed to include <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" ></script> after including ##custom.js## script, after that need to add one html element for captcha above the submit button. Define id to that element and data-sitekey="site_key", where sitekey is google capctha key. After that at the end of custom.js file (before onloadCallback function) add new function for verification and call it in onloadCallback function
In order to use google captcha in html form, needed to include <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" ></script> after including **custom.js** script, after that need to add one html element for captcha above the submit button. Define id to that element and data-sitekey="site_key", where sitekey is google capctha key. After that at the end of custom.js file (before onloadCallback function) add new function for verification and call it in onloadCallback function

Načítá se…
Zrušit
Uložit