Results 1 to 4 of 4

Thread: value of a php variable disappears

  1. #1
    Join Date
    Sep 2005
    Posts
    229

    value of a php variable disappears

    After the first space I have a problem with the value of php variable disappearing?
    I produce a code like this - echo "<a href=javascript:goto('$a[0]',$a[1]')>$a[1]</a> with a value of of $a[0] is 'T h i s' then my mouse goes on the anchor with a value of - javascript:goto('T which is a syntax error? why is this happening please help me.

  2. #2
    Join Date
    Jun 2006
    Posts
    623
    Due to HTTP this is not a limit of PHP cause spaces are not allowed in HTTP protocol. To protect passing illegal characters with a get method you have to url encode the variables that you are passing. Did you check the manual for urlencode() function that can be handy?

  3. #3
    Join Date
    Dec 2007
    Posts
    1,599
    I figured out this with this solution given which would help you guys out.

  4. #4
    Join Date
    Dec 2007
    Posts
    1,547
    The codes are not proper, take a look at the fix that i did

    PHP Code:
    echo "<a href=\"javascript:goto('$a[0]','$a[1]')\">$a[1]</a>"

Similar Threads

  1. environment variable
    By lda1971 in forum Windows Software
    Replies: 1
    Last Post: 23-07-2011, 01:29 AM
  2. Replies: 2
    Last Post: 28-08-2009, 07:51 PM
  3. OSK text disappears
    By Ananias in forum Windows Software
    Replies: 2
    Last Post: 01-05-2009, 01:25 PM
  4. Replies: 3
    Last Post: 25-04-2009, 11:34 AM
  5. Internet disappears
    By monsitj in forum Technology & Internet
    Replies: 3
    Last Post: 23-11-2008, 12:14 PM

Tags for this Thread

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
  •  
Page generated in 1,714,280,079.00675 seconds with 17 queries