Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a new window based on IP

Status
Not open for further replies.

techexpressinc

Programmer
Oct 28, 2008
67
US
Hi

techexpressinc said:
open a new window
You will get no new window with that code. In thread216-1554134 , where I posted that code, no window opening was mentioned.
techexpressinc said:
I put this in the body of html and nothing happen?
Of course. As I mentioned, that is PHP code, so in the [tt]body[/tt] of a HTML document will do nothing. Even more, neither in a PHP script which generates a HTML document will not work if you put it in the [tt]body[/tt]. The [tt]header()[/tt] function must be called before the content is output.


Feherke.
 
I do not regularly deal with this stuff and need pointers.
I now vaguely remember some the processes.

The PHP goes to hosting site in the cgi-bin directory with the suffix phpcode.pl.

The the HTML page hyper links to it to be redirected.

Does this sound like the way it works?

Russ
 
Hi

Russ said:
I do not regularly deal with this stuff and need pointers.
Neither I. But anyway, there are no pointers in PHP. ( It has references, which are somehow similar, but not the same. )
Russ said:
The PHP goes to hosting site in the cgi-bin directory with the suffix phpcode.pl.
Usually PHP scripts are not put in the cgi-bin/ directory. They can be anywhere. Usually PHP scripts have .php extension. Perl used to have .pl.


Feherke.
 
Growl - I am not there yet!

I put the code with the directory: cgi-bin
and then put this in the URL:
I get "Page Not Found?? why.."

if I put in the complete URL
I get HTTP Error 500 - Internal server error.

So, I am almost there Yippie.. I just need a little push/help.
Thx
Russ
 
Good point. See I got confused, I did install some Pearl code before. I did a rename back to filename.php.


I thought that cgi-bin would be a good place to "hide" the code.

I moved to htdoc folder and it works better there.

Russ
 
The example links appear to be to a real site. I'm hoping this exercise was simply for direction and not security since the whole world knows about these pages now.

If this IP check is for security, you should rename your targeted HTML files to something not easily guessed or modified (replacing 'bad' with 'good'). You can also employ a check on the targeted HTML files (as PHP files) to continue the verification of IP address.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top