Is this code in unsafe? I'm pretty new to MySQL, and I don't want my site to get hacked... (I know I haven't connected to the db in the script- that's on purpose).
Any help would be greatly appreciated.
It's for a custom built member system. This particular script is to fetch and display information on members. The profile is accessed by going to profile.php?mode=view&id=64. I know that the script works, I just want to know if it's hackable.
Any help would be greatly appreciated.
| Code: |
| <?
require_once('/path/to/database/connect/file.php'); mysql_select_db("marston_memsys"); $result = mysql_query("select * from members"); $r=mysql_fetch_array($result); $userid = $r["user_id"]; $username = $r["username"]; $regdate = $r["user_regdate"]; switch($mode) { default: echo "Sorry! No content here..."; break; case "view": switch($id){ default: echo "non-existant member"; break; case $userid: echo '<a href="'.$userid.'">'.$username.'</a> - Member since: '.$regdate; break; } break; } ?> |
It's for a custom built member system. This particular script is to fetch and display information on members. The profile is accessed by going to profile.php?mode=view&id=64. I know that the script works, I just want to know if it's hackable.
