Generating from form to html !

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Peuplarchie
Forum Contributor
Posts: 148
Joined: Sat Feb 04, 2006 10:49 pm

Generating from form to html !

Post by Peuplarchie »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Good day to you all,
        How can, with  this specific form :

[syntax="html"]<form name="tform">

<b class="gray">Exp&eacute;diteur : </b><input type="text" name="nom" size=30><br>

<b class="gray">Date d'affiche : </b><input type="text" name="affiche" size=30><br>

<b class="gray">Courriel : </b><input type="text" name="courriel" size=30><br>



<b class="gray">&Eacute;v&egrave;nement : </b><input type="text" name="titre" size=30><br>

<b class="gray">Date de l'&eacute;v&egrave;nement : </b><input type="text" name="date" size=30><br>

<b class="gray">Description : </b><input type="text" name="description" size=30><br>

<b class="gray">Image : </b><input type="file" name="image0" size=30><br>



<b class="gray">Nom lien principale : </b><input type="text" name="liens0nom" size=30>
<b class="gray">Addresse lien principale : </b><input type="text" name="liens0adresse" size=30><br>


<b class="gray">Nom : </b><input type="text" name="liens1nom" size=30>
<b class="gray">Addresse : </b><input type="text" name="liens1adresse" size=30><br>


<b class="gray">Nom : </b><input type="text" name="liens2nom" size=30>
<b class="gray">Addresse : </b><input type="text" name="liens2adresse" size=30><br>

<b class="gray">Nom : </b><input type="text" name="liens3nom" size=30>
<b class="gray">Addresse : </b><input type="text" name="liens3adresse" size=30><br>



<br><br>


<center>
<textarea cols=60 rows=10 name="Text1">  </textarea><br>
<input type="button" value="Generate Source" >
</center>



</form>
Can I make the user create a piece of html code like that would generate into a textarea :

Code: Select all

<table border=0 align="center" cellspacing=1 cellpading=0 >
<tr><td bgcolor="#003366" class="white" align="center"><table border=0 align="center" cellspacing=1 cellpading=0 >
<tr><td bgcolor="#000033" class="white" align="left" colspan=2><b class="gray">Exp&eacute;diteur :</b><b class="white">NOM</b><br>
<tr><td bgcolor="#000000" class="white" align="left" width=450>
<b class="gray"><b class="gray">Exp&eacute;diteur  :</b><b class="white">TITRE</b><br>
<b class="gray"><b class="gray">Date d'affiche  :</b><b class="white">AFFICHE</b><br>
<b class="gray"><b class="gray">Courriel  :</b><b class="white">COURRIEL</b><br>

<b class="gray"><b class="gray">&Eacute;v&egrave;nement  :</b><b class="white">EVENEMENT</b><br>
<b class="gray"><b class="gray">Date de l'&eacute;v&egrave;nement  :</b><b class="white">DATE</b><br>
<b class="gray"><b class="gray">Description  :</b><b class="white">DESCRIPTION</b><br>


<b class="gray">Nom : </b><b class="white">LIENS1NOM</b>
<b class="gray">Addresse : </b><b class="white">LIENS1ADRESSE</b><br>


<b class="gray">Nom : </b><b class="white">LIENS2NOM</b>
<b class="gray">Addresse : </b><b class="white">LIENS2ADRESSE</b><br>

<b class="gray">Nom : </b><b class="white">LIENS3NOM</b>
<b class="gray">Addresse : </b><b class="white">LIENS3ADRESSE</b><br>

</td>



<td bgcolor="#000033" class="white" align="center"><b class="white"><a href="LIENS0ADRESSE" class="white" target="actor"><img src="IMAGESUPLOADED" border=0 width=150></a></td></tr>
</table>





THANKS !!!!!


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You want to place, literally, the code of the second snippet into the first's textarea? htmlentities()
User avatar
Peuplarchie
Forum Contributor
Posts: 148
Joined: Sat Feb 04, 2006 10:49 pm

I been give some thing, How about uploading file.

Post by Peuplarchie »

Some one gave me this, Can I and How can I upload file in the same time ?

Code: Select all

<?php
if (!isset($_POST[submit]))
{
?>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
Name: <input type="text" name="name"><br>
Email: <input type="text" name="email"><br>
<input type="submit" name="submit" value="Submit">
</form>
<?php
}else{
?>
<textarea cols="20" rows="20">
Hello: <?php echo $_POST['name']; ?><br>
Your email is: <?php echo $_POST['email']; ?><br>
</textarea>
<?php
}
?>
Post Reply