Skip to main content
Inspiring
June 5, 2012
Question

Masking a web address in a URL

  • June 5, 2012
  • 1 reply
  • 1177 views

Hi:

On my site, I'm providing links to other products in an frame. But I'd prefer not to include the url to their site in the actual URL that visitors are seeing. I'd rather it just says OwnersWebsite.

The URL currently reads (This is not the actual address: couldn't figure out how to not make it clickable It just shows the parts of the address)):

http://www.mysite.com/frame.php?url=http://www.theirsite.com

I'd like it to read (Again: don't click. This is just meant to show the pieces of the URL):

http://www.mysite.com/frame.php?url=OwnersWebsite

I'm a real PHP novice, but I think I identified the code relating to this issue.  (Out of 6000 lines of code -- a victory in itself!!)

if(!empty($d['listing_url']) && $d['listing_swebsite'] == 1){

                                        $website = "<div class=\"blueText\">Website: <a href=\"{urlroot}frame.php?url=".$d['listing_url']."\" target=\"_blank\">Visit our Website</a></div>";

                                    }

I'm thinking something needs to be added to this part of the action...

".$d['listing_url']."

Thanks in advance for your help and patience with someone just starting to learn PHP.

Jami

This topic has been closed for replies.

1 reply

Inspiring
June 19, 2012

No replies... :-(
I'm hoping someone has an idea.

Community Expert
June 19, 2012

Here's the thing with your proposal.  Regardless of what happens, the iframe will still show the URL and will still be visible with right-clicking -> viewing frame information or source.  If you just want to cover it up with something else then you will just increase the memory usage and script processing time to run a Switch->Case or If/ElseIf operation to test for each possible outcome.  But like I said, in order for the frame to work it needs the URL in the code, no way around it.

What I'm confused about is you say you went through 6,000 lines of code.  Is this part of a CMS or other application that you are trying to modify?  If so, have you consulted with that community as well to see if there is already a workaround for what you are looking to do?

Only other solution I can think of is to find an alternate to the frame service.  You mention products so I'm going to assume a store, and the most notorious store for frames is the A-Store from Amazon. In which case I will say that I have seen plenty of posts for workarounds but nothing concrete that I can recommend as a solution for it.  Only solution there is to complain to Amazon for a better way to integrate.

Participant
June 20, 2012

Basically Dreamviewer is used for making a website in php and it is also a server of php, we can design or coding in this software.