Codeigniter insert html line in php form

302

I use codeigniter to show registration form like in the code below and I just want to add a line "By clicking Register, you agree to our Terms" but the syntax of that line is not correct. Could you please help me.

<?php 
echo form_open();
              blablabla
echo form_input($data);
echo ("By clicking Register, you agree to our <a href="<?php echo base_url(); ?>terms/" target="_blank">Privacy  Terms</a>");
echo form_submit('submit','Register');
echo form_close(); 
?>
342

Answer

Solution:

I dont think you need the brackets after echo. Why not like this:

<?= form_open();?>
//Your html stuff
<?=form_submit();?>
<?= form_close();?>
78

Answer

Solution:

You can also do this

 <?php     
 echo form_open();    
 echo form_input($data);    
 echo "By clicking Register, you agree to our <a href='".base_url()."terms/'     
 target='_blank'>Privacy  Terms</a>";   
 echo form_submit('submit','Register');    
 echo form_close();     
 ?>

People are also looking for solutions to the problem: php - Doctrine One To Many No Join Table

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.