Jump to content

changing PHP variable from javascript


mariosuyoto

Recommended Posts

I have an example code like this :

<script language=javascript>

function edit() {

    <? $status="edit";?>   

{

function new() {

    <? $status="new";?>   

{

</script>

<form method=post action=storage.php>

  <input type=button name=edit value=EDIT onClick=edit()>

</form>

 

The problem is

i can't get $status at storage.php as i want ($status = new)

Any help for my problem? and how should i do to get $status = "edit" at storage.php?

 

Thank You

Link to comment
https://forums.phpfreaks.com/topic/152764-changing-php-variable-from-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.