0

I am trying to formulate a link to another page in my directory. It can either be done in the php code or the html. However for some strange reason, and only on this page, everytime i generate a url to a new page, the url generated is the page i am on + the url i want to go to.

For example, if i am on mysite.php and formulate a link to go to purchase.php then the generated url is mysite.php/purchase.php

Does anyone know why this might be?

<h1>Success</h1>
<a href="page.php">Link text</a>
<?php
   ...
   ...
?>

this is essentially all i have with an echo saying hi! . What happens is, if i am currently on home.php the above url becomes path/home.php/page.php

3
  • Talk to us in code, that's what we understand! Commented Apr 8, 2012 at 10:34
  • the issue is all with an html href or conversely an echoed href though :) do you want to see one of those?! Commented Apr 8, 2012 at 10:36
  • We want to see all the parts of the code that you, as a scripter, think are related to the problem. Commented Apr 8, 2012 at 10:37

1 Answer 1

1

You should create url for /purchase.php instead of purchase.php. You can read more about what's the difference in here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.