I am in need of some help, any help is appreciated. I understand that PHP is beyond the scope of Construct 2, however I do know there are some experienced script programmers on these forums.
What I have is a database named "test" and what im doing is sending an AJAX request from Construct 2 asking for a match between the text in FriendBox (which is a textbox in Construct 2) to my database and return the echoed result into a text plugin named FriendsText.
However, I do have it all setup, and when I try to put something inside the FriendBox textbox and send the AJAX request to my PHP file, it returns "/ br" every time. I am not sure why it is returning that instead of returning the username from my database.
Here is the screenshot where I declare an AJAX request inside Construct 2:
<img src="http://img703.imageshack.us/img703/4387/fwhk.png" border="0" />
And here is my PHP file that should return username:
<?php
$username = $_GET['fname'];
$con=mysqli_connect("localhost","root","","test");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT username FROM test WHERE username='".$username."");
while($row = mysqli_fetch_array($result))
{
echo $row['username'];
}
mysqli_close($con);
?>
This is the value that is returned when I run my program in Construct 2 over a public hosted server:
<img src="http://img27.imageshack.us/img27/8505/546i.png" border="0" />