/    Sign up×
Community /Pin to ProfileBookmark

Script Help!

I did a search on the forums and on the internet and found nothing for what I’m looking for. I want a script that will allow just me to login with my pass and then on my pages I could have some sort of include or something so it would show my online status. So I would login with my pass and then on my pages is would change from offline to online. When ever I’m not logged in it shows offline and when ever I am logged in it shows online. I think it would also need to have sessions so it would keep me loged in. I would also need a logout button. Is this possible? If so is there anybody that would be willing to help me do this? I don’t have any money other wise I would pay someone to help me do it! Thanks. ?

to post a comment
PHP

10 Comments(s)

Copy linkTweet thisAlerts:
@brendandonhueAug 08.2003 — Does it have to use sessions? It could be done with cookies or flatfile. Are you building a new script for the login and everything, or are you using an already existing one (such as Pyro's)?
Copy linkTweet thisAlerts:
@JickauthorAug 08.2003 — I'll probably try to impliment Pyro's so I don't have to build my own which could take quite a while considering my intelligence level when it comes to PHP! Lol... :p

In response to your sessions question. No. It dosn't have to use them. I'm willing to do it whatever way would be eaiser. The only resin I'm doing the login part in the first place is because I'm under the impression that you would have to do it that way other wise the server would never be accurate about my status since I have a dinamic IP address which would not allow for it to just say I'm online if my IP comes to that page. I would greatly appreciate any help. ?
Copy linkTweet thisAlerts:
@brendandonhueAug 08.2003 — Untested code but something like this might work with Pyro's script

<?php

$Offline = "Currently Offline";

$Online = "Currently Online";

if (!isset($verified)) { die($Offline); }

if (!$verified) { die($Offline); }

else {echo $Online; }

?>
Copy linkTweet thisAlerts:
@JickauthorAug 09.2003 — Ok, assuming that the script brendandonhue gave me goes in the "passwordreader.php" file of Pyro's code, where do I put it in there? Something like this:
[code=php]<?PHP
$user = 'yourencryptedusername';
$pass = 'yourencryptedpassword';
$offline = "Currently Offline";
$online = "Currently Online";

if(md5($_POST['username']) == $user && md5($_POST['password']) == $pass)
{
setcookie ("verified", true);
header ("Location:http://www.yoursite.com/dir/page.htm");
}
else
{
echo ("Incorrect Password");
}
if (!isset($verified)) { die($offline); }
if (!$verified) { die($offline); }
else
{
echo $online;
}
?>[/code]

Let me know if it's wrong and how to fix it and also if I even have it in the right file! :p
Copy linkTweet thisAlerts:
@JickauthorAug 09.2003 — I really need help with this. I just need to know if it's in the right file and if I put it in there right. Just look at my last post. ?
Copy linkTweet thisAlerts:
@brendandonhueAug 09.2003 — You can put it on any page you want, it should show your online status. Anywhere within your domain anyway.
Copy linkTweet thisAlerts:
@JickauthorAug 09.2003 — Ohh so I could put it in a file of it's own and as long as it's in the same dir as the login script it should work? Thats all I would need and then I could put an include on the pages I want to display it on?
Copy linkTweet thisAlerts:
@brendandonhueAug 09.2003 — Assuming there are no errors in my script, then yes you could do that.
Copy linkTweet thisAlerts:
@JickauthorAug 10.2003 — Ok, I had some help from one of my freinds. I got it working exactally how I want it to. You can try it out here:

[B][URL]http://kd7pyo.infinitypages.com/status/[/URL][/B]

Enter test/test for the username and password. As you can see it works fine. One thing I noticed is if you enter a custom status message with quotes or apostrifys it will put slashes like this:

[B]"/test/"[/B]

[B]don/'t[/B]

I'm not sure what is wrong. Can someone go and look and see whats wrong? This birthday boy would greatly appreciate it! ?

Here is my ([B]process.php[/B]) file that takes and outputs the custom message if you enter one:
[code=php]<?
IF ($user == "")
{
echo "The (<b>Username</b>) feild needs to be filled in.<br><a title='Go Back' href='http://kd7pyo.infinitypages.com/status/'>Go Back</a>";
exit;
}
IF ($pass == "")
{
echo "The (<b>Password</b>) feild needs to be filled in.<br><a title='Go Back' href='http://kd7pyo.infinitypages.com/status/'>Go Back</a>";
exit;
}
IF ($stat == "Custom" and $customtext == "")
{
echo "The (<b>Custom</b>) feild needs to be filled in.<br><a title='Go Back' href='http://kd7pyo.infinitypages.com/status/'>Go Back</a>";
exit;
}
IF ($stat == "Custom")
{
$stat = $customtext;
}
IF ($user == "test" and $pass == "test")
{
echo "Your status has been changed to: (<b>$stat</b>).<br><a title='Go Back' href='http://kd7pyo.infinitypages.com/status/'>Go Back</a>";
$openit = fopen("status.txt", "w");
fwrite($openit, "$stat");
}
else
{
echo "Sorry, you have entered a wrong username and/or password.<br><a title='Go Back' href='http://kd7pyo.infinitypages.com/status/'>Go Back</a>";
}
?>[/code]
Copy linkTweet thisAlerts:
@pyroAug 10.2003 — Look into [URL=http://forums.webdeveloper.com/showthread.php?s=&threadid=11768&highlight=password]stripslashes()[/URL]
×

Success!

Help @Jick spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...