0

I hosted my website on github.My contact form doesn't work.I used PHP and HTML to make it.Here are my php code lines

PHP:

<?php

if (isset($_POST['submit'])) {

    $name = $_POST['name'];

    $emailFrom = $_POST['email'];

    $mobile = $_POST['number'];

    $message = $_POST['message'];

    $mailTo = "vukstamenkovic9@zohomail.eu";

    $headers = "From: ".$emailFrom;

    $txt = "You have received an e-mail from ".$name.".\n\n".$message;

    mail($mailTo, $subject, $txt, $headers);

    header("Location: index.html?mailsent");
}

?>

When I want to contact,I always get this: 405 Not Allowed How can I resolve this?I searched it and nothing showed up.I would really appreciate help.

aynber
  • 22,380
  • 8
  • 50
  • 63
  • 1
    I don't think GitHub allows forms/POST requests or PHP, if that's what you're using. `GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, optionally runs the files through a build process, and publishes a website.` [src](https://docs.github.com/en/github/working-with-github-pages/about-github-pages) – aynber Jul 16 '20 at 11:53
  • This question is duplicated: https://stackoverflow.com/questions/27672315/do-github-pages-support-php – Apaxito Jul 16 '20 at 12:32
  • Does this answer your question? [Do GitHub pages support PHP?](https://stackoverflow.com/questions/27672315/do-github-pages-support-php) – Ruben Helsloot Jul 16 '20 at 13:13

0 Answers0