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>";
}


}

?>
Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: formatting php so it looks nice

can you place the demo link...

God wisely designed the human body so that we can neither pat our own backs nor kick ourselves too easily

3

Re: formatting php so it looks nice

You are mixing up php and HTML a bit I think ...
why don't you create a nice looking form first, thn take that and incorporate it in your script?
That way you can preview it locally as well.

The German PunBB Site:
PunBB-forum.de