0

I want to have a overlay over my content site. So if somebody clicks on a link a article is loaded into the covering overlay Div

Everything is working fine except the output is not working properly.

<script language="javascript">

    $( ".iddd" ).click(function() {
    var aid = $(this).prop('id');
    $('#overlaycontent').load('http://www.example.com/overlay.php', { id: aid });

    });

Test PHP Script:

<?php 

include ("config.php");
$ID = $_POST['id'];

echo $ID;

?>

That´s how my links are placed:

<a class="iddd" href="#overlay" id="6337cab172">

The id should be loaded into the script so I can access my articles but i guess the Jquery is not working properly.

I looked at this overlay with dynamic php content the right way?

but still it doesnt post the ID properly!

Peter
  • 1

1 Answers1

0

Not sure what is in config.php and if missing that could cause your problem, but to include a file, you don't use parenthesis, but only quotes, so, instead of

include ("config.php");

just

include "config.php";
Johannes
  • 64,305
  • 18
  • 73
  • 130
  • Parens may not be needed (and still work just fine if they exist). Having them isn't his problem. – IncredibleHat Mar 11 '18 at 01:14
  • yep, thank you sir :) Is it possible to write a function so i just need to put the id as a parameter and it automatically puts it in my overlay div? – Peter Mar 11 '18 at 01:16