You are here: Problem Getting Script's URL ($_SERVER['PHP_SELF'] not what I expected) « PHP Programming Language « IT news, forums, messages
Problem Getting Script's URL ($_SERVER['PHP_SELF'] not what I expected)

Posted by Tom on 11/03/06 03:08

I have a function that restricts access to a page to logged in users.
When a user who isn't logged in goes to the page, it will dynamically
generate a login form.

I'm trying to use it in conjunction with the free shared SSL
certificate offered by my host. To use SSL, you would change a URL
like this

http://mydomain.com/page.php

to

https://ssl.myhost.com/mydomain.com/page.php

My problem: when my script dynamically generates the login form, it
uses the $_SERVER['PHP_SELF'] value in the action field. But this ends
up being '/page.php' rather than '/mydomain.com/page.php' so my form
gets submitted to

https://ssl.myhost.com/page.php

instead of

https://ssl.myhost.com/mydomain.com/page.php

Simple I thought, I'll just use the SERVER or ENV variable that gives
me the full url. My problem: it doesn't seem to exist!

Anyone have any suggestions? Anyone else confront and solve this
issue?

Thanks,
Tom

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация