Sup stackies.
Okay, i have got a real head scratcher for you guys! I've been trying to solve this puzzle for a week now (apparently i was on stack cooldown). Ok so whats going on is that i have 2 scripts, that goes under the same if/elseif statement. They both work 100% individually (multiple tests were taken to conclude this). The script is supposed to start the if/elseif depending on one of 2 submit buttons. the scripts themselves is not the problem. It's the process of starting the scripts. On the same page as the 2 submit buttons, there is 2 "text" fields, that both of the scripts utilize to complete.
The buttons is build like this:
<input type="SUBMIT" Name="Udlaan" VALUE="Udlån" METHOD="POST" class="Aside-Udlån">
<input type="SUBMIT" Name="Aflever" VALUE="Aflever" METHOD="POST" class="Aside-aflever" >
They work.
The text fields are build like this:
<input Type="Text" Name="bunnr" Method="POST" Class="Skriv_bun" Placeholder="bun Nummer">
<input Type="Text" Name="Ordreren" Method="POST" Class="Ordre_No_Skriv" Placeholder="Ordre Nummer">
The variables that holds the data from the textfield looks like this:
$Ordre_Nr=$_POST['Ordreren'];
$bun_Nr=$_POST['bunnr'];
So the problem is that the data from the text field is never getting parsed into the variablesm, which causes my scripts to never run . (I mind you that the input fields and the variables are 3 lines apart with nothing inbetween nor above the textfields that has any relevance to this problem.) I added in or die($conn);
on one of the variables, which gave me "Object of class mysqli could not be converted into string". Without it, the above just returns false with undefined index.
I tried making new scripts that is in no way connected to my real script. This is one of them:
<html>
<head>
<meta charset="UTF-8">
<title>title</title>
</head>
<body>
<form METHOD="POST"> <input type="submit" Method="POST" NAME="WORLD" Placeholder="World">
<input type="text" Method="POST" NAME="Hello" Placeholder="hej">
</form>
<?php
$f = $_POST['World'];
$e = $_POST['hej'];
if(isset($f)){echo $e;}
?>
</body>
</html>
Do we agree that this should work? well it doesn't. Nothing, sip, nada. except the same "Undefined index".
I made another quite like the one above(Almost exactly like it) using POST
aswell, the data i put in the text field came out as GET
(I could see everything in the url bar).
This isn't just a standard error, i had a guy with 20 years (on/off) of experience look at it, and he could not find a single syntax error, that could be related to this issue.
If anyone has any really good suggestions, please come forth and prevail! And should you be in need for more information, i will try my best to provide ^^
Fyi, i don't care much for "SQL injection comments, since it's not important for this issue. Fyi 2. This is NOT a duplicate. I have checked multiple questions with answers for this issue, nothing has worked.