Go Back   Gaming Gutter > Non-Gaming > Programming


Programming - All general programming discussion in here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» Recent Threads
Go to first new post Lolatquilt's Underground...
Yesterday 07:46 PM
Last post by Cyrus
Today 05:54 PM
1 Replies, 2 Views
Go to first new post I'm back.
Today 05:37 PM
Last post by Tyler
Today 05:53 PM
6 Replies, 7 Views
Go to first new post SSOTM...
Yesterday 02:42 PM
Last post by Lifeandlifeonly
Today 05:51 PM
30 Replies, 31 Views
Go to first new post Selling NP, SoS, FPot,...
Today 04:21 PM
by Vaspim
Last post by lolatquilts
Today 05:50 PM
14 Replies, 15 Views
Go to first new post Question regarding...
08-26-2008 08:55 AM
Last post by kamikaze_turtle
Today 05:47 PM
3 Replies, 4 Views
Reply
 
LinkBack Thread Tools Display Modes

 PHP Help
Old 03-20-2008, 05:42 AM   #1 (permalink)
Starwind237 Starwind237 is offline Gender Male
Underground
 
Starwind237's Avatar
 
Starwind237 is offline
Join Date: Jan 2007
Age: 18
Posts: 387
iTrader: 0 / 0%
Starwind237 Is Recognizable
Rep Power: 5
Cool PHP Help

I'm want to know if their is a way for a php page to detect what page the person who came to it from and allow or disallow access because of that.

In other words I want a "login Page" that when sucessful login happens redirects to another page. But if someone was to go to that page directly (skiping the login page) it detects that and denies access.

Any help with this would be appreciated.
__________________
  Reply With Quote

 
Old 03-20-2008, 06:28 AM   #2 (permalink)
second2none second2none is offline Gender Male
Underground
 
second2none is offline
Join Date: Sep 2006
Location: BrisBANE <----
Age: 19
Posts: 5,023
iTrader: 1 / 100%
second2none Is a Party Captainsecond2none Is a Party Captainsecond2none Is a Party Captain
Rep Power: 15
yes
PHP Code:
<?php
$ref 
$_SERVER['HTTP_REFERER'];
if(!
$ref=="http://www.google.com"){
    echo 
"Sorry, but you didn't come from the right page";
}
else {
    echo 
"You came from the right place.";
}
?>
although referers are easy to fake.
__________________
This is from:
Screenies Of A Mod
Code:
How did you do it? FLP , jotform, some other form of hacking? - First Class Noob
Lawl.. funny shit.

Quote:
Originally Posted by Kore
By k[ore] on Today, 08:44 AM
i'll give you rep alright, but it won't be positive.
Lawl Ownt

Hoes forgot to eat a dick and shut the FUCK UP!
  Reply With Quote

 
Old 03-20-2008, 06:43 AM   #3 (permalink)
Starwind237 Starwind237 is offline Gender Male
Underground
 
Starwind237's Avatar
 
Starwind237 is offline
Join Date: Jan 2007
Age: 18
Posts: 387
iTrader: 0 / 0%
Starwind237 Is Recognizable
Rep Power: 5
Thank You. +Rep

I'm trying to secure a proxy page. They have a tendency to stop working when you do. I think this will work though.
__________________

Last edited by Starwind237; 03-20-2008 at 08:04 AM.
  Reply With Quote

 
Old 03-20-2008, 05:09 PM   #4 (permalink)
Cataclysmic Cataclysmic is offline Gender Male
Spelar lite DotA...
 
Cataclysmic's Avatar
 
Cataclysmic is offline
Join Date: Jan 2008
Location: Amsterdam, NY
Posts: 1,260
iTrader: 3 / 100%
Cataclysmic Is Popular
Rep Power: 3
Wait a sec...
Can't TamperData change the referrer?
__________________
We should seriously just automatically deny anyone with something along the lines of "Current Goal: UG" in their signature.

Quote:
Kyo: Cataclysmic, I love you now
-------------------------------------
second2none: unfortunately if you have a gf, you are already paying for sex.
-------------------------------------
ANON - Dark has left the conversation.
Nomhak says: what a faggot
-------------------------------------

Sejiru: You look like a person who'd win an award of greatness in the field of excellency!
  Reply With Quote

 
Old 03-20-2008, 08:02 PM   #5 (permalink)
Starwind237 Starwind237 is offline Gender Male
Underground
 
Starwind237's Avatar
 
Starwind237 is offline
Join Date: Jan 2007
Age: 18
Posts: 387
iTrader: 0 / 0%
Starwind237 Is Recognizable
Rep Power: 5
Quote:
Originally Posted by Cataclysmic View Post
Wait a sec...
Can't TamperData change the referrer?
The people I'm protecting it from won't be able to figure that out.

if anyone want's to try and breach the security I'll leave the web server on until tomorrow night.

http://starwind237.no-ip.info/ is "login"

Google -:- Unleash the Web is proxy
__________________

Last edited by Tyler; 03-21-2008 at 03:56 PM.
  Reply With Quote

 
Old 03-21-2008, 01:07 AM   #6 (permalink)
second2none second2none is offline Gender Male
Underground
 
second2none is offline
Join Date: Sep 2006
Location: BrisBANE <----
Age: 19
Posts: 5,023
iTrader: 1 / 100%
second2none Is a Party Captainsecond2none Is a Party Captainsecond2none Is a Party Captain
Rep Power: 15
does your password run through a DB or is it just php script
__________________
This is from:
Screenies Of A Mod
Code:
How did you do it? FLP , jotform, some other form of hacking? - First Class Noob
Lawl.. funny shit.

Quote:
Originally Posted by Kore
By k[ore] on Today, 08:44 AM
i'll give you rep alright, but it won't be positive.
Lawl Ownt

Hoes forgot to eat a dick and shut the FUCK UP!
  Reply With Quote

 
Old 03-21-2008, 09:11 AM   #7 (permalink)
Starwind237 Starwind237 is offline Gender Male
Underground
 
Starwind237's Avatar
 
Starwind237 is offline
Join Date: Jan 2007
Age: 18
Posts: 387
iTrader: 0 / 0%
Starwind237 Is Recognizable
Rep Power: 5
Quote:
Originally Posted by second2none View Post
does your password run through a DB or is it just php script
Just a php script. I'm going to be pretty much the only one using it. I haven't got into doing databases yet. Thats my next the to learn.
__________________
  Reply With Quote

 
Old 03-23-2008, 05:19 PM   #8 (permalink)
rcadble rcadble is offline Gender Male
Underground
 
rcadble is offline
Join Date: Sep 2006
Posts: 217
iTrader: 0 / 0%
rcadble Is Recognizable
Rep Power: 6
Not a good idea in general to do. After it logs in, create a session variable, isLogged. Set the value to true.

When working with PHP sessions, you need to have "session_start();" as your first line of code in the whole page.

Setting a Session Variable:
This goes in a conditional that is executed when you logged in successfully.
Code:
$_SESSION['isLogged'] = true;
In your second page, you can check to see if this session variable exists.

Checking the Sesson Variable:
Code:
if ($_SESSION['isLogged']==true) {
    //run script
} else {
    echo "You must be logged in to view this page!"; //if the session date is invalid
}
__________________
Omnipresent Autobuyer, the best free autobuyer.
Version 1.2
Always around, always present.
  Reply With Quote

 
Old 03-24-2008, 02:13 PM   #9 (permalink)
Starwind237 Starwind237 is offline Gender Male
Underground
 
Starwind237's Avatar
 
Starwind237 is offline
Join Date: Jan 2007
Age: 18
Posts: 387
iTrader: 0 / 0%
Starwind237 Is Recognizable
Rep Power: 5
Thanks I like the way the sessions work better. The idiots at school won't every be able to get on my proxy. XD
__________________
  Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -7. The time now is 05:55 PM.


vBulletin skin developed by: eXtremepixels
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.22447109 seconds (100.00% PHP - 0% MySQL) with 19 queries