Jump to content

echoing variable on link page


Petrus

Recommended Posts

 

Hi,

 

I know it is probely not a regex question but I don't know the right category.

 

I have 2 variables like $variable1 and $ variable2 which are placed in a loop now I want the $variable to be echo't in a link like <a href="http://exampe.com/$variable1"/> On this dynamicly generated page I want to output the $varible1 of this link and

$variable2

 

    while($row = mysql_fetch_assoc($result))

    {

    echo " <tr>";

    echo "  <td>" . $row["variable1"] . "</td>";

    echo "    <td>" . $row["variable2"] . "</td>";

    echo " </tr>";

Link to comment
https://forums.phpfreaks.com/topic/219044-echoing-variable-on-link-page/
Share on other sites

You're already halfway there . . .

 

while($row = mysql_fetch_assoc($result)) {
     echo "<a href=\"http://example.com/{$row['variable1']}\">{$row['variable1']}</a>"
}

 

this page hase a  url <a href=\"http://example.com/{$row['variable1']}\">{$row['variable1']}</a>

on this page I want in the <body></body> te output the varibles form the row like variable1 and variable2.

 

so link is clicked <a href=\"http://example.com/{$row['variable1']}\">{$row['variable1']}</a>" which gave a page on that page I want to output variable1 and varible2

 

I hope you understand now better, please lett me know.

 

Hi,

 

I know it is probely not a regex question but I don't know the right category.

 

I have 2 variables like $variable1 and $ variable2 which are placed in a loop now I want the $variable to be echo't in a link like <a href="http://exampe.com/$variable1"/> On this dynamicly generated page I want to output the $varible1 of this link and

$variable2

 

    while($row = mysql_fetch_assoc($result))

    {

    echo " <tr>";

    echo "  <td>" . $row["variable1"] . "</td>";

    echo "    <td>" . $row["variable2"] . "</td>";

    echo " </tr>";

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.