Online Shopping : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

11 of 20 people (55%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

Is is possible to redirect a User to another URL and send some variable with the post method?

Mar 15th, 2008 18:30
ha mo, TeraZen, Nicolas Lemay,


Yes it's possible! You must use "HIDDEN" input type in your form, and
use JavaScript so that on form load it will submit the form to the page
you want to redirect...
I've made an example;
<html>
<head><title>Submit form Test</title>
<script language="JavaScript">
function submitform()
{
	document.myform.submit();
}
</script>
</head>
<body onLoad="submitform()">
<form name="myform" action="http://www.domain.com/script.php">
<input type="hidden" name="myvar" value="somevalue">
</form> 
</body>
</html>
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.yamot.com
http://www.mozmar.com
http://www.templatestemp.com