url in php coding

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
robin1
Forum Newbie
Posts: 20
Joined: Thu Aug 01, 2002 4:36 pm

url in php coding

Post by robin1 »

hey everybody,

this code works
echo $row["CATEGORY"]."(".$row["ENTRIES"].") </font></td>";


but this one doesn't, what wrong with this code?
echo "<a href="/testing.php?cmd=$row["CATEGORY"]&xxxx=$row["CATEGORY"].">(".$row["ENTRIES"].") </font></td>";

any help you could give me would be greatly appreciated
thanks
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

change it to this:

Code: Select all

echo "<a href="/testing.php?cmd=&#123;$row&#1111;'CATEGORY']&#125;&xxxx=&#123;$row&#1111;'CATEGORY']&#125;">(&#123;$row&#1111;'ENTRIES']&#125;)</a> </font></td>";
syntax may be a little off. my caffeine is running low ;)
User avatar
PaTTeR
Forum Commoner
Posts: 56
Joined: Wed Jul 10, 2002 7:39 am
Location: Bulgaria
Contact:

Post by PaTTeR »

or to this

Code: Select all

printf('<a href="testing.php?cmd=%s&xxxx=%s">("%s")</a></font></td>',
        $row&#1111;'CATEGORY'],$row&#1111;'CATEGORY'],$row&#1111;'ENTRIES']);
for moore info
http://www.php.net/manual/en/function.printf.php
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

or even to this:

Code: Select all

echo '&lt;a href="/testing.php?cmd='.$row&#1111;'CATEGORY'].'&amp;xxxx='.$row&#1111;'CATEGORY'].'"&gt;
('.$row&#1111;'ENTRIES'].')&lt;/a&gt;&lt;/font&gt;&lt;/td&gt;';
Have a look at: http://www.php.net/manual/en/language.types.string.php

There's lots of ways to do strings.

Mac
Post Reply