RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1965 | Replies: 4
Reply
Join Date: Apr 2005
Location: Kerala
Posts: 172
Reputation: hbmarar is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
hbmarar's Avatar
hbmarar hbmarar is offline Offline
Junior Poster

need help with the login

  #1  
Apr 5th, 2005
Well, I have created a config file where I provide the server name,dbname,dbusr name.I include this in another file called create which just creates a table to store userinformation.

So when the login html file gets a user name and password it has to call another page...but it showed a error 'dbname.usertable' not exists. So I tried changed the database name and and tried to use the usertable of that database...this time it was error logging on.....

Well I would like to know the possible reasons .Could you please help me with the reason...

Also if possible the steps you would follow when creating a database for a web application including commands and whether create a user and grant permission for the application database

hari
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2005
Posts: 354
Reputation: DanceInstructor is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 12
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: need help with the login

  #2  
Apr 5th, 2005
Could you post your code pls. It will be much easier to help you if we can see your code. Let's start with the page you use to create the database and table.
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote  
Join Date: Apr 2005
Location: Kerala
Posts: 172
Reputation: hbmarar is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
hbmarar's Avatar
hbmarar hbmarar is offline Offline
Junior Poster

Re: need help with the login

  #3  
Apr 6th, 2005
hi,

thanks for the concern and reply.Pasting the code as asked
--------------------------------------------------------------------
<?

//set up the names of the database and table
$db_name ="phpportal";
$table_name ="authusr";

//connect to the server and select the database
$server = "localhost";
$dbusername = "hbm";
$dbpassword = "hbm";

//domain information
$domain = "//removed";

//Change to "0" to turn off the login log
$log_login = "0";

//base_dir is the location of the files, ie http://www.yourdomain/login
$base_dir = "http://127.0.0.1/userlogin/login";

//length of time the cookie is good for - 7 is the days and 24 is the hours
//if you would like the time to be short, say 1 hour, change to 60*60*1
$duration = time()+(60*60*24);

//the site administrator's email address
$adminemail = "hbmarar@rediffmail.com";

//sets the time to EST
$zone=3600*-5;
?>

//--------------------------------------
//create create.php
//-------------------------------------------
<?

require ('config.php');

$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());

$sql ="
CREATE TABLE IF NOT EXISTS authorize
(
firstname VARCHAR(20),
lastname VARCHAR(20),
username VARCHAR(20),
password VARCHAR(30),
email VARCHAR(100),
authority VARCHAR(20),
redirect VARCHAR(100)
)
";

$result = @mysql_query($sql,$connection) or die(mysql_error());

echo "<p>$table_name has been create.</p>";
echo "<p><a href=\"admin/createadmin.html\">Create Admin</a></p>";
?>

Hope this would give you a picture for helping me out

with regards and Happy new Year wishes(Indian new Year)
Hari
Reply With Quote  
Join Date: Apr 2005
Location: Kerala
Posts: 172
Reputation: hbmarar is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
hbmarar's Avatar
hbmarar hbmarar is offline Offline
Junior Poster

Re: need help with the login

  #4  
Apr 6th, 2005
I have checkedthe following too..

mysql server started in win98.logged in as root and checked the table
..it exists and able to insert data from commanline...should i specify use phpportal qurey as a first query....?
Reply With Quote  
Join Date: Feb 2005
Posts: 354
Reputation: DanceInstructor is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 12
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: need help with the login

  #5  
Apr 6th, 2005
In your config you have:

$table_name ="authusr";

but in your query in create.php looks like this:

CREATE TABLE IF NOT EXISTS authorize
(
firstname VARCHAR(20),
lastname VARCHAR(20),.....

and then have:

echo "<p>$table_name has been create.</p>";

so you have not created the table authusr, but have created the table authorize. You can change your query to look like this and things should work better:

$sql ="
CREATE TABLE IF NOT EXISTS $table_name
(
firstname VARCHAR(20),
lastname VARCHAR(20),
username VARCHAR(20),
password VARCHAR(30),
email VARCHAR(100),
authority VARCHAR(20),
redirect VARCHAR(100)
)
";

Happy New Year
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:42 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC