TheDutchBeast Posted December 13, 2012 Share Posted December 13, 2012 (edited) I have a picture display code. But the picture is not vertically aligned and I just can't get it to work. What am I doing wrong? One of the last rules contains the vallign; print"<img src=\"$foto\" width=\"$screenW\" heigth=\"$screenH\" valign=\"middle\">"; Thanks in advance. Dave <?php include '../databaseconnectie/DBconnection2.php'; // connectie toevoegen via include if(isset($_POST['check'])){ $check = $_POST['check']; } elseif(isset($_GET['check'])){ $check = $_GET['check']; } else { $check = "";} if(isset($_POST['screenW'])){ $screenW = $_POST['screenW']; } elseif(isset($_GET['screenW'])){ $screenW = $_GET['screenW']; } else { $screenW = "";} if(isset($_POST['screenH'])){ $screenH = $_POST['screenH']; } elseif(isset($_GET['screenH'])){ $screenH = $_GET['screenH']; } else { $screenH = "";} if(isset($_POST['teller'])){ $teller = $_POST['teller']; } elseif(isset($_GET['teller'])){ $teller = $_GET['teller']; } else { $teller = "";} if(isset($_POST['cycle'])){ $cycle = $_POST['cycle']; } elseif(isset($_GET['cycle'])){ $cycle = $_GET['cycle']; } else { $cycle = "";} if(isset($_POST['seconde'])){ $seconde = $_POST['seconde']; } elseif(isset($_GET['seconde'])){ $seconde = $_GET['seconde']; } else { $seconde = "";} if(isset($_POST['eindtijd'])){ $eindtijd = $_POST['eindtijd']; } elseif(isset($_GET['eindtijd'])){ $eindtijd = $_GET['eindtijd']; } else { $eindtijd = "";} if(isset($_POST['arrayfoto'])){ $arrayfoto = $_POST['arrayfoto']; $fotoresultaat = explode("-,-,-,",$arrayfoto); } elseif(isset($_GET['arrayfoto'])){ $arrayfoto = $_GET['arrayfoto']; $fotoresultaat = explode("-,-,-,",$arrayfoto); } else { $fotoresultaat = "";} ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /> <?php if($check == "" && $teller==""){ ?> <form name="detect" method='post' action=" <?php echo $_SERVER['PHP_SELF']; ?>"> <input type='hidden' name='screenW' value='screenW'/> <input type='hidden' name='screenH' value='screenH'/> <input type='hidden' name='check' value='check'/> </form> <SCRIPT language="javascript"> var screenW = 640, screenH = 480; var Check = "check"; if (parseInt(navigator.appVersion)>3) { screenW = screen.width; screenH = screen.height; } else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)==3 && navigator.javaEnabled() ) { var jToolkit = java.awt.Toolkit.getDefaultToolkit(); var jScreenSize = jToolkit.getScreenSize(); screenW = jScreenSize.width; screenH = jScreenSize.height; } window.document.detect.screenW.value=screenW; window.document.detect.screenH.value=screenH; window.document.detect.check.value=Check; window.document.forms['detect'].submit(); </SCRIPT> <?php } $tijd = time(); if($teller ==""){ $result = mysql_query("SELECT * FROM opdrachten WHERE starttijd < '$tijd' AND eindtijd > '$tijd' AND type = 'foto'") or exit(mysql_error()); while ($row = mysql_fetch_array($result)) { $fotoresultaat[] = $row['bestand']; $leeg = "iets"; $starttijd = $row['starttijd']; $eindtijd = $row['eindtijd']; $cycle = "nee"; $seconde ="10"; $teller=0; } } if($cycle=="nee"){ $aantal = count($fotoresultaat); if($tijd<$eindtijd){ if($teller < $aantal){ $foto = $fotoresultaat[$teller]; $teller++; $arrayfoto = implode('-,-,-,',$fotoresultaat); print "<meta http-equiv=\"refresh\" content=\"$seconde;URL=fotoshow.php?teller=$teller&&eindtijd=$eindtijd&&cycle=$cycle&&seconde=$seconde&&arrayfoto=$arrayfoto&&screenW=$screenW&&screenH=$screenH\" />"; }else{ $foto = $fotoresultaat[0]; $teller=1; $arrayfoto = implode('-,-,-,',$fotoresultaat); print "<meta http-equiv=\"refresh\" content=\"$seconde;URL=fotoshow.php?teller=$teller&&eindtijd=$eindtijd&&cycle=$cycle&&seconde=$seconde&&arrayfoto=$arrayfoto&&screenW=$screenW&&screenH=$screenH\" />"; } }else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=../index.php\" />"; } } elseif($cycle == "ja"){ } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=../index.php\" />"; } ?> <title>Image</title> <?php ?> <style type="text/css"> html { overflow-x: hidden; overflow-y: auto; background-color : orange; } img{ margin-left: -8px; margin-top: -8px; align : center; } </style> </head> <body> </body> </html> <?php if($cycle !=""){ print"<img src=\"$foto\" width=\"$screenW\" heigth=\"$screenH\" valign=\"middle\">"; } ?> </body> </html> Edited December 13, 2012 by TheDutchBeast Quote Link to comment Share on other sites More sharing options...
TheDutchBeast Posted December 13, 2012 Author Share Posted December 13, 2012 Solved! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.