Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

browser links

foreach($orders as $orders){
echo '
<a href=\'
https://sellercentral-europe.amazon.com/gp/orders-v2/details?ie=UTF8&orderID='
.$orders['orderid'].'\'>'.$orders['orderid'].'</a>'
;

echo '
<a href="
https://sellercentral-europe.amazon.com/gp/orders-v2/details?ie=UTF8&orderID='
.$orders['orderid'].'">'.$orders['orderid'].'</a>'
;

}


want to make html href links


this code is just making
<a href=' https://sellercentral-europe.amazon.com/gp/orders-v2/details?ie=UTF8&orderID=403-2206310-81283'>403-2206310-81283</a> <a href=" https://sellercentral-europe.amazon.com/gp/orders-v2/details?ie=UTF8&orderID=403-2206310-81283">403-2206310-81283</a>


i want links in html when run on a browser
Avatar of hielo
hielo
Flag of Wallis and Futuna image

change < to <
and also > to >
foreach($orders as $orders){
echo '
<a href=\'
https://sellercentral-europe.amazon.com/gp/orders-v2/details?ie=UTF8&orderID='
.$orders['orderid'].'\'&gt;'.$orders['orderid'].'</a>'
;

echo '
<a href="
https://sellercentral-europe.amazon.com/gp/orders-v2/details?ie=UTF8&orderID='
.$orders['orderid'].'"&gt;'.$orders['orderid'].'</a>'
;

}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You need to use a text editor or HTML/code editor and change the HTML entities like < to the characters that are needed for the links to work.  HTML entities are character sequences used to display characters that HTML would otherwise use to decide how to display the page.  In your sample above, you need to replace < with < and > with > and your links will work in a web page.
Well, that ended up not working well.  I'll have to put spaces between the character sequences for this to display properly.  Change "& l t ;" to "<" and "& g t ;" to ">" in your code editor.
Avatar of rgb192

ASKER

applied your change

I am only getting links for urls that have no (null) orderid

Avatar of rgb192

ASKER

now it works... thanks
The $orders['orderid'] part is a PHP variable that needs to be filled in by the PHP code... which means this needs to be a *.php page, not a *.html page.