Thanks,
but could the HTML file all ready have content?
Like with logo and text?
Hi,
Is it possible to make a PHP code that sends the information from a html form to a html file?
The reason I'm asking is because our company want to change the email signature. And put in text and logo.
We use Lotus Notes 7.0.3 and the only choice I got now is to make a HTML file.
But my challenge is the users "signature".
The code I have so fare is:
If PHP is the hard way Im up for some Lotus script.
Thank you for your suggestion.
Fjebja
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>> could the HTML file all ready have content?
No, you must write the entire file. But you can use a html file as a template, transposing the variables using placeholders. For example:
Template (template.tpl):
<div align="right"><img src="logo.gif" alt="Logo" /></div>
<div style="color:green;">{$Forn
<div style="color:blue;">Tlf: {$tlf}</div>
...and in your PHP code:
The action attribute in the form must contain the name of the PHP file, and the method should be "post".
<FORM action="signature.php" method="post">
The <input> fields in the form must have names:
<LABEL for="fornavn">Fornavn:</LABE
<INPUT type="text" id="fornavn" name="fornavn" /><BR>
<LABEL for="etternavn">Etternavn: </LABEL>
<INPUT type="text" id="etternavn" name="etternavn" /><BR>
<LABEL for="tittel">Jobb tittel: </LABEL>
<INPUT type="text" id="tittel" name="tittel" /><BR>
<LABEL for="tel">Tlf: </LABEL>
<INPUT type="text" id="tlf" name="tlf" /><BR>
<LABEL for="mobil">Mobil: </LABEL>
<INPUT type="text" id="mobil" name="mobil" /><BR>
<LABEL for="email">email: </LABEL>
<INPUT type="text" id="email" name="email"><BR>
In the PHP file, you must fetch the variables from the form using the $_POST array.
Thank you for your suggetions!
Im almost there.
I have my htm, template and php files working. Puh !
but there is two things I can't get to work and that is to promt the user to save the file as Signature.html, the only thing he og she gonna do is to locate the folder we use.
Tryed FILE_APPEND but getting a nasty PHP Warning.
And the other thing is if a form is empty how can I make the line be blank in the signature.html?
thanks.
>> to promt the user to save the file as Signature.html
...not sure if I understand... the file is saved on the web server with the name "signature.html". If you want the user to control the name of the file, you must have a field for filename in the form:
<LABEL for="filename">Filnavn: </LABEL>
<INPUT type="text" id="filename" name="filename"><BR>
You could use the user name for filename:
$filename = str_replace(' ','_',"{$fornavn}_{$ettern
>> if a form is empty how can I make the line be blank in the signature.html?
You mean if a form field is empty? You could have multiple templates, with/without tlf, with/without email and so on, an select the appropriate template based on the input. Or you could create the template dynamically, based on the input. The first is easier to maintain, the second is more dynamic, but requires php skills to modify.
This code is perfect : $filename = str_replace(' ','_',"{$fornavn}_{$ettern
Thank you!
Im skipping the part with multiple template.
In my template I have a tiny logo.
When user save the HTML file the logo don't follow onto local disk.
Here is my PHP code so fare.
After the signature.html is saved, is it possible to promt to save the logo as well?
Tryed to get it to work, but cant solve it.
You can not download two files in the same request, unless you use a zip file or similar. You could serve the logo as a separate download, with similar code as lines 17-22. Save this as "logo_download.php" and link to it from the form like this:
<a href="logo_download.php" target="_blank">Download logo</a>
That's great, I've done the logo download separatly - Thanks.
I have to go with multiple templates after all, because there can't be empty form fields in the signature.
I've made the templates but I can't figure out the ' if (empty($name)) ' php code, and if there is two empty form fields - what to do then?
First name and Last name has to be in place, but the fax and mobile can be blank. (even both can be blank)
How do I make the php code to pick the right template?
I have one template when all the fields are field inn.
One without fax
One without mobile
One without fax and mobile.
I appreciate your answers, they help me understand php more!
Business Accounts
Answer for Membership
by: szewkamPosted on 2009-07-03 at 14:59:14ID: 24774621
you can't pass variables to html file. But without any problems you can generate html files from php script. Use file_put_contents (if you have PHP > 5) or combination of fopen, fwrite, fclose like you have in your script just change file.txt to file.html :)