# playing with PHP arguments...

Message
06/07/2004 09:54 pm
Im playing with a website that uses PHP and I would like to play with the argument line. (This question can also be applied to ASP and JSP). Take this example:

www.website.com/path/element.php?dir=???

Now for each link I have to play with the ??? part in the "URL Substitutes..." button to get this:

URL: */element.php*
Replace: /element.php
With: /???/element.php

I would like to say this instead in a template:
URL: */element.php?dir=???*
Replace: /element.php
With: /[dir]/element.php or /???/element.php

Is this possible or is this in a future release or am I dreaming?

Thanks
06/08/2004 04:00 am
No, this is a reality! :-)

For example, if you want to convert .../element.php?dir=abc to /abc/element.php then use

URL: */element.php*
Replace:
/element.php?dir=*
With:
/*/element.php

This should work.

Best regards,
Oleg Chernavin
MP Staff
06/08/2004 08:13 am
Thank Oleg for the quick reply:

What do you do in cases with more than one argument say:

http://www.server.com/path.php?arg1=abc&dir=???&arg2=def&so on...

Url: */path.php?*dir=*&*
Replace: /path.php?*dir=*&*
With: /*/path.php?*dir=*&*

Thanks
06/08/2004 09:22 am
Sorry, but it is possible to handle only one argument relocation this way.

Oleg.
06/08/2004 09:25 am
I am wrong - you can do it. But you should create several URL Substitution rules and check the box to apply all rules. Each of the rules should relocate one argument at a time.

Oleg.
06/08/2004 07:00 pm
I dont understand. Can you give an example with this:

I have an URL like:
www.server.com/path/action.php?arg1=abc&dir=def&arg2=ghi

What should my two (or more) URL substitutions rules be?

Thanks
06/09/2004 07:33 am
Oh, I thought about some other combination. Sorry, but I dont have any idea how to make this kind of conversion now.

Oleg.
06/10/2004 08:20 am
I just added this to Offline Explorer Pro. Now you will be able to use the following rules:

URL: */command.php?arg1=*&dir=*&*
Replace: /command.php?arg1=*&dir=**&***
With: /**/command.php?arg1=*&dir=**&***

The updated version is:

Oleg.
07/01/2004 06:06 pm
I sent you a couple of emails. It does work and it doesnt. It works if I check the URL Substitute rule (apply at the server) but if I uncheck the rule (apply when exporting only), it doesnt work. I appreciate all of your help in this matter.

> I just added this to Offline Explorer Pro. Now you will be able to use the following rules:
> > URL: */command.php?arg1=*&dir=*&*
> Replace: /command.php?arg1=*&dir=**&***
> With: /**/command.php?arg1=*&dir=**&***
> > The updated version is:
> I sent you a couple of emails. It does work and it doesnt. It works if I check the URL Substitute rule (apply at the server) but if I uncheck the rule (apply when exporting only), it doesnt work. I appreciate all of your help in this matter.