MAS1 MAS1 - 1 year ago 107
HTML Question

how to pass php variable value to action attribute of html form

i want to pass php variable value as a action to html form. i am trying as follows, but it is not working.

<form name="upload" action="<?=$url?>" method="post" >
<input type="submit" value="submit">

All this code are in one php file.

Answer Source

Have you tried <?php echo $url ?> If it works, then short_open_tag in the php.ini is turned off. That means you will need to either turn it on or use the long open tag <?php throughout your code.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download