Page 1 of 1
Help needed with some code
Posted: Thu Oct 27, 2011 7:02 pm
by countrydj
Hi Guys..
I am trying to get one of two codes to work:
Both codes work individually, but I want either of them to work.
These both work:
Code: Select all
if(getenv(REMOTE_ADDR) == $vars["admin ip"]){
Code: Select all
if($_REQUEST['passwd'] == "virgo"){
This doesn't work:
Code: Select all
if(getenv(REMOTE_ADDR) == $vars["admin ip"]) or if($_REQUEST['passwd'] == "virgo"){
Can anybody advise me what the above code should be?
Thanks,
John C
Re: Help needed with some code
Posted: Thu Oct 27, 2011 7:12 pm
by Celauran
countrydj wrote:Code: Select all
if (getenv(REMOTE_ADDR) == $vars["admin ip"] || $_REQUEST['passwd'] == "virgo") {
Hardcoding your password isn't a real good idea, though. Nor is storing your password in plaintext.
Re: Help needed with some code
Posted: Thu Oct 27, 2011 7:41 pm
by countrydj
Hi Celauran..
That was quick !!!!
Thanks for taking the time to help me.
I should have known this but my mind is 'fuddled' at the moment.
Hardcoding your password isn't a real good idea, though. Nor is storing your password in plaintext.
I accept what you say.
However, I use my ip number to access the admin from my PC, but when I am away from my PC I need some way of accessing my admin.
Have you ay suggestions ???
John C
Re: Help needed with some code
Posted: Thu Oct 27, 2011 7:44 pm
by Celauran
Salt your password, pepper it, hash it, and store it in a database.
Re: Help needed with some code
Posted: Fri Oct 28, 2011 6:34 am
by countrydj
Hi Celauren...
Many thanks for your reply.
It just shows how 'thick and behind the times' that I am.
I have never heard of this, but based on your advice, I will check it out AND use it.
Again, MANY THANKS...
John C