473,508 Members | 2,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?
Jul 17 '05 #1
0 1658

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
1457
by: Mark | last post by:
This may be a dumb question but can you tranfer variables stored in a PHP page on one server to a page on a different server via a form POST and be able to access those variables on the new page...
3
1903
by: Abby | last post by:
I have an application that is written in php/mysql on a Linux platform and need to transfer hosts. This is a session based application and I don't know a lot about php/Linux/mysql, but can get by....
10
3591
by: Mark | last post by:
This may be a dumb question but can you tranfer variables stored in a PHP page on one server to a page on a different server via a form POST and be able to access those variables on the new page...
3
9636
by: jonnyblazed | last post by:
Okay..... I'm gonna sum up what I want to do cause it will make it pretty simple for you guys to understand. Here we go: I have a form that posts data to a PHP mailer page I have created. When...
3
3956
by: jonnyblazed | last post by:
Okay..... I'm gonna sum up what I want to do cause it will make it pretty simple for you guys to understand. Here we go: I have a form that posts data to a PHP mailer page I have created. When...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.