简体   繁体   English

解决PHP中的任务,然后重定向到另一个PHP文件

[英]Solve tasks in PHP and then redirect to another PHP file

So im currently programming a register form, which passes variables with the entered informations to another php file through POST. 因此,我目前正在编程一个注册表,该表单将带有输入信息的变量通过POST传递到另一个php文件。 Well, im performing some checks in this PHP file and whould like to pass the variables after that to the next register form on another php site. 好吧,即时通讯在此PHP文件中执行一些检查,然后谁想将变量传递给另一个php网站上的下一个注册表单。

Is this somehow possible ? 这可能吗?

I will be thankfull for every answer i get! 我将为我收到的每一个答案表示感谢!

-english is not my main language. -英语不是我的主要语言。

You can send informtaion using cURL 您可以使用cURL发送信息

Code example from http://davidwalsh.name/curl-post //extract data from the post extract($_POST); 来自http://davidwalsh.name/curl-post //的代码示例//从帖子提取中提取数据($ _POST);

//set POST variables
$url = 'http://domain.com/get-post.php';
$fields = array(
                        'lname' => urlencode($last_name),
                        'fname' => urlencode($first_name),
                        'title' => urlencode($title),
                        'company' => urlencode($institution),
                        'age' => urlencode($age),
                        'email' => urlencode($email),
                        'phone' => urlencode($phone)
                );

//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);

//execute post
$result = curl_exec($ch);

//close connection
curl_close($ch);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM