Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Stripping Variables in a $_GET
Old 03-03-2009, 11:47 PM Stripping Variables in a $_GET
Average Talker

Posts: 15
Trades: 0
I have a form on one page and when I send it using the $_GET method my url end up looking like this:
Code:
?make1=scripts%2FvehicleSelection.php%3Fmake%3DCHEVROLET%26NewUsed%3DU&model=CORVETTE&make=CHEVROLET&Search=Search
I want to strip out the first part of this, this part
Code:
?make1=scripts%2FvehicleSelection.php%3Fmake%3DCHEVROLET%26NewUsed%3DU&
So I should simply just end up with something close to
Code:
model=CORVETTE&make=CHEVROLET
macbaby is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-04-2009, 02:43 AM Re: Stripping Variables in a $_GET
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
That part of the url happens because you have a field in your formular with it.
It may be a hidden field.

The point is, that this value may be needed by the form processing script.
Why do you want to strip it out?
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 03-04-2009, 01:41 PM Re: Stripping Variables in a $_GET
Average Talker

Posts: 15
Trades: 0
Hi, Yes it is in the form because I am utilizing AJAX to pull in a field for another selection field in the form. I dont want this variable being passed to the next page because I don't need it in my next script.
macbaby is offline
Reply With Quote
View Public Profile
 
Old 03-04-2009, 03:08 PM Re: Stripping Variables in a $_GET
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
If you need it, then it will be in the url.
There is no way to prevent this, or you use 2 separate forms.
1 for the ajax, 1 for the rest
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 03-04-2009, 04:04 PM Re: Stripping Variables in a $_GET
Average Talker

Posts: 15
Trades: 0
I'm not sure you have helped me out here. I am looking for someone to answer my original question.
macbaby is offline
Reply With Quote
View Public Profile
 
Old 03-04-2009, 04:39 PM Re: Stripping Variables in a $_GET
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
The answer is simple:
You cannot remove the display in the url if you don't remove the field in the form.

Your best bet is to have 2 forms: 1 for the ajax request, 1 for the other requests, and removing the unneeded field from the "normal" field.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Stripping Variables in a $_GET
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.42161 seconds with 12 queries