Ask coding questions

← Back to all posts
HTML Form and PHP
vincentcourtois (0)

Hello, i'm a student and i've been asked to make a website for a project. I would like to make a contact form on a website.

So i have a simple form to send an e-mail. I know i need to use PHP to process the data.

<form action="contact.php" method="POST" > I don't know how to call the contact.php to process the data. I tried to create in the website folder a file named "contact.php" but it doesn't work so i need to create a PHP Code, so another repl, how can i do to link the HTML to the PHP if it's two different repls ? I don't understand this part. Thank you
Commentshotnewtop
timmy_i_chen (989)

We made some updates to PHP (well, we made two new "languages"):

https://repl.it/languages/php_cli - New and improved PHP language for command line interface shenanigans. Supports multiple files and syntax highlighting.
https://repl.it/languages/php7 - PHP Web servers! Just like other hosted repls, this allows you to write websites using PHP.

Enjoy!

HappyFakeboulde (212)

Are you sure you need to use PHP? Can't you use another backend?
If you can use a different backend language, perhaps make a Python or NodeJS repl, set up Flask or HTTP respectively, and move the HTML files to there.
Then add some systems in the Python/NodeJS for handling the form.

vincentcourtois (0)

@HappyFakeboulde I found my answer thanks anyway, the PHP in JS,HTML,CSS Repls from repl.it is not supported yet...

HappyFakeboulde (212)

@vincentcourtois Yes
I'm trying to give you an alternative