|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-07-07 05:27 UTC] kouber@php.net
Description: ------------ When I write some RewriteRule with additional "redirected" variables, they seem to be empty in my script. RewriteRule ([a-z]+/)?([0-9]+) job_view.php?job_sid=$2&theme=$1 When I call the following URL "http://localhost/gray/56", I expect in my script to have these variables: job_sid => string(2) "56" theme => string(4) "gray" But what var_dump($job_sid) and var_dump($theme) actually tells me is: job_sid => string(2) "56" theme => string(0) "" Note that $theme is an empty string, but not null. The weirdest thing is that var_dump($_GET) shows correct result: array(2) { ["job_sid"]=> string(2) "56" ["theme"]=> string(4) "gray" } I forgot to mention, that I have register_globals=On, so I expect ALL of my $_GET variables to be registered as globals. Reproduce code: --------------- var_dump($_GET); var_dump($job_sid); var_dump($theme); Expected result: ---------------- array(2) { ["job_sid"]=> string(2) "56" ["theme"]=> string(4) "gray" } string(2) "56" string(4) "gray" Actual result: -------------- array(2) { ["job_sid"]=> string(2) "56" ["theme"]=> string(4) "gray" } string(2) "56" string(0) "" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 21:00:01 2025 UTC |
Works fine here with these settings: <VirtualHost *> ServerName localhost RewriteEngine on RewriteRule ([a-z]+)?/?([0-9]+) /rewrite.php?job_sid=$2&theme=$1 DocumentRoot /www/apache/htdocs/ php_value register_globals 1 </VirtualHost> You propably just have something wrong with your settings.