Save PHP Post Data to string -


I have simple PHP code; I $ _ POST ["email"]; I can resonate correctly.

But I can not save it in the variable.

  var email = $ _POST ["email"];  

I got this error

  Parse error: syntax error, unexpected T_VAR  

Any ideas?

Please read. You need to change:

  var email = $ _ POST ["email"];  

to

  $ email = $ _ POST ["email"];  

If you want to assign the php value to the JavaScript variable, then it will:

  var email = '& lt ;? Php echo $ _POST ["email"]; ? & Gt; ';  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -