skip to Main Content

on my website i’m using a form to ulpoad the images of the users that compiles that form.
Then, that image should be automatically displayed through a simple query and php, and it just worked fine until i’ve discovered that i ca’nt display images that has spaces or special characters in the name.
So the point is: how can i solve this issue?

To display the image i just at first save it in a folder, and save its name in the database in a table, im using phpmyadmin.
Thanks to all

2

Answers


  1. i suggest you rename the picture before uploading. You can remove special characters with function

    preg_replace($pattern, $replacement, $string);

    read more in doc enter link description here

    Login or Signup to reply.
  2. Check if the name in upload folder is matching with the name of the picture it could be because you’re not inserting “Special characters” this might help:

     mysqli_real_escape_string($conn,$NameOfThePicture);
    

    https://www.php.net/manual/en/mysqli.real-escape-string.php
    Check the documentation.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search