Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7952155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:46:36+00:00 2026-06-04T02:46:36+00:00

i would like to make a simple avatar system for my users. Usage is

  • 0

i would like to make a simple avatar system for my users.

Usage is simple, every uploaded avatar image is named by user, for example:

<a>...$username.'.jpg';..</a>

so there is really no need for database.
When user is logged in, I just append the filetype to the already (from database) required username.

What concerns me here is the default image, which is used before user sets his own image. What is the best way to handle this? Is there a possiblity to create / copy default image to users avatar folder when user account is created?

I know that I can achieve this using database (default value) or checking if user image is set etc. but i want to keep it as simple as possible.

Thanks in advance 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:46:37+00:00Added an answer on June 4, 2026 at 2:46 am

    Very simple example of what the file would do. I’d suggest making it more secure of course.

    $filename = $_GET["avatar"];
    $path = 'path/to/your/files';
    if (!file_exists($path.$filename.'.jpg'))
    {
       $filename = "default";
    }
    Header('Content-type: image/jpg');
    readfile($path.$filename.'.jpg');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to make a simple user login/registration system using PHP and mysql.
i would like make a simple script that store one dynamic image (Random) in
I have some data in .cvs. I would like to make a simple barplot
I would like to make a simple collapsible faq in wordpress. There are accordion
I am trying to make simple SFTP connection and would like to perform simple
Simple task: I would like to make a program (parent.exe). There are three buttons.
I am working on a simple desktop java application. I would like to make
I would like to make a simple desktop application to learn this kind of
I would like to make a simple but non trivial manipulation of DOM Elements
I would like to make a simple panel with buttons that are placed horizontally

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.