Jump to content

Passing values in URL


vishak

Recommended Posts

Hi...

I've just started learning Ajax and my question is :

I am passing these values in this url ,

http://localhost/test/check.php?sem=s1&s2&branch=cse

 

the value of sem is actually s1&s2,

but since & is the delimiter here I'm not able to receive the full value of sem

Should i escape the & character?(if so, how?)

Or is there any other way to overcome this?

Link to comment
Share on other sites

Just to add, if you're using server-side languages like PHP or ASP u can do them automatically:

 

PHP:

http://localhost/test/check.php?sem=<?php echo urlencode('s1&s2'); ?>&branch=cse

 

ASP:

http://localhost/test/check.php?sem=<%=Server.URLEncode("s1&s2")%>&branch=cse

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...