javascript - How to extract the value passed in through onclick function event? -


I have an onclick = "ShowSingleNew (299)" event for this one link Opens a new popup, what I would like to do is to remove 299 (which is an id of the given new item) and pass it to my PHP script so that the item belongs to that user Read

The php bit looks like this:

  if (empty ($ _GET ['news_id'])) Select {SKL ..} and select {SLL} where News_id == $ _GET ['news_id']; }   

How can I pass this ShowSingleNew ID on the next page and give it in the $ _GET variable?

Do you have to pass a news ID using the query string as the URL? NewsId = 104 format.

  The sample code looks like this in the original format:  
  ShowSingleNew (newsId) {var url =    "Your URL goes here"; Window.open (url + "? NewsId =" + newsId); // other code}   

On the php side, you can use $ _GET ['newsId'] to bring the News ID.

Note:

How many values ​​to pass in the query string here:

Reference:



Comments

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -