Can i write some html code inside php script.
would it be possible to display a html form using php
the reason i ask is because i want to have a log in formin an area of the home page that disappears and displays a welcome message when they user logs in along with diffent buttons and features availible to users
It'd need to be as a string, i.e. quoted, but yes. It'd also need to be on one line in the actual document though. New lines can be designated with \n if you want it to look neater in the source, or you can just use an echo statement for each line.
>I suck at this game, can you give me some pointers?
The easiest way - without having to echo yourself to death - would be:
PHP Code:
<?php
// Do whatever you want in PHP
echo "hello" . $name1;
echo "hello" . $name2;
echo "hello" . $name3;
// Then "break" out of PHP, back to straight HTML
?> <form method="POST" action="--WEBBOT-SELF--">
<p align="left">Username:<br><input type="text" name="Username" size="18"></p>
<p align="left">Password:<br><input type="text" name="Password" size="18"></p>
<p align="center"><input type="submit" value="Submit" name="B1"> <input type="reset" value="Reset" name="B2"></p>
</form>
<?php
// If necessary, "break" back in to PHP
echo "hello" . $name4;
echo "hello" . $name5;
echo "hello" . $name6;
?>
<!-- You can also do the same in a single line
<p align="left">Username:<br>
<input type="text" name="Username" value="<?php echo $UserName; ?>size="18">
</p>
<!-- You can also do the same in a single line -->
<p align="left">Username:<br>
<input type="text" name="Username" value="$UserName" size="18">
</p>
HTML;
It's a nice feature, I agree, but I prefer to use it only for simple text, as originally intended, as it can make life a little bit more difficult when debugging a script.
Bookmarks