How to call a new page from a function not a form

A

Anonymous

Guest
If the action happens in the users browser, then you'll have to use javascript or ActionScript.
php is a server side language, so things happen only when you link that script in the server.
:)
 
You can use setTimeout

Code:
<script language="javascript">
function call_script(){
     document.location = "my_script.php?my_var1=blahblah&my_var2=blahblah";
}
</script>
</head>
<body onload="window.setTimeout('call_script();' , 1500 );">

After 1500 miliseconds the user got in this page, he will be redirected to my_script.php and all those URL vars will be interpreted by php as $HTTP_POST_VARS["my_var1"] and $HTTP_POST_VARS["my_var2"].

This is just an example, then you can pass arguments to the function so you can use for example a form to choose which vars you want to send, etc...

bye
:)
 
Back
Top