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

There was a case quite a few years back where a Sikh wanted to become a member of the RCMP. The RCMP has a strict dress code that includes a particular hat as part of the standard uniform. This hat was not compatible with the traditional turban so his application was refused. The dress code was not created to exclude Sikhs. It had been in play for many decades before he applied. Should they have allowed him to serve by modifying the dress code?

I actually just googled this case and discovered that it is inaccurate that the dress code had been in use for many decades before he applied. About a decade earlier, it was modernized to be inclusive for women. So why adapt to be inclusive to women but not extend the same courtesy for other groups the uniform was a problem for a few years later?

Additionally, the department was in specific need of Sikhs because the community that it was serving had a large Sikh population, so there was a strong advantage to getting Sikhs on the force to ease the language and cultural barriers to serve the local community more effectively. It's good that he was able to successfully lobby for change, because doing so meant a better ability for the department to serve the community with no downsides.

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

A 5xx error means that the web server is configured incorrectly. When I tried to load your website, it took a very long time to load, but it finally did, without any 5xx errors. It's possibly that your website was temporarily down while Googlebot crawled it. However, this problem is not related to anything wrong on the SEO side. It has to do with the server that's hosting your site.

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

Sorry, I'm not understanding what you're trying to do. It looks like you're checking to see if an email is the same as a staff's email address, and if it is, don't use your own email?

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

I don't see if (isset($_POST['add_submit'])) anywhere in your code. Please show the code that includes that and then I can let you know if there are any typos that might be causing issues.

However, I do notice that on both lines 6 and 12 you are inserting $brand into the database, when $brand is pulled in from a POST request. It's very important for you to sanitize this before submitting it to your database, or you can be in danger of an SQL injection attack.

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

Sorry, I'm a little confused by what you mean. What do you mean by retain the selected value? When do you want it to retain the value? After submitting the form?

A dropdown will default to the option that has selected specified. So, for example, when iterating through the while loop, if $row1['class'] is equivalent to what was passed into the form, for example $_POST['selClass'], then you would want to set it to be selected as so: <option value="value" selected>.

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

I've seen folk try to use SEO and such as you listed but their basic product and reputation remain the same. I consider product, company and the folk that run the company the foundation. If these are missing then proceeding with more marketing does not change what they are building on.

Yes, product, company, and company leaders are the foundation, and if they are missing, any amount of marketing won't help. However, I still feel like it's incorrect to say that digital marketing is not special from the forms of marketing that came before it, it's just marketing over a different medium, and nothing has changed in marketing.

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

Digital marketing is NOT SPECIAL. It's just marketing done over the Internet or some call digital signage, digital marketing. Nothing has really changed in marketing. Just a change in having more delivery options.

I cannot disagree with this more. Digital marketing is unique from marketing that has been traditionally done for the past 100+ years. First there were print ads. Then tv commercials, which were an evolution of print ads. They were a different format, but the process was largely the same. Then came digital. At first, in the early 2000s, digital worked much the same as other multimedia ads before it (tv commercials, digital billboards, etc.) However, with user generated content, social media, search engines and SEO, digital marketing has now evolved into a completely different ballgame from the way that marketing has been done for the past century plus.

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

It’s hard for anyone to help you because you’re not really describing what your problem is. Is the code you provided not working? Are you getting any error messages? Your topic title says to write an algorithm and then you just posted a bunch of code. We are confused how we can help.

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

Can you please post your code here? The page you linked to seems very spammy.

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

I'm looking for some alternatives to Swagger UI that I can use with my API's swagger file to generate our official documentation.

So far I've been looking at Apiary and ReDoc.

Does anyone have any favorites? Which are the most intuitive for api documentation?

Ideally I'd be looking for one with a built-in console.

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

This appears to be part of a homework assignment, in which txt files are required but you didn’t attach them to your post.

Where are you stuck with this assignment? Are you getting any error messages? Please show us the code you have so far and explain where you’re stuck so that we can help you.

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

Good idea, Jim. You're also not going to suffer from ageisim going that route because you'll be in the same age bracket as everyone else with COBOL skills. The flip side of it is that absolutely everyone you'll be competing for a job against will have a 30+ year long career as a seasoned programmer.

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

Also, you might wish to connect with Narue who works as a programmer in the same city as you.

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

Hopefully you have no regrets 5 years from now.

I still think the logical progression for your career is a data analyst or database admin for the modern web. It evolves on your experience with MS Access and the like, is very high in demand, and works very closely with developers.

You can look into some no sql databases such as Neo4j, MongoDB, and Cassandra. Or stick to the regular ole Oracle, MySQL, and MS SQL.

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

HI William! Welcome to DaniWeb :)

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

I don’t want a 500 lb man helping me down a ladder either.

As I mentioned, we should be hiring the absolute best people for the job, regardless of what their personal grooming needs might be. If that means different weight brackets for each set of duties, then that makes sense because, as I mentioned, safety trumps all. If someone is not physically capable of doing the job, then they shouldn’t be given the chance to put other people’s lives in danger.

But a uniform for uniform’s sake doesn’t make sense to me. So, yes, I think that if an ideal candidate for the job doesn’t fit the uniform, the uniform is the problem, not the candidate, and therefore needs to be updated to meet the needs of the candidates of tomorrow. Otherwise we would all be running around wearing uniforms designed for life in the 1400s.

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

Glad I could oblige, Jim!!

I've had something else I've wanted to say, as well, and just never got around to it. Since you've updated this thread, I figured I might as well say it now :)

There was a case quite a few years back where a Sikh wanted to become a member of the RCMP. The RCMP has a strict dress code that includes a particular hat as part of the standard uniform. This hat was not compatible with the traditional turban so his application was refused. The dress code was not created to exclude Sikhs. It had been in play for many decades before he applied. Should they have allowed him to serve by modifying the dress code?

I absolutely feel like they should have allowed him to serve by modifying the dress code!! Not too long in our history, being a police officer was a "man's job". Women were forbidden from being police officers because the excuse was that there were no female uniforms. There are still so many industries today where dress code is an excuse not to progress into gender equality.

And then there was the infamous NASA spacewalk just last month. It made headlines for promoting it was going to be the first-ever all-women spacewalk. Female engineers cheered! Finally, women role models in the sciences! Teachers used it as a valuable lesson to teach in the classrooms. Buuuuuttt, embarassingly it was scrapped at the very last moment because there weren't two …

rproffitt commented: Small world. I lived in Richmond BC Canada and this came up. There were changes and soon they were on the force. There's more to this story. All good +0
Dani 4,675 The Queen of DaniWeb Administrator Featured Poster Premium Member

Ok, so yeah, the email address associated with this account begins with a K. I suggest you log out and request a password reset to your gabgarri account.

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

They probably created an original account with Social login with Facebook or Google, and when they tried to log in this time, it created a brand new account instead of logging them in. I’ll investigate. :)

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

I think it's realistic for someone of any age to attempt a new career in programming. My criticism is mainly of my experience with people who have come out of coding bootcamps.

6 months of time is not realistic to really grasp all but the very surface of programming, and that's assuming you're putting in 12+ hour days building up your portfolio. Check out this article I just stumbled across: https://techbeacon.com/app-dev-testing/bootcamps-wont-make-you-coder-heres-what-will

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

I'm curious as to why you think your age stands in the way as a data analyst, but it won't as a programmer?

I hate to say it, but I think that ageism is very prevalent in web development and mobile apps, which are where the focus of coding bootcamps are. Web apps today put a very heavy emphasis on catering to millennials, and so businesses want to hire people who "get" their target demographic.

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

If you have previous experience with databases, I don't see why it would make sense to shift completely away from that and start at ground zero as a complete newbie. Every website today is only as strong as its database, and data analytics is a huge industry, especially with machine learning powered by data mining, etc. According to Glassdoor, data analyst salaries are about $100K and database engineers average $150K/year around San Jose, CA. (Albeit the cost of housing is tremendous here as well.)

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

1) Is it realistic to even consider this as a career for the next 10 years for someone my age? Assuming it is,

Programming is a huge industry. Everything from writing hardware drivers to designing games for gaming consoles to building a website to on-page search engine optimization to front-end UI. You can get a full-time job in Silicon Valley or you can be an independent consultant working out of your home office or anything in between. They all require different sets of skills, have huge discrepancies in salaries, and some might be more suited to you than others, depending on your current skillset and interests.

2) Are there some coding schools that you can comfortably recommend that are accepted by the IT industry?

