Hi there,
This is a problem which has both me and another programmer completely stumped. I hardly even know how to ask the question, since I\'m not really sure where the error is coming from at all. Anyways, here\'s the scenario. I\'m using PHP to connect to a MySQL server and retrieve the path name for different files. Since I need the file to open up in a new browser window, I\'m using PHP to output javascript (using the window.open method). I had done this before, in an earlier version of my program, and it worked perfectly. But for some strange reason, although this version is very similar to the old version, the window refuses to open...saying instead, \"Done, but errors on the page.\"
I have to note that the older version and the newer version differ quite a bit before the javascript, but I\'ve used identical or close to identical javascript code.
I\'ve also checked the input to the javascript code using a printf statement, and the $Device, $Technology, $Foundry, and $Checklist variables are exactly the same between the two versions. The only difference is that one will and one will not open.
Also, the strange thing is that the new program will open all the directories in the pathname leading up to the final file...it just refuses to open the file (which happenes to be an excel file).
Anyway, sorry for the long question, but if anyone has a clue as to where the problem lies...please let me know. It would be greatly, greatly appreciated. The code is included below:
-- thanx a bunch,
xijia
P.S. let me know if you need more info
Older version:
$Checklist_Results = mysql_query($Checklist_Query);
$Checklist_Row = mysql_fetch_array($Checklist_Results);
$Checklist = $Checklist_Row[\"Checklist\"];
// all four variables are identical in the newer version
echo \"<script>\";
printf (\"window.open(\'U:\/ProductFile\/%s\/%s\/%s\/%s\');\n\", $Device, $Technology, $Foundry, $Checklist);
echo \"</script>\";
?>
Newer version:
$Checklist_Query =
\"select Checklist from Checklist where DeviceID =\".$DeviceID.
\" and TechID = \".$TechID.\" and FoundryID = \".$FoundryID;
$Checklist_Results = mysql_query($Checklist_Query);
$Checklist_Row = mysql_fetch_array($Checklist_Results);
$Checklist = $Checklist_Row[Checklist];
$http = \"File://Erp/Yield_Data/ProductFile/\".$Device.\"/\".$Technology.\"/\".$Foundry.\"/\".$Checklist;
echo \"<script>\";
printf (\"window.open(\'$http\')\");
echo \"</script>\";
?>