Forum Moderators: coopster & phranque

Message Too Old, No Replies

Newsupdate from wap to html

wap news

         

Tommy

6:14 pm on Jul 10, 2002 (gmt 0)

10+ Year Member



I need some sort of secure portal to add news on my html newspage from my mobilephone, i have a small wap page so some loginscript for me to put in the news and direct publish the news on my htmlpages. Send me some tips please....
The script/portal have to be free or cheap..
I have also mySQL

Brett_Tabke

11:50 pm on Jul 10, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I think you are on the right track thinking that is going to be a custom ap.

My first thought, was an email->web program. If you have an email box on the site you are working on, and you have a cron job, I was thinking you could have the cron job check the mail box and then up date your page. You just send email to your site, and the cron picks it up out of your box and posts it.

Other than that, I don't know enough about the capabilities of wap browsers and how they'd handle forms to know. Otherwise, why couldn't you just use a really low key stock app to do it?

jatar_k

11:54 pm on Jul 10, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I have been mulling this around on and off today trying to figure out an idea too. I like the cron job /email bit, sounds perfect. I didn't think of that, I was going the more wap form route but I didn't really find anything about how the phones handle forms etc and I have never actually used one.

Tommy

6:46 am on Jul 11, 2002 (gmt 0)

10+ Year Member



That was a nice idea !, i have to look up with my webhotel to see how they can help me.
My idea is that i surf to my wappage through my phone and then login to send some newstext into a database mySQL and then the htmlnews page use the same database ?
I havent use WAP (VML) before (except a small testpage.) so this is all new for me, also connecting to mySQL is "new."
I use only working script ready to install...
Have to learn me more programming script and so on.

Crazy_Fool

9:31 pm on Jul 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>My idea is that i surf to my wappage through my
>>phone and then login to send some newstext into
>>a database mySQL and then the htmlnews page use
>>the same database ?

that's almost certainly the easiest way to do it. you will need to use PHP to save the data from the form into the MySQL database - it's exactly the same procedure as if you were doing it with a web form, except the PHP script needs to output WML instead of HTML.

you can make development and testing a bit easier by using the opera web browser to test submission of the form as opera is WAP enabled.

Tommy

7:16 pm on Jul 12, 2002 (gmt 0)

10+ Year Member



My idea seems to be "easy" to fix, but i havent made own php pages or connecting through mySQL (only with page/script already done), so if there is one out there who can provide me with a simple code for my experiment i be very happy ! after testing i can learn me more about the coding and design :-)
I have downloaded PHP manual so i am probably busy all night reading and testing, have to get the whiskybottle open.....

I will first install a working NEWS board then i need some help to make a small input page for WAP
So i be back....

Tommy

10:37 pm on Jul 12, 2002 (gmt 0)

10+ Year Member



Now i have a working newspage (php with mySQL), so can someone maybe help me a bit to create a page so i can post news from my mobilephone to my site.

I understand that i need a php page generating wml and connecting to mySQL. That is the help i need, to create a small testpage.

Have to do more testing in the morning, maybe i solve it myself.

Tommy

9:16 am on Jul 13, 2002 (gmt 0)

10+ Year Member



have made a small test page now !
but cant get it working ok, some tips please
my password is hidden

i get the inputfiels but when i press send nothing happens

<?php
// send wml 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.org/DTD/wml_1.1.xml\">";
?>
<wml>
<card id="News" title="Newsinput">
<p>Newsinput
<br/>
<input emptyok="true" name="poster" title="Name: " type="text" value=""/><br/>
<input emptyok="true" name="heading" title="Header: " type="text" value=""/><br/>
<input emptyok="true" name="text" title="text: " type="text" value=""/><br/>
<a href="<?php echo $PHP_SELF;?>">Send!</a><br/>
</p>
<?php
$db = mysql_connect("localhost", "myggans", "password");
mysql_select_db("myggans_3",$db);
$sql="INSERT INTO news_data VALUES('','en','','$text','$heading','$poster','','0','1','','1')";
$result=mysql_query($sql,$db);

if ((isset($heading)) AND (isset($text))) {
echo "Done!<br>";
echo "Details:<br>";
echo "Header: $heading<br>text: $text";
}
?>
</card>
</wml>

Crazy_Fool

2:43 am on Jul 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



your code is very wrong there.

keep it as simple as possible - keep the WML and the PHP separate. write a WML form which submits to a PHP script. the PHP script will save the data to the database exactly the same as if it had been submitted from a web page. the PHP script will then output a simple WML page saying "Done".

it might help to write an HTML page to submit to the php script first, just to make sure your php script is saving data normally.

Tommy

8:23 am on Jul 14, 2002 (gmt 0)

10+ Year Member



OK i have try this many hours now and i get it to work now.....
i have learn me alot under this hour

the first page i get to work is this:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="News" title="Newsinput">
<p>Newsinput
<br/>
Name:<br/>
<input type="text" name="poster"/>
<br/>
Heading:<input type="text" name="heading"/>
<br/>
Text:<input type="text" name="text"/>
<br/>

<anchor title="post">post
<go href="result.php" method="post">
<postfield name="poster" value="$(poster)"/>
<postfield name="heading" value="$(heading)"/>
<postfield name="text" value="$(text)"/>
</go>
</anchor>
</p>
</card>
</wml>

And the resultpage look like this:

<?php
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.org/DTD/wml_1.1.xml\">";
?>
<wml>
<card id="News2" title="News">
<?php
$db = mysql_connect("localhost", "myggans", "123456");
mysql_select_db("myggans_3",$db);
$sql="INSERT INTO news_data VALUES('','en','','$text','$heading','$poster','','0','1','','1')";
$result=mysql_query($sql,$db);
if ((isset($heading)) AND (isset($text))) {
echo "Done!<br/>";
echo "Details:<br/>";
echo "Header: $heading<br/>text: $text";
}
?>
</card>
</wml>