Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 22nd, 2005, 04:17 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default Grab url address

Something which should be really simple... But I cannot find it anywhere :(

I have my dsl modem configured to foward http request to the server; and this is working fine.

But what I want to do, is host more websites on the same server.

so what I was thinking of doing is basically having something in the index.php which says something like:

<?php
$urlname=" ".$_SERVER[" ???????? "];
if(strpos($urlname, "urladdress1") == true) {
.
.
}

if(strpos($urlname, "urladdress2") == true) {
.
.
}

etc..

if someone know how to do this I will really appreciate your help :)
 
Old December 23rd, 2005, 07:25 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Something like this?
Quote:
quote:
<?php
$urlname = $_SERVER['HTTP_HOST'];
if(strpos($urlname, "urladdress1") == TRUE) {
    .
    .
    .
}
if(strpos($urlname, "urladdress2") == TRUE) {
    .
    .
    .
}
?>
`~@#\^%&*/\.<.\/-|+|_!:;..=?>
Students' finances
 
Old December 23rd, 2005, 08:19 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think I looked at this problem the wrong way to be honnest.

I'm looking at reconfiguring my apache server to host multiple website on 1 server; I think that's the correct way to do it :)

Thanks for you help though :) I appreciate it ^^
 
Old December 23rd, 2005, 09:04 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Yes. Apache can host 1000s (unlimited) Web sites on a single machine. You can easily do it, if you've access to httpd.conf file.
http://www.mediasworks.com/tutorials...de_windows.htm

`~@#\^%&*/\.<.\/-|+|_!:;..=?>
Students' finances





Similar Threads
Thread Thread Starter Forum Replies Last Post
Application that can grab & display URL of webpage josephx VB.NET 3 November 4th, 2007 11:59 AM
How do i encoding a url address kevo PHP How-To 3 July 17th, 2007 03:29 AM
how to grab and store executed value of url method PHP How-To 0 March 30th, 2006 01:57 PM
URL address Security CMensah Classic ASP Basics 3 September 5th, 2003 07:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.