LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   script to modify url (http://www.linuxquestions.org/questions/programming-9/script-to-modify-url-454633/)

gazman1 06-14-2006 06:09 AM

script to modify url
 
ok i have two applications one will only output urls like myserver/fmi/xml/fmlresult.xml/?name=gaz&surname=man
but the second will only accept urls that are
myserver/fmi/xml/fmlresult.xml/?-db=student&-lay=students&firstname=gaz&surname=man&-findall


the information that is different never changes so would it be possible to write a perl/php script that would be queried like this myserver/script.php?name=gaz&surname=man it would then reformat the url to be myserver/fmi/xml/fmlresult.xml/?-db=student&-lay=students&firstname=gaz&surname=man&-findall query that and retrun the result.

vikasumit 06-14-2006 08:53 AM

Hi,


as per my understanding to you question that is possible in PHP , but franking i am not clear with idea how you are going to use it...

for in general you can try something like this

Code:

<?
header ("Location: myserver/fmi/xml/fmlresult.xml/?-db=student&-lay=students&firstname=$_GET[name]&surname=$_GET[surname]&-findall
?>

a very basic PHP script to redirect your

myserver/script.php?name=gaz&surname=man

to

myserver/fmi/xml/fmlresult.xml/?-db=student&-lay=students&firstname=gaz&surname=man&-findall


Hope that help

gazman1 06-14-2006 09:17 AM

basically we have a virtual learning environment which we use for course notes etc. and a database which we use for storing information on accounts etc. We want users to be able to see select info stored about them in database from the learning environment so the learnign environ is supposed to query the database, however the learnign environment will only produce urls like myserver/script.php?name=gaz&surname=man but the datbase will only accept queries in the form myserver/fmi/xml/fmlresult.xml/?-db=student&-lay=students&firstname=gaz&surname=man&-findall


All times are GMT -5. The time now is 10:55 AM.