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

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Sun Dec 29, 2002 3:10 pm

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.
:)

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Sun Dec 29, 2002 4:53 pm

You can use setTimeout

Code: Select all

<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
:)

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests