If you're getting this discouraged over creating a URL, then maybe you
should give this stuff up. There's no variable that gives you the full
URL of your script, deal with it.
What is this parse() function you're using? What does it do? Why is this
"over kill and BS"?
Try this:
$myurlvar = http
but the scriptname itself will be included there.
Try this, if you don't want the scriptname to be included.:
$url = preg_replace('/^(http:\/\/)[^\/]+((\/[^\/])*\/)([^\/]+)$/',
'\\1$SERVER_NAME\\2', $SCRIPT_URI);
Haven't tested them, but should work.
Michael
"Michael Virnstein" <[EMAIL PROTECT
typo:
$url = preg_replace('/^(http:\/\/)[^\/]+(\/.*)$/', '\\1$SERVER_NAME\\2',
$SCRIPT_URI);
Michael
"Michael Virnstein" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> try:
>
> $url = preg_replace('/^(http:\/\/)[^\/]+(\/.*)$, '\\1$SERVER_NAME\\2',
> $S
try:
$url = preg_replace('/^(http:\/\/)[^\/]+(\/.*)$, '\\1$SERVER_NAME\\2',
$SCRIPT_URI);
Michael
"Jtjohnston" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I want to detect the url my .php lies in.
>
> This is over kill and BS:
>
> $myurlvar = "http:
Why don't you try something like this...do a system call to pwd and
strip out the portion of the url that you know is the upper directory.
Then you can exchange that for the http://www.site.com/ and then add
the additional directories to the end and call the script name...there
might not be a fun
5 matches
Mail list logo