Jump to content

Assgining values to a PHP variable inside javascript


Recommended Posts

Hello,

 

Here is my snippet,

<script>

function valid(name)

{

       

var t="<?php $_SESSION['FName']='<script>name</script>'; ?>";

}

</script>

<input name="chk" type="button" value="Submit" onclick="valid('Joe');" />

 

 

I need to store the variable 'name' in the php session variable 'FName'.

Code is not exact or logical. But it could be similar.

Struggling more.

:confused:

Need Help!!!

 

Thanks.

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.