javascript - change PHP variable with onclick and echo the variable -


I would like to change the value of a PHP variable when clicked on a specific device.
The only way I can see that it is possible to refresh the webpage, so it can again read the variable, but I do not have to refresh the whole page, I just need to refresh it only. I

  & lt ;? Php $ path = $ _SERVER ['DOCUMENT_ROOT']; $ Path = "/include/functions.php"; ($ Path) included; Randomopponent (); $ Selectopponent = "Choose an opponent"; ? & Gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Link rel = "stylesheet" href = "include / css / logged_in.css" /> & Lt; Title & gt; Testite & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; This is a protected page! & Lt; Br> & Lt; A href = "# selectopponent" & gt; Choosing Options & lt; / A & gt; & Lt; Div id = "selectopponent" class = "option to choose" & gt; & Lt ;! - This is the part that rival - & gt; & Lt; Div & gt; & Lt; H2 & gt; Choose an opponent & lt; / H2 & gt; & Lt; Table class = "options to choose" & gt; & Lt; TR & gt; & Lt; Td class = "selectopponenttd" onclick = 'location.href = "# & lt ;? Php echo" $ opponent 1 ";? & Gt;"> & gt; & Lt ;? Php echo "$ opponent 1" "
"; ? & Gt; & Lt ;! - Defined in RandomMonitor (); - & gt; & Lt; Img class = "selectopponnetpic" src = "/" & lt; php resonance $ rival 1;? & Gt; alt = "& lt ;? Php echo "$ opponent 1";? & Gt; "& gt; & lt;! - defined in Randommonent (); - & gt; & lt; / td & gt; & lt; td class =" selectopponenttd "onclick = 'location.href =" # & lt ;; Php echo "$ opponent 2"; & Gt; "& gt; & lt ;? php" rival 2 "resonance" & lt; Br>?;?; & Gt; & lt;! - defined in Randommonent (); ->  & lt ;? Php echo & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;

So I do not know how to do this, for example, when $ competitor is then clicked on 3 $ opt now $ Chunapopent = $ opponent 3 me and him echo should do.

Have seen in the Load () function? You can use it in the $ _GET combination, but you'll need to adjust your HTML to include:

  & lt; Div class = 'coppdiv' & gt; & Lt; / Div & gt; For example, when the opponent is clicked:  

$ ("Coppdiv"). Load ("get_opponent.php? Opp =" + opp_id)

/ P>


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -