Jump to content

Wap site and PHP


unplugged_web

Recommended Posts

I've just been asked to build a wap site, but I wanted to know if I could use PHP with WML? I need to be able to use cURL to send the details of a form to one place, but the user to somewhere else. Normally I use this:

<?php$firstname = strval($_GET['firstname']);$lastname = strval($_GET['lastname']);$ch = curl_init();curl_setopt($ch, CURLOPT_URL,"http://www.somewhere.com/HttpInjectSMS?firstname=$firstname&lastname=$lastname");curl_setopt($ch, CURLOPT_GET, 1);curl_setopt($ch, CURLOPT_GETFIELDS);//result$result = curl_exec($ch);curl_close($ch);header("Location:thankyou.php");?>

Which works fine on the web, but didn't know if it would work on a wap site?Thanks

Link to comment
Share on other sites

PHP is a server side language, and WAP is a client side alternative to (X)HTML for mobile phones.You can use PHP to generate a WAP page, the same way you generate an (X)HTML page. As soon as the user clicks on a link or submits a form, PHP can process the request and generate back a certain WAP page.

Link to comment
Share on other sites

PHP is a server side language, and WAP is a client side alternative to (X)HTML for mobile phones.You can use PHP to generate a WAP page, the same way you generate an (X)HTML page. As soon as the user clicks on a link or submits a form, PHP can process the request and generate back a certain WAP page.
Thats' great thanks. One question though - do I put it in the code in the same way?IE, for a regular web page I'd put:
<form action="number.php" method="get" id="SMSForm" onsubmit="return validate_form()"><input name="number" type="text" onfocus="if(this.value=='Mobile number MUST start 07')this.value='';" onclick="MM_validateForm('number','','RinRange11:12');return document.MM_returnValue" value="Mobile number MUST start 07" /><br /><input name="submit" type="image" src="images/send.jpg" value="send" /></form>

but for a wap page I guess I'd use:

<card title="Fieldset"><p><fieldset title="SMSForm"><form action="number.php" method="get" id="SMSForm" onsubmit="return validate_form()"><input name="number" type="text" onfocus="if(this.value=='Mobile number MUST start 07')this.value='';" onclick="MM_validateForm('number','','RinRange11:12');return document.MM_returnValue" value="Mobile number MUST start 07" /><br /><input name="submit" type="image" src="images/send.jpg" value="send" /></form></fieldset></p></card>

Link to comment
Share on other sites

I don't know any WAP to tell you for sure, but if you mean do you embed PHP code in the same way - yes. In the end, the PHP code will be replaced by whatever you generate with it, including WAP markup.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...