Skip to content
Sign upLog in
← Back to Community
how to connect php to html
Profile icon
ChezCoder

how can I connect a PHP file to an HTML,CSS,JS web file?
I tested it on PHP web but it just runs the PHP even without clicking the submit button...
can I just set the ACTION attr on an HTML input element to the link of the REPL php?:

<form action='replink.php' method='post'> <input name='test'> <input type='submit'> </form>
Voters
Profile icon
kingcoding595
Profile icon
ChezCoder
Comments
hotnewtop
Profile icon
[deleted]
  1. You need to be using the PHP Web template
  2. Form code needs to be on the index page
  3. Another page can pick up the submitted code using the $_GET or $_POST superglobal arrays

Have a look at this example: https://repl.it/@malvoliothegood/php-and-forms

Profile icon
Vandesm14

I don't think PHP works well with repl.it as of now. They're planning on getting it to work in the future.

Profile icon
MythicalFrog

@Vandesm14
, it is now replit.com :)

Profile icon
Vandesm14

@MythicalFrog
I know... This was from a year ago...

Profile icon
MythicalFrog