SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Transfering variables to php script

    Hi,

    The following code does not transfer variables r and u to a php script, probably syntax error. What's wrong?

    <script language="JavaScript" src="http://www.abcd.net/feed.php?r="+escape(document.referrer)+"u="+escape(navigator.userAgent)></script>

    Thanks

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are a number of possibilities:
    1) doc.ref is empty, null, etc.
    put the following in the beginning -- alert(document.referrer)
    2) the php can't distinguish between the 2 vars because you didn't separate them with a delimiter ('&')
    Code:
    ...(document.referrer)+"u="+escape...
    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still


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
  •