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

$("#subtot").val() is javascript but you are attempting to pass it into a php function. Php doesn’t know what to do with it.

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

Use cases for this would be to transport a tiny bit of data via a URL parameter or the like, so I don’t see that as being a problem.

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

You mean instead of json_encode()? Json_encode and serialize have two different use cases.

Json_encode is the most space efficient way of converting a PHP array to a string.

Serialize is used when you want to transport an object as a string and preserve the object’s properties while in transit. (Eg what type of object is it, the object’s structure, etc.) This way when you unserialize it, it will return back to its original form. Because the string generated contains all this metadata beyond the simple data, the string it produces is much longer.

In my use case, we only need to transport array data.

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

If you don’t want to use their paid API, then I wouldn’t say this is a matter of being illegal or not. I would say it’s just not possible.

Unfortunately, if an app does not expose their API to the public, for free, there’s most often just no way of circumventing it.

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

It looks like WhatsApp does not have a public API for your app to directly tap into.

There are paid solutions you can use such as Twilio that you can then integrate into an app that you build.

奇_925 commented: Do you have a circle about WhatsApp protocol development? +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Sorry, I don’t have any experience developing for it. Are you stuck on a bug?

奇_925 commented: Yeah,I want to develop a script that can mass texting in WhatsApp,but no underlying protocol technology. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Has anyone ever come across any authoritative statement from Google on their official position of whether RSS feeds should be noindexed or not?

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

The query cache, that rproffitt linked to, used to cache MySQL result sets for situations where an identical query is made and there have been no table writes to any of the tables involved in the query. However, it has since been deprecated.

I recommend using something like Memcached to cache query results. We do that here at DaniWeb with great success. However, when using caching systems such as Memcached or Redis, it can always take some playing around to get the optimal hit/miss ratio. Otherwise, it could end up slowing you down more than speeding you up. In other words, it takes resources to save to the cache, so if you’re saving to the cache more than you’re utilizing what’s in the cache, that’s not a good thing. Plus, caches like Memcached only know how to store data for a particular duration of time. You will have to manually clear the cache each time a table is updated. It isn’t like the built-in query cache that automatically invalidates queries for tables that are modified.

rproffitt commented: Oh my. Times change so I must too! +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Robots meta tags and robots.txt do two completely different things. Which you use depends upon the specific use case for each of your pages.

The robots.txt file is used to disallow certain bots (e.g. Googlebot) from accessing parts of your site. You can specify which files or folders should be inaccessible and which bot(s) they should be inaccessible to. (For example, you can make a URL accessible to Googlebot but not to Bingbot.) You may wish to make certain sections of your site uncrawlable by search engine spiders if you feel it would be a waste of resources to visit those sections. For example, Googlebot has limited crawl resources to devote to each website, known as crawl budget. Sometimes it makes sense to ensure Googlebot doesn't waste crawl budget crawling around an uninteresting section of your site, because then you might not have enough crawl budget left to crawl the high quality pages. Keep in mind that just because a webpage is inaccessible to Googlebot because of robots.txt, that doesn't mean that it might not appear in the search results anyways. Sometimes, if there are a lot of backlinks pointing to a URL, Google might decide that URL is valuable even if it can't access it! When that happens, there won't be a page title or description in the search results, and the URL will just appear on its own with no context.

You can use <meta name="robots" content="noindex"> when you want Google to not index a particular page. As …

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

According to a Google search, Syncfusion seems to be a solution but unfortunately it isn't free.

Personally, I use wkhtmltopdf, which is open source, but I am in a Linux environment and use it with PHP. I don't know if there's a way to use it with C#.

mtyide commented: I need a free and robust solution, this has to be a nuget package I can simply add on to my project. +3
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Sometimes we have a need to take a simple PHP array and represent it as an encoded string.

One use case that we have for this at DaniWeb is when a new user signs up, and we ask them to click on a link that was sent to them via email to verify their email address. The URL that they click on has, as a query string parameter, an encoded version of a PHP array that contains information such as the user's ID # and email address. This way, when the user clicks the link, we already know everything we need to about the user and can easily update that user's ID record, without their email address being in plain text in the URL that they click.

Basically what we're doing is converting the array to a JSON string that represents the array contents, then converting that string to a hexidecimal string, and then converting that base 16 string to a base 62 string to condense it (by utilizing A-Za-z0-9).

For example, suppose I have the following PHP array:

$array = array('foo', 'bar', 'baz', 'bat');

This function will convert that array to the simple string 43iGVuUpQisSlw7JnbQyrR8c2AtKX8lCiT.

This also works with associative arrays, multidimensional arrays, etc.

As a reminder, this does not one-way encrypt the string, and it's pretty easy to decode, because it just encodes the string, and doesn't encrypt it. Don't use this for passwords or for anything sensitive!

A good use case is, what we do, which is …

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

Hi and welcome to DaniWeb! I snipped the link to your Telegram group because we don't allow solicitations in our forums. That being said, people are free to reply to you here.

However, it does seem a little concerning that the app would make health diagnoses without the patient being seen by a medical professional.

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

A little while ago, I wrote a tutorial about how important it is to sanitize PHP user input strings. Not only is it important to sanitize user input being fed into a database query, but it's also important to sanitize user input being displayed to the end-user to generate valid HTML: For example, converting & to &amp;. Otherwise, you can end up with javascript injection attacks and that sort of thing. This happens when a malicious user fills out a user field with javascript, for example, it isn't properly sanitized, and it's displayed on a webpage where a different victim user's web browser sees it and it executes the malicious javascript.

To combat this, I rolled my own template library for DaniWeb, which is built on top of the Codeigniter 3.1.x PHP framework. By default, Codeigniter, being an MVC framework, requires you to pass an array of variables into a view template that you want the template to have access to. My template library handles this by creating a class where you "assign" variables to a template. For each of those variables, it sanitizes them to make sure they aren't vulnerable to any injection bugs, and also runs them through a bad words censor. This makes it really easy to make sure that there are absolutely no injection bugs anywhere on DaniWeb, as templates literally only have access to variables that have been passed through the filter.

Here's an example of how I would access my template library from …

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

DaniWeb is built on top of the Codeigniter 3.1.x PHP framework. Although I probably should have built it as a CI model, here is the database library that we are using. You can see it mainly serves as a wrapper for CodeIgniter's built-in database class.

You can see we use a master-slave database setup. Some of the functionality includes logging if a slow query takes more than 1s. We also group all queries that are the result of a single POST request (e.g. submitting a form, etc.) in a transaction. If a query fails, we retry it, and if it fails multiple times, we roll back the transaction.

I hope this helps you with your own project, and even if it doesn't, perhaps you'll find it interesting.

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

What is the most effective strategy for a website that does not receive enough traffic?

Buy ads.

Which tool or software is the best for tracking website traffic?

Google Analytics.

What are some effective methods for driving traffic to a website?

Buy ads on social networks (Facebook ads, etc.) or Google Ads, or drive organic traffic from your social media pages.

Is there a way to measure the ROI of digital marketing campaigns?

Yes, Google Analytics can help you with this. So can Google Ads.

What common mistakes do people make when they start digital marketing?

Spending too much money per click.

Is it effective to hire a digital marketing agency?

It can be, yes.

What are some common pitfalls of digital marketing?

It can be a money drain if you don't stay focused on your ROI.

If I want to hire a marketing consultant, what are their expected charges?

Generally, they would take a percentage of your overall marketing/advertising budget that you are going to spend with them.

As my earnings are low, I want to get a discount on marketing resources. Do you know any deal or coupon websites offering discounts for digital marketing services and tools?

Read! Read! Read! There's nothing like doing it yourself through learning.

Good luck!

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

A PHP array is essentially a stack of elements that can be used to denote a list, represent a collection of variables, etc. You can easily use loops to iterate over each element of an array. As PHP is a loosely typed language, all of the elements of an array are not required to be of the same data type. You can also create an array of arrays, also known as a multidimensional array. Array keys can be either numerical or strings, and there can even be arrays with a combination of both key types. Arrays with string keys are known as an associative array, and they essentially function like an array of key-value pairs.

Here is an example of a numerical array:

Array
(
    [0] => foo
    [1] => bar
    [2] => baz
    [3] => bat
)

Here is an example of an associative array:

Array
(
    [banana] => yellow
    [apple] => red
    [grape] => green
)
Push elements onto an array

The easiest way to push multiple elements at a time onto the end of an array is to use PHP's native array_push() function as so:

$stack = array("orange", "banana");
array_push($stack, "apple", "raspberry");

When doing so, the elements added to the array will always have numerical keys, even if the existing array is an associative array. Something that people tend to not realize is that, when you just want to push one element onto the end of a PHP array, you should avoid the function call entirely, as …

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

Wish I could help but unfortunately I don't know of any. I used to attend Affiliate Summit conferences pretty regularly though. Perhaps there's a forum over at https://www.affiliatesummit.com/ where they can make recommendations?

jwatson commented: Thanks Dani for reply. +3
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I've finally recovered enough from COVID to make it back to my computer for short periods of time.

Are you still having problems / confused with this? If so, I'll take the time to help.

Ant_426 commented: I'm sorry to hear you were ill. I trust you have recovered and are feeling better. Thanks for taking the time to answer. Appreciated. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I can’t really provide a good answer right now because I’m typing on my iPhone from bed. However, you shouldn’t be making assumptions about the state of arrays being passed into a form (or assumptions about what any user input looks like, for that matter).

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

By definition, REST APIs all follow a specific set of constrains as to how it functions. Using a framework that already takes all of the nuances of REST into consideration can significantly shorten your development timeframe, as you won’t have to reinvent the wheel.

That being said, I wrote the DaniWeb Connect API (which is a RESTful API) from scratch.

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

I’m in bed with Covid.

pritaeas commented: Plenty of time then ;) +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

The SQL query would be something like:

SELECT COUNT(*) FROM ip WHERE ip_address = 'x.x.x.x'

If it returns 5 or greater, then redirect them.

It's hard to know the exact code to use because you haven't told us if you're using a PHP framework, the library you're using to connect to the database server, etc.

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

In your examples 2 and 3 are missing final } on while loop

Yes, that would cause a PHP fatal error which would cause the PHP script to just not display anything.

Ant_426 commented: Please see copy/paste comment to Andris above. I have full error reporting turned on and I am not receiving any errors. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Can I mark this question as solved? Or does it still not work?

AdamFriska commented: I'm pretty sure it's solved, looks ok to me +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I think the goal should be to create the illusion to the gamer that so much is going on simultaneously when, in fact, a lot of things are over-simplified, not truly random, etc. behind the scenes.

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

Why did you choose to use MongoDB for this use case? Why convert IP strings to hex? How does it make them more searchable that way? Also, why not use existing solutions, as rproffitt mentioned, such as GeoIP?

sankar2000 commented: it will not be a just a simple geoip database, will have other features aswell +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Maybe there are simply no rows that have the quote_id set to the value of $qno simply because your first query literally deleted all the rows that existed in the database where that was the case.

Ant_426 commented: Unfortunately not. The data is visible in the table in the database. I simply included that as an example of some code which is working +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Who to blame? the CTO or CMO?

Also, playing the blame game between executives at your company is not going to solve or fix anything. Learn from your mistakes and move on. Work as a team towards making every day better than the last. Good luck!

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

In 2022 (as opposed to a few years ago, when Google was really prioritizing AMP in the SERPs), does it make sense to use AMP pages for a content-based site, but not news-based site (e.g. Google News is not relevant) if you can achieve all good core web vitals metrics without it?

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

I don't think it's a failed launch at all. You got thousands of registrations, congrats!!

