douyouyi8878 2019-06-02 16:57
浏览 180

如何使PHP重定向从运行aws服务的python函数生成的链接

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"; ?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料