Unable connect to wifi

Can you introduce me? please.I don't understand, why esp32 can't connect to wifi?

#include <EEPROM.h>
#include <WiFi.h>

void writeString(char add,String data);
String read_String(char add);
  String recivedData, recivedData1;
  
void setup() {
  Serial.begin(115200);
  EEPROM.begin(512);
  WiFi.begin(recivedData.c_str(), recivedData1.c_str());
  
}

void loop(){
  
  String input;
  while(Serial.available()) {
    input = Serial.readString();
  String user, pass, token;
  for (int i = 0; i < input.length(); i++) {
    if (input.substring(i, i + 1) == "*") {
      String data = input.substring(i + 1);
    writeString(10, data);  //Address 10 and String type data
    delay(10);      
    }
  }
  
  for (int j = 0; j < input.length(); j++) {
    if (input.substring(j, j + 1) == "#") {
      pass = input.substring(j + 1);
      String data = input.substring(j + 1);
    writeString(30, data);
    delay(10);
    }
  }  
  
  //Serial.print(data);
  //Serial.print(pass);
  }
  recivedData = read_String(10);
  Serial.print("Read Data:");
  Serial.print(recivedData);
  
  recivedData1 = read_String(30);
  Serial.print("Read Data1:");
  Serial.println(recivedData1);
  delay(1000);

  WiFi.begin(recivedData.c_str(), recivedData1.c_str());
  while (WiFi.status() != WL_CONNECTED) {
    delay(200);
    Serial.print(".");
  }
  Serial.println(WiFi.localIP());  
}

void writeString(char add,String data){
  int _size = data.length();
  int i;
  for(i=0;i<_size;i++)
  {
    EEPROM.write(add+i,data[i]);
  }
  EEPROM.write(add+_size,'\0');  
  EEPROM.commit();
}

String read_String(char add){
  int i;
  char data[100]; 
  int len=0;
  unsigned char k;
  k=EEPROM.read(add);
  while(k != '\0' && len<500)   
  {    
    k=EEPROM.read(add+len);
    data[len]=k;
    len++;
  }
  data[len]='\0';
  return String(data);
}

To put your code in a code box, use the </> icon in the far left of the post tool bar and paste your code between the two bracket sets that appear.

To go back and put your code in a code box, in the bottom right of your post, select "more" and click modify. When the modify post opens, high light your code and click the </> in the far left of the post tool bar. This will put you code in code brackets. Then save the changes.

you don't wait until it connects. see the examples