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

OK so the weirdest thing just happened. The file was reverted back to its original buggy state and somehow not checked in on git. Was I dreaming yesterday?

I must have made the change, uploaded it, but not pushed it to git, and then somehow it reverted??

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

Myself, along with everyone else I know, uses Postman.

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

Ah, nope, it’s happening for me too. I’ll look in a little bit. Still in bed again.

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

Happening in the exact same place? Try clearing your browser cookies perhaps?

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

I have no clue what you're referring to, rproffitt? Huh??

That being said, I don't understand why DaniWeb is flagging the link as broken when it's not. Weird. I'll check that out later today.

Either way, I took a look at the link, and it seems as if these are concepts that really aren't fully grasped until you just do them. For example, I could explain what a loop is conceptually, but you don't really get it until you code it.

What I suggest you do is install PHP+MySQL (or some other backend language + database server stack of choice) on your local computer (or on a server you have access to), and play around with it. Go through these questions such as "Explain the difference between the DELETE and TRUNCATE command" ... Well, run these two commands yourself and see the difference.

When it comes to intension and extension of a database, I believe these are just words that describe overall concepts and can't really be demonstrated with any specific query. I hope my answer a few posts up was helpful.

Alisha_8 commented: Hey Dani, can you please help why the link have the cross lines on it? +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

It should be fixed now, but you might need to clear your browser cache.

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

Thanks for reporting this. It’s a bug introduced yesterday when converting actionable <a> tags to <button> tags. I’m still in bed after a late night (coding said change) and I’ll fix it as soon as I make my way to my home office.

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

Just so that everyone will always know what's being referred to, in case the other page is taken offline, here's the code I'm referring to:

#!/usr/bin/php
<?php
/**
 * @license http://www.wtfpl.net/txt/copying/ WTFPL
 */

date_default_timezone_set( 'UTC' );


$sitemaps = array(
    'https://bjornjohansen.no/sitemap_index.xml',
);

$crawler = new BJ_Crawler( $sitemaps );
$crawler->run();


/**
 * Crawler class
 */
class BJ_Crawler {

    protected $_sitemaps = null;
    protected $_urls = null;

    /**
     * Constructor
     *
     * @param array|string $sitemaps A string with an URL to a XML sitemap, or an array with URLs to XML sitemaps. Sitemap index files works well too.
     *
     */
    function __construct( $sitemaps = null ) {

        $this->_sitemaps = [];
        $this->_urls = [];

        if ( ! is_null( $sitemaps ) ) {
            if ( ! is_array( $sitemaps ) ) {
                $sitemaps = array( $sitemaps );
            }

            foreach ( $sitemaps as $sitemap ) {
                $this->add_sitemap( $sitemap );
            }
        }

    }

    /**
     * Add a sitemap URL to our crawl stack. Sitemap index files works too.
     *
     * @param string $sitemapurl URL to a XML sitemap or sitemap index
     */
    public function add_sitemap( $sitemapurl ) {

        if ( in_array( $sitemapurl, $this->_sitemaps ) ) {
            return;
        }

        $this->_sitemaps[] = $sitemapurl;

        $ch = curl_init();
        curl_setopt( $ch, CURLOPT_URL, $sitemapurl );
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
        $content = curl_exec( $ch );
        $http_return_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );

        if ( '200' != $http_return_code ) {
            return false;
        }

        $xml = new SimpleXMLElement( $content, LIBXML_NOBLANKS );

        if ( ! $xml ) {
            return false;
        }

