Hi there,
I wrote this code to mae it so that in the form before it that the user said their username and then on this page it matches up the username with the username on the database and then uses the password of that users as $password. I am new to php and i thought that this would do the trick. But it doesn't. Instead of printing the password it prints "Resource id #6".
Here's the code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Radio Ilam | Radio of the Suburbs</title><meta name="keywords" content="music note, free template, website template, CSS, XHTML" /><meta name="description" content="Music Note - free CSS template provided by templatemo.com" /><link href="templatemo_style.css" rel="stylesheet" type="text/css" /><style type="text/css">
.style1 {
text-align: center;
}
.style2 {
font-weight: bold;
color: #C32929;
}
.style3 {color: #FF0000}
td {padding: 2px; vertical-align:top; border-top: 1px solid #CCC;}
</style></head>
<body>
<?php
// Connects to your Database
mysql_connect("removed", "removed", "removed") or die(mysql_error());
mysql_select_db("a1408362_data") or die(mysql_error());
//checks cookies to make sure they are logged in
if(isset($_COOKIE['ID_my_site']))
{
}
$username = $_COOKIE['ID_my_site'];
if ($username <> "administrator")
{ header("Location: members.php");
}
else {}
?>
<div id="templatemo_container_wrapper">
<div id="templatemo_container">
<div id="templatemo_header">
<div id="templatemo_site_title">Radio<span class="style2">Ilam</span></div>
<div id="templatemo_site_slogan">Radio of the Suburbs</div>
</div>
<div id="templatemo_menuleft"></div>
<div id="templatemo_menu">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="competitions.php">Competitions</a></li>
<li><a href="#">Lates Music</a></li>
<li><a href="#" class="current">Members</a></li>
<li><a href="#">Listen Live</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
<div id="templatemo_content">
<div id="templatemo_left_column">
<div class="templatemo_section2">
<h1>Administrator</h1>
<p>Welcome
<p><a href="logout.php">Logout</a></p>
</div>
<br />
</div>
<div id="templatemo_right_column">
<?php
$username = $_REQUEST['catergory'] ;
$password = mysql_query("SELECT password FROM users WHERE username = '$username'");
echo "$password"
?>
<h1>User</h1>
<p>
</p>
</div>
</div>
<div id="templatemo_footer">Copyright © 2009 RadioIlam<a href="#"></a></div>
</div>
</div>
</body>
</html>
Help with captcha script needed
Hello, I am working on a script where reCAPTCHA or a similar form of CAPTCHA will be used, for the sake of this example I will talk about reCAPTCHA. I wanted to know how I could have the reCAPTCHA
How to generate a text file using php...?
Hi, Can anyone give me code to generate a text file using phpThanks in advance
Question about the upload of large files
Hi there,I have a question about the upload of large files, like videos (files generally above 20Mo).Is it better to use the FTP functions of php or the normal upload fonctions using additional
close site for maintenance
i get a tutorial, saying the following code can put our site offline, and only the developer can view the siteCode: [Select]RewriteEngine OnRewriteBase /RewriteCond %{REMOTE_ADDR}
List/Menu Box
On an edit page when you want something to select what a user has previously selected from the database, how would you do this for a List/Menu box? The only way I know how is Code: <?php echo
question about n
I was looking at some of the things you could do with php and one of the things I have tried is \n.used this wayCode: [Select]while(list($key, $val) = each($myArray)){ echo "$key =>
remove innitial
and
tagsi am using tiny_mce as a text editor for my CMS.buy now the problem is it add <p> tag with dataso while retrieving the data for front end i get an extra space. so there is any why that i
Show message after entering data
Hello Colleagues I would like to display messages after entering the data example: " data were successfully " or " Error send data" in advance thanks.
Is there a quick way to do this?
Hi all,I need to create a mysql table from php that goes a little something like thisid, name, total, place1today, place1yersterdayhowever place1today and yersterday need to goto place2, place3 upto
Most basic form question ever?
Hello,I want to use this snippet to make sure the fields in a form are ok before processing it.Code: <FORM method="post">To:<input type="text"