frijole Posted April 24, 2008 Share Posted April 24, 2008 Not sure what is wrong with this, any ideas? <?php if($_POST) { echo "<table border="1" align=\"center\">"; foreach($artists as $artist) { switch ($artist) { case "dali": //show Dali picture echo "<tr><td><b>Salvador dali</b></td><td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/24/Salvador_Dal%C3%AD_1939.jpg/180px-Salvador_Dal%C3%AD_1939.jpg"></td></tr>"; break; case "vanGogh": //show Van Gogh picture echo "<tr><td><b>Vincent Van Gogh</b></td><td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/38/VanGogh_1887_Selbstbildnis.jpg/170px-VanGogh_1887_Selbstbildnis.jpg"></td></tr>"; break; case "escher": //show Escher picture echo "<tr><td><b>M. C. Escher</b></td><td><img src="http://upload.wikimedia.org/wikipedia/en/thumb/4/43/EscherSelf1929.jpg/220px-EscherSelf1929.jpg"></td></tr>"; break; case "picasso": //show Picasso picture echo "<tr><td><b>Pablo Picasso</b></td><td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/98/Pablo_picasso_1.jpg/180px-Pablo_picasso_1.jpg"></td></tr>"; break; } echo "</table>"; } else { ?> <form action="<?php echo $_SERVER[php_SELF]; ?>" method="POST"> <input type="text" name="firstName" size="25"><br /> <select name="options[]" size="4" multiple id="options[]"> <option value="dali">Salvador Dali</option> <option value="vanGogh">Vincent Van Gogh</option> <option value="escher">M. C. Escher</option> <option value="picasso">Pablo Picasso</option> </select><br /> <INPUT TYPE="image" SRC="./images/kaufen.jpg" BORDER=0 ALT="Submit"> <input type="reset" value="Reset"> <?php } ?> Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 24, 2008 Share Posted April 24, 2008 echo "<table border=\"1\" align=\"center\">"; You forgot to escape the quotes around 1. Quote Link to comment Share on other sites More sharing options...
frijole Posted April 24, 2008 Author Share Posted April 24, 2008 sweet, thanks. 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.