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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Leonidas DosasCommented:
Change the href="change_pass1.php" to href="/change_pass1.php" or  href="./change_pass1.php"
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.