I have this script.
<script type='text/javascript' charset='utf-8'>
$(window).load(function(){
window.loadIframe = function(frame) {
var link = $(frame).attr('src');
$.post('link.php', {'link': link}, function (txt) {});
}
});
</script>
If I replace $.post('a.php', {'link': link}, function (txt) {});
for alert(link)
it will display a link: example(http://www.example.com/123-a-b-c-d-e-f-0), ok.
Then, in the link.php I have this code:
<?
...
$link = filter_input(INPUT_POST, 'link', FILTER_SANITIZE_NUMBER_INT);
mysql_query("insert into prueba values ('', '$link')");
...
?>
When I check the database, the value inserted isn't the full link, is 123-------0
Where is the problem? Thank you very much.