Home > Enterprise >  Passing variables in php as paramters through form action on submit
Passing variables in php as paramters through form action on submit

Time:11-10

i want to pass a parameter $to_email on submit click somewhat like this

<form action="../codeVerification.php?'$to_email'" method="POST">

this method failed and the parameter was not passed

how can i pass the parameter through action in php

CodePudding user response:

You would use


<form action="../codeVerification.php" method="POST">
<input type="hidden" name="to_email" value="<?=$to_email?>">

CodePudding user response:

Try inserting in the string .urlencode("../codeVerification.php?'$to_email'").

and better to use method="GET" of not passing data.

  •  Tags:  
  • php
  • Related