G
Garnet
Ambitioniertes Mitglied
- 1
Ich versuche jetzt schon seit einigen Stunden eine Variable an mein php-Skript zu senden, leider ohne Erfolg. Ich hoffe es kann mir einer dabei helfen.
Mein Java-Code:
php:
Die Variable message ist aber leer, obwohl im Java-Code ganz sicher was in der Variable " kommentartext" gespeichert wurde. Woran kann das liegen?
[/LEFT]
Mein Java-Code:
Code:
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]final
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][SIZE=2]ArrayList<NameValuePair> nameValuePairs = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ArrayList<NameValuePair>(1);[/SIZE]
[SIZE=2]nameValuePairs.add([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BasicNameValuePair([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"param1"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]kommentartext[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]));[/SIZE]
php:
Code:
[SIZE=2]<?php [/SIZE]
[SIZE=2]$db = new SQLite3('CE2012AppDB2'); [/SIZE]
[SIZE=2]if ( false===$db ) { [/SIZE]
[SIZE=2] exit('Fehler bei sqlite_open'); [/SIZE]
[SIZE=2]} [/SIZE]
[SIZE=2] $message=$_POST["param1"];[/SIZE]
[SIZE=2]$result = $db->exec('INSERT INTO Kommentare (Kommentartext) VALUES ($message)'); [/SIZE]
[SIZE=2]?>[/SIZE]
Die Variable message ist aber leer, obwohl im Java-Code ganz sicher was in der Variable " kommentartext" gespeichert wurde. Woran kann das liegen?
[/LEFT]