Forum Moderators: coopster

Message Too Old, No Replies

Error on form submit

php mysql twisted mind error webmasterworld whatever

         

Twisted Mind

8:44 am on Oct 26, 2005 (gmt 0)

10+ Year Member



Hello i made this script:
<form name=\"info$order_id\" target=\"_new\" method=\"post\" action=\"components/com_confirmation/billing_shipping_info.php\">
<input name=\"order_id\" type=\"hidden\" value=\"$order_id\">
<input type=\"submit\" name=\"submit\" value=\"Billing/shipping\" class=\"button\"></table>"

in html it will be:
<form name="info103" target="_new" method="post" action="components/com_confirmation/billing_shipping_info.php">
<input name="order_id" type="hidden" value="103">
<input type="submit" name="submit" value="Billing/shipping" class="button"></form>

When submitted all i ask him to do is this:

echo ".$_POST['order_id'].";
any help? thanks anyway u guys are great

Twisted Mind

9:11 am on Oct 26, 2005 (gmt 0)

10+ Year Member



help me!

Netter

9:24 am on Oct 26, 2005 (gmt 0)

10+ Year Member




1.
this is a better use:

echo <<<END
<form name="info103" target="_new" method="post" action="components/com_confirmation/billing_shipping_info.php">
<input name="order_id" type="hidden" value="$order_id">
<input type="submit" name="submit" value="Billing/shipping" class="button"></form>
END;

2. not echo ".$_POST['order_id']."; but
echo ".$_POST[order_id].";

you do not use ' for array key when it's inside "
or you can use

echo ".{$_POST['order_id']}.";

Twisted Mind

9:34 am on Oct 26, 2005 (gmt 0)

10+ Year Member



gonna try it ty

Twisted Mind

1:06 pm on Oct 26, 2005 (gmt 0)

10+ Year Member



as i just said this is how its displayed in the source code whenu look on iexplore not the script :)
1.
this is a better use:
echo <<<END
<form name="info103" target="_new" method="post" action="components/com_confirmation/billing_shipping_info.php">
<input name="order_id" type="hidden" value="$order_id">
<input type="submit" name="submit" value="Billing/shipping" class="button"></form>
END;

Netter

1:24 pm on Oct 26, 2005 (gmt 0)

10+ Year Member



is this
echo <<<END
...
END;

inside <?php?> ?
it should be. maybe it's just for php5... I don't remember. it's just another way of printing html code with php variables without adding slashes etc.

Twisted Mind

1:37 pm on Oct 26, 2005 (gmt 0)

10+ Year Member



i dont know i dont use it but i have another question cuz i made it work but...

i loop forms as u might want to know so the first =
(this is as read from source code)
<form name="info_101" method="post" action="components/com_confirmation/billing_shipping_info.php" target="_new" >
<input type="hidden" value="101" name="order_id">
<input type="submit" value="Billing/Shipping info">

and this the second:

<form>

the second one is:
<form name="info_103" method="post" action="components/com_confirmation/billing_shipping_info.php" target="_new" >
<input type="hidden" value="103" name="order_id">
<input type="submit" value="Billing/Shipping info">
<form>

but when it opens the billing_shipping_info.php it always echo's 103 how the ... is this possible.... i have no where 103 in my scripts

Twisted Mind

1:42 pm on Oct 26, 2005 (gmt 0)

10+ Year Member



this is sooo wierd

Twisted Mind

6:47 am on Oct 27, 2005 (gmt 0)

10+ Year Member



no one knows what can be wrong?

Twisted Mind

7:13 am on Oct 27, 2005 (gmt 0)

10+ Year Member



Well i found out that all submit buttons got to the same action :)

Twisted Mind

7:28 am on Oct 27, 2005 (gmt 0)

10+ Year Member



Solved it changed post to submit and get but now it shows in the adress bar... i dont want that :)

gsnider

4:35 pm on Oct 27, 2005 (gmt 0)

10+ Year Member



do you still need help? getting the values using post instead of get?

Twisted Mind

6:00 am on Oct 28, 2005 (gmt 0)

10+ Year Member



IF u can tell me how do it becouse i dind find out how :)

gsnider

8:33 pm on Oct 31, 2005 (gmt 0)

10+ Year Member



private message me the source code for this page, i'll reply with the solution.