Help with changing form action dynamically
Posted: Thu Oct 11, 2012 5:49 pm
Hi,
I am new to php coding and I am trying to do a small change to an existing piece of code. I am unable to figure out the way to do it.
Problem statement : based on the get variable (received from wordpress form); I need to change the form action of the php file.
if $_GET["topic1"] = "abc" then user has to be redirected to page - http://ourdomain.com/thankyou/\" after information processing; else if $_GET["topic1"] != "abc" then the form action should be 'https://secure.url.net/folder/web/index.jsp'
*************** Existing code **************
<html>
<body onLoad="document.tpgpayment.submit()">
<form id = 'myform' name= 'myform' action='https://secure.url.net/folder/web/index.jsp' method = 'post'>
<?
include '/var/www/config/dbconfig.php';
$tPassData = "";
$i = 0;
<--- business logic written in php -->
?>
</form>
</html>
************** End of Code *******************
Any ideas or suggestions will be of a great help.
Thanks!
phpLearner
I am new to php coding and I am trying to do a small change to an existing piece of code. I am unable to figure out the way to do it.
Problem statement : based on the get variable (received from wordpress form); I need to change the form action of the php file.
if $_GET["topic1"] = "abc" then user has to be redirected to page - http://ourdomain.com/thankyou/\" after information processing; else if $_GET["topic1"] != "abc" then the form action should be 'https://secure.url.net/folder/web/index.jsp'
*************** Existing code **************
<html>
<body onLoad="document.tpgpayment.submit()">
<form id = 'myform' name= 'myform' action='https://secure.url.net/folder/web/index.jsp' method = 'post'>
<?
include '/var/www/config/dbconfig.php';
$tPassData = "";
$i = 0;
<--- business logic written in php -->
?>
</form>
</html>
************** End of Code *******************
Any ideas or suggestions will be of a great help.
Thanks!
phpLearner