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

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -