textbox and mysql
#1
Posted 15 January 2007 - 01:36 AM
#2
Posted 15 January 2007 - 01:45 AM
You're on the world's largest tutorial indexing site. Easy question...
#3
Posted 15 January 2007 - 02:17 AM
note: already know the DB stuff. Need to know how to get the address bar info.
<edit>
I have this so far
$address = $_SERVER['HTTP_REFERER'];
But i need the actual page its on. Not the one before that.
Edited by ProjectWhat, 15 January 2007 - 02:46 AM.
#4
Posted 15 January 2007 - 07:51 AM
if( $_SERVER['HTTPS'] == 'on' ) {
$url = 'https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
} else {
$url = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
}
With this code, you are seeing if the $_SERVER['HTTPS'] is on, if it is the user is using the https protocol, and if it is off, they are just on http.
If you want to use it for ftp:// aswell it will take a little modifying of the script.
This again is a frequently asked question, quick forum search / database search will have your answer.
Matt
#5
Posted 16 January 2007 - 05:20 PM
#6
Posted 17 January 2007 - 02:02 PM
rc69, on Jan 16 2007, 05:20 PM, said:
Yeah you could. But it would be much more complex. What do you think those tracking images on websites do?
#7
Posted 17 January 2007 - 02:06 PM
#8
Posted 17 January 2007 - 02:39 PM
ProjectWhat, on Jan 15 2007, 02:17 AM, said:
I don't think that can be done.
If you're at yoursite.com and you type "othersite.com" into the address bar, there is no GET or POST. The user will just goto othersite.com.
However.
You might be able to do something with this:
http://ajaxian.com/a...ton-overloading
It stops the user from leaving the page - you might be able to use it to collect the address box, then pass it to php, then redirect to where the user wanted to go.
#9
Posted 17 January 2007 - 04:53 PM
Dayon, on Jan 17 2007, 01:39 PM, said:
ProjectWhat, on Jan 15 2007, 02:17 AM, said:
I don't think that can be done.
If you're at yoursite.com and you type "othersite.com" into the address bar, there is no GET or POST. The user will just goto othersite.com.
However.
You might be able to do something with this:
http://ajaxian.com/a...ton-overloading
It stops the user from leaving the page - you might be able to use it to collect the address box, then pass it to php, then redirect to where the user wanted to go.
Hmm, that sounds like an interesting idea. Even with how evil it sounds at first.
Make sure you make it secure, as there are some malicious ways it seems that people use that method.
#10
Posted 01 February 2007 - 06:52 PM
#11
Posted 02 February 2007 - 12:52 AM
The reason for this, i'm sure, is security. There may be some hacks you can try to get around this, but none of them will be pretty, convenient, or in anyway sane.
My question to you is, why would you want to do this? And why don't you just put an "address" bar on your site that would first go to a logging page, then redirect to the address entered?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