Digital media is all about learning and adjusting. Facebook, itself, lived by the mantra to move fast and break things in its early days. Build stuff, get it out there, see what works, see what sticks, and be quick to change what doesn't.

So now you know what works and what doesn't. You found a way to get thousands of registrations, so that part was a success. You learned that your existing verification system is not as optimized as it needs to be, so you know what you need to fix. So fix it so the next thousand registrations will be verified.

As for all the ones who dropped off, send them an email letting them know the verification process has been streamlined into just a few simple clicks, and lure them to pick up where they left off.

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

I'm back!!

After a month-long break, filled with family visits, getting married, and going on our honeymoon, I'm finally back!

Family is still in town for another couple of weeks, but I'm going to start returning to my desk most afternoons.

rewagupta commented: Congratulations to start a new part of your life +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

It looks like the code was taken from here but it also appears in lots of other places such as here or here.

Please always give credit where credit is due when copying/pasting someone else's code. Otherwise, it's code theft. While we have a community rule against copying/pasting from elsewhere for copyright reasons, I think it's fine in this case because this specific snippet was found soooooo many places around the web that it's probably public domain at this point.

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

Welcome to DaniWeb :)

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

I see you replied to me personally. So that everyone else following this thread is in the loop, you've got it to a point where:

I think it returned a positive, error-free var_dump because this was the result: object(mysqli_result)#3 (5) { ["current_field"]=> int(0) ["field_count"]=> int(3) ["lengths"]=> NULL ["num_rows"]=> int(1) ["type"]=> int(0) }

Now that you have that, you need to loop through the result set.

You can now loop through the results with a while loop, instead of a for loop. This way you don't need to count the number of results first:

// Loop through each row in the result set
while ($row = mysql_fetch_assoc($result)) {
    // For each row ...
    echo 'Daily Remaining Balance: ' . $row['dbalance'] . '<br>';
    echo 'Monthly Remaining Balance: ' . $row['mbalance'] . '<br>';
    echo 'Available Balance: ' . $row['balance'] . '<br>';
}
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

It's a good strategy to use var_dup() to spit out the output of a variable, to make sure you're on the right track.

Right after line 14, $result = mysqli_query($MyConn, $query);, then do var_dump($result); to make sure that you're actually correctly querying the database and getting a resultset. What does it print out when you do that?

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

Get rid of all of the:

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;

and

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

that is before and after the Welcome! button.

Also, you have a bug in the a.btn CSS where you have border-radius; instead of border-radius: (semi-colon instead of colon).

Now, I'm not quite sure what you're trying to do. What do you want the Welcome! button to look like? The easy fix, of course, would just be to change display: inline-block; to display:block; with the a.btn CSS.

The alternative fix would be to wrap the <a class="btn" ... button HTML with <div style="text-align:center"> and </div>.

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

Sorry you're having a difficult time. I would try applying as a freelancer on sites such as Upwork. I've had good experiences hiring from Upwork in the past.

cornDMT commented: Thankyou +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

SEO is the practice of optimizing your website to rank highly in search engines, namely Google.

What is your specific question about SEO?

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

I will disagree with rproffitt. Among all the social networks, LinkedIn is the best in terms of generating leads, because you're fostering a professional relationship with people there one-on-one. Beef up you LinkedIn CV with your skill set, encourage your coworkers (both past and present) to review you. Post to your wall about the interesting things you, or your company, are working on. Once you've built credibility around yourself, you can pitch your business and be taken more seriously, like you know what you're talking about, and come off as trustworthy.

rproffitt commented: I've seen folk try to go with LinkedIn alone only to ask why it's not working. +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

What is the model?

Eg https://www.cyberpowerpc.com/

lewashby commented: All I could find was a product ID and device ID. +6
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Not sure what you mean by duplicate? The URL you linked to is this exact same one.

rproffitt commented: Fixed the link. +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I am trying to get the hang of Google Analytics 4.

One of the conversions that we track is sign ups.

I'm seeing a lot of conversions attributed to the Organic Social group. However, a lot of these conversions are people who found the site some other way (e.g. organic search), and then subsequently signed up through a social OAuth flow (e.g. Log in with Facebook).

We are using the cross-channel attribution model that looks at first click, last click, etc. So I get, I suppose, that I'm wanting to look more at first click organic social conversions as opposed to last click. However, this still doesn't give me an accurate picture when someone first stumbled across my site from organic search, then subsequently from a facebook post, and then chose to sign up.

How can I exclude the portion of the conversion path that goes https://www.daniweb.com/connect/profile/auth/ -> redirect to social network OAuth -> redirect back to DaniWeb from the conversion flowchart?

Hopefully this makes sense.

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

I also want to add that Google Search Console just started showing a performance report for this never-before-seen search appearance starting on May 11th.

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

Yes, and this was a mistake that I made many years ago with DaniWeb. The problem is that Google has a limited amount of crawl budget to crawl and index all the pages of your site. In our case, we were using up almost Google's entire crawl budget crawling thousands of tag pages, that don't actually have any real, quality content (just links to the content pages). That meant very little crawl budget was left over for the actual content pages. We were hit with a Google Panda penalty, which is an algorithmic penalty that targets "thin content" sites ... sites where most of the pages indexed don't have a lot of quality content and text.

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

Are you interested in SEO? Huh?

jwenting commented: no, he's just another spambot +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

SEO agencies are a dime a dozen nowadays. It's nearly impossible to rank in Google for "seo agency" or any such keywords. Therefore, agencies target local markets (such as "[city name] seo agency") because, presumably, there are only a couple of other seo companies in the same geographic area, and therefore less competition to rank in Google against them. This works if the agencies are focused on local SEO, which means doing SEO for local brick and mortar companies that have a storefront, and want to rank for things like "<business type> near me", easily found in Google Maps, etc.

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

Hi and welcome to DaniWeb!!

The problem that you are likely to encounter is that anti-spam functionality has become very sophisticated nowadays, and one of the things that it specifically singles out is when there is a one-off blast to thousands of recipients.

For example, here on DaniWeb, we have a 20 year history of slowly and steadily acquiring new emails for our mailing list, messaging opted-in users regularly, removing bounced emails from the list, etc. One of the things that email providers such as Gmail, etc. like to see is that a list has been slowly growing organically over time, and that unsubscribe requests are honored, emails that bounce are removed from the list, and users who don't engage with the email contents are also removed from the list over time. The key to making it through email spam filters is consistency!

To just send out a one-time blast to 12K recipients, the thing that sets off spam alarm bells is, did these recipients opt-in to receiving marketing-based emails from you? Where did this list of 12K emails come from? Did you buy this list of 12K emails, or did you grow the list organically, yourself, over time? Remember, with both US-laws as well as just about all email provider terms of service contracts, you are prohibited from sending marketing-based emails to anyone who hasn't explicitly opted in to receiving marketing-based emails from your company. Long story short: It's going to be close to impossible to, out of nowhere, …

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

I got my answer!

The Core Web Vitals, as well as the Enhancements section, are both based on CruX (Chrome User Experience Report), which is essentially a live sampling from actual Google Chrome users.

Although we have hundreds of thousands of pages of content accumulated over the past 20 decades, only 35K URLs on my site have been accessed over the past 7 days. (That number jumps up to 73K over the past 30 days, but it looks as if Google Search Console is pretty in line with data from just the past 7 days.)

AussieWebmaster commented: GSC is a sampler - and as you nopticed it looks at very recent numbers - do a site: to see how many pages in the index +4
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Wow, am I far behind the game. Javascript I of course knew. Cookies I didn't!! Thanks for that, Frank.

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

The Coverage section of Google Search Console shows 206K valid URLs, of which 174K are submitted and indexed, nearly all of which are Q&A pages. The remaining 32K are indexed, but not submitted in sitemap.

However, the Core Web Vitals section only shows data on 28K URLs. In the Enhancements section, it says there are only 27K valid Q&A items.

What happened to the other 150K URLs?