+ 1

How to use php

Im taking the php course and it doesnt mention where could php be writen, is it like js could i write it in note pad and just include it in the html file like this :<?php src='my.php' php> whats the right way to use it?

14th Jul 2019, 8:55 PM
Deleted
Deleted - avatar
7 Antworten
+ 1
It can be written where you would write html. Difference being that to start and end html, you use "<html>" and "</html>". For php you start and end it with "<?php" and "?>" (not including " ") Just remember that you have to save your files as .php. Also, dont worry about the filetype as it won't change how you write normal html and css in there.
14th Jul 2019, 9:39 PM
MarkusS
MarkusS - avatar
+ 1
No , it needs a compiler. You may use xampp or wampp for creating localhost on your computer or laptop and put your programs on it and open them by localhost address (127.0.0.1) in a browser
14th Jul 2019, 9:01 PM
Ali Shekari
Ali Shekari - avatar
+ 1
I could send you my first ever php document that I got. It helped me getting started ny showing some simple php variables inside an already good html file
14th Jul 2019, 10:18 PM
MarkusS
MarkusS - avatar
+ 1
Yeah you do. Late reply since i forgot it was in another language, heh.. But here you go. Pastebin.com/A3RGnihA
14th Jul 2019, 10:43 PM
MarkusS
MarkusS - avatar
+ 1
That's cool help alot thankyou man
14th Jul 2019, 10:46 PM
Deleted
Deleted - avatar
+ 1
I can see now that you'll get a few errors, but hopefully you'll see where they are and why
14th Jul 2019, 10:46 PM
MarkusS
MarkusS - avatar
0
MarKusS yes that would be nice What about a form? Do i just do action ='file.php' ??
14th Jul 2019, 10:20 PM
Deleted
Deleted - avatar