note 60229 rejected from function.require-once by nlopess

From: Date: Fri, 30 Dec 2005 17:30:24 +0000
Subject: note 60229 rejected from function.require-once by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-100998@lists.php.net to get a copy of this message
Note Submitter: ben at secondplatform dot com ---- I'm having a problem passing a string to a file by way of require_once() or include(). In the site this happens on, there is a subnav menu in the left-hand column, and it is displayed with require_once('includes/left.php'). The problem arises when I try to pass a string with a space in it, to the left.php page using require_once. The current malfunctioning code is: require_once('includes/left.php?page=category&value=' . $category); This system works fine when $category doesn't have spaces. But if $category contains any spaces I get the errors: Warning: main(includes/left.php?page=category&value=KBH Series): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in [path]\httpdocs\php\view_cat.php on line 98 and Fatal error: main(): Failed opening required 'includes/left.php?page=category&value=KBH Series' (include_path='.;./includes;./pear') in [path]\httpdocs\php\view_cat.php on line 98 I've tried using cookies, literal quotations, etc to try to get this variable passed to left.php and nothing seems to work. I feel silly explaining this issue, because it's obviously a result of miscommunications between myself and the designer.. but it would be nice to find an easy fix. Ideas anyone?

« previous php.notes (#100998) next »