Is it possible to create an web-page,form,that would accept specific input and generate
an XML file from it.The form has to have the ability to add items in one particular section(where we can
add additional streams) and give us the ability to remove streams as well.
For each stream we must be able to attach a logo for that stream as well.
[off-topic]
When you post code in the forum, you need to format it. To do so you can either select all the code and click the </> button, or type 3 backticks ``` on a separate line both before and after the code block.
How familiar are you with PHP and form processing? Itâs pretty straightforward, you could start off with a page that has form fields to add an item, then once there are already items added, display those as well with a âdeleteâ button against them. Once you have everything correct, you have a âprocessâ button which will generate the XML. When that is working, you can start to add the JS bells and whistles to make it nicer by preventing screen re-draws every time to add or remove an item, for example.
First, each of your form fields will need a name, so that the processing code can distinguish them.
Next stage is to assign an âactionâ to your <form> tag, and write a short PHP script that will display the form fields.
Once you can do that, you can consider how to store the information while you are adding âstreamsâ, whatever they may be. You might use a group of session variables, or you might put them in a database. But youâll need to do something to store the data until you are ready to produce the final XML file.
The diagonal pen icon at the bottom of your post allows you to edit posts when things donât appear as you expect them to, rather than duplicating posts.
Thatâs very strange. To give the benefit of the doubt itâs not the first time someone has posted a question that very much hints towards âwill someone do this for me?â, but the first of those links that @Archibald posted actually shows some progress towards the goal (and a lot of similar âweâre not going to write it for youâ posts) that seems to have been dropped here.
Iâm happy to try to guide people in the right direction as far as my own ability allows me, but Iâd echo the comments in the first link.
@tech93, can you provide some more background on this, and perhaps why itâs exactly the same code as in that first forum link.
after a long time i started working on this again but not sure what each fields name should be and how can we have each field name uniquely defined secondly as a next stage how to assign an âactionâ to form tag an then write PHP script that will display the form fields?
since unable to do above so unable to follow advised steps further âOnce you can do that, you can consider how to store the information while you are adding âstreamsâ, whatever they may be. You might use a group of session variables, or you might put them in a database. But youâll need to do something to store the data until you are ready to produce the final XML file.â
as unable to get help from different forums so have been trying to seek help from this forum.
If by âhelpâ you mean somebody to write it for you, then Iâm afraid youâre out of luck. This is not a free coding service. Other members may be willing to help you with it, but you will need to demonstrate that you are also trying to help yourself.
ya, i am ready to work hard to resolve this issue but currently stuck for this "not sure what each fields name should be and how can we have each field name uniquely defined secondly as a next stage how to assign an âactionâ to form tag an then write PHP script that will display the form fields?
since unable to do above so unable to follow advised steps further âOnce you can do that, you can consider how to store the information while you are adding âstreamsâ, whatever they may be. You might use a group of session variables, or you might put them in a database. But youâll need to do something to store the data until you are ready to produce the final XML file.â
I notice you havenât yet put name tags on each of your inputs, and you will need to do this otherwise your code, when you have it written, wonât be able to access the values that your user submits.
Read up on the <form> tag and how to specify an action parameter for it, and then have a play with some basic PHP code to get the form variables and display them. Plenty of example code around.
They can be whatever you want them to be, as long as theyâre valid html names. You can find the documentation for the html input on line.
Just donât give the same name to more than one field.
The best way to eat an elephant is one mouthful at a time.
Is action_page.php the name of this script that displays the form and then processes it? If it is, you can just put action="" instead of specifying the file name.
Iâd think it was better to use method="put". Apart from anything else, youâre puttting data into a database or some session variables. So youâd need to look in the $_POST array if you do that.
Normally youâd have the form processing inside an if() clause like
if ($_SERVER['REQUEST_METHOD'] == "POST") {
...
}
so that it only gets processed when the forum is submitted. It would also be put before the form itself, so that when you submit the form, you donât see it drawn again before the data is processed. When you have error checking, you can figure out the errors and display any appropriate messages in the form, rather than below it.
I even tried âputâ as well and even tried by keeping action_page.php=" " but it does not display entered values in the fields of the form as my script name is action_page.php which tries to display the entered values in the form script name as âl2.phpâ and both are in my htdocs folder.
but in the below link for the mentioned example it works well.