transferring variable / hiding php-file

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-14-2003
Mikko
 
Posts: n/a
Default transferring variable / hiding php-file



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?


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0