Ok, so i tried multiple of solutions but nothing seems to work for me, (or i'm just too stupid to get it).
I have such jquery code:
Jquery:
var current_id = $(this).attr("id");
var dataString = {"id" : current_id};
$.post("popup.php" , {"id" : $(this).attr("id")}, function(msg) { alert(msg);} );
I know few lines are useless here but i tried all options,
PHP:
$tmp = $_POST['id'];
if($tmp == "kontakt"){
echo '<p>UDANE PRZESŁANIE</p>';}
else{
echo '<p>NIEUDANE PRZESŁANIE</p>';
}
When i click on id=kontakt php returns error :
Notice: Undefined index: id in D:\***\popup.php on line 2
but alert sends back
<p>UDANE PRZESŁANIE</p>
Edit:
Ok, Maybe i haven't make my question clear. I don't care if php error is shown or not, I just want to know why it shows up in the first place.
thisin your JavaScript Snipplet?{"id": $(this).attr("id")}code used twice?console.log(current_id)or something like that. )