0

在用户在我的网站上注册后,我正试图将用户重定向到 touchnet 的 upay 网站。所以这就是我的网站的样子:

Registration.php
     |This is where the user will register for an account along with providing their information
Insert.php
     |This is the script that will take all the data posted from `Registration.php`'s form and insert them into the database. But it is also the script that will send the user to the payment page
touchnet
     |This is the site that will receive the posted data from `Insert.php` and take care of payment. 

所以这是我的卷曲设置:

$url='https://secure.touchnet.com:*/Something/*/*.jsp';

//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, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, false);

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

//close connection
curl_close($ch);

但是,当插入完成插入数据并使用 curl 重定向时,它实际上会转到www.domain.com/Something/tapp,即www.domain.com我的网站。浏览器说/Something未找到,显然是因为它甚至没有转到正确的 url。为什么 cURL 无法重定向到正确的 url?

4

0 回答 0