Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreMobile 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:
  #1  
Old June 30th, 2007, 05:48 AM
jojoba's Avatar
jojoba jojoba is offline
I love your chinese eyes :*
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2006
Location: Her heart... she claims!
Posts: 1,583 jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 10 h 34 m 39 sec
Reputation Power: 453
XHTMLMP - How to combine php with xhtml-mp?

Hi

[I have two questions in the same thread]

Q1:

I have started making the site and stuck in a step. I have to show the videos list in a page. now this video list will be calculated in real time from the videos folder then I will run a loop to display their title using list element.

but my N70 gives me ERROR CODE: 0 when I click on a page like mywapsite.com/show_videos.php

I guess it is not understanding .php so how should I go from here to show the videos present in the videos folder dynamically because the number of videos will keep changing therefore I want to show the list dynamically.

Q:2

I made two logos one of .gif and other of .wbmp type. then I wanted to read the accept headers to make the decision in real time that what format of logo should I display.

I wrote the following code

PHP Code:
<?php

header
("Vary: Accept");

if ( 
stristr($_SERVER['HTTP_ACCEPT'], "image/gif") || stristr($_SERVER['HTTP_ACCEPT'], "image/jpg") || stristr($_SERVER['HTTP_ACCEPT'], "image/png") )
{
?>
  <img src="images/logo.gif" alt="logo" height="87" width="80" />
<?php
}
else
{
 
?>
   <img src="images/logo.wbmp" alt="logo" height="87" width="80" />
 <?php
}

?>


but again I had to rename my index.html to index.php for this code and once i renamed it I start to get error code: 0. I am confused that how I will make dynamic decisions for wap sites?

any help is much appreciated.

Reply With Quote
  #2  
Old July 1st, 2007, 04:26 AM
jabba_29's Avatar
jabba_29 jabba_29 is online now
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,771 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 6 Days 6 h 34 m 6 sec
Reputation Power: 1632
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
Are you sending any other headers?

If you are sending this as any wap variant, then you must use valid wml or xhmtl mp - the page will break if you don't.

PHP won't parse .html files unless you specifically make it.
__________________
Cheers,

Jamie


# skiFFie | Home of the 'accessibility module' for Drupal
# Jamie Burns [me] Accessibility Module [drupal]
# guidelines | search | wap resources | not getting help | fold to cure


__________________

Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.



__________________

Reply With Quote
  #3  
Old July 1st, 2007, 11:28 PM
jojoba's Avatar
jojoba jojoba is offline
I love your chinese eyes :*
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2006
Location: Her heart... she claims!
Posts: 1,583 jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)jojoba User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 10 h 34 m 39 sec
Reputation Power: 453
sorry I didn't your point. I made a .php page with the following code
PHP Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
  "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html>
<head>
<title>WAP Easy Videos - upload and download videos using your handset</title>
<link rel="stylesheet" href="xmlmobile.css" type="text/css"/>
</head>
<body>
<p>
<?php

// Send header to indicate content negotiation depends on the "accept" header
header("Vary: Accept");

if ( 
stristr($_SERVER['HTTP_ACCEPT'], "image/gif") || stristr($_SERVER['HTTP_ACCEPT'], "image/jpg") || stristr($_SERVER['HTTP_ACCEPT'], "image/png") )
{
?>
  <img src="images/logo.gif" alt="logo" height="87" width="80" />
<?php
}
else
{
 
?>
   <img src="images/logo.wbmp" alt="logo" height="87" width="80" />
 <?php
}

?>
</p>
<h1>Wap World</h1>
<p><a href="http://www.wap.easyvideos.org/">Download Videos</a></p>
<p><a href="http://www.wap.easyvideos.org/">Upload Videos</a></p>
<p><a href="http://www.wap.easyvideos.org/">Download Audio Songs</a></p>
<p><a href="http://www.wap.easyvideos.org/">Upload Audio Songs</a></p>
<p><a href="http://www.wap.easyvideos.org/">Download Ringtones</a></p>
<p><a href="http://www.wap.easyvideos.org/">Upload Ringtones</a></p>
<p><a href="http://www.wap.easyvideos.org/">Download Images</a></p>
<p><a href="http://www.wap.easyvideos.org/">Upload Images</a></p>
<p><a href="http://www.wap.easyvideos.org/">About Me</a></p>
<p><a href="http://www.wap.easyvideos.org/">Terms Of Use</a></p>
<p><a href="http://www.wap.easyvideos.org/">Contact Me</a></p>
<p><a href="http://www.easyvideos.org/">www.easyvideos.org</a></p>

</body>
</html>



but when I browse it on my N70 or online emulator it gives error code: 0

what I am confused at is that how am I going to mix php code with xhtml so that they can be browsed on handsets?

thanks

Reply With Quote
  #4  
Old July 1st, 2007, 11:32 PM
jabba_29's Avatar
jabba_29 jabba_29 is online now
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,771 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 6 Days 6 h 34 m 6 sec
Reputation Power: 1632
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
error code: 0 is an unknown error usually a connection error - usually DNS related.
Are you sure the site is accessible globally?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreMobile Programming > XHTMLMP - How to combine php with xhtml-mp?


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 5 hosted by Hostway