/    Sign up×
Community /Pin to ProfileBookmark

disappearing "+" sign from tha passed url

Here is my url :

[code=html]http://localhost/accounting/products.php?sortby=($row->fgiris+$row->sfeksik)&nr=3[/code]

and i want to catch value of sortby to insert into the db by

[code=php]$sortby = $_GET[“sortby”];[/code]

But in the table it is written this value

[code=php]($row->fgiris $row->sfeksik)[/code]

plus (+) sign disappears.

How how i can get whole value without loosing that + sign?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@Jeff_MottApr 18.2009 — It's in a URL, so it needs to be URL encoded.

[font=courier]sortby=(%24row-%3efgiris%2b%24row-%3esfeksik)[/font]
Copy linkTweet thisAlerts:
@NogDogApr 18.2009 — If you are creating the URL within your PHP code, you can use the [url=http://www.php.net/urlencode]urlencode[/url]() function.
Copy linkTweet thisAlerts:
@SyCoApr 20.2009 — [code=php]$sortby = $_GET["sortby"]; [/code]
Renaming like this serves no purpose and just means you're more likely to forget to sanitize the user input as it no longer looks like a use inputted variable.
×

Success!

Help @mrtblt 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,
)...