PHP Problems inside of HTML file


#1

When i try to add <?php //script ?> it shows an error: https://i.imgur.com/IDmQPXf.png


#2

Also, when doing a basic form i get this: https://i.imgur.com/0cglmaz.png


#3

That’s a linting error. If you specify the file type as .php they’ll go away.


#4

The form screenshot shows so blurry I can’t read the error message. What error are you getting? Glitch is primarily for Node.js, so if you’re wanting to use PHP on Glitch I suggest remixing from an example app like https://glitch.com/edit/#!/lamp-poc


#5

I get “Method not allowed”.


#6

Make sure you have route defined for the HTTP method you are requesting.


#7

This is my index.html code:

https://pastebin.com/3CN5jjkd

And welcome.php:

https://pastebin.com/bMT1nLBc


#8

So, yea, it is defined. (post)


#9

Also, in a Node-sqlite/Node-app project, it says: “Cannot POST /fileName.php”


#10

Unfortunately you can’t just put PHP files in a Node app as it won’t work. As I mentioned in my first response, you’ll need to remix this PHP base project and add your files to it - https://glitch.com/edit/#!/lamp-poc


#11

Ok, thank you :).:sweat_smile: