in Education by
I've a submit discussion form with image upload in my website. Now, I want to upload a unique file name when the user submits their image so that I can show the result of all images and can avoid duplicate file names. How can I do this with php? If you need my form process code then I'll upload it. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can use the uniqid() function to generate a unique ID /** * Generate a unique ID * @link http://www.php.net/manual/en/function.uniqid.php * @param prefix string[optional]

* Can be useful, for instance, if you generate identifiers * simultaneously on several hosts that might happen to generate the * identifier at the same microsecond. *

*

* With an empty prefix, the returned string will * be 13 characters long. If more_entropy is * true, it will be 23 characters. *

* @param more_entropy bool[optional]

* If set to true, uniqid will add additional * entropy (using the combined linear congruential generator) at the end * of the return value, which should make the results more unique. *

* @return string the unique identifier, as a string. */ function uniqid ($prefix = null, $more_entropy = null) {}

Related questions

0 votes
    From the page http://msdn.microsoft.com/en-us/magazine/dd315413.aspx: User agents interact with resources, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    From the page http://msdn.microsoft.com/en-us/magazine/dd315413.aspx: User agents interact with resources, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    From the page http://msdn.microsoft.com/en-us/magazine/dd315413.aspx: User agents interact with resources, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    Hello I am trying to upload some files to the amazon S3 bucket but I am facing an error that the key is ... 't exist Please help. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I want to extract an extension from a filename in Python, How can I do that? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    Write a program to accept a filename from the user and display all the lines from the file which contain python comment character ‘#’. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    How will you create a Base64 encoder that encodes using the URL and Filename safe type base64 encoding scheme in Java8?...
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
    How will you create a Base64 decoder that decodes using the URL and Filename safe type base64 encoding scheme in Java8?...
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
    I am new to React but I know main concept of unique key. However, I am getting a warning. Below ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    i have this problem that i want to upload image on a server through multi-part form but its keep ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    i have this problem that i want to upload image on a server through multi-part form but its keep ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 19, 2022 in Education by JackTerrance
0 votes
    I'm currently looking at ways to allow people to select multiple files at once to batch upload images. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I'm developing an Android app and I'm working on photo uploading to my rails server. If I upload ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    To lower the file size, while uploading, in Scratch, check the _________ box in the left corner of the upload screen Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
...