Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Valid Welcome-Message.php
#1

(This post was last modified: 05-21-2018, 01:44 AM by John_Betong. Edit Reason: added link to W3.org )

To remove the Welcome-page.php HTML validation errors and warnings;

Step #1

File: ./application/Controllers/Home.php:

PHP Code:
<?php namespace App\Controllers;

use 
CodeIgniter\Controller;

class 
Home extends Controller
{
public function 
index()

   $tmp crypt("a-very-long-random-text-string"'a-personal-crypt-key');
   $data['nonce'] = $tmp;

   return view('welcome_message'$data);
}


}
// 

Step #2

File: ./application/Views/welcome-message.php

PHP Code:
// add lang="en" 
 
  <html lang="en">

// remove: {csp-style-nonce}
// replace with:
 
  <style nonce="<?= $nonce ?>">

// add px
 
  letter-spacing0.8px;

// remove from <svg ...
 
   version="1.0"


 
  

https://validator.w3.org/
That's it a validated web page Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB