Hello,
I'm working for a school assignment on a photo website. We managed to get almost everything done except for downloading the .RAW files, which you can only do when you are logged in. I'm really stuck here... I hope someone can help me.
Also, an error got into my code right now:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in D:\studenten_website\website\61113\WEBSITE\Copyofzw.php on line 60
PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in D:\studenten_website\website\61113\WEBSITE\Copyofzw.php on line 60
Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
session_start();
include('connection.php');
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zwart Wit</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<?php
if(!empty($_SESSION['ingelogd']))
{
$rawdown = "SELECT raw_naam FROM foto WHERE jpg_naam = '".$imgnaam."'";
echo "<a href='download.php?$rawdown'>klik hier</a>";
}
echo '<script type="text/javascript">' ;
echo '<!--' ;
echo 'function MM_swapImgRestore() { //v3.0';
echo ' var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;';
echo '}';
echo 'function MM_preloadImages() { //v3.0';
echo ' var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();';
echo ' var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)';
echo ' if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}';
echo '}';
echo 'function MM_findObj(n, d) { //v4.01';
echo ' var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {';
echo ' d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}';
echo ' if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];';
echo ' for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);';
echo ' if(!x && d.getElementById) x=d.getElementById(n); return x;';
echo '}';
echo 'function MM_swapImage() { //v3.0';
echo ' var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)';
echo ' if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}';
echo '}';
echo '//Thumbnail';
echo 'vanaf_links = 0;';
echo 'vanaf_boven = 0;';
echo 'grootste_breedte = 400+20;';
echo 'grootste_hoogte = 369+20; ';
echo '//Thumbnail';
echo 'if (parseInt(navigator.appVersion.charAt(0))>=4){';
echo 'var isNN=(navigator.appName=="Netscape")?1:0;';
echo 'var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}';
echo "var optNN='scrollbars=yes,width='+grootste_breedte+',height='+grootste_hoogte+',left='+vanaf_links+',top='+vanaf_boven;";
echo "var optIE='scrollbars=yes,width=150,height=100,left='+vanaf_links+',top='+vanaf_boven;";
echo 'function popBeeld(BeeldURL,BeeldTitel){';
echo "if (isNN){imgWin=window.open('about:blank','',optNN);}";
echo "if (isIE){imgWin=window.open('about:blank','',optIE);}";
echo 'with (imgWin.document){';
echo "writeln('<html><head><title>Bezig met inladen ...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');";
echo "writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');";
echo "writeln('isNN=(navigator.appName=="'Netscape'")?1:0;');writeln('isIE=(navigator.appName.indexOf("'Microsoft'")!=-1)?1:0;}');";
echo "writeln('function aanpassen_aan_beeldgrootte(){');writeln('if (isIE){');writeln('window.resizeTo(120,120);');";
echo "writeln('width=240-(document.body.clientWidth-document.images[0].width);');";
echo "writeln('height=120-(document.body.clientHeight-document.images[0].height);');";
echo "writeln('window.resizeTo(width,height);}');writeln('if (isNN){');";
echo "writeln('window.innerWidth=document.images["'BeeldNaam'"].width;');writeln('window.innerHeight=document.images["'BeeldNaam'"].height;}}');";
echo "writeln('function maak_titel(){document.title="'+BeeldTitel+'";}');writeln('</sc'+'ript>');";
echo "writeln('</head><body bgcolor=ffffff scroll="'yes'" onload="'aanpassen_aan_beeldgrootte();maak_titel();self.focus()'" onblur="'self.close()'">');";
echo "writeln('<img name="'BeeldNaam'" src='+BeeldURL+' style="'display:block'"></body></html>');";
echo 'writeln(' ');';
echo 'close(); ';
echo '}}';
//-->
echo '</script>';
?>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="dingetje">
<div id="hallo">
<a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Rollover1','','WEBAFB/bannerknoppen/bannerknop1-mouseover.gif',1)">
<img src="WEBAFB/bannerknoppen/bannerknop1.gif" name="Rollover1" width="121" height="50" border="0" id="Rollover1" /></a>
<a href="cato.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Rollover2','','WEBAFB/bannerknoppen/bannerknop2-mouseover.gif',1)"><img src="WEBAFB/bannerknoppen/bannerknop2.gif" name="Rollover2" width="121" height="50" border="0" id="Rollover2" /></a>
<a href="Contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Rollover3','','WEBAFB/bannerknoppen/bannerknop3-mouseover.gif',1)"><img src="WEBAFB/bannerknoppen/bannerknop3.gif" name="Rollover3" width="121" height="50" border="0" id="Rollover3" /></a>
<a href="login.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Rollover4','','WEBAFB/bannerknoppen/bannerknop4-mouseover.gif',1)"><img src="WEBAFB/bannerknoppen/bannerknop4.gif" name="Rollover4" width="121" height="50" border="0" id="Rollover4" /></a></div>
</div>
<div id="pro5">
<p align="center"><a href="javascript:popBeeld('WEBAFB/Uitwerkingen/1/2eMiddellandstraat1949.jpg','')"<?php $imgnaam = '2eMiddellandstraat1949.jpg' ?>><img src="WEBAFB/Uitwerkingen/1/2eMiddellandstraat1949.jpg" alt="Klik om de foto te vergroten..." border="0" width="250" height="200" /></a><br /></p>
</div>
</body>
</html>
Thanks a lot!