RE: [PHP] inspirational

2002-05-26 Thread John Holmes
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

Re: [PHP] inspirational

2002-05-26 Thread Michael Virnstein
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

Re: [PHP] inspirational

2002-05-26 Thread Michael Virnstein
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

Re: [PHP] inspirational

2002-05-26 Thread Michael Virnstein
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:

RE: [PHP] inspirational

2002-05-26 Thread Ray Hunter
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