stegers72 Posted September 18, 2013 Share Posted September 18, 2013 Hello ; I am trying to echo an image with url, but I keep getting an error, I think my parameter .$modelurl.$item['performerid'].$modelpageext is not correct. Anyone that can help me out a bit ? echo '<img src="'.$file.'" width=\"160\" height=\"120\" border=\"0\" alt=\"\">'; <a href=\".$modelurl.$item['performerid'].$modelpageext\">"; Many thanks in advance ; Pascal Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/ Share on other sites More sharing options...
cataiin Posted September 18, 2013 Share Posted September 18, 2013 try: echo "<img src='".$file."' width='160px' height='120px' border='0px' alt='' />"; echo "<a href='".$modelurl.$item['performerid']."'>".$modelpagenext."</a>"; Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/#findComment-1450112 Share on other sites More sharing options...
AbraCadaver Posted September 18, 2013 Share Posted September 18, 2013 Need more info. What do those vars contain and what should the href look like? And are you trying to make a clickable image? Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/#findComment-1450113 Share on other sites More sharing options...
stegers72 Posted September 18, 2013 Author Share Posted September 18, 2013 Need more info. What do those vars contain and what should the href look like? And are you trying to make a clickable image? Thanks for your reply, yes I am trying to make a clickable image $ext = '.jpg'; $modelurl = 'http://www.test-url/'; $modelpageext = '.php'; Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/#findComment-1450117 Share on other sites More sharing options...
cataiin Posted September 18, 2013 Share Posted September 18, 2013 what returns: echo "<a href='".$modelurl.$item['performerid'].$modelpagenext."'><img src='".$file."' width='160px' height='120px' border='0px' alt='' /></a>"; ? Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/#findComment-1450124 Share on other sites More sharing options...
AbraCadaver Posted September 18, 2013 Share Posted September 18, 2013 What should the href look like? Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/#findComment-1450128 Share on other sites More sharing options...
stegers72 Posted September 18, 2013 Author Share Posted September 18, 2013 This seems to do the job ... Many thanks for the help what returns: echo "<a href='".$modelurl.$item['performerid'].$modelpagenext."'><img src='".$file."' width='160px' height='120px' border='0px' alt='' /></a>"; ? Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/#findComment-1450136 Share on other sites More sharing options...
AbraCadaver Posted September 18, 2013 Share Posted September 18, 2013 Model? Performer? Is this a porn gallery? Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/#findComment-1450137 Share on other sites More sharing options...
cataiin Posted September 18, 2013 Share Posted September 18, 2013 Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/#findComment-1450142 Share on other sites More sharing options...
jazzman1 Posted September 19, 2013 Share Posted September 19, 2013 $ext = '.jpg'; $modelurl = 'http://www.test-url/'; $modelpageext = '.php'; @stegers72, using a "http://" prefix inside a "href" attribute tells the browser, that this searchable file/directory is outside of this server. It's not good for performance, but there is no problem if you want to use it, of course. @cataiin, Abra is correct by saying to use meaningful variable names. Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/#findComment-1450294 Share on other sites More sharing options...
stegers72 Posted September 19, 2013 Author Share Posted September 19, 2013 @stegers72, using a "http://" prefix inside a "href" attribute tells the browser, that this searchable file/directory is outside of this server. It's not good for performance, but there is no problem if you want to use it, of course. @cataiin, Abra is correct by saying to use meaningful variable names. Thanks for the help. I appreciate it. Link to comment https://forums.phpfreaks.com/topic/282256-echo-php-image-with-url/#findComment-1450303 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.