I can get the href to work by itself and I can get the src image to work by itself But when I try putting both together I get one syntax error or another. Can someone give me a hand thanks. echo"<a href="$bookurl"><img src =\"$photourl$bookimage\" align=\"left\" vspace=\"7\" hspace=\"7\">"</a>; PHP:
You seem to be getting a bit confused with your quotes. Try this: echo "<a href=\"$bookurl\"><img src=\"$photourl$bookimage\" align=\"left\" vspace=\"7\" hspace=\"7\" /></a>"; PHP:
echo'<a href="'.$bookurl.'"><img src ="'.$photourl.$bookimage.'" align="left" vspace="7" hspace="7"></a>'; PHP: this should work
Thanks XIG .. that worked fine. I'm not at all confused I butcher my code by example... just didn't have a complete example to mutilate this time... Very much appreciated...
OK, well here is the new thing. Both of these codes work with FireFox but not with IE.. Any idea what that's about? Now what? Thks http://www.earrelaphant.com/community/recipes/viewrecipe.php?id=1760
What kind of error are you getting in IE? The code line looks pretty normal, are you sure the error is with the code itself or is it a display problem? I looked at the link you provided in both IE and Firefox but I don't see much of a difference, unless I'm missing something obvious.
PHP is server side code, so it wouldn't make a difference with either browser. Post which code you are using and what the problem that you are noticing..
There isn't an error in IE it just didn't display. the photo and link. The issue it turn out is in an include that was running in front of it. When I took the include out then IE displays the image and link fine. So todays project is figuring out how to deal with the include that I took out. thks.
Ok, here is what I done. I was trying to use an include for an entire page into another page. I found out that was a mistake after a day or two. So then I took the coding I needed to use from the one page and inserted into the page where I want it to run. What the code does is display user comments for a particular recipe. Now In Firefox this approach is working great. Displays everything perfectly.. everything seems to work. With no errors being reported related to this coding. I do get two errors for something related to ads and so are unrelated. Now, in IE I get error if the recipe does have comments but don't get any errors if the recipe doesn't have any comments. Either way though nothing is displayed in IE. This is a screenshot of the error from IE And here is a copy of the code with a comment added to show the reference point from IE error message. <!-- display comments begins --> <table border="2" width="590" bordercolor="#008000"> <tr> <td valign="top"> <div align="center"> <table border="0" cellpadding="8" cellspacing="0" width="100%"> <tr> <td width="100%" align="center" bgcolor="#E8FFEE"><font face="Verdana" size="2" color="#006C1C">Visitor Reviews of <B><a href="viewrecipe.php?id=<?echo"$id";?>"><?echo"$title";?></a></B></font></td> </tr> <? $query = "SELECT * FROM reviews where id = '$id'"; $result = mysql_db_query($db, $query); $count = 0; while($r = mysql_fetch_array($result)) {//1 $active = $r["active"]; $review = $r["review"]; $author = $r["contributor"]; $email = $r["email"]; if($email != "") {//2 $contributor = "<a href=\"mailto:$email\">$author</A>"; }//2 else {//3 $contributor = $author; } //3 if($active == "yes") {//4 if($count == 0) {//5 echo" <tr> <td width=\"100%\" bgcolor=\"$bgcolor2\"><font face=\"$font\" size=\"$fontsize\" color=\"$fontcolor\">Review By: $contributor<br> $review</font></td> </tr> "; $count = 1; <!-- This is where error is showing in IE --> } //5 else { //6 echo" <tr> <td width=\"100%\" bgcolor=\"$bgcolor1\"><font face=\"$font\" size=\"$fontsize\" color=\"$fontcolor\">Review By: $contributor<br> $review</font></td> </tr> "; $count = 0; } //6 } //4 }//1 ?> </table> </div> </td> </tr> </table> <!-- display comments ends --> Code (markup): Something seems to be missing for what ever the number 5 thing is referring. I don't understand what this does either. I only have one recipe with comments and you can see it here: http://www.earrelaphant.com/community/recipes/viewrecipe.php?id=1152 I hate to dump this in here like this but I'm just plum stuck. AGAIN thks
if you ask me, your error is on this line: <font face="Verdana" size="1" color="#000000"><B><a href="#" onClick="emailWindow('1152', '115 Rover[COLOR="Red"][B]'[/B][/COLOR]s Reward')"><img src="images/recipeasemail.gif" width="103" height="64" alt="Eamil this recipe"></a></B></font> Code (markup): I marked it red. I am guessing the title stems from your database? make sure you escape those strings.
YOur right about something in this code causing problem. I edited it out and the IE error goes away but comments still don't display. This is the code that I edited out. <font face="<?echo"$font";?>" size="<?echo"$fontsize";?>" color="<?echo"$fontcolor";?>"><B><a href="#" onClick="emailWindow(<?echo"'$id', '$title'";?>)"><img src="images/recipeasemail.gif" width="103" height="64" alt="Eamil this recipe"></a></B></font> Code (markup):
try this: <font face="<?echo"$font";?>" size="<?echo"$fontsize";?>" color="<?echo"$fontcolor";?>"><B><a href="#" onClick="emailWindow('<?echo $id;?>', '<?echo addslashes($title);?>')"><img src="images/recipeasemail.gif" width="103" height="64" alt="Eamil this recipe"></a></B></font> Code (markup): [/QUOTE] solved? => ?