PHP与其他域通信
这个PHP文件正在工作,但现在我需要一个帮助一个理解的想法。 域A和域B位于不同的服务器中。 现在这个index.php位于域A中。我希望下面的代码为域B生成一个链接,并注册一个域,以便它可以重定向。 可能吗PHP与其他域通信,php,Php,这个PHP文件正在工作,但现在我需要一个帮助一个理解的想法。 域A和域B位于不同的服务器中。 现在这个index.php位于域A中。我希望下面的代码为域B生成一个链接,并注册一个域,以便它可以重定向。 可能吗 <?php $new_link = ""; if(isset($_POST['submit'])) { if(isset($_POST['cid'],$_POST['gid'])) {
<?php
$new_link = "";
if(isset($_POST['submit']))
{
if(isset($_POST['cid'],$_POST['gid']))
{
$cid = $_POST['cid'];
$gid = $_POST['gid'];
$new_link = "www.something.com/".$cid.$gid;
// if your input is integer and you want to add them then use this
// $new_link = "www.something.com/".($cid+$gid);
}
}
?>
<form method="post" action="">
<h1 style="color:#0CF; font-family:Arial, Helvetica, sans-serif;">Enter ID 1:</h1>
<input type="text" value="" name ="cid" id="cid" />
<h1 style="color:#0CF; font-family:Arial, Helvetica, sans-serif;">Enter ID 2:</h1>
<input type="text" value="" name ="gid" id="gid"/>
<h1 style="color:#0CF; font-family:Arial, Helvetica, sans-serif;">Copy Your Link Here</h1>
<textarea style="width:500px; height:50px;"><?php echo $new_link;?></textarea><br /><br /><br />
<input type="submit" value="submit" name="submit" id="submit"/>
</form>
详细说明“注册域”。你的意思是进入一个域吗?在注册商处注册一个域通常需要一些时间,而不仅仅是查询url。如果你想链接到另一台服务器,这应该可以。@kennypu,用附属链接[domain B]创建子域,域B的生成器是[domain a]@CommuSoft,如何链接到服务器并使其能够创建子域。如果你真的想创建子域,这将比仅仅使用PHP要困难得多