Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

You should definitely have the ability to vote and comment. Only new members with fewer than 5 posts or so are not allowed to. Let me see if I can figure out what's going on here because I'm not able to reproduce this behavior myself.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

I've never tried hosting it myself, so I'm not sure. I vaguely remember having to set the font weight to something specific. I think it was that if I used fas the font weight had to be 400 or something like that. 600 for solid? I forget what it was.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

So I use Font Awesome very heavily, and here's what I do. (In fact, I randomly saw your question while actively on the fontawesome.com website!)

Firstly, I use their CDN, as so:

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">

Then, I use fas, fab, or far ... for solid icons, brand icons, and regular icons. This changed in Font Awesome 5. Previous versions just had them all under fa but this latest version you need to specify the category. I typically use the solid versions (fas) with the exception of things like Facebook icons or social media brand icons, where I need fab. Try using fas fa-users instead of fa, and make sure you're using the latest version from the CDN.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

This will be fixed in the upcoming DaniWeb+Dazah merger. Thanks!! And stay tuned.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

This problem has been fixed. I'm sorry it took so long to fix, but I'm on vacation (a friend's destination wedding in Vermont) and I didn't realize that an SSL certificate expired and DaniWeb.com was unable to communicate with the Dazah API.

These kinds of problems will no longer exist after the DaniWeb/Dazah merger goes live in about a month.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Microsoft bought Skype and, while I can't say that the software has really been improved in any substantial way since it was purchased, I don't think it was made worse or lost market share either. I guess we shall see what happens.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

I didn't get the test email either so I've reached out to James. Waiting to hear back from him.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Checking ...

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi there John! You should be able to reply to my PM in the platform. Or, from the Contact Us page at the bottom of the site, you can find my email address. Talk to you soon!

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

In comment.php, you are retrieving Post ID via $_GET[] as opposed to via $_POST[]. GET is for query strings, such as comment.php?post_id=123 while POST is for data submitted from a form such as this one.

<form method="POST" name="form" action="comment.php">

    <div class="form-group">
        <input class="form-control" type="text" id="name" name="name" placeholder="Your name..." />
    </div>
    <div class="form-group">
        <textarea name="comment" id="message" class="form-control" placeholder="Your comment..."></textarea>
    </div>
    <div class="form-group">
        <button type="submit" class="btn btn-success" name="submit">Comment</button>
    </div>

</form>

You can see here that you are passing in name and comment via POST, but you are not passing in post ID anywhere. You need to pass post ID into the form as well, preferably as a hidden input variable.

<input type="hidden" name="post_id" value="<?php echo $_GET['post_id']?>">
Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

I just came across this thread since you linked to it from one of the group chats. Did cereal's suggestion work?

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi John!! Welcome to DaniWeb :)

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Better to let a few dead links through for now instead of killing everything.

We're not killing everything. We're just killing the links when servers return clearly incorrect / confusing status codes. For example, LinkedIn doesn't like bots, so they return an http status 999, which we silently ignore. However, Microsoft seems to not like bots, but they are returning http 404 errors which are reserved for old pages that no longer exist. If the server tells us the page doesn't exist, we have no way of verifying whether they're lying to us because they don't like bots, or if the page really does not exist. IMHO, it's a badly configured server to purposefully lie by using an http status code that is specifically reserved for a different purpose.

Hopefully we're acting friendlier now by specifying a referer and useragent.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Yes, this website is very poorly configured. I can understand them choosing to not waste bandwidth on bots. However, they seem to:

  • return a 404 error on a HEAD request
  • return a 500 error on a GET request where a referer is set but a user agent is not set

I'm now making full GET requests (instead of just HEAD) setting the referer to the actual URL of the post that the link appears in, and the user agent to DaniBot. It's more bandwidth, obviously, but hopefully it will allow us to bypass servers that don't like bots, without us faking our user agent or being a bad bot.

We're still going to get bad results for servers that actively reject requests where the user agent has a Bot in the name, or isn't a known user agent (Mozilla, IE, Chrome, etc.) However, I think we have to be good botizens as well.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

So I tried to spoof the user agent and no luck. This is my cURL request

    $ch[$row->url] = curl_init($row->url);
    curl_setopt($ch[$row->url], CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch[$row->url], CURLOPT_HEADER, true);
    curl_setopt($ch[$row->url], CURLOPT_NOBODY, true);
    curl_setopt($ch[$row->url], CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch[$row->url], CURLOPT_CONNECTTIMEOUT, 15);
    curl_setopt($ch[$row->url], CURLOPT_TIMEOUT, 30);
    curl_setopt($ch[$row->url], CURLOPT_SSL_VERIFYPEER, false);

$row->url is set to https://support.microsoft.com/en-gb/help/927477/how-to-troubleshoot-a-damaged-presentation-in-powerpoint-2007-and-powerpoint-2010

Can anyone let me know how to get curl_getinfo() to stop telling me that the request returns a 404 status code. I mean, obviously it's not lying and it is returning a 404. I just meant why is my PHP code doing so and my web browser is not.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Soooo, as it turns out, I have a usable PC again, and I'm not catching any glaring bugs with our link checker. The problem seems to be that the link in question here is not just timing out when DaniBot attempts to reach it. It's actually actively returning a 404 error to the bot. This means that the server is actually responding and saying yes, we received your request, that specific page doesn't exist. As of right now, the only thing I can think of is that the web server just doesn't like bots.

A lot of web servers that are tight on bandwidth actively choose to return bad http status codes instead of serving up the correct content when they detect that the request is originating from a bot they don't recognize.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Sorry, I haven't had usable access to my computer the past week (due to moving).

The problem is our bad link checker is catching false positives. This can be due to the web servers rejecting connections from what they detect to be bots (as our link checker is a bot. )

Once I have usable PC access again, I'll work on seeing if I can fix it.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Are you using a pre-release version?

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Jim, I think that cereal is just demonstrating a simple example to show that found_rows() isn't working for him, and his actual use case isn't as simplistic as in the example he demonstrated. The advantage to using found_rows() versus count(*) is that count returns a count of all rows that match the SQL query. found_rows() returns a count of all rows that match the SQL query if a LIMIT were not in place.

We use it here on DaniWeb. So, for example, we have 30 posts per page. So page one the SQL query has LIMIT 0, 30, page 2 has LIMIT 30,30, etc. If I were to just do a COUNT(*) then it would always return 30 because that's a count of how many rows it's returned. However, in order to build out our page navigation, I need to know how many rows would be returned if the LIMIT clause were not in place. Therefore, I can use cereal's method to give me the total number of rows in the database so I can accurately build my page navigation.

Which leads me to my next point. Cereal, since sql_calc_found_rows only makes sense with LIMIT, perhaps it doesn't calculate itself accurately without a LIMIT in place? Try adding LIMIT to your query and see if it returns better results?

cereal commented: thank you! +14
Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Pty, if the op is knowledgeable enough in web development to want to build something from scratch, and they are actively working to improve their skills, why point them in the direction of using an out of the box tool like square space? At the end of the day, it's just going to be limiting and then they'll be stuck with it.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

I have no idea what Web Plus x8 is but you need to delete that line. Use Dreamweaver, or even Notepad or any plain text editor.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Here it is ... <meta http-equiv="Refresh" content="15; url=http://www.fbjewellery.co.uk/products.html"> ... Clear as day, telling me to refresh the page to products.html after 15 seconds.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Oh do you mean a meta refresh tag?!

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

A meta tag is not going to refresh a browser. It needs to be javascript. There definitely is some rogue javascript going on somewhere here.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Yes you can share the link as long as it's relevant and useful to the discussion. Just as long as it's not a blatant solicitation.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

That's incredibly strange. What page does it revert to? Since you say it's across multiple browsers and platforms, I guess we can rule out browser toolbars and extensions. It is most likely JavaScript causing this. It could be a third party ad, or some type of JavaScript plugin, etc.

What page is this? I might be able to track down the offending JavaScript for you.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

OK fixed.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

With header missing? I'm confused? Can you post a screenshot? Thanks so much for helping!

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Also, do other ads in the same slots work just fine? Might be a bug related to the ad itself.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Can you please be specific about which ad slot?

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Not familiar with keyframes (other than seeing them used and never doing anything myself with them). Is "bugfix" just a friendly name?

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

You can use PHP to retrieve a user's IP address. And you can use the JavaScript-based HTML5 geo API to retrieve a user's latitude and longitude (coordinates), provided they agree to it.

However, you need a third party service or library or something to actually determine a user's city, state, country, zip code, area code, etc.

I would recommend Geo2IP. That's what I've been using for years and there is a free version that lets you download their database and use it directly, albeit it's a little less accurate. However, what I like about it is that it doesn't depend on any third party API calls, so once you download it you can use it locally without limitation.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Perhaps check the user agent?

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

The code you presented does not count 1,2,3,4,5 ... not from 0 or 1 or otherwise. As diafol pointed out, you need a loop.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Unless your website is targeting an intranet or users where you have some control over what they will be using, I would definitely do my very absolute best to be backwards compatible, or at least downgrade nicely, for over 6% of my users. I tend to not worry once it gets to the .5% range or lower. I'm not saying it needs to have every feature ... just downgrade to the point of being usable and not looking broken.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Wait, ubuntu phone is blackberry?

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

I much prefer chrome. It seems like web browsers always go through phases. First internet explorer was considered bloatware and Firefox was considered the lean alternative. Then Firefox became bloaty and it was chrome that was lean. Now it's back to Firefox. And things come full circle with the new Microsoft Edge being fast, with a new name to boot after IE got such a bad rap.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

And now everything is working again?

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

I'm not a java developer ... However, if I follow your logic correctly, you're checking to the left side. Then, if it's not 0 itself, then you check from the right side. Well, if it's not a 0 itself, then the closest we can be to it is 1. Therefore, if it's already a 1 from the left side, there should be no need to then check the right side because it can't be anything better.

In fact, taking that a step further, you first count from the left, then you count from the right. Then, you figure out which one is lowest. Well, I think instead maybe you should be counting from the left, as you are, and then store that number. Then, count from the right only up to the number we counted from the left. Once we hit it, we know that the left is closest, and we can just break.

This saves us having to continue looping on the right when it's clear the answer is already the left's result. Plus, we can get rid of the expensive Math.min() function.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Haha. Glad you got it solved so quickly!

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

I've certainly never heard of it, but I've barely touched anything beyond PHP since starting DaniWeb. That being said, if it interests you, then give it a whirl and see what you think. If it's enjoyable to write in, then delve further. As far as the job market ... I'm not so sure there's a need for half the languages that are out there nowadays, but who am I to say ;)

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Whatever happened with this?

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

OK, I just checked ... and this account is the only one you have with that eternity yahoo email address. Could your account be associated with a different email??

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

I think the last time was when you hit your head or something

Oh, that was terrible!! I was pitching Dazah at an event and I fell off the stage backwards and hit my head into the wall. Then, to add insult to injury, a chair came crashing down on top of me. Then the paramedics showed up.

I remember that was open and people could send one private message.

My mistake for asking you to send me a private message. To prevent against spam, new members can only reply to incoming messages, and cannot cold message anyone. I'll initiate a conversation with you.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi,

I'm sorry about that. You should be able to log in with your old email address and password, and it should log you into your old Dazah account.

Please send me a private message with your username and I'll investigate the issue.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Are you sure you're getting the same error message?? What version of PHP are you using??

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

Umm ... I don't think CURLOPT_HTTPSHEADER is a known cURL variable. Try doing something like this instead:

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/x-www-form-urlencoded',
    'Content-Length: ' . strlen($req),
));
Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

It looks like it's not loading the Twitter Bootstrap CSS files, which reside on Google's CDN. Do you have any settings set to not load external resources on a webpage?

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

I took a closer look and it appears the CSS is broken. Can you do a hard refresh or clear the browser cache? That should correct the problem.

Dani 4,645 The Queen of DaniWeb Administrator Featured Poster Premium Member

We don't have a separate desktop + mobile view. We just use responsive web design that is based on the browser dimensions.