0
I asked another question here on the forum about another subject that helped me a lot about this but the link opens in new page.
What I would like to do is to click on the Ubmit to open inside an iframe inside the page and if the field was not filled in receive a message (popup) stating that the field was not filled in..
<?php
if (isset($_REQUEST['txt_url'])) {
$link = 'http://' . $_REQUEST['txt_url'] . '.datatix.com.br';
header('Location: ' . $link);
}
?>
<div class="instancia">
<div class="content">
<img src="img/logo_datatix.jpg" height="32px">
<form action="" method="post">
<input type="text" name="txt_url" value="" placeholder="Digite sua Instância">
<input type="submit" value="Ok" name="ok "class="ok">
</form>
</div>
</div>
<div class="iframe">
<iframe id="conteudo_iframe"></iframe>
</div>
If possible not to use php would be much better.
It would be more or less what is in the code below, but the user does not put the whole domain only the subdomain.
Example: It puts "test" and "OK" but in iframe it would load the link test.dominio.com.br
body{ padding:0; margin:0;}
.instancia{ background-color:#D3172F; color:#FFF; font-family:Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif; width:100%; position:fixed; border-bottom:#9B1022 2px solid !important;}
.instancia .content{ width:320px; margin:0 auto; display:table;}
.instancia img{ float: left;}
.instancia input{ height:30px; padding-left:5px; padding-right:5px; width:176px; border:0; float: left;}
.instancia .ok{ border:0; background-color:#9B1022; height:32px; width:32px; color:#FFF; float:left; font-weight:bold; cursor:pointer;}
<div class="instancia">
<div class="content">
<img src="img/logo.jpg" height="32px">
<form action="" method="post">
<input type="text" name="txt_url" value="" placeholder="Digite sua Instância">
<input type="submit" value="Ok" name="ok "class="ok">
</form>
</div>
</div>
<div class="iframe">
<iframe name="exemplo" width="100%"></iframe>
</div>
But how do I play the php post on this link? .
– Rodrigo B. Silva
@Rodrigob.Silva modified the answer, the process for form and link is the same
– Pedro Sanção
<?php if (isset($_REQUEST['txt_url'])) { $link = 'http://' . $_REQUEST['txt_url'] . '.datatix.com.br'; header('<script type="text/javascript"> window.location.href =" . $link . '.datatix.com.br" ; </script>'); } ? > If I do so it does not load
– Rodrigo B. Silva
edited the question.
– Rodrigo B. Silva