delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

This HTML form, when submitted, sends all the fields to a CSV file and my e-mail address.
How can I get the three variables from the PHP form to automatically appear in the three corresponding text areas of the HTML form?
Thanks,
Tom


Perhaps this is a PHP question, but it also involves my HTML form...if I need to post this in the PHP forum, let me know.
I have a PHP form with 3 fields AANAME, ABCOMPANY, AAEMAIL that are validated with a JAvascript function before being submitted using the "GET" method (POST seems to not work).
Upon validation, an HTML page opens with a FORM that includes a table with 3 text areas with the same field names as above, along with a section with many checkboxes. This HTML form, when submitted, sends all the fields to a CSV file and my e-mail address.
How can I get the three variables from the PHP form to automatically appear in the three corresponding text areas of the HTML form?
Thanks,
Tom

TOP

Thanks for your response. To test it, I tried placing your code in the body of the html, but the php code itself prints inside the text area. I suspect I am doing something wrong somewhere, of course.
In the HTML page, in the header I also have this code
Code:
  1. <?php
  2. $AANAME = $_POST["Name"];
  3. $ABCOMPANY = $_POST["Company"];
  4. $AAEMAIL = $_POST["Email"];
  5. ?>
Copy Code

TOP

there is a file already on my website of the same name and it appears to be a binary file which I am hesitant to edit or overwrite.
I tried renaming the HTML to php but it seemed to mess things up.
I think your first suggestion would work, but I perhaps I can get the 3 variables into the HTML page in some hidden way and them have them added to the CSV file when the HTML form is finally submitted
What do you think?

TOP

yes... I am new at this php coding and I thank you for taking the time to help... I appreciate it!

TOP

abstract:

This HTML form, when submitted, sends all the fields to a CSV file and my e-mail address.
How can I get the three variables from the PHP form to automatically appear in the three corresponding text areas of the HTML form?
Thanks,
Tom


Exactly what Kravvitz said: the file isn't being parsed by PHP. You can't have PHP code without having PHP read and translate it.
So either rename your file to ___.php, or keep it as ___.html and put that code he posted inside .htaccess.
And:
What does "mess things up" mean?
What exactly is a "binary file"? .htaccess should be plain, readable text.

TOP

I did rename the file to php and it works, as suggested. T
he .htaccess appears to have additional characters in it when viewed with Notepad, so I assumed it was a non-text type of format --- that's why I didn't play with it ---
But renaming this HTML form page to PHP is not a problem for me, so I did that and the variable appears in the textarea --- thank you!!!

TOP

actually, when I rename my html page to php the variable names get inserted, but the form doesn't post properly. I need to keep it an HTML file in order for the following "frontpage" HTML code to work:
Code:
  1. <form method="POST" action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-onSubmit>
  2. <!--webbot bot="SaveResults" startspan U-File="SA-form-results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE" S-Builtin-Fields="Date Time" S-Email-Format="TEXT/PRE" S-Email-Address="tom@medianet-ny.com" B-Email-Label-Fields="TRUE" B-Email-Subject-From-Field="FALSE" S-Email-Subject="New SELF EVALUATION" U-Confirmation-Url="SA-Confirmation-page.htm" S-Date-Format="%m/%d/%Y" S-Time-Format="%I:%M:%S %p" S-Form-Fields="AANAME ABCOMPANY AAEMAIL CAR-CH1 CAR-CH2 CAR-CH3 CAR-OP1 CAR-OP2 EMP-CH1 EMP-OP1 HAP-CH1 HAP-OP1 HAP-OP2 ENG-CH1 ENG-CH2 ENG-OP1 PAS-CH1 PAS-OP1 MOT-CH1 MOT-OP1 EXP-CH1 EXP-OP1 EXP-OP2 INS-OP1 SCN-CH1 SCN-CH2 SCN-OP1 APR-CH1 APR-OP1 APR-OP2 PAP-CH1 PAP-CH2 PAP-OP1 COR-CH1 COR-CH2 COR-OP1 COR-OP2 CDV-CH1 CDV-OP1 CDS-CH1 CDS-CH2 CDS-CH3 CDS-CH4 CDS-OP1 CDS-OP2 CDS-OP3 CDS-OP4 ADS-CH1 ADS-CH2 ADS-OP1 ENV-CH1 BLS-CH1 BLS-CH2 BLS-CH3 BLS-CH4 BLS-CH5 BLS-CH6 BLS-CH7 BLS-OP1 BLS-OP2 BLS-OP3 BLS-OP4 BLS-OP5 BLS-OP6 SPS-CH1 SPS-CH2 SPS-CH3 SPS-CH4 SPS-OP1 SPS-OP2 SPS-OP3 TEC-CH1 TEC-CH2 TEC-OP1 TEC-OP2 FOC-CH1 FOC-OP1 INT-CH1 INT-CH2 INT-OP1 INT-OP2 INT-OP3 INT-OP4 " --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" -->                       
Copy Code
So... I did edit the .htaccess (it is a text file after all, as you said) and added the line Kravitz suggested.
But the textarea box seems to show the php code, not the variable.
When I use php, the variable names pass --- but the frontpage code doesn't work...
any thoughts?
This is the HTML code that works if the file

TOP

I don't think you can run PHP in Front Page... but to tell you the truth I don't know anything about Front Page at all except that it's from Microsoft and it's some kind of publishing system.
If you want to start using PHP you should probably just use PHP and get rid of the Front Page stuff.

TOP

I use FrontPage 2003 because it does allow me to edit the very simple HTML pages on my website, bit I agree with you and others who have posted replies that I should just do this task in php and eliminate the front-page automated postings to CSV file and e-mail.
I will look on this forum for simple ways to make a single form, use the javascript code to validate the input fields and then submit the form to a CSV file and my e-mail address.
Thanks for your comments!
Tom

TOP

abstract:

This HTML form, when submitted, sends all the fields to a CSV file and my e-mail address.
How can I get the three variables from the PHP form to automatically appear in the three corresponding text areas of the HTML form?
Thanks,
Tom


For future reference in regards to trying to open .htaccess
Open your .htaccess in wordpad instead of notepad   just make sure when you save, to do save as and make sure that "text document" is selected and it didn't append an extension After that you can open in notepad and it will appear the way it's supposed to.
Originally Posted by Tom Mucciolo
I use FrontPage 2003 because it does allow me to edit the very simple HTML pages on my website, bit I agree with you and others who have posted replies that I should just do this task in php and eliminate the front-page automated postings to CSV file and e-mail.
I will look on this forum for simple ways to make a single form, use the javascript code to validate the input fields and then submit the form to a CSV file and my e-mail address.
Thanks for your comments!
Tom

TOP

Back Forum