Jump to content

Recommended Posts

After running this script I get a display of " /cars/bmw/305.html "  but what I actually need is to display http://www.company.com/cars/bmw/305.html. 

Thank you for your help.

 

    print "<div><a href="\""." $linkPrefix="" .="" $hit["VISIBLEPATH"]="" .="" "\"="" target="\"blank\"">" . $hit["VISIBLEPATH"] . "</a></div>";

And where exactly do you expect http://www.company.com/ to come from?

 

Ok Thorpe....my website is http://www.company.com (example of course) and I am programming a search engine and I have two scripts in my server...the first script sends the search information to the other script which then displays the searched results where a user can then click to go to their search page. Now the bad thing is the displayed results are showing a path like this /***/***/***.html which is ok for an unpublished website and only useful on my test machine here but not a useful link to users out there.  All I need is a way of appending http://www.company.com at the beginning so that the search result links will work online.  to rephrase it again..../***/***/***.html is quiet okay in my local machine running wamp server but  http://www.company.com/***/***/***.html  is okay if its now a published website.

 

Thank you

hmm if its the same url over and over just do this

 

<?

echo "<a href=\"http://www.company.com".$whatever_the_link_is."\">http://www.company.com".$whatever_the_link_is."</a>";

?>

 

Thank you for your help all of you.  I finally managed to find a solution by using the code below:

 

<?php
$destinationUrl = "www.cars.com/www/buses/coachescontent/index.html";
$destinationUrl = str_replace("/www/", "/", $destinationUrl);
echo $destinationUrl;
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.