i m trying to find out which method would be the best to create a:

web-form.
that the client can build and add field as wanted.
with submit button. (for me to recieve)
with convert to downloadable pdf,txt,doc. (for them to backup)

it's for the client to build his Q&A form that could be as long as he want and that i could fill up for him.

it seems pretty simple but i can't find anything similar?!@!

i was thinking flash..but i find it complicated to mix html and flash...

PHP must be a lot simpler but i m not to good at it!!!

any help, ex, tut?

thanks.

for a good tut hav a look on php.net. It's the best documented site for php in the net.

the form is done in html

<form method=post action="save.php">
Your name:<br>
<input type=text name="name"><br><br>
Your email:<br>
<input type=text name="email">

This code sends the data to save.php. In PHP you can get the variables like this:

$name=$_REQUEST["name"];
$email=$_REQUEST["email"];

Saving that stuff in txt:

$f=fopen("filename.txt","w");
fwrite($f,$name."\n");
fwrite($f,$email."\n");
fclose($f);

For PDF you can find a library on php.net. Doc maybe as well, but I'm not sure.

If you want to have a variable form you can make up you own stylesheet. Eg: style.stl

Your family-name|name|text
Your christian-name|cname|text
Your email-address|email|text
Your password|password|password
Your comment|comment|textarea

Read the lines from that file (have a look in a tut, I'm too lazy in the moment to explain) and explode them (see next example). With simple conditions you can style your output.

In save.php you do basically something like:

$f=file("style.stl");
$f2=fopen("output.txt","w");
for($x=0;$x<count($f);$x++){
$t=explode("|",$f[$x]);
fwrite($f2,$t[1].": ".$_REQUEST[$t[1]]."\n");
}

this code recieves the variable-names from your form ($f) and saves it with the data in "output.txt" ($f2).


I hope this helps. If not, than ask again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.