• PHP Help PHP Coding
  • [Resolved] passing 2 values to php with a <a href=""></a> tag

I need to pass two values from a link(created dynamically from a database) to a php page that contains a dynamic sql select statement.

I don't want the look of a button or a dropdown. I really want a link using a <a href=></a> tag.

The problem is that I can only get the link, when clicked, to pass only one value.

My tag looks like this:

<a href='rec_vars.php?tc=$tc?sc=$sc'>$sc </a>

Is it possible to do what I want to do or can only one value be passed this way?

If you know, I would appreciate your advise.

Thanks!

    rec_vars.php?tc=$tc?sc=$sc

    should be

    rec_vars.php?tc=$tc&amp;sc=$sc

    or perhaps
    rec_vars.php?tc=$tc&amp;amp;sc=$sc

      If I understand, you want to do something along these lines?

      
      echo "<a href=http://www.myurl.com/page.php?var1=$var1&var2=$var2>$var1</a>";
      

        This Works.

        <a href='rec_vars.php?tc=$tc&sc=$sc'>$sc </a>

        Thank You !!

          Write a Reply...