Results 1 to 8 of 8

Thread: strings with spaces [Resolved]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    strings with spaces [Resolved]

    Ok, so I have the following function:
    Code:
    function gofull()
    {
        URL = location.href
        if (URL.search("Date_Found") != -1)
    	{
    	URL = URL.substring(0,URL.search("Date_Found")-1)
    	}
        URL=URL+"?Date_Found="+document.dform.Date_Found.value+"&Last_Known="+document.dform.Last_Known.value
        
        if (document.dform.TagNum.options[document.dform.TagNum.selectedIndex].value != 1)
            URL = URL+"&TagNum="+document.dform.TagNum.options[document.dform.TagNum.selectedIndex].value
        if (document.dform.SYMP.value != "")
            URL = URL+"&SYMP="+document.dform.SYMP.value
        if (document.dform.User.options[document.dform.User.selectedIndex].value != 1)
            URL = URL+"&user="+document.dform.User.options[document.dform.User.selectedIndex].value
        if (document.dform.impact.value != "")
            URL = URL+"&impact="+document.dform.impact.value
    
            URL = URL+"&act_prod_date="+document.dform.act_prod_date.value
    	location.href = URL
    }
    -->
    </script>
    It works great except for the fact that the "SYMP" field is a string that will contain spaces. When that field is put into the URL when the form is refreshed, it adds "%20" for each space... and then when I use the following:
    PHP Code:
            <?php
            
    if(isset($_GET['SYMP']))
                echo 
    "<input type=text name=SYMP size=40 value=" $_GET['SYMP'] . ">";
            else
                echo 
    "<input type=text name=SYMP size=40 value=\"\">";
            
    ?>
    it only puts the first word of the string into the textbox.

    How do I get it to grab the whole string out of the URL?
    Last edited by ober0330; May 12th, 2004 at 10:43 AM.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

Posting Permissions

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



Click Here to Expand Forum to Full Width