Page 1 of 1

url in php coding

Posted: Fri Nov 08, 2002 10:17 pm
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

Posted: Fri Nov 08, 2002 10:23 pm
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 ;)

Posted: Sat Nov 09, 2002 2:57 am
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

Posted: Mon Nov 11, 2002 2:54 am
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