Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Adding security to a page
Old 05-05-2009, 09:57 AM Adding security to a page
Average Talker

Posts: 22
Name: john
Trades: 0
Hi, i just created a page where i can access my phpadmin through. the problem is that, it has no security, which means who ever know's the url: can abuse it.

is there a way for me to add something like "You are not admin."

Here's my script.

PHP Code:
<?php
$connect 
mysql_connect("localhost","root","pw") or die (mysql_error());
mysql_select_db("db")or die (mysql_error());
$Query mysql_query("SELECT * FROM members ORDER BY setname DESC");
?>

<head>
<title>Untitled Document</title>
</head>
<body>
<style type="text/css">
table {border-collapse:collapse;}
table td, table th {border:1px #000 solid; padding:5px;}
</style>
<table width="500" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
  <tr>
    <td>Edit</td>
    <td>Delete</td>
    <td>User ID</td>
    <td>Username </td>
    <td>Password</td>
    <td>wins</td>
    <td>loses</td>
  </tr>

<?php
while ($Result mysql_fetch_assoc($Query))
{
?>

  <tr>
    <td><a href="edit.php?uid=<?php echo $Result['id'];?>">Edit</a></td>
    <td><a href="delete.php?uid=<?php echo $Result['id']?>">Delete</a></td>
    <td><?php echo $Result['id']?></td>
    <td><?php echo $Result['setname']?></td>
    <td><?php echo $Result['password']?></td>
    <td><?php echo $Result['wins']?></td>
    <td><?php echo $Result['loses']?></td>
  </tr>

<?php
}
?>

</table>
</body>
</html>
microsoftx is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-05-2009, 11:13 AM Re: Adding security to a page
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
If it's just you accessing it, I'd recommend using htaccess for the password.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 05-05-2009, 02:18 PM Re: Adding security to a page
GeekSpecialties's Avatar
Super Talker

Posts: 132
Name: Leonard
Location: Minnesota, USA
Trades: 0
Here is a simple php password protect script.
I've used it in the past and was very simple to install and configure.

http://www.zubrag.com/scripts/password-protect.php
GeekSpecialties is offline
Reply With Quote
View Public Profile Visit GeekSpecialties's homepage!
 
Reply     « Reply to Adding security to a page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11243 seconds with 12 queries