Getting Subdomain Name With PHP?


Posted on 16th Feb 2014 07:03 pm by admin

I want to grab the subdomain name with PHP so I can generate database queries.

for example my subdomain is san-jose.mydomain.com

How would I go about grabbing the subdoman name with PHP? Thanks!

No comments posted yet

Your Answer:

Login to answer
256 Like 46 Dislike
Previous forums Next forums
Other forums

If statement help please.
Hello on my site I have 2 content boxes. 1 is for the main content (which is the biggest one) and th

Re-Order by ID Number
I have a cms set up for inputting an image, thumb, title, pdf, and eps. When input the database ass

check_changed_data - I can't get data from the called method event
I use check_changed_data to trigger my event method.

The method delivers er_changed_data.

Creating a custom API
I'm creating a site, and I need to create a basic API. Unfortunately I have no idea where to start.

Links not updating
I'm trying to fuel a simple navigation system for a news section. It works fine when it comes to ret

Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.

In the loop (for th

need help in mysql_num_rows()
please tell me what i am doing wrong in this query. it displays this error

Code: Warning: mys

Extra fields in main body and php required.
I'm new to PHP so please be gentle. I have a little php script below that works well.
The &quo

why isn't this PHP code working ???
it's suppose to find a name on the database.

<?php

$s = $_POST["lname&

Not adding to db
Hi, I can't figure out why it won't add the record to the database. It's just a simple form to get

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash