FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Fix up a login script





Kurosaki-Ichigo
Well. Ive got this login script right. And i think its a bit too simple. Can anyone who knows php add some stuff to it ? There is also a few errors. I think anyone who knows php could do it as i think its very simple. If your interested. Pm me or reply to this topic.
salman_500
post your script here maybe...... i may be able to help you out !
Kurosaki-Ichigo
http://www.uzzisoft.net/learning_php.html

Go here. Theres a thing you can download. Inside it has a PHP video tutorial and a script. What i want is :

1. More expandable profile : Msn, Yahoo, AOL. Something like other forums.

2. actuall parts for posts : I mean its just a page where you can post but what i want is categorys and a topic and reply system. With a admin panel if possible.

3. # of posts displayed : Number of posts displayed in profil and under each post.

4. Code for displaying a forums latest posts on a page.

I think thats it.
If you cant do all of them, dont worry, any help is good.
the zephyrus
Please realize, the code you linked to was never meant to be actually used. It was only for demonstration purposes. And if you were to ever try using it, someone might well come along and inject arbitrary SQL into your system. Which is bad.

What you're asking for is a lot too. Your title makes it sound like you want a few more lines. But you're past asking for a complete overhaul, even, more like you're asking for a new system from the ground up. Now, I don't object to free lunches, but a free lunch is a sandwich and a soda, not you coming over hauling off the contents of my fridge, and then then fridge itself to boot.

Will I code this? Sorry but no. My time is scarce. Not that I'm trying to be a jerk, but it's a big task.

Will I explain how to code it? Oaky. Okay, actually, but I gotta say oaky more often 'cause it's fun.

Oh, and in case you didn't read the above:
THE CODE YOU LINKED TO IS UNSAFE AND YOU SHOULD NOT USE IT WITHOUT FIRST LEARNING TO SANITIZE USER INPUT!
I disclaim myself from any liability.

Expanding the profile just involves adding more database fields. Where you have the install script, and it creates a database, make it create an extra field for all the stuff you want. Go into the update and display profile pages and add the appropriate querys.

If you want a post count, add an integer field into the table that's retrieved and incremented every time a user posts.

The latest post thing requires you to have a date/time field in your table. Then query the table for everything. Do a SELECT statement, LIMIT 1, and SORT BY timestamp DESC. That's the most recent post.

Notice I skipped two. Two is a killer. There is no easy solution. But if you want to, the basic plan is this. Keep a table of topics. Each topic should have the posts inside it recorded. When someone opens a topic, query for all the posts that match the topic, sorted by date, and print them out in a foreach. It's not pretty.

But here's the thing. And perhaps more my point.

Actually,
THIS MAY WELL BE THE WHOLE POINT OF THIS POST!

What you're looking for sounds a lot like a forum, bulletin board, whatever you wanna call it. Point is, it's been done. Why reinvent the wheel? You can easily get

phpBB
http://www.phpbb.com/

SMF
http://www.simplemachines.org/

and that's almost exactly what you want/need! They're very easy to set up with very clear instructions.

And then you can go from there. The board handles everything from registration to threaded posting to post counting to recent posts.

And if you want anything else, and this is true especially of phpBB, you can modify the code to make it do what you want, and this is a ton easier than from scratch.
y06hci0088
Quote:

<?php

if(empty($_POST['username'] == false && $_POST['password'] == false )){
setcookie("username", $_POST['username']);
setcookie("password", $_POST['password']);
}

if($_POST['username'] == $username && $_POST['password'] == $password) {
echo "Login success"}
?>



this script shld do a simple login script??

of course, encryption can be applied, like mcrypt which contain an array of encryption like blowfish... which u can decrypt with a pass phrase...

(however, for mcrypt, u need a library)

and other one-way encryption like sha1,md5...

u can make the security more strict by magic-quote function and striplashes.....

(chk the php manual for more info, magic-quote is suppose to be set in the php.ini)

but now, i hav a problem that is how do u verify if the user hav enter the correct password before in the case that the user try to direct access the page which is banned without password....

anyone can help, thnx.... Laughing
Kurosaki-Ichigo
Sorry but ill pass. Im trying to learn php at the moment and it looks like hard work (especially the looping).

I think ill just intergrate my site with an IPB forum.
Related topics
php login module
simple login script
Login Script
Login Script - PHP
30 $FRIH to fix my script!!
150 frih$ if you make me a login script with....
Login Script
Free PHP/MySQL login script
problem with login script
PHP login script problem
Free php script login / register , GREAT!
Servlet Basic login script?
Protect Your Page With Simple Login But Yet Powerful Script
Simple PHP Login Script
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.