The noobest error i've ever seen.. [SOLVED]

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

The noobest error i've ever seen.. [SOLVED]

Post by vitinho444 »

I started coding at the age of 12, that was 5 years ago and i never, i never found this error... It's very strange that it happens because I think this is so easy that i can't fail ...

So i have a form:

Code: Select all

<form method="POST" id="create" action="criar.php">
							<p class="label">Titulo*</p>
								<input class="register" id="titulo" type="text" name="titulo">
								
							<p class="label">Categoria</p>
								<select id="category">
									<option value="Universidade" selected="selected">Universidade</option>
									<option value="Curso">Curso</option>
								</select>
								
							<p class="label">Nota (%)</p>
								<input id="nota" onchange="NotaChange" class="nota" type="text" name="nota">

							<p class="label">Análise / Opinião / Critica / Observações</p>
								<textarea style="resize: none;" cols="45" rows="10" name="analise"></textarea>
								
							<br><br>
							<input type="submit" class="button" name="criar">
						</form>
And basicly, when i submit it, the variable $_POST["category"] doesn't exist...

Showing this error:

Code: Select all

Notice: Undefined index: category in C:\xampp\htdocs\uniopiniao\criar.php on line 36
What the hell is happening?
Last edited by vitinho444 on Wed Jul 03, 2013 10:43 am, edited 1 time in total.
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: The noobest error i've ever seen..

Post by Jackolantern »

Form data is not sent by ID. You need to give "category" a name attribute, and it will be stored on the server under that name :)
The indelible lord of tl;dr
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Re: The noobest error i've ever seen.. [SOLVED]

Post by vitinho444 »

Jackolantern wrote:Form data is not sent by ID. You need to give "category" a name attribute, and it will be stored on the server under that name :)
SEE!! I WAS TALKING ABOUT THAT I TOTALLY MISSED THAT JESUS!!!!

Thanks a lot jacko ;)
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: The noobest error i've ever seen..

Post by Jackolantern »

No problem hehe :)
The indelible lord of tl;dr
Post Reply

Return to “Beginner Help and Support”