Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
aniebel #1
fwrite() across mapped network drive
I'm trying to write an XML file across a local network on a mapped drive but it
seems to be more picky when I do that as opposed to writing it locally. It must
be a file as opposed to a name,value pair for Flash. This file will be used by
multiple apps.
Please forgive my nutty string manipulation. I'm new at this and have not
figured out how to do it more efficiently. I'm running PHP5 on a Windows 2000
if that makes a difference.
<?php
$dir = "X:\\";
$str_xml=array();
//set database access information as constants
DEFINE ('DB_USER', 'twist');
DEFINE ('DB_PASSWORD', 'tagny5');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'tagny_clients');
//make the connection
$dbconnect = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not
connect to MySQL: ' . mysql_error());
if($dbconnect){
//echo "connected";
};
//select database
$db = mysql_select_db(DB_NAME) OR die ('Could not select the database: ' .
mysql_error());
if($db){
//echo ", selected";
};
//make query from table
$query = 'SELECT client FROM tagny_clients GROUP BY client';
$result = mysql_query($query);
//begin XML
//main node
$str_xml = "<sharedtypes><lists Version='1'><list Version='1' name='Client'
values='";
for ($i = 0; $i<mysql_num_rows($result); $i++){
$row = mysql_fetch_assoc($result);
//$row['subclient'];
$str_xml .= $row['client'] . ', ';
}
//close nodes
$str_xml .= "'></list></lists></sharedtypes>";
///
$str_change_case = strtolower($str_xml);
$str_find_replace = str_replace("&"," & ", $str_change_case);
$str_find_replace2 = str_replace("_"," ", $str_find_replace);
$str_ucwords = ucwords($str_find_replace2);
//////////
$filename = "tag_client_list.xml";
//echo $dir.$filename.' ';
// Let's make sure the file exists and is writable first.
if (is_writable($dir.$filename)) {
if (!$fh = fopen($filename, 'w+')) {
echo "Cannot open file ($filename)";
exit;
}
// Write $str_ucwords to our opened file.
if (fwrite($fh, $str_ucwords) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ".$filename;
fclose($fh);
} else {
echo "The file $filename is not writable";
}
/////////
//fclose($fh);
//print xml
//echo $str_ucwords;
?>
aniebel Guest
-
#40117 [NEW]: Unable to access mapped network drive
From: jsbruns at selectionsheet dot com Operating system: Windows 2003 Server PHP version: 5.2.0 PHP Bug Type: Filesystem... -
XP Pro Mapped Network Drive question
I have set everyone up to a mapped network drive with a common, first time logon. I now want everyone to change their password but even though I... -
mapped network drive in windows explorer EXTREMELY slow
Hi, I am having an extremely frustrating and time wasting problem with Windows Explorer. Often, but not always, when I click on a mapped network... -
Removable disk, mapped network disk and drive letter problem
I don't know why this is such a big problem in Windows, but I hope somebody has a solution for it. You know those USB card readers used for... -
Mapped network drive fails
I have a Windows 2000 Server with AD, and all XP workstations. All users are setup with a P: drive that is mapped back to the server for their...



Reply With Quote

