₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,330,994 members, 8,448,133 topics. Date: Sunday, 19 July 2026 at 07:52 PM

Toggle theme

Abiodun2014's Posts

Nairaland ForumAbiodun2014's ProfileAbiodun2014's Posts

1 2 3 4 5 6 7 8 9 10 (of 12 pages)

ProgrammingRe: How To Create Sessions In PHP by Abiodun2014(op): 10:18pm On May 07, 2015
larisoft:
<?php

$username = $_POST['username']; //corrected this
$password = $_POST['password'];

//...verify and validate your username and password (I guess you know how to do that)


//set cookie
$time = time() + 60 * 60 * 7 * 30;
setcookie("user", $username, $time);
setcookie("password", $password, $time); //corrected this too

//log user in...
}


// now on the index page put

<?php

//check to see if user already has a session; if yes, collect username and password from cookie instead of login form:

if(isset($_COOKIE['user'])){

$username = $_COOKIE['user'];
$password = $_COOKIE['password'];

//verify against database username and password and take user in.
?>



}

And my guy..abeg dey try read code small before you copy paste am. There are three ways to never really learn programming and yet be a programmer. They are
1. Copying and Pasting.
2. Copying and Pasting.
3. Copying and Pasting Ruthlessly
My nairaland look alike site loads very slow or doesn't load at all on Operamini alone. How can I solve this?!
ProgrammingRe: Urgent Help With My Website by Abiodun2014(op): 1:03am On May 05, 2015
tefoko:
Make use of sessions.That's all
Please put more lights on the use of sessions! You got any vivid explanation or example?!
WebmastersRe: Opinion: 5 Reasons Why Nairaland Is Better Than Facebook For Nigerians by Abiodun2014(m): 2:14pm On Apr 27, 2015
Martins301:
1. Privacy

Unlike facebook where you have to use your name, upload your pics (which is archived) and post really interesting stuffs to attract likes, comments and friends, Nairaland isn't like that. Only your username (which can be as fake as the smile of a policeman demanding for bribe) is displayed, plus you get to change your profile pic (which can be fake as well) without the previous ones being archived for public consumption. This sort of privacy has given lots of people the courage to freely express themselves and exhibit behaviours they would never dare to exhibit in real life. Take for instance the case of beryl04 supporting gay rights and Depressedguy confessing that he is gay. Am 100% sure they would never do such in real life. Such privacy has also led some people to exhibit clownish behaviours capable of making people laugh e.g PhockPhockMan tit temitemi1 orijin101 and Airforce1

2. Learning & Information

In terms of learning and getting information on different issues, Nairaland beats facebook hands down. Nairaland has different sections and subsections such as politics, religion, romance, family, jobs, education, business, etc that you can learn and get information from. In fact, it has been statistically and scientifically proven by me that the less time you spend on facebook and the more time you spend on Nairaland, the high the level of your awareness and social intelligience.

3. Features

There are specific features that makes NL also better than FB. Some include absence of delete button and ability to quote the comments of other users. On the absence of delete button, I think its good cos it makes people concious of what they say, knowing fully well they cannot take it back, especially once it has been quoted by someone else. Although there is room to modify your writeup, it is still a good thing that ordinary users do not have the ability to delete posts so as to provide evidence and punish frequent rule breakers babyosisi barcanista and emmyw and temitemi1, and thus maintain decorum in the forum.

4. Historical Records

If not for the issue of hackers and data loss that hit the site, Nairaland would still have had the records of 'every and all' posts dating 5, 6, 7 years back. Facebook on the other hand appears to permanently delete your posts that are 6 to 12 months old. Am patiently waiting for October 2016 so I can remind barcanista of how he wrongly predicted or forecasted in March 2015 that PDP would win Edo state grin

5. Helping Nigerians

I don't know how many people in Nigeria have gotten jobs through facebook but I do know of many that have gotten employment through Nairaland. I also know of one or two persons who got helped with paying hospital bills through Nairaland.

Having used Facebook and Nairaland, I think Nairaland is the place to be for Nigerians. Feel free to add to the list. Like this post if you agree with it and Share if you disagree.



Source: Martins301
Who talk say Nairaland beta pass Facebook! No allow dem hear dat from your mouth oooo.
1) Privacy is one of the factors Facebook doesn't disregard, they take that with big piority!
Nairaland is kinda enclosing it self, it really doesn't wanna expand! It won't suprise me if someone elses forum dominates it!
Facebook is opened to the world as a whole! U not just enclosed to a country like Nairaland!
I get hooked up with my lost time friend via Fb
I can also raise discussion via FB and gets comments/suggestion on wat to do
Facebook has really made live easy and connection with friends easy!

I would say Facebook is still the Best!

I still don't understand why Nairaland bans by posts anytime I make mention of my Site! I really wish I cld but I can't cause this post would be removed! Smh for Nairaland
ProgrammingRe: How To Create Sessions In PHP by Abiodun2014(op): 11:44pm On Apr 24, 2015
larisoft:
Haba! That is unecessarily long na and even introduces a lot more than was asked.

please use this on login page

//collect username and password:
$username = $_POST['password'];
$password = $_POST['password'];

//...verify and validate your username and password (I guess you know how to do that)


//set cookie
$time = time() + 60 * 60 * 7 * 30;
setcookie("user", $username, $time);
setcookie("password", $password, "$time"wink;

//log user in
}


// now on the index page put

//check to see if user already has a session:
if(isset($_COOKIE['user'])){

//if yes, collect username and password from cookie instead of login form:

$username = $_COOKIE['user'];
$password = $_COOKIE['password'];


//....verify and validate then log user in automatically.

}

Hope this helps. I'm a fan of short clean code.
It didn't work oooo
WebmastersRe: Urgent Help With Nairaland Lookalike Forum by Abiodun2014(op): 5:48pm On Apr 17, 2015
I mean my own site not nairaland!!! How do I keep my members logged in for a long time?! Who knows the code?!
WebmastersUrgent Help With Nairaland Lookalike Forum by Abiodun2014(op): 3:27pm On Apr 17, 2015
Please people, I need help with my Nairaland look alike forum, I want a situation whereby a User logs in and stay logged in 4ever, without been logged out.
Even wen he closes the browser and reopens he still stays logged in!
I heard I cld do this with Sessions! Anyone with the code?!
ProgrammingRe: Urgent Help With My Website by Abiodun2014(op): 2:23pm On Apr 17, 2015
Nah, I can't
ProgrammingUrgent Help With My Website by Abiodun2014(op): 7:47am On Apr 17, 2015
I run a Nairaland Look alike forum! And am tired of my members login in every hour!!! I want a situation wen they close a browser and reopen dey still get logged in! How do I come by this?! Anyone with an idea?!
Just like Nairaland itself or Facebook; once am logged in, am logged in! Aint a situation am gonna log in again!!!

I would be really grateful!
Yea... For my do_login.php script; the code is posted below

<?php
session_start();
require('incfiles/init.php');
if(functions::isloggedin())
{
if(empty($redirect))
{
functions::go($config->url);
} else {
functions::go('http://'.$redirect);
}
die();
}
if(isset($_POST["submit"])) {
//STEP DOWN VALUES
$username=$_POST["username"];
$password=$_POST["password"];
$redirect=$_POST["redirect"];
//CLEANUP VALUES
$username=functions::cleaninput($username);
$password=functions::cleaninput($password);
$password=md5($password);
$checkquery=mysql_query("SELECT username, password
FROM users WHERE username='$username' AND
password='$password'" or die(mysql_error());
$num=mysql_num_rows($checkquery);
if($num>0)
{
$banq = mysql_num_rows(mysql_query("SELECT * FROM
`bannedusers` WHERE `username`='$username' AND
`boardid`=0" );
if($banq > 0)
{
$binfo = mysql_fetch_array(mysql_query("SELECT * FROM
`bannedusers` WHERE username='$username'" );
$reason = $binfo["reason"];
$date = $binfo["date"];
$unbandate = $binfo["unbandate"];
$today = time();
if($today < $unbandate) {
$pagetitle = "You Have Been Banished By one of the
Administrator!.";
require('incfiles/head.php');
$ud = date('l jS F Y \a\t g:I A', $unbandate);
$bd = date('l jS F Y \a\t g:I A', $date);
echo "<h2>You Have Been Banished By one of the
Administrator!.</h2><div class='display'><p>Reason:
$reason<p>Banned Date: $bd<p>Unbanned Date: $ud</
div>";
require('incfiles/end.php');
die();
} else {
mysql_query("DELETE FROM bannedusers WHERE
username='$username' ANd boardid=0" ;
$pagetitle = "U have Just Been Unbanned";
require('incfiles/head.php');
$msg="U Hav Just Been Unbanned Pls Go Back And Login
Again";
echo "<div class='display'>$msg<br/><a
href='javascript:history.go(-1)'>Go back</a></div>";
}
}
else {
$CookieExpire = 100000;
$time = 60 * 60 * 24 * $CookieExpire;
$time = time() + $time;
$key = $username . date('mY');
$key = strtoupper(md5($key));
setcookie("sessionkey", "$key", "$time" ;
setcookie("user", "$username", "$time" ;
setcookie("password", "$password", "$time" ;
$_SESSION["user"]=$username;
$id=functions::user_info($username, userID); $date=date
();
$guestip=$_SERVER["REMOTE_ADDR"];
$guestbrowser=$_SERVER["HTTP_USER_AGENT"];
mysql_query("UPDATE b_guestsonline SET time=1 WHERE
browser='$guestbrowser' AND guestip='$guestip'" ;
mysql_query("UPDATE users SET sessionkey='$key' WHERE
username='$username'" ;
if(empty($redirect))
{
functions::go($config->url);
} else {
functions::go('http://'.$redirect);
}
}
}
else
{
$pagetitle = "incorrect username and/or password, make
sure you type correctly your username & password !";
require('incfiles/head.php');
$msg="incorrect username and/or password, make sure
you type correctly your username & password !";
echo "<div class='display'>$msg<br/><a
href='javascript:history.go(-1)'>Go back</a></div>";
}
}
else
{
$pagetitle = "Error";
require('incfiles/head.php');
$msg="Error";
echo "<div class='display'>$msg<br/><a
href='javascript:history.go(-1)'>Go back</a></div>";
}
require('incfiles/end.php');
?>
ProgrammingRe: How To Create Sessions In PHP by Abiodun2014(op): 10:31pm On Apr 16, 2015
Yea... For my do_login.php script; the code is posted below

<?php
session_start();
require('incfiles/init.php');
if(functions::isloggedin())
{
if(empty($redirect))
{
functions::go($config->url);
} else {
functions::go('http://'.$redirect);
}
die();
}


if(isset($_POST["submit"])) {
//STEP DOWN VALUES
$username=$_POST["username"];
$password=$_POST["password"];
$redirect=$_POST["redirect"];
//CLEANUP VALUES
$username=functions::cleaninput($username);
$password=functions::cleaninput($password);
$password=md5($password);
$checkquery=mysql_query("SELECT username, password FROM users WHERE username='$username' AND password='$password'"wink or die(mysql_error());
$num=mysql_num_rows($checkquery);
if($num>0)
{
$banq = mysql_num_rows(mysql_query("SELECT * FROM `bannedusers` WHERE `username`='$username' AND `boardid`=0"wink);
if($banq > 0)
{
$binfo = mysql_fetch_array(mysql_query("SELECT * FROM `bannedusers` WHERE username='$username'"wink);
$reason = $binfo["reason"];
$date = $binfo["date"];
$unbandate = $binfo["unbandate"];
$today = time();
if($today < $unbandate) {
$pagetitle = "You Have Been Banished By one of the Administrator!.";
require('incfiles/head.php');
$ud = date('l jS F Y \a\t g:I A', $unbandate);
$bd = date('l jS F Y \a\t g:I A', $date);
echo "<h2>You Have Been Banished By one of the Administrator!.</h2><div class='display'><p>Reason: $reason<p>Banned Date: $bd<p>Unbanned Date: $ud</div>";
require('incfiles/end.php');
die();
} else {
mysql_query("DELETE FROM bannedusers WHERE username='$username' ANd boardid=0"wink;
$pagetitle = "U have Just Been Unbanned";
require('incfiles/head.php');
$msg="U Hav Just Been Unbanned Pls Go Back And Login Again";
echo "<div class='display'>$msg<br/><a href='javascript:history.go(-1)'>Go back</a></div>";
}
}

else {
$CookieExpire = 100000;
$time = 60 * 60 * 24 * $CookieExpire;
$time = time() + $time;
$key = $username . date('mY');
$key = strtoupper(md5($key));
setcookie("sessionkey", "$key", "$time"wink;
setcookie("user", "$username", "$time"wink;
setcookie("password", "$password", "$time"wink;

$_SESSION["user"]=$username;
$id=functions::user_info($username, userID); $date=date();
$guestip=$_SERVER["REMOTE_ADDR"];
$guestbrowser=$_SERVER["HTTP_USER_AGENT"];
mysql_query("UPDATE b_guestsonline SET time=1 WHERE browser='$guestbrowser' AND guestip='$guestip'"wink;

mysql_query("UPDATE users SET sessionkey='$key' WHERE username='$username'"wink;
if(empty($redirect))
{
functions::go($config->url);
} else {
functions::go('http://'.$redirect);
}

}
}
else
{
$pagetitle = "incorrect username and/or password, make sure you type correctly your username & password !";
require('incfiles/head.php');
$msg="incorrect username and/or password, make sure you type correctly your username & password !";
echo "<div class='display'>$msg<br/><a href='javascript:history.go(-1)'>Go back</a></div>";
}
}
else
{
$pagetitle = "Error";
require('incfiles/head.php');
$msg="Error";
echo "<div class='display'>$msg<br/><a href='javascript:history.go(-1)'>Go back</a></div>";
}

require('incfiles/end.php');
?>
ProgrammingHow To Create Sessions In PHP by Abiodun2014(op): 8:26pm On Apr 16, 2015
I wanna keep my members to my forum logged in for a very long time! Like wen they go off the site, using a mobile browser and come back, dey get logged in automatically!

Anyone can help with the code, I wanna use it for my Nairaland Look alike forum!!!

Would really appreciate if anyone can help
Art, Graphics & VideoPS4 Adventure Games Cds For Sale At A Very Cheap Price by Abiodun2014(op): 2:00pm On Mar 29, 2015
Halo, just got this Ps4 console and av played like almost everygame on it... From GTA, Thief, Asphalt and many more...

I wanna sell some of the CDs, I bought dem for 12000 naira each but I would be giving it out for a whopping sum of 5000 each!

Call 08134600302
If you interested, plz holla... For lagos based individuals only! I no fit because of 5k dey waka d whole Nigeria! Lol
EducationVote Aderiye Abiodun For Social Director At Yabatech Sug Level by Abiodun2014(op): 3:02am On Mar 08, 2015
HELLO NAIRALANDERS, PLEASE AND PLEASE; ADERIYE ABIODUN OLANREWAJU is viaing for the post of SOCIAL DIRECTOR at YASUG 2015 and he really needs your help to win...

If you are a student of the prestigous school, Yabatech, please come this monday around 10am to 4pm to vote for ADERIYE ABIODUN.. with your School Id card or School Fees Receipt!!! Your vote is really needed cos it counts...

Thanks.. Mod abeg place for frontpage... Support a die hard Nairalander Fan. Thanks

EventsRe: This End Of The Year Party Cake Will Blow Your Mind (see Photos) by Abiodun2014(m): 7:21pm On Jan 02, 2015
Wetn make I kan do? undecided
Nairaland GeneralI Need Help With My Assignment. by Abiodun2014(op): 6:40pm On Aug 28, 2014
Hello, thanks for checking out this post. I was given an assignment on Electrical Design and Drafting. The homework is for me to draw an Architectural Floor plan of an Hospital with electrical fittings, and Model the drawing! The drawing should also be done using 3D autocad!!! I don hear am ooo! And we r to submit the assignment on Monday! Abeg Nairalanders make una help ur boy!!!
RomanceRe: My Fiancee Went To NYSC And Changed by Abiodun2014(m): 7:44pm On Aug 26, 2014
ebujany: Hi guys..pls i have a very serious problem.

My girl went to nysc and changed totally. she's now a stranger from who i use to know. it started from wen she got to camp. wen ever i call her, she wnt pick up and wnt call back, flash or send call me sms as the case may be. wen she finally picks she will say she was busy. she told me about a corper that works in ICT in her camp and that the guy wants to help her get posted to a good PPA.

She said they normally do the fixing with money but the guys said he will do that for her with his own money. I noticed that wenever i call, she's not happy. we quarrel about everything from wer she is to wat is happeing there.Today, she finally got posted to a nice place of PPA and I was happy for her. When i called her, her call was on call waiting OVer 10missed calls she didn't pick.

this was a girl that wen ever I call even if her call is on call waitin she will ask the caller to call her back that she wants to answer my call but she didn't. wen she finally picked she told me she was talkn with the guy.i asked wen it started that the guys call is now more important than mine.she got angry and said i shld stop calln her.am so mad ryt now don't know wat to do.
Dude stop beating around the bush. It is clearly written, she aint interested in U anymore... I don't knw Y una dey marry girl wey neva finish sch!? Allow the girl finish her education b4 anyfn! *smh* for u bro

1 2 3 4 5 6 7 8 9 10 (of 12 pages)