Hi all
I need help with writing a preg_match statement. I am v new to preg_match!
i have a web page which is included when a specific word is found within the url and I am using this code to do that:
if (preg_match('/(\/myword)/',$_SERVER['REQUEST_URI'],$matches)) {
include('/myscript.php');
exit();
}
Now, on this page (myscript.php) I have links which send via GET a number back to itself and I display database records accordingly based on that ID, so the url in the address bar may end up looking like this:
ww.mysite.com/myword/?id=999
This is working fine, however on this page, I need to be able to click a link which takes you to more details of that database record so my url will end up being as such:
www.mysite.com/myword/myrecord
(where 'myrecord' can be different each time)
However, I need this last bit to redirect to a new page and not go to myscript.php which it is doing at the moment because of the preg_match statement I have set above.
Can someone help out and explain how I can get round this by keeping the GET script and the 'show the database record' script separately but the 'myword' will be in both URL's?
I hope that makes sense.
P.S. If its any use I am using mod_rewrite to manage my friendly urls.