hello!
This is for use with PHP but the regex will be the same as perl.
Basically the REQUEST_URI will contain a key-value pair like... query=THESUBMITTEDQUERY
which could turn up straight after the ?query=THESUBMITTEDQUERY or half way through like ?name=fred&query=THESUBMITTEDQUERY&hello=world
So what I want to do is replace the "query=THESUBMITTEDQUERY" with query=$variable no matter where it sits in that sting.
$url = $_SERVER['REQUEST_URI'];
$url = preg_replace('/??????????/', "query=$variable", $url);
Can anyone help me with the right code to go in ?????????? to do that?
Thanks,
Regan
This is for use with PHP but the regex will be the same as perl.
Basically the REQUEST_URI will contain a key-value pair like... query=THESUBMITTEDQUERY
which could turn up straight after the ?query=THESUBMITTEDQUERY or half way through like ?name=fred&query=THESUBMITTEDQUERY&hello=world
So what I want to do is replace the "query=THESUBMITTEDQUERY" with query=$variable no matter where it sits in that sting.
$url = $_SERVER['REQUEST_URI'];
$url = preg_replace('/??????????/', "query=$variable", $url);
Can anyone help me with the right code to go in ?????????? to do that?
Thanks,
Regan