Android Question No reaction in mysql database

DonManfred

Expert
Licensed User
Longtime User
The called php needs javascript it seems....
LogCat connected to: 05157df57d72d204
--------- beginning of main
** Service (widget) Start **
ExecuteRemoteQuery(GetOrderCount)
JobName: GetOrderCount / Response from server: 1
Set TeslaUnreadCount -> 1
setUnreadCount(): de.fbdn.bestellungen/com.main
--------- beginning of system
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
JobName = InsertP, Success = true
<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("a70f29605e4c01459720d657f9b67b68");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";location.href="http://athrun999.er-webs.com/test.php?name=klaus&age=30&ckattempt=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **

I suggest to remove javascript from that php
 
Upvote 0

Alphaw

Member
Licensed User
Longtime User
The called php needs javascript it seems....


I suggest to remove javascript from that php

DonManfred, as the php script here:
B4X:
$con = mysql_connect($host,$user,$pw) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES 'utf8'");

$name = $_GET["name"];
$age = $_GET["age"];

$q = mysql_query("Insert into Persons (name, age) VALUES ('$name', $age)");

$q = mysql_query("SELECT * FROM Persons");
$count = mysql_num_rows($q);

print ("I have inserted $name and $age in my table and now there are $count rows in the table");

I do not use javascript, how can I remove so?
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
it seems that it is a redirect page of your hosting that is shown in that log.

are they blocking mobile traffic or something?
 
Upvote 0

Alphaw

Member
Licensed User
Longtime User
I just use online free server, and follow KMatle's step, just change the database and password I using for the free server. Here is the full php script.

B4X:
<?php

$host = "sql104.er-webs.com";
$user = my username;
$pw = my pass word;
$db = my database;

$con = mysql_connect($host,$user,$pw) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES 'utf8'");

$name = $_GET["name"];
$age = $_GET["age"];

$q = mysql_query("Insert into Persons (name, age) VALUES ('$name', $age)");

$q = mysql_query("SELECT * FROM Persons");
$count = mysql_num_rows($q);

print ("I have inserted $name and $age in my table and now there are $count rows in the table");

?>

Since I just start to learn the server skill, I do not know whether the web is block the mobile action.
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Typing

B4X:
http://athrun999.er-webs.com/test.php?name=klaus&age=30&ckattempt=1

in my browser will get back this message from the php:

B4X:
I have inserted klaus and 30 in my table and now there are 10 rows in the table

This means, you've inserted 10 rows so far :)

So the php works, but as the message says "This site needs Javascript..."

I tried setting a header in your app: https://www.b4x.com/android/forum/threads/set-http-request-header-with-httputils2.39413/

but no success :(
 
Upvote 0

Alphaw

Member
Licensed User
Longtime User
Maybe I install a xampp and try to make a server for my computer and test whether the code is ok. Thank you for all your help.
 
Upvote 0
Top