Hi guys
If this one has been done before, I apologise. I have searched the forum, but I'm not really sure what keywords to use. Anyway, I'd appreciate and answer to the following query:
I have a sitemap and for each webpage listed (in an <ol> list) I offer a link to the actual page (obviously) as well as a link to some details about the page. If the visitor clicks on the 'details' link, a little JavaScript URL produces a pop-up window with details about the page. The code for this looks like this example:
<ol class="sitemaplink">
<li>Geography: <a href="javascript:window.open('sitemap_details.php?page=geo',
'_blank', 'toolbar=no, resizable=yes, scrollbars=yes, status=no,
height=400, width=500')">details</a></li>
So the pop-up window appears and it contains PHP code (sitemap_details.php) to pull out the details of the page 'Geography' from a little MySQL table. The code in the file sitemap_details.php looks like this:
<?php
//Various includes for HTML header, db connection etc ...
$newpage = $page; // Pick up chosen page from sitemap.php, reg_glob is on
// Extract page content from DB
$result=mysql_query("SELECT title, description,
status, page FROM sitemap WHERE page='$newpage'");
if (!$result) // Procedure for failure here
//blah, blah, blah ...
else // Display content from DB
{
$row = mysql_fetch_array($result);
echo ("<h2>" . $row["title"] . "</h2><h3>" .
$row["description"] . "</h3><p>Status: " . $row["status"] . "</p>");
print "<br /><br />";
print "<p><a href=\"javascript:window.close();\">Close Window</a></p>";
print "</body>";
print "</html>";
}
?>
All this works like a dream - window pops up, content is correct ... but the browser seems to try and download something (download dialogue appears) and then immediately produces an error dialogue saying that a file couldn't be downloaded and you have to click on OK to make it go away. What's the problem and can I suppress this nasty download attempt and error dialogue?
Thank you very much for your help
Norman