www.webdeveloper.com
Results 1 to 2 of 2

Thread: PHP url problems

  1. #1
    Join Date
    Aug 2006
    Posts
    12

    PHP url problems

    I have a site that is using a JavaScript onChange event and is returning a url to the website and refreshing the page. Then the php picks up whatever the update equals and adds some more content to the page.
    In other words the user makes a choice from the drop down menu and that triggers the page to return with a new url ex. www.kasa.com/tech.php?update=travel. From here if the user made a mistake and wanted to change the choice it just adds to the existing url like this www.kasa.com/tech.php?update=travel?update=time. I want to get rid of the first update and replace it with the new one, so that the php can pick it up and send it to the right script.

    Thanks.

  2. #2
    Join Date
    Oct 2006
    Posts
    1,297
    This is not a PHP question. In JavaScript, the onchange event code might have something in it that looks similar to this:

    self.location.href += '?'+this.name+'='+escape(this.options[this.selectedIndex].value);

    That needs to be changed to something more like this:

    self.location.search = '?'+this.name+'='+escape(this.options[this.selectedIndex].value);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles