我的代码在使用web浏览器执行时运行良好,但是当我尝试使用wget、curl或python脚本执行它时,它不能正常工作。 执行php代码,但表单不是自动提交的。在
<?php
$dbh = new PDO('mysql:host=localhost;dbname=database', 'username', 'password');
$reponse = $dbh->query('SELECT code FROM download limit 1');
$donnees = $reponse->fetch();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr">
<head>
<title>validation de formulaire</title>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<style type="text/css">
</style>
</head>
<body onload="document.f.submit()">
<form name="f" method="post" action="http://website.lol/upload/traitement.php">
<input type="text" class="form-control" id="url" name="url" placeholder="http://..." value="https://url.com/<?php echo $donnees['code']; ?>">
</form>
</body>
</html>
也在javascript中尝试过:
^{pr2}$但结果是一样的。在
使用curl发布数据
相关问题 更多 >
编程相关推荐