Welcome Guest, Not a member yet? Register   Sign In
How pass GET value in a URL?
#1

[eluser]napster3000[/eluser]
I tried to pass a GET value in a url but i get error

/frontend.php/Booking/?id_build=74

I've to get id_build value passed by url.
#2

[eluser]eoinmcg[/eluser]
If you have query strings enabled you should be able to access them via URI segments
http://ellislab.com/codeigniter/user-gui.../urls.html

Otherwise, try accessing via the $_REQUEST superglobal
http://us2.php.net/manual/en/reserved.va...equest.php
#3

[eluser]enjoyfrancis[/eluser]
$_GET['id_build']
#4

[eluser]eoinmcg[/eluser]
@enjoyfrancis This won't work out of the box. Codeigniter's default behaviour is to empty the $_GET array
#5

[eluser]enjoyfrancis[/eluser]
ah thanks
#6

[eluser]therealmaloy[/eluser]
@napster3000

one of the best ways to do it is using segments as pointed out by eoinmcg.

try to minimize the use of the traditional value pair method in the URLs but instead utilize the functionality provided by CI.

this method is very handy and will make your URLs a little bit cleaner and clearer...
#7

[eluser]napster3000[/eluser]
may i use each other?
GET and segnements
#8

[eluser]napster3000[/eluser]
i used $this->uri->segment(3) but when after i submit a form the value of $this->uri->segment(3) return "css"! how??

i think it's for this html header

<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/print.css" type="text/css" media="print" />
<link rel="stylesheet" href="css/table.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/calendar.css" />

but why??
#9

[eluser]therealmaloy[/eluser]
@napster3000

post your controller and view, let's try to dissect your problem...




Theme © iAndrew 2016 - Forum software by © MyBB