Welcome Guest, Not a member yet? Register   Sign In
Sending URLs through URI segments
#1

[eluser]Unknown[/eluser]
Hi all, I'm currently in the middle of making a Bookmarking application with CI and I've come across a problem when it comes to sending full URLs to my functions.

What I want to do is use a simple Javascript bookmarklet that can be stored in the users toolbar to send the current pages URL and Title to my "Add" function.

For example, if I were on Google and clicked the bookmarklet it would send the following:

http://www.appname.com/controller/functi...F;/Google/

The information in the last two segments would then be placed in a form for quick storage.

However, the problem I'm having with CI is the fact that the URI encoded parts of the URL (: and /) are passed as their actual values, meaning that the Segment based approach will not work, but at the same time Query Strings does not really seem viable as it would mean changing the *entire* URL structure of my app would it not?

Sorry if this isn't overly clear/is a problem that is well documented but I couldn't find much help from the CI website.

Thanks in advance for your help!

Matt
#2

[eluser]EugeneS[/eluser]
have you tried urlencode ?

Code:
echo urlencode('http://google.com/?hl=en');

will return you http://google.com/?hl=en


more over you can encript/decript urls or you can use symbol codes and separate them through the "_" for example .... like

324_435_456_456

will be long row but will definitely work
#3

[eluser]sophistry[/eluser]
I gather you can't use POST?




Theme © iAndrew 2016 - Forum software by © MyBB