I think you want something like this?
<?php
if(!empty($_POST['D1']) && !empty($_POST['T1'])){
$providers = array(
'google_drive' => 'https://drive.google.com/file/d/{replace}/view',
'clody' => 'https://www.cloudy.ec/embed.php?id={replace}'
);
if(isset($providers[$_POST['D1']])){
$url = str_replace('{replace}', $_POST['T1'], $providers[$_POST['D1']]);
echo "Your url is $url";
}
}
?>
<form method="POST" action=<?php ($_SERVER["PHP_SELF"]); ?>>
<p>chose url:
<select size="1" name="D1">
<option value="google_drive">google drive</option>
<option value="clody">clody</option>
</select>
<input type="text" name="T1" size="40" value="insert code">
<input type="submit" value="go" name="B1"><input type="reset" value="reset" name="B2">
</p>
</form>
5
solved Correction the code [closed]