Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
|
Moderated Pro PHP This is a moderated forum for discussing advanced, professional level issues with PHP. Your posts will not appear until a moderator approves them. Posts that are not the right level for this forum will be responded to and you'll be asked to post them in the [url="http://p2p.wrox.com/sql-server-2000-20/9"]Beginning PHP[/url] forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Moderated Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 22nd, 2007, 01:42 PM
Guest
 
Posts: n/a
Default .htaccess Environment Variables

Hoping someone can help me with this problem. I'm trying to pass a variable with a RewriteRule in my .htaccess file using this technique:

RewriteRule foo bar [E=VAR:VAL]

I refer to the variable on the resulting page using:

<? php
echo $_SERVER["VAR"];
?>

and get no results. I've used phpinfo() and find that the variable doesn't show up.

I have also tried this:


echo $_ENV["VAR"];

and

$var = getenv('VAR');

with no luck.

This, however, does return a value:

echo $_SERVER["REDIRECT_URL"];

but this wasn't the solution I was looking for.

I'm using a hosting site w/ Apache/1.3.37 and PHP Version 4.4.4

Any ideas?

--
Michael






Similar Threads
Thread Thread Starter Forum Replies Last Post
Environment variables dotnetprogrammer VS.NET 2002/2003 3 November 30th, 2004 10:10 AM
Environment Variables Error axla BOOK: Beginning ASP.NET 1.0 0 May 23rd, 2004 02:43 AM
configuring environment variables pete_m BOOK: Beginning ASP.NET 1.0 0 April 28th, 2004 04:40 AM
Environment Variables cmiller PHP How-To 1 October 29th, 2003 06:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.