Reputation: 19
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.
Upvotes: 2
Views: 133
Reputation: 320
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;
Upvotes: 1