How do I generate html script by using a form?

Reply

Join Date: Jun 2009
Posts: 3
Reputation: mzqpla has a little shameless behaviour in the past 
Solved Threads: 0
mzqpla mzqpla is offline Offline
Newbie Poster

How do I generate html script by using a form?

 
-1
  #1
Jun 6th, 2009
I have a template for my ebay auctions. I want to make a form that I can type in the variable information (ie title, description, images) and generate the html script to include those variables.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: How do I generate html script by using a form?

 
0
  #2
Jun 6th, 2009
Question ripped from here
http://answers.yahoo.com/question/in...2152917AAED8nE

Just so you can spam your sig-links.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 178
Reputation: codejoust is an unknown quantity at this point 
Solved Threads: 17
codejoust's Avatar
codejoust codejoust is offline Offline
Junior Poster

Re: How do I generate html script by using a form?

 
0
  #3
Jul 6th, 2009
If you want to keep away from PHP and the rest of the server-side languages you can use some simple javascript with regular expressions, or even embedding the variables.

Javascript Example -
  1. <form onsubmit="pop()" action="#" id="inForm"> <input id="color" type="text" /></form> <textarea readonly="readonly" id="out"></textarea>

  1. var color = document.getElementById('color');
  2. var text = '<span style="color:'+color+';">Colored Text</span>';
  3. document.getElementById('out').innerHTML = text;
  4. document.getElementById('inForm').style.display = 'none';

PHP Example -

  1. <?php
  2. function get($var){
  3. //Validation and filtering
  4. $varI = $_GET[$var];
  5. if ($varI.len() > 200){ }
  6. else {
  7. echo(strip_tags($varI)); }
  8. }
  9. ?>
  10.  
  11. <div style="color:<?php get('color'); ?>"><?php get('name'); ?></div>


html for form
  1. <form action="generate.php"><input name="color" type="text" /><br /><input name="name" type="text" /></form>

Hope that helps!
Last edited by peter_budo; Jul 8th, 2009 at 6:51 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC