Dynamic Image SRC

This is a discussion on Dynamic Image SRC within the PHP Language forums, part of the PHP Programming Forums category; "Derek Fountain" <nospam@example.com> escreveu na mensagem news:4210739c$0$30059$5a62ac22@per-qv1-newsreader-...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 02-17-2005
RootShell
 
Posts: n/a
Default Re: Dynamic Image SRC

"Derek Fountain" <nospam@example.com> escreveu na mensagem
news:4210739c$0$30059$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
>> This works fine with the front page, but in the index page for
>> http://localhost/gongfamily/daevid/
>>
>> the images are broken, because the links are relative. I could
>> make the links absolute, but then I couldn't use my testing
>> server. There might be an Apache solution to this, such as
>> setting up some sort of alias or virtual root, but that stuff is
>> beyond me.

>
> My current project lives in a directory called 'dp', and my test machine
> is
> called 'monkey' (or 'localhost'). I use this function to set a couple of
> path variables:
>
> function setPaths( &$filePath, &$httpPath )
> {
> if( (strcmp( $_SERVER['SERVER_NAME'], "monkey" ) == 0) ||
> (strcmp( $_SERVER['SERVER_NAME'], "localhost" ) == 0) ) {
> $filePath = "/home/derek/public_html/dp/";
> $httpPath = "/~derek/dp/";
> } else {
> $filePath = "/home/derek/html/www.dp.com/public_html/";
> $httpPath = "/";
> }
> }
>
> This gets called at the top of each page as part of the standard
> boilerplate
> code I always use. I then access images and the like with $httpPath and
> text and config files with $filePath.
>
> --
> The email address used to post is a spam pit. Contact me at
> http://www.derekfountain.org : <a
> href="http://www.derekfountain.org/">Derek Fountain</a>


I used something similar and it's pretty simple :)

Regards,
RootShell


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:11 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0