image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #9  
Old August 10th, 2004, 01:02 PM
Twiggy
 
Join Date: Nov 2002
Location: Far, far, away!
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Hype.it is on a distinguished road
ah... then to protect one's own applications or projects what lines do i need to invoke to activate this feature?
__________________
Wow... now even cuter! Meow!

Workstation:G5 Dual 2Ghz 8Gb Ram, 160GB Serial ATA (system) & SohoRaid 250Gb x2 (work), ATI RADEON 9600 Pro, 20" Apple Display, iSticks with Sub Laptop: PowerBook G4 15", 768Mb Ram, 60Gb HD & SuperDrive Connection: 6Mbit ADSL with P2P Music: Samsung YP-55 256Mb MP3 Player Sennheiser HD-25 closed head phones. Mobile: Sony Ericsson P900 with 128Mb MemoryDuo
Reply With Quote
  #10  
Old August 10th, 2004, 04:02 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
It's not a feature, per se, it's just the way PHP works.

Here's a short example I wipped up for you:
http://trogdor.myvnc.com:81/~amras/config_example/

Let's say you have a file called config.php containing something like:
Code:
<?php

// This is an example configuration file in PHP
// by Michael Sanford for www.macosx.com

	$config['username'] = 'michael';
	$config['password'] = 'michael1';
	$config['host'] = 'michaelsanford.com';

?>
And you called that configuration file with:
Code:
<?php

// This is an example configuration file in PHP
// by Michael Sanford for www.macosx.com

// call the configuration script
include("./config_example.php");

	echo "Username: " . $config['username'] . "<br />";
	echo "Password: " . $config['password'] . "<br />";
	echo "Host: " . $config['host'] . "<br />";

?>
Hit config_example_local.php and see what happens. You get the output. Now hit config_example.php, you get a blank page.

Now that you even know the URL of my configuration script ( http://trogdor.myvnc.com:81/~amras/c...ig_example.php ) try and hack it so you can print the $config variable elements...you'll have a pretty hard time doing it.

PS The thing to keep in mind here is that PHP means Hypertext PRE PROCESSOR, which means the code is executed before it's sent to the client. So even if you knew the URL of your configuration file and tried to curl it in the terminal, the server would just process the file, find there's no HTML output and download an empty file.
__________________
michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn
• iMac Aluminum 24" |
MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD
• iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD
• AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote
  #11  
Old August 10th, 2004, 10:00 PM
TommyWillB's Avatar
Registered User
 
Join Date: Mar 2001
Location: ol' Gay San Francisco
Posts: 2,016
Thanks: 0
Thanked 0 Times in 0 Posts
TommyWillB is on a distinguished road
Everthing you ever wanted to know about Apache can be found at Apache.org... Look in the HTTP 1.3 section.

Also, I've found it easier to change the ownership/permissions of the httpd.conf file so that I can edit is as my non-root administrator password... So I don't need to mess with any command line suff... I just use BBedit.


...Oh... and everything you want to know about PHP is at php.net.
__________________
TommyWillB
Intel iMac "early 2006" core duo
TommyWillB.com hosted on Mac OS X 10.5.x / Apache 2.2.x / PHP 5.x
Reply With Quote
Reply

Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 09:10 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.