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 August 17th, 2004, 11:17 AM
eXZire eXZire is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 4 eXZire User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wap, forms and PHP

Ok, I'm am having som trouble getting this to work.. anybody see anything wrong? =)

wap.php:
PHP Code:
<?php
header
("Content-type: text/vnd.wap.wml");

$dag date("j");
$maaned date("n");
$aar date(Y);

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=\"card1\" title=\"Nytt element\">
<p><do type=\"accept\" label=\"Kjor\">
  <go href=\"wap2.php\" method=\"post\">
  <postfield name=\"tekst\" value=\"$(tekst)\" />
  <postfield name=\"dato\" value=\"$(dato)\" />
  <postfield name=\"belop\" value=\"$(belop)\" />
  <postfield name=\"type\" value=\"$(type)\" />
  </go>
</do>
Tekst: <input type=\"text\" name=\"tekst\" /></p>
<p>Dato:<input type=\"text\" name=\"dato\" value=\"" 
$dag "/" $maaned "/" $aar "\" /></p>
<p>Belop:<input type=\"text\" name=\"belop\" /></p>
<p><select name=\"type\">
  <option value=\"1\">Inntekt</option>
  <option value=\"0\">Pending</option>
  <option value=\"-1\">Utgift</option>
</select></p>


</card>

</wml>"
;
?>

wap2.php:
PHP Code:
<?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=\"card2\" title=\"OK\">
<p>" 
$tekst " " .  $dato " " $belop " " $type;
if(
$tekst && $dato && $belop) {
    
// Not important SQL things, the trouble is actually GETTING INSIDE THIS IF! :P
// (Meaning: Why doesn't the variables work?
    
echo "Completed Succesfully";
}
else {
    echo 
"Sorry, didn't work =)";
};

echo 
"</p>
</card>

</wml>"
;
?>
Now, the problem is, the variables $tekst, $dato, $belop and $type aren't set in wap2.php (So i always end up getting "Sorry, didn't work =)".... Anybody seeing the problem? =)

Reply With Quote
  #2  
Old August 17th, 2004, 12:21 PM
andymoo's Avatar
andymoo andymoo is offline
Timelord
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Loughborough, Leicestershire
Posts: 605 andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 5 h 53 m 46 sec
Reputation Power: 63
have you tried changing post to get to see if that works?

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /...../devshedwap1.php on line 4
__________________
Andy Moore << oh no it's got a blog.....
Word Press WAP Plugin with Ad Mob Advertising revenue
PHP developer
deploying ringtones, mp3 downloads and realtones
I'm a geek who's obsessed with stats and gadgets

Reply With Quote
  #3  
Old August 17th, 2004, 01:00 PM
eXZire eXZire is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 4 eXZire User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yep.. tried that...

(Err.. That parse error of yours.. did you get that on my script? )

Reply With Quote
  #4  
Old August 17th, 2004, 01:42 PM
andymoo's Avatar
andymoo andymoo is offline
Timelord
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Loughborough, Leicestershire
Posts: 605 andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 5 h 53 m 46 sec
Reputation Power: 63
parse error, yeah fraid so. i just cut n pasted it then saw that and carried on working on what i'm doing.......

if you change it to get don't the vars appear in the query string? - if they do the second script should pick it up okay

if something doesn't work for me one way around i reverse it and try that way:

if it's passing the vars okay i'd try changing

if($tekst && $dato && $belop) { .......

to

if(!$tekst || $dato || $belop){
// nie
}else{
// ya
}

are you in norway? lovely place. was in Vanvikan not so long ago at a friend's party, a long way to travel but well worth it - loved reindeer stew and the chilli nuts there are great!!

Reply With Quote
  #5  
Old August 17th, 2004, 02:10 PM
eXZire eXZire is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 4 eXZire User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What blew my cover? My variable names? Damn

Yep, Norwegian

I've never tasted reindeer stew though.. But I've tasted moose though (Hm.. is that the right translation? anyway, in norwegian then: elg :P )

Anyway, what wierd PHP version are you running? :P I didn't get any parse error, not on my pc, and not on my Sony Ericsson T630...

But anyways, just forget the if then, I'll be happy as long as i somehow can get some freakin' php variables in wap2.php :P

(By the way.. now, when i enter all values and press "kjor" in wap.php, i come to wap2.php, and can see the card label, but everything else is blank? How the hell? (And yes, the server reports PHP errors, so it can't be that...)

And about seeing the variables. I haven't seen anything i put in those fields in wap.php even one time.. (the <p>" . $tekst . " " . $dato . " " . $belop . " " . $type; " should echo them if they are there )

(By the way.. when where you here in Norway? Winter? :P Did you think it was cold? )


And oh, yeah, one last thing.. yes, the variables appear in the adress field when i use get, but i still don't see anything echoed... wierd..

Reply With Quote
  #6  
Old August 18th, 2004, 05:18 AM
eXZire eXZire is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 4 eXZire User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Never mind, works now... (All right, was a PHP error.. :P inside the PHP i didn't show you Oh well...

Reply With Quote
  #7  
Old August 18th, 2004, 06:09 AM
andymoo's Avatar
andymoo andymoo is offline
Timelord
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Loughborough, Leicestershire
Posts: 605 andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 5 h 53 m 46 sec
Reputation Power: 63
Cool, pleased you got it sorted out!

I was over there about 3 monts ago, it snowed once when we were in Trondeihm and went as low as -2 the rest of the time is was okay.

I had reindeer, elk and whale over there. The elk was really, really nice and the whale was similar to smoked salmon I thought just darker.

Our friend from over there is coming over to Liverpool for a weekend soon, I hope he brings some bags of Chili Nuts!

We've just got reverse billing sms into Norway on 2098 and now have WAP billing there! Take a look around your teletext and you should see an ad for our WAP site on it!

Anyway, pleased you got your code problem sorted!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > Wap, forms and PHP


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