A lot of people love coding schools but I am one of those people who is not quite sold. I think they're great to teaching you how to build a snazzy website for a small business or a simple mobile app in a very short amount of time. That's what it's all about ... making you hireable as quickly and efficiently as possible. However, what they don't tell you is that without the background of a computer science degree, you will lack all of the mathematical and analytical experience required to focus on big data sets (e.g. working with billions of records), fine-tuning performance, etc. It's my personal experience that coding schools teach you what's necessary to land your first small-time consulting …

rproffitt commented: That's a quality reply. Great example. +0
Dani 4,675 The Queen of DaniWeb Administrator Featured Poster Premium Member

If your form includes two submit buttons that each need to do something different, you can use AJAX (Javascript on the front end) to override the form action based on which button is pressed.

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

Are you getting any more errors? If not, can you please mark this question solved. Thanks!

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

Were you able to get this done?

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

Were you able to figure it out? The code would be like this:

echo str_repeat("<img src='../public/images/star.png' height='20px' width='20px'/>", floor($row['average_rating']));

More information at https://www.php.net/manual/en/function.str-repeat.php

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

I think the reason you haven't received any responses is because your question is confusing. What do you mean by define said row? Which row? Define in which way?

I see line 4 you have (THE UNDEFINED ROW) but I'm not sure what you are trying to do?

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

I’m on my phone so I can’t type much but blank pages are due to php fatal errors. Typically these are syntax errors, calling functions/methods that don’t exist, etc.

You can set php logging to print out fatal errors instead of just a blank page. I don’t remember the syntax off the top of my head.

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

So you View Source each site you visit as you browse the web? I think if you have to View Source in order to tell, then it’s not obvious :)

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

I disagree. WordPress now powers more than one third of all sites on the Internet. Sure, you might stumble across a typical blog and instantly think WordPress. But there are so many sites out there I never would have thought we’re on the platform at first glance.

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

I find that a lot of folk won't ask the site owner the questions. Why is that?

Because, while it may be the case that imitation is the best form of flattery, some people feel self-conscious about coming off like a copy-cat, or they're afraid the site owner will think they're trying to be a competitor, or steal their hard work.

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

I see you marked this thread as solved. Do you still need help with code to change password? I suggest you begin by using the password_hash() function for joining and logging in, and then use the pseudocode I provided. Let us know if you need more assistance.

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

So it looks like you are storing passwords in plain text in the database. NEVER. EVER. DO. THIS. It is incredibly insecure. Please look into PHP's password_hash() function.

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

That’s the thing. We need to see your register and login code in order to give you the code for password change.

Otherwise, without it, the best we can offer us the pseudo code I provided in my first reply above.

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

So I’m confused. You’re asking for help writing the PHP code that can be used to do a lost password reset, but you don’t have code for a signup or login?

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

Rproffitt,

When I started DaniWeb, I launched it on the phpBB platform because I couldn’t afford a $100 vBulletin license. From a developer’s perspective, you may think $100 is almost nothing for the value of an entire fully functional web app. As a student, anything I couldn’t afford to buy, I learned how to build myself from scratch.

rproffitt commented: I agree this is the best incentive to "roll your own" solutions. +0
Dani 4,675 The Queen of DaniWeb Administrator Featured Poster Premium Member

It looks like you just want us to do your homework for you.

Pseudo code is English that describes the steps needed (in English) to accomplish what you’re trying to do. Help us to help you by telling us what you think the answer to this part is, and we’ll help you along if you’re stuck.

There’s no excuse to not attempting this part, at the very least, because it doesn’t require any programming knowledge. Just think, logically, what steps are required to do what the assignment is asking for.

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

Maulik_4, can you show us MY_Controller.php please so that I can help?

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

OK, so you're connecting to MySQL via PDO. I'm personally not familiar with PDO. Is there a reason you're not using something like MySQLi?

It seems as if you don't have very much experience at all with web development. Did you write this PHP yourself? Where is your PHP code to log in? Your database schema? Is this part of a larger PHP application?

Hasan_10 commented: . +0
Dani 4,675 The Queen of DaniWeb Administrator Featured Poster Premium Member

So I see you have a list of DNS servers, but I'm not quite sure why. The web server should already have a way of resolving domain names to IP addresses. What you want to do instead for curl_setopt($curl, CURLOPT_URL, $serverName); is simply set $serverName to the IP address you're trying to connect to.

