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

On the mac, there's a little checkbox that says "Show with clock".

Screen_Shot_2022-03-27_at_10_11_27_AM.png

rproffitt commented: Nice. The last time I saw Windows fire works SS was in Windows 3 with some addon pack. No clock. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Didn't Microsoft Windows have this built-into their OS many, many years ago?

rproffitt commented: It did but no onscreen date&time feature. +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

sleep() is the right approach, but you have to play with flushing the output buffer to force what should be echo’ed to the browser up to that point to the end-user. Sorry, I wish I could type more but I’m on my phone and not home.

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

Try clearing your browser cookies and cache.

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

As to comment limits here, I use a reply when I need to write at length.

Click the "Reply to this Topic" purple bar at the bottom of the page.

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

Owning data is a must for ad revenue. Someone has to set the initial rules.

I guess I'm having a difficult time understanding how your platform will be different from all the other platforms already out there: You set the initial rules. You decide how people can gain power to override the rules. You own all data.

That sounds to me a lot like all the platforms that already exist. If you own the data, how can you pass ownership of the content to the members? Are you envisioning that you will always own all the data? Or can each individual member choose to monetize their content in whatever way they deem fit?

As someone who has been running an online community for over half their life, here are the things I have found members of social media sites, by and large, are frustrated by:

  • They are angry they don't own their own content
  • They feel as if their freedom of speech is denied by having to succumb to rules set and enforced by others (e.g. someone wants to have 100% control over what they are allowed to post on their own Facebook page)
  • They can't choose to monetize or not monetize their own content in exactly the way they want to (e.g. an open-source fanatic doesn't want a Microsoft ad displayed next to the content they write, or they may be anti-ad and not want any ads at all on pages that include their content)
rproffitt commented: This is gold. Will others see this as gold in the next question. +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

IMHO, you're being hypocritical.

On one hand, you're saying that you want to create a platform owned and run by its members.

On the other hand, you're saying that there should be a ban of all political speech on weekdays, a rating system that disincentives swear words, promotion of content about strikes and boycotts, etc.

In other words, this is not a platform where the members make the rules. This is a platform, just like every other social media platform that already exists, where its creator makes the rules. The only difference here is this platform revolves around your rules and your values. However, don't be confused. Your platform doesn't encourage free speech any more than any other platform does.

In your previous topic, you were saying you wanted to create a hybrid platform that is a mix of certain aspects of Reddit and certain aspects of Facebook. That is why my recommendation was to create a platform from scratch. I estimated it would take 2-3 programmers 8-16 months to create something pretty robust. However, you could probably launch with an MVP (minimally viable product) after about 4-5 months, and then take another half a year or so to onboard the first handful of users which you would ultimately learn a lot from in terms of what features and functionality would make it a polished product.

However, if you just want the minimum functionality of being able to post and vote, then you can do that for free by installing …

stratozyck commented: Owning data is a must for ad revenue. Someone has to set the initial rules. +0
rproffitt commented: Not to mention that you get both desktop and mobile right out of the gate. Try that on a Rolled It Myself site. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

He’s saying the creators (aka him and the initial dev team he hires that he would pay a salary to) would initially own 100%. With the plan of handing that ownership over to the members and moderators who grow the community over time.

It seems as if he doesn’t like how Reddit, the business, owns all of Reddit, but rather that the subreddits should each be owned by the members and moderators who lead each subreddit.

stratozyck commented: Yes, and I hate how FB encourage antisocial behaviors. No, we should not all move into the Meta.” +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

That is not at all what I understood from the question. He wrote he wants to fund a prototype for a platform that is a hybrid of Facebook and Reddit in terms of moderation functionality, and then release it “to the people,” to quote him, without plans for it ever being a hugely profitable business.

stratozyck commented: Yup, I just want a simple post, track users, track stuff for data mining for ads. I could do it but I don't have the time. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I completely disagree. Reddit didn’t start with billions. Neither did Quora. I know it was a long time ago, but I bootstrapped DaniWeb with a $20 initial investment and quickly displaced the largest tech publications at the time (CNET, Ziff Davis, etc.)

It is also completely reasonable for a project of this magnitude to be coded by one person because I coded DaniWeb myself, and I don’t see a Reddit-like platform as technically THAT different from ours.

If you were to hire a couple developers, I think you could do the entire thing, all in, for less than $300k and 8-16 months of work. I’m assuming 2-3 full time devs each being paid $100k. If you’re a programmer yourself, then of course you would save most of that money. I used to also do mostly C++ and I found it relatively easy to pick up PHP web development because the syntax is very similar in style to C.

I agree that Reddit today might be worth in the billions, but that’s because of the value placed on how much traffic it gets, the size of its database, and user base. It did not take anywhere near that amount of money to get to that valuation.

stratozyck commented: This guy gets it. Everyone else read it as “I want to compete with Reddit today.” +0
jwenting commented: neither started with billions, but to make a competitor with what they are now you would need it... +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi there and nice to meet you. What types of digital marketing do you focus on? I have over 25 years experience in SEO (before it was even an industry!)

bestbiz17 commented: I would like to venture into SEO for a start. Is there a guide for me to begin with? +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Basically what I am suggesting is just having one query where you don’t need the foreach loop. I’m in bed right now so it’s hard for me to type out from my phone, but try playing around with the group by clause.

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

I highly suggest that, moving forward, you comment your code as you go so that it’s easier to read and easier to follow.

Your code is a bit of a spaghetti mess, which I’m sure makes it very hard to debug when something like this happens.

Plus, you have things like:

$count=$count=$stmt->execute([$debname, $debmd5,$debsize, 3]) ;

Why do you have count=count? And what is it counting? I noticed you also are performing a lot of calculations without putting in comments why you are doing those calculations or what you are trying to calculate. That makes it very difficult for someone else to review and understand your code, but it probably makes it very difficult for you to debug or remember why you did it that way, if you need to revisit the code in the future.

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

Also, everything is wrapped in

function convert_filesize

but I don’t see you calling that function anywhere.

You should put echo statements beneath each SQL query and ensure that code block is even being reached.

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

The solution I got is to use a DISTINCT action in my SQL code.

OMG! I'm sooo sorry. I got brainwashed after reading rproffitt's post ... it's DISTINCT, not UNIQUE. And I knew that!!

LIMIT 1 just limits the query to a single row. What if you remove the LIMIT 1?

rproffitt commented: "Dani has formed a new core memory." Sorry about that, I really need to double check when pulling from memory. +16
lukwagomedia commented: That's alright. +1
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I would stick to PHP and MySQL as they are free and there are a lot of online tutorials and resources catering to newbies. There is also phpMyAdmin which is a web-based GUI to visualize your MySQL databases and tables.

I use the PHPStorm IDE and it, also, has a built-in UI to visualize and interact with MySQL.

How can someone write about foreign keys, relational databases and not have been exposed to SQL?

By using GUI based tools to design and interact with tables without writing out actual SQL statements. Similarly, I am familiar with code commits and forks and whatnot by using my IDE's UI-based Github integration without knowing any of the CLI git commands.

jwenting commented: you'd still need to know what happens at the database level for those things to make sense... +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

php.ini has a maximum file size limit, maximum execution time, maximum memory, etc. You most likely are hitting one of these limits.

jwenting commented: and even if not one of those, limits set in the web server configuration or the configuration of some proxy or firewall that guards that server +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

Here's a link to the tutorial I just wrote, based on my post here: https://www.daniweb.com/programming/web-development/tutorials/537376/sanitize-php-user-input-strings

rproffitt commented: My son's name is Robert'); DROP TABLE students;-- +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Suppose you have a php script where a user is prompted to enter a number. You then do something with that number ... you increment it, perform some other math calculation on it, search the database for records with the ID # the user passed in as a query string, etc.

But what if your script is expecting a number, but they passed in something like apple?

What if you were expecting the end-user to visit the URL www.example.com?id=5 but, instead, they went to the URL www.example.com?id=apple?

