0 Users appreciate this thread.
11Drago (2014-05-10 14:26:28)Well this is helpful to be people who have experience, but can't help anyone who has no experience with making a register or login.
CoolApps (2014-05-15 11:53:16)^^ Well, they do need to look at how Logins and Registers work.
Newer account: NodePoint
CoolApps (2014-05-19 15:02:18)Well yeah, but what if you're on a mobile network or something?
Newer account: NodePoint
SPCOxion (2014-05-24 04:00:49)Even better:
if($_SERVER['REMOTE_ADDR'] != 'Put your IP here'
//redirect
}
Doesn't need a login/register, and it's much harder to hack into
2014-05-24 11:02:33
CoolApps (2014-05-30 17:15:33)Bad idea if you have a mobile network.
Plus, you have to make your website really hard to hack anyway so therefore, detections via IP is useless.
Newer account: NodePoint
GuitarBoy (2014-06-26 04:15:30)Or you could just use $_GET to make a secret key that only YOU will know.
if(!isset($_GET['key']) || $_GET['key'] != '123abc'
http://m.ajango.org - Ajango
New social networking website coming this year! Check for updates frequently!
Ajango Forum Thread
New social networking website coming this year! Check for updates frequently!
Ajango Forum Thread
SPCOxion (2014-06-26 06:06:07)Maybe even a cookie? ^
I know it sounds odd, but wouldn't that be t least somewhat cool?
GuitarBoy (2014-06-27 01:31:40)Yeah, my method isn't something you should use for a serious production.
http://m.ajango.org - Ajango
New social networking website coming this year! Check for updates frequently!
Ajango Forum Thread
New social networking website coming this year! Check for updates frequently!
Ajango Forum Thread
CoolApps (2014-06-27 17:27:25)Yeah, using GET is a good idea as well.
I wouldn't use OR for that, your code basically shows the content if you don't have GET in the URL or have the code correct.
BTW, just noticed your code won't work since you don't have {}.
Anyway, use AND (&& ) instead, and use ELSE for that as well.
The reason why I didn't use GET is because it's just for detecting by cookie content, I'm not intending a page which requires GET input for verification.
2014-06-28 00:31:26
Newer account: NodePoint
epicpwner2003 (2014-07-10 04:31:08)GuitarBoy's method isn't very secure, because someone can just look into the code using a Chrome debugger or Firebug and see the code.
...the noise the human language makes when it screams in agony. It is a pretty funny noise.
-FluxerCry
Click here if you have a crush on me. (No one)
-FluxerCry
Click here if you have a crush on me. (No one)
CoolApps (2014-07-11 16:28:52)^ And plus, if that was the case then pretty much all sites which use PHP would be "hacked" (SQL database info reviled, able to add your own PHP code etc.)
Newer account: NodePoint
GuitarBoy (2014-07-27 20:44:48)What are you guys saying?
It's PHP. You can't view it in Firebug or any kind of dev tools panel.
The only thing you DO see are cookies. $_GET is not a cookie. It is part of a query string. And if you have no idea what the correct key for the query is, you'll never be able to access it unless you guess.
And my code DOES work @CoolApps. It is a single-line if statement therefore {} are not required. Try it. It's the same for JavaScript.
http://m.ajango.org - Ajango
New social networking website coming this year! Check for updates frequently!
Ajango Forum Thread
New social networking website coming this year! Check for updates frequently!
Ajango Forum Thread
Log in to submit a comment
Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)
New registered users today: 7
Newest registered user: ElegantVulpes
This is completely simple and quick, I will also explain how it works.
<?php
if ($logged != 'Andre'
// Add redirects here or whatever
}
?>
What above basically says is if $logged (which is a variable, replace with your own such as cookie or session) is NOT (!=) "Andre" then [Enter PHP executed if that user or content doesn't match the specified].
Enjoy.