|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
can i save input from user such as below method? i found this code from internet resouce but it not really works. Can someone explain to me? thanks a lot..
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <head> <meta http-equiv="Cache-Control" content="max-age=0" forua="true"/> </head> <card id="AddressList"> <onevent type="onenterforward"> <refresh> <setvar name="FirstName" value="" /> <setvar name="LastName" value="" /> <setvar name="Phone" value="" /> </refresh> </onevent> <do type="accept"> <go href="#Confirm" /> </do> <p align="center"> Address List<br/> </p> <p align="left"> Enter name and phone num.<br/><br/> First Name: <input name="FirstName" type="text" format="15M" /> </p> <p align="left"> Last Name: <input name="LastName" type="text" format="15M" /> </p> <p align="left"> Phone Number: <input name="Phone" type="text" format="NNN-NNN-NNNN" /> </p> </card> <card id="Confirm"> <do type="accept" label="Yes"> <go method="post" href="../AddressList/AddressListAdd.pl"> <postfield name="FirstName" value="$FirstName"/> <postfield name="LastName" value="$LastName"/> <postfield name="Phone" value="$Phone"/> </go> </do> <do type="option" label="No"> <go href="#AddressList" /> </do> <p> You entered:<br/> $FirstName<br/> $LastName<br/> $Phone<br/> Add to the list? </p> </card> </wml> coding below was saved in AddressListAdd.PL extension. #!/usr/bin/perl require 'DeckUtils.pl'; #Get the CGI variables %cgiVars = &AppUtils::ParseCGIVars(); $FirstName = $cgiVars{"FirstName"}; $LastName = $cgiVars{"LastName"}; $Phone = $cgiVars{"Phone"}; #Open the address list file for append access open(FILE, ">>../AddressList/AddressList.dat"); #Add the new information $NewLine = $FirstName . ""; $NewLine = $LastName . ""; $NewLine = $Phone . ""; print FILE $NewLine . "\n"; close(FILE); #Build a deck to display a success message and jump back to add another name $Deck = "Content-type: text/vnd.wap.wml <?xml version=\"1.0\"?> <!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\"> <wml> <head> <meta http-equiv=\"Cache-Control\" content=\"max-age=0\" forua=\"true\"/> </head> <card> <do type=\"accept\"> <go href=\"../AddressList/AddressList.wml\" /> </do> <p align=\"center\"> Address List<br/> </p> <p align=\"left\" mode=\"nowrap\"> Added: $FirstName $LastName $Phone </p> </card> </wml>"; print $Deck; another question is.. izzit really can save user input into .DAT file? hope hear from u all.... thanks very much ![]() |
|
#2
|
||||
|
||||
|
Quote:
Yes, a DATfile is esentially just a text file with a different extension. Provided you have write access to the file, it shouldn't be a problem. Again, what doesn't work. And please don't cross / double post. This is basically the same as your other question......
__________________
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 # Any form of employment is strictly prohibited ...... __________________ 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. __________________ |
|
#3
|
|||
|
|||
|
thanks for your reply. i had tried... but it doest work. here is the file i put http://n.domaindlx.com/alexdinon/Addresslist.wml
thanks |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > inquiry........... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|