1

I've two sub-domains : 1) root/mobile where mobile points to m.mydomain.com 2)root/beta where beta points to beta.mydomain.com

But I want both the sub domains to access some common folders that are under root like root/images

iThink
  • 1,239
  • 3
  • 13
  • 34
  • Is it on a GNU/Linux? If so, can you not just symbolic link the dirs you need? – Jonnix Sep 13 '11 at 18:35
  • If you check out the commands on http://en.wikipedia.org/wiki/Symbolic_link you may find a simple solution to your question. – Jonnix Sep 13 '11 at 18:39
  • Wait. Is there a problem accessing `root/images` from the two web roots? Or is `images` something you want to be web accessible? Just looking for some clarity on the issue. – webbiedave Sep 13 '11 at 18:44
  • i want root/images to be accessed from two differnet sub domains. – iThink Sep 13 '11 at 18:50

2 Answers2

0

You can access files in a directory higher than the one you are in with ... For example, let's say we're in root/mobile/index.php and we want to access root/lib/include.php. You could include the file with include('../lib/include.php');

Note: This assumes that the "common files" you are trying to access are both accessible from this user account.

Cyclone
  • 17,939
  • 45
  • 124
  • 193
  • well as I've said root/mobile where mobile points to m.mydomain.com which makes "mobile" its root. So my question is how can I go beyond root & access say root/lib/include.php – iThink Sep 13 '11 at 18:56
  • Are they in separate filesystems? – Cyclone Sep 13 '11 at 20:34
  • This worked. I dont know wht went wrong in the first place. I tried now it worked. gr8! – iThink Sep 14 '11 at 15:18
-1

See http://www.php.net/manual/en/function.imagecreatefromjpeg.php you could use it to have a PHP file that you place in both root/mobile and root/beta. It could then read in images from root/images.

n8schloss
  • 2,723
  • 2
  • 19
  • 27
  • How? It looks like they were looking for a way to use PHP to load images from a common directory on two different sub doamins. Loading the images into PHP and then using PHP to show it would accomplish this. – n8schloss Sep 13 '11 at 18:43
  • @someoneHuman this is not the answer Im looking for. Images was just an example. That common files cud be anything say class files – iThink Sep 13 '11 at 18:46
  • Your code explains how to make an image resource from a JPG file and then it "can read in images from root/images". That doesn't explain HOW to read in those images from root/images, all you've done is repeat what he said he needed done. – Cyclone Sep 13 '11 at 18:47