SunQuest
           WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old November 27th, 2003, 12:38 PM
Kaisser Kaisser is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 Kaisser User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Php doesn´t work in WML

Hello, i am from spain and my english is horrible, excusme :S

I have a wml page with php code, but this doesn´t work correctly.
I have this:

<?php
// send wml headers
header("Content-type: text/vnd.wap.wml");
echo "<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""
. " "http://www.wapforum.org/DTD/wml_1.1.xml">";
?>

<wml>
<card id="card1" title="Hello World!">
<p>
<?php


//Conexion con la base de datos
$idDB = @mysql_connect('localhost','','')
or die("No puedo conectar con el gestor");

// Seleccionamos la base de datos
mysql_select_db('Juego',$idDB);


$Persona = $HTTP_GET_VARS['user'];
$Contraseña= $HTTP_GET_VARS['pass'];


//Sentencia SQL para buscar un usuario con esos datos
$ssql = "SELECT * FROM usuarios WHERE User='$Persona' and Password='$Contraseña'";



//Ejecuto la sentencia
$rs = mysql_query($ssql,$idDB);

//vemos si el usuario y contraseña es váildo
//si la ejecución de la sentencia SQL nos da algún resultado
//es que si que existe esa combinación usuario/contraseña

if (mysql_num_rows($rs)!=0)
{ // Todo correcto, mostramos pantalla de bienvenida

print "<br/>Welcome to a PHP-enabled site!";
}
else
{
//si no existe le mando otra vez a la portada

print "<br/>MAL";
}

mysql_free_result($rs);
mysql_close($idDB);

?>

</p>
</card>
</wml>

And WinWap shows this:

Welcome to a PHP-enabled site!"; } else { //si no existe le mando otra vez a la portada print "
MAL"; } mysql_free_result(); mysql_close(); ?>

I have add types for http.conf to Apache and php runs in my local server.

Someone help me?? Please

THANKS.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > Php doesn´t work in WML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway