一个PHP脚本,它从表单接收POST信息,接收它们,添加它们并传递它们

A fairly basic question, I'm looking to know which is the proper way of doing it.

I can create an html form where the user can put his/her input and then passes them (action=http://...) into a php script.

I can create a php script that receives these data and stores them as variables:

..
$name = $_POST['name'];
$email = $_POST['email'];
..

Now, I wanna take these variables (plus some more pre-defined in this very script) and automatically "post" these fields into different address that would further handle them. (by "post", I mean the exact same way the html form "posted" these fields into this script to begin with)

To make it a little clearer: this problem wouldn't exist if I were to include all the need values as hidden fields in the script and asked the user to click "submit", I'm basically looking for a way to make the typical (html => form => fields => Post) happen automatically.

Your help is very appreciated.

You could store them in a session and access them later. That way the user isn't able to see the values, like they would if you used hidden fields.

Declare them like this:

<?php

session_start(); //START THE SESSION

$_SESSION['name'] = $_POST['name'];
$_SESSION['email'] = $_POST['email'];

?>

Then whenever you want to access them, on any script, use $_SESSION['name'] or $_SESSION['email']. BUT you always have to declare session_start(); on every page/script you want to access them on.

Read up on PHP sessions here: The PHP Manual