ID:               22564
 User updated by:  msanders at primary dot net
 Reported By:      msanders at primary dot net
-Status:           Feedback
+Status:           Open
 Bug Type:         Unknown/Other Function
 Operating System: Windows NT 5.0 build 2195
 PHP Version:      4.2.3
 New Comment:

PHP is running as CGI on both machines. These are production servers
and no problem like this ever occured in our development our the first
production deployment. We have attempted to install 4.3.1 on our
development environment, but we ran into problems with include files. 

Here is the source in question
<?
        $WEB_ROOT = substr(ereg_replace("[\x5c\]"."[\x5c\]","\x5c",
$HTTP_SERVER_VARS['PATH_TRANSLATED']), 0 , -strlen(
$HTTP_SERVER_VARS['SCRIPT_NAME']));
        include($WEB_ROOT."/includes/appHeader.php");
        include($WEB_ROOT."/includes/clsDomain.php");
        global $FORMDATA;
        global $oConnStr;
        
        //echo $FORMDATA;
        
        
        if(getenv('REQUEST_METHOD')=='POST'){
                $accountID = trim($HTTP_POST_VARS['account_id']);
                $domain_name = trim($HTTP_POST_VARS['domain_name']);
                $customerID = trim($HTTP_POST_VARS['customerid']);
                $action =  trim($HTTP_POST_VARS['action']);
                $org = trim($HTTP_POST_VARS['org']);
                $admin = trim($HTTP_POST_VARS['admin']);
                $billing = trim($HTTP_POST_VARS['billing']);
                $tech = trim($HTTP_POST_VARS['tech']);
        }
        else
        {
                $accountID = trim($HTTP_GET_VARS['account_id']);
                $domain_name = trim($HTTP_GET_VARS['domain_name']);
                $customerID = trim($HTTP_GET_VARS['customerid']);
                $action =  trim($HTTP_GET_VARS['action']);
                $org = trim($HTTP_GET_VARS['org']);
                $admin = trim($HTTP_GET_VARS['admin']);
                $billing = trim($HTTP_GET_VARS['billing']);
                $tech = trim($HTTP_GET_VARS['tech']);
        }
        
        if ($action == "Billing"){
                header("Location:
inww_contact_form.php?clientid=".$objSession->clientid."&customerid=".$customerID."&account_id=".$accountID."&domain_name=".$domain_name."&org=".$org."&admin=".$admin."&billing=".$billing."&tech=".$tech."&action=Billing");
                exit();
        }
        if ($action == "Tech"){
                header("Location:
inww_contact_form.php?clientid=".$objSession->clientid."&customerid=".$customerID."&account_id=".$accountID."&domain_name=".$domain_name."&org=".$org."&admin=".$admin."&billing=".$billing."&tech=".$tech."&action=Tech");
                exit();
        }
        
        if($action == "Admin"){
                $newURL =
"inww_contact_form.php?clientid=".$objSession->clientid."&customerid=".$customerID."&account_id=".$accountID."&domain_name=".$domain_name."&org=".$org."&admin=".$admin."&billing=".$billing."&tech=".$tech."&action=Admin";
                $shadowURL =
"inww_signup.php?clientid=".$objSession->clientid."&customerid=".$customerID."&account_id=".$accountID."&domain_name=".$domain_name."&org=".$org."&admin=".$org."&billing=".$billing."&tech=".$tech."&action=Billing";
                ?>
                        <link rel="stylesheet" href="/general.css" type="text/css">
                        <a href="<?=$shadowURL?>">Use Org Contact for Admin 
Contact</a><br>
                        <a href="<?=$newURL?>">Enter New Contact for Admin Contact</a>
                <?
                exit;
        }
        
        if($action === "start"){
                //Find any existing contacts
                $sql = "SELECT * FROM domain_contact_tbl WHERE domain_contact_id ".
                                "IN(SELECT org_contact_id FROM domain_registration 
WHERE domain_id
".
                                        "IN(SELECT domain_id FROM domain_tbl WHERE 
account_id ".
                                                "IN(SELECT account_id FROM account_tbl 
WHERE
customerId=".$customerID.
                                                " AND account_status_id IN(1,2))".
                                        ")".
                                ")";
                
                $oConn = new Connection();
                $oRS = new Recordset();
        
                $oConn->Open($oConnStr);
                $rs = $oRS->Open($sql, $oConn);
                if(!$oRS->eof){
                        $prevContacts = true;
                        //echo "Previous Contacts";
                }
                else{
                        $prevContacts = false;
                        //echo "No previous contacts";
                }
                $oRS->Close();
                
                                
                if($prevContacts){
                        header("Location:
inww_contact_form.php?clientid=".$objSession->clientid."&customerid=".$customerID."&account_id=".$accountID."&domain_name=".$domain_name."&org=".$org."&admin=".$admin."&billing=".$billing."&tech=".$tech."&action=Org");
                }
                else{
                        header("Location:
inww_contact_form.php?clientid=".$objSession->clientid."&customerid=".$customerID."&account_id=".$accountID."&domain_name=".$domain_name."&org=".$org."&admin=".$admin."&billing=".$billing."&tech=".$tech."&action=Org");
                }
                exit();
        }
        if($action == "Namesrv"){
                $namesrv1 = "ns1.telstra.com.au";
                $namesrv2 = "ns2.zip.com.au";
                ?>
                <title>Domain Registration Form</title>
                <link rel="stylesheet" href="/general.css" type="text/css">
                <style>
                        .error {font-size: 12pt;
                                        text-transform: none;}
                
                        THEAD   {text-decoration: underline;
                                         font-weight: bold;}
                </style>
                </head>
                
                <body BGCOLOR="#FFFFFF">
                <p class="title">Enter Nameservers and Expiration for
<?=$domain_name?></p>
                <form method="POST" action="inww_signup.php" name="Nameservers">
                <INPUT TYPE="hidden" NAME="clientid"
VALUE="<?=$objSession->clientid?>">
                <INPUT TYPE="hidden" NAME="account_id" VALUE="<?=$accountID?>">
                <INPUT TYPE="hidden" NAME="customerid" VALUE="<?=$customerID?>">
                <input type="hidden" name="domain_name" value="<?=$domain_name?>">
                <input type="hidden" name="org" value="<?=$org?>">
                <input type="hidden" name="admin" value="<?=$admin?>">
                <input type="hidden" name="billing" value="<?=$billing?>">
                <input type="hidden" name="tech" value="<?=$tech?>">
                <input type="hidden" name="action" value="Save">
                <table cellpadding="2" cellspacing="2">
                <tr>
                        <td>Number of Years to Register</td>
                        <td>
                                <select name="numYears" size=1>
                                        <option value=1>One Year</option>
                                        <option value=2>Two Years</option>
                                        <option value=5>Five Years</option>
                                        <option value=10>Ten Years</option>
                                </select>
                        </td>
                </tr>
                <tr>
                        <td>Nameserver 1</td>
                        <td><input type="text" name="namesrv1" 
value="<?=$namesrv1?>"></td>
                </tr>
                <tr>
                        <td>Nameserver 2</td>
                        <td><input type="text" name="namesrv2" 
value="<?=$namesrv2?>"></td>
                </tr>
                <tr>
                        <td>Nameserver 3</td>
                        <td><input type="text" name="namesrv3" value=""></td>
                </tr>
                <tr>
                        <td>Nameserver 4</td>
                        <td><input type="text" name="namesrv4" value=""></td>
                </tr>
                <tr>
                        <td colspan=2><input type="submit" value="Register 
Domain"></td>
                </tr>
                </table>
                
                <?
        }
        if($action == "Save"){
                list($domName, $topDom) = split("\.", $domain_name);
                
                $topCheck = false;
                
                if($topDom == "biz"){
                        $topCheck = true;
                }
                
                if($topDom == "info"){
                        $topCheck = true;
                }
                
                if($topDom == "us"){
                        $topCheck = true;
                }
                
                if($topDom == "cc"){
                        $topCheck = true;
                }
                
                if($topDom == "tv"){
                        $topCheck = true;
                }
                
                
                include_once($WEB_ROOT."/includes/inww/clsINWWDomain.php");
                if(getenv('REQUEST_METHOD')=='POST'){
                        $namesrv1 = trim($HTTP_POST_VARS['namesrv1']);
                        $namesrv2 = trim($HTTP_POST_VARS['namesrv2']);
                        $namesrv3 = trim($HTTP_POST_VARS['namesrv3']);
                        $namesrv4 = trim($HTTP_POST_VARS['namesrv4']);
                        $numYears = trim($HTTP_POST_VARS['numYears']);
                }
                else
                {
                        $namesrv1 = trim($HTTP_GET_VARS['namesrv1']);
                        $namesrv2 = trim($HTTP_GET_VARS['namesrv2']);
                        $namesrv3 = trim($HTTP_GET_VARS['namesrv3']);
                        $namesrv4 = trim($HTTP_GET_VARS['namesrv4']);
                        $numYears = trim($HTTP_GET_VARS['numYears']);
                }
                $oDomain = new INWWDomain();
                $oDomain->AccountID = $accountID;
                $oDomain->DomainName = $domain_name;
                $oDomain->Registrar = "INWW";
                $oDomain->Nameservers[0] = $namesrv1;
                
                if(trim($namesrv2) != ""){
                        $oDomain->Nameservers[1] = $namesrv2;
                }
                
                if(trim($namesrv3) != ""){
                        $oDomain->Nameservers[2] = $namesrv3;
                }
                
                if(trim($namesrv4) != ""){
                        $oDomain->Nameservers[3] = $namesrv4;
                }
                
                $oCont = new DomainContact();
                $oCont->DomainContactID = $org;
                $oCont->SelectContact();
                $oDomain->OrgContact = $oCont;
                
                $oCont = new DomainContact();
                $oCont->DomainContactID = $admin;
                $oCont->SelectContact();
                $oDomain->AdminContact = $oCont;
                
                $oCont = new DomainContact();
                $oCont->DomainContactID = $tech;
                $oCont->SelectContact();
                $oDomain->TechContact = $oCont;
                
                $oCont = new DomainContact();
                $oCont->DomainContactID = $billing;
                $oCont->SelectContact();
                $oDomain->BillingContact = $oCont;
                
                
                if($topCheck){
                        $oDomain->eInsertDomain();
                        $srvName = "http://".getenv("HTTP_HOST"); 
                                
                        header("Location:
".$srvName."/cust_tools/show_account.asp?clientid=".$objSession->clientid."&account_id=".$accountID."&vtime=".time());
                        exit;
                }
                else{
                        if($oDomain->INWWRegisterDomain($numYears)){
                                $oDomain->eInsertDomain();
                                $srvName = "http://".getenv("HTTP_HOST"); 
                                
                                header("Location:
".$srvName."/cust_tools/show_account.asp?clientid=".$objSession->clientid."&account_id=".$accountID."&vtime=".time());
                                exit;
                        }
                        else{
                                echo "<br>Error with INWW Registration";
                        }
                        exit;
                }
                exit();
                //echo
"<hr>".$oDomain->INWWRegistryKey."<br>".$oDomain->Expires;                             
 
        }
?>


Previous Comments:
------------------------------------------------------------------------

[2003-03-06 11:12:08] [EMAIL PROTECTED]

1) What is the exact text of your script? (Copy and Paste or provide
URL to .phps, do *NOT* summarize or othewise reduce the content)

2) Are you running PHP as a CGI or as an ISAPI dll?

3) Is there anyway you can try using 4.3.1 or (better yet) a snapshot? 
If you can't permanently put 4.3.1 on the server in question for some
reason, could you at least try running it there temporarily to see if
it makes a difference?

------------------------------------------------------------------------

[2003-03-05 23:31:12] msanders at primary dot net

This is a very unusual problem we are having with the header(Location:
urlinfo) function. On one system we are getting this error "CGI Error
The specified CGI application misbehaved by not returning a complete
set of HTTP headers. The headers it did return are". If we refresh the
page a couple of times the desired redirected page is displayed. On
another system we are not having any problems. The page gets redirected
immediately. The other system is also Windows NT 5.0 build 2195. It is
also PHP version 4.2.3. The only difference on the PHP configurations
between the two boxes is php is installed on the d drive while the
other is installed on the c drive. On both machines the websites lives
on the d drive. I cannot find any IIS configuration differences between
the two machines. I have rebooted the machine that is having the
problems to see if I am getting cached pages. However this did not
help. Also both machines are using only php_curl and php_mssql
extensions. I am pretty sure that this is a configuration problem,
however I cannot see any differences in either IIS or PHP configuration
between these two machines other than where php is installed.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=22564&edit=1

Reply via email to