Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML and PHP in one file

Tags:

html

php

mysql

I'm a PHP newbie trying to sort some basics out. I have a user-form that leads to a mysql select query, which works fine. Every tutorial I have found so far has the standard form tag, ie: action='script.php' method='post'. This obviously opens script.php in a new tab/window though.

If I don't want to display what's fetched from my db on a different webpage I have to put the html and php in one document together. I didn't think this is how you would really want to do it though.

My specific question is when you want to display stuff on the same page do you just put everything in together within one document and let users hit the submit button?

like image 471
acl77 Avatar asked Aug 13 '26 21:08

acl77


1 Answers

NO you dont put your php scripts on the same page as your html file/s

Try this link for your reference =)

like image 175
Kim Oliveros Avatar answered Aug 16 '26 12:08

Kim Oliveros



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!