d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Login Help > Need Help
12Next
Add Reply New Topic New Poll
Member
Posts: 6,325
Joined: Dec 2 2007
Gold: 5,347.75
Feb 12 2010 09:37am
Hi All..

I have recently made a website with wordpress which i wanna use for some uploads and stuff..

on the site i have a public section and a private section(For uploads)

Here is what it looks like:

Home - Pictures - Hidden page, (Transparent Site, "Private") <-- Menu.

When a user presses on hidden page it should redirect the person to Hidden page's page

on the hidden page there should be a textbox and a button (The user must write the secret password )

When the user pushes on the button it should check if the password is correct.. if it is then he/she is redirected to "Transparent Site, "Private"" (only for admins and higher ranked users..)

I simply need the code for making a textbox and a button and a true/false boolean and the code to redirect to the page

nb: i don't need users to the login form.. only password

plzz help-.

Member
Posts: 16,327
Joined: Apr 18 2009
Gold: 259.62
Feb 12 2010 09:43am
Quote (Nogge @ Feb 12 2010 04:37pm)
Hi All..

I have recently made a website with wordpress which i wanna use for some uploads and stuff..

on the site i have a public section and a private section(For uploads)

Here is what it looks like:

Home - Pictures - Hidden page, (Transparent Site, "Private")  <-- Menu.

When a user presses on hidden page it should redirect the person to Hidden page's page

on the hidden page there should be a textbox and a button (The user must write the secret password )

When the user pushes on the button it should check if the password is correct.. if it is then he/she is redirected to "Transparent Site, "Private"" (only for admins and higher ranked users..)

I simply need the code for making a textbox and a button and a true/false boolean and the code to redirect to the page

nb: i don't need users to the login form.. only password

plzz help-.


do something like this
http://webdesignskolan.se/php/login_basic/login_basic.html
Member
Posts: 6,325
Joined: Dec 2 2007
Gold: 5,347.75
Feb 12 2010 09:49am
Quote (Goss3N @ 12 Feb 2010 16:43)


ty for your time man ;) but honestly i don't understand a word E: in swedishv:p

This post was edited by Nogge on Feb 12 2010 09:49am
Member
Posts: 16,327
Joined: Apr 18 2009
Gold: 259.62
Feb 12 2010 09:56am
Quote (Nogge @ Feb 12 2010 04:49pm)
ty for your time man ;) but honestly i don't understand a word E: in swedishv:p


im pretty sure there are some danish sites :D
alernative english
Member
Posts: 2,551
Joined: Sep 14 2003
Gold: 106.11
Feb 12 2010 10:07am
Code

<?php
$password = "Whatever_pass_you_like";

$pass = (isset($_POST['password']) ? $_POST['password'] : "";

if($pass == $password)
{
 // Secret Page
}
else
{
 // Show login again.
 echo('<input type="password" name="password" />');
}


of course this is as simple as you can make it without sessions, etc to keep a user logged in between pages and what not.
Member
Posts: 6,325
Joined: Dec 2 2007
Gold: 5,347.75
Feb 12 2010 10:44am
Quote (Bricegould @ 12 Feb 2010 17:07)
Code
<?php
$password = "Whatever_pass_you_like";

$pass = (isset($_POST['password']) ? $_POST['password'] : "";

if($pass == $password)
{
// Secret Page
}
else
{
// Show login again.
echo('<input type="password" name="password" />');
}


of course this is as simple as you can make it without sessions, etc to keep a user logged in between pages and what not.


as simpel as i want it for now :) ty
Member
Posts: 1,555
Joined: Apr 28 2005
Gold: 55.00
Feb 16 2010 03:56am
Quote (Bricegould @ Feb 12 2010 10:07am)
Code
<?php
$password = "Whatever_pass_you_like";

$pass = (isset($_POST['password']) ? $_POST['password'] : "";

if($pass == $password)
{
 // Secret Page
}
else
{
 // Show login again.
 echo('<input type="password" name="password" />');
}


of course this is as simple as you can make it without sessions, etc to keep a user logged in between pages and what not.


Shouldnt have $password set in the file its to be used by should be echo'ed from a config file and encrypted and should also validate $_POST['password']; for a base mininum at least. think someone come and uses '; and there you just got screwed : /
Member
Posts: 9,475
Joined: Mar 14 2005
Gold: 110.00
Feb 16 2010 08:24am
Quote (Lilfade_LOR_CF @ 16 Feb 2010 04:56)
Shouldnt have $password set in the file its to be used by should be echo'ed from a config file and encrypted and should also validate $_POST['password']; for a base mininum at least. think someone come and uses '; and there you just got screwed : /


He said it was as simple as you can make it. Sometimes there is security in simplicity, but that isn't the case here. This is just something simple to shutup the OP. Why would you "echo" the password? Why would you encrypt it in a config file (one way, salted hash maybe)? Also, SQL injection? Where the SQL? Also, learn to use proper grammar (I don't have the best but if someone walked up to me and talked how your post reads, I'd think you're a crack head).

This sounds like some people I work with that throw around buzz words and I have to explain to management why they shouldn't be instituting policy :( .
Member
Posts: 6,325
Joined: Dec 2 2007
Gold: 5,347.75
Feb 16 2010 12:54pm
Quote (Lilfade_LOR_CF @ 16 Feb 2010 10:56)
Shouldnt have $password set in the file its to be used by should be echo'ed from a config file and encrypted and should also validate $_POST['password']; for a base mininum at least. think someone come and uses '; and there you just got screwed : /


i am so sry.. i didn't understand 1 word :/
Member
Posts: 2,551
Joined: Sep 14 2003
Gold: 106.11
Feb 16 2010 03:34pm
Quote (llamaoo7 @ 16 Feb 2010 09:24)
He said it was as simple as you can make it.  Sometimes there is security in simplicity, but that isn't the case here.  This is just something simple to shutup the OP.  Why would you "echo" the password?  Why would you encrypt it in a config file (one way, salted hash maybe)?  Also, SQL injection?  Where the SQL?  Also, learn to use proper grammar (I don't have the best but if someone walked up to me and talked how your post reads, I'd think you're a crack head).

This sounds like some people I work with that throw around buzz words and I have to explain to management why they shouldn't be instituting policy :( .


Thanks for the translation.
Go Back To Programming & Development Topic List
12Next
Add Reply New Topic New Poll