Hey python i like that tutorial that you made for login in but there is one error.
This is what i get everytime i try to log in
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/vibutx/public_html/login/login.php on line 73
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/vibutx/public_html/login/login.php on line 81
Username and passwords do not match our records
please help
Comments
That is the code used to make the login.php... any ideas?? BTW, i changed the DB info to **** for security reasons
mysql_connect(your_server,your_username,your_password) or die ("Could not establish connection"); // make connection
mysql_select_db(your_db); // select database
just put the info directly into the statement
See this is what I want to do and I have a few questions to see if this will work with what I am trying to do.
I have a strategy section and I would like it so that non registered users could only limited amounts of the section and for the real juicy stuff you need to be a site user. What I’m wondering is will this script work with .htaccess files in order to keep people out of directories of the pages. In other words I don’t want people to be able to link to the address of a certain piece of content and bypass all the login/registration scripting.
Secondly I was curious if this scripting is cable of being used with the database I use for my phpBB. In other words people only need to register on the site once and will be able to access all content.
Finally, this is only an idea I have and I'm not very good with php but rather proficeint with html/xhtml (I have limited experince with other languages as well). I have started to learn php and think this would help with the learning of the language and provide a nice feature to my site.
all comments are welcome. Again I havent started the scripting yet so maybe I might be able to answer most these questions myself.
edit-
Ok so I think i figured out how to prevent the access to other parts of the site.... silly me had blinders on with the index.php.
That is just a generic php file. Like if you wanted to have an index.php file for the intial content section and then you had that linked to a say page2.php all you would need to do is place the login verification code in that page (page2.php), right?
Still wondering about the phpBB database usage though
Also can I place the php login varification into an html/xhtml file or does it have to be a php file strictly?
BTW, Python....awsome job with the tuts man
Thanks,
this should help you out some...you do need to change some of the details though. if you have any problems, feel free to pm me
You can create a html file and then rename it php, insert the php code wherever you want it to appear, and voila
for example if you had a normal index.html file:
[PHP]
<HTML>
<HEAD>
</HEAD>
<BODY>
<A>HI THIS IS MY BODY CONTENT </A>
<?PHP>
//INSERT PHP LOGIN CODE HERE
?>
</BODY>
</HTML>
[/PHP]
EDIT:
YOU HAVE TO RENAME IT AS A PHP FILE FOR THE CODE TO WORK
edit-
So wait I can just place the phpBB code into a webpage as stated above and rename it to a php file. Thus place the login verification and what not....hmmm but wait is that phpBB code the login or the verification or is it both???
OK i think i might have wraped my hands around this...
The phpBB script simply checks to see if the user is logged in and if they are not it redirects them to the phpBB login page. Then once logged in it will redirect them to the content. Is this correct?
Thanks bud
i know that if the user is not logged in, it leads them to the login page. although im not sure what you mean by verification
Despite this little issue, I found your tuts to be very insightfull.