Skip to content
Advertisement

calling php file fron another php file while passing arguments

i need to call a php inside another php file and pass some arguments also. how can i do this?? i tried

JavaScript
  • but gives access denied. i read like v must not set allow_url_open to OFF.

if i write like

JavaScript
  • gives error as /…/myfiles.php?file=hello: no such file or directory.

how can i solve this???

Advertisement

Answer

You don’t have to pass anything in to your included files, your variables from the calling document will be available by default;

File1.php

JavaScript

File2.php

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement