I got these files:
Updating script:
<script>
function TradeURLTimer() {
setInterval(function(){
jQuery.ajax({
url: "assets/cores/check_username.php",
data:'TradeURL='+$("#TradeURL").val(),
type: "POST",
success:function(data){
$("#username-availability-status").html(data);
},
error:function (){}
});
}, 3000);
}
</script>
My check_username.php:
<?php
// Variables to connection
$mysql_hostname = "localhost";
$mysql_user = "*******";
$mysql_password = "*********";
$mysql_database = "**********";
$prefix = "";
// Create connection
$conn = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
$connect = mysql_select_db($mysql_database, $conn);
$TradeURL=$_POST['TradeURL'];
$count_TradeURLs = mysql_num_rows(mysql_query("SELECT * FROM users WHERE TradeURL='$TradeURL'"));
switch ($count_TradeURLs) {
case "0":
?>
<section class="feed-item col-md-2 pull-left">
<div style="padding-top: 5px;" class="icon">
<i class="fa fa-check color-green"></i>
</div>
</section>
<?php
echo $TradeURL;
break;
case "1":
?>
<section class="feed-item col-md-2 pull-left">
<div style="padding-top: 5px;" class="icon">
<i class="fa fa-remove color-red"></i>
</div>
</section>
<?php
break;
}
?>
My inserted text $_POST['TradeURL']
is =
https://steamcommunity.com/tradeoffer/new/?partner=53756765&token=bnsKYKib
But somehow when I ask the check_username.php
to echo the variable $TradeURL
, then it is only
https://steamcommunity.com/tradeoffer/new/?partner=53756765
So something is removing the last part of the link:
"&token=bnsKYKib"
Why does this happen? I can't figure it out. I tried to convert it into a string and split it, but still the same outcome...