nodeMCU webserver Not Found error

hi guys i am new to arduino and having a hard time figuring out what is wrong with the code that i am using for my ESP8266 nodeMCU cause when i upload the code and i try to open the webserver in my phone in only shows a white page with the Not Found:/ i have checked the serial monitor and the wifi is connected.
this is what im working

#include <ESP8266WebServer.h>

const char* ssid = "neneboots";;
const char* password = "87654321";
String notice;


ESP8266WebServer server(80);

char webpage[] = R"=(
<!DOCTYPE html>
<html>
<body>
<h3>Electronic Notice Board </h3>
<form method="post"action="/postForm">
<input type="text" name="myText" placeholder="Write your Notice...">
<input type="submit" value="Post Notice">
</form>
</body>
</html>
)=";



void setup() {
  //Wifi as access point__________________
  Serial.begin(115200);
  Serial.print("CONNECTING TO ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(400);
    Serial.print("-");
  }
  Serial.println("");
  Serial.println("WIFI CONNECTED!");
  server.begin();
  Serial.println("SERVER STARTS AT : ");
  Serial.println(WiFi.localIP());
  //Server________________________________
  server.begin();
  server.on("/postForm", handlePostForm);   
}


void loop() {
  server.handleClient();
  delay(10);
}



void handlePostForm()
{
 notice=server.arg("myText");
 Serial.println("Text Received, contents:");
 Serial.println(notice);
 server.send(200, "text/html", webpage);
}
char webpage[] = R"=(

Can you please explain what this line of code does ?

If you want to include quotation marks in strings then you must escape them by preceding them with a backslash

If you spread HTML commands over several lines when initialising a string then you need to use the line continuation character () at the end of each line. Try this for example

char  webpage[] = "=(\
<!DOCTYPE html>\
<html>\
<body>\
<h3>Electronic Notice Board </h3>\
<form method=\"post\"action=\"/postForm\">\
<input type=\"text\" name=\"myText\" placeholder=\"Write your Notice...\">\
<input type=\"submit\" value=\"Post Notice\">\
</form>\
</body>\
</html>\
)=";

void setup() 
{
  Serial.begin(115200);
  while(!Serial);
  Serial.println();
  Serial.println(webpage);
}

void loop() 
{
}

“hi guys i am new to arduino and having a hard time figuring out what is wrong with the code that i am using for my ESP8266 nodeMCU”

Have you gotten the the example code, which has been tested to generally work< to work in your situation? Is anything printed out in the serial monitor (after loading push the reset button to get fresh output) ?

Yes i have gotten to make the example to work and also other codes seems to work but not this one. The serial monitor shows the IP after the wifi is connected

UKHeliBob: char webpage[] = R"=(

Can you please explain what this line of code does ?

It's to denote raw literal string. So whatever inside () will be as it is. No escape character is processed. The purpose of it is so we don't have to add annoying escape character every time.

The code connects up to my router ok, so there seems to be some issue in how the client request is being handled. I've seen this type of client handling in functions, but haven't really paid that much attention to it, so just not sure how it is supposed to work. You might try starting with the working code and slowly start putting your code in the working code structure and see where it stops working.

this code is like the same to the other one but it works. so i dont know why the other one doesnt but is there any chance that this issue will happen again?

#include <ESP8266WebServer.h>


const char* ssid = "neneboots";
const char* password = "87654321";
String notice;
String notice2;
float notice3;

ESP8266WebServer server(80);

char webpage[] = R"=(
<!DOCTYPE html>
<html>
<body>
<h3>Electronic Notice Board </h3>
<FORM METHOD="POST"action="/postForm">
<input type="text" name="myText" value="Write your Notice...">
<div><input type="text" name="myTemp" value="Write your Notice..."></div>
<input type="submit" value="Post Notice">
</form>
</body>
</html>
)=";


void handlePostForm()
{
 notice=server.arg("myText");
 notice2=server.arg("myTemp");
 notice3= notice2.toFloat();
 Serial.println("Text Received, contents:");
 Serial.println(notice);
 Serial.println(notice3);
 server.send(200, "text/html", webpage);
}
//----------------------------------------------------------------------------------


void setup() {
  //Wifi as access point__________________
  Serial.begin(115200);

  Serial.print("CONNECTING TO");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(400);
    Serial.print("-");
  }
  Serial.println("");
  Serial.println("WIFI CONNECTED!");

  server.begin();
  Serial.println("MINI SERVER STARTS AT : ");
  Serial.println(WiFi.localIP());
  //Server________________________________
  server.begin();
  server.on("/postForm", handlePostForm);      
  }

void loop() {
  server.handleClient();
   delay(10);
}

After setting both codes up for my system, they both work. Note that the access url needs to be like below including the /postForm at the end of the url (if it is not included, you will get the page not found notice). My wemos d1 is running on port 82, so that also had to be added to the code and the url. I tested single text box code using my cell phone and it worked.

http://cwxxxx.myfoscam.org:82/postForm

wow everything seems to be working now thank you so much that helped alot i understand it now.

brownoutee: wow everything seems to be working now thank you so much that helped alot i understand it now.

Most web sites will serve up some sort of index html file if just a non specific request is made. These codes are only looking for the specific "postForm" request. I found the code itself interesting, especially the escaping of all the html code at one time.