Nikola Ignjatovic ff49eb2b91 added Services image | 3 年之前 | |
---|---|---|
.vs | 4 年之前 | |
PHPMailer_5.2.0 | 3 年之前 | |
customizer | 4 年之前 | |
documents | 3 年之前 | |
images | 3 年之前 | |
industries | 3 年之前 | |
scripts | 3 年之前 | |
services | 3 年之前 | |
styles | 3 年之前 | |
teams | 3 年之前 | |
webfonts | 3 年之前 | |
README.md | 3 年之前 | |
apply.php | 3 年之前 | |
careers.php | 3 年之前 | |
contact_form.php | 3 年之前 | |
footer.php | 3 年之前 | |
header.php | 3 年之前 | |
index.php | 3 年之前 | |
job_apply.php | 3 年之前 | |
portfolio.php | 3 年之前 | |
style.css | 3 年之前 |
Diligent web site
Pre-requirements:
* installed wamp server (https://sourceforge.net/projects/wampserver/)
* installed git (https://git-scm.com/downloads)
When the WAMP is installed, click the WAMP server icon > Apache > httpd.conf, then change the line Listen 80 to Listen 8080 or any port you want.
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:
Type of file which sends an email
Type of file which is included in every single page
header.php which is included in the top of the body and
footer.php which is included in the bottom of the body
Regular type of PHP file (the rest).
Sending email
This project uses PHPMailer 5.2.0
For email sending, needed to make an instance of PHPMailer and use method send from that class.
Before that, needed to setup email:
```$mail = new PHPMailer(); //make instance of PHPMailer
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPSecure = "tls"; // enable SMTP authentication
$mail->Host = "smtp.site.com"; // sets the SMTP server
$mail->Port = 587; // sets SMTP port
$mail->Username = "yourname@yourdomain"; // SMTP username
$mail->Password = "yourpassword"; // SMTP password
$mail->SetFrom("[email protected]", "Sender"); //set email which sends a message
#add attachment to email
$resume_file = $_FILES["resume-file"];
$data = substr($resume, strpos($resume, ","));// everything except header of document
$filename = $resume_name; //fileName
$encoding = "base64"; // encoding type
$type = substr( $resume , 6 , strpos($resume, ";") - 5); // type of document
$mail->AddStringAttachment(base64_decode($data), $resume_name, $encoding, $type); //add attachment
$mail->Subject = "Subject"; //add subject
$mail->Body = "Message"; //add message
$mail->AddAddress('[email protected]', "Reciever"); //add email which recieves message
$mail->IsHtml(true); //enable html message instead of text
$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 input (type file )is used in html form, needed 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
There are three the most important variables in header.php. They used for paths.
1. backToRoot is used for back to the root folder where there are index.php, portfolio.php, etc.
2. backToRootIndustries is used for navigation to the industries folder
3. backToRootServices is used for navigation to the services folder.
styles/custom.css is a file which uses developers to add a new feature to the website, style.css is used for bug fixing in old style
For checking validation of file, needed to use (https://www.freeformatter.com/html-validator.html)
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. That very important for SEO, when someone create new page on website.
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 needed to add one html element for captcha above the submit button. Define id for that element and custom attribute data-sitekey=“site_key”, where sitekey is google captcha key. After that at the end of custom.js file (before onloadCallback function) add new function for verification and call it in onloadCallback function