I have decided that its about time I got up to speed with PHP. I'm using my PlusNet account for hosting and for the MySQL database (which I created using phpmyadmin) I am trying to create a v.simple login site just to get used to working with the code etc.. I have created a database: dewbie_pn I have created a table: members In this table I have: Id, username, password. I have put in 3 users details. ------------------------------------------------------------------------------------ Now, my problem is getting these pages on the net so they work!! I've tried uploading them to my usual ftp.plus.net account, whenever I try to open main_login.php it askes if I want to save the file to disc instead of opening the page. I tried uploading it to my cshell.plus.net and ccgi.plus.net parts of my web space, and for this I just get an error message (You don't have permission to access / on this server.) Now this is really nooby of me, but what am I doing wrong?! ------------------------------------------------------------------------------------ Here is a list of the code for the 3 pages. [b]main_login.php[/b] (this is a login page where the 3 users I have created login with their usernam and password) [code]<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post" action="checklogin.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Member Login </strong></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="myusername" type="text" id="myusername"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="mypassword" type="text" id="mypassword"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Login"></td> </tr> </table> </td> </form> </tr> </table>[/code] This goes to this page.. [b]checklogin.php[/b] (checks the login details against the database) [code]<?php $host="humbug"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="dewbie_pn"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ?>[/code] If it matches, it goes to this final page... [b]login_successful.php[/b] (displays a page saying "Successfuly Logged In" [code]// Check if session is not registered , redirect back to main page. // Put this code in first line of web page. <? session_start(); if(!session_is_registered(myusername)){ header("location:main_login.php"); } ?> <html> <body> Login Successful </body> </html>[/code]