(affichage d'abord, donc s'il vous plaît être miséricordieux si je suis parti sur une partie de l'étiquette, le balisage, etc. :))POST'ing à un serveur pour le contenu d'un <iframe>
côté serveur:
iframe-contents.php:
<?PHP
if($_POST['test-post-parameter'] == 'test-post-value'){
echo 'test-post-parameter successfully detected as "test-post-value".';
} else {
echo 'test-post-parameter either absent or of a different value than "test-post-value". :(';
}
?>
OK, laisse ainsi dire que je demande iframe contenu à l'aide
bash$ wget --post-data='test-post-parameter=test-post-value' -O - http://example.com/iframe-contents.php
Le résultat serait:
test-post-parameter successfully detected as "test-post-value".
Si, cependant, je l'ai demandé à l'aide
`bash$ wget -O - http://example.com/iframe-contents.php`
je finirais obtenir:
test-post-parameter either absent or of a different value than "test-post-value
Maintenant - permet de dire que j'ai un autre fichier sur le serveur, appelé index.html
:
<html><head><title>PAGE_TITLE</title></head>
<body>
<iframe width="100%" height="100%" src="iframe-contents.php" />
</body>
Si j'ai essayé de taper http://example.com/index.html
dans mon navigateur, je recevrais PAGE_TITlE
dans ma barre de titre, avec test-post-parameter either absent or of a different value than "test-post-value". :(
dans le corps .
Ma question est la suivante: Comment puis-je modifier l'élément iframe afin que je reçoive?
test-post-parameter successfully detected as "test-post-value".