php - Passing parameter in header tag -


i trying pass value header.

is there way pass parameter directed new web page.

below header code (it not work), pass parameter of "mycode" page.

header("location: http://evon1991-z.comp.nus.edu.sg/kxclusive/insertdetail.php".'$mycode'); 

how should go doing it?

variables don't expand inside single quotes. result of string concatenation like:

http://evon1991-z.comp.nus.edu.sg/kxclusive/insertdetail.php$mycode 

you need:

header("location: http://evon1991-z.comp.nus.edu.sg/kxclusive/insertdetail.php?param=$mycode"); 

..assuming $mycode plain value. in case $mycode complete percent-encodeded query string format, prepend ? , append main url.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -