newbie question about PHP and CGI

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gursharn
Forum Newbie
Posts: 2
Joined: Mon Dec 29, 2003 10:01 am

newbie question about PHP and CGI

Post 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,
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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...
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post 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.
gursharn
Forum Newbie
Posts: 2
Joined: Mon Dec 29, 2003 10:01 am

the formmail file is a Perl file

Post 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.
Post Reply