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

The DaniWeb member list has been recently reintroduced, and with some additional featuers to boot ... For the last handful of years, it was only available as a bare bones moderators-only tool. I've added a bunch of filtering and sorting onto it, and you can now access it via the left sidebar in the Social section.

https://www.daniweb.com/stats/members

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

I’ve marked the topic as solved since it’s working now.

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

Change the first line from <? php to <?php

You have a space between the ? and the php that needs to be removed. Also, make the other changes I wrote about earlier.

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

Earlier today, I was in need of an easy way to delete files that mached a specific format within a series of folders. For the case of this example, let's say all CSS files. I discovered I could do it with:

find . -name '*.css' -delete

The . represents the current folder and below. Unfortunately you can't use rm -r because it doesn't recursively check for file names matching a pattern.

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

Hi Erich,

I'm sorry you've been having such a difficult time posting. You had already signed off by the time I replied to you via chat.

You can post your C++ question for free here: https://www.daniweb.com/community/contribute/2

It's free to ask a question.

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

I think, but I do stand corrected, that two space proponents were from the days of typewriters and printers that only used monospaced fonts. You wanted to make it easier to read when a new sentence started, and since the spacing between each and every character, including punctuation characters, was always exactly the same, you wanted to give more of an obvious spacing to an end of a sentence than you gave to just between words. Therefore, we gave double the space of a blank character to the end of a sentence, and a single blank character between letters.

But then entered the world of word processors and kerning! (Could I possibly mention kerning more times in a single forum topic?!) Kerning made it work automagically to figure out the aesthetically best amount of space to design between each and every letter, word, punctuation, character, etc. depending upon the font being used. It was no longer required for the end-user to "fake" displaying an extra blank character between sentences by hitting the spacebar twice in a row when typing.

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

Hi,

What is the complete error message? PHP error messages typically say what line the error is on, etc.

In investigating the code above, the biggest things that stand out ot me are on line 17 you have the variable $visitor-email but I don't believe that dashes are allowed in variable names. Secondly, on line 19, you have two commas after $email_subject.

rproffitt commented: It's Dani Lint. Is there a Lint checker for PHP? (Yes!) +15
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Renting a dumpster was not a problem since they could drop it off in the driveway then pick it back up a week later with no actual contact.

Yeah, around here, those kinds of businesses are not considered essential (since construction is not allowed right now), and therefore just entirely not open. However, they are now talking about loosening some of the shelter in place restrictions in a couple of weeks.

I live right on the border of Santa Clara county and San Mateo county. San Mateo has 1K+ confirmed cases and Santa Clara has 2K+.

Still haven't left the house in well over a month except to take the dog for a walk on the hiking trail that follows the creek that divides the two counties. Because it's nestled in the suburban neighborhood, it hasn't been very crowded at all.

Both counties have closed all public parks and parking lots at trail heads, so you're only allowed to walk on trails you can walk/bike to from your home. Although you're allowed to go walking outside for exercise, driving to places to walk is prohibited, so you can only walk within your own neighborhood.

Which is PERFECTLY fine by me!! Remember how I moved back in early February?! Soooo glad I did because I love where I live now. I'm back in the neighborhood I used to live in, just renting for now until we can afford to eventually buy in this neighborhood.

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

I'm pro-Oxford comma.

Reverend Jim commented: Obviously a wise and right-thinking individual. +14
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

For me, I added some DaniWeb features, completely refactored the CSS, and baked for the first time in my life. My fiancé and I even had a bread bake-off.

Gronzelt commented: During covid, I stayed at home, worked online, and watched my favorite TV shows. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

So apparently Microsoft Word’s latest release shows a grammar error if you do two spaces after a period, this ending the debate of which is correct.

I used to do two spaces after a period back on my old Apple IIGS with its mono spaces font. However, I’ve always said that since the world of kerning has existed in word processor apps, just add a single space and the software will give it the proper amount of spacing after a period before the next sentence begins.

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

I’m on my phone now so I can’t search easily, but didn’t you just ask this question two days ago?

nishita_1 commented: please help me +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

You gave us a big project to do but you haven’t shared what you’ve done so far, what errors you’re getting, or where you’re stuck.

We will definitely help you learn so you can complete your project. But why would we take hours and hours just to do your homework for you?

Radroad commented: I couldnt figure out how to edit my question but I added a comment under this post. Sorry for the confusion +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi zoya. Welcome to DaniWeb!!

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

