Page 1 of 1

htaccess question

Posted: Sat Nov 21, 2009 1:15 am
by cardi777
I am currently using this as my htaccess file:

Code: Select all

RewriteEngine on
Options +FollowSymLinks
RewriteRule ([0-9]+)/([0-9]+)/([0-9]+)/(.*)/(.*)\.php$ index.php?tid=$1&cid=$2&cat=$3 [L]
table - row - category - section - page name

This works great for my 5 variables. Page urls looks like this: website.com/66/0/12/categories/product-name.php

I have a page a forgot password page which is a for. When an email address is submitted, it goes to a page that does the work etc, then sends back a message to say something like "Success" of "Failuer". But i am finding that i can't request[] those vars back on the forgot password password form page to work ever since i implimented htaccess mod rewrite.

Is there a way to modify the htaccess so that i can still send the odd variable ??

Totally boggled
Doug

Re: htaccess question

Posted: Sat Nov 21, 2009 8:33 am
by BlaineSch
cardi777 wrote:I am currently using this as my htaccess file:

Code: Select all

RewriteEngine on
Options +FollowSymLinks
RewriteRule ([0-9]+)/([0-9]+)/([0-9]+)/(.*)/(.*)\.php$ index.php?tid=$1&cid=$2&cat=$3 [L]
table - row - category - section - page name

This works great for my 5 variables. Page urls looks like this: website.com/66/0/12/categories/product-name.php

I have a page a forgot password page which is a for. When an email address is submitted, it goes to a page that does the work etc, then sends back a message to say something like "Success" of "Failuer". But i am finding that i can't request[] those vars back on the forgot password password form page to work ever since i implimented htaccess mod rewrite.

Is there a way to modify the htaccess so that i can still send the odd variable ??

Totally boggled
Doug
Hm, I actually thought that would allow GET data, I know it allows POST data so why not try using that instead? If that does not allow get data then you could either make another htaccess rule or use another page that does not have any rules applied to it.

Re: htaccess question

Posted: Sat Nov 21, 2009 9:27 pm
by cardi777
how does one send vars it via post?

Currently i receive using REQUEST, and the var is sent in the url.

I am only aware of sending vars 2 ways. Through the url name, and through a form submission. Is there another way?

Maybe a dumb question

Re: htaccess question

Posted: Sat Nov 21, 2009 10:20 pm
by cardi777
This is the url i make...

74/17/0/content/forgot-password.php?msg=Password reset

I tried this rule on...

Code: Select all

RewriteRule ([0-9]+)/([0-9]+)/([0-9]+)/(.*)/(.*)\.php?msg=/(.*)/$ index.php?tid=$1&cid=$2&cat=$3&msg=$6 [L]
But no luck getting the msg var to echo. Im getting it with request_.

Any ideas? Totally stuck.

Re: htaccess question

Posted: Sun Nov 22, 2009 2:26 am
by cardi777
solution...

doesn't apepar to be one, from further looking around. But i did make a function that may help out. Its a bit of a work around.

this captures all variables in the url, does a good job so far too.

Code: Select all

 
$myurl = explode('?', $_SERVER["REQUEST_URI"]);
$myurl_2 = explode('&', $myurl[1]);
foreach ($myurl_2 as $var) {
     $tempvar = explode('=', $var);
     ${$tempvar[0]} = rawurldecode($tempvar[1]);
 
}
 
echo $msg;
 
 
so with this url:74/14/0/content/change-my-details.php?msg=Update Successful!

you can access the variable as $msg. Just put the above code somewhere at the start of your page.