After a PHP_SELF Form Is Submitted, how do I redirect to a new page? [duplicate]
This question already has an answer here:
How do I make a redirect in PHP?
27 answers
I have a page that submits a form like this;
<form name="getInfoForm" class="getInfoForm" action="<?PHP echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" target="" method="post" novalidate autocomplete="off" >
<input type="submit" name="submit" value="Submit" >
</form>
After the form is processed in the PHP part of the page, how can I redirect to a new page?
The PHP processes the form and submits the data to a MySQL table. I want to then go to a specific new page. How do I do that?
I can't find an answer in all the similar questions, or I don't understand it.
php html form-submit
marked as duplicate by deceze♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 5:54
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How do I make a redirect in PHP?
27 answers
I have a page that submits a form like this;
<form name="getInfoForm" class="getInfoForm" action="<?PHP echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" target="" method="post" novalidate autocomplete="off" >
<input type="submit" name="submit" value="Submit" >
</form>
After the form is processed in the PHP part of the page, how can I redirect to a new page?
The PHP processes the form and submits the data to a MySQL table. I want to then go to a specific new page. How do I do that?
I can't find an answer in all the similar questions, or I don't understand it.
php html form-submit
marked as duplicate by deceze♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 5:54
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I'm sorry guys, apparently I didn't explain this well enough. I understand about using HEADER but I don't know where to put it in my PHP. If I put it at the top of my code or the bottom it apparently launches immediately and takes me to the location specified. The PHP updates a MySQL table, so I need the redirect to happen after the successful INSERT INTO the table.
– Keith D Kaiser
Nov 15 '18 at 16:10
add a comment |
This question already has an answer here:
How do I make a redirect in PHP?
27 answers
I have a page that submits a form like this;
<form name="getInfoForm" class="getInfoForm" action="<?PHP echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" target="" method="post" novalidate autocomplete="off" >
<input type="submit" name="submit" value="Submit" >
</form>
After the form is processed in the PHP part of the page, how can I redirect to a new page?
The PHP processes the form and submits the data to a MySQL table. I want to then go to a specific new page. How do I do that?
I can't find an answer in all the similar questions, or I don't understand it.
php html form-submit
This question already has an answer here:
How do I make a redirect in PHP?
27 answers
I have a page that submits a form like this;
<form name="getInfoForm" class="getInfoForm" action="<?PHP echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" target="" method="post" novalidate autocomplete="off" >
<input type="submit" name="submit" value="Submit" >
</form>
After the form is processed in the PHP part of the page, how can I redirect to a new page?
The PHP processes the form and submits the data to a MySQL table. I want to then go to a specific new page. How do I do that?
I can't find an answer in all the similar questions, or I don't understand it.
This question already has an answer here:
How do I make a redirect in PHP?
27 answers
php html form-submit
php html form-submit
asked Nov 15 '18 at 5:06
Keith D KaiserKeith D Kaiser
3461320
3461320
marked as duplicate by deceze♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 5:54
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by deceze♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 5:54
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I'm sorry guys, apparently I didn't explain this well enough. I understand about using HEADER but I don't know where to put it in my PHP. If I put it at the top of my code or the bottom it apparently launches immediately and takes me to the location specified. The PHP updates a MySQL table, so I need the redirect to happen after the successful INSERT INTO the table.
– Keith D Kaiser
Nov 15 '18 at 16:10
add a comment |
I'm sorry guys, apparently I didn't explain this well enough. I understand about using HEADER but I don't know where to put it in my PHP. If I put it at the top of my code or the bottom it apparently launches immediately and takes me to the location specified. The PHP updates a MySQL table, so I need the redirect to happen after the successful INSERT INTO the table.
– Keith D Kaiser
Nov 15 '18 at 16:10
I'm sorry guys, apparently I didn't explain this well enough. I understand about using HEADER but I don't know where to put it in my PHP. If I put it at the top of my code or the bottom it apparently launches immediately and takes me to the location specified. The PHP updates a MySQL table, so I need the redirect to happen after the successful INSERT INTO the table.
– Keith D Kaiser
Nov 15 '18 at 16:10
I'm sorry guys, apparently I didn't explain this well enough. I understand about using HEADER but I don't know where to put it in my PHP. If I put it at the top of my code or the bottom it apparently launches immediately and takes me to the location specified. The PHP updates a MySQL table, so I need the redirect to happen after the successful INSERT INTO the table.
– Keith D Kaiser
Nov 15 '18 at 16:10
add a comment |
2 Answers
2
active
oldest
votes
You can redirect in PHP using the following:
header("location: yourpage.php")
Where "yourpage.php" is the name/path of the page you wish to redirect to.
It is worth referring to the PHP manual if you wish to learn more about the header function.
add a comment |
Do your redirect using header() function and also die() right after:
header("location: xxxx");
die();
Read more about why you need die() in this answer
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can redirect in PHP using the following:
header("location: yourpage.php")
Where "yourpage.php" is the name/path of the page you wish to redirect to.
It is worth referring to the PHP manual if you wish to learn more about the header function.
add a comment |
You can redirect in PHP using the following:
header("location: yourpage.php")
Where "yourpage.php" is the name/path of the page you wish to redirect to.
It is worth referring to the PHP manual if you wish to learn more about the header function.
add a comment |
You can redirect in PHP using the following:
header("location: yourpage.php")
Where "yourpage.php" is the name/path of the page you wish to redirect to.
It is worth referring to the PHP manual if you wish to learn more about the header function.
You can redirect in PHP using the following:
header("location: yourpage.php")
Where "yourpage.php" is the name/path of the page you wish to redirect to.
It is worth referring to the PHP manual if you wish to learn more about the header function.
edited Nov 15 '18 at 5:21
answered Nov 15 '18 at 5:15
PrinsPrins
2274
2274
add a comment |
add a comment |
Do your redirect using header() function and also die() right after:
header("location: xxxx");
die();
Read more about why you need die() in this answer
add a comment |
Do your redirect using header() function and also die() right after:
header("location: xxxx");
die();
Read more about why you need die() in this answer
add a comment |
Do your redirect using header() function and also die() right after:
header("location: xxxx");
die();
Read more about why you need die() in this answer
Do your redirect using header() function and also die() right after:
header("location: xxxx");
die();
Read more about why you need die() in this answer
answered Nov 15 '18 at 5:31
Jose FloridoJose Florido
11519
11519
add a comment |
add a comment |
I'm sorry guys, apparently I didn't explain this well enough. I understand about using HEADER but I don't know where to put it in my PHP. If I put it at the top of my code or the bottom it apparently launches immediately and takes me to the location specified. The PHP updates a MySQL table, so I need the redirect to happen after the successful INSERT INTO the table.
– Keith D Kaiser
Nov 15 '18 at 16:10