473,623 Members | 3,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xml tp html or php

3 New Member
sir the below script is wap script in xml,if possible to converet html or php plz edit and put here sir
[HTML]<? //include the space function found on php.net Include ('data/function_dskspa ce.php'); //headers header("Content-type: text/vnd.wap.wml"); echo "<?xml version=\"1.0\" ?>"; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.or g/DTD/wml_1.1.xml\">" ; //sadhu's genius one line fix $page = $_GET["page"]; //how many files do you want shown on each page? EDIT $conf["items_per_page "] = 7; //if the page number is not set, set it too.. Zero/home if (!isset($page)) {$page = 0;} //open our directory or give error message if(!($dp = opendir("./"))) die ("Cannot open ./"); //array and read directory $file_array = array(); while ($file = readdir ($dp)) { //don't want to show that index really eh if(substr($file ,0,1) != '.' and $file != "index.php" ) { $file_array[] = $file; } } //count files in dir $file_count = count ($file_array); //sort the file order sort ($file_array); //main page ?> <wml> <card id="card1" title="wappyBUD DY"> <p align ="center" mode="nowrap"> <img src="" alt="frendz"/><br/><br/></p><p align ="left" mode="nowrap"> <? //if is no files give error message if ($file_count==" 0"){echo "<small>Sor ry there are $file_count files in this folder!</small>";} //if there is some files if ($file_count > 0) { $first_record = $page * $conf["items_per_page "]; $last_record = $first_record + $conf["items_per_page "]; while (list($fileInde xValue, $file_name) = each ($file_array)) { if (($fileIndexVal ue >= $first_record) AND ($fileIndexValu e < $last_record)) { //icon code so we know the extension of files and can assign the correct gif. I did want to use the mimetype function but found it didn't work on all servers sigh.. $icon = "data/unknown.gif"; $rev = strrev ($file_name); $exp = explode (".", $rev); $true = strrev ($exp[0]); $trueext = strtolower ($true); if ($trueext=="zip " OR $trueext=="rar" OR $trueext=="gz") {$icon = "data/zip.gif";} if ($trueext=="amr "){$icon = "data/amr.gif";} if ($trueext=="mid i"){$icon = "data/midi.gif";} if ($trueext=="mid "){$icon = "data/mid.gif";} if ($trueext=="gif "){$icon = "data/gif.gif";} if ($trueext=="jpe g"){$icon = "data/jpeg.gif";} if ($trueext=="jpg "){$icon = "data/jpg.gif";} if ($trueext=="jad "){$icon = "data/jad.gif";} if ($trueext=="jar "){$icon = "data/jar.gif";} if ($trueext=="sis "){$icon = "data/sis.gif";} if ($trueext=="bmp "){$icon = "data/bmp.gif";} if ($trueext=="wbm p"){$icon = "data/wbmp.gif";} if ($trueext=="txt "){$icon = "data/txt.gif";} if ($trueext=="avi "){$icon = "data/avi.gif";} if ($trueext=="thm "){$icon = "data/thm.gif";} if ($trueext=="nth "){$icon = "data/nth.gif";} if ($trueext=="png "){$icon = "data/png.gif";} if ($trueext=="mmf "){$icon = "data/mp4.gif";} if ($trueext=="wav "){$icon = "data/wav.gif";} //find true path of this site.. Ah don't ya just love php.net $docname = "" . $_SERVER [ 'SERVER_NAME' ] . $_SERVER [ 'PHP_SELF' ]; $path = dirname($docnam e); $path = str_replace ("www.", "", $path); //get rid of ext on files $linkname = str_replace (".$trueext" , "", $file_name); //blah getting bored now.. Time for a joint.. $kb="kb"; $number=($fileI ndexValue+1); //right.. filesize $size = round(filesize( $file_name)/1024,1); //set dir and file values $dirlinks = "<small><im g src=\"data/dir.gif\" alt=\"$number\"/>$file_name [dir]<br/>$number: </small><input type=\"text\" title=\"Directo ry:\" value=\"not allowed [directory]\"/><br/><br/>"; $filelinks = "<small><a href=\"$file_na me\"><img src=\"$icon\" alt=\"$number\"/>$linkname [$size$kb]</a><br/>$number: </small><input type=\"text\" title=\"File URL:\" value=\"http://$path/$file_name\"/><br/><br/>"; //show/determine file an dir if (is_dir($file_n ame)){echo $dirlinks;}else { echo $filelinks;} } } ?> </p><p align ="center" mode="nowrap"> <? //pages set up $mb = "mb"; $pages = (int) ceil($file_coun t / $conf["items_per_page "]); $pages = ($pages -1); if ($pages>0){if ($page=="0"){ec ho "<small>Hom e Page<br/><br/></small>";}else{ echo "<small><br/>Page $page of $pages<br/><br/></small>";}} if (($file_count > 0) AND ($page != 0)) //previous page { $prev_page = $page -1; echo "<small><a href=\"".$_SERV ER["PHP_SELF"]."?page=$prev_p age\">«Prev</a></small>"; } if (($file_count > 0) AND ($last_record < $file_count)) //next page { $next_page = $page + 1; if ($page=="0"){$b reak="";}else{$ break="|";} echo "$break<small>< a href=\"".$_SERV ER["PHP_SELF"]."?page=$next_p age&amp;sid=$si d\">Next»</a></small>"; } //watch for numptys putting non existant pages in jumpbox if ($page>$pages){ echo "<br/><small><br/><br/>This page does not exist!</small>";} //show the jumpbox if($pages>1)ech o "<br/><br/><input emptyok=\"true\ " name=\"jump\" format=\"*N\" size=\"3\" value=\"\" /><small><br/><a href=\"".$_SERV ER["PHP_SELF"]."?page=$(jump) &amp;sid=$sid\" >Jump [1-$pages]</a></small>"; if ($page<$pages){ echo "<br/><small><a href=\"".$_SERV ER["PHP_SELF"]."?page=$pages& amp;sid=$sid\"> Last Page</a></small>";} if ($page=="0" AND $file_count>$co nf["items_per_page "]){echo "<br/>";} if ($page>0){echo "<br/><small><a href=\"".$_SERV ER["PHP_SELF"]."?page=0&amp;s id=$sid\">Home Page</a><br/></small>";} //file count echo "<small><br/>$file_count </small>"; //diskspace $space = dskspace ('./'); $space = round ($space/1024000,1); //show em lol echo "<small>fil es [$space$mb]</small>"; //show the path so ya site url is at bottom echo "<br/><small>$path </small>"; } //close our directory ah.. closedir($dp); //WE REQUEST THAT YOU DO NOT REMOVE THE COPYRIGHT/LINK BELOW. //GIVE CREDIT WHERE CREDIT IS DUE! echo "<small><br/>All Rights Reserved<br/>©2003, 2006 <a href=\"http://hack.s-60.org\">raghu</a><u>&</u><a href=\"http://jonroig.com\">j on</a></small>"; ?> </p> </card> </wml> [/HTML]
Jun 25 '08 #1
2 1375
Atli
5,058 Recognized Expert Expert
Hi.

