John
John

Reputation: 507

how do i echo a link in php that contains php with Codeigniter?

so i am trying to echo a link to to call a function to load a view in CodeIgniter. this is the link:

<a href='<?php echo base_url()."main/signup" ?>'>Sign Up!</a>

echo '<a href=\'<?php echo base_url()."main/login" ?>\'>Log In!</a>';

i am running an Acer Aspire 5920,

Ubuntu 12.04,

Xampp 1.8.1,

Codeigniter 2.1.3

Upvotes: 0

Views: 75

Answers (1)

Erik Klop
Erik Klop

Reputation: 135

Remove the php tags from between the href, something like this:

echo '<a href="' . base_url() . 'main/login'">Log In!</a>';

Good luck!

Upvotes: 1

Related Questions