Professional Web Applications Themes

js issue to php - PHP Development

A currently existing page is handed a value like this : page.htm?code in the html of that page :...

Sponsored Links
  1. #1

    Default js issue to php

    A currently existing page is handed a value like this :

    page.htm?code

    in the html of that page :


    Sponsored Links
    Peter Guest

  2. #2

    Default Re: js issue to php

    A currently existing page is handed a value like this:
    page.htm?code_value


    in the html of that page :

    <script type="text/javascript">

    code = (self.location.search) ? self.location.search.substring(1) :
    "none";

    if (code == "code_value")
    {
    // build url ...
    }

    </script>



    I want to change the js to php ... but how do I get the code value ?
    because, if I understand correctly, php would expect ?code=value


    Peter Guest

  3. #3

    Default Re: js issue to php

    Peter Van Hove wrote:
     

    Although the part of a URL you have shown may be correct, I've never seend
    this format being used before and you may be storing up problems by keeping
    the format (instead of, say, page.html?code_value=1).

    Running as a module PHP should have full view of the requested URI. Try
    phpinfo() for the right variable to use. It wont automatically
    aassign/create a variable wrt 'code_value'.

    HTH

    C.


    Colin Guest

  4. #4

    Default Re: js issue to php

    "Peter Van Hove" <net> wrote
    in message news:AeYne.109259$telenet-ops.be... 


    Elementary, dear Watson.

    <?php

    $code = $_SERVER['QUERY_STRING'];

    if($code=="code_value"){
    // build code
    }
    ?>


    --
    Welcome to Usenet! Please leave tolerance, understanding
    and intelligence at the door. They aren't welcome here.
    eternal piste erection miuku gmail piste com


    Kimmo Guest

  5. #5

    Default Re: js issue to php


    thx, works.


    Peter Guest

  6. #6

    Default Re: js issue to php

    It may not be the most beautiful solution but it stays compatible this way
    with the earlier implementation.
    Life is hard ... ;-)


    Peter Guest

Similar Threads

  1. CSS Issue, need some help
    By ICI-MASA in forum Macromedia Dynamic HTML
    Replies: 3
    Last Post: January 9th, 12:55 PM
  2. DmFade Issue -- DMTools Issue
    By Dave in forum Macromedia Director Basics
    Replies: 5
    Last Post: June 24th, 11:18 PM
  3. FRS issue
    By Monty Slayton in forum Windows Server
    Replies: 0
    Last Post: June 17th, 01:46 PM
  4. 4GL V7.32 issue
    By Malc P in forum Informix
    Replies: 1
    Last Post: August 26th, 09:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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