Author Topic: Submit form via php  (Read 3151 times)

ccordner

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Submit form via php
« on: October 05, 2011, 05:57:46 pm »
I have a scribus form, which I want people to be able to complete and submit electronically.

I have managed this, albeit in a somewhat clunky way, via the submit (and "mailto:xxx@yyy.com"). However, this is no use if they don't have Outlook, Thunderbird etc.

Is it possible to submit the form to an email address via php?

I found a site that promised to help, but couldn't get it to work. I'm not sure if that's because the code wasn't right, or it's because I was trying it on my laptop (offline) first.

Any help would be appreciated.

Chris

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1881
  • Karma: 26
    • the graphics lab
Re: Submit form via php
« Reply #1 on: October 06, 2011, 01:07:46 am »
all i can tell is: it should work...

for more i need more...

ciao
a.l.e

ccordner

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Submit form via php
« Reply #2 on: October 06, 2011, 05:27:32 pm »
Sorry.

Right, let me try and explain this in a way that makes sense. I got most of this from (http://koivi.com/fill-pdf-form-fields/tutorial.php).

I already have a form, which has umpteen fields on it. I created it with scribus, I set the export type to HTML (And tried it with PDF/FDF with similar results). I created a php file with the code below as suggested:

Code: [Select]
<?php echo '<pre>'print_r($_POST); echo '</pre>'?>
After much messing around, I saved the php code (called it "submit.php") in the same folder as the form, opened the form in IE7 (and Firefox) and hit "Submit".

All that happened in either case was that the browser then displayed the php code (minus the opening tag) and nothing else.

Is there a reason the browser is displaying the code rather than executing it? If so, could this be linked to the fact that it's just a file on a computer rather than on a web server?

Thanks
Chris

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1881
  • Karma: 26
    • the graphics lab
Re: Submit form via php
« Reply #3 on: October 06, 2011, 09:14:47 pm »
you have to put the php file in a place served by a web server and submit the form through http to that server.

... please get in touch with somebody in your neighborhood who knows a bit about web development and get some help...

... or learn first the basics of php :-)

ciao
a.l.e