Jump to content


Member Since 07 Feb 2012
Online Last Active Today, 04:34 PM

#518577 What are the ideal breakpoints and font size?

Posted by BrowserBugs on Yesterday, 05:55 PM

I use break points when it 'breaks', not by a set width. As for font sizes it depends on the font. I generally base everything at 100% and simply adjust up or down depending as not all fonts are the same size.



I can see px, where are the pts?


Think he meant px, agreed a bad choice unless over 18, but mixing with % has some crazy results.


Edit: Helpful link, http://pxtoem.com/

#518547 NEWS: Changes to the Web Designer Forum are on their way!

Posted by BrowserBugs on 13 December 2017 - 03:14 PM

Nice one.


Is there anything you really don’t like? Um, yes, a few things come to mind.


I hate the mobile version and the full version is not responsive, but that said I'd rather battle on zooming as I know where everything is. For me I live on the latest posts and recent topics, as generally they're fresh rather than digging in older threads by category. If you could move latest threads and latest posts to the top of the mobile home screen it would be much better, then all categories underneath?


Minimum post count for new members is annoying, but so is letting anyone open as many threads as they like. Not 100% sure on a the better way, maybe each can start up to three threads (introduction and first question) which would unlock to more when a member older than a certain date, or has over X posts replies? I think many established members would either reply or report based on the thread which I think would help out mods.


And finally some way of addressing old threads to be locked. Sure some are worth waking up but many, especially in the SEO section, are reviving way out of date ideas that should be put in a museum along with tables for layout.


Wow, feeling a little refreshed after this ... therapy ;) 

#518483 Best Browser for SEO

Posted by BrowserBugs on 08 December 2017 - 05:49 PM

Please suggest me best Browser that support most of the SEO addons.


That would be me ;)

#518416 Urgent - Please Help!

Posted by BrowserBugs on 04 December 2017 - 09:28 AM

Hi Hoax,


Sorry i'm not into WordPress, but that said I thought I'd post a rejig to see if we can get answers to some of the components and what they do, it might also help others think of plugins for each bit. As many here have pointed out you'll need to interpret the design into components, if I was handed a mock-up of Googles home page it seems simple enough, but the question is always 'what happens when I press X', this is where the time can quickly disappear.



#518394 Why responsive website is required ?

Posted by BrowserBugs on 30 November 2017 - 04:35 PM

Responsive design has been a known best practice for over 5 years now...


OMG, responsive exists? Next you're gonna tell me people can fly between countries!

#518310 please review Kodi Beginner

Posted by BrowserBugs on 24 November 2017 - 08:54 AM

Haha sorry mate must have been miles away, maybe the empty white left column threw me. Might be nice to put in a screen shot and enhance the download link?

#518243 Problems caused by a 404 error page

Posted by BrowserBugs on 19 November 2017 - 09:41 AM

When viewing the 404.php page it still throws up and error:

Warning: Cannot modify header information - headers already sent by (output started at /home/ /public_html/somewhere.co.uk/404.php:1) in /home/ /public_html/somewhere.co.uk/404.php on line 38


It does not show up if I rem out:

header('HTTP/1.0 404 Not Found');


This is after changing the top line to:

<?php function tellOwner($var) { 
$ip = getenv ("REMOTE_ADDR");

The email function works.


Take a look at https://stackoverflo...nt-error-in-php as they really cover in depth the typical causes, they also cover using http://php.net/headers_sent to check. Removing the header('HTTP/1.0 404 Not Found'); would stop the error, but i'm pretty sure if you check the 404.php direct without it using http://www.webconfs.com/http-header-check.php you'd be getting a 200 ok which defies the point.

#518211 Problems caused by a 404 error page

Posted by BrowserBugs on 17 November 2017 - 11:29 AM


BrowserBugs  Thanks for the code, this looks like something more useful than what I currently have. So what I need to do is include that code into <head></head>



No it needs to go above the head. The thing with headers is once they are sent they can't be resent. When you request a php page anything above the opening <html> is processed before any headers are returned, like the server pauses before returning the header. Normally you request a file, the server looks for the file and if it exists displays it, this by default has a 200 ok header, and if it does not find the file it returns a 404 header, and if you have a custom 404 page it will use that.


What you can do with PHP is change headers before the output, and then choose what you want to do about it. This is very powerful if you want clean urls without relying upon the band aid canonical link, but that's another topic.


So I've made a basic page for this, you can customise your heart out with styles etc but the principal is the same. Also wrapped your mailer into a function, then you can just call it in any case you want an email, saves it firing all the time.

// New function if your mailer is working fine, I've not tested the mailer.
function tellOwner($var) {
$ip = getenv ("REMOTE_ADDR");
$requri = getenv ("REQUEST_URI");
$servname = getenv ("SERVER_NAME");
$combine = $ip . " tried to load " . $servname . $requri ;
$httpref = getenv ("HTTP_REFERER");
$httpagent = getenv ("HTTP_USER_AGENT");
$today = gmdate("l, j F Y, g:i a ");
$note = "Page Not Found" ;
$message = " ";
$message2 = "$today \n
$combine \n
User Agent = $httpagent \n
$note \n
$httpref ";
$to = "jbloggs@somewhere.co.uk";
$subject = "404 Error Page";
$from = "From: jbloggs@somewhere.co.uk\r\n";
mail($to, $subject, $message2, $from);
$site_url = "http://www.somewhere.co.uk";
if($_SERVER['HTTP_REFERER']!="") { // Gets the referrer
  if(substr($_SERVER['HTTP_REFERER'], 0, strlen($site_url))==$site_url) { 
    // If the referrer start is the same as $site_url then they clicked a link from your website.
    $msg = "<p>Please accept our apologies for this, it appears this broken. Head back to our <a href=\"/\">home page</a>.</p>";
    tellOwner(); // New function to send a mail
  } else {
    // They clicked a link from a 3rd party website.
    $referer = parse_url($_SERVER['HTTP_REFERER']); $referer = $referer['host'];
    $msg = "<p>You were incorrectly referred to this page by <b>" . $referer . "</b>, not too sure why. Head back to our <a href=\"/\">home page</a>.</p>";
    tellOwner(); // New function to send a mail
} elseif(substr($_SERVER['REQUEST_URI'], 0, strlen("/404.php"))=="/404.php"){
    $msg = "<p>It appears you wanted to see our super duper 404 error page? Well here it is in all its glory; hope you like it!</p>";  
    // Because they went to http://www.somewhere.co.uk/404.php it does exist. The server wants to return a header of 200 ok, but we don't want that else we end up with /404.php say in the index, so instead we change to 404 headers so the search engine or crawler thinks it's not here.
    header('HTTP/1.0 404 Not Found');
} else {
	$msg = "<p>Sorry but the page you have requested cannot be accessed, this could possibly be a mis-typed URL or out-of-date bookmark. Head back to our <a href=\"/\">home page</a>.</p>";
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>404 | Page Not Found</title>
<meta name="robots" content="noindex">

<h1>Page not found</h1>
<?php echo $msg; ?>

#518209 Problems caused by a 404 error page

Posted by BrowserBugs on 17 November 2017 - 09:07 AM

Wow, brave move on the email for every 404 but kudos for wanting to investigate making a better user experience. First, can I just urge you to take off the 301 all to the home page, it defeats the purpose of 404 and also leaves you wide open to potential problems. 301 tells the search engines 'hi, I know the page you wanted but I have permanently moved the content to this new page', and in a sinister context if I linked to a random url on your site such as 'yourdomain.com/cheap_meds' the answer to the search engine would be 301, the cheap meds content has moved to the home page instead of 404 wtf are you asking for.


Google Search Console will let you know about 404s where the page was indexed but has disappeared, but tracking every 404 would be time consuming, urls on a domain root are pretty much infinite in combinations and parameters. I would suggest not using tracking code on the 404 page, instead make a minimal design page.


Take a look at what I use, this is in the head of the 404 page assuming it's kept at root (/404.php) and htaccess uses;

$site_url = "http://www.yourdomain.com";
if($_SERVER['HTTP_REFERER']!="") { // They were referred.
   if(substr($_SERVER['HTTP_REFERER'], 0, strlen($site_url))==$site_url) {
        // They followed a link on your site to this location, possibly use your email idea here.
        $msg = "<p>Sorry message for the broken link as it's your fault.</p>";
    } else {
        // They were referred here from somewhere else, you might want to know this and ask them to update their link.
        $referer = parse_url($_SERVER['HTTP_REFERER']);$referer = $referer['host'];
        $msg = "<p>You were incorrectly referred to this page by <b>" . $referer . "</b>.</p>";
} elseif(substr($_SERVER['REQUEST_URI'], 0, strlen("/404.php"))=="/404.php"){
    // They wanted to see your 404 page ;) - remember the php version shouldn't exist directly
    $msg = "<p>It appears you wanted to see our super duper 404 error page? Well here it is in all its glory; hope you like it!</p>";
    header('HTTP/1.0 404 Not Found');
} elseif(substr($_SERVER['REQUEST_URI'], 0, strlen("/wp-login.php"))=="/wp-login.php" || substr($_SERVER['REQUEST_URI'], 0, strlen("/wp-admin/"))=="/wp-admin/"){
    // They think you run WordPress
    $msg = "<p>It appears you think this is built with WordPress - Hahahahahahaha!</p>";
} else {
    $msg = "<p>Sorry but the file you have requested cannot be accessed, this could possibly be a mis-typed URL or out-of-date bookmark.</p>";
echo $msg; ?>

I'm racking my brains as I read a great blog article on ways to improve error pages, if I can remember where I'll post it.


Edit: Forgot to say in all cases of messing around with headers make sure you test them, I use http://www.webconfs....eader-check.php

#518044 Form submission timer

Posted by BrowserBugs on 06 November 2017 - 12:30 PM

It's this function ...

function spawnSecure($var) { 
	$spawn = trim(stripslashes($var)); $now = date('Y-m-d H:i:s'); $diff = strtotime($now) - strtotime($spawn);
	if($diff<=1.5) { return false; } else { return true; }

... the difference here is 1.5 seconds, but this can be adjusted to your needs. All you need to do is add a form field ...

<input type="hidden" name="anything" value="<?php echo date('Y-m-d H:i:s'); ?>">

... then grab it when posted and check if it was too quick ...

if(!spawnSecure($_POST['anything'])) {
    $err_msg = "<b>Error!</b> - This appears to be an automated attempt, please take your time or call for assistance.";

#517863 FREELANCERS BEWARE - workroll.com are adding OUR work and saying they did it

Posted by BrowserBugs on 20 October 2017 - 12:28 PM

Both pages now say "The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. If you are the application owner check the logs for more information." - flaming them might have worked :D

#517780 Contact form captcha not working. Anything obvious?

Posted by BrowserBugs on 15 October 2017 - 08:00 AM


EDIT: Sorry. It seems to be OK if I go back to PHP 5.5.


I've cleared the cache in a few browsers and it seems to work now. Feel free to try it anyone if you want to check.

My server (ipage) uses the default of PHP 5.5. I must have screwed up by changing to 5.6 quite a while ago.

I'm still not 100% sure, but it seems to be OK at the moment.

Please let me know if you happen to test it and it fails.


Ah, didn't know you had changed to 7.1. I think most of the hosts I use stop at 7 at the mo, I've not got any projects in a 7 environment yet so no idea what should be in the ini, most are in the 5.6 bracket. There will also no doubt be some deprecated features from versions gone by.

#517775 Contact form captcha not working. Anything obvious?

Posted by BrowserBugs on 14 October 2017 - 12:19 PM

Does it print out just "Code : " with no actual code? If so then the $_SESSION is not set or is empty; which would be why it doesn't match.


So either the session is not set, or the session variable is not set, we can test this which should give you a message about things that are set or not.

$msg = "Message:";
if(session_id()=="") { // Session ID will exist if session is set, if it's emtpy ...
    session_start(); // Start the session.
    if(session_id()=="") { // If it's still not set.
        $msg .= "<br>I can't start session.";
    } else {
	$msg .= "<br>Session is set.";
    if(!isset($_SESSION['6_letters_code'])) { // If $_SESSION['6_letters_code'] is not set.
        $msg .= "<br>6_letters_code is not set.";
	$_SESSION['6_letters_code'] = ""; // Set $_SESSION['6_letters_code']
	if(!isset($_SESSION['6_letters_code'])) { // If it's still not set.
            $msg .= "<br>6_letters_code cannot be set.";
    } else {
	$msg .= "<br>6_letters_code is set.";
        if(trim($_SESSION['6_letters_code'])=="") { // If it's set but empty.
            $msg .= "<br>6_letters_code is empty.";
	} else {
            $msg .= "<br>6_letters_code is " . $_SESSION['6_letters_code'] . ".";
echo "<p>" . $msg . "</p>";

#517773 Contact form captcha not working. Anything obvious?

Posted by BrowserBugs on 14 October 2017 - 10:47 AM

for a quick test on the contact page just before the send it button insert <?php echo "Code: " . $_SESSION['6_letters_code']; ?> - does it match the image?

#517769 Contact form captcha not working. Anything obvious?

Posted by BrowserBugs on 14 October 2017 - 08:50 AM

Hmm I can't see where you set the $_SESSION['6_letters_code'], somewhere it should store the rand to the $_SESSION['6_letters_code'] - is there any more to this?


Edit: Also where the image is have you clipped of the next bit of code? Image isn't closed, no closing </form> either.