What are the potential pitfalls of using <IFRAME> in PHP code?

Using <IFRAME> in PHP code can potentially lead to security vulnerabilities such as cross-site scripting (XSS) attacks if the source of the <IFRAME> is not properly sanitized. To prevent this, always make sure to sanitize any user input before using it in the <IFRAME> source attribute.

&lt;?php
// Sanitize user input before using it in the &lt;IFRAME&gt; source attribute
$iframe_src = filter_var($_POST[&#039;iframe_src&#039;], FILTER_SANITIZE_URL);
?&gt;

&lt;iframe src=&quot;&lt;?php echo $iframe_src; ?&gt;&quot;&gt;&lt;/iframe&gt;