well no coz i use caps
mehhhh
Printable View
Not standards.. <?php looks more professional.
You mean mysql_fetch_array(), you don't need capitals.. it looks like crap :P
If you're going to play with capitals, use the camel method, $this->fetchArray, $this->mysqlQuery, $this->numRows
First word lowercase, second word uppercase.
Still looks awful, not aligned at all :P Looks like my pre-2006 coding.
I preferPHP Code:$this->db->runResults();
Well since most of my applications are centered around the database, I just usually extend my core from the database, that way I can manage it, but your way is just as easy.
Have some clean code.
PHP Code:<?php
$connection = mysql_connect( "", "", "" );
mysql_select_db( "", $connection );
$id = $_REQUEST[ 'id' ];
switch( $id )
{
default:
if( $_SESSION[ 'zetolic_user' ] )
{
$select = mysql_query( "SELECT * FROM `users` WHERE `username`='$_SESSION[zetolic_user]'" );
$fetch = mysql_fetch_array( $select );
echo "<center><font face='verdana' size='1'>
<b>Welcome,<a href='?page=member&id=" . $_SESSION[ zetolic_user ] . "'> $_SESSION[zetolic_user]</b></a><br>
Current Zoints: <b>$fetch[coins]</b><br><br>
<a href='?page=function&id=trade'>Trade Zoints</a><br>
<a href='?page=function&id=profile'>Edit Profile</a><br>";
if( $fetch[ rank ] == 3 )
{
if( $_SESSION[ zetolic_admin ] )
{
echo "<a href='?page=admin&id=list'>UserList</a><br>
<a href='?page=admin&id=search'>Search Users</a><br>";
}
else
{
echo "<a href='?page=admin'>Admin Login</a><br>";
}
}
echo " <a href='?page=function&id=logout'>Logout</a>
</font></center>";
}
else
{
echo "<center><font face='verdana' size='1'><form action='?page&id=login' method='POST'>
Username :<br><input name='zetolic_user'><br><br>
Password :<br><input type='password' name='zetolic_pass'><br>
<input type='Submit' value='Login'></form><br><br>
<a href='?page=register'>Register</a></font></center>";
}
break;
case "login":
$user = $_POST[ 'zetolic_user' ];
$pass = md5( $_POST[ 'zetolic_pass' ] );
$select = mysql_query( "SELECT * FROM `users` WHERE `username`='$user' AND `password`='$pass'" );
$count = mysql_num_rows( $select );
if( $count == '0' )
{
echo "<meta http-equiv='REFRESH' content='0;url=?'>";
echo "<center><font face='verdana' size='1'>Invalid Username/Password</center></font>";
}
else
{
echo "<meta http-equiv='REFRESH' content='0;url=?'>";
echo "<center><font face='verdana' size='1'>Loggining in</center></font>";
$_SESSION[ 'zetolic_user' ] = $user;
}
break;
}
?>
As I said, I'm not willing to spend time cleaning up his code if it's crappy :P just got rid of the 6 miles of white spaces you quite rightly pointed out and cleaned up his connection and echo spacing.
@Jack - capitals doesn't look professional, looks like you're a shift abusing learner. As denta said if you want to use caps go to the scrappy method of using $this->
@Jew - please tell me you were bored.
What program:P