Click here to Skip to main content
12,892,810 members (62,813 online)
Rate this:
Please Sign up or sign in to vote.
See more: PHP Ajax jQuery
I was expecting an ouput but it didn't show any. Is there missing in my code or what's wrong? Thanks in advance

I have this line of code in my main page

        <label for="text_email">E-mail:</label>
        <input id="text_email" type="email" >
        <script type="text/javascript" charset="utf-8" src="//">
            function email(str){
                $.post('checkmail.php',{ email: str},
                }, 'json');
        <label for="text_email" id="check_email"></label>

And this line of code

        $pdo=new PDO('mysql:host=localhost;dbname=class;charset=utf-8', 'root');
    catch(PDOException $e)
        echo 'Failed: '.$e->getMessage();
    $stmt=$pdo->prepare('SELECT email FROM class where email=:email LIMIT 1');
        $check='E-mail cannot be use.';
        $check='E-mail can be use.';
    echo json_encode(array('returnValue'=>$check));
Posted 27-Aug-12 8:09am
ryanb31 27-Aug-12 15:24pm
So, what specific line of code is giving you a problem?
Mohibur Rashid 29-Aug-12 1:41am
first pointer: your src in script tag is wrong. it should be src="http//"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170424.1 | Last Updated 27 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100