質問の答え: https://stackoverflow.com/a/16721000/2217905
<?php
if(isset($_POST["act"])) {
$uname = $_POST['username']; //Username
$uname = str_replace(array('!','"','£','$','%','%','^','&','*','(',')','-','+','=','\\','/','[',']','{','}',';',':','@','#','~','<',',','>','.','?','|',' '), '', $uname);
// Set some variables and values that you want to be propogated through the URL
$variable['1'] = $_POST['username'];
// We now set the base of the dynamic link
$link = "http://yunodev.com/skinstealer.php";
// Add on a question mark to the link, to identify that variables are now being set
$link .= "?";
// Lets add on our first variable to the link
$link .= $variable['1'];
}
?>
<!-- THIS PAGE IS skinstealer.php -->
<html>
<head>
<title>Minecraft Skin Stealer - Image View</title>
</head>
<body>
<img src="http://s3.amazonaws.com/MinecraftSkins/<?php echo $uname; ?>.png" width="800" height="400" alt="Error">
<p><b>Image scaled by 800x400pixels. Will be much smaller, and no blur when downloaded.</b></p>
<p><a href="http://s3.amazonaws.com/MinecraftSkins/<?php echo $uname; ?>.png">Download Skin</a></p>a
これは私が今持っているコードです。基本的に私が欲しいのは、ユーザーがリンクにアクセスしたときです: http://example.com/skinstealer.php?id=Laimそのスキンが表示されます。それが理にかなっていれば。
これまで変数をやったことがないので、これは私にとって新しいことです。
ジョージのコメントの後に編集
現在、(echo の場合) 得られるのはhttp://example.com/skinstealer.php?laim だけです。そのリンクにアクセスすると、エラー画像が表示されます。必要に応じて、ライブ デモをアップロードできます。