2016-03-07 80 views
-2

我有一個php代碼來生成鏈接。 (此代碼之前用戶URL加入我的網址從TextBox獲取值到URL

<?php 
    if(isset($_POST["submit"])){ 
     $link = $_POST["link"]; 
     echo '<a href="http://onlinedealsindia.in/go.php?url="$link"">Buy Now</a>'; 
    } 
?> 
<input type="url" class="form-control" name="link" placeholder="Enter Product URL" required> 
<input class="button" type="submit" name="submit" value="Submit"> 

我想用戶URL讓我的URL等之後加入 - http://www.onlinedealsindia.in/go.php?url=(USERS URL)。由上述可見回聲。在提交用戶獲得ans回聲與我的網站URL後添加的鏈接。

回答

0
<?php 
if(isset($_POST["submit"])){ 
$link = $_POST["link"]; 
echo '<a href="http://onlinedealsindia.in/go.php?url='.$link.'">Buy Now</a>';// corrected incorrect usage of quotes 
} 
?> 
<form accept="" action="" method="post"> <!-- added form open -->  
<input type="url" class="form-control" name="link" placeholder="Enter Product URL" required> 
<input class="button" type="submit" name="submit" value="Submit"> 
</form> <!-- added form closing--> 
+0

謝謝!工作.... – Rahul