I have a site that shows car pictures pulled from a database with the following columns: id carname category date imagename popularity 200 mustang transport car01 402 When the image is reqested it shows the file as car01. What i wont to do is use the carname in the alt tag. the source code shows: [i mg]http://mysite.com/s/images/car01.gif[/i mg]"><br><input onClick='highlight(this);' type="text" alt="" Could someone tell me how to call the carname to use it in the alt tag.
It would be best to see the code that creates the link. But the short of it is the name is likely in $result[carname] or whatever variable name they used.
Maybe, it depends on how the results are called. Post the code that generates the link and we can see. Otherwise try it and see if it works.
This is the line of code: It allows users to copy the code to add to there website. $images=$images . "<tr><td width=\"34%\" align=\"center\" height=\"0\"><br><img src=\"images/" . $row[imagename] . "\" border=\"0\"><br><font style=\"font-size: 3pt\"> </font><br><input onClick='highlight(this);' type=\"text\" alt=\"" . $i . "\" size=\"20\" value=\"[img]http://" . $domainname . "/s/" . $row[imagename] . "[/img]\"><br><input onClick='highlight(this);' type=\"text\" alt=\"$imagename" . $i . "\" size=\"20\" value=\"<img src="http://" . $domainname . "/s/" . $row[imagename] . ""/>\"><br><input onClick='highlight(this);' type=\"text\" alt=\"" . $i . "\" size=\"20\" value=\"http://" . $domainname . "/s/" . $row[imagename] . "\"></td>"; Code (markup):
I'm thinking type=\"text\" alt=\"$row[carname]\" But I can't copy the entire string to format it for some reason to show an example or test.
type=\"text\" alt=\"$row[carname]" Worked great ! Thank you for spending the time helping me. I had a go at it for about 5 hours and even got my php book out,but theres nothing like skilled help