/    Sign up×
Community /Pin to ProfileBookmark

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. [url]www.kasa.com/tech.php?update=travel[/url]. From here if the user made a mistake and wanted to change the choice it just adds to the existing url like this [url]www.kasa.com/tech.php?update=travel?update=time[/url]. 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.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@so_is_thisNov 16.2006 — 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);
×

Success!

Help @kwrj2000 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...