nav33n 472 Purple hazed! Team Colleague Featured Poster

-796

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep.. Thats what window.opener will do..

nav33n 472 Purple hazed! Team Colleague Featured Poster

And

$result = mysql_query("SELECT * FROM images WHERE 'Broad1'='$thumb_name'");

Should be

$result = mysql_query("SELECT * FROM images WHERE Broad1='$thumb_name'");

No quotes around Broad1.

Ah! correct.. I couldn't spot that one!

kevin wood commented: very helpful +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

Everything is correct.. But this is wrong.

$result = mysql_query("SELECT * FROM images WHERE 'Broad1'='$thumb_name'");
{
echo $row;
echo "<br />";
}
?>

This should be

$result = mysql_query("SELECT * FROM images WHERE 'Broad1'='$thumb_name'");
$row= mysql_fetch_array($result);
echo $row['Broad1'];
echo "<br />";
?>
nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Sam :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hello Mark! Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

you can do the same thing by putting echo :)

echo "success!";
echo "<meta http-equiv=\"refresh\" content=\"2;url=redirectpage.php\">";

This will redirect the script to redirectpage.php after 2 seconds.

More about meta refresh/redirect here.

nav33n 472 Purple hazed! Team Colleague Featured Poster
nav33n 472 Purple hazed! Team Colleague Featured Poster

:) cool !

nav33n 472 Purple hazed! Team Colleague Featured Poster

It displays thrice because its looping three times. You can do it this way.

<?php
mysql_connect("localhost", "root", "1234") or die(mysql_error());
mysql_select_db("userlist") or die(mysql_error());
$name=$_POST['name'];
$password=$_POST['password'];
$query = "SELECT * FROM user where username='$name' && password='$password'"; 
$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0){
	echo "Success!";
}
else
{
	echo "Sorry! Wrong name!!";
}
?>
nav33n 472 Purple hazed! Team Colleague Featured Poster

When the user types username and password, why not check if that exists in the table, rather than get all records and then check ?

$name=$_POST['username'];
$password=$_POST['password'];
Ie., $query = "select * from user where username='$name' and password='$password'";

Then check if this returns more than 1 row. If it does, then the username and password is valid. Else, invalid username and pass.

nav33n 472 Purple hazed! Team Colleague Featured Poster

echo '<form action="<?php $PHP_SELF; ?>" method="POST">';

This is wrong. Use this instead. echo '<form action='.$_SERVER['PHP_SELF'].' method="POST">';

nav33n 472 Purple hazed! Team Colleague Featured Poster
nav33n 472 Purple hazed! Team Colleague Featured Poster

Instead of $row = mysql_fetch_array($result) use, while($row = mysql_fetch_array($result)) {
AND

 echo "Thanks for logging in.";
 header("http://www.google.com");

will give you an error because you can't output anything before header function. Either echo a message or redirect the user. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

-791

nav33n 472 Purple hazed! Team Colleague Featured Poster

-786

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Ajay :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb twojays :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Welcome 2bu !

nav33n 472 Purple hazed! Team Colleague Featured Poster

-784

nav33n 472 Purple hazed! Team Colleague Featured Poster

-782

nav33n 472 Purple hazed! Team Colleague Featured Poster

no problem with the upper, managed to solve myself. Thank you very much for your reply.

Can you tell us how you solved your problem ? Maybe it will help someone else having the same problem :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. Maybe theres something wrong with your script ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

There is NO default config.php and database.class in php. :)

Sulley's Boo commented: eyse hee -_- meri marzi mote .. +5
nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome !