2

I am sorry if this already exist how ever I looked all over the entire website for about an hour and could not find what I was looking for I also searched google a little bit..

So I have this code here.

<table> <tr> <td> <form name=myform action="filehere.html#+" method="POST" target="iframe_a"> </td> </tr> <tr> <td> <textarea name="xml" cols="115" rows="7" value="pastecodehere"></textarea> </td> </tr> <tr> <td> <input type="submit" value="Save Changes" /> <br> <hr noshade> <center> <iframe height=100% width=100% src="about:blank" name="iframe_a"></iframe> </center> 

Alright so what you would do here is you would fill out the form with the code you wish to send and you would hit submit and it would save.

How ever what I want to do is make it more complex with a drop down so that the code is already there behind the form and you select which you want to use... kind of like a drop down choosing which code you wish to use but at no time the code is displayed on the front end but when you hit submit it completes the action.

Edit:

<outfits> <outfit thumbnailUrl="URLHERE" default="1" name="stud1" color="0xcc9970" mood="6" species="babe"> <head url="URLHERE" z="33000"/> <face url="URLHERE" c="0x0" c2="0xFF8484" displayName="girl3" z="34000" id="20014792"/> <midsection url="URLHERE" color="0x000000" z="9000"/> <leg url="URLHERE" color="0x000000" z="10000"/> <expression url="URLHERE" z="36010"/> <expression url="URLHERE" z="36010"/> </outfit> </outfits> 

This is the code you would put into the form and it would send it as complete and it would change the model of your avatar.

3
  • Could you clarify what you mean by code? Where you have written XML, would you like to have some form of multi-select to choose the markup? Commented Sep 16, 2014 at 9:08
  • @Ducks There is still no PHP. Do you want to fetch a list of values from a database and put them in a dropdown list, or? Commented Sep 16, 2014 at 9:15
  • @ʰᵈˑ Basically I want it to send the code that is being sent into the form.. by default the USER has to POST the code into the form I currently have.. I want to have it already there.. and all they do is select which they want and hit submit.. How ever I was kinda just asking for help with this thread maybe I worded it incorrectly... Commented Sep 16, 2014 at 9:18

1 Answer 1

1

You would likely want to implement some form of templating.

In your form, you'd want to have something along the lines of this:

<table> <tr> <td> <form name=myform action="post.php" method="POST" target="iframe_a"> </td> </tr> <tr> <td> <input name="name" type="text" value="Name" /> </td> </tr> <tr> <td> <input name="species" type="text" value="Species" /> </td> </tr> <tr> <td> <input name="mood" type="text" value="Mood" /> </td> </tr> <tr> <td> <input name="color" type="text" value="Colour" /> </td> </tr> <tr> <td> <input type="submit" value="Save Changes" /> <br> <hr noshade> 

Then you could take the inputs (whatever they may be, text, images, so on) and insert them into an XML document using variables:

$avatar = $_POST; $avatar_config = <<XML <outfits> <outfit thumbnailUrl="{$avatar['thumbnail']}" default="1" name="{$avatar['name']}" color="{$avatar['color']}" mood="{$avatar['mood']}" species="{$avatar['species']}"> <head url="URLHERE" z="{$avatar['head_z']}"/> <face url="URLHERE" c="0x0" c2="0xFF8484" displayName="{$avatar['face_display_name']}" z="34000" id="20014792"/> <midsection url="URLHERE" color="0x000000" z="9000"/> <leg url="URLHERE" color="0x000000" z="10000"/> <expression url="URLHERE" z="36010"/> <expression url="URLHERE" z="36010"/> </outfit> </outfits> XML; 
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you so much @Liamja this is exactly what I was looking for other than the one thing that is required is - I have to have action="filehere.html#+" as a set action is there any way that I can give the form 2 actions?
You could of course set action="filehere.html#+" if your iframe hosts a PHP script, otherwise you may have to consider using javascript to process the form, using the same idea I posted above, just simply using Javascript instead of PHP.
I will try with both, Either way thank you in advance for your amazing help brother.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.