Results 1 to 3 of 3

Thread: VB-ASP dealing with a search

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    40

    Angry

    Dear fellow members,

    I am a beginner in vb as well as databases. Here is my problem. I need to create a db search on my website. One to contain a command button and a text box. The text box should be the input field for a zipcode and the command button initiates the search. A new page would return a field that is associated with the zipcode.
    -----------------------------------------------------------
    Here is my code for the first page:
    ------------------------------------
    <%@ LANGUAGE="VBSCRIPT" %>
    <HTML><HEAD>
    </HEAD>
    <BODY>
    <P>Simply enter your zip code, and our locator system will find the name(s) of
    the city.</P>
    <P>
    <FORM action=test.asp method=get>&nbsp;
    <P><B>Enter a Zip-Code: </B><INPUT name=zip> <INPUT type=submit value="look it up"> </FORM>
    <BLOCKQUOTE></BLOCKQUOTE></TD><TD width="14" valign="top"><IMG height=1 src=""
    width=14> </TD></TR><TD colspan="4">&nbsp;
    <HR noShade SIZE=1>
    </BODY></HTML>
    -----------------------------------------------------------

    The second page: (test.asp)
    --------------------------------
    <%@ LANGUAGE="VBSCRIPT" %>
    <HTML>
    <HEAD>
    <TITLE>Test</TITLE>
    </HEAD>
    <BODY>
    <% dim zip
    %>
    <%
    IF zip="39110" THEN
    Response.Write ("Madison Branch")
    ELSE
    Response.Write ("Not madison")
    END IF
    Response.Write ("Madison Branch")
    %>
    </BODY>
    </HTML>

    -----------------------------------------------------------

    My If statement isn't working!!!
    All I get is =>

    Not madisonMadison Branch

    on the page. I appreciate all help from experienced asp gurus.

    Thanks,

    SG


  2. #2

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    40

    Unhappy addition..

    Seems like im getting a 0 all the time for zip?????
    my entry form is not accepting the value as zip?

  3. #3
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi spg1

    In your first page make the method of your form to post
    and in your test page do

    Dim Zip

    Zip = Request.Form("zip")

    That will get the value from the previos page.

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width