2015-01-20 7 views
0

나는 등록 양식을 작성하고 그것을 내 유일한 문제를 작동 제출을 클릭하면 내가 URL에 게시 정보를 숨길 수 있기를 원하는하고 검증이이없음 새로 고침 등록 양식

등록을하지 못합니다. php? action = signup

거기에 mod 재 작성이 있습니까? URL은? 액션 = 가입

하지만

PHP 코드 등록 페이지

을 위해 아무것도

함께했다 어디로 나는 모든 검색 한을 제거

register.php

남아 그래서

     <?php 
        //Error reporting @1-8F636958 
        error_reporting(E_ALL | E_STRICT); 
        //End Error reporting 

        //Include Common Files @1-EDC1CE42 
        define("RelativePath", "."); 
        define("PathToCurrentPage", "/"); 
        define("FileName", "NewPage1.php"); 
        include_once(RelativePath . "/Common.php"); 
        include_once(RelativePath . "/Template.php"); 
        include_once(RelativePath . "/Sorter.php"); 
        include_once(RelativePath . "/Navigator.php"); 
        //End Include Common Files 

        class clsRecordusers { //users Class @2-9BE1AF6F 

        //Variables @2-9E315808 

         // Public variables 
         public $ComponentType = "Record"; 
         public $ComponentName; 
         public $Parent; 
         public $HTMLFormAction; 
         public $PressedButton; 
         public $Errors; 
         public $ErrorBlock; 
         public $FormSubmitted; 
         public $FormEnctype; 
         public $Visible; 
         public $IsEmpty; 

         public $CCSEvents = ""; 
         public $CCSEventResult; 

         public $RelativePath = ""; 

         public $InsertAllowed = false; 
         public $UpdateAllowed = false; 
         public $DeleteAllowed = false; 
         public $ReadAllowed = false; 
         public $EditMode  = false; 
         public $ds; 
         public $DataSource; 
         public $ValidatingControls; 
         public $Controls; 
         public $Attributes; 

         // Class variables 
        //End Variables 

        //Class_Initialize Event @2-627C035C 
         function clsRecordusers($RelativePath, & $Parent) 
         { 

          global $FileName; 
          global $CCSLocales; 
          global $DefaultDateFormat; 
          $this->Visible = true; 
          $this->Parent = & $Parent; 
          $this->RelativePath = $RelativePath; 
          $this->Errors = new clsErrors(); 
          $this->ErrorBlock = "Record users/Error"; 
          $this->DataSource = new clsusersDataSource($this); 
          $this->ds = & $this->DataSource; 
          $this->InsertAllowed = true; 
          if($this->Visible) 
          { 
           $this->ComponentName = "users"; 
           $this->Attributes = new clsAttributes($this->ComponentName . ":"); 
           $CCSForm = explode(":", CCGetFromGet("ccsForm", ""), 2); 
           if(sizeof($CCSForm) == 1) 
            $CCSForm[1] = ""; 
           list($FormName, $FormMethod) = $CCSForm; 
           $this->EditMode = ($FormMethod == "Edit"); 
           $this->FormEnctype = "application/x-www-form-urlencoded"; 
           $this->FormSubmitted = ($FormName == $this->ComponentName); 
           $Method = $this->FormSubmitted ? ccsPost : ccsGet; 
           $this->btn_register = new clsButton("btn_register", $Method, $this); 
           $this->username = new clsControl(ccsTextBox, "username", "Soldier", ccsText, "", CCGetRequestParam("username", $Method, NULL), $this); 
           $this->username->Required = true; 
           $this->user_email = new clsControl(ccsTextBox, "user_email", "User Email", ccsText, "", CCGetRequestParam("user_email", $Method, NULL), $this); 
           $this->user_email->Required = true; 
           $this->user_birthdate = new clsControl(ccsTextBox, "user_birthdate", "User Birthdate", ccsText, "", CCGetRequestParam("user_birthdate", $Method, NULL), $this); 
           $this->user_birthdate->Required = true; 
          } 
         } 
        //End Class_Initialize Event 

        //Initialize Method @2-052CBF13 
         function Initialize() 
         { 

          if(!$this->Visible) 
           return; 

          $this->DataSource->Parameters["urluid"] = CCGetFromGet("uid", NULL); 
         } 
        //End Initialize Method 

        //Validate Method @2-B7C6592D 
         function Validate() 
         { 
          global $CCSLocales; 
          $Validation = true; 
          $Where = ""; 
          $Validation = ($this->username->Validate() && $Validation); 
          $Validation = ($this->user_email->Validate() && $Validation); 
          $Validation = ($this->user_birthdate->Validate() && $Validation); 
          $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this); 
          $Validation = $Validation && ($this->username->Errors->Count() == 0); 
          $Validation = $Validation && ($this->user_email->Errors->Count() == 0); 
          $Validation = $Validation && ($this->user_birthdate->Errors->Count() == 0); 
          return (($this->Errors->Count() == 0) && $Validation); 
         } 
        //End Validate Method 

        //CheckErrors Method @2-E8847328 
         function CheckErrors() 
         { 
          $errors = false; 
          $errors = ($errors || $this->username->Errors->Count()); 
          $errors = ($errors || $this->user_email->Errors->Count()); 
          $errors = ($errors || $this->user_birthdate->Errors->Count()); 
          $errors = ($errors || $this->Errors->Count()); 
          $errors = ($errors || $this->DataSource->Errors->Count()); 
          return $errors; 
         } 
        //End CheckErrors Method 

        //Operation Method @2-6BA9892D 
         function Operation() 
         { 
          if(!$this->Visible) 
           return; 

          global $Redirect; 
          global $FileName; 

          $this->DataSource->Prepare(); 
          if(!$this->FormSubmitted) { 
           $this->EditMode = $this->DataSource->AllParametersSet; 
           return; 
          } 

          if($this->FormSubmitted) { 
           $this->PressedButton = "btn_register"; 
           if($this->btn_register->Pressed) { 
            $this->PressedButton = "btn_register"; 
           } 
          } 
          $Redirect = $FileName . "?" . CCGetQueryString("QueryString", array("ccsForm")); 
          if($this->Validate()) { 
           if($this->PressedButton == "btn_register") { 
            if(!CCGetEvent($this->btn_register->CCSEvents, "OnClick", $this->btn_register) || !$this->InsertRow()) { 
             $Redirect = ""; 
            } 
           } 
          } else { 
           $Redirect = ""; 
          } 
          if ($Redirect) 
           $this->DataSource->close(); 
         } 
        //End Operation Method 

        //InsertRow Method @2-C62BC29D 
         function InsertRow() 
         { 
          $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this); 
          if(!$this->InsertAllowed) return false; 
          $this->DataSource->username->SetValue($this->username->GetValue(true)); 
          $this->DataSource->user_email->SetValue($this->user_email->GetValue(true)); 
          $this->DataSource->user_birthdate->SetValue($this->user_birthdate->GetValue(true)); 
          $this->DataSource->Insert(); 
          $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this); 
          return (!$this->CheckErrors()); 
         } 
        //End InsertRow Method 

        //Show Method @2-AE9867B3 
         function Show() 
         { 
          global $CCSUseAmp; 
          $Tpl = CCGetTemplate($this); 
          global $FileName; 
          global $CCSLocales; 
          $Error = ""; 

          if(!$this->Visible) 
           return; 

          $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this); 


          $RecordBlock = "Record " . $this->ComponentName; 
          $ParentPath = $Tpl->block_path; 
          $Tpl->block_path = $ParentPath . "/" . $RecordBlock; 
          $this->EditMode = $this->EditMode && $this->ReadAllowed; 
          if($this->EditMode) { 
           if($this->DataSource->Errors->Count()){ 
            $this->Errors->AddErrors($this->DataSource->Errors); 
            $this->DataSource->Errors->clear(); 
           } 
           $this->DataSource->Open(); 
           if($this->DataSource->Errors->Count() == 0 && $this->DataSource->next_record()) { 
            $this->DataSource->SetValues(); 
            if(!$this->FormSubmitted){ 
             $this->username->SetValue($this->DataSource->username->GetValue()); 
             $this->user_email->SetValue($this->DataSource->user_email->GetValue()); 
             $this->user_birthdate->SetValue($this->DataSource->user_birthdate->GetValue()); 
            } 
           } else { 
            $this->EditMode = false; 
           } 
          } 

          if($this->FormSubmitted || $this->CheckErrors()) { 
           $Error = ""; 
           $Error = ComposeStrings($Error, $this->username->Errors->ToString()); 
           $Error = ComposeStrings($Error, $this->user_email->Errors->ToString()); 
           $Error = ComposeStrings($Error, $this->user_birthdate->Errors->ToString()); 
           $Error = ComposeStrings($Error, $this->Errors->ToString()); 
           $Error = ComposeStrings($Error, $this->DataSource->Errors->ToString()); 
           $Tpl->SetVar("Error", $Error); 
           $Tpl->Parse("Error", false); 
          } 
          $CCSForm = $this->EditMode ? $this->ComponentName . ":" . "Edit" : $this->ComponentName; 
          $this->HTMLFormAction = $FileName . "?" . CCAddParam(CCGetQueryString("QueryString", ""), "ccsForm", $CCSForm); 
          $Tpl->SetVar("Action", !$CCSUseAmp ? $this->HTMLFormAction : str_replace("&", "&amp;", $this->HTMLFormAction)); 
          $Tpl->SetVar("HTMLFormName", $this->ComponentName); 
          $Tpl->SetVar("HTMLFormEnctype", $this->FormEnctype); 
          $this->btn_register->Visible = !$this->EditMode && $this->InsertAllowed; 

          $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this); 
          $this->Attributes->Show(); 
          if(!$this->Visible) { 
           $Tpl->block_path = $ParentPath; 
           return; 
          } 

          $this->btn_register->Show(); 
          $this->username->Show(); 
          $this->user_email->Show(); 
          $this->user_birthdate->Show(); 
          $Tpl->parse(); 
          $Tpl->block_path = $ParentPath; 
          $this->DataSource->close(); 
         } 
        //End Show Method 

        } //End users Class @2-FCB6E20C 

        class clsusersDataSource extends clsDBlocalhost { //usersDataSource Class @2-5EDEDCFF 

        //DataSource Variables @2-8A9D7D42 
         public $Parent = ""; 
         public $CCSEvents = ""; 
         public $CCSEventResult; 
         public $ErrorBlock; 
         public $CmdExecution; 

         public $InsertParameters; 
         public $wp; 
         public $AllParametersSet; 

         public $InsertFields = array(); 

         // Datasource fields 
         public $username; 
         public $user_email; 
         public $user_birthdate; 
        //End DataSource Variables 

        //DataSourceClass_Initialize Event @2-56B8B1F7 
         function clsusersDataSource(& $Parent) 
         { 
          $this->Parent = & $Parent; 
          $this->ErrorBlock = "Record users/Error"; 
          $this->Initialize(); 
          $this->username = new clsField("username", ccsText, ""); 

          $this->user_email = new clsField("user_email", ccsText, ""); 

          $this->user_birthdate = new clsField("user_birthdate", ccsText, ""); 


          $this->InsertFields["soldier"] = array("Name" => "soldier", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1); 
          $this->InsertFields["user_email"] = array("Name" => "user_email", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1); 
          $this->InsertFields["user_birthdate"] = array("Name" => "user_birthdate", "Value" => "", "DataType" => ccsText, "OmitIfEmpty" => 1); 
         } 
        //End DataSourceClass_Initialize Event 

        //Prepare Method @2-DC2F5FB8 
         function Prepare() 
         { 
          global $CCSLocales; 
          global $DefaultDateFormat; 
          $this->wp = new clsSQLParameters($this->ErrorBlock); 
          $this->wp->AddParameter("1", "urluid", ccsInteger, "", "", $this->Parameters["urluid"], "", false); 
          $this->AllParametersSet = $this->wp->AllParamsSet(); 
          $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "uid", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false); 
          $this->Where = 
           $this->wp->Criterion[1]; 
         } 
        //End Prepare Method 

        //Open Method @2-B071412E 
         function Open() 
         { 
          $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); 
          $this->SQL = "SELECT * \n\n" . 
          "FROM users {SQL_Where} {SQL_OrderBy}"; 
          $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent); 
          $this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order)); 
          $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent); 
         } 
        //End Open Method 

        //SetValues Method @2-1C83BB75 
         function SetValues() 
         { 
          $this->username->SetDBValue($this->f("soldier")); 
          $this->user_email->SetDBValue($this->f("user_email")); 
          $this->user_birthdate->SetDBValue($this->f("user_birthdate")); 
         } 
        //End SetValues Method 

        //Insert Method @2-D2F97CD9 
         function Insert() 
         { 
          global $CCSLocales; 
          global $DefaultDateFormat; 
          $this->CmdExecution = true; 
          $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent); 
          $this->InsertFields["soldier"]["Value"] = $this->username->GetDBValue(true); 
          $this->InsertFields["user_email"]["Value"] = $this->user_email->GetDBValue(true); 
          $this->InsertFields["user_birthdate"]["Value"] = $this->user_birthdate->GetDBValue(true); 
          $this->SQL = CCBuildInsert("users", $this->InsertFields, $this); 
          $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteInsert", $this->Parent); 
          if($this->Errors->Count() == 0 && $this->CmdExecution) { 
           $this->query($this->SQL); 
           $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteInsert", $this->Parent); 
          } 
         } 
        //End Insert Method 

        } //End usersDataSource Class @2-FCB6E20C 

        //Initialize Page @1-2A4101A9 
        // Variables 
        $FileName = ""; 
        $Redirect = ""; 
        $Tpl = ""; 
        $TemplateFileName = ""; 
        $BlockToParse = ""; 
        $ComponentName = ""; 
        $Attributes = ""; 

        // Events; 
        $CCSEvents = ""; 
        $CCSEventResult = ""; 
        $TemplateSource = ""; 

        $FileName = FileName; 
        $Redirect = ""; 
        $TemplateFileName = "NewPage1.html"; 
        $BlockToParse = "main"; 
        $TemplateEncoding = "UTF-8"; 
        $ContentType = "text/html"; 
        $PathToRoot = "./"; 
        $PathToRootOpt = ""; 
        $Scripts = "|"; 
        $Charset = $Charset ? $Charset : "utf-8"; 
        //End Initialize Page 

        //Before Initialize @1-E870CEBC 
        $CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage); 
        //End Before Initialize 

        //Initialize Objects @1-1F103AC9 
        $DBlocalhost = new clsDBlocalhost(); 
        $MainPage->Connections["localhost"] = & $DBlocalhost; 
        $Attributes = new clsAttributes("page:"); 
        $Attributes->SetValue("pathToRoot", $PathToRoot); 
        $MainPage->Attributes = & $Attributes; 

        // Controls 
        $users = new clsRecordusers("", $MainPage); 
        $MainPage->users = & $users; 
        $users->Initialize(); 
        $ScriptIncludes = ""; 
        $SList = explode("|", $Scripts); 
        foreach ($SList as $Script) { 
         if ($Script != "") $ScriptIncludes = $ScriptIncludes . "<script src=\"" . $PathToRoot . $Script . "\" type=\"text/javascript\"></script>\n"; 
        } 
        $Attributes->SetValue("scriptIncludes", $ScriptIncludes); 

        $CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage); 

        if ($Charset) { 
         header("Content-Type: " . $ContentType . "; charset=" . $Charset); 
        } else { 
         header("Content-Type: " . $ContentType); 
        } 
        //End Initialize Objects 

        //Initialize HTML Template @1-28F2FDD6 
        $CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage); 
        $Tpl = new clsTemplate($FileEncoding, $TemplateEncoding); 
        if (strlen($TemplateSource)) { 
         $Tpl->LoadTemplateFromStr($TemplateSource, $BlockToParse, "UTF-8"); 
        } else { 
         $Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "UTF-8"); 
        } 
        $Tpl->SetVar("CCS_PathToRoot", $PathToRoot); 
        $Tpl->block_path = "/$BlockToParse"; 
        $CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage); 
        $Attributes->SetValue("pathToRoot", ""); 
        $Attributes->Show(); 
        //End Initialize HTML Template 

        //Execute Components @1-0C9864E9 
        $users->Operation(); 
        //End Execute Components 

        //Go to destination page @1-810C207B 
        if($Redirect) 
        { 
         $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage); 
         $DBlocalhost->close(); 
         header("Location: " . $Redirect); 
         unset($users); 
         unset($Tpl); 
         exit; 
        } 
        //End Go to destination page 

        //Show Page @1-E3A8594F 
        $users->Show(); 
        $Tpl->block_path = ""; 
        $Tpl->Parse($BlockToParse, false); 
        if (!isset($main_block)) $main_block = $Tpl->GetVar($BlockToParse); 
        $main_block = CCConvertEncoding($main_block, $FileEncoding,    $TemplateEncoding); 
        $CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage); 
        if ($CCSEventResult) echo $main_block; 
        //End Show Page 

        //Unload Page @1-4215F8E1 
        $CCSEventResult = CCGetEvent ($CCSEvents, "BeforeUnload", $MainPage); 
        $DBlocalhost->close(); 
        unset($users); 
        unset($Tpl); 
        //End Unload Page 


        ?> 
+0

IDE를 사용하여이 코드를 만듭니다. – 2Advanced

+1

기존 코드를 게시하십시오! – starkeen

+0

다시 작성 하시겠습니까? 당신은 자신보다 앞서 가고 있습니다. '

'태그에'method = "post"'를 넣으면됩니다. –

답변

2

POST를 통해 정보를 제출할 수 있습니다. 데이터를 제출하는 방식은 GET HTTP 요청에 의한 것입니다. 가장 좋은 방법은 게시물 데이터를 통해 제출하는 것입니다. 프론트 엔드 콜이 폼 제출을 위해 아약스를 사용하고 있다고 가정하고 있습니까? 그렇지 않은 경우 간단한 양식 변경 메소드를 사용하여 POST하십시오. 아약스를 사용하고 있다면 jquery와 같은 것을 사용하고 있는지 XHR 요청을 직접 작성하고 있는지 알고 싶을 것입니다.하지만 그렇게한다면 그렇게 할 수 있습니다.

<form action="action_page.php" method="POST"> 
+0

나는 그것을 새로 고치려고했지만 오류가 없다면 이메일이 사용 중이거나 유효하지 않은 것처럼 리디렉션합니다. – 2Advanced

+0

Ajax 요청을 사용하십시오. xmlhttp 요청 사용. 또는 폼을 제출할 때 Ajax 라이브러리를 사용하여 요청을 설정하고 호출하도록하십시오. – Asheliahut

+0

확인 양식을 게시하도록 설정되어 있습니다. 유효성 검사를 사용하여 오류 메시지를 게시하지 않을 경우 유효성 검사를 사용하면 유효합니까? action-signup 고유하거나 필요한 경우 ajax를 사용하여 유효성을 검사하고 싶습니다. – 2Advanced