Below is my ajax code along with html and php code.
I am getting an error "title is not defined"..

function callAjax() {
    $.ajax ({
        type: "POST",
        url: "get.php",
        data: "title=" + title, 
        success: function(msg) {
        error: function(msg){ alert(msg); },


<form method="post" onsubmit="callAjax();">
    <div class=><label for="title">Title:</label><input type="text" name="title" /></div><br/>
<input type="submit" value="submit"></form>';

$title = $_POST['title'];
echo $title;

please specify the problem clearly

i could find the variable name 'title' at php file,ajax and html too

where you are getting from?

at line 7 how you get the value of title? that might be the problem i think

happy coding

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.