I am creating a real estate site and on the navigation tab it reads "search for your property"

When you click it opens to my search page with all my contact info. I have an address the mls search group provided, but I want to have it open when my page opens, so my customers don't have to click the page again to see it. Can anyone help me do this? Directions would have to be VERY simple:)

Dani AI

Generated

asked for the MLS search to appear as soon as the "search for your property" page opens; questioned the PHP angle. For this need, PHP is not required unless the MLS site must be proxied or pre-processed on the server. Three practical options follow (quick to apply, with trade-offs).

Embed with an iframe (simplest)

<iframe src="https://mls.example.com/search" style="width:100%;height:600px;border:0;"></iframe>

Note: many sites block being framed with X-Frame-Options or CSP frame-ancestors; the browser will refuse to show the page if those headers are present (see iframe element documentation and X-Frame-Options / frame-ancestors).

Open the MLS in a new tab on load (if framing is blocked)

<script>
window.addEventListener('load', function(){
  window.open('https://mls.example.com/search','_blank');
});
</script>

Caveat: some browsers or pop-up blockers may prevent automatic new tabs/windows (see Window.open).

Server-side proxy with PHP (when embedding is blocked and terms allow it)

<?php
$url = 'https://mls.example.com/search';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
echo curl_exec($ch);
curl_close($ch);
?>

Caution: proxying can break relative URLs, JavaScript, and may violate MLS terms — adjust links/assets and confirm permission.

Troubleshooting checklist: inspect the browser console for "Refused to display" messages, look for X-Frame-Options or CSP headers in network responses, and ensure protocol match (https). If embedding is not allowed, request an embeddable widget or API from the MLS provider.

Recommended Answers

All 2 Replies

Member Avatar for Member #46692

How is this related to php?

Which forum should it go in?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.