Also, you are setting the user agent to $_SERVER['HTTP_USER_AGENT']. Keep in mind that the user agent is a string that web browsers send to the web server to identify themselves. Therefore, a user agent won't exist if you're running this script via a cron job or a CLI script (e.g. it will only work if you're running this PHP script from a web browser).

Also, lines 49 and 50 say to use the values within the $proxy array corresponding to the element with index 0. But your $proxy array has indexes 1, 2, and 3, and does not have an index 0.

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

So if you want to get a cut of the transaction and forward the rest to the user, you don't want to use JSON with the Payouts API. That's why I wanted to get a clearer picture of what you're trying to do. Because, for your use case, you don't want to use the old Masspay API or the Payouts API. That's not what they're designed for.

What you want to do instead is use Adaptive Payments, which is specifically designed for when you are the owner of an app, and you want there to be multiple receivers of the payment. Her'es more information: https://developer.paypal.com/docs/classic/adaptive-payments/integration-guide/APIntro/

If you read that entire page, it should answer all your questions. Parallel payments looks like what you would like to do.

I understand that the page says that you need to opt-in to the service, so your best bet is to read that whole page, and then contact PayPal customer service for more information about getting started.

Unfortunately, PayPal IPN or the Payouts API won't do what you want.

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

Hope I answered your question. Plus I love Dani Web :)

Thanks so much!!

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

So I'm actually not sure what eBay and Reddit have in common :)

That aside, I don't think you can use IPN for users paying each other. The recipient's PayPal address needs to manually opt into receiving IPN notifications, which your end-users aren't all going to do or know how to do. I think you might also need to have a PayPal merchant account in order to enable IPN notifications.

You also can't use PayPal MassPay because it's been deprecated and won't work anymore.

Maybe if you gave me a clearer example of what you're trying to do, I can propose an alternative. Do you just want to be notified when one person pays another person through your platform? Or do you want to take a cut of it (e.g. profit sharing). PayPal profit sharing works such that the buyer will pay your app $10. Your app will keep $3 and automatically forward $7 on to the seller.

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

OK, so firstly, are you able to confirm that /Client/GetClientList returns something like:

[{"Id":1,"FirstName":"abc","LastName":"xyz","FullName":"abc xyz"},{"Id":2,"FirstName":"qwe","LastName":"rty","FullName":"qwe rty"}]

If that's true, then we can say the C# part (which I can't help you with) is correct, and we just need to look at the Javascript part.

Taher_3 commented: Yes, I'm getting Json result in this format and I'm unable to handle this result +0
Dani 4,675 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hello! Welcome to DaniWeb!!

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

I had a 17” MSI gaming laptop that I was very happy with for many years.

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

You don't have a semi-colon after header("location:login_user.php")

It should be header("location:login_user.php");

It says the } is unexpected because it sees a } immediately after that line without a semi-colon first.

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

This is a LOT of code for us to read and understand. If it's giving you an error message saying undefined index 'gender', that probably means that $_POST['gender'] is not defined. However, you have $gender= isset($_POST['gender']) && !empty($_POST['gender']); and I don't understand what you're trying to do there. It looks like you're setting the $gender variable to a boolean (true or false) as to whether $_POST['gender'] exists or not, instead of setting it to the value of $_POST['gender'] if it does exist. You would want to do:

$gender= (isset($_POST['gender']) && !empty($_POST['gender'])) ? $_POST['gender'] : null;

What that does is it sets $gender to $_POST['gender'] if it exists, and NULL if it doesn't. Can you please be more specific as to the actual error messages you're receiving and what isn't working as intended?

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

You need to provide some more information in order for us to be able to help you. I see here you are giving us an HTML form that asks a user for an old password, and to enter a new password twice. I understand what you want to do is update the password in the database, when the form is submitted. However, you are giving no insight to what your PHP application code currently looks like, what database you're using, how passwords are stored in the database, etc.

Basically the steps that would be involved would be:

  • Retrieve the old password from the form
  • Check to see if the new password and repeat new password fields are the same
  • If they aren't a match, show an error that the passwords are not the same
  • If they are a match, compare the old password to the encrypted password for the user in the database
  • If they aren't a match, show an error that the old password is incorrect
  • If they are a match, encrypt the new password and overwrite the encrypted password field in the database

Now, how that algorithm actually gets translated into PHP code has a lot to do with what PHP framework (if any) you're using, what database you're using, what library you're using to connect to the database, the database schema, etc.