Lots of CSS changes over the past two days (clear your browser cache to experience them!) and a new homepage to boot.

Whatcha think of the homepage changes? Does it do a good job explaining what DaniWeb is all about?

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

Hi, nice to meet you. Looking forward to you posting your question. Hope you find DaniWeb helpful!!

phirux commented: Thank you so much, Dani. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hey there! Welcome to DaniWeb :)

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

This is a super broad question. To begin, so you have a programming language of choice that you’d like to create this with? Have you previously created any web apps? Are you looking to create something from scratch or start with an existing script that might do something similar and modify it for your needs? And lastly, are you looking more for programming help or for suggestions and feedback related to features and functionality people might be looking for in such an app?

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

I definitely agree moving off of shared to something more reliable. I see you linked to Cloudways, which is pretty popular to deploy a simple WordPress site or something like that, and have it fully managed and be completely hands off.

However, if you are going to be doing stuff beyond out of the box PHP, or any custom development or the like, then I would look elsewhere.

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

We all want to rank in the SERPs, umerblzn. We just might have different methods of making that happen.

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

Hi and welcome to DaniWeb. I built DaniWeb with CodeIgniter 3, although CodeIgniter 4 was just released recently, with a code base much more similar to Laravel.

Do you prefer CI or Laravel so far?

ankitakumari commented: I have just started learning codeigniter and laravel. And so far i have my inclination towards laravel. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I guess I don’t see why bounce rates would be lower than other OAuth options that also reduce the friction to create a new account.

You’re saying that the target demographic is eCommerce, but you also said your target demographic are people in bed laying sideways with only one free hand. Who is going to be typing in shipping addresses and credit card numbers?

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

I’ll be honest. I don’t think that you have given me a strong enough value proposition as to why I should incorporate it into DaniWeb, and pay you for it nonetheless.

I mean ... users on mobile can already log in with Facebook in a single click. We’re all already logged into either Google or FB already. And, from mobile, I actually think context switching between browser/email client is more of a jarring experience.

I get that there is less barrier to entry to join a new site than filling out a whole form. But I’m not so sure I see the benefit to the website owner.

Since you plan on charging for this product ultimately, you have to have a strong enlightened value proposition as to why there would be an ROI. The business owner needs to see a return on their investment. Eg if they spend $500, they’ll make $1500. How will giving you money make them more money, when they’re already using log in with Facebook for free?

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

The code is already very heavily commented so it would be hard for us to explain what it does more than the programmer who wrote it and commented their code while doing so.

Perhaps if you could give us a better example of what you're looking for? You say the process of moving the elevator ... the entire thing simulates an elevator moving. Do you mean your homework assignment is to convert the existing code to pseudocode?

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

I disagree with rproffitt.

Pretty much all login systems, whether it's in-house or third-party social login, require an email to log in. For one reason or another, a platform may choose to outsource their login mechanism. As the OP points out, plenty of sites outsource their login platform to Auth0 and other SaaS-based authentication platforms.

I use a site in which, instead of prompting the user for an email address and password to log in each time, they only prompt for your email address. You then receive an email with a one-time-use link to log you into the site. It is, indeed, passwordless.

DaniWeb's lost password feature works much the same way. You click the Forget Password link on the signup page. You're prompted for your email address. You then receive an email with a one-time-use link that logs you into your control panel.

I'm not quite sure what you mean, DrakeDemon, when you say that it would use mailto HTML links to open the default email app. Who would you be emailing? The end user would be emailing your platform? How does the end user then gain access once the email has been received and "processed"?

Typically login systems work by sending a cookie to your web browser. How would a cookie end up on the end-user's computer after a server processes an email it receives?

The other thing to consider is that the email protocol is not guaranteed (delivery failures do happen quite regularly) or instant. Sometimes, ISPs …

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

The OP name looked like indian one, so suggested it.

Ah, I see. If you click into their profile you can see their location.

vishnuvis commented: Didn't know that, Thanks. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Line 124 of the above code says: names[j + 1] = tmpname;

Please keep in mind that it looks like the first three lines of your code above were not properly indented so our forum system did not add line numbers to them.

I just want to clarify you did mean line 124 of the code you posted here.

Let's assume it is ... By the time we get to line 124, how many elements are in the array names? Is it possible for there to be fewer than j elements in the array, such that index j+1 doesn't exist?

Something tells me that line 124 in the error you got does not correspond to line 124 in the code you posted above.

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

Hey there!

Thanks for upgrading to a DaniWeb Premium membership. Unfortunately I don't know Java (two courses in college 20 years ago is the extent of my Java knowledge). However, an array index out of bounds exception means that you have an array, and you're trying to retrieve a specific index of the array that doesn't exist. For example, if you have an array with 5 elements, you're trying to retrieve array[8] or something like that.

Usually the error message will specify the line that triggered the error. Can you let us know what line that is and then we can look into it.

Andrew_62 commented: It was line 124 +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

hi there

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

So the code that I have provided here is server-side, while the code you were working with is client-side. Do you have any experience working with server-side OAuth? Also keep in mind the code I've provided only works with my Codeigniter framework, so you can't copy/paste it.

However, it's heavily commented. If you read it and understand how it works, you should be able to create what you need based off of it in your own project.

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

I actually do want to add that individual actions taken (posting, etc.) are each attached to the IP address used for that action. However, that data is currently not converted to a geographic location, used to update the map in your member profile, or for the purposes of user matching.

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

We used to regenerate your location based on your IP address on a regular basis whenever you were logged into DaniWeb. In such a case, if using a VPN, we might have your location here one day, there the next.

However, in the interest of user privacy, we decided to no longer track our users around the globe.

We now retrieve your location via the IP->Geolocation database only when you first sign up. After that, you have complete control of when your location is updated in our database by clicking the 'Update Location' button in your user settings. When using this method, we first attept to use Javascript to request browser access to your wifi geocordinates. If you deny us access, we then use a GeoIP lookup database. But, again, it's all only done on demand now. You also have the ability to delete all of your location history.

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

We had a bug a little while back where we were accessing an old database for the GeoIP API.

That meant that, for users whose geolocation were mapped from their IP address, it was incorrect/unknown for IP subnets not in the database.

Now, 1-2 years later, can we go back and retroactively retrieve the correct location for each of those IP addresses with a more updated database? Or, is it possible, for example, that ISPs may recycle IP addresses across different cities/states?

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

So I actually wrote two tutorials for using OAuth 2 with the DaniWeb API.

Here is the one for being PHP-based: https://www.daniweb.com/programming/web-development/tutorials/469804/getting-started-with-oauth-2-0-explicit-flow

And here is the one for being Javascript-based: https://www.daniweb.com/programming/web-development/tutorials/469810/oauth-2-0-implicit-flow-with-the-daniweb-api

Connecting to Facebook via OAuth is quite similar. Here's my code (I use PHP Codeigniter framework) to connect via Facebook.

