0

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(); 
?>

2 Answers 2

1

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

<?= form_open();?>
//Your html stuff
<?=form_submit();?>
<?= form_close();?>
Sign up to request clarification or add additional context in comments.

1 Comment

FYI: CodeIgniter specifically recommends against using PHP shorthand. See: ellislab.com/codeigniter/user-guide/general/…
1

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();     
 ?>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.