Threaded View

  1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    18
    Vote Rating
    0
    deepakse is on a distinguished road

      0  

    Default Answered: How to solve "Uncaught SyntaxError: Unexpected token < " Error.

    Answered: How to solve "Uncaught SyntaxError: Unexpected token < " Error.


    Hi,
    i have created a simple form using sencha touch and i use MySQL as a back-end for storing data.My basic functionality is just user fill the form and values of textfield in the form is stored in to MySQL table.Every beginer try to do it.But i am facing problem with storing data into table.
    here is my code.

    Ext.define('SenchaDemo.view.Main',
    {
    extend: 'Ext.Panel',
    xtype: 'mainpage',
    requires: [
    'Ext.TitleBar',
    'Ext.Video'
    ],
    config:
    {
    fullscreen:true,
    items:[
    {
    xtype:'textfield',
    id:'tname',
    name:'name',
    label:'Name'
    },
    {
    xtype:'textfield',
    id:'temail',
    name:'email',
    label:'Email'
    },
    {
    xtype:'textfield',
    id:'tmsg',
    name:'message',
    label:'Message'
    },
    {
    xtype:'button',
    name:'submit',
    text:'click here',
    id:'b1',
    listeners:{
    tap:function()
    {

    // fetch value from text field

    var fname=Ext.getCmp('tname').getValue();
    var femail=Ext.getCmp('temail').getValue();
    var fmsg=Ext.getCmp('tmsg').getValue();
    //console.log(fname,femail,fmsg);

    mystore.setProxy({
    type:'jsonp',
    url:'http://10.16.10.244/senchaDB/userinsert.php',
    method: "POST",
    //callbackKey: 'callback',
    /*reader:{
    type:'json'
    },*/
    /*success:function(result,request)
    {
    var text = result.responseText;
    //Ext.Msg.alert(text);
    console.log(text);
    },*/
    extraParams:
    {
    pname:fname,
    pemail:femail,
    pmsg:fmsg
    }


    });

    mystore.load();
    Ext.Msg.alert("Data Successfully store on the server");


    }
    }

    }
    ]




    }
    });
    and server side code id here
    <?php$con=mysql_connect("localhost","root","");
    $db=mysql_select_db("triumphsys",$con);
    //$callback=$_REQUEST['pname'];
    //$name=$_GET['pname'];
    //$email=$_GET['pemail'];
    //$msg=$_GET['pmsg'];
    //echo"".$years;
    $query="INSERT INTO userinfo(name,email,msg)VALUES('".$_POST['pname']."','".$_POST['pemail']."','".$_POST['pmsg']."')";
    //"insert into userinfo(name,email,msg)values('$_POST['pname']','$_POST['pemail']','$_POST['pmsg']')"
    $result=mysql_query($query);
    mysql_close($con);
    ?>
    Error Code here

    [COLOR=red !important]Uncaught SyntaxError: Unexpected token < userinsert.php:1


    [/COLOR]


    Please suggest me where i did wrong code.

  2. What does the response look like? Also, why aren't you just using a form panel and submitting the form? Why are you loading a store to submit data?

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi