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
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>";

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.