#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    3
    Rep Power
    0

    How to put some value from link to the other script when user clicks a link...


    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..?
    I don't know where to put onclick event

    Thanks, Robert...
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1045
    Hi,

    a link to do an update? An onclick handler? OK, stop right there. I think you've missed some HTML basics. In HTML, changing data is done with forms. You can learn about forms here:

    https://developer.mozilla.org/en-US/...ide/HTML/Forms

    You need no JavaScript hacks, no onclick handlers, just plain HTML.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    3
    Rep Power
    0
    I know this, mybe I wasn't clean in asking what I want.
    I have a data from MySQL on my page presented in php and html, but I want when user clicks on some column, that this value goes to other php script.I don't knowe how to do this in php(if is this possibile), so I need a javascript...

    Thanks...
  6. #4
  7. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1045
    OK, I think you'll have to be more specific. Are you talking about Ajax? Do you want the data to be sent without directing the browser to that page? What do you do with this data?

    In any case, you will need a form. If you use Ajax, you parse this form instead of submitting it.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by Jacques1
    OK, I think you'll have to be more specific. Are you talking about Ajax? Do you want the data to be sent without directing the browser to that page? What do you do with this data?

    In any case, you will need a form. If you use Ajax, you parse this form instead of submitting it.
    Thank you, I need to show a data for ID on which I click on the other page.So I think I need a AJAX(my knowledge about javascript is poor)...

    Thanks..

IMN logo majestic logo threadwatch logo seochat tools logo