playing with PHP arguments...

Author Message
Spencer 06/07/2004 09:54 pm
I`m 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
Oleg Chernavin 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
Spencer 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
Oleg Chernavin 06/08/2004 09:22 am
Sorry, but it is possible to handle only one argument relocation this way.

Oleg.
Oleg Chernavin 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.
Spencer 06/08/2004 07:00 pm
I don`t 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

Now I would like it to download to this folder:

f:\download folder\www.server.com\path\def\action.php?arg1=abc&dir=def&arg2=ghi

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

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

Oleg.
Oleg Chernavin 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:

http://www.metaproducts.com/download/betas/oep1721.zip

Oleg.
Spencer 07/01/2004 06:06 pm
I sent you a couple of emails. It does work and it doesn`t. It works if I check the URL Substitute rule (apply at the server) but if I uncheck the rule (apply when exporting only), it doesn`t 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:
> > http://www.metaproducts.com/download/betas/oep1721.zip
> > Oleg.
>
Spencer 07/02/2004 12:25 am
Please disregard my last posting. I tried it again and URL Substitution with multiple wild cards doesn`t work either with it checked or unchecked. Argh!

> I sent you a couple of emails. It does work and it doesn`t. It works if I check the URL Substitute rule (apply at the server) but if I uncheck the rule (apply when exporting only), it doesn`t work. I appreciate all of your help in this matter.
Oleg Chernavin 07/02/2004 10:39 am
Can you provide me with a sample but real Project that shows that it doesn`t work? Maybe something is wrong with the settings? I tested this feature on MP Forums.

Oleg.