Solved

php, need file path but starting at domain and user account, not complete path from server

Posted on 2016-08-17
1
51 Views
Last Modified: 2016-08-17
I have the following php code:

echo dirname(__DIR__).$file['name']

Open in new window


which returns:

/var/www/vhosts/zenbinder.com/httpdocs/vault/includeIMG_4300.JPG.jpeg

But I need it to return:

http://zenbinder.com/vault/smithmike/IMG_4300.JPG.jpeg

FYI -- the "smithmike" is already being stored in a php variable "$username" so we can pull it from there
0
Comment
Question by:edavo
1 Comment
 

Accepted Solution

by:
edavo earned 0 total points
ID: 41760484
Since the domain and basic path was static, I found on another site, just keep it simple and use a static path, until you need to call the dynamic user and file. Much simpler than I thought.

<?php echo "http://www.zenbinder.com/vault/".$username."/".$file['name']?>
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now