I have a php file which is used to display a pdf file. The pdf file contains variables obtained from php file given below.
$areaOfCircle;
...
...
$pdf->WriteFixedPosHTML($areaOfCircle, 20, 50, 20, 50, 'auto');
And I have my Unity script here
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SendToServer: MonoBehaviour
{
public string areOfCircle;
IEnumerator Start()
{
WWWForm form = new WWWForm();
form.AddField("areaOfCircle", areOfCircle);
UnityWebRequest www = UnityWebRequest.Get("https://localhost/sqlconnect/myFirstPhp.php");
yield return www.SendWebRequest();
if (www.isNetworkError || www.isHttpError)
{
Debug.LogError(www.error);
}
else
{
Debug.Log("Sent");
}
}
}
I am trying to send value of the string to php from Unity but I only get error message. What am I doing wrong here?