Suppose I have something like this:
<form method=get action="token.php">
<b>Enter token:</b><br>
<input type="text" name="token"><BR>
<input type="submit" value="Submit">
</form>
And after the user enters the token, he is taken to a new page that displays the results of running token.php. How do I edit this new page? What if I want to enter another form in it?
I am just learning these things(complete beginner).
Thank you very much
P.S. Can I add something like this in the middle of the .php file?
<html>
<form method=get action="myPhp.php">
<b>Enter data:</b><br>
<input type="text" name="data"><BR>
<input type="submit" value="Submit">
</form>
</html>
What would the correct syntax look like?
There are two major ways to add HTML code to your PHP file.
First things first: All PHP code has to go in between
<?phpand?>. After a?>and before a<?php, you can write HTML code which will then be outputted without going through any PHP code.Another way to output HTML is by simply using
echoin PHP.That line of code will print a bold “Hello world!” message on your page.
Anyway, with all due respect, I think I can tell from your question that you do not fully grasp the concept of PHP and HTML just yet. Before trying to use PHP I recommend you try to do some PHP tutorials — it’s a whole other language than HTML, and knowing HTML does not mean you’ll be able to work with PHP right away.