Ask coding questions

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

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
timmy_i_chen (1151)

We made some updates to PHP (well, we made two new "languages"): - New and improved PHP language for command line interface shenanigans. Supports multiple files and syntax highlighting. - PHP Web servers! Just like other hosted repls, this allows you to write websites using PHP.



Hello! I am not sure how I could send forms in the PHP Web Server. When I do it, the email is not getting sent for some reason. Could you please help me with this? Thanks!

HappyFakeboulde (237)

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 (2)

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

HappyFakeboulde (237)

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