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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help 1

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
Hiya fellas.
I've encountered a problem and I hope one of you can help me.
I have this simple form that checks if a specific folder exists on a specific drive.

How can I make what's typed in my search box display on my script.asp


My user, would type:d:\data\files and search

MY FORM

<form method=&quot;POST&quot; action=&quot;script.asp&quot;>
<p align=&quot;center&quot;> </p>
<p align=&quot;center&quot;> <input type=&quot;text&quot; name=&quot;search&quot; size=&quot;25&quot;> </p>
<p align=&quot;center&quot;>  <input type=&quot;submit&quot; value=&quot;Search it !&quot; name=&quot;B1&quot;>  
<input type=&quot;reset&quot; value=&quot;Reset&quot; name=&quot;B2&quot;></p>
</form>


MY SCRIPT PAGE

<%
Set fs=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
If fs.FolderExists(&quot;d:\data\files&quot;) = true Then
Response.Write(&quot;Folder d:\data\files exists.&quot;)
Else
Response.Write(&quot;Folder d:\data\files does not exist.&quot;)
End If
set fs=nothing

%> QUOTE OF THE DAY
The only ideas that will work for you are the ones you put to work.
<%
Jr Clown
:eek:)
%>
 
JrClown,

I don't do VB so maybe someone can verify my code.


<%
'get the users input
sSearch = Request(&quot;search&quot;)
Set fs=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
If fs.FolderExists(sSearch) = true Then
Response.Write(&quot;Folder &quot; & sSearch & &quot; exists.&quot;)
Else
Response.Write(&quot;Folder &quot; & sSearch & &quot; does not exist.&quot;)
End If
set fs=nothing
%>


Hope this helps
-pete
 

Thank you very much Palbano, Great job buddy. You got my vote. QUOTE OF THE DAY
The only ideas that will work for you are the ones you put to work.
<%
Jr Clown
:eek:)
%>
 
You may need to cstr the Request.
From experience, if you don't put a verified string into the .FileExists, it'll shoot out an error. I wouldn't be surprised if it did the same for .FolderExists.

Ex:
sSearch = cstr(Request(&quot;search&quot;))

Better to be safe than sorry :)

leo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top