Connecting Tech Pros Worldwide Help | Site Map

transferring variable / hiding php-file

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:32 AM
Mikko
Guest
 
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?



 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.