Hi,
I'm using PHP and I have a form that I want to use on many different sites. Say the form posts to "http://www.whateversite.com/upload.php". Is there a way to detect a site's url and return it as a variable, so I can simply type something like
"$url"."/upload.php"
instead of rewriting the code every time I use the form on a new site?
2006-07-12
06:22:11
·
2 answers
·
asked by
jat212406
1
in
Computers & Internet
➔ Programming & Design
Ok - I think I got it... This works for what I need:
PHP:
"http://www".$_SERVER[SERVER_NAME]."/upload.php"
or Javascript:
"http://www."+document.domain+"/upload.php"
First time on Yahoo answers. Seems like there should be a way to answer your own question or respond to other's answers
2006-07-12
08:35:47 ·
update #1