WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP 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:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old July 20th, 2005, 02:28 AM
alexdinon alexdinon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 6 alexdinon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 29 m 24 sec
Reputation Power: 0
Exclamation inquiry...........

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

Reply With Quote
  #2  
Old July 20th, 2005, 03:00 AM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,667 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 4 Days 5 h 1 m 49 sec
Reputation Power: 1618
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
Quote:
Originally Posted by alexdinon
izzit really can save user input into .DAT file?

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.

__________________

Reply With Quote
  #3  
Old July 20th, 2005, 07:20 AM
alexdinon alexdinon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 6 alexdinon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 29 m 24 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > inquiry...........


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