how to get the parameters passed by URL in my Action? - hyperlink

In my jsp page I got a link like that :
<a href="actionEdit.do?mtitle=<%=f.getMovieTitle()%>">
Everything works fine in the page, but I want to get the value of mtitle in my Action page
I can't get it with request.getparameter()
thx for ur help

You could try:
Request.QueryString["mtitle"]

try following code:
String mtitle = request.getParameter("mtitle");

Related

Kohana 3.3 get url parameters

My question can look stupid but I need to get in touch and get a decision. I want to pass parameters to url without the parameters being seen in the url. this is to secure my server. Because the url looks like this
controller/edit/123
and the '123' is the user ID in the database.
I can simple do this
public function action_edit($id) {
get_db_info($id);
}
Is it possible to hide the parameter while redirecting to this url from a view? ie in the view file
// Do something to set the ID
<?php Kohana_Request::post("user_id", $id); ?>
Click
and get the ID like this
public function action_edit() {
$id = $this->request->post("user_id");
get_db_info($id);
}
But the problem I can't access the KOhana_Request instance and get this error
*Non-static method Kohana_Request::post() should not be called statically*
Can someone gives a secured approach to this ?
I think I found a solution by encoding and decoding the parameters.
Since Kohana 3.3 do not allow parameters in controller functions see .
I do this in my view
$user_id = Encrypt::instance()->encode($liste->user_id);
$encode_id = base64_encode($user_id);
$encode_ure_id = urlencode($encode_id);
And from the controller,
$encoded_id = urldecode($this->request->param('uri_id'));
$encode_base_url = base64_decode($encoded_id);
$user_id = Encrypt::instance()->decode($encode_base_url);
If this can help others.

Passing url paramaters

Any idea about how can I send parameters in url query and get values of these parameters in next page
In first template I wrote this code
<a href ='r_rss/openOneNews?url={rss_link}'>{rss_title}</a>
Q:How can I get url parameter value in ExpressionEngine and use something like this in following page:
<iframe src = 'url' />
Thanks
See this answer - you want to use Mo' Variables to get the query string, which will then convert to a variable tag:
<iframe src = '{get:url}' />
Ahmed - please don't cross-post your question:
https://expressionengine.stackexchange.com/questions/14546/form-post-values
https://expressionengine.stackexchange.com/questions/14548/sending-paramters-in-url

Yii url route with parameters

At the moment i have a glossar controller with an actionAnzeige()-method.
For this action i need GET-paramter named item.
Now i could use this url: www.xy.de/glossar/anzeigen?item=programming
But i want to use this: www.xy.de/glossar/programming
I've added this route to the rules:
'glossar/<item:\d+>'=>'glossar/anzeigen',
and now i can generate the url i want to use:
<?php echo Yii::app()->createUrl('glossar/anzeigen', array('item' => $glossarItem->Url)); ?>
But if i visit the created url, i get a 404 error.
You can use this, which accepts characters or numbers:
'glossar/<item:.+>'=>'glossar/anzeigen',
You have to use w+ instead of d+ since item takes letters instead of digits
'glossar/<item:\w+>'=>'glossar/anzeigen',

Redirection url provoc a lost of information in my url

I'm trying to do a redirection from my host : http://www.carthera.com to http://www.carthera.eu,
Everything looks fine, but when i try to go on another page with carthera.eu I have this :
http://carthera.eu/index.php?page=carthera&ssmenu=0
But with carthera.com I just have the
http://carthera.com
Does anyone know where it comes from and how can i fix this ?
Thanks a lot!
For information, the problem was that the host used an Iframe to display carthera.com. So basically when I went on carthera.com, I would have an iframe with carthera.eu. So the information for the get are not displayed in carthera.com but in the iframe carthera.eu ...

Yii framework CHtml::link error jump to a named anchor in another page

I'm use Yii Framework.
I have a named anchor <a name="projet">projet</a> in about.php page.
I've created a link in the index page to the named anchor in the about page like that :
<?php echo CHtml::link('MyLink',array('site/page','view'=>'about#projet')); ?>
But when I click on the link "MyLink", I have an error 404 response with this message :
The requested view "about#projet" was not found.
And in the url I have:
localhost/myApps/index.php?r=site/page&view=about%23projet
I checked default charset application is UTF-8. So I don't understand why my link isn't well encoded.
Someone can help me please?
try this:
echo CHtml::link('MyLink',array('site/page','view'=>'about', '#'=>'projet'));

Resources