You can't increment apple, as it would throw an error. You can't look up the ID # apple in your database ... or worse yet, a malicious person can use an SQL injection attack string that could actually destroy your database!

Therefore, you always want to sanitize user input into the format you are expecting.

If you are expecting $variable to be an integer, then do $variable = intval($variable); and that will convert whatever $variable happens to be to its integer equivalent. If you are expecting $variable to be a positive integer (e.g. an ID # in a database) then do $variable = abs(intval($variable));. If you want to strip HTML tags from a string, you can use the strip_tags() php function.

PHP additionally has sanitization functions to ensure a string is properly formatted as an email or a URL. Here is a more complete list but you can use it as so:

// To strip all characters except those that are …
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Suppose you have a php script where a user is prompted to enter a number. You then do something with that number ... you increment it, perform some other math calculation on it, search the database for records with the ID # the user passed in as a query string.

But what if your script is expecting a number, but they passed in something like apple.

What if you were expecting www.example.com?id=5 and they went to the URL www.example.com?id=apple

You can't increment apple, it would throw an error. You can't look up the ID # apple in your database ... or worse yet, a malicious person can use an SQL injection attack string that could actually destroy your database!

Therefore, you always want to sanitize user input into the format you are expecting.

If you are expecting $variable to be an integer, then do $variable = intval($variable); and that will convert whatever $variable happens to be to its integer equivalent. If you are expecting $variable to be a positive integer (e.g. an ID # in a database) then do $variable = abs(intval($variable));.

Suppose you want to pass a string into MySQL. I've seen MySQL queries from you (in previous posts here at DaniWeb) look something like this: SELECT * FROM user_table WHERE string = '$string';

The problem with this, is what if $string contains a quote?! What if the value of string is My name is 'Dani'.

Then, you'd actually be running the SQL query: SELECT * FROM user_table WHERE …

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

Firstly, the best way to upload files via PHP is not via FTP.

Check out https://www.dropzone.dev/

If you want to upload files to your own server (which it seems like that's what you're trying to do), use https://www.dropzone.dev/js/

If you want everything to be handled for you (including hosting the files), use https://www.dropzone.dev/plus/ (but it costs money)

Documentation is at https://docs.dropzone.dev/getting-started/installation/stand-alone

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

I use DropzoneJS and I’m quite happy with it. It’s quite popular as well.

Divyansh_5 commented: Can you please elaborate? Like the steps, i am bit new to this. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Outsourcing a mobile app like that, excluding everything else, to a small overseas dev team is probably about $250,000.

jwenting commented: and that's just the app itself, without all the hardware, support infrastructure, etc. etc. needed to operate it +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

So sorry! I forgot to reply to this the other day.

I do see you have class="collapse show" That means you want it to be shown by default, not collapsed. I would remove the show class. Also, remove the collapsed class. Let the Javascript handle that itself.

Are you including Bootstrap's JS file? It might help to provide a live link to where this isn't working so we can investigate the whole page and make sure there are no javascript errors causing it to not work.

https://getbootstrap.com/docs/5.1/components/collapse/

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

SEO is changing every day, but yes, I think think a big part of SEO is seeing what spammy SEO techniques people are trying to use, and find a way to counter them and prevent them from continuing to work. 2021 was all about guest blogging no longer being effective. I feel like that trend will continue. I also think Core Web Vitals will become a bigger signal.

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

There's a lot more to it than that, of course. Otherwise, everyone would be able to easily game SEO!

You need a good combination of strong backlinks also talking about those keywords, and in-depth content on your site also talking about those keywords, among other things.

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

Sorry, I was in bed not feeling well all day yesterday so I wasn't able to properly articulate myself while typing from my phone.

You have the code here:

     $ext = pathinfo($l_filename, PATHINFO_EXTENSION);
     $stmt = $pdo->prepare("INSERT INTO download (address, filename,ip_address) VALUES (?, ?, inet_aton('$ip'))");
     $stmt->execute([$ip, $ext]);

Basically what that code does is look at the extension for whatever filename is passed in, where an extension is simply what comes after a period. Since someone can type anything for l_filename, such as anything.malicous-extension then you don't want to plug that directly into a MySQL query.

Absolutely ANY TIME that any portion of a database query is generated using end-user freeform text, or text derived from end-user freeform text, there's a way of a malicious end-user to exploit that, and so you always want to sanitize.

For the $ext being passed into that MySQL query, you would want to wrap it around this function call: https://www.php.net/manual/en/mysqli.real-escape-string.php

Secondly, you have:

$file_url='http://foxclone.org/downloads/'.$l_filename;
...
readfile($file_url);

The same thing here ... Because $l_filename can be potentially malicious, if $l_filename is something malicious, and then you have PHP code to readfile(), you can potentially be reading and executing malicious code on your server.

What format are you expecting $l_filename to be? If you're expecting it to be just alphanumeric characters, then strip away all non-alphanumeric characters from the string before using it. If you're expecting it to be 25 characters, for example, then prevent end-users from potentially making it 5000 characters before it's attempting to …

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

So I see you currently have code in place to create a big tree with all your categories. Do you want to be able to click on them and have them expand/collapse without refreshing the entire page? If so, this can only be accomplished with Javascript.

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

Glad you got it fixed. I was going to say, the problem is that you are echo'ing out the "unable to connect" string before calling header(). You can't echo anything to the screen before any header calls.

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

Hi and welcome to DaniWeb. However, I have to ask. Why a Photoshop clone in Java?

rproffitt commented: "When you have a hammer, everything looks like a nail." +0
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

Welcome to DaniWeb! Good luck in your studies. Do you know yet exactly what field interests you after graduation? What are you getting your bachelors in?

serenityh commented: I'm getting my Bachelor's of Science in Multimedia Design and Development. This will be my second bachelors. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

As an author of embedded software which has no UI, "Any project" is overreaching

Firstly, this is the UI/UX Design forum, so I would say it applies to any project within the context that this post was made in. That being said, UI and UX are very different things. UI is user interface. UX is user experience, and I would argue that any project has a target user in mind with the goal of creating a positive experience for that user.

In the context of end-user facing software, the user experience is the overall user friendliness, and whether the app was designed to meet those needs or goals. In the context of embedded software, perhaps you are writing an API or some lower level functionality to be ultimately utilized by other devs. In that case, you still need to take into consideration the users of your product (even if your product is an internal API, and those users of your product are other devs utilizing your internal API) and creating something usable, functional, and beneficial for them.

Or, suppose you are writing embedded software for something like an alarm clock. You still need to factor in the needs of the end-users. Will there be a visible display? Will there be an on-off button? Or will it be a switch? Or will it be a touchscreen? One of the prototypes might have a touchscreen and then it's ultimately determined that half-asleep people weren't able to focus on a touchscreen, …

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

Hi David, welcome to DaniWeb! I've been doing SEO for over 25 years and I'm truly passionate about it. Feel free to start any discussions about the topic and I'll be sure to chime in.

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

If you still want to hire an outside firm to develop this app for you, despite my strong hesitations, I would check out Upwork or Toptal.

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

There are many free or low cost Wordpress themes available, but it's going to be difficult to find an existing theme that is already laid out exactly like your wireframe design.

You can get themes at:

... and so many other places, but those are the 3 I am personally familiar with.

I'm not sure how tied you are to the wireframe you posted here, but I would highly recommend that you browse some theme sites, find a theme that works for you and that you like, and then make some adjustments to it to meet your needs in terms of how many headings, having both a top left and top right logo (which is quite unique), etc.

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

I have no experience with Java, but a quick Google search turned up https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpRequest.html

____ commented: is it the post method? because i need it +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

As rproffitt suggested, you can use something such as Log In with Facebook or Log In with Google. Most people only have one Facebook or Google account.

However, from a security standpoint, nothing is preventing them from creating another account.

You can also limit to the IP address + browser and operating system used.

That makes things a little more secure because you’re essentially limiting an IP address to a single Google account, for example. However, that doesn’t necessarily work because IP addresses change all the time and some IP addresses are used for entire company offices or everyone in a college dorm.

You can of course add a cookie to the browser when a user visits for the first time and then only allow future logins if the cookie exists. But that isn’t foolproof because cookies get cleared by the end-user all the time, they switch browsers, etc.

However, that’s what you’re limited to. A server being connected to via the HTTP protocol doesn’t have direct access to unique hardware IDs in the end-user’s computer or anything like that.

Can you please let me know your specific use case and I’ll see if I can think of the best fit for your needs?

rproffitt commented: "Make it foolproof and I'll find a better fool." +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Are both versions using the same CSS file? Is it possible that there is a second CSS file that is accessible in the remote version but not available locally?

Are there any JS files that may be altering the DOM that may be working in one version but not the other?

It’s not really possible for me to diagnose this without seeing the actual code. Can you please attach to a post the html and css of the local version (if the file extensions are not supported, upload as a zip or use a .txt extension)? Also, can you please link to the server version? This way I’ll be able to investigate the differences between them.

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

I don't believe you can. I don't see any contact information on that site to contact anyone, and there is no delete membership functionality. You can contact them here: https://www.whois.com/whois/finebookmarks.com

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

Let me know if you have any other questions. I'm really good with CSS but I have never used Squarespace before so I don't understand the limitations you're working with. However, I'm also pretty good at figuring out a way to get CSS to do what I want given a confined HTML structure.

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

Basically what it comes down to is you want to have an outer element set to inline-flex, and then each direct child element within it will be horizontal.

kevindougans commented: thanks very much, i'm making progress although not quite got where i want yet :) +4
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Working with the existing HTML you have:

  • Get rid of display: inline on .form-item.field.email, .form-item.field.select, .form-button-wrapper
  • Move the button to be inside the <div class="field-list clear"> element
  • Make the <div class="field-list clear"> element have display: inline-flex

Good luck!

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

Is there something that we could be doing better to make the site more user friendly?

java_marvin commented: Thank you. I am fine for the moment. If I have some suggestion in the future, I will tell you. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Click the purple banner at the bottom of the page that says "Reply to this Topic".

To insert code in your post, click the third button from the left in the editor toolbar.

java_marvin commented: Thanks, I finaly found it :-) +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Mine is READY. When I’m not playing in hard mode, my second is PIOUS.

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

Are you referring to an Uber or Lyft clone that only dispatches from your local cab company?

If so, what would the benefits of someone using the app over Uber, for example?

It’s not always the case that “if you build it, they will come.” Sometimes, it makes more sense to just go where the people already are.

Wouldn’t it be more profitable for your cab company to simply operate under Uber?

If I sell homemade jam, for example, it’s more effective for me to get my jam onto the shelves of the most popular supermarkets, where people are already shopping, than to build my own market to sell my jam, convince people to start shopping in it, and only sell my own food in it. It’s an uphill battle to convince people to now go to two stores: one for just my jam, and another for everything else they need.

People use Uber because it works anywhere, in any city, and at any time. What would be the advantage to downloading and installing your app just to use when they happen to need a ride in your city?

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

Yes, it’s unrelated to the browser’s asset cache. By “cache” I simply mean that jQuery’s get and set data() on an DOM element are essentially just getting and setting a Javascript variable attached to the element, with the added convenience of this variable being initialized to whatever happens to be the value of the element’s data-* property, at the time of page load, if any. Multiple data() calls to update the value does not update the corresponding DOM property, however.

This differs from setting the DOM data-* attribute with attr() because doing so almost serves as a visible variable that is being manipulated in the DOM itself.

The conclusion is either always use data() or always use attr() and you can never go wrong, because, in doing so, you’ll always be setting and getting the same variable attached to a DOM element. It’s making the assumption that you’re working with the same variable interchangeably that can cause undesired results.

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

Ahrefs free plan has some good core functionality as well. However, it’s definitely worth the money if organic SEO is really important to your business model.