I am using aws booto3 and python to generate a quicksite link. Now I want to redirect to that link when a html button is clicked. I am using php and html in front end .. I am also running the code on xamp apachee server.
This is my python code:
import boto3
def linker():
client = boto3.client('quicksight', aws_access_key_id=' ',aws_secret_access_key='abc', region_name='us-east-2')
p= client.get_dashboard_embed_url(AwsAccountId="123", DashboardId="7d5163cf-801c-6666-ba2d-231d3b2ba1b5", IdentityType="IAM", SessionLifetimeInMinutes=100, ResetDisabled=True, UndoRedoDisabled=True)
return p['EmbedUrl']
This is redirect.php:
<?php
$result = exec( "python abc.py" );
if(isset($_POST['submit'])){
header("Location: $result");
}
?>
This is the html file
<form action=redirect.php; ?> id="#form" method="post" name="#form">
<input id='btn' name="submit" type='submit' value='Submit'>
<?php include "redirect.php"; ?>