Jacobb123
12-15-2007, 07:57 PM
I have done some mod rewrites but have some questions because my scripts are not executing like they should because of $_GET issues.
my rewrite rule is this
^question/(.*)/(.*)/(.*)?$ /viewtopic.php?cat_id=$1&f=$2&id=$3
I have the URL as /question/arts-and-humanities/visual-arts/test-question
Now my question is this with a mod_rewrite is the script that I am executing reading the actual url? is it reading viewtopic.php?cat_id=1&f=2&id=3 or is it reading the /question/arts-and-humanities/visual-arts/test-question
I ask because I am having some problems setting up my queries
I am doing this
$cat_title = $_GET['cat_id'];
$ncat_id = get_cat_id(str_replace("-"," ",str_replace("and","&",$cat_title)),$hostname,$dbuser,$dbpass,$db);
$forum_title = $_GET['f'];
$f_id = get_cat_id(str_replace("-"," ",str_replace("and","&",$forum_title)),$hostname,$dbuser,$dbpass,$db);
$post_id = $_GET['id'];
$post_id1 = get_cat_id(str_replace("-"," ",str_replace("and","&",$post_id)),$hostname,$dbuser,$dbpass,$db);
When I echo the $_GET['f'] it returns the value "visual-arts" but when I echo the value for $f_id it returns "1"
So I am not sure what is going on or exactly how this works. I am hoping someone could explain it to me.
my rewrite rule is this
^question/(.*)/(.*)/(.*)?$ /viewtopic.php?cat_id=$1&f=$2&id=$3
I have the URL as /question/arts-and-humanities/visual-arts/test-question
Now my question is this with a mod_rewrite is the script that I am executing reading the actual url? is it reading viewtopic.php?cat_id=1&f=2&id=3 or is it reading the /question/arts-and-humanities/visual-arts/test-question
I ask because I am having some problems setting up my queries
I am doing this
$cat_title = $_GET['cat_id'];
$ncat_id = get_cat_id(str_replace("-"," ",str_replace("and","&",$cat_title)),$hostname,$dbuser,$dbpass,$db);
$forum_title = $_GET['f'];
$f_id = get_cat_id(str_replace("-"," ",str_replace("and","&",$forum_title)),$hostname,$dbuser,$dbpass,$db);
$post_id = $_GET['id'];
$post_id1 = get_cat_id(str_replace("-"," ",str_replace("and","&",$post_id)),$hostname,$dbuser,$dbpass,$db);
When I echo the $_GET['f'] it returns the value "visual-arts" but when I echo the value for $f_id it returns "1"
So I am not sure what is going on or exactly how this works. I am hoping someone could explain it to me.