Ivan Golubar
asked on
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
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).
$changePass_btn = '<a href="change_pass1.php">Change password</a>';
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).
Check you don't have a somewhere in your code otherwise your links would be relative to that.
<base href="http://www.yoursite.com/">
<base href="http://www.yoursite.com/">
Change the href="change_pass1.php" to href="/change_pass1.php" or href="./change_pass1.php"
ASKER
With:
in other case:
Originally my site is Word press I have different Themes and i am making one mine.
href="/change_pass1.php
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
page does not redirect me.Originally my site is Word press I have different Themes and i am making one mine.
What is the browser link with
href="change_pass1.php"
ASKER
http://my.com/wp-content/themes/aaa/bbb/user.php?u=ivan
(the same as it was before clicking on link)
(the same as it was before clicking on link)
I assume you're already calling get_template_directory_uri () in your code to let WP know where your current template lives?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
But i added it now to main page where in Onload function.
But still no result.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
I get next in browser:
What does it mean?
I get next in browser:
http://my.com/wp-content/themes/my2/my3/%3C?php%20echo%20home_url();%20?%3E/about-us
What does it mean?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes i understand now.
The problem is not in the link to the *.php
But that code in *.php is incorrect.
The problem is not in the link to the *.php
But that code in *.php is incorrect.
$changePass_btn = '<a href="change_pass1.php">Ch
Also, maybe the relative path is wrong? Can you share a link?