Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 04-08-2008
Member
 
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.
Reply With Quote
  #2  
Old 04-08-2008
Member
 
Join Date: Jun 2006
Posts: 620
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?
Reply With Quote
  #3  
Old 04-08-2008
Member
 
Join Date: Dec 2007
Posts: 1,592
I figured out this with this solution given which would help you guys out.
Reply With Quote
  #4  
Old 04-08-2008
Member
 
Join Date: Dec 2007
Posts: 1,542
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>"
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "value of a php variable disappears"
Thread Thread Starter Forum Replies Last Post
environment variable lda1971 Windows Software 1 23-07-2011 01:29 AM
Runtime Error 91 : Object Variable or with block variable not set Ryan21 Software Development 2 28-08-2009 07:51 PM
OSK text disappears Ananias Windows Software 2 01-05-2009 01:25 PM
What is Global Variable static? Declaring static variable instead of Global variable Reckon Software Development 3 25-04-2009 11:34 AM
Internet disappears monsitj Technology & Internet 3 23-11-2008 12:14 PM


All times are GMT +5.5. The time now is 12:31 AM.