dezkit Posted February 27, 2008 Share Posted February 27, 2008 basicly this is my first time using and I TOTALLY SUCK! =p can somebody please explain to do a simple register and login script. something like this one http://www.phpeasystep.com/workshopview.php?id=6 Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/ Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 everytime i put in "john" "1234" in the main_login.php and press submit, it says cannot connect Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477645 Share on other sites More sharing options...
peranha Posted February 27, 2008 Share Posted February 27, 2008 What does your script look like, can you post it in code tags Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477646 Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 checklogin.php <?php ob_start(); $host="localhost"; $username="dezkit"; $password="******"; $db_name="test"; $tbl_name="members"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ session_register("myusername"); session_register("mypassword"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ob_end_flush(); ?> Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477647 Share on other sites More sharing options...
peranha Posted February 27, 2008 Share Posted February 27, 2008 It cannot connect to the database at localhost with the specified username and password. make sure that those are correct in the script, and that My sql is running. Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477649 Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 how do i make mysql run? lol Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477650 Share on other sites More sharing options...
peranha Posted February 27, 2008 Share Posted February 27, 2008 put phpinfo() in a phpinfo.php page and go to it, see if my sql is there. dont forget the php opening and closing tags Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477652 Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 edit: yea i see all of those words that i dont know Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477655 Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 btw im using yahoo smallbusiness Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477657 Share on other sites More sharing options...
peranha Posted February 27, 2008 Share Posted February 27, 2008 MySQL is showing up then, what do you use to create tables and databases then. Can you connect to the database that way. Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477658 Share on other sites More sharing options...
peranha Posted February 27, 2008 Share Posted February 27, 2008 I am not familiar with that, but is it installed on your PC Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477659 Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 its not, where can i dl it? Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477661 Share on other sites More sharing options...
peranha Posted February 27, 2008 Share Posted February 27, 2008 Do you have a mysql database test or do you need to download mysql. http://dev.mysql.com/downloads/ that is the mysql link if that is what you need. the community server is free, and there is a enterprise server which you can pay for. Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477666 Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 what should i use in my localhost, dezkit@localhost or just localhost? Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477670 Share on other sites More sharing options...
peranha Posted February 27, 2008 Share Posted February 27, 2008 Just localhost Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477672 Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 this is getting frustrating, should i contact Yahoo! ? Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477685 Share on other sites More sharing options...
peranha Posted February 27, 2008 Share Posted February 27, 2008 installing my sql on local host has nothing to do with yahoo. if the website resides on yahoo, then you will have to get their connection information to the sql database. Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477687 Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 i never installed mysql, it comes with the yahoo plan. Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477688 Share on other sites More sharing options...
TheFilmGod Posted February 27, 2008 Share Posted February 27, 2008 <?php //Connect To Database $hostname="h50mysql13.secureserver.net"; $username="username"; $password="password"; $dbname="database"; mysql_connect($hostname,$username, $password) OR DIE ("Unable to connect to database! Please try again later."); mysql_select_db($dbname); ?> This is my connect code - I use godaddy.com . It should be similar. Notice that localhost does not exist because mysql is on a different server than your website files... Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477690 Share on other sites More sharing options...
peranha Posted February 27, 2008 Share Posted February 27, 2008 you need to get a hold of yahoo, or check in your plan for the connection information. localhost is for your PC Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477691 Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 guys.... http://help.yahoo.com/l/us/yahoo/smallbusiness/webhosting/mysql/mysql-06.html Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477699 Share on other sites More sharing options...
peranha Posted February 27, 2008 Share Posted February 27, 2008 By the looks $host = "mysql"; you will have to create a database with a user and password. Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477700 Share on other sites More sharing options...
dezkit Posted February 27, 2008 Author Share Posted February 27, 2008 peranha, thank you mate, i love you for all your time. you are the best person on the internet lol Link to comment https://forums.phpfreaks.com/topic/93251-i-am-new-help/#findComment-477711 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.