簡體   English   中英

表單提交后缺少CSS文件

[英]css file missing after form submission

我創建了一個表單來發送文本。 在表單提交后,我使用不同的控制器和操作重定向了頁面。 每當我提交表單時,僅該特定頁面都缺少我正在使用的css文件“ temp.css”。 這樣我就遇到了一些設計問題。 誰能解釋為什么會這樣。

文本
 <div ng-init='textcontents = <?php echo (!empty($text_info))?json_encode($text_info):'[{"0":"empty"}]'; ?>'> <?php echo $this->Form->create('TwilioText', array('url' => array('controller' =>'Emailer','action' => 'text_sendmsg'),'novalidate')); ?> <div class="hidden"> <?php $value = isset($cust_detail['customerid']) ? $cust_detail['customerid'] : ''; echo $this->Form->input('TwilioSentText.customerid', array('type' => 'text', 'ng-model' => 'livedata.customerid', 'value' => $value)); echo $this->Form->input('TwilioSentText.firstname', array('type' => 'text', 'ng-model' => 'livedata.firstname', 'value' => $cust_detail['firstname'])); echo $this->Form->input('TwilioSentText.lastname', array('type' => 'text', 'ng-model' => 'livedata.lastname', 'value' => $cust_detail['lastname'])); ?> </div> <div class="textmsg"> <div class="textleft pull-left"> <?php foreach ($textChat as $key => $value) { if($value['msg'] == 'in'){ ?> <div class="time2"> <p> <?php echo $value['formatedtime'];?> </p> </div> <div class="inbox"> <p> <?php echo $value['sent_msg'];?> </p> </div> <?php } else { ?> <div class="time"> <p> <?php echo $value['formatedtime'];?> </p> </div> <div class="outbox"> <p> <?php echo $value['sent_msg'];?> </p> </div> <?php } } ?> </div> <div class="textright pull-right"> <div class="righttop pull-left"> <div class="righttop_left pull-left"> <div class="form-group"> <?php $value = isset($cust_detail['phone1']) ? $cust_detail['phone1'] : ''; echo $this->Form->input('TwilioSentText.msgSentNmbr', array('type' => 'hidden', 'placeholder' => 'Phone', 'label' => false, 'class' => 'form-control', 'div' => false, 'value' => $value)); echo $this->Form->input('TwilioSentText.msgTitle', array('label' => false, 'class' => 'text-list', 'div' => false, 'type' => 'select', 'ng-options' => "key as value.textName for (key , value) in textcontents", 'ng-change' => "textcontent = textcontents[textName].textDescription;", 'ng-model' => "textName", 'empty' => 'Content')); ?> </div> <?php $hostname = "www." . $_SERVER['HTTP_HOST']. ".com"; $CRMuser = $_SESSION['user_id']; $trade = "/trade-in-value-louisville-car-appraisal.php"; $schedappt = "/salesman.php?sales_id=$CRMuser"; $creditapplication = "/car-credit-approval-online-form.php"; $directions = "www.kiastore.com/directions"; $fname = '<# sfirstname>'; $laname = '<# slastname>'; $callme = '<# sphone>'; $emailme = '<# semail>'; $mycontact = $fname.' '.$laname.'<br>'.$callme.'<br>'.$emailme; ?> <div class="text_btn"> <input type="button" value="Trade" class="btn-img btn-img-pos" onclick="insertLink('<?php echo $hostname.$trade?>')"> <input type="button" value="Credit App" class="btn-img btn-img-pos2" onclick="insertLink('<?php echo $hostname.$creditapplication?>')"> <input type="button" value="Inventory Link" class="btn-img btn-img-pos3" onclick="insertLink('<?php echo $hostname?>')"> </div> </div> <div class="righttop_right pull-left"> <div class="form-group" > <?php echo $this->Form->input('', array('label' => false, 'class' => 'text-list', 'div' => false, 'type' => 'select', 'empty' => 'Current Deals')); ?> </div> <div class="text_btn"> <input type="button" value="Sched Apt" class="btn-img btn-img-pos" onclick="insertLink('<?php echo $hostname.$schedappt ?>')"> <input type="button" value="Directions" class="btn-img btn-img-pos2" onclick="insertLink('<?php echo $directions ?>')"> <input type="button" value="My Contact" class="btn-img btn-img-pos3" onclick="insertLink('<?php echo $mycontact; ?>')" id="text_list"> </div> </div> </div> <div class="rightbottom pull-left"> <?php echo $this->Form->textarea('TwilioSentText.sent_msg', array('placeholder' => 'Text Content', 'ng-model' => 'textcontent', 'label' => false, 'id' => 'nwtext', 'class' => 'form-control', 'div' => false, 'value' => '')); echo $this->Form->input('TwilioSentText.url',array('type' => 'hidden', 'value' => $url)); echo $this->Form->submit('Send',array('class' => 'btntext_send', 'id' => 'btntext_send','div' => false,'name'=>'submit')); echo $this->Form->submit('Schedule',array('class' => 'btntext_schd','div'=>false,'name'=>'submit')); echo $this->Form->end(); ?> </div> <span id="btntxt">Or Press Enter</span> </div> </div> </div> 

調節器

 public function text_sendmsg() { if ($this->request->data['submit'] == 'Schedule') { if (($this->request->is('post'))) { $this->autoSendText(); $this->Session->setFlash('Text to be sent has been scheduled'); } else { $this->Session->setFlash('Failed'); } return $this->redirect(array('controller' => 'Todolist', 'action' => 'index')); } elseif (($this->request->data['submit'] == 'Send')) { $url = explode('edit/',$this->request->data['TwilioSentText']['url']); $rurl = explode('-',$url[1]); $cust_id = $rurl[0].'-'.$rurl[1].'-31/formmini'; if ($this->request->is('post')) { $send = $this->sendTextMsg(); if($send == 1) $this->Session->setFlash('Saved Successfully'); else $this->Session->setFlash('Customer Text disabled'); }else{ $this->Session->setFlash('Failed to send'); } return $this->redirect(array('controller' => 'Customers','action' => 'edit/'.$cust_id)); } } 

提前致謝。

檢查您的布局文件或類似的文件,其中包括css文件。

我使用FormMail腳本在我的網站上嵌入了一個表單。

在服務器的根文件夾中,我具有以下結構:

/index.html

/redirect-page.html

/css/styles.css

/cgi-bin/FormMail.pl

我的索引頁面包含帶有重定向輸入的表單:

<input type="hidden" name="redirect" value="http://www.my.domain/redirect-page.html"/>

當我編寫redirect.html時,我從索引頁面復制並粘貼了頭部。 它包含指向styles.css的鏈接,如下所示:

<link href="css/styles.css" rel="stylesheet" type="text/css">

表單提交工作正常,我被重定向到redirect.html,但是redirect.html沒有鏈接到css / styles.css。

我意識到從/ cgi-bin中的FormMail.pl文件中加載了redirect.html,並且鏈接參考正在同一文件夾中尋找styles.css。

因此,我按如下所示編輯了redirect.html的標頭,以更正我的style.css的路徑,以指示從/ cgi-bin中退出並返回至/ css中:

<link href="./css/template.css" rel="stylesheet" type="text/css">

之后,redirect.html被鏈接到styles.css。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM