Web Hosting Deals Holiday Logo Design Webcam Chat Website Header Templates Register domain Search Engine Optimisation Web Hosting
Go Back   Talk Mania Forum > Programming / Scripting / Coding

Programming / Scripting / Coding Got a question about : PHP / Perl / Java / JavaScript / CGI Scripts / JavaScript coding. Ask here! We'll get you the answers !

 Image
Buy Sell Downloads

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-16-2007, 03:09 PM
Junior Member
 
Join Date: Feb 2007
Posts: 21
salaam205 is on a distinguished road
Thumbs up php if / else

hi, it is my first thread in this clup so i would like to give you all a php code
this code is
example you have a page and we need if we open this page to say ( hi admin welcome back) if i am the admin if not ( you are not the admin )
PHP Code:
<?  
if ($REMOTE_ADDR == "88.213.6.149")
 echo 
"hi admin welcome back";
else
 echo 
"you are not the admin";
?>
change this (88.213.6.149) to your ip
that is all thanks

Reply With Quote
  #2 (permalink)  
Old 02-16-2007, 03:10 PM
Junior Member
 
Join Date: Feb 2007
Posts: 21
salaam205 is on a distinguished road
is there any quesion?
Reply With Quote
  #3 (permalink)  
Old 03-11-2007, 02:15 PM
Junior Member
 
Join Date: Oct 2006
Posts: 10
Phoinx is on a distinguished road
Of a nice one. I haven't thought about that
Reply With Quote
  #4 (permalink)  
Old 03-12-2007, 10:08 AM
Junior Member
 
Join Date: Mar 2007
Posts: 11
calmlikeabomb is on a distinguished road
I'll contribute a little to this thread.

PHP Code:
<?  
if ($REMOTE_ADDR == "88.213.6.149" && isset($_COOKIE['admin'])) {
 echo 
"hi admin welcome back";
}else{
 echo 
"you are not the admin";
}
?>
This will now also check to see if a cookie is set, along with the validating the administrators i.p. address
Reply With Quote
  #5 (permalink)  
Old 07-18-2007, 03:23 PM
Junior Member
 
Join Date: Jul 2007
Location: QC, Philippines
Posts: 1
fairyjerry14 is on a distinguished road
Send a message via MSN to fairyjerry14 Send a message via Yahoo to fairyjerry14
what if?

hi.. this is my first reply here.. a little question about that one who determine the admin by its IP add.. what if i use a proxy IP and use the same IP as the admin? hmm.. thanks i hope this thing should help... if you have answers to prevent that please i want to know your answers.. thanks again..
Reply With Quote
  #6 (permalink)  
Old 07-18-2007, 08:21 PM
Senior Member
 
Join Date: May 2007
Posts: 181
Blog Entries: 1
skyfe is on a distinguished road
Code:
<?   
if ($_SERVER['REMOTE_ADDR'] == "88.213.6.149") { 
echo "hi admin welcome back"; 
}else{ 
echo "you are not the admin"; 
} 
?>
It should be.
Reply With Quote
  #7 (permalink)  
Old 07-19-2007, 06:59 PM
Junior Member
 
Join Date: Jul 2007
Posts: 20
Richard180 is on a distinguished road
really cool here people help people!

Reply With Quote
Reply

Bookmarks

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
Forum Jump


All times are GMT +2. The time now is 02:51 AM.


Fake ID

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC8
Forums Copyright © Talk-Mania.com