2017-01-17 1 views
0

私のconfig/configにある$ config ['url_suffix']を$ config ['url_suffix'] = ''に変更しようとしました。 。私のURLのIDであるセグメント(3)をランダムな文字列(Codeigniter)に変更することはできますか?

これがサーバーエラーであると思う場合は、「サーバーの読み取りエラーが発生しました」というエラーメッセージが表示され、「アクセスが禁止されました。ウェブマスターにお問い合わせください。そして私も、私の見解でrandom_stringを入れてみました更新することは、現在動作していない

設定ファイル

$config['url_suffix'] = '<?= random_string(40?>'; 

ビュー

<a data-toggle="modal" class="btn btn-warning" data-target="#update_account-<?= $profileAccount->id?>"><span class="glyphicon glyphicon-edit"></span>Edit</a> 
    <div class="modal fade" id="update_account-<?= $profileAccount->id?>" tabindex="-1" role="dialog" aria-labelledby="titleLabel"> 
     <div class="modal-dialog" role="document"> 
      <div class="modal-content"> 
       <div class="modal-header modal-header-success"> 
        <button type="button" class="close btn btn-primary" data-dismiss="modal" aria-label="Close"> 
         <span aria-hidden="true">&times;</span></button> 
         <h4 class="modal-title" id="titleLabel">Update Profile</h4> 
        </div> 
        <div class="modal-body"> 
         <div class="container"> 
         <div clas="row"> 
          <form method="post" action="<?= base_url(). 'User/updateProfile/'.random_string($profileAccount->id)?>"> 
           <div class="col-md-5 col-lg-5"> 
            <?= validation_errors();?> 
            <div class="form-group"> 
            <label>ID</label> 
            <input type="text" disabled value="<?= $profileAccount->id?>" class="form-control"> 
           </div> 
           <div class="form-group"> 
            <label>First Name</label> 
            <input type="text" name ="fname"value="<?= $profileAccount->first_name?>" class="form-control"> 
           </div> 
           <div class="form-group"> 
            <label>Middle Name</label> 
            <input type="text" name ="mname" value="<?= $profileAccount->middle_name?>" class="form-control"> 
           </div> 
           <div class="form-group"> 
            <label>Last Name</label> 
            <input type="text" name ="lname" value="<?= $profileAccount->last_name?>" class="form-control"> 
           </div> 
           <div class="form-group"> 
            <label>Email Address</label> 
            <input type="email" name ="email" value="<?= $profileAccount->email?>" class="form-control"> 
           </div> 
           <div class="form-group"> 
            <label>Password</label> 
            <input type="password" name ="password" class="form-control"> 
           </div> 
           <div class="form-group"> 
            <label>Contact Number</label> 
            <input type="text" name ="phone" value="<?= $profileAccount->phone?>" class="form-control"> 
           </div> 

          </div> 
         </div> 
        </div> 
       </div> 
       <div class="modal-footer"> 
        <span class="pull-right"> 
         <button type="submit" class="btn btn-success">Update Event</button> 
         <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> 
        </span> 
       </form> 
      </div> 
     </div> 
    </div> 
</div> 
+0

[ 'たurl_suffixを持っていると思う動作しない場合'] =' <?= random_string(40?> '; '関数内に閉じ括弧がありません。 –

+0

私はすでにそれを変更しましたが、それでも動作しません.. "更新"をクリックするとURLはこのlocahostになります:// xxxx/User/viewProfile Angel

+0

PHP内に ' ' –

答えて

0
あなたの設定が文字に閉鎖を欠けてい

かっこ

変更この

$config['url_suffix'] = '<?= random_string(40?>'; 

$config['url_suffix'] = '<?= random_string(40)?>'; 

に私はあなたのrandom_string 関数がエラー

ライン `$の設定で、タイプミスがあり
+0

ありがとうございますが、まだ動作していません。 – Angel

+0

はい、タイプミスがありましたが、PHPの中で ''のようなものに気付いたことがありますか? –

関連する問題