Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. Urlencode issues with ambersand

Urlencode issues with ambersand

Scheduled Pinned Locked Moved Support
2 Posts 2 Posters 77 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K
    K
    KnightFlyer
    wrote on last edited by
    #1

    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=AUTO

    and 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>

    1 Reply Last reply
    0
    • N
      N
      nicolas
      wrote on last edited by
      #2

      Hi,
      I am about to release version 2.31.31 with a fix for that bug. Check the donwload page in the following hours, the command to upgrade your FOP2 installation is:

      wget -O - http://download.fop2.com/upgrade_fop2.sh | bash

      1 Reply Last reply
      0

      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
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      Powered by NodeBB Contributors
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups