Question about url variables

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Question about url variables

    Does anyone know of a way to grab a complete url, save it in a variable and transfer it to another page.

    Thanks,

    Robert
    rappelec Guest

  2. Similar Questions and Discussions

    1. Variables question
      I have a musql database on a personal web server which correctly displays the variable I want in flash. However I wish to change my variables now...
    2. local variables question...
      Ok I'm reading the docs in order. It's saying that "variables"... (ex: variables.whatever) must be specified for local variables, but there's no...
    3. server variables question
      I have a little snippet of code that looks like this: strServer = Request.ServerVariables ("server_name") If strServer = "localhost" then ...
    4. Newbie question about variables in URL
      I'd be grateful for any help with this... I'm a PHP newbie using Apache and PHP offline for testing site pages (I'll get an online remote server...
    5. getenv variables question
      I am trying to write a PHP action into my custom 404 error page that will email me when someone tries to access a bad link. I can get it to work...
  3. #2

    Default Re: Question about url variables

    Are you trying to get the user's REQUESTED page?

    If so, this will do it:

    <CFSET sRequestPage = "http://" & CGI.SERVER_NAME & CGI.SCRIPT_NAME & "?" &
    CGI.QUERY_STRING>

    If you need to, you can also test for (CGI.HTTPS IS "On").

    Cheers,
    -- MikeR

    MikerRoo Guest

  4. #3

    Default Re: Question about url variables

    I'm not sure if I understand what you mean by user's REQUESTED page. What I
    have is a page with an article on it and a link to a "email this article" form.
    The is used for sending someone the url of the page that contains the article.
    I tried using <CFSET sRequestPage = "http://" & CGI.SERVER_NAME &
    CGI.SCRIPT_NAME & "?" & CGI.QUERY_STRING> but I still just get the path
    [url]http://www.company.com/newsandpubs/pr/[/url]
    Maybe I'm emplimenting this wrong. I have <CFSET sRequestPage = "http://" &
    CGI.SERVER_NAME & CGI.SCRIPT_NAME & "?" & CGI.QUERY_STRING> at the top of the
    article page and <cfparam name="sRequestPage" default=""> at the top of the
    email form page. Then I include #sRequestPage# between the cfmail tags.

    rappelec Guest

  5. #4

    Default Re: Question about url variables

    So you are displaying a page and it has a button like "Email this page" which
    posts to your email page, and you want to send the full original URL?

    If that is what you are asking then Add this tag inside the form that has your
    email button:
    <input type="hidden" name="sRequestPage" value="#sRequestPage#" />

    In your email page, you would have:
    <cfparam name="FORM.sRequestPage" default="">

    and
    #FORM.sRequestPage# between the cfmail tags.

    --MikeR


    MikerRoo Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139