fife Posted June 6, 2011 Share Posted June 6, 2011 ok I have this looping query which works and displays everything I need while ($CP = mysql_fetch_array($Link)) { if ($CP['logo']=='logo_default.jpg') { echo "<img src=\"/images/logo_default.jpg\" border='0' alt=\"{$CP['name']}\" />"; } else { echo "<img src=\"/members/images/{$CP['county']}/{$CP['logo']}\" border='0' alt=\"{$CP['name']}\" />"; } $CP['clubID']; } Now I want to have a form where the only visible element is club image so I have made that form.... while ($CP = mysql_fetch_array($Link)) { <form action="" id="myclubfrm"> <input type="image" scr="<?php if ($CP['logo']=='logo_default.jpg') { echo "/images/logo_default.jpg"; } else { echo "/members/images/{$CP['county']}/{$CP['logo']}"; } ?>" width="200" height="133" name="clubinsert" > <input name="club" type="hidden" value="<?php $CP['clubID']; ?>"> <input name="pap" type="hidden" value="<?php $CP['permission'];?>"> </form> } The issue is that if I do it the second way no image is displayed. Just blank a image box with writing in the middle saying submit Quote Link to comment https://forums.phpfreaks.com/topic/238592-button-image/ Share on other sites More sharing options...
wildteen88 Posted June 6, 2011 Share Posted June 6, 2011 You cannot dump html code within PHP code and expect your script to just work. Quote Link to comment https://forums.phpfreaks.com/topic/238592-button-image/#findComment-1226093 Share on other sites More sharing options...
fugix Posted June 6, 2011 Share Posted June 6, 2011 what does a "view source" on your browser show? Quote Link to comment https://forums.phpfreaks.com/topic/238592-button-image/#findComment-1226094 Share on other sites More sharing options...
fife Posted June 6, 2011 Author Share Posted June 6, 2011 I did dump html code. there is the correct formatting I just missed it for shortening purposes. The view source shows...... <input type="image" scr="../images/logo_default.jpg" width="200" height="133" name="clubinsert"> <input name="club" type="hidden" value=""> <input name="pap" type="hidden" value=""> Quote Link to comment https://forums.phpfreaks.com/topic/238592-button-image/#findComment-1226101 Share on other sites More sharing options...
fugix Posted June 6, 2011 Share Posted June 6, 2011 if you copy pasted that, then you misspelled src...you have scr Quote Link to comment https://forums.phpfreaks.com/topic/238592-button-image/#findComment-1226102 Share on other sites More sharing options...
fife Posted June 6, 2011 Author Share Posted June 6, 2011 OMG thank you so much. I have been looking at that for over an hour! Again thank you Quote Link to comment https://forums.phpfreaks.com/topic/238592-button-image/#findComment-1226104 Share on other sites More sharing options...
fugix Posted June 6, 2011 Share Posted June 6, 2011 OMG thank you so much. I have been looking at that for over an hour! Again thank you no problem, its always the little things that cause so much trouble Quote Link to comment https://forums.phpfreaks.com/topic/238592-button-image/#findComment-1226171 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.