how can i pass a php variable from parent page to include page -


i including page childpage.php in parent page, want pass variable parent page childpage.php , want access variable in childpage.php. here code:

include_once("childpage.php?a='$x'"); 

why doesn't work?

you can define variable before include so

$x = 'something needed in include file'; include_once("childpage.php"); 

you can use $x variable in childpage.php now.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -