compose and upload a new article using a custom form












-5















I'm starting to learn about php trying to achieve the goal of make my first custom form. From what I understand, it's possible to collect data from a form you can compose and customize to get information like title, subtitle, uploaded images and of course the main text of a supposed post and collect them in an html file that the form itself plus a php file can store in a folder on my server.



what i would like to understand better is if i can compose the form making it be able to include the collected information between pieces of code i don't wanna write anytime in the fields of the form. i also need to understand how to make it be able to save the final html file with a different suffix like an increasing number at the end of the name to be sure no older file created this way is going to be lost cause of overwrite.



the best would be a way to leave the last 5 documents i upload using this method with the suffix between 1 and 5 and rise the number of the older files, but that would be super fancy. doing so i wanna basically make myself a sort of backoffice for my website. I'm sincerely just trying to learn and do it in the most easygoing way so feel free to suggest me good guides if you know some, it would already be a nice help.










share|improve this question

























  • So what is the question exactly? Did you try anything yet? Please read How to Ask and create a Minimal, Complete, and Verifiable example - This website is not a code writing service

    – Alon Eitan
    Dec 31 '18 at 8:50











  • Hi, Salvatore! Seems like you have a good hold on exactly what you need, which is a great start. Unfortunately, a lot of the things you ask will simply need some good ol' fashioned tinkering, working through tutorials. Highly recommend putting a day aside to build one or two guided tutorial projects!

    – Andrew Cheong
    Dec 31 '18 at 8:53











  • i already know how to write a form, i already checked many guides about the argument, but learning everything about it by myself and searching for more specific informations it's getting harder since i don't know enough specific keywords... an example would be awesome of course but even just explication of part of the problem would be useful. and for your information it's not the right place where to flame neither.

    – Salvatore Improta
    Dec 31 '18 at 8:56











  • @AndrewCheong i have nobody to guide me but google xD it's not my first form in absolute, i already made many that works sending the information via mail and managed to understand basic guide i found online. with that said i believe i made a clear question and even telling me that it's possible would help.

    – Salvatore Improta
    Dec 31 '18 at 8:59











  • To be clear, I haven't downvoted you. Hm. In that case perhaps English isn't your first language. Sorry, but I don't think we understand: "what i would like to understand better is if i can compose the form making it be able to include the collected informations between pieces of code i don't wanna write anytime in the fields of the form."

    – Andrew Cheong
    Dec 31 '18 at 9:06
















-5















I'm starting to learn about php trying to achieve the goal of make my first custom form. From what I understand, it's possible to collect data from a form you can compose and customize to get information like title, subtitle, uploaded images and of course the main text of a supposed post and collect them in an html file that the form itself plus a php file can store in a folder on my server.



what i would like to understand better is if i can compose the form making it be able to include the collected information between pieces of code i don't wanna write anytime in the fields of the form. i also need to understand how to make it be able to save the final html file with a different suffix like an increasing number at the end of the name to be sure no older file created this way is going to be lost cause of overwrite.



the best would be a way to leave the last 5 documents i upload using this method with the suffix between 1 and 5 and rise the number of the older files, but that would be super fancy. doing so i wanna basically make myself a sort of backoffice for my website. I'm sincerely just trying to learn and do it in the most easygoing way so feel free to suggest me good guides if you know some, it would already be a nice help.










share|improve this question

























  • So what is the question exactly? Did you try anything yet? Please read How to Ask and create a Minimal, Complete, and Verifiable example - This website is not a code writing service

    – Alon Eitan
    Dec 31 '18 at 8:50











  • Hi, Salvatore! Seems like you have a good hold on exactly what you need, which is a great start. Unfortunately, a lot of the things you ask will simply need some good ol' fashioned tinkering, working through tutorials. Highly recommend putting a day aside to build one or two guided tutorial projects!

    – Andrew Cheong
    Dec 31 '18 at 8:53











  • i already know how to write a form, i already checked many guides about the argument, but learning everything about it by myself and searching for more specific informations it's getting harder since i don't know enough specific keywords... an example would be awesome of course but even just explication of part of the problem would be useful. and for your information it's not the right place where to flame neither.

    – Salvatore Improta
    Dec 31 '18 at 8:56











  • @AndrewCheong i have nobody to guide me but google xD it's not my first form in absolute, i already made many that works sending the information via mail and managed to understand basic guide i found online. with that said i believe i made a clear question and even telling me that it's possible would help.

    – Salvatore Improta
    Dec 31 '18 at 8:59











  • To be clear, I haven't downvoted you. Hm. In that case perhaps English isn't your first language. Sorry, but I don't think we understand: "what i would like to understand better is if i can compose the form making it be able to include the collected informations between pieces of code i don't wanna write anytime in the fields of the form."

    – Andrew Cheong
    Dec 31 '18 at 9:06














-5












-5








-5


1






I'm starting to learn about php trying to achieve the goal of make my first custom form. From what I understand, it's possible to collect data from a form you can compose and customize to get information like title, subtitle, uploaded images and of course the main text of a supposed post and collect them in an html file that the form itself plus a php file can store in a folder on my server.



what i would like to understand better is if i can compose the form making it be able to include the collected information between pieces of code i don't wanna write anytime in the fields of the form. i also need to understand how to make it be able to save the final html file with a different suffix like an increasing number at the end of the name to be sure no older file created this way is going to be lost cause of overwrite.



the best would be a way to leave the last 5 documents i upload using this method with the suffix between 1 and 5 and rise the number of the older files, but that would be super fancy. doing so i wanna basically make myself a sort of backoffice for my website. I'm sincerely just trying to learn and do it in the most easygoing way so feel free to suggest me good guides if you know some, it would already be a nice help.










share|improve this question
















I'm starting to learn about php trying to achieve the goal of make my first custom form. From what I understand, it's possible to collect data from a form you can compose and customize to get information like title, subtitle, uploaded images and of course the main text of a supposed post and collect them in an html file that the form itself plus a php file can store in a folder on my server.



what i would like to understand better is if i can compose the form making it be able to include the collected information between pieces of code i don't wanna write anytime in the fields of the form. i also need to understand how to make it be able to save the final html file with a different suffix like an increasing number at the end of the name to be sure no older file created this way is going to be lost cause of overwrite.



the best would be a way to leave the last 5 documents i upload using this method with the suffix between 1 and 5 and rise the number of the older files, but that would be super fancy. doing so i wanna basically make myself a sort of backoffice for my website. I'm sincerely just trying to learn and do it in the most easygoing way so feel free to suggest me good guides if you know some, it would already be a nice help.







php html forms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 at 20:41









James Z

11.2k71935




11.2k71935










asked Dec 31 '18 at 8:45









Salvatore ImprotaSalvatore Improta

12




12













  • So what is the question exactly? Did you try anything yet? Please read How to Ask and create a Minimal, Complete, and Verifiable example - This website is not a code writing service

    – Alon Eitan
    Dec 31 '18 at 8:50











  • Hi, Salvatore! Seems like you have a good hold on exactly what you need, which is a great start. Unfortunately, a lot of the things you ask will simply need some good ol' fashioned tinkering, working through tutorials. Highly recommend putting a day aside to build one or two guided tutorial projects!

    – Andrew Cheong
    Dec 31 '18 at 8:53











  • i already know how to write a form, i already checked many guides about the argument, but learning everything about it by myself and searching for more specific informations it's getting harder since i don't know enough specific keywords... an example would be awesome of course but even just explication of part of the problem would be useful. and for your information it's not the right place where to flame neither.

    – Salvatore Improta
    Dec 31 '18 at 8:56











  • @AndrewCheong i have nobody to guide me but google xD it's not my first form in absolute, i already made many that works sending the information via mail and managed to understand basic guide i found online. with that said i believe i made a clear question and even telling me that it's possible would help.

    – Salvatore Improta
    Dec 31 '18 at 8:59











  • To be clear, I haven't downvoted you. Hm. In that case perhaps English isn't your first language. Sorry, but I don't think we understand: "what i would like to understand better is if i can compose the form making it be able to include the collected informations between pieces of code i don't wanna write anytime in the fields of the form."

    – Andrew Cheong
    Dec 31 '18 at 9:06



















  • So what is the question exactly? Did you try anything yet? Please read How to Ask and create a Minimal, Complete, and Verifiable example - This website is not a code writing service

    – Alon Eitan
    Dec 31 '18 at 8:50











  • Hi, Salvatore! Seems like you have a good hold on exactly what you need, which is a great start. Unfortunately, a lot of the things you ask will simply need some good ol' fashioned tinkering, working through tutorials. Highly recommend putting a day aside to build one or two guided tutorial projects!

    – Andrew Cheong
    Dec 31 '18 at 8:53











  • i already know how to write a form, i already checked many guides about the argument, but learning everything about it by myself and searching for more specific informations it's getting harder since i don't know enough specific keywords... an example would be awesome of course but even just explication of part of the problem would be useful. and for your information it's not the right place where to flame neither.

    – Salvatore Improta
    Dec 31 '18 at 8:56











  • @AndrewCheong i have nobody to guide me but google xD it's not my first form in absolute, i already made many that works sending the information via mail and managed to understand basic guide i found online. with that said i believe i made a clear question and even telling me that it's possible would help.

    – Salvatore Improta
    Dec 31 '18 at 8:59











  • To be clear, I haven't downvoted you. Hm. In that case perhaps English isn't your first language. Sorry, but I don't think we understand: "what i would like to understand better is if i can compose the form making it be able to include the collected informations between pieces of code i don't wanna write anytime in the fields of the form."

    – Andrew Cheong
    Dec 31 '18 at 9:06

















So what is the question exactly? Did you try anything yet? Please read How to Ask and create a Minimal, Complete, and Verifiable example - This website is not a code writing service

– Alon Eitan
Dec 31 '18 at 8:50





So what is the question exactly? Did you try anything yet? Please read How to Ask and create a Minimal, Complete, and Verifiable example - This website is not a code writing service

– Alon Eitan
Dec 31 '18 at 8:50













Hi, Salvatore! Seems like you have a good hold on exactly what you need, which is a great start. Unfortunately, a lot of the things you ask will simply need some good ol' fashioned tinkering, working through tutorials. Highly recommend putting a day aside to build one or two guided tutorial projects!

– Andrew Cheong
Dec 31 '18 at 8:53





Hi, Salvatore! Seems like you have a good hold on exactly what you need, which is a great start. Unfortunately, a lot of the things you ask will simply need some good ol' fashioned tinkering, working through tutorials. Highly recommend putting a day aside to build one or two guided tutorial projects!

– Andrew Cheong
Dec 31 '18 at 8:53













i already know how to write a form, i already checked many guides about the argument, but learning everything about it by myself and searching for more specific informations it's getting harder since i don't know enough specific keywords... an example would be awesome of course but even just explication of part of the problem would be useful. and for your information it's not the right place where to flame neither.

– Salvatore Improta
Dec 31 '18 at 8:56





i already know how to write a form, i already checked many guides about the argument, but learning everything about it by myself and searching for more specific informations it's getting harder since i don't know enough specific keywords... an example would be awesome of course but even just explication of part of the problem would be useful. and for your information it's not the right place where to flame neither.

– Salvatore Improta
Dec 31 '18 at 8:56













@AndrewCheong i have nobody to guide me but google xD it's not my first form in absolute, i already made many that works sending the information via mail and managed to understand basic guide i found online. with that said i believe i made a clear question and even telling me that it's possible would help.

– Salvatore Improta
Dec 31 '18 at 8:59





@AndrewCheong i have nobody to guide me but google xD it's not my first form in absolute, i already made many that works sending the information via mail and managed to understand basic guide i found online. with that said i believe i made a clear question and even telling me that it's possible would help.

– Salvatore Improta
Dec 31 '18 at 8:59













To be clear, I haven't downvoted you. Hm. In that case perhaps English isn't your first language. Sorry, but I don't think we understand: "what i would like to understand better is if i can compose the form making it be able to include the collected informations between pieces of code i don't wanna write anytime in the fields of the form."

– Andrew Cheong
Dec 31 '18 at 9:06





To be clear, I haven't downvoted you. Hm. In that case perhaps English isn't your first language. Sorry, but I don't think we understand: "what i would like to understand better is if i can compose the form making it be able to include the collected informations between pieces of code i don't wanna write anytime in the fields of the form."

– Andrew Cheong
Dec 31 '18 at 9:06












1 Answer
1






active

oldest

votes


















0















what i would like to understand better is if i can compose the form
making it be able to include the collected informations between pieces
of code i don't wanna write anytime in the fields of the form




this is not clear. please give an example.




i also need to understand how to make it be able to save the final
html file with a different suffix




if you really need to save forms data on disk, and avoid collision. you can generate unique id while writing the file as file name
see http://php.net/manual/en/function.uniqid.php



or using a composer package to generate uuid. see https://github.com/ramsey/uuid
while i still recommend using a proper data store, database or in memory.






share|improve this answer
























  • example: putting a web address between html tags <a></a>. i'm gonna check your guides but i would like to avoid to relay on a database trying to write every aspect i need in the website by myself.

    – Salvatore Improta
    Dec 31 '18 at 9:05













  • @SalvatoreImprota in any case you can retrieve the submitted form data depends on the form method. in case of GET, you have them in super global array $_GET, the same if the form method is POST, then data will be in $_POST and $_FILES - in case your form uploads files. see php.net/manual/en/tutorial.forms.php also php.net/manual/de/function.file-put-contents.php

    – Moaaz
    Dec 31 '18 at 9:22








  • 1





    ty im already finding answers just searching on the php site that google never showed during my research XD (php.net/manual/en/tutorial.forms.php)

    – Salvatore Improta
    Dec 31 '18 at 9:33











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53985356%2fcompose-and-upload-a-new-article-using-a-custom-form%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0















what i would like to understand better is if i can compose the form
making it be able to include the collected informations between pieces
of code i don't wanna write anytime in the fields of the form




this is not clear. please give an example.




i also need to understand how to make it be able to save the final
html file with a different suffix




if you really need to save forms data on disk, and avoid collision. you can generate unique id while writing the file as file name
see http://php.net/manual/en/function.uniqid.php



or using a composer package to generate uuid. see https://github.com/ramsey/uuid
while i still recommend using a proper data store, database or in memory.






share|improve this answer
























  • example: putting a web address between html tags <a></a>. i'm gonna check your guides but i would like to avoid to relay on a database trying to write every aspect i need in the website by myself.

    – Salvatore Improta
    Dec 31 '18 at 9:05













  • @SalvatoreImprota in any case you can retrieve the submitted form data depends on the form method. in case of GET, you have them in super global array $_GET, the same if the form method is POST, then data will be in $_POST and $_FILES - in case your form uploads files. see php.net/manual/en/tutorial.forms.php also php.net/manual/de/function.file-put-contents.php

    – Moaaz
    Dec 31 '18 at 9:22








  • 1





    ty im already finding answers just searching on the php site that google never showed during my research XD (php.net/manual/en/tutorial.forms.php)

    – Salvatore Improta
    Dec 31 '18 at 9:33
















0















what i would like to understand better is if i can compose the form
making it be able to include the collected informations between pieces
of code i don't wanna write anytime in the fields of the form




this is not clear. please give an example.




i also need to understand how to make it be able to save the final
html file with a different suffix




if you really need to save forms data on disk, and avoid collision. you can generate unique id while writing the file as file name
see http://php.net/manual/en/function.uniqid.php



or using a composer package to generate uuid. see https://github.com/ramsey/uuid
while i still recommend using a proper data store, database or in memory.






share|improve this answer
























  • example: putting a web address between html tags <a></a>. i'm gonna check your guides but i would like to avoid to relay on a database trying to write every aspect i need in the website by myself.

    – Salvatore Improta
    Dec 31 '18 at 9:05













  • @SalvatoreImprota in any case you can retrieve the submitted form data depends on the form method. in case of GET, you have them in super global array $_GET, the same if the form method is POST, then data will be in $_POST and $_FILES - in case your form uploads files. see php.net/manual/en/tutorial.forms.php also php.net/manual/de/function.file-put-contents.php

    – Moaaz
    Dec 31 '18 at 9:22








  • 1





    ty im already finding answers just searching on the php site that google never showed during my research XD (php.net/manual/en/tutorial.forms.php)

    – Salvatore Improta
    Dec 31 '18 at 9:33














0












0








0








what i would like to understand better is if i can compose the form
making it be able to include the collected informations between pieces
of code i don't wanna write anytime in the fields of the form




this is not clear. please give an example.




i also need to understand how to make it be able to save the final
html file with a different suffix




if you really need to save forms data on disk, and avoid collision. you can generate unique id while writing the file as file name
see http://php.net/manual/en/function.uniqid.php



or using a composer package to generate uuid. see https://github.com/ramsey/uuid
while i still recommend using a proper data store, database or in memory.






share|improve this answer














what i would like to understand better is if i can compose the form
making it be able to include the collected informations between pieces
of code i don't wanna write anytime in the fields of the form




this is not clear. please give an example.




i also need to understand how to make it be able to save the final
html file with a different suffix




if you really need to save forms data on disk, and avoid collision. you can generate unique id while writing the file as file name
see http://php.net/manual/en/function.uniqid.php



or using a composer package to generate uuid. see https://github.com/ramsey/uuid
while i still recommend using a proper data store, database or in memory.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 31 '18 at 8:52









MoaazMoaaz

111




111













  • example: putting a web address between html tags <a></a>. i'm gonna check your guides but i would like to avoid to relay on a database trying to write every aspect i need in the website by myself.

    – Salvatore Improta
    Dec 31 '18 at 9:05













  • @SalvatoreImprota in any case you can retrieve the submitted form data depends on the form method. in case of GET, you have them in super global array $_GET, the same if the form method is POST, then data will be in $_POST and $_FILES - in case your form uploads files. see php.net/manual/en/tutorial.forms.php also php.net/manual/de/function.file-put-contents.php

    – Moaaz
    Dec 31 '18 at 9:22








  • 1





    ty im already finding answers just searching on the php site that google never showed during my research XD (php.net/manual/en/tutorial.forms.php)

    – Salvatore Improta
    Dec 31 '18 at 9:33



















  • example: putting a web address between html tags <a></a>. i'm gonna check your guides but i would like to avoid to relay on a database trying to write every aspect i need in the website by myself.

    – Salvatore Improta
    Dec 31 '18 at 9:05













  • @SalvatoreImprota in any case you can retrieve the submitted form data depends on the form method. in case of GET, you have them in super global array $_GET, the same if the form method is POST, then data will be in $_POST and $_FILES - in case your form uploads files. see php.net/manual/en/tutorial.forms.php also php.net/manual/de/function.file-put-contents.php

    – Moaaz
    Dec 31 '18 at 9:22








  • 1





    ty im already finding answers just searching on the php site that google never showed during my research XD (php.net/manual/en/tutorial.forms.php)

    – Salvatore Improta
    Dec 31 '18 at 9:33

















example: putting a web address between html tags <a></a>. i'm gonna check your guides but i would like to avoid to relay on a database trying to write every aspect i need in the website by myself.

– Salvatore Improta
Dec 31 '18 at 9:05







example: putting a web address between html tags <a></a>. i'm gonna check your guides but i would like to avoid to relay on a database trying to write every aspect i need in the website by myself.

– Salvatore Improta
Dec 31 '18 at 9:05















@SalvatoreImprota in any case you can retrieve the submitted form data depends on the form method. in case of GET, you have them in super global array $_GET, the same if the form method is POST, then data will be in $_POST and $_FILES - in case your form uploads files. see php.net/manual/en/tutorial.forms.php also php.net/manual/de/function.file-put-contents.php

– Moaaz
Dec 31 '18 at 9:22







@SalvatoreImprota in any case you can retrieve the submitted form data depends on the form method. in case of GET, you have them in super global array $_GET, the same if the form method is POST, then data will be in $_POST and $_FILES - in case your form uploads files. see php.net/manual/en/tutorial.forms.php also php.net/manual/de/function.file-put-contents.php

– Moaaz
Dec 31 '18 at 9:22






1




1





ty im already finding answers just searching on the php site that google never showed during my research XD (php.net/manual/en/tutorial.forms.php)

– Salvatore Improta
Dec 31 '18 at 9:33





ty im already finding answers just searching on the php site that google never showed during my research XD (php.net/manual/en/tutorial.forms.php)

– Salvatore Improta
Dec 31 '18 at 9:33


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53985356%2fcompose-and-upload-a-new-article-using-a-custom-form%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

How to correct the classpath of spring boot application so that it contains a single, compatible version of...