Diligent web site
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

il y a 5 ans
il y a 5 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # diligent-site
  2. Diligent web site
  3. Pre-requirements:
  4. * installed wamp server (https://sourceforge.net/projects/wampserver/)
  5. * installed git (https://git-scm.com/downloads)
  6. 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.
  7. 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)
  8. First of all, this project contains the following file types:
  9. 1. Type of file which sends an email
  10. 1. **contact_form.php** - sends email from homepage contact form and
  11. 1. **job_apply.php** which sends email from apply form),
  12. 1. Type of file which is included in every single page
  13. 1. **header.php** which is included in the top of the body and
  14. 2. **footer.php** which is included in the bottom of the body
  15. 1. Regular type of PHP file (the rest).
  16. **Sending email**
  17. This project uses PHPMailer 5.2.0
  18. For email sending, needed to make an instance of PHPMailer and use method *send* from that class.
  19. Before that, needed to setup email:
  20. ```$mail = new PHPMailer(); //make instance of PHPMailer
  21. $mail->IsSMTP(); // telling the class to use SMTP
  22. $mail->SMTPSecure = "tls"; // enable SMTP authentication
  23. $mail->Host = "smtp.site.com"; // sets the SMTP server
  24. $mail->Port = 587; // sets SMTP port
  25. $mail->Username = "yourname@yourdomain"; // SMTP username
  26. $mail->Password = "yourpassword"; // SMTP password
  27. $mail->SetFrom("sender@gmail.com", "Sender"); //set email which sends a message
  28. #add attachment to email
  29. $resume_file = $_FILES["resume-file"];
  30. $data = substr($resume, strpos($resume, ","));// everything except header of document
  31. $filename = $resume_name; //fileName
  32. $encoding = "base64"; // encoding type
  33. $type = substr( $resume , 6 , strpos($resume, ";") - 5); // type of document
  34. $mail->AddStringAttachment(base64_decode($data), $resume_name, $encoding, $type); //add attachment
  35. $mail->Subject = "Subject"; //add subject
  36. $mail->Body = "Message"; //add message
  37. $mail->AddAddress('reciever@gmail.com', "Reciever"); //add email which recieves message
  38. $mail->IsHtml(true); //enable html message instead of text
  39. $mail->send(); //send email```
  40. When 'resume-file' is sent using POST method, it can be found in FILES array, but other parameters can be found in POST array
  41. When input (type file )is used in html form, needed to add enctype="multipart/form-data" and setup:
  42. contentType: false, cache: false, processData:false, url: "myscript.PHP?call=upload" ('?call=upload' added after script name) in ajax submit
  43. There are three the most important variables in header.php. They used for paths.
  44. 1. backToRoot is used for back to the root folder where there are index.php, portfolio.php, etc.
  45. 2. backToRootIndustries is used for navigation to the industries folder
  46. 3. backToRootServices is used for navigation to the services folder.
  47. 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
  48. For checking validation of file, needed to use (https://www.freeformatter.com/html-validator.html)
  49. 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.
  50. 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