I'd like to create a form that will put a line of text into a few lines of html code. With multiple variables. Like this: Keyword1 = good Keyword2 = day text = <p>Have a {INSERT KEYWORD1 HERE} {INSERT KEYWORD2 HERE}.</p> Can anyone recommend a site that will show me how to do this? or just send me to a site that has done something similiar and I can just view source and read the code. thanks, -Wes
let the form send keywords to a php file. after that use this code in your php file $kw1=POST['txt1']; // txt1 is the name of the 1st text field in your form $kw2=POST['txt2']; // txt2 is the name of the 2nd text field in your form echo " text = <p>Have a",$kw1 $kw2,".</p> "; PHP:
Have a <span id="keyplace1"></span><span id="keyplace2"></span>. <input type="text" id="keyword1" /> <input type="text" id="keyword2" /> <button onClick="update()">Update</button> <script> function update(){ var keyword1 = document.getElementById("keyword1").value; var keyword2 = document.getElementById("keyword2").value; document.getElementById("keyplace1").innerHTML = keyword1; document.getElementById("keyplace2").innerHTML = keyword2; } </script> Code (markup):