Jump to content

dewbie

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dewbie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Update on my problem... PlusNet told me that I do need to put it on my ccgi.plus.net space, so I did, then I realised it wasn't workign as I had put it in the cgi bin folder, I moved it from there into the main directory and got this error message: [img src=\"http://img506.imageshack.us/img506/5639/php39um.jpg\" border=\"0\" alt=\"IPB Image\" /] I then tried loading it onto the KK space, just to see if it worked, and it did! However, I have problems with this bit if anyone can help me... also ideas why it isnt working on my plusnet space when it does on KK's, even though PlusNet claim that their ccgi supports PHP.. maybe they dont have PHP installed on my ccgi space?! This is the bit of code that is wrong, I need to know what to put in for $host as it doesnt seem to like ccgi.plus.net ot humbug.. [b][!--coloro:red--][span style=\"color:red\"][!--/coloro--]$host="humbug"; // Host name[!--colorc--][/span][!--/colorc--][/b] $username="dewbie"; // Mysql username $password="2fbe8e1fefb41176"; // Mysql password $db_name="dewbie_pn"; // Database name $tbl_name="members"; // Table name
  2. 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>&nbsp;</td> <td>&nbsp;</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]
  3. Hey, im working on a large site with multiple pages and updates to parts of each page daily, so its only practical to have the bits that need updating as iFrames (so I only have to update 1 html page, instead of 20). The site is designed using tables. There is a standard Navigation bar, and what im trying to achieve is when you click (for example) "[b]Roster[/b]" on the navbar, then one of the tables on that page (for example tableID "[b]RosterTable[/b]" will display the iFrame "[b]roster.htm[/b]" in the table "[b]RosterTable[/b]". I thought it would be a case of changing the button property for "target" to something like "RosterTable" (the id of the table) and the sourse being some sort of <iframe> code... but it doesnt work. Is it possible to do this? If so.. how! I apreciate any help on this matter [a href=\"http://www.dewbie.plus.com/kk/\" target=\"_blank\"]Here[/a] is the web site so you can visualise what im trying to do.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.