public function auth($service = 'facebook')
{
    // Attempt to retrieve the referer
    if (($referer = $this->input->get('uri')) === null)
    {
        $referer = $this->input->get('state');
    }

    if (empty($referer))
    {
        $referer = 'profile';
    }

    $redirect_uri = urlencode(base_url(uri_string()));

    $oauth = array(
        'linkedin' => array(
            'YOUR_APP_ID' => '',
            'YOUR_APP_SECRET' => '',
            'COMMA_SEPARATED_LIST_OF_PERMISSION_NAMES' => 'r_basicprofile,r_emailaddress'
        ),
        'facebook' => array(
            'YOUR_APP_ID' => '',
            'YOUR_APP_SECRET' => '',
            'COMMA_SEPARATED_LIST_OF_PERMISSION_NAMES' => 'email,public_profile'
        ),
        'google' => array(
            'YOUR_APP_ID' => '',
            'YOUR_APP_SECRET' => '',
            'COMMA_SEPARATED_LIST_OF_PERMISSION_NAMES' => 'profile email'
        )
    );

    if ($service == 'facebook')
    {
        // Retrieve everything passed in as a query string
        $parameters = $this->input->get();

        // If ?code= is passed in and not empty ...
        if (isset($parameters['code']))
        {
            $code_generated_by_facebook = $parameters['code'];

            // If ?state= is passed in and a valid match ...
            // Hash is changing on every page refresh?
            if (isset($parameters['state']))
            {
                // Make an API call to fetch an access token
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/v3.2/oauth/access_token');
                curl_setopt($ch, CURLOPT_POST, true);
                curl_setopt($ch, CURLOPT_POSTFIELDS, "client_id={$oauth['facebook']['YOUR_APP_ID']}&redirect_uri=$redirect_uri&client_secret={$oauth['facebook']['YOUR_APP_SECRET']}&code=$code_generated_by_facebook");
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

                // Retrieve the result of the API call
                $result = json_decode(curl_exec($ch));
                curl_close($ch);

                // Use the access token retrieved to make the desired API request to retrieve a member's profile
                if (isset($result->access_token))
                {
                    $access_token = $result->access_token;

                    $app_secret_proof = hash_hmac('sha256', $access_token, $oauth['facebook']['YOUR_APP_SECRET']); …
Paulo_7 commented: I am sorry for my lack of knowledge, but you're too good for me! I give you the details you need to fill the code, and just copy it. Is it possible? +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Aww, I really wish I could help you, but unfortunately I don't know Python. Perhaps the least I can do is bump this thread and hopefully it can get some renewed interest. That is, unless you have already figured out what was wrong.

You're referring to the while loop that begins on line 74, correct?

I'm completely grasping at straws here, but what about a do while loop instead of a while loop?

ppel123 commented: Hi Dani, thanks for answering, after a lot of search I managed to solve it with threading events of Python. Thanks for the interest. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Ping :)

Were you ever able to get this working? Per my previous post, is your app ID properly specified in your actual code?

Paulo_7 commented: Hi Dani, my app on facebook is setup and live. If you have a code more simple and working with login of FB and you can share i'll be thankful +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I’m going to take a different side now. Blogger outreach hasn’t worked for me lately. I’ve had more success focusing on on-page.

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

I don’t focus on specific on page keywords as DaniWeb is nearly all user generated content so it’s not like I can explain keyword density to forum members.

I’ve found that what moves the needle the most is just creating a steady supply of long form content. (Eg longer pages with more content per page, and higher frequency of new content).

In other words, at times when DaniWeb tends to get more new topics and posts created as a result of a PPC campaign, hiring a staff writer to contribute a solid article or two, or even me just putting more effort into focusing on replying to questions, the direct result tends to be more organic traffic across the entire site. (Not necessarily the new content just created).

When doing blogger outreach, I focused mostly on branded keywords. Eg “DaniWeb”.

Creating quality content on a continuous basis has outperformed building backlinks for me in terms of organic. This was not always the case. Links carried much more weight back in 2005-2010. Wow, that was a decade ago!

vishnuvis commented: valuable insights, Thanks. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

So then the bug must be in the 'show.bs.modal' function.

What if you put console.log(doctorId) right above line 12 of your code above. When the modal loads, does it execute and spit out the correct ID in the developer tools console of your web browser?

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

Someone had posted recently (can't find the thread right now, I think it might have been via private message) asking for the ability to mark topics read through the cog dropdown when viewing the list of topics.

If you clear your browser cache to freshen the javascript files, then you should now have access to this feature. It only shows up for topics that currently have unread posts.

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

I unfortunately haven’t had much success with guest post / outreach. Backlinks just don’t affect my SEO as much nowadays.

Now I’m focusing more on creating more content on my own site and I’ve found it moves the needle a lot more.

vishnuvis commented: Mind sharing the keywords you are working on which moved needle solely on content rather than links, I know it's a stupid question. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi and welcome to DaniWeb! Perhaps less self-promotion moving forward though.

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

Hi Shiva! Very nice to meet you. What aspects of online marketing are you into? We have a digital media and marketing category here at DaniWeb.

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

When you load the page, what does the actual HTML look like for the button? Does it properly fill in the correct values for data-doctor-id, data-name, etc?

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

What happens if you use the mysql_error() function to fetch the text message from the last MySQL operation?

Right before your while statement, do echo $mysql_error($samb);. What's the error?

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

Have you closed the if statement?

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

I think this is the same question you asked here: https://www.daniweb.com/programming/web-development/threads/522286/problem-calling-function#post2260006

Is this question different?

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

Per Mozilla documentation:

The keydown event is fired when a key is pressed. Unlike the keypress event, the keydown event is fired for all keys, regardless of whether they produce a character value. The keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered.

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

You want to include a shared header and a shared footer. Typically this is done with a server-side language such as PHP or Python.

You can get started with an existing CMS (something that takes care of all of this for you, and more) such as Wordpress.

BrightJovanny commented: Thanks for the quick response. I actually want to learn web development from scratch, so, I'm not sure if WordPress would do. +0