Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include file from other domain 1

Status
Not open for further replies.

foxphpbomb

Programmer
Apr 10, 2007
29
US
I am trying to create a widget, that will display content in an iframe on another site. the problem is that I don't want to show the database connection info in the code that people copy and paste into their sites.

I thought about doing an include file, but this doesn't seem to work:

include_once("
any suggestions would be appreciated.
 
No, that won't work. Your PHP engine needs to fetch PHP script code and parse and run that code itself. When you do an include like you've shown, the foreign server runs the foreign code locally to itself and sends just the output of the script.

But if your server runs PHP scripts instead of just sending out the source code, no user should ever see source code.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top