        switch ( $xml->getName() ) {
            case 'sitemapindex': …
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

There can be an infinite number of levels of sitemap index files pointing to sitemap index files pointing to sitemap files.

Luckily, the BJ_Crawler class you described over in your other thread already uses recursion to currently handle an unlimited depth, so you don't need to handle this on your end. It's already being taken care of for you.

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

I do not understand what an object is. Still at procedural style.

I am trying to teach you as there's no way for you to accomplish what you're trying to do without it. It's not possible for the code to realistically be converted to procedural style. What you're asking is akin to saying "I don't understand function calls or loops. Rewrite this code without any function calls or loops."

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

I am curious, have you ever built a web crawler before ?

I have not, but I have 20 years of PHP experience, and built this site. While not a crawler, per se, we do have a cURL-based link validator in the backend.

Struggling to understand the code on this one

There is a class called BJ_Crawler that defines objects of the type BJ_Crawler. Objects of this type have two properties: $_sitemaps and $_urls.

The constructor function is executed when you create a new object of the type BJ_Crawler. That means I can use this class by doing something such as:

$mySitemaps = new Array('sitemap1.xml', 'sitemap2.xml');
$myCrawler = new BJ_Crawler($mySitemaps);

and when I run that code, it calls the __construct() function first. In that constructor function, for each sitemap that is passed in (e.g. in this case, sitemap1.xml and sitemap2.xml), we call the class's add_sitemap() function.

This add_sitemap() function fetches each sitemap file, adds it to the object's list of sitemap files, finds all of the sitemap's URLs, and adds them all to the object's list of URLs.

Now, the $myCrawler variable is an object that is storing a list of sitemaps and a list of URLs contained within those sitemaps.

We can then call:

$myCrawler->run();

and what that will do is perform cURL requests to look up all of the URLs associated with $myCrawler.

You can see, in this example code, above the Crawler class is a similar use case that the developer presents:

$sitemaps …
gce517 commented: Great explanation! +1
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

If you know of any small site's xml sitemap url then let me know so I can test each sitemap crawler code I come across on that small site.
Do not want to be testing on large sites.

We use sitemap index files to break our sitemap up. You can try parsing https://www.daniweb.com/home-sitemap.xml which is a pretty small sitemap file of ours.

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

No need to write php code for the crawler to sniff out the SiteMap url as the site owner's will submit on the "Link Submit" form the url of their sitemaps.

Many sites, DaniWeb included, also include a link to the sitemap file in our robots.txt.

That being said, the code at https://www.daniweb.com/programming/web-development/threads/538869/can-this-oop-be-convert-to-procedural-style that you posted should be exactly what you're looking for, but unfortunately there is no way of converting it to procedural style. It was designed to be object oriented for a reason ... Objects give you functionality that is exponentially more difficult to accomplish with procedural code. And, in this case, because we're using built-in PHP classes and objects, it's not possible to rewrite them without thousands and thousands of lines of code.

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

I'm glad you got it working. I'll mark this question as solved. That being said, why use simple_html_dom.php at all? I use PHP's built-in DomDocument class as so:

// Initiate ability to manipulate the DOM and load that baby up
$doc = new DOMDocument();
libxml_use_internal_errors(true);
$doc->loadHTML($message, LIBXML_NOENT|LIBXML_COMPACT);
libxml_clear_errors();

// Fetch all <a> tags
$links = $doc->getElementsByTagName('a');

// If <a> tags exist ...
if ($links->length > 0)
{
    // For each <a> tag ...
    foreach ($links AS $link)
    {
        $link->setAttribute('class', 'link-style');
    }
}

// Because we are actually manipulating the DOM, DOMDocument will add complete <html><body> tags we need to strip out
$message = str_replace(array('<body>', '</body>'), '', $doc->saveHTML($doc->getElementsByTagName('body')->item(0)));

If you need the html to be loaded from a file, you can do:

$message = file_get_contents('https://...');

It works for XML manipulation as well: https://www.php.net/manual/en/book.simplexml.php

Good luck!

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

That link. Does it take me in circles?

Rproffitt is referring to the link you posted just pointing to this very page.

I had actually never heard of the words intension and extension of a database. However, from what I could tell from a Google search, the intension is the relational schema.

For example, it defines that I have one table of posters and that table has columns for the poster's ID # in the platform, poster's name, and other attributes about the poster. Then there's another table of posts and that table has columns for both the post ID # in the platform, the post message, as well as the poster's ID # who made the post. There's a relationship between the poster's ID # across both tables.

The extension are the actual rows of data themselves, contained within these tables.

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

I think the only way that Doordash would be able to send a cease and desist order is if the clone app is strictly violating one of their patents, and even then, Doordash would have to prove it in court.

However, in general, I'm not a fan of clone apps because I feel as if, in most cases, the original app has a huge market share and there's no reason for an end-user to switch.

Williams Brown commented: Nithin from SpotnEats Clone scripts are imitations of successful internet business project models. People that are interested in developing new onli +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

The LIKE parameter is meant for fuzzy matches, but we need to know what type of fuzzy match in order to help you. In other words, if I have MySQL that says col1 = 'foo' then I'm looking for an exact match for rows whose col1 is set to the value "foo". However, if I have MySQL that says col1 LIKE 'f%' then that's a fuzzy match for all rows whose col1 begins with the letter f.

As mentioned in my previous post, you can use the LIKE keyword to search for fuzzy matches by using % and _. However, in order to help you come up with the specific MySQL query you need, we need to know what you're looking for. Are you looking for strings that begin with a letter? That end with a letter? That are a specific number of letters long? That begin with a certain substring? That have a certain substring inside them? There's an infinite number of things you can do with LIKE fuzzy matching. But which of those are you trying to do?

Also, in your original query, do you mean for $col1 and $col2 to be PHP variables? Or are the names of the MySQL columns col1 and col2? (In which case you shouldn't have the dollar signs in front of them).

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

The MySQL query, as you have it, is incomplete, as ? is not valid MySQL.

I'm also not sure what, specifically, you mean by wild card match or fuzzy match query. When you use the LIKE keyword, you compare the column to a string that may include % or _. The percent sign represents zero or more characters. The underscore represents exactly one character.

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

Sorry, I don't know C++, but can you explain what isn't working with the code you have. Is the solve() function supposed to be removing the whitespace?

According to this StackOverflow question the solution is str.erase(remove_if(str.begin(), str.end(), isspace), str.end());

You could also try using regex as so: str = regex_replace(str,regex("\\s"),""); which is the equivalent of how I would do it in PHP (my language of choice).

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

PHP is a backend web development language that generates HTML. HTML is the markup language that gets interpreted by web browsers. When you say "floating text" I assume you are referring to text visible in a web browser, is that correct?

Also, I'm unsure what you mean by "floating text"? Can you describe what you're trying to achieve? (e.g. by posting a picture)?

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

Hello and welcome to DaniWeb! I really wish I could help you, but, while I have a lot of PHP experience, I don't have any experience with Laravel or its templating system.

Does the code you have not work? Is it giving you any errors? I can try to help you debug it if you can explain in what way you're looking for guidance.

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

I thought that's what husbands were for ;-)

It is! Insomniac me doesn't want to be exposed to all that blue light from my phone.

We have a programmable (but not wifi) thermostat that keeps our house at the proper temperature day and night, winter or summer.

I like to keep the windows open all day long when I'm working, and my husband is super against having the thermostat on when the windows are open. Something about wasting electricity. So the thermostat tends to get switched on depending on comfort level at bedtime.

I understand how having COPD might make some features attractive, but I would think you'd want your filters on all the time.

The air purifiers we have are medical grade and literally sound like loud airplanes taking off, and are strategically located based on negative air pressure (e.g. where outside air tends to seep into the house even with all doors and windows closed). I get a very bad migraine if I am in the same room as either of them when they're on. We do keep them on a lower level if we have company over (e.g. for COVID reasons), but we need them on full blast to keep the smoky air under control when the outdoor air quality is at dangerous or potentially hazardous levels (e.g. AQI > 100).

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

It doesn’t sound like you’ve ever lived anywhere with wildly unpredictable weather. I’m familiar with the old school remote car start that was useful back in NY winters. But here in CA, when you’re expecting it to cool into the 50s tonight, and instead you’re laying in bed tossing and turning because it’s randomly in the mid-80s outside instead and ridiculously warm in the bedroom, being able to adjust the thermostat from bed is a godsend.

Or, if you’re like me and have COPD and realllllllly struggle with California wildfires, having the air purifiers turn on throughout the house automatically, when I wasn’t home and didn’t even realize a fire had broken out yet, upon detection of poor air quality outdoors, has saved me a trip to the emergency room.

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

I couldn’t live without a Nest thermostat or doorbell at this point.

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

Why does your dishwasher need wifi?

I can understand with things like an oven, because we use that here so it automatically knows the precise cooking temperature and duration for any food.

But a dishwasher?

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

If that’s your thing, there’s nothing illegal or wrong with porn. Lots of people watch it, right?

A porn website is definitely on the seedier side of the web, but there’s a lot of money in it and it’s completely legal income. I know a handful of different people, some whom I consider some of my very closest friends, who all made a very sizable income streams off of porn websites back in the late 1990s and early 2000s. I think I once heard a story that porn pretty much funded the development of the World Wide Web back in the day.

When I was first starting out DaniWeb, and needed money for server bills, I did some freelance web development work for a porn site’s vBulletin forum. I’m not going to name any names because the technical lead on the project is incredibly successful today in a much less seedier business.

But people follow the money. And there’s a lot of money in porn. More than any other industry on the web, I believe.

Nowadays I would say it’s probably much, much tougher because there’s just so much competition in the space now, and I’ve been told people can find virtually anything they want for free with PornHub. It’s like the YouTube of the porn world or something. (I think?)

I heard some people saying the next big thing is going to be immersive porn with 360 degree 3D porn through the Oculus, but wearing heavy …

Hauwau commented: Please i need to create my porn site how do i do it +0
Geospatial commented: Best answer. I am new here, i want to learn from you +0
MMHN commented: it's totally depends on your content and volume. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

You typically either write in PHP or in a backend javascript library (node.js), but not both. PHP is considered a little more archaic nowadays, but many open source social platforms happen to be written in it.

An example of a powerful, open-source Javascript-based social platform is Discourse. Of course no PHP required there.

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

Thank you for following up with the direction you took the article in. I'm curious if, of all the places you sourced book recommendations from, we were the only ones to give so much pushback against paperback?

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

the cloudflare option is not free its $5/month. Which is not ideal for me

That Cloudflare option you are referring to is to resize images. The ability to automatically host all images on your server, and cache them, is free with Cloudflare. I would strongly, strongly recommend using that over something like Imgur.

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

This is not what Google Drive was designed for and it is not recommended. Instead, you should be hosting images through a CDN.

I recommend Cloudflare, as it’s what DaniWeb uses, and they have a free option. It can take some initial configuring to get your server onto Cloudflare, but once it is, you can configure it to cache your images on its servers around the world.

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

I know you mention you already got it working, but I will echo gce's note that the reason the full name isn't being understood is because you are missing quotes around it.

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

I think you're going to have a hard time ranking for either "clone app" or "custom app development". They're both going to prove to be very tough keywords. The issue is that if you have a blog, that makes money just from ads, any amount of money you spend targeting those keywords is never going to give you a return on your investment. Every single app development agency is targeting those keywords, and they're making a whole lot more $ per organic lead than you ever will from your blog.

bijutoha commented: How is it going if he makes a whole lot more $ per organic lead than his rivals? +3
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I’m glad you got it working, although it wasn’t necessarily the way you were wanting.

You can use URI rerouting so that your pages don’t have a .php extension. DaniWeb is written in PHP and none of our files have a php extension.

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

Have you figured out your bug?

download.png

Without a doubt, this image very clearly shows that those three files are not available at those locations. They are showing 404 errors. Although I do now notice those are .map files ... I've never seen .map files for JS before?

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

Provided that menu.html is not being blocked from being seen by bots in your robots.txt file, Googlebot is able to understand and parse javascript, and is able to understand what the complete page is meant to look like.

However, it is not ideal, from an SEO perspective. Web browsers having to fetch menu.html and then parse the Javascript also makes pages load slower, which is bad for the end-user and also for Google.

The better way to accomplish a shared menu is to use a server-side programming language (PHP, for example).

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

Here are the categories that LinkedIn uses per their API. (Ignore how they are formatted, that was for my personal use case.)

$php_categories = array(
    array('category' => 'corp','industry' => 'Accounting'),
    array('category' => 'fin','industry' => 'Accounting'),
    array('category' => 'man','industry' => 'Airlines/Aviation'),
    array('category' => 'tech','industry' => 'Airlines/Aviation'),
    array('category' => 'tran','industry' => 'Airlines/Aviation'),
    array('category' => 'leg','industry' => 'Alternative Dispute Resolution'),
    array('category' => 'org','industry' => 'Alternative Dispute Resolution'),
    array('category' => 'hlth','industry' => 'Alternative Medicine'),
    array('category' => 'art','industry' => 'Animation'),
    array('category' => 'med','industry' => 'Animation'),
    array('category' => 'good','industry' => 'Apparel & Fashion'),
    array('category' => 'cons','industry' => 'Architecture & Planning'),
    array('category' => 'art','industry' => 'Arts and Crafts'),
    array('category' => 'med','industry' => 'Arts and Crafts'),
    array('category' => 'rec','industry' => 'Arts and Crafts'),
    array('category' => 'man','industry' => 'Automotive'),
    array('category' => 'gov','industry' => 'Aviation & Aerospace'),
    array('category' => 'man','industry' => 'Aviation & Aerospace'),
    array('category' => 'fin','industry' => 'Banking'),
    array('category' => 'gov','industry' => 'Biotechnology'),
    array('category' => 'hlth','industry' => 'Biotechnology'),
    array('category' => 'tech','industry' => 'Biotechnology'),
    array('category' => 'med','industry' => 'Broadcast Media'),
    array('category' => 'rec','industry' => 'Broadcast Media'),
    array('category' => 'cons','industry' => 'Building Materials'),
    array('category' => 'corp','industry' => 'Business Supplies and Equipment'),
    array('category' => 'man','industry' => 'Business Supplies and Equipment'),
    array('category' => 'fin','industry' => 'Capital Markets'),
    array('category' => 'man','industry' => 'Chemicals'),
    array('category' => 'org','industry' => 'Civic & Social Organization'),
    array('category' => 'serv','industry' => 'Civic & Social Organization'),
    array('category' => 'cons','industry' => 'Civil Engineering'),
    array('category' => 'gov','industry' => 'Civil Engineering'),
    array('category' => 'cons','industry' => 'Commercial Real Estate'),
    array('category' => 'corp','industry' => 'Commercial Real Estate'),
    array('category' => 'fin','industry' => 'Commercial Real Estate'),
    array('category' => …
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

And are the bootstrap and popper JS files also in the correct locations the HTML is looking for them at?

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

Your screenshot shows a file called jquery-3.6.1min.js inside the folder core/js/jquery.

However, your javascript says:

<script src="core/js/jquery/jquery-2.2.4.min.js"></script>

The file jquery-2.2.4.min.js, that your HTML code is looking for, is not there.

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

Glad to hear you got your question answered by yourself. It's a rewarding feeling, right?

Thank you for updating the forum thread with what you did so it can help others.

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

I would upgrade to a newer version of jQuery. The version you're using is pretty old.

The jQuery code to load menu.html inside #menu is correct, and the only reason it wouldn't be working is because:

  • menu.html and index.html are located in different folders
  • jQuery is not loading correctly
  • Something in plugins.js or active.js is preventing jQuery from working properly
  • Something else is going wrong in code you aren't including in your example here; For example, if other javascript on the page is syntactically broken, no javascript on the page will work

If you use Google Chrome, as I do, try opening the Developer Tools and see if any javascript console errors show up. You can do this by right clicking on the web page, and then choosing Inspect. Then, when the developer tools open, click the Console tab across the top, and see if it flags any errors. Other web browsers also provide similar functionality although I'm not sure offhand what it's called in Edge, Safari, or Firefox.

The best way for us to help you at this point is probably to just provide a link to the live version of this page, so we can diagnose for ourselves what the issue may be.

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

I'm not really a book person. I learned Redis just by reading the official documentation, doing, and lots and lots of experimenting and discovering. Redis-based Github repos are really good places to learn different real world applications. I think certain technologies just don't translate well to being completely explained in print.

I'm currently just using Redis for some persistent caching but I'm going to start integrating it into DaniWeb's live chat functionality soon for its pub/sub functionality.

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

Glad you got it sorted.

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

Another example:

$page = 10; // We set $page to 10
echo 'backward ' .$backward = $page--; // We set $backward to the value of $page, which is 10, and *then* set $page to 9
echo 'forward ' .$forward = $page++; // We set $forward to the value of $page, which is now 9, and *then* set $page back to 10
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

You are setting the value of $page to $backward, and then decrementing $page.

That's why you will notice that after executing:

echo 'backward ' . $backward = $page--;

The value of $backward is 10, and the value of $page is 9.

If what you are trying to do is decrement $page, and then set the newly decremented value to the $backward variable, you will want to do ++$page and --$page.

// Set the value of $page to $backward, and then increment $page
$backward = $page++;

// Increment $page, and then set the new value to $backward
$backward = ++$page;
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Oh, and I forgot to mention ... Does your domain have an account at Google Search Console?

Under Page indexing, what does it say? Are your pages back in Google's index?

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

The purpose of urlencode and rawurlencode is to translate weird characters that have no place being in URLs into a form that is URL-friendly, so that freeform strings can be properly transported within a valid-formatted URL without the URL breaking.

For example, https://www.daniweb.com/wdjd$&@“;!,.html is not a valid URL.

When you use user input (that can literally be absolutely anything) to dynamically build your URL, there’s a chance of the end user entering wacky data that makes no sense in the context of a properly formatted URL. So that’s why we encode the bits and segments of the URL that have the possibility to be “weird”, to ensure that our URL looks and functions like a valid URL. These urlencode functions “translate” weird characters and symbols that have no business being in a URL into encoded versions that represent the characters but in a way that is allowed in URL strings.

$_SERVER[PHP_SELF] is the URL of the current page, according to php. If PHP is telling us it’s the URL representing the page we are on, it goes without question that it’s a valid URL. There’s no need to encode any invalid characters because we won’t find any invalid characters in a valid URL.

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

I suspect you can get it from Samsung’s website. Or Amazon. We don’t allow our members here to link to eCommerce sites they are affiliated with, so any such responses will be removed.

Grahamstephan commented: Thank You Dani +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi and welcome :)

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

I’m glad you were able to figure it out on your own. Thank you for following up with what you did to fix it.