Author Topic: [MOD] WAP page to download files.  (Read 78201 times)

0 Members and 1 Guest are viewing this topic.

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: [MOD] WAP page to download files.
« Reply #30 on: April 25, 2005, 03:14:24 PM »
Well. I have tested wap page on several phones. And I think that I fixed everything :)
So...
The biggest bug was <center> tag, so we must to replace it with <p> tag:

Find
Code: [Select]
<center>
replace with:
Code: [Select]
<p align="center">
find:
Code: [Select]
</center>
replace with:
Code: [Select]
</p>


and to ensure working use this:
Code: [Select]
Header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml_1.2.xml\">";


So it works?
Again this addres?!
http://www.funny.lt

Offline luk

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] WAP page to download files.
« Reply #31 on: April 28, 2005, 11:26:18 PM »
Quote
Message # 1013612:
Date: 10/01/02 18:00
By: Johnny Profile
Subject: wml + php solution...

Hi All!

I found an interesting diference between my solution and this article.
Almost everything is the same, but when i'm using the
header (Content-Type: text/vnd.wap.wml); function, my phone says "Response unknown" or "No response, try again"
I have Nokia 6510 mobile.
So I don't use the header function and everything works well :)

Here is my sample code what I use.

<?php
echo "<?xml version\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>

<wml>
<card id="main" title="First Wap page">
<p>Here is a php number:
<?php $i=1; echo $1;
<br/>
</p>
</card>
</wml>

Thats all.
Bye.

http://www.phpbuilder.com/annotate/message.php3?id=1013612

I have Nokia6100 and i get the same error with some WML scripts.I can't imagine what the problem is.If anyone can help me(us) please post it here al their experience ( knowledge ) about this problem.

WAP Chats :

MobiiliChat 1.07
Code: [Select]
http://www.mobiilichat.com/forum/mobiilichat_v1.07.zip
W@Pchat Ver.1.2
Code: [Select]
http://www.earthweb.biz/myscript.php?file=wapchat.zip
GumSlone WAP Chat2 and 1.05
Code: [Select]
http://gumslone.com/scripts/wap_chat_v2.zip
http://gumslone.com/scripts/GS_WAP_CHAT_V1.0.5.zip


I have install it in my PC Apache + PHP + MySQL with WML support.All in one package : XAMPP for WINDOWS

Quote
http://www.apachefriends.org/en/xampp-windows.html

All 3 WML scripts works with WINWAP 3.2
Quote
http://www.winwap.com/products_2_1.php


BUT IN MY NOKIA6100 just MobiiliChat works 100%.The rest 2 scripts didn't work ,and i get "File Format Unknow" ERROR.

Look the 3 WML script header functions :

MobiiliChat 1.07
Quote
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");



W@Pchat Ver.1.2
Quote
header("Content-type: text/vnd.wap.wml");



GumSlone WAP Chat2 and 1.05
Quote
header("Content-type:text/vnd.wap.wml;charset=UTF-8");


It might be possible to be this header problem? MobiiliChat 1.07 works 100% for me, bust rest 2 NOT WORK !




Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: [MOD] WAP page to download files.
« Reply #32 on: April 29, 2005, 05:13:25 AM »
Have you tried this header?

Code: [Select]
Header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml_1.2.xml\">";

I`m working with wap pages and it`s usability. I have tested this page with 7 diferent phones.
Wml code is very tricky one. Because everything MUST be valid.
Again this addres?!
http://www.funny.lt

Offline Ufetto

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [MOD] WAP page to download files.
« Reply #33 on: May 08, 2005, 11:26:46 PM »
Hi Guys.

I have tested this mod on my site but it doesn't work :(
My wap site is: http://www.funzone.it/4wap .

On the phone I see the web page but when I click on the botton i can't see the file.   :roll:

My index.php code is:

Code: [Select]
<?
//Some settings
$url = 'http://www.funzone.it'; //where installed 4images, without traling slash
$title = 'FunZone 4Wap'; //title for wap card
$no_id = 'ID non trovato'; //msg when no id found
$enter_id = 'Inserisci ID'; //msg when user comes
$button = 'Mostra'; //text for button
$footer = 'FunZone.it'; //footer text
$dbhost = "localhost"; //host of database
$dbuser = "XXX"; //database user
$dbpass = "XXX"; //database pass
$dbname = "XXX"; //and database ;]

//dont need to change after this
Header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml_1.2.xml\">";
?>

<wml>
<card title="<? echo $title ?>">
<p align="center">
<form method="post" action="index.php">
<?php 
$id 
$_REQUEST['id'];
if(
$id!=""){
$db mysql_connect("$dbhost""$dbuser""$dbpass") or die ("Error");
@
mysql_select_db("$dbname"$db) or die ("DB not found");
$result mysql_query("SELECT image_id, image_media_file, cat_id, image_name FROM 4images_images where image_id=$id");
$row mysql_fetch_array($result);
$image_id $row["image_id"];
$cat_id $row["cat_id"];
$image_name $row["image_name"];
if (
$image_id!=""){
$image_media_file $row["image_media_file"];
?>

<a href="<? echo $url;?>/data/media/<? echo $cat_id;echo "/";echo $image_media_file; ?>"><? echo $image_name;?></a><br />
<?php }
else { echo 
$no_id; } }
else { echo 
$enter_id; }
?>

<br />
<input name="id" type="text" id="id" size="6" /><br />
<input name="submit" type="submit" value="<? echo $button ?>" />
</form>
<br />
<small>&reg; <? echo $footer ?></small>
</p>
</card>
</wml>

Thanks all for Help and sorry for my bad english.  :wink:

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: [MOD] WAP page to download files.
« Reply #34 on: May 09, 2005, 05:34:18 AM »
It`s dificult to make an universal wap page... then we need to do a phone recognition...
try this code, I hope it`ll help:

Code: [Select]
<?
//Some settings
$url = 'http://www.pramoga.net'; //where installed 4images
$title = 'wap.pramoga.net'; //title for wap card
$no_id = 'ID not found'; //msg when no id found
$enter_id = 'ID'; //msg when user comes
$button = ' find &gt;'; //text for button
$footer = 'Pramoga.net'; //footer text
$dbhost = "localhost";
$dbuser = "dbuser";
$dbpass = "dbpass";
$dbname = "pramoga_pramoga";
//dont need to change after this
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="<? echo $title ?>">
<p>
<br />
<?
$id = $_REQUEST['id'];
if($id!=""){
$db = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die ("Error");
@mysql_select_db("$dbname", $db) or die ("DB not found");
$result = mysql_query("SELECT image_id, image_media_file, cat_id, image_name FROM 4images_images where image_id=$id");
$row = mysql_fetch_array($result);
$image_id = $row["image_id"];
$cat_id = $row["cat_id"];
$image_name = $row["image_name"];
if ($image_id!=""){
$image_media_file = $row["image_media_file"];
?>
Spausk nuoroda, kad parsisiusti:
<a href="<? echo $url;?>/data/media/<? echo $cat_id;echo "/";echo $image_media_file; ?>"><? echo $image_name;?></a><br />
<? }
else { echo $no_id,"<br />"; }
}
else { echo $enter_id,"<br />"; }
?>
<br />
<input name="id" /><br />
<a href="index.php?id=$(id)"><? echo $button ?></a>
</p>
</card>
</wml>
Again this addres?!
http://www.funny.lt

Offline Ufetto

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [MOD] WAP page to download files.
« Reply #35 on: May 10, 2005, 04:16:30 PM »
Thanks!   :wink:

Now it works great!  8)

Offline sanju

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [MOD] WAP page to download files.
« Reply #36 on: June 29, 2005, 01:34:03 AM »
brilliant the wap page is working for me too just another request for the wap page thing..

Actually i was thinking is it possible to make Wap page  to download images from 4images installed site for only registered members at the site or certain member Group...
i have seen theres a mod for wap download i really found it useful.. but it would gr8 if only registered members can download thrugh wap... or certain member group only who can download from the wap page...
and something like limited download for guest in a day...

i have added this in Request forum but looks like noone gave a look to it.. :(

http://www.4homepages.de/forum/index.php?topic=8571.0

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: [MOD] WAP page to download files.
« Reply #37 on: June 30, 2005, 02:44:13 PM »
You see... my php is kind a simple and small :)
I`m programing when I got idea and I know how to make a working script.
User login in wap pages is something like a template system, but for wap. Or we just need somehow take session script from all system...
The first Idee about wap templates i like more, but if we are going through wap, we must to disable flash, mp3, video etc.
So the question will be how to disable these only for the wap page :)
Again this addres?!
http://www.funny.lt