从输入表单发送信息到iframe

So i have looked over quite a few post on here that all have check marks saying they got it to work and for some unknown reason i cant get it to function properly. Here is my code:

Page 1: (All this works fine the way it is besides sending the post to the iframe)

<iframe name="videoIframe" src="<?php echo $q . '/' . 'videos.php'?>" 
height="200px" width="740px" frameborder="0" scrolling="no" style="overflow: 
hidden;"></iframe>

<form action="<?php echo $q . '/' . 'videos.php' ?>" method="post" 
target="videoIframe">
<input type="text" name="ytlink" id="ytlink" placeholder="example: 
https://www.youtube.com/watch?v=zw3lkPIDWBo" required>
<input type="submit" value="submit" id="submit" method="post">
</form>

Page 2: (Iframe on parent page)

<?php
$_POST['ytlink'] = $YT;
$file_data = "<iframe class='ytvideos' src='" . $YT . "?controls=0' 
frameborder='0' allow='autoplay' allowfullscreen></iframe>" . "
"; 
file_get_contents('videos.txt'); 
file_put_contents('videos.txt', $file_data);
?>     

Can anyone see what im doing wrong here? Its driving me nuts, i have asked many questions on here that have been very helpfully answered or pointed me in the right direction but i really did check similar post on here and other sites. No solution check marked has worked for me yet. Hopefully you all can see something I am not seeing. (Security isn't important for this site at all so any method you know would be greatly appreciated. P.S: I have no backend database as of now.)

Hi just from a quick look, shouldn't $_POST['ytlink'] = $YT; be $YT= $_POST['ytlink'];. If I'm getting the wrong end of the stick just try debugging it one step at time, I find echoing the variables is a good way to start.