process two actions

Hi, im trying to create a site for this artistic web project idea I had but for it I neeed the form to be sent to two different web pages. I understand how to make the form. And from what I have learned so far the forms action tag needs to go to a php page to run a script. And that code would perform the action that would cause two separate pages to open in the background. Maybe this is not possible I am not sure. Below would be an example of the form.

happy sad

and so everything is sent to the art.php but after that I do not know what to do to make it display on the two different web pages. I’ve looked all over and its always possible I overlooked how to do this, but I was unable to find the relevant info
If there is a way to do this any help would be appreciated, thank you

I would think that using the PHP SESSIONS would do what you are looking for. If the form has not been filled out then it will be displayed… otherwise the art.php script will be executed.

Be sure to add the session_start(); to each of your PHP pages (at the top).

Then on subsequent pages all you need to do is call the defined variable… ($_SESSION_Happy and $_SESSION_Sad) to get that data/info.

<?php session_start(); if($_POST['submit'] == "Submit") { $_SESSION_Happy = $_POST['happy']; $_SESSION_Sad = $_POST['sad']; } ?> happy sad

Hope this helps.

you can do it with javascript ,
onsubmit this form with javascript(jQuery) you can send a post request to another page also , or you can send both of post requests from javascript ,

$('#form').submit(function(){
$.post('art.php',$('#form').serialize(),function(response){
//this is callback function with response , you can remove it
});
});

you can run this code to art.php and another page you want …

Sponsor our Newsletter | Privacy Policy | Terms of Service