<?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 Quote:Dwight B. wrote: in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Login-PHP-and-PostgreSQL/m-p/1088352#M64362</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Dwight B. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Might it be that you need an absolute url instead of a relative url here?&lt;BR /&gt;
	&amp;nbsp;action="verifica_usuario.php"&amp;nbsp;&lt;/P&gt;

&lt;P&gt;RELATIVE -name of a file that is on the same machine as the one calling it. It usually is just a file name.&amp;nbsp;&lt;BR /&gt;
	ABSOLUTE -access a file on a remote machine. &amp;nbsp;it includes the protocol, path, and file name.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/Absolute%20url"&gt;https://en.wikipedia.org/wiki/Absolute%20url&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Maybe something like this?&lt;BR /&gt;
	&amp;nbsp;action="&lt;A href="https://mysite.com/mobile-services/verifica_usuario.php"&gt;https://mysite.com/mobile-services/verifica_usuario.php&lt;/A&gt;"&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thanks for the reply, I put the &lt;STRONG&gt;verifica_usuario.php&lt;/STRONG&gt; on server, and I changed the action url, and that error don't show anymore, but i have a new problem :(&lt;/P&gt;

&lt;P&gt;At verifica_usuario.php have this lines:&lt;/P&gt;

&lt;PRE class="brush:php;" style="font-size: 13.008px; line-height: 19.512px;"&gt;include "index.html"; // line 13 and 43
header("location: area_restrita.php"); // line 36&lt;/PRE&gt;

&lt;P&gt;index.html is the main page of my app and it's in the folder in my pc, don't in the server, so he can't find.&lt;/P&gt;

&lt;P&gt;How can I solve it?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:php;"&gt;&amp;lt;?php

session_start(); //inicia a sessao

include "http://localhost:8080/ConexaoBD/conecta.class";

$user = $_GET['user'];
$password = $_GET['password'];

if((!$user) || (!$password)){
    
    echo "Por favor, todos campos devem ser preenchidos! &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;";
    include "index.html"; //----------HERE------------
    
}else{
    $password = md5($password);
    
    $sql = pg_query(
        "SELECT * FROM pessoa WHERE email_pessoa = '{$user}' AND senha_pessoa = '{$password}' AND status_pessoa='A' ";
    );
    
    $login_check = pg_num_rows($sql);
    
    if($login_check &amp;gt; 0){
        
        while($row = pg_fetch_array($sql)){
            foreach ($row as $key =&amp;gt; $val){
                $$key = stripslashes( $val );
            }
            
            $_SESSION['id_pessoa'] = $id_pessoa;
            $_SESSION['nome_pessoa'] = $nome_pessoa;
            $_SESSION['tipo_pessoa'] = $tipo_pessoa;
            $_SESSION['email_pessoa'] = $email_pessoa;
            
           header("location: area_restrita.php");
                
        }
    }else{
        echo "Você não pode logar-se! Este usuário e/ou senha não são válidos!&amp;lt;br /&amp;gt;
             Por favor tente novamente!&amp;lt;br /&amp;gt;";
        
        include "index.html";//------------HERE----------
    }
    
}


?&amp;gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2016 01:05:44 GMT</pubDate>
    <dc:creator>Gabriel_A_</dc:creator>
    <dc:date>2016-01-15T01:05:44Z</dc:date>
    <item>
      <title>Login PHP and PostgreSQL</title>
      <link>https://community.intel.com/t5/Software-Archive/Login-PHP-and-PostgreSQL/m-p/1088350#M64360</link>
      <description>&lt;P&gt;I'm developing an app where I need implements login, the all data are stored in PostgreSQL database, I'm using PHP and XAMPP as server, but it's not works, an error appears:&lt;/P&gt;

&lt;PRE style="font-size: 13.008px; color: rgb(96, 96, 96); line-height: 19.512px;"&gt;Cannot POST /http-services/emulator-webserver/ripple/userapp/x/C/Users/Gabriel.DESKTOP-HUBGD9F/AppData/Local/XDK/xdk-scratchdir/d1b4c333-e5d3-4334-9276-67c06d0fba6f/platforms/ios/www/verifica_usuario.php&lt;/PRE&gt;

&lt;P&gt;I don't know why this error appears, the verifica_usuario.php is in the same folder as html, &amp;nbsp;I put bellow the form code of my login page:&lt;/P&gt;

&lt;PRE class="brush:xml;"&gt; &amp;lt;form action="verifica_usuario.php" method="POST" id="formLogin"&amp;gt;
            
            &amp;lt;label&amp;gt;User&amp;lt;/label&amp;gt;&amp;lt;br/&amp;gt;
            &amp;lt;input name="user" type="text" id="user" /&amp;gt;&amp;lt;br/&amp;gt;
            &amp;lt;label&amp;gt;Password&amp;lt;/label&amp;gt;&amp;lt;br/&amp;gt;
            &amp;lt;input name="password" type="password" id="password" /&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;
            
            &amp;lt;input type="submit" name="Submit" value="LOGIN" /&amp;gt; 

&amp;lt;/form&amp;gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Here are the &lt;STRONG&gt;verifica_usuario.php&lt;/STRONG&gt; code:&lt;/P&gt;

&lt;PRE class="brush:php;"&gt;&amp;lt;?php

session_start(); //inicia a sessao

include "http://localhost:8080/ConexaoBD/conecta.class";

$user = $_GET['user'];
$password = $_GET['password'];

if((!$user) || (!$password)){
    
    echo "Por favor, todos campos devem ser preenchidos! &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;";
    include "index.html";
    
}else{
    $password = md5($password);
    
    $sql = pg_query(
        "SELECT * FROM pessoa WHERE email_pessoa = '{$user}' AND senha_pessoa = '{$password}' AND status_pessoa='A' ";
    );
    
    $login_check = pg_num_rows($sql);
    
    if($login_check &amp;gt; 0){
        
        while($row = pg_fetch_array($sql)){
            foreach ($row as $key =&amp;gt; $val){
                $$key = stripslashes( $val );
            }
            
            $_SESSION['id_pessoa'] = $id_pessoa;
            $_SESSION['nome_pessoa'] = $nome_pessoa;
            $_SESSION['tipo_pessoa'] = $tipo_pessoa;
            $_SESSION['email_pessoa'] = $email_pessoa;
            
           header("location: area_restrita.php");
                
        }
    }else{
        echo "Você não pode logar-se! Este usuário e/ou senha não são válidos!&amp;lt;br /&amp;gt;
             Por favor tente novamente!&amp;lt;br /&amp;gt;";
        
        include "index.html";
    }
    
}


?&amp;gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Someone can help me please? Thanks!&lt;/P&gt;

&lt;P&gt;**Sorry for my bad English :l&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 23:12:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Login-PHP-and-PostgreSQL/m-p/1088350#M64360</guid>
      <dc:creator>Gabriel_A_</dc:creator>
      <dc:date>2016-01-14T23:12:09Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Software-Archive/Login-PHP-and-PostgreSQL/m-p/1088351#M64361</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Might it be that you need an absolute url instead of a relative url here?&lt;BR /&gt;
	&lt;SPAN style="font-size: 13.008px; color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 14.3088px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="color1" style="font-size: 13.008px; line-height: 14.3088px; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: auto !important; color: rgb(128, 128, 128) !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;"&gt;action&lt;/CODE&gt;&lt;CODE class="plain" style="font-size: 13.008px; line-height: 14.3088px; color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: auto !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;"&gt;=&lt;/CODE&gt;&lt;CODE class="string" style="font-size: 13.008px; line-height: 14.3088px; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: auto !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;"&gt;"verifica_usuario.php"&lt;/CODE&gt;&lt;SPAN style="font-size: 13.008px; color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 14.3088px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;RELATIVE -name of a file that is on the same machine as the one calling it. It usually is just a file name.&amp;nbsp;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;ABSOLUTE -access a file on a remote machine. &amp;nbsp;it includes the protocol, path, and file name.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/Absolute%20url" target="_blank"&gt;https://en.wikipedia.org/wiki/Absolute%20url&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Maybe something like this?&lt;BR /&gt;
	&lt;SPAN style="font-size: 13.008px; color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 14.3088px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="color1" style="font-size: 13.008px; line-height: 14.3088px; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: auto !important; color: rgb(128, 128, 128) !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;"&gt;action&lt;/CODE&gt;&lt;CODE class="plain" style="font-size: 13.008px; line-height: 14.3088px; color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: auto !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;"&gt;=&lt;/CODE&gt;&lt;CODE class="string" style="font-size: 13.008px; line-height: 14.3088px; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: auto !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;"&gt;"https://mysite.com/mobile-services/verifica_usuario.php"&lt;/CODE&gt;&lt;SPAN style="font-size: 13.008px; color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 14.3088px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;DIV&gt;Hope this helps.&lt;/DIV&gt;</description>
      <pubDate>Thu, 14 Jan 2016 23:23:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Login-PHP-and-PostgreSQL/m-p/1088351#M64361</guid>
      <dc:creator>Dwight_B_1</dc:creator>
      <dc:date>2016-01-14T23:23:01Z</dc:date>
    </item>
    <item>
      <title>Quote:Dwight B. wrote:</title>
      <link>https://community.intel.com/t5/Software-Archive/Login-PHP-and-PostgreSQL/m-p/1088352#M64362</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Dwight B. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Might it be that you need an absolute url instead of a relative url here?&lt;BR /&gt;
	&amp;nbsp;action="verifica_usuario.php"&amp;nbsp;&lt;/P&gt;

