user3926729
user3926729

Reputation: 71

how to insert php variables inside the form action

i need to create a form which can be insert a php variable inside the action the example is here

<form name="form" method="post" action="order_cart.php?id=<?php echo '$.prod_diay.' ?>" >

Upvotes: 0

Views: 2952

Answers (3)

Devin H.
Devin H.

Reputation: 1105

<form name="form" method="post" action="order_cart.php?id=<?php echo '$.prod_diay.' ?>" >

becomes

<form name="form" method="post" action="order_cart.php?id=<?php echo $prod_diay ?>" >

Notice the quotes missing around $.prod_diay.

Upvotes: 2

iam-decoder
iam-decoder

Reputation: 2564

how you currently have the php insert, its not actually echoing the variable contents, just the variable name, try this:

<form name="form" method="post" action="order_cart.php?id=<?php echo $prod_diay; ?>" >

Upvotes: 0

Erlesand
Erlesand

Reputation: 1535

Don't use single quotes around a variable, and not sure what the . are for?

<?php echo '$.prod_diay.' ?>

Do like this instead,

<?php echo $prod_diay; ?>

Upvotes: 1

Related Questions