webboy Posted January 10, 2007 Share Posted January 10, 2007 Hi all I m a very new hereto coding.I have been playing around with PHP and wish to have my domain display without the prefix also suffixeg have www.mydomain.co.uk by usign the $_server[...How do i remove the www also the .com or .co.uk from the information ? so i am left with mydomin Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted January 10, 2007 Share Posted January 10, 2007 so what you want to show on your visitor's url address bar is only "mydomain"? Quote Link to comment Share on other sites More sharing options...
webboy Posted January 17, 2007 Author Share Posted January 17, 2007 what i want to show is in the text bodyI would like to display domain name eg (mydomain) and remove the www and .comthen be able to repeat it within the text by putting it within a string, Quote Link to comment Share on other sites More sharing options...
DeathStar Posted January 17, 2007 Share Posted January 17, 2007 dont realy know but i think you should most likely get a script to see what page the user is wviewing from and go from there. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 17, 2007 Share Posted January 17, 2007 check out substr, str_replace, etc string functions. Quote Link to comment Share on other sites More sharing options...
webboy Posted January 18, 2007 Author Share Posted January 18, 2007 Yes I was thinking along those linesbut as I have no idea how to program php.. Could anybody help hereas I all I wish to achieve is every time I wish to print the domain name I don't have to retpy the info as it site will be moved and replacted ahh just thinking out loud I will look up in dreamwever to do a left$ Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 18, 2007 Share Posted January 18, 2007 If you have NO idea, it'd be quicker to pay someone to work on it for you. If you're learning PHP, it'd be good for you to try to figure it out from the documentation.A quick solution would be to have one var with the domain and just change it when you move it.$domainURL = "mydomain.com";When you move, change to $domainURL = "mynewdomain.com";and then just <?=$domainURL?> when you need it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.