Sending Info from IE Window to IE Window and MySQL prob!!
Hey... Im tyrign to make an MP3 player for the broadband part of my site, however, although i can make it play MP3s, i want to be able to get the MP3 Selection window to make the Actual Site window play te music, if you understand what i mean ? If not then i will try to simplyfy it (but that wasnt simple ;))....
1.Person Opens MP3 Window from site, 2 windows open.
2.Cliick the song they want to play, and click Play in the MP3 window.
3.All i need now is the MP3 window to change a variable in the main window, so the loop thats checking to see if the variable has changed, notices, and thus changes the song accordingly..
So all i really need is a way of chaging a variable from 1 window to another :)
The MySQL problem is weird, i don tknwo why it wont work.....
Code:
if (isset($_POST['submit'])) {
$link = mysql_connect("localhost","username","password");
if(!$link) die ("couldnt connect to $link");
mysql_select_db("abunting", $link);
$query = "SELECT 1 FROM site_members WHERE Alias='$alias' AND password='$password'";
$result = mysql_query($query, $link) or die(mysql_error());
if($result == 1) {
print " ".mysql_result($result, 0)." the username and password you entered was correct";
} else {
print " ".mysql_result($result, 0)." the login you entered or the password you entered is incorrect";
}
}
surely result becomes 1 if the login and password are correct, but this doesnt seem to work!
Thanks
Re: Sending Info from IE Window to IE Window and MySQL prob!!
Quote:
Originally posted by JafferAB
Hey... Im tyrign to make an MP3 player for the broadband part of my site, however, although i can make it play MP3s, i want to be able to get the MP3 Selection window to make the Actual Site window play te music, if you understand what i mean ? If not then i will try to simplyfy it (but that wasnt simple ;))....
1.Person Opens MP3 Window from site, 2 windows open.
2.Cliick the song they want to play, and click Play in the MP3 window.
3.All i need now is the MP3 window to change a variable in the main window, so the loop thats checking to see if the variable has changed, notices, and thus changes the song accordingly..
So all i really need is a way of chaging a variable from 1 window to another :)
The MySQL problem is weird, i don tknwo why it wont work.....
Code:
if (isset($_POST['submit'])) {
$link = mysql_connect("localhost","username","password");
if(!$link) die ("couldnt connect to $link");
mysql_select_db("abunting", $link);
$query = "SELECT 1 FROM site_members WHERE Alias='$alias' AND password='$password'";
$result = mysql_query($query, $link) or die(mysql_error());
if($result == 1) {
print " ".mysql_result($result, 0)." the username and password you entered was correct";
} else {
print " ".mysql_result($result, 0)." the login you entered or the password you entered is incorrect";
}
}
surely result becomes 1 if the login and password are correct, but this doesnt seem to work!
Thanks
your kidding right?
$query = "SELECT 1 FROM site_members WHERE Alias='$alias' AND password='$password'";
what is the RED? and those variables will be blank if you are running from a post from a form. use $_POST['alias']