Topic: formatting php so it looks nice
So I have made this login box using a tutorial by user ontap. It allows me to login to my punbb forum from anywhere on my site by having this login box always in the menu bar of my main site.
I am very happy with it except that when I include it in my html homepage it uglies up the look...is there anyway of formatting php functions like this....is there a way of previewing php without uploading it to a webserver. This would help.
I want it to be a nice looking login box not ust plain and ugly white and grey. And also to say login and logout next to each box.
any help would be great.
Cheers
Nick
<?php
function login_menu() {
global $pun_user;
if ($pun_user['is_guest']) {
echo "<form id=\"login\" method=\"post\" action=\"/pun/login.php?action=in\" onsubmit=\"return process_form(this)\">
<input type=\"hidden\" name=\"form_sent\" value=\"1\" />
<input type=\"hidden\" name=\"redirect_url\" value=\"".$_SERVER['SCRIPT_NAME']."\" />
<input type=\"text\" name=\"req_username\" size=\"25\" maxlength=\"25\" />
<input type=\"password\" name=\"req_password\" size=\"16\" maxlength=\"16\" />
<input type=\"submit\" name=\"login\" value=\"Login\" />
</form>";
echo '<a href="/pun/register.php">Need to register.</a>';
echo '<a href="/pun/login.php?action=forget">Forgot your password.</a>';
}
else {
echo "Logged in as: ".pun_htmlspecialchars($pun_user['username'])."
<br>Click <a href=\"/pun/login.php?action=out&id=".$pun_user['id']."&location_out=".$_SERVER['SCRIPT_NAME']."\">here</a> to log out.</div>";
}
}
?>
see my hack to integrate punbb with wordpress comment system.
Illustration Community