Urlencode issues with ambersand
-
I cannot get ambersand to get escaped with urlencode
I have the callerid superfecta running.
Customer name has '&' in it. "E&E Engine Machine" by the time the url only the 'E' before the '&' survives as the customer's name.
Here is my popup link declaration.
http://192.168.1.200/callerid/selacct5.php?phone=#{CLIDNUM}&cname=#{CLIDNAME}&exten=AUTOand the PHP@ that url
<html>
<body>
<?php
/***************************************************************************
** Php code to insert mysql popup data for gambas to continue
** with building the bridge from freepbx/Fop2 to ASSET SCULPTOR applications
** mainly launching and creating order entry transactions.** JRM, Halloween 2021
****************************************************************************/$phone= substr($_GET['phone'],-10);
$cname=urldecode($_GET['cname']);echo $cname;
echo "<BR>";
$exten=$_GET['exten'];
$cusname="CallerID is ".$phone." ".$cname;echo "<title>";
echo $cusname;
echo "</title>";
$_cname = str_replace(',', ' ', $cname);
$username = "?????";
$password = "???????";
$database = "?????";
$mysqli = new mysqli("localhost", $username, $password, $database);
/*******************************************************************
** first lets see how many accts tied to the phone number
** query customer to get the acct# where the phone number is
** in the main record cus_acct, then select distinct cus_acct from
** customer where cus_commID=cus_acct
********************************************************************/
$num_accts='0';
$cus_acct='None';
$cus_commID='None';$query = "select cus_acct from customer where cus_phone='".$phone."'";
echo "$query";if ($result = $mysqli->query($query)){ $num_accts = mysqli_num_rows($result); }echo $num_accts;
while ($row = $result->fetch_assoc()) {
$cus_acct = $row["cus_acct"];
$cus_commID= $row["cus_commID"];}echo "deebugcommID=".$cus_commID;
// Now how many Accounts
echo $num_accts;$query = "insert into cidDelivery (acct,accts,exten,phone_num,cname) values ('".$cus_acct."','".$num_accts."','".$exten."','".$phone."','".$_cname."')";
echo $query;
$result=$mysqli->query($query);
echo "DONE";
?>
</body>
</html>
<body>
<!--
<script>
setTimeout(function() {
window.close()
},20000 );
</script>
-->
</body> -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login