HTML code that generate custom url with user given value - url

Hi i am want an html code that replace XXXXXXXXXXXXXXXXXXX value from my url with my user given value and generate a new url
Below is My URL
https://www.facebook.com/connect/uiserver.php?method=stream.publish&redirect_uri=https://www.facebook.com&api_key=192236710846214 &picture= XXXXXXXXXXXXXXXXXXX%3Flvh%3D1& source=https://dl.dropboxusercontent.com/u/61636013/achille.swf&set=a.106020872877897.12204.100004099541771&type=1&theater &name=Posted by Karthik%C2%AD&caption=Kaur & comment%C2%AD&description=%C2% For Fun

Best is that you use php:
<?php
$x="XXXXXXXXXXXXXXXXXXX";
$location= "https://www.facebook.com/connect/uiserver.php?
method=stream.publish&redirect_uri=https://www.
facebook.com&api_key=192236710846214 &picture=".
$x.
"%3Flvh%3D1& source=https://dl.dropboxusercontent.com
/u/61636013/achille.swf&set=a.106020872877897.12204.
100004099541771&type=1&theater &name=Posted by
Karthik%C2%AD&caption=Kaur & comment%C2%AD&description=%C2%";
header("Lcation:".$location);
?>

Related

Duplicating POST request to another URL

I have a PHP file on a URL that processes data sent from an API. I can't access the sending server to redirect, duplicate or test that feed to a staging server.
What code can I put in the processing file that will send a duplicate of the POST variables to another URL?
Is it a question of processing all POST variables into a new form and then submitting the form after the live code has run?
<form id='forwarding-form' action="https://stagingURL" method = "post">
<? foreach ($_POST as $key=>$value) {
echo "<input type = 'hidden' name='$key' value='$value'>";
} ?>
</form>
then at the end of the file
<script>
$('#forwarding-form').submit();
</script>
Will this work?
Or is there a more direct or elegant way?

Get values from url after a specific portion of html

I need to go to a specific portion of html through url and get the values from url.
Here is my url.
But if i get the value of 'number_page' as,
$_GET['number_page'] it doesn't return anything.
Is there any solution?
Given you are using PHP(implied from your question) and the 'aTag' in my example is the html code of the page you are at:
<?php
$aTag="";
$pos = strrpos($aTag, "number_page=");
$subStr = substr($aTag,$pos+12);
$pos = strrpos($subStr, "'");
echo substr($subStr,0,$pos);
?>
The output will be 10
You can see it here

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',

Resources