Page 1 of 1

newbie question about PHP and CGI

Posted: Mon Dec 29, 2003 10:01 am
by gursharn
Hi,

Our website is hosted at an external ISP. I am unaware as to how I can accomplish the following and am hoping you can help.

The ISP uses a Formmail.pl script in order to email forms. My user requirements indicate that in addition to an email being sent, I also need to store the form fields in a MYSQL Database. I have been successful in writing to the database but am not sure how to incorporate this emailing action in the existing php script. Prior to adding the mysql component, we only had ACTION="/cgi-sys/formmail.pl" in the form tag.

Is this even possible?

Thanks,

Posted: Mon Dec 29, 2003 11:09 am
by Weirdan
Hmm... .pl extensions are usually assigned to perl files... Check the source of that script to see if it perl or php before going any further...

Posted: Mon Dec 29, 2003 11:15 am
by microthick
lol, here's a NASTY way of getting what you need done.

Change the ACTION to a php script you write.

Process your form with the php script and insert relevant data into the database.

Then, using php, echo out the html to create a form, with hidden fields used to hold the data you just submitted.

Then, use JavaScript to submit the form to the formmail.pl script.

I don't recommend it, but it'll work.

the formmail file is a Perl file

Posted: Mon Dec 29, 2003 3:59 pm
by gursharn
I've tried using exec to no avail. I don't know what to do . There must be an easier way to call a perl script from within a PHP script.