javascript - How to create php code inside onClick() -



javascript - How to create php code inside onClick() -

this question has reply here:

execute php function image onclick event 2 answers

is possible this

<td onclick="<?php $_session['key']=$value; ?>"> </td>

if not possible, how similar?

it not possible execute straight php code in javascript function simple reason : php executed on server side, , javascript executed on client side (so, after php execution).

if want execute php click, have 2 options : set link on td, send on php script or utilize ajax function executed click on element.

javascript php html

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -