mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
making page stay on the same page when pressing button
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from flask import Flask, request, render_template
|
||||
from flask import Flask, request, render_template, redirect
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
app = Flask(__name__)
|
||||
@@ -21,7 +21,7 @@ def move():
|
||||
print("Bericht succesvol gepubliceerd")
|
||||
else:
|
||||
print("Fout bij het publiceren van bericht")
|
||||
return "Bericht verzonden!"
|
||||
return redirect('/')
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
|
@@ -5,10 +5,10 @@
|
||||
</div>
|
||||
<div class="button-section">
|
||||
<form action="/move" method="post">
|
||||
<button class="btn" name="direction" value="left">←</button>
|
||||
<button class="btn" name="direction" value="up">↑</button>
|
||||
<button class="btn" name="direction" value="right">→</button>
|
||||
<button class="btn" name="direction" value="down">↓</button>
|
||||
<button type= "button" class="btn" name="direction" value="left">←</button>
|
||||
<button type= "button" class="btn" name="direction" value="up">↑</button>
|
||||
<button type= "button" class="btn" name="direction" value="right">→</button>
|
||||
<button type= "button" class="btn" name="direction" value="down">↓</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user