Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute an html document held in a sperate sub-directory 1

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I am probably being a mega dope here but here goes.

I have a folder on my web server root that holds
template and test scripts. This folder has many sub-folders each with its own template or script.

When I run one of my templates in one sub-folder, I want it to reference a script in another sub-folder on the 'action'
parameter of a submitted form.

How do I point the 'action' statement to a seperate sub-directory without hard coding the entire physical path on the server?

folder
|
|
|--Templates&Tests folder
|
|
|--Template01 folder
| Contains 'MyForm.html'
|
|--Template02 folder
Contains 'MyScript.asp'

In 'MyForm.html':-

<form action=&quot;MyScript.asp&quot; method=&quot;post&quot; name=&quot;Form01&quot;>
<input name=&quot;Run TestComponent&quot; type=&quot;submit&quot;>
</form>

'Myscript.asp' will not be found because it does not exist
in the folder Template01 where 'MyForm.html' is executed.
I vaguely remember seeing something somewhere indicating you can use '/' and '//' to define the folder level in front of a script. Is this relevant or a red herring?


Dazed and confused
 
You can use .. to go to a parent folder. So for your example, you'd have:
Code:
<form action=&quot;../Template02/MyScript.asp&quot; method=&quot;post&quot; name=&quot;Form01&quot;>
<input name=&quot;Run TestComponent&quot; type=&quot;submit&quot;>
</form>
What that says is to look at the parent folder(Templates&Tests) of the current location (Template01), then look in the Template02 folder and use the MyScript.asp script.

 
Worked nicely.

Many thanks.

Dazed and confused
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top