D
D
dm2015-04-15 10:42:41
PHP
dm, 2015-04-15 10:42:41

How to make another page open after form submission?

After clicking on the "Send" button, you need to open another page. How to do it? Hang up an onclick with a function on the button. What is the function itself? I'm not strong in js.
PS Probably incorrectly explained. I meant that the data is sent where necessary, and then another page opens.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeny Petrov, 2015-04-15
@Chekhoved

To load the response from the server into the desired window after submitting the form, it has a target attribute .
Moreover, such an opportunity exists not only in the form, but even in the button in the form of the formtarget attribute .
The name of the window is specified as the target window — the name attribute . To open in a new window, specify the standard name _blank . The default value is _self .
In general, the level of questions and answers has become catastrophically low ...

T
The Dragger, 2015-04-15
@IPD2

if(isset($_POST['submit'])){
http_redirect('site.url')
}
php.net/manual/ru/function.http-redirect.php

<script language="JavaScript"> 
$('submit').click(function(){
  window.location.href = "my_url"
})
</script>

in php and js

A
arab789, 2015-04-15
@arab789

If in js then:
In general, you send data from the form to some script, and if you do this, you won’t know whether it worked correctly or not. In the script, after the correct response, you can make a redirect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question