Reputation: 75
Here is my project structure, classes-> forgotpassword.php ,,
index.php is in the outer side of the project. Requirement is, Whenever the non registered user clicks on forgotpassword link. It should redirect him to my SIGNUP page.
What I'm doing is,
else{
//$link_address = '';
echo 'Hi user, You are not yet registered to Wings2Roots<br><br><a href="index.php"><br/>Please click here to SIGNUP</a>';
}
So, whenever I'm clicking on SIGNUP , it's redirecting me to http://localhost/ProjectName/classes/index.php. As a result it displays File not found. Problem here is, I don't want that classes in that url.
Upvotes: 2
Views: 62
Reputation: 453
Try this..
<a href="../index.php"><br/>Please click here to SIGNUP</a>
Upvotes: 2
Reputation: 15609
You can change your index.php
. to /index.php
.
<a href="/index.php"><br/>Please click here to SIGNUP</a>
Or, you could create a base_url()
function that is always going to point to the root directory, then do something like:
<a href="<?php echo base_url();?>/index.php"><br/>Please click here to SIGNUP</a>
Upvotes: 0