&lt;P&gt;RELATIVE -name of a file that is on the same machine as the one calling it. It usually is just a file name.&amp;nbsp;&lt;BR /&gt;
	ABSOLUTE -access a file on a remote machine. &amp;nbsp;it includes the protocol, path, and file name.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/Absolute%20url"&gt;https://en.wikipedia.org/wiki/Absolute%20url&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Maybe something like this?&lt;BR /&gt;
	&amp;nbsp;action="&lt;A href="https://mysite.com/mobile-services/verifica_usuario.php"&gt;https://mysite.com/mobile-services/verifica_usuario.php&lt;/A&gt;"&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thanks for the reply, I put the &lt;STRONG&gt;verifica_usuario.php&lt;/STRONG&gt; on server, and I changed the action url, and that error don't show anymore, but i have a new problem :(&lt;/P&gt;

&lt;P&gt;At verifica_usuario.php have this lines:&lt;/P&gt;

&lt;PRE class="brush:php;" style="font-size: 13.008px; line-height: 19.512px;"&gt;include "index.html"; // line 13 and 43
header("location: area_restrita.php"); // line 36&lt;/PRE&gt;

&lt;P&gt;index.html is the main page of my app and it's in the folder in my pc, don't in the server, so he can't find.&lt;/P&gt;

&lt;P&gt;How can I solve it?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:php;"&gt;&amp;lt;?php

session_start(); //inicia a sessao

include "http://localhost:8080/ConexaoBD/conecta.class";

$user = $_GET['user'];
$password = $_GET['password'];

if((!$user) || (!$password)){
    
    echo "Por favor, todos campos devem ser preenchidos! &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;";
    include "index.html"; //----------HERE------------
    
}else{
    $password = md5($password);
    
    $sql = pg_query(
        "SELECT * FROM pessoa WHERE email_pessoa = '{$user}' AND senha_pessoa = '{$password}' AND status_pessoa='A' ";
    );
    
    $login_check = pg_num_rows($sql);
    
    if($login_check &amp;gt; 0){
        
        while($row = pg_fetch_array($sql)){
            foreach ($row as $key =&amp;gt; $val){
                $$key = stripslashes( $val );
            }
            
            $_SESSION['id_pessoa'] = $id_pessoa;
            $_SESSION['nome_pessoa'] = $nome_pessoa;
            $_SESSION['tipo_pessoa'] = $tipo_pessoa;
            $_SESSION['email_pessoa'] = $email_pessoa;
            
           header("location: area_restrita.php");
                
        }
    }else{
        echo "Você não pode logar-se! Este usuário e/ou senha não são válidos!&amp;lt;br /&amp;gt;
             Por favor tente novamente!&amp;lt;br /&amp;gt;";
        
        include "index.html";//------------HERE----------
    }
    
}


?&amp;gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 01:05:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Login-PHP-and-PostgreSQL/m-p/1088352#M64362</guid>
      <dc:creator>Gabriel_A_</dc:creator>
      <dc:date>2016-01-15T01:05:44Z</dc:date>
    </item>
    <item>
      <title>Hi Gabriel,</title>
      <link>https://community.intel.com/t5/Software-Archive/Login-PHP-and-PostgreSQL/m-p/1088353#M64363</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi Gabriel,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Is not clear to me if you are developing a device app or a web app. My answer is based in index.html as the main file created by XDK.&lt;/P&gt;

&lt;P&gt;In first case, you should call the php authorization script from the app and process the result in the app. Not include index.html on the server side php scripts.&lt;/P&gt;

&lt;P&gt;If it is the second case, you should build the app as a Web App, upload all files to server and add the php files (or call them with the complete url path)&lt;/P&gt;

&lt;P&gt;I hope this help&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Diego&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 20:30:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Login-PHP-and-PostgreSQL/m-p/1088353#M64363</guid>
      <dc:creator>Diego_Calp</dc:creator>
      <dc:date>2016-01-18T20:30:06Z</dc:date>
    </item>
  </channel>
</rss>

