<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic &amp;quot;http://localhost/signup.php&amp;quot; in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082497#M62146</link>
    <description>&lt;P&gt;"&lt;A href="http://localhost/signup.php" style="font-size: 13.008px; line-height: 14.3088px; color: blue !important;"&gt;http://localhost/signup.php&lt;/A&gt;"&lt;/P&gt;

&lt;P&gt;Are you sure you're using the correct localhost url ? Where's the port number ? ;). localhost:3003/signup.php for instance check your IDE or your TOMCAT/Wamp configuration in order to get the correct URL.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Aug 2016 09:20:58 GMT</pubDate>
    <dc:creator>jerome_g_2</dc:creator>
    <dc:date>2016-08-04T09:20:58Z</dc:date>
    <item>
      <title>Login Local Storage Error</title>
      <link>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082496#M62145</link>
      <description>&lt;DIV class="post-text" itemprop="text"&gt;
	&lt;P&gt;I'm creating a login interface in Intel XDK for a mobile app. When I hit login, I'm getting alert "login error". Username and password is exist in MySQL db but cant login.&lt;/P&gt;

	&lt;P&gt;HTML login form&lt;/P&gt;

	&lt;PRE class="brush:xml;" style=""&gt;&amp;lt;input type="text" placeholder="Email" id="email"&amp;gt;
&amp;lt;input type="password" placeholder="Password" id="pass"&amp;gt;
&amp;lt;button class="button widget uib_w_13 d-margins button-positive button-clear" id="login" data-uib="ionic/button" data-ver="0"&amp;gt;Login&amp;lt;/button&amp;gt;&lt;/PRE&gt;

	&lt;P&gt;Javascript&lt;/P&gt;

	&lt;PRE class="brush:jscript;"&gt; $(document).on("click", "#login", function(evt)       
{

    var email=$("#email").val();
    var pass=$("#pass").val();
    var dataString="email="+email+"&amp;amp;pass="+pass+"&amp;amp;login=";
    if($.trim(email).length&amp;gt;0 &amp;amp; $.trim(pass).length&amp;gt;0)
    {
        $.ajax({
            type: "POST",
            url: 'http://localhost/signup.php',
            data: dataString,
            crossDomain: true,
            cache: false,
            beforeSend: function(){ $("#login").html('Connecting...');},
            success: function(data){
                if(data=="success")
                {
                    localStorage.login="true";
                    localStorage.email=email;
                    activate_page("#userpage"); 
                }
                else(data="failed");
                {
                    alert("Login error");
                    $("#login").html('Login');
                }
            }
        });
    }
     return false;
});&lt;/PRE&gt;

	&lt;P&gt;PHP Code&lt;/P&gt;

	&lt;PRE class="brush:php;" style=""&gt;if(isset($_POST['login']))
{
    $email=mysql_real_escape_string(htmlspecialchars(trim($_POST['email'])));
    //example pass. do not use without bcrypt
    $pass=mysql_real_escape_string(htmlspecialchars(trim($_POST['pass'])));
   

    $login=mysql_num_rows(mysql_query("select * from `login` where `email`='$email' and `pass`='$pass'"));
    if($login!=0)
    {
        echo "success";
    }
    else
    {
        echo "failed";
    }
}&lt;/PRE&gt;

	&lt;P&gt;Any help appreciated. Thank you&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Aug 2016 02:37:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082496#M62145</guid>
      <dc:creator>Sam_Suresh</dc:creator>
      <dc:date>2016-08-04T02:37:18Z</dc:date>
    </item>
    <item>
      <title>"http://localhost/signup.php"</title>
      <link>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082497#M62146</link>
      <description>&lt;P&gt;"&lt;A href="http://localhost/signup.php" style="font-size: 13.008px; line-height: 14.3088px; color: blue !important;"&gt;http://localhost/signup.php&lt;/A&gt;"&lt;/P&gt;

&lt;P&gt;Are you sure you're using the correct localhost url ? Where's the port number ? ;). localhost:3003/signup.php for instance check your IDE or your TOMCAT/Wamp configuration in order to get the correct URL.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 09:20:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082497#M62146</guid>
      <dc:creator>jerome_g_2</dc:creator>
      <dc:date>2016-08-04T09:20:58Z</dc:date>
    </item>
    <item>
      <title>That is correct URL.</title>
      <link>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082498#M62147</link>
      <description>&lt;P&gt;That is correct URL.&lt;/P&gt;

&lt;P&gt;I able to register user with same URL. But not able to login. I think there is problem with datastring.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 10:43:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082498#M62147</guid>
      <dc:creator>Sam_Suresh</dc:creator>
      <dc:date>2016-08-04T10:43:58Z</dc:date>
    </item>
    <item>
      <title>Hi Sam,</title>
      <link>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082499#M62148</link>
      <description>&lt;P&gt;Hi Sam,&lt;/P&gt;

&lt;P&gt;Could be that you are passing in the datastring an empty login variable? Then isset($_POST['login']) evaluates to false.&lt;/P&gt;

&lt;P&gt;Try something like this:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;var dataString="email="+email+"&amp;amp;pass="+pass+"&amp;amp;login=1";
&lt;/PRE&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Diego&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 11:45:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082499#M62148</guid>
      <dc:creator>Diego_Calp</dc:creator>
      <dc:date>2016-08-04T11:45:00Z</dc:date>
    </item>
    <item>
      <title>Thank you for pointing that</title>
      <link>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082500#M62149</link>
      <description>&lt;P&gt;Thank you for pointing that out.&lt;/P&gt;

&lt;P&gt;I still cant login.. It stopped at connecting... Is my redirect after login is correct?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 00:10:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082500#M62149</guid>
      <dc:creator>Sam_Suresh</dc:creator>
      <dc:date>2016-08-05T00:10:03Z</dc:date>
    </item>
    <item>
      <title>Hi Sam,</title>
      <link>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082501#M62150</link>
      <description>&lt;P&gt;Hi Sam,&lt;/P&gt;

&lt;P&gt;The redirect, are you talking about the activate_page? Seems OK to me, but sometimes XDK needs a tweak to have it working.&lt;/P&gt;

&lt;P&gt;Take a look to jquery ajax documentation, I saw some examples where you need to add the event complete to remove what are you doing in the beforeSend.&lt;/P&gt;

&lt;P&gt;Another suggestion is to place a console.log in your code to know if now it is entering into the success section of the ajax call, then see what happens with activate_page.&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Diego&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 11:43:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Login-Local-Storage-Error/m-p/1082501#M62150</guid>
      <dc:creator>Diego_Calp</dc:creator>
      <dc:date>2016-08-05T11:43:42Z</dc:date>
    </item>
  </channel>
</rss>

