PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
its not printing anything because $_POST['text'] does not exist. The reason is that the <p> html tag is not a form element and won't be "submitted". You need to put it in a form field. Try changing the
But is there a way of displaying "Hello world" as text that actually shows up in the page?
I don't want the text to be in a form, but I need it so people can see it, so it can't be hidden.
Any more suggestions?
The whole point of using $_POST (or $_GET, for that matter) is to obtain data from the user, so there's no point in not using a form, allowing the user to enter or change what is passed to the next script. If you already know what you want the script to use, just code that in the script. It sounds like you're learning to use PHP (good for you, it will be very valuable to you, I'm sure), so I strongly recommend that you learn what the purpose of each part of the language is, not reinforce incorrect ideas.