Welcome Guest, Not a member yet? Register   Sign In
how to pass empty variable into url?
#1

[eluser]Unknown[/eluser]
hello..

i've create a class with index function like this

Code:
class Myclass extends Controller
{
function Myclass()
{
  parent::Controller();
}

function index($var1="",$var2="",$var3="",$var4="")
{
  .... bla bla bla
}
}

this URL is working the way i wanted:
http://blabla.com/codeigniter/myclass/in...3/content4

but with this url, i can't get var4 value
http://blabla.com/codeigniter/myclass/index////content4

why is that happen? any solution?

sorry for my poor english Smile
#2

[eluser]WanWizard[/eluser]
You can't pass empty values in the URL, the repeated /// are stripped.

If the position of the variable is not relevant, you can simply use http://blabla.com/codeigniter/myclass/index/content4.
If it is relevant, use http://blabla.com/codeigniter/myclass/in...4/content4, then use $this->uri->uri_to_assoc() to fetch them.
#3

[eluser]Unknown[/eluser]
woaah replied so fast..thanks.

ok got it..
the position is relevant, i will try: $this->uri->uri_to_assoc()




Theme © iAndrew 2016 - Forum software by © MyBB