HTML HREF inside PHP

Codes here !

Moderators: macek, egami, gesf

Post Reply
User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: HTML HREF inside PHP

Post by Nullsig » Mon May 07, 2012 5:32 am

It looks like you are missing semi-colons and brackets.

Code: Select all

if($col==$ar_cols[$last_key]){ 
$re_html .= '<br/>'. $row[$col]; 
echo "<a href=productinfo.php?id=".$row['ProductID'].">View more Details</a>";
}
Adding the curly brackets to group off this section of code the code now reads:

If $col is equal to the $last_key index of $ar_cols do the following.
Concatenate to the end of $re_html a line break and the value of $row[$col].
Then echo out a hyperlink to productinfo.php with the query string of id=$row['productID'].

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest