This is a discussion on transferring variable / hiding php-file within the PHP Language forums, part of the PHP Programming Forums category; I would like to do this html/file1.php cgi-bin/file2.php it is called: file1.php$c1=something ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I would like to do this html/file1.php cgi-bin/file2.php it is called: file1.php$c1=something file1.php is: <? include "/cgi-bin/file2.php?c1=$c1" ?> But it gives: Warning: main(/cgi-bin/file2.php?c1=1234): failed to open stream: No such file or directory Seems its looking for file "/cgi-bin/file2.php?c1=1234", instead of calling file /cgi-bin/file2.php with variable c1=1234 What am I doing wrong? What I'm trying to do, at the moment there is just one .php file, html/file1.php which includes sql-password. So instead of file1.php (with sql-password) being in /html I would like file1 just call file2.php in cgi-bin, so if there is some problem with php, people would only see <? include "/cgi-bin/file2.php?c1=$c1" ?> instead of sql-password. And file2.php including password would be in protected directory, not visible to net. Am I trying the right thing? Im not sure if file1.php should run include, exec, or something else? The real code (that im trying to move to file2.php) uses echo:s to make a html-page Does it work like that, or do i need to use some return, to return the page from file2 to file1, and only file1 to echo it? |