/    Sign up×
Community /Pin to ProfileBookmark

opendir() connecting to one area on server but not another

I’m trying to access multiple folders throughout several areas on several PCs to move images around. I’m having one problem area though and I’m not sure why this is happening.

Here’s what I have:

[code=php]

$small_path = “images/myimages/”;
$med_path = “\\server3/images/jpeglibrary/”;
$local_path = “\\server3/images/”;
$local_path2 = “\\server3/folder1/folder2/images/jpeg/”;

//WORKS
$small = opendir($small_path) ? “Connected <br>” : “Did not connect!<br>”;
//WORKS
$med = opendir($med_path) ? “Connected<br>” : “Did not connect!<br>”;
//WORKS
$local1 = opendir($local_path) ? “Connected <br>” : “Did not connect!<br>”;
//DOES NOT WORK
$local2 = opendir($local_path2) ? “Connected<br>” : “Did not connect!<br>”;

echo $small . $med . $local1 . $local2;

//WORKS
echo “<img src=”{$local_path2}1200 1256553.jpg”>”;

[/code]

$local_path2 is my problem child. It gives me this error

[QUOTE]

Warning: opendir(server3/folder1/folder2/images/jpeg/) [function.opendir]: failed to open dir: Invalid argument

[/QUOTE]

I’ve checked permissions on all the folders in the path of $local2 and there are no restrictions. I know that the path is good because it the <img> link works. I just don’t know what else to think.

I’m not sure if this matters or not but some accounting software is installed on server3 and $local_path2 is within it’s directories.

Any ideas? ?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@bokehFeb 23.2006 — [B]server3/folder1/folder2/images/jpeg/[/B] Run that from the dos prompt and see if you can access the directory.
Copy linkTweet thisAlerts:
@CWCJimmyauthorFeb 23.2006 — Yessir, it sure does
Copy linkTweet thisAlerts:
@NogDogFeb 23.2006 — Just to see if you can get PHP to tell you anthing more:
[code=php]
//DOES NOT WORK
$errorLevel = ini_get('error_reporting'); // DEBUG
error_reporting(E_ALL); // DEBUG
$local2 = opendir($local_path2) ? "Connected<br>" : "Did not connect!<br>";
error_reporting($errorLevel); // DEBUG
[/code]
Copy linkTweet thisAlerts:
@CWCJimmyauthorFeb 23.2006 — No luck with that. Nothing displayed.

I'm assuming all I have to do is pop that code where $local2 was.
×

Success!

Help @CWCJimmy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...