Esato Mobile
Sony Ericsson / Sony : GPRS, WAP, MMS and Email setup : Dynamic WAP WML File with php
> New Topic
> Reply
< Esato Forum Index > Sony Ericsson / Sony > GPRS, WAP, MMS and Email setup > Dynamic WAP WML File with php Bookmark topic
psyhkal Posts: 1

Well all these pages are working in the emulators we tested the URL http://www.projectalpha.com.au/wap/ on a few nokia but they had a filename lock out so they did not load the php file and would report... invalid file type. But you see php has a content header dedicated to:

- Content-type: text/vnd.wap.wml

so it is possible to do a dynamic card system with the live linking to the database. Does anybody know of any new PDA's and/or mobile phones that will allow you to wap to a pre hypertext processor (php) file.



anyway I though you might like to see the routine while it is short.

LOL













function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}


$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}


echo sprintf('%s%sxml version="1.0" encoding="utf-8"%s%s','');
echo sprintf(' echo sprintf(' %shttp://www.wapforum.org/DTD/wml13.dtd%s>','"','"');

?>

.style2 {color: #FF0000}
.style3 {font-family: Arial, Helvetica, sans-serif}
-->






























elements here. -->



Welcome Note

Welcome to project alpha WAP interface, at the moment this is farely basic WAP interface, from here you

can test your clients Line for ADSL Complancy Issues. You can also log into the site using your sysop username and

password this will allow you to view statistics of your clients including basic invoice details.




This is a restricted area and is not open to the public. Please be advised that you cannot access any vital

details using this interface.




Copyright 2004 © All Rights Reserved.



elements here. -->







Second Card





>From here you can test the line to see if it will support ADSL.

Simply type in the area code and phone number and the WAP interface will search for the details

pertaining to this Number and Exchange.





">




Landline Number:



Area Code:







Both fields required to see if your exchange supports DSL Services




">











if (empty($phoneno)){
$showform = true;
}
else
{

$showform = false;
$number = str_replace(' ', '' ,$phoneno);
$areac = str_replace(' ', '' ,$areacode);
$url = sprintf();
$xHandle = fopen($url,"r") ;
$xData = fread($xHandle, 64000) ;
fclose($xHandle);
$xData = ereg_replace("[r,n]", "", $xData);
$number = ereg_replace(".*","",$xData);
$number = ereg_replace(".*","",$number);
$status = ereg_replace(".*","",$xData);
$status = ereg_replace(".*","",$status);
$exchange = ereg_replace(".*","",$xData);
$exchange = ereg_replace(".*","",$exchange);
$state = ereg_replace(".*","",$xData);
$state = ereg_replace(".*","",$state);

if (!$nRecID_EnquiryID 0) {
if ($MM_insert = "DSLLogged") {
$insertSQL = sprintf("INSERT INTO dslcheck (areacode, phone, state,

status, phonenumber, exchange) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($areacode, "

text"),
GetSQLValueString($phoneno, "

text"), GetSQLValueString($state, "text"), GetSQLValueString($status, "text"), GetSQLValueString($number, "text"),

GetSQLValueString($exchange, "text"));

mysql_select_db($database_Epwebdev, $Epwebdev);
$Result1 = mysql_query($insertSQL, $Epwebdev) or die(mysql_error());

$nRecID_EnquiryID = mysql_insert_id();
}
}

if ($nRecID_EnquiryID 0) {
mysql_select_db($database_Epwebdev, $Epwebdev);
$query_EnquiryID = sprintf("SELECT dslcheck.RecID, dslcheck.`state`, dslcheck.

queried FROM dslcheck WHERE dslcheck.RecID = %s", $nRecID_EnquiryID);
$EnquiryID = mysql_query($query_EnquiryID, $Epwebdev) or die(mysql_error());
$row_EnquiryID = mysql_fetch_assoc($EnquiryID);
$totalRows_EnquiryID = mysql_num_rows($EnquiryID);
}

}

print "$exchange"; ?>">
The Following Result was returned by the server.




The phone line indeed support DSL services. This means that this line can be connected to DSL

through your vendor.

Make sure you check with the customer/client that they do not already have DSL services to this

line otherwise if the do

suggest you Churn the over immediately.




Enquiry ID:

 

$row_EnquiryID['state']; ?>




 



Status:

 




Number:

 




Exchange:

 




State:

 






if ($totalRows_EnquiryID > 0) {
mysql_free_result($EnquiryID);
} else {
?>
No result found for ($(areacode)) - $(phoneno)









Please enter in your sysop username and password.










http://www.projectalpha.com.au/wap/ 11:53 PM 3/07/2004 -->

--
Posted: 2004-07-03 16:22:13
Edit : Quote

New Topic   Reply
Forum Index

Esato home