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

[eluser]whygod[/eluser]
hi guys

I want to pass a value into URL.
Let say that variable name is $email_tmp.

and the value is,
$email_tmp = '[email protected]';

How to pass $email_tmp into link URL?

Thanks in advanced.







#2

[eluser]robertorubioes[/eluser]
Hi,

You try it?

http://domain.com/controller-foo/[email protected]

I think you need know "GET" protocol HTTP.

But also you view
http://ellislab.com/codeigniter/user-gui...input.html
Code:
$this->input->get()
#3

[eluser]PhilTem[/eluser]
Code:
redirect(urlencode('example.com/controller/method/?email=' . $email_tmp));

even though I would not recommend too extensively passing data via URI parameters. You've got sessions which can store data more securely plus it won't escape the strings.

PS: Or a little more fancy techniques used:
Code:
$uri_params = array('email' => $email_tmp);
redirect(urlencode('example.com/controller/method/' . http_build_query($uri_params)));




Theme © iAndrew 2016 - Forum software by © MyBB