Jump to content

Need help to "Sanatize" a URL?


roldahayes

Recommended Posts

Hi, Im trying to sort out a problem with Cross Site Scripting on a basket page we use.

 

We have been told by our security PCI sanning company that the data that needs to be "sanatized" is:

 

// assign variables

    //echo "ref1:" . $HTTP_REFERER . "<br>";

    //$temp = (string)$HTTP_REFERER;

    //$urlref2 = substr($temp,0,6);

    //echo "ref:" . $urlref;

    $urlref = $HTTP_REFERER;

    $prodID = $_GET['productID'];

    $delete = $_GET ['delete'];

    $quantity = $_GET['quantity'];

    $updateQuantity = $_GET['updateQuantity'];

    $update = $_GET ['update'];

    $currency = "£";

    // maximum querys per user basket

    $MAXBASKETQUERY = 25;

    // start the html table  

 

Can anyone suggest the best way to do this please?

Link to comment
https://forums.phpfreaks.com/topic/202235-need-help-to-sanatize-a-url/
Share on other sites

Yeah the manual

http://php.net/manual/en/function.mysql-real-escape-string.php

 

$prodID = mysql_real_escape_string($_GET['productID']);

assuming it was alphanumberic. If it was only numeric you could just as easily use

$prodID = intval($_GET['productID']);

 

 

edit: %2F is a / character. Just remove that from /product_page.php somewhere in the code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.