Current location: Hot Scripts Forums » Programming Languages » PHP » very simple for php programmer....(URL functions)


very simple for php programmer....(URL functions)

Reply
  #1 (permalink)  
Old 01-27-09, 04:34 AM
creative ideas creative ideas is offline
Newbie Coder
 
Join Date: Jan 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
very simple for php programmer....(URL functions)

hi,

i m passing a id from my login page....
what i want is if user paste (http://localhost/earn/refrence.php?id=) link without any ID ..then he will be redirected to my registration page..
Please answer A.S.A.P!!!!
Reply With Quote
  #2 (permalink)  
Old 01-27-09, 04:57 AM
Yeroon's Avatar
Yeroon Yeroon is offline
Code Master
 
Join Date: Aug 2007
Location: Netherlands, Nijmegen
Posts: 850
Thanks: 2
Thanked 20 Times in 20 Posts
Put this at top of the page.

Code:
$checkID = $_GET["id"];
if(!(isset($checkID))) {
    header("Location: http://www.somepage.com/"); 
}
Make sure there is no html output before this code!
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Reply With Quote
  #3 (permalink)  
Old 01-27-09, 06:05 AM
chambaz chambaz is offline
Newbie Coder
 
Join Date: Mar 2008
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
really if its a login system you should store the id in a session this way no one could navigate to the page without logging in properly.
Reply With Quote
  #4 (permalink)  
Old 01-27-09, 01:10 PM
phpdoctor's Avatar
phpdoctor phpdoctor is offline
Code Guru
 
Join Date: Feb 2007
Location: New Zealand
Posts: 767
Thanks: 4
Thanked 2 Times in 2 Posts
Store a session like chambaz said otherwise your system is totally unsecure.
On every secure you need to check the session...

Good Luck,
Lex
__________________
01010000 01001000 01010000
Reply With Quote
  #5 (permalink)  
Old 01-27-09, 02:27 PM
ianbrind ianbrind is offline
Wannabe Coder
 
Join Date: Jul 2008
Location: Somerset UK!
Posts: 192
Thanks: 0
Thanked 0 Times in 0 Posts
Also add exit after the header

PHP Code:

header("Location: http://www.somepage.com/"); 
exit(); 
Reply With Quote
  #6 (permalink)  
Old 01-27-09, 10:40 PM
creative ideas creative ideas is offline
Newbie Coder
 
Join Date: Jan 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up thanks

hi,

thank you all
it will work fine and i am using everything in session.......................
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
simple url extraction script buzzbuilder Script Requests 1 07-24-08 06:51 AM
Need a JSP programmer for a simple payment page VanHost Job Offers & Assistance 2 11-30-05 10:38 AM
Simple URL rotator hosseinrz Script Requests 1 06-01-05 09:06 PM
Need a programmer to write some simple scripts phillipse Job Offers & Assistance 4 03-29-05 09:33 PM
Simple Code to go to specific URL maxo C/C++ 0 02-10-05 11:53 AM


All times are GMT -5. The time now is 08:27 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.