Webmaster Forums 101 - Free Help and Discussions
 
 
 

MEMBER REWARDS - Earn free advertising by participating in these forums! Click here for details.

Welcome to Webmaster Forums 101!

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th October 2005, 06:38 AM   #1

Username: techitout
Rank: WF101 Newbie
Join Date: Mar 2005
Posts: 17
Points: 0.00
Default Web on your Mobile

To learn how to write for a mobile and to try out my concept, I have launched “Edufacts – Educational facts on your Mobile” www.edufacts.info

Anybody out there looking at XHTML on your Mobile

I have a problem with a Pearl script. In “Maths” my “Imperial to Metric Converter” works on a PC but not on my mobile (Sharp gx15). It displays the answer as a zero. Some of the code.

number is length to convert.
$FORM{$name} = $value;
$convert = ”FORM{‘from’}.to.$FORM{‘to’};
%multiplier = (“FeettoMetres” =>”0.3048”,);

$answer = ($FORM{‘number’} * ($multiplier{$convert});
print (“${answer}”);

I think it has to do with the answer being in the wrong format “Boolean”. How do I alter my code? The other INPUTS all print OK.

My “Web Design” pages look at some problems with screen and font sizes. My original research data is a MS Word.doc, many blanks. The “Font Properties” is set up to demonstrate how each “font element” behaves on real phones.

All comments and additional data welcomed. I will make it available to all. Does anybody know what Character set should be used when using XHTML on mobiles and what is the correct DTD
On my PC pages, I take the Character set out of the first line and include it in a META tag. Also you cannot put any spaces in front of <?xml ver….> It puts IE browsers into “Quirk Mode”

Tony Bell
editor@
www.edufacts.info
www.dtscan.com
www.techitoutuk.com
techitout is offline   Reply With Quote
Old 6th October 2005, 09:33 AM   #2
Mr. Tech's Avatar

Username: Mr. Tech
Rank: Problem Solver
Join Date: Dec 2004
Location: Gold Coast, Australia
Posts: 2,166
Points: 1,025.61
Send a message via MSN to Mr. Tech
Default

I think i know the problem... It's in this peice of code:

$answer = ($FORM{‘number’} * ($multiplier{$convert});

You need to remvoe the extrac open bracket which is infront of $multiplier{$convert}. Try that and see if it works...
__________________
Please read the Forum Rules

Get rewarded for posting
- free advertising!

.::. [ Webmaster Resources ] .::. [ Web Design ] .::. [ Developer Tutorials ] .::.
Mr. Tech is offline   Reply With Quote
Old 7th October 2005, 09:36 AM   #3

Username: techitout
Rank: WF101 Newbie
Join Date: Mar 2005
Posts: 17
Points: 0.00
Default not displaying answer

Thanks for reply. I went back to original code and found I had left off a bracket before the *. It still does not work. should be:-

$answer = ($FORM{‘number’}) * ($multiplier{$convert});
techitout is offline   Reply With Quote
Old 7th October 2005, 09:41 AM   #4
Mr. Tech's Avatar

Username: Mr. Tech
Rank: Problem Solver
Join Date: Dec 2004
Location: Gold Coast, Australia
Posts: 2,166
Points: 1,025.61
Send a message via MSN to Mr. Tech
Default

What about the ‘number’? Shouldn't it be 'number'?

I'm not all that good with Perl so I'm just pointing out the erros that would occur in PHP
__________________
Please read the Forum Rules

Get rewarded for posting
- free advertising!

.::. [ Webmaster Resources ] .::. [ Web Design ] .::. [ Developer Tutorials ] .::.
Mr. Tech is offline   Reply With Quote
Old 8th October 2005, 10:20 AM   #5

Username: techitout
Rank: WF101 Newbie
Join Date: Mar 2005
Posts: 17
Points: 0.00
Default Simple calculator

Thanks for the reply.
I wrote my first simple php program to calculate the area of a circle.
It does not work on my phone server.
Tried it with sucess on another server, it works on my PC but gives an error 405 Method not allowed on my phone (Sharp gx15).

<?php

$radius = $_POST['radius'];
$area = 3.142 * $radius * $radius;


print "<html><head><title>Area Conversion on your Mobile</title></head>\n";
print "<body><b>Area of circle with Radius of $radius is</b>\n";
print "<hr />";
print "$area";
print "<hr />\n";
print "<a href=\"http://www.edufacts/calculator/area.html\"><small>Back to the Calculator</small></a>\n";
print "</body></html>";

?>

Found at www.edufacts.info/calculator/area.html

Tony
techitout is offline   Reply With Quote
Old 8th October 2005, 04:52 PM   #6
Mr. Tech's Avatar

Username: Mr. Tech
Rank: Problem Solver
Join Date: Dec 2004
Location: Gold Coast, Australia
Posts: 2,166
Points: 1,025.61
Send a message via MSN to Mr. Tech
Default

Gives me a 405 on my PC. There is absolutely nothing wrong with your PHP. Don't know if this will fix it but try replacing:

$area = 3.142 * $radius * $radius;

With:

$area = 3.142 * $radius;
$area = $area * $radius;

Maybe it doens't like the two stars (*)...
__________________
Please read the Forum Rules

Get rewarded for posting
- free advertising!

.::. [ Webmaster Resources ] .::. [ Web Design ] .::. [ Developer Tutorials ] .::.
Mr. Tech is offline   Reply With Quote
Old 4th November 2005, 02:08 AM   #7

Username: techitout
Rank: WF101 Newbie
Join Date: Mar 2005
Posts: 17
Points: 0.00
Default Code now works

POST does not work on Mobiles.
This code now works on Mobiles. Tony Bell

<?php

$diarad = $_GET['diarad'];
$length = $_GET['length'];

if (empty($diarad))
{
print "<html><head><title>Area Conversion on your Mobile</title></head>";
print "<body><b>Please select a Diameter or Radius</b><hr />";
print "<small>Use your Back Button</small></a>";
print "</body></html>";
}

if ($diarad == 1)
{
$lengthr = $length/2;
$aread = 3.142 * $lengthr * $lengthr;
$aread = number_format($aread, 3);

print "<html><head><title>Area Conversion on your Mobile</title></head>\n";
print "<body><b>Area of circle with Diameter of $length is</b>\n";
print "<hr />";
print "$aread";
print "<hr />\n";
print "<small>Use your Back Button</small>\n";
print "</body></html>";
}

if ($diarad == 2)

{
$arear = 3.142 * $length * $length;
$arear = number_format($arear, 3);

print "<html><head><title>Area Conversion on your Mobile</title></head>\n";
print "<body><b>Area of circle with Radius of $length is</b>\n";
print "<hr />";
print "$arear";
print "<hr />\n";
print "<small>Use your Back button</small>\n";
print "</body></html>";
}

?>
techitout is offline   Reply With Quote
Old 4th November 2005, 08:54 AM   #8
Mr. Tech's Avatar

Username: Mr. Tech
Rank: Problem Solver
Join Date: Dec 2004
Location: Gold Coast, Australia
Posts: 2,166
Points: 1,025.61
Send a message via MSN to Mr. Tech
Default

There you go. Who would have thought that was the case. Nice work on figuring that one out
__________________
Please read the Forum Rules

Get rewarded for posting
- free advertising!

.::. [ Webmaster Resources ] .::. [ Web Design ] .::. [ Developer Tutorials ] .::.
Mr. Tech is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Login
User Name
Password


Featured Members


Featured Links


Useful Resources
Webmaster Resources
Developers Tools
Developer Tutorials


Partners

All times are GMT +10. The time now is 05:23 AM.


Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.3.2
 
 
WEBMASTER FORUMS 101
ARCHIVE
CONTACT US
TOP
   
© Webmaster Forums 101 2005. All Rights Reserved.
Design by: vBCore