Jump to content

Help - Code is redefined so where did I go wrong?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
ghost2012

ghost2012

    Newbie

  • Members
  • PipPip
  • 16 posts
What I'm trying to do is receive only data input.
So where did I go wrong.

This is the html code.


<form action="order001.php" method="post" style="height: 460px">

	order01<input id="order01" style="width: 40px" type="text" /> <br />

	order02<input id="order02" style="width: 40px" type="text" /><br />

	order03<input id="order03" style="width: 40px" type="text" /><br />

	<br />

	<input name="Submit1" type="submit" value="submit" />

</form>



This is the php code.


<?php

$order01 = $_POST["order01"];

$order02 = $_POST["order02"];

$order03 = $_POST["order03"];


if ( $order01 > 0 ) {

	echo " amount of $order01 <br />";

}else {

	break;

}


if ( $order02 > 0 ) {

	echo " amount of $order01 <br />";

}else {

	break;

}

if ( $order03 > 0 ) {

	echo " amount of $order01 <br />";

}else {

	break;

}



?>



I'm not trying to use any array just yet but if you know how I'm willing to learn. :D
Any comments or critique is welcomed.

#2
kwm

kwm

    Newbie

  • Members
  • PipPip
  • 11 posts
for PHP, you still have to use the name-attribute for input/select/textarea tags.
it won't work just with an id, as I know from my experience...

oh and you always echo the value of $order01, that should be changed.