PHP & CPanel Related Question

ukhost

Well-Known Member
Jan 8, 2002
222
0
316
PHP & CPanel Related Question

Hi,

I'm looking at createing a php page that I can place in the skeleton dir to copy to each account as it is created.

What I am look for is the php code to get the url the user has entered and display this somewhere in the document!

Any ideas?

Kind Regards,

Neil
 

TomB

Member
Sep 3, 2002
19
0
151
I snagged this bit of code off of this board I think... hope this helps.

&?php
$data = explode(&.&, $GLOBALS[&HTTP_HOST&]);
$domain = $data[1] . &.& . $data[2];
echo &&html&&title&$domain&/title&&body&&;
echo &The domain &B&$domain&/B& is Under Construction &/body&&/html&&;
?&

Tom
 

Holbrookau

Active Member
Aug 23, 2002
35
0
156
Here's the one I use - in java:

&SCRIPT LANGUAGE=&JavaScript&&
&!-- Begin
{
document.write(location.href);
}
// End --&
&/SCRIPT&

Just put that anywhere you want the address to appear.
 

JustinK

Well-Known Member
Sep 4, 2001
251
0
316
[quote:e4d6cb2fbe][i:e4d6cb2fbe]Originally posted by TomB[/i:e4d6cb2fbe]

I snagged this bit of code off of this board I think... hope this helps.

&?php
$data = explode(&.&, $GLOBALS[&HTTP_HOST&]);
$domain = $data[1] . &.& . $data[2];
echo &&html&&title&$domain&/title&&body&&;
echo &The domain &B&$domain&/B& is Under Construction &/body&&/html&&;
?&

Tom[/quote:e4d6cb2fbe]

I'm not quite understanding that code since you split it via the period and then the period you just split it by back in... this is the example I give for users to use:

[quote:e4d6cb2fbe]
&html&
&head&
&title&Welcome to &?=$_SERVER[&HTTP_HOST&]?&&/title&
&/head&
&body&
Welcome to &?=$_SERVER[&HTTP_HOST&]?&!
Your domain is now pointing to _insert hostname here_ .
_insert more info here_
&/body&
&/html&
[/quote:e4d6cb2fbe]
 

ukhost

Well-Known Member
Jan 8, 2002
222
0
316
Hi Folks,

Thanks for the code snippets, will go and build my page now! :)

Kind Regards,

Neil