-5

質問の答え: 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 だけです。そのリンクにアクセスすると、エラー画像が表示されます。必要に応じて、ライブ デモをアップロードできます。

4

1 に答える 1

0

わかった、やっと。(先日入手しましたが、この問題を抱えている他の人のためにこの質問を更新するのを忘れていました。)

削除するコード:

<?php
if(isset($_POST["act"])) {

// 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']; 


} <!-- REMOVE THIS

次に、すべての「POST」を「GET」に変更します。例は次のとおりです: http://yunodev.com/download/minecraft/ (V5)

于 2013-05-23T18:10:24.393 に答える