First of all... that has to be the worst formated piece of code I've ever seen!
What happened to all the new-line chars?

Second. We are not here to create your code for you. Try it yourself and post back if you have any specific problems and we will be happy to do what we can to help you.

If you are just asking for some tips on how to do this, please specify what it is you are attempting to do. I can't really make out what it is you want from the vague statement you made in your post.

Lastly, I would ask that you read through the Posting Guidelines before posting again, specifically the part about How to ask a question.

Thanks.
Jun 25 '08 #2
hsriat
1,654 Recognized Expert Top Contributor
First of all... that has to be the worst formated piece of code I've ever seen!
lol!.. I agree

Hey Jackrose,
Its not a regular thing to convert WML to HTML as they have different approach. HTML page is one page, shown at screen at one time. But WML may contain multiple cards (one time screens). So you first need to separate the cards. Then for each card, you would need to convert the markup to HTML.

I would suggest, if this is the only page you need to convert, do it manually. But if the list is long, you should try to make a markup convector using PHP and RegExp.

But I see that there's PHP in the code along with WML, so you need to convert the generated markup and then place it back in the PHP.

Regards
Jun 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
8396
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties in JavaScript/JScript and HTML/XML elements. Without trying to get famous :-) but thinking it would be interesting to others I decided to post the following summary: 1. Variable names in JavaScript/JScript
4
2963
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text email by creating a text file, with content following certain format, and saving that file into the correct '..\mailroot\pickup' folder, and it is working fine
1
2406
by: cirillo_curiosone | last post by:
Hi, i'm new to javascript. I started studing it on the web few weeks ago, but still haven't been able to solve one big problem: HOT TO PASS VALUES FROM A SCRIPT VARIABLE TO A CHILD HTML GENERATED BY FUNCTION. Here'e the point: I'm writing a simple website for showing my photographs. It has a central page with many links (as many as galleries are).
33
4759
by: LRW | last post by:
http://gto.ie-studios.net/index.php When you view the above site in IE, if the 1st of the three product images is tall enough to push the cell down a couple of pixels, IE somehow doesn't show that happening. But if you look at it in Firefox you can see the small gap of white where the semi-circle image is broken. I've tried changing the background colors to gray in cells and tables
0
395
by: Boris Ammerlaan | last post by:
This notice is posted about every week. I'll endeavor to use the same subject line so that those of you who have seen it can kill-file the subject; additionally, Supersedes: headers are used to ensure that only one copy resides on a given news server. This notice was last updated on March 9th, 2005, and is available (with a complete revision history) on the World Wide Web at http://www.stack.nl/~boris/HTML/ciwahfaq.html. Most of it was...
9
1996
by: Patient Guy | last post by:
Taking the BODY element as an example, all of its style attributes ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01, a fact noted in the DOM Level 2 HTML specification. The DOM specification does not explicitly itself deprecate the use of attributes however for the element in the interface definition section I read. Is there text in the DOM specification that states specifically that the DOM specification...
5
3582
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact that for server control component , code is running on the server side. But if I take as example a Label. I place on a webform an HTM label control and a WebForm label control, I could see that properties are different for
6
433
by: Guy Macon | last post by:
cwdjrxyz wrote: HTML 5 has solved the above probem. See the following web page: HTML 5, one vocabulary, two serializations http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
0
8162
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8603
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4067
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2593
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.