Href not redirecting to the file in same directory

I have "change_pass1.php" file in same directory file where next line of code is
	$changePass_btn = '<a  href="change_pass1.php">Change password</a>';

Open in new window

but link is not working. Why?

I did try also other files in same directory and is the same. I did try to call an not-existing  file and i may see the path in the browser, but when i am calling my existing  file browser does not redirect me (it stays on the same page-path in browser does not change).
Ivan GolubarAsked:
Who is Participating?
 
mohan singhWeb developerCommented:
Hi @ ivan golubar
Replace your code with this

<a href="<?php echo home_url(); ?>/about-us">about us</a>

Open in new window

0
 
rgranlundCommented:
$changePass_btn = '<a  href="change_pass1.php">Change password</a>'; Change to.
$changePass_btn = '<a href="change_pass1.php">Change password</a>';

Also, maybe the relative path is wrong?  Can you share a link?
0
 
Neil ThompsonSenior Systems DeveloperCommented:
Check you don't have a somewhere in your code otherwise your links would be relative to that.

  <base href="http://www.yoursite.com/">
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
Leonidas DosasCommented:
Change the href="change_pass1.php" to href="/change_pass1.php" or  href="./change_pass1.php"
0
 
Ivan GolubarAuthor Commented:
With:
href="/change_pass1.php

Open in new window

i get in browser next link http://my.com/change_pass1.php (part in link is missing:http://my.com/wp-content/themes/aaa/bbb/change_pass1.php)

in other case:
href="./change_pass1.php

Open in new window

page does not redirect me.

Originally my site is Word press I have different Themes and i am making one mine.
0
 
Leonidas DosasCommented:
What is the browser link with
href="change_pass1.php"

Open in new window

0
 
Ivan GolubarAuthor Commented:
http://my.com/wp-content/themes/aaa/bbb/user.php?u=ivan


(the same as it was before clicking on link)
0
 
Neil ThompsonSenior Systems DeveloperCommented:
I assume you're already calling get_template_directory_uri() in your code to let WP know where your current template lives?
0
 
Leonidas DosasCommented:
Take a look at this documentation Wordpress doc
Capture.JPG
0
 
Ivan GolubarAuthor Commented:
I don't remember it, because i am doing this template almost one year now.
But i added it now to main page where in Onload  function.
But still no result.
0
 
Ivan GolubarAuthor Commented:
Thank you

I get next in browser:

http://my.com/wp-content/themes/my2/my3/%3C?php%20echo%20home_url();%20?%3E/about-us

Open in new window



What does it mean?
0
 
NerdsOfTechTechnology ScientistCommented:
that translates to:


http://my.com/wp-content/themes/my2/my3/<?php echo home_url(); ?>/about-us

Open in new window


Therefore, there is some sort of php parsing issue.
0
 
Ivan GolubarAuthor Commented:
Yes i understand now.

The problem is not in the link to the *.php

But that code in *.php is  incorrect.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.