/    Sign up×
Community /Pin to ProfileBookmark

Generating from form to html !

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

<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 :

<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 !!!!!

to post a comment
PHP

13 Comments(s)

Copy linkTweet thisAlerts:
@The_Little_GuyMay 09.2006 — Is it something like this what you want?
[code=php]<?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
}
?>[/code]
Copy linkTweet thisAlerts:
@PeuplarchieauthorMay 09.2006 — Yeah ! Thanks !

Your freaking good and fast Little Guy !

Can I see the result (non-source) beside the source ?

How can I set all the input's and the textarea be assign to variable to ?
Copy linkTweet thisAlerts:
@The_Little_GuyMay 09.2006 — in between the textarea tags, change all the '[B]<[/B]' to '[B]&lt;[/B]'

If you want to go even further, you can change all the '[B]>[/B]' to '[B]&gt;[/B]'

These two things will print out the open tag symbol, instead of format.

Did this answer your question? I wasn't quite sure.
Copy linkTweet thisAlerts:
@PeuplarchieauthorMay 09.2006 — Yes and no,

Beside the code in the textarea, I need to see the result loaded.

We should see the result of the code beside the code in a textarea .
Copy linkTweet thisAlerts:
@The_Little_GuyMay 09.2006 — Do you want somthing like this?
[code=php]<?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:&lt;input type="text" value="<?php echo $_POST['name']; ?>">&lt;br>
Your email is: &lt;input type="text" value="<?php echo $_POST['email']; ?>">&lt;br>
</textarea><br><br>
<b>Your Result looks like this</b><hr>
Hello: <input type="text" value="<?php echo $_POST['name']; ?>"><br>
Your email is: <input type="text" value="<?php echo $_POST['email']; ?>"><br>
<?php
}
?>[/code]
Copy linkTweet thisAlerts:
@PeuplarchieauthorMay 09.2006 — Can I do :

[code=php]
<?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:&lt;input type="text" value="<?php echo $_POST['name']; ?>">&lt;br>
Your email is: &lt;input type="text" value="<?php echo $_POST['email']; ?>">&lt;br>
</textarea><br><br>
<b>Your Result looks like this</b><hr>
Hello: <?php echo $_POST['name']; ?><br>
Your email is: <?php echo $_POST['email']; ?><br>
<?php
}
?>
[/code]
Copy linkTweet thisAlerts:
@HuevoosMay 09.2006 — jumping in and out of php tags gives a lot more work to the server than it should.

I think I understand, do you want something like this?

[code=php]<?php
if (!isset($_POST[submit]))
{
echo <<<FORM
<form action="$_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>
FORM;
}else{
echo <<<FORM
<textarea cols="20" rows="20">
<p>Hello: <b>$_POST['name']</b><br>
Your <i>email</i> is: <a href="mailto: $_POST['email']">$_POST['email']</a><br></p>
</textarea>

<div><p>Hello: <b>$_POST['name']</b><br>
Your <i>email</i> is: <a href="mailto: $_POST['email']">$_POST['email']</a><br></p></div>
FORM;

}
?> [/code]
Copy linkTweet thisAlerts:
@PeuplarchieauthorMay 09.2006 — Yeah, f*** your are good !
Copy linkTweet thisAlerts:
@PeuplarchieauthorMay 09.2006 — It give me that error:


Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in addtest11.php on line 5
Copy linkTweet thisAlerts:
@The_Little_GuyMay 09.2006 — This was because of the single quotes.

Try this:
[code=php]<?php
if (!isset($_POST[submit]))
{
echo <<<FORM
<form action="$_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>
FORM;
}else{
echo <<<FORM
<textarea cols="20" rows="20">
<p>Hello: <b>$_POST[name]</b><br>
Your <i>email</i> is: <a href="mailto: $_POST[email]">$_POST[email]</a><br></p>
</textarea>

<div><p>Hello: <b>$_POST[name]</b><br>
Your <i>email</i> is: <a href="mailto: $_POST[email]">$_POST[email]</a><br></p></div>
FORM;

}
?> [/code]
Copy linkTweet thisAlerts:
@PeuplarchieauthorMay 10.2006 — Good It working now.

Can I add uploading image ?
Copy linkTweet thisAlerts:
@PeuplarchieauthorMay 10.2006 — What do yu mean by :
umping in and out of php tags gives a lot more work to the server than it should.[/QUOTE]

What do it affect ?
Copy linkTweet thisAlerts:
@PeuplarchieauthorMay 10.2006 — In the form how can I add select boxes, radio botun and others ?
×

Success!

Help @Peuplarchie spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...