Welcome Guest, Not a member yet? Register   Sign In
Additional URL in a URI?
#1

[eluser]Iverson[/eluser]
I need to do something similar to the way Digg captures a url and sends it to their site. For example, when a user clicks on
Code:
http://www.example.com/getlink/http://www.anothersite.com
I want to grab that url and use it on the page. I don't want to use query strings and I keep getting an error from xajax...

Quote:Unable to parse URL
Filename:libraries/xajax.php
Line Number: 1641

Is there anyway to do this with just my models and controllers?
#2

[eluser]xwero[/eluser]
instead of adding an url to the link why not add the id of the link. The problem with adding an url to the URI is that the forward slashes are seen as segments in CI so you will have, whitout routing; getlink (controller), http: (function), '', www.anothersite.com and so on.
#3

[eluser]Iverson[/eluser]
Thanks for the advice. The problem is that the link will come from an external page and there's no way I will know what the link is until it comes in. The same theory as Digg uses. A user clicks on a link that says

Code:
http://www.digg.com/submit?url=http://www.example.com

Digg then takes that URL and uses it.
#4

[eluser]xwero[/eluser]
i advise you to do the same and use a query string instead of a segment so your url will look like the digg url.
#5

[eluser]Iverson[/eluser]
I am doing that now, however I still get the xajax error I posted above about being "unable to parse the URL in the xajax.php library.
#6

[eluser]Iverson[/eluser]
I fixed it. If you are using XAJAX and would like to have a special character in your URI/URL, you need to go to line 1633 of the file you renamed xajax.php in the /libraries folder and add the URL code you will need. It takes the URL and replaces special characters with the proper code in an array.

Example (using colons)

Codes can be found here




Theme © iAndrew 2016 - Forum software by © MyBB