Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to use parameters in ASP

Hi,

I'm a beginner with ASP. could anyone tell me how to use parameters on my asp pages? in PHP I only have to submit them to my url like test.php?Myparam=Hello%20world&MySecondPar=ABCDEFG in the code itself I can then use my parameters like: print $Myparam

When I open my asp testpage
[code]
<%

Response.Write "<P>Today is " & Date () & "."
Response.Write "

Parameter is " & par & ".

"

%>
[/code]

like this: test1.asp?par="hello"

it doesn't show hello Why not, what do I have to do to make this work ?


;-)
-mac-
mailto:programmersheaven@mac-doggie.nl
the Netherlands...

Comments

  • chick80chick80 Member Posts: 349
    [b][red]This message was edited by chick80 at 2002-9-8 11:8:51[/red][/b][hr]
    It doesn't write nothing because par is not defined!
    Try this:

    [CODE]
    Dim param
    param = Request.QueryString("par")
    Response.Write "Parameter is: " & param
    [/CODE]
    This if you pass the parameter with GET.
    If you pass it with POST you'll have to use
    [CODE]
    param = Request.Form("par")
    [/CODE]

    nICO

    [hr]
    [italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
    JOHN KEATS




  • mac_doggiemac_doggie Member Posts: 488
    Thanxxx I will try it.
    ;-)
    -mac-
    mailto:programmersheaven@mac-doggie.nl
    the Netherlands...


  • Andre YoungAndre Young USAMember Posts: 0

    ______ ( http://forcoder.org ) free video tutorials and ebooks about / Visual Basic .NET C C++ R Ruby Python C# PHP Go Scratch PL/SQL Swift Java Assembly MATLAB Delphi JavaScript Perl Objective-C Visual Basic Kotlin SAS VBScript ML Crystal D COBOL FoxPro Bash Erlang Hack Rust Clojure Scheme Scala Prolog Dart Apex Lisp Julia ABAP Awk Logo Alice F# Lua LabVIEW Ada Fortran Transact-SQL / ______________

Sign In or Register to comment.