Need help with code - WifiNINA

(deleted)

(deleted)

You can have a look at the examples in this WiFiWebServer Library, to see if it's OK to use / adapt, especially

  1. HttpBasicAuth for PWD protected Webpage
  2. Examples in HTTPClient Directory

(deleted)

Hey guys,

Before I go into my question, I am using a NANO 33 IoT and the library WiFiNINA…

Recently I found out how to get inputs like passwords and usernames, things like that:

client.print("Username:
");
client.print("
");
client.print("");

But this is quite useless because I do not know how to use the information sent back to the Arduino when the username/password is entered and submitted. I do know how to edit code such that if one types "on" or "off" and submits that, the Arduino will apply voltage to a pin:

if (currentLine.endsWith("GET /action_page.php?username=on")) {
digitalWrite(2, HIGH);
} else if (currentLine.endsWith("GET /action_page.php?username=off")) {
digitalWrite(2, LOW);
}

My question is, how do I redirect the client to a different page if the correct password is entered?

Check out this thread: [MERGED] Need help with code - WifiNINA - Networking, Protocols, and Devices - Arduino Forum

gfvalvo:
Check out this thread: [MERGED] Need help with code - WifiNINA - Networking, Protocols, and Devices - Arduino Forum

This thread has no result... I have the same question but the response to that thread is useless

robert_yoojean:
This thread has no result... I have the same question but the response to that thread is useless

Quite a coincidence that the wording of your question is identical to that in the other thread....

khoih-prog:
You can have a look at the examples in this WiFiWebServer Library, to see if it's OK to use / adapt, especially

  1. HttpBasicAuth for PWD protected Webpage
  2. Examples in HTTPClient Directory

Does not compile...

(deleted)

Cameron_Bert:
How does this answer my question? :confused: still confused....
Basically just download those libraries and figure it out myself?

It answers your question because it gives you more research. Download the libraries and look at the example code. Try adapting and compiling the code, then come back with more specific questions.

In the years that I have been using the Arduino world, I have never heard of the WiFiNINA library. But, then, I've never tried to make a webpage for any of my Arduino projects.Most use the ESP32 and ESP libraries.

Cameron_Bert:
Why did you literally just copy my question?

Indeed. Using an email address that nicely matches your moniker.

Cameron_Bert:
You are just adding spam to this forum

A bit. But merging the threads illuminates the trouble.

I suggest you "two" work together.

@Cameron_Bert, do not cross-post. Threads merged.