TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-29-2008, 05:31 PM   #1 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default Here's a stupid one...

It's amateur question hour... I just tried to upload one of my projects to a new subdomain on my site. To my wonderful surprise, it turns out that my host has PHP installed as CGI instead of an Apache module (why? because they were all abused as children and wish to take it out on their customers, and I'm locked in to them for now...) so I can't use php_ini in my .htaccess file without causing an internal server error. Grrr. So I was going to use ini_set() to add paths for both the host (linux) and my local server (windows), however, we have a small problem.

PHP Code:
ini_set('include_path''.:/data/16/1/7/24/1496513/user/1609716/htdocs/tuatara/bin/lib/');
ini_set('include_path''.;C:\\Users\\m\\Documents\\web sites\\htdocs-tuatara\\bin\\lib\\'); 
The second causes a problem because it's reading the semi-colon as an end of line delimiter, even though it's in quotes. I can't use a colon with windows paths, of course. I've solved this problem by just reverting to my old method of

PHP Code:
include($_SERVER['DOCUMENT_ROOT'].'/bin/lib/files...'); 
but I'm curious as to how I would solve this problem in the future if I need to set multiple include paths via ini_set() on a windows box?
-m
delayedinsanity is offline  
Reply With Quote
Old 05-29-2008, 05:33 PM   #2 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

That was interesting. I think vBulletin must've thought I was attempting an attack - it stripped all my quotes and backslashes from the second ini_set() until I double backslashed it.
-m
delayedinsanity is offline  
Reply With Quote
Old 05-30-2008, 01:59 AM   #3 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

That'll be because the backslash is the escape character. For it to appear as a string, as you want it, you will need to specify it as a double back slash, or a forward slash would suffice.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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


All times are GMT. The time now is 09:06 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design