Welcome Guest, Not a member yet? Register   Sign In
what is the code?
#1

[eluser]Unknown[/eluser]
what is the code in condigniter for
Code:
<a href='abc.php? id=1'>click here</a>

that means , how to pass variables through a URL
#2

[eluser]Ajaxboy[/eluser]
[quote author="bir" date="1334982095"]what is the code in condigniter for
Code:
<a href='abc.php? id=1'>click here</a>

that means , how to pass variables through a URL[/quote]

looks like an example of a link, and has a typo space in it
#3

[eluser]ojcarga[/eluser]
Codeigniter lets you pass variables like this

www.mysite.com/pages/news/12

instead of

www.mysite.com/?page=pages&category=news&id=12

To do that, you need to use mod_rewrite and a .htaccess file.

http://ellislab.com/codeigniter/user-gui...elper.html
http://ellislab.com/codeigniter/user-gui...uting.html
http://ellislab.com/codeigniter/user-gui...s/uri.html

Take a look into those links where you can find more info about that and come back if you have further questions Wink



#4

[eluser]Nakul Khandelwal[/eluser]
This is what i use, try it :

View :
Code:
<a href="&lt;?php echo base_url(); ?&gt;hello/abc/?id=1">Click Here</a>

Controller :
Code:
class Hello extends CI_Controller {

public function abc()
{
   parse_str($_SERVER['QUERY_STRING'], $_GET);
  
  
   if(isset($_GET['id'])) {
    $id = $_GET['id'];
   }
}
}




Theme © iAndrew 2016 - Forum software by © MyBB