Welcome Guest, Not a member yet? Register   Sign In
Problem with uri
#1

[eluser]7amza[/eluser]
Hey
i have a problem using this uri :
site.com/page/{#####}
while {####} is a non ASCII Page Slug, so when i try to get the page from the databse i get en empty result (FALSE)!!
this is the query(using ORM DM):
Code:
$slug = $this->uri->segment(2);
$page = new page();
$page->where('slug',$page)->get();
if($page->exists() == FALSE){
echo "Empty";
}else{
..
}
in the database all is right the slug exists , and if i use an ASCII Page slug it works good !
any help guys?
// sorry for my poor english
#2

[eluser]7amza[/eluser]
any help guys?
#3

[eluser]InsiteFX[/eluser]
Maybe you should post this in the ORM forum.

InsiteFX
#4

[eluser]Toppy[/eluser]
Thought it was your code (based on your post example) but re-read your message about the ascii working.

Anyways can't delete my reply so we're stuck with this not helpful message of mine.
#5

[eluser]JoostV[/eluser]
You characters may be converted. Did you check if the contents of $slug are whatr you expect them to be? No html entities or any other conversions?
#6

[eluser]InsiteFX[/eluser]
Maybe you need to create a route for it!
Code:
$route['page/(:num)'] = "page/$1";

InsiteFX
#7

[eluser]7amza[/eluser]
hey guys ,
i found the proble and still searchinf for the cause and the solution .
the problem is that the url is encoded automatically ! so i need every time to decode the slug before passing it to the database !!!
so when i use :
urlencode($slug);
// get the page ..
all is working good , so any suggect guys?




Theme © iAndrew 2016 - Forum software by © MyBB