|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I need some help with a php script. I'm trying to send a variable to another php file within the wml-url :
if(mysql_num_rows($fagTabell) > 0) { while($row=mysql_fetch_array($fagTabell)) print "<a href=\"dato.php?fagkode=" . row["fagkode"] . "\">" . $row["fagbeskrivelse"] . "</a><br/>"; }//while }//if These lines creates wml-urls, where "row["fagkode"] is to be sent with the url..It seems like I have managed to send it, but I can't use the variable in dato.php... I've tried this in dato.php : $kode=HTTP_GET_VARS["fagkode"]; echo"<p>$kode</p>"; (wich only creates the error "Unsupported content-type: text/html") or just : print"$fagkode"; doesn't print anything at all). Could use some help here! Ole Kristian |
|
#2
|
|||
|
|||
|
Hi Ole,
From the code you supplied it looks like you're missing a curly bracket: while($row=mysql_fetch_array($fagTabell)) { <- This one Hope this clears up your problem. Ben |
|
#3
|
|||
|
|||
|
Try this, instead:
if(mysql_num_rows($fagTabell) > 0) { while($row=mysql_fetch_array($fagTabell)) print "<a href=\"dato.php?fagkode=$row["fagkode"]\">$row["fagbeskrivelse"]</a><br/>"; }//while }//if (you have type row["fagkode"] instead of $row["faqkode"], and you can embebed your php variables in strings)... Ah! don't forget to print the wml header, when you are writing WAP applications, before print something, just put this in your code: print("Content-type: text/vnd.wap.wml\r\n\r\n"); this is the standard wap.wml header and will tell that your file is using this protocol... Happy WAPPy... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > php and wml hand in hand..not |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|