PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 30, 2022

[FIXED] How to access external link html in CI

 January 30, 2022     codeigniter, external-links, html, php     No comments   

Issue

I have this Html Code in my CI, it's quite normal ... When i run in localhost it's all fine, but when i host the wbsite

it keeps sending mysite.com/www.google.com instead just wwww.google.com.

am i missing something here ?

<ul>
              <li>
                <a href="www.google.com" class="drop-text">Login</a>
              </li>
              <li>
                <a href="#contact" class="drop-text">Contact Us</a>
              </li>
            </ul>

result expected is www.google.com on url my bar


Solution

Your href needs to be https://www.google.com, else your site will be prepended as you are seeing.

It will think it's a local link.

So

<a href="www.google.com" class="drop-text">Login</a>

needs to be

<a href="https://www.google.com" class="drop-text">Login</a>

So for external links, the http:// or https:// needs to be included in the links url



Answered By - TimBrownlaw
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing