Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: OnClick on Link

  1. #1
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    OnClick on Link

    Dear,

    I have something like this:
    <a href="update.php"><?php echo $r; ?></a>
    and I want to know how to pass a $r to update.php
    when user clicks on link..?
    This $r is a field that is id in MySQL table, and I need to
    redirect to update.php page when user clicks on this $r..

    Thanks

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    cant you jsut do that with php itself?


    Code:
    <a href="update.php?id=<?php echo $r; ?>"></a>

  • #3
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks to the top of World...
    (souch torture for me for one "?")..
    Thanks again..

  • #4
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry I'am new to the web development, so I don't know how
    to get this "id" on the other script...

    Escouse me for discuting about php, in Ajax group..

    Thsanks..

  • #5
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,085
    Thanks
    23
    Thanked 593 Times in 592 Posts
    PHP Code:
    <?php
    if(isset($_GET["id"]))
        
    $table_column $_GET["id"];   // $table_column is now $r 
    ?>
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •