This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
Integrate MachForm with a separate php script
Started 15 years ago by johnfox | 9 posts |
-
Hello,
In MachForm I need to be able to do the following:1) Save an uploaded picture to a folder I specify
2) I need to change the way uploaded file names are currently named. I seems that MachForms generates a random string for file names, and my clients demand that I follow their naming format.
3) I need to pass the form data to a separate php script which is executed when the user submits the form. The PHP script is in a different folder from MachForms.
All help is greatly appreciated
Posted 15 years ago # -
Hi,
For your questions :
1. To change upload folder , you can edit "config.php" file and search for this code :
define('UPLOAD_DIR', './data');
change the value with your folder path, for example
define('UPLOAD_DIR', '/public_html/form_files');
2. I'm afraid this is not possible
3. You can use 'HttpClient' class to do this, check this post for details :
http://www.appnitro.com/forums/topic/aweber-integration?replies=7
MachForm Support
Posted 15 years ago # -
I changed the Upload_Dir to:
define('UPLOAD_DIR', '/public_html/uploadedlogo');
But I get the following error:
Warning: move_uploaded_file(/public_html/uploadedlogo/form_1/files/element_1_a3b49bc74a7e1f86094194a5aa89d5dd-18-1252589718-nchsaa.gif) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/airplane/public_html/machform/includes/post-functions.php on line 1036 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phptRJO8Y' to '/public_html/uploadedlogo/form_1/files/element_1_a3b49bc74a7e1f86094194a5aa89d5dd-18-1252589718-nchsaa.gif' in /home/airplane/public_html/machform/includes/post-functions.php on line 1036 Warning: Cannot modify header information - headers already sent by (output started at /home/airplane/public_html/machform/includes/post-functions.php:1036) in /home/airplane/public_html/machform/view.php on line 4
What am I doing wrong?
Thanks for the help!
Posted 15 years ago # -
try to change this code :
define('UPLOAD_DIR', '/public_html/uploadedlogo');
to
define('UPLOAD_DIR', '/home/airplane/public_html/uploadedlogo');
and make sure "uploadedlogo" folder have write and read permission on it.
MachForm Support
Posted 15 years ago # -
the folder uploadedlogo has 777 permissions and I changed the path to:
define('UPLOAD_DIR', '/home/airplane/public_html/uploadedlogo');
Got the following error:
Warning: move_uploaded_file(/home/airplane/public_html/uploadedlogo/form_1/files/element_1_38f055dc79c7e2ea5845f562f9567085-19-1252589718-nchsaa.gif) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/airplane/public_html/machform/includes/post-functions.php on line 1036 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpiPfQ5V' to '/home/airplane/public_html/uploadedlogo/form_1/files/element_1_38f055dc79c7e2ea5845f562f9567085-19-1252589718-nchsaa.gif' in /home/airplane/public_html/machform/includes/post-functions.php on line 1036 Warning: Cannot modify header information - headers already sent by (output started at /home/airplane/public_html/machform/includes/post-functions.php:1036) in /home/airplane/public_html/machform/view.php on line 41
The file path seems to be correct, any other ideas why this may not be working?
Oh and about the HttpClient class: That will be able to send all the form data to a php script in a different location on my server? Just double-checking
In the php script receiving that data, it's retrieved using the Post method correct?
Thank you very much for the help!
Posted 15 years ago # -
Anyone have any ideas why this isn't working? I'm not even able to access different folders inside machforms folder.
Posted 15 years ago # -
When you changed the UPLOAD_DIR setting, is the form already created or not?
Try to create a new form with a single file upload field then test uploading small files.Let me know how it goes.
MachForm Founder
Posted 15 years ago # -
Ok, my dir is:
define('UPLOAD_DIR', './uploadlogo')
Then I created a new form only with one file upload field and I have the same error.
Here's the link to the form: http://www.airplanepeanuts.com/machform/view.php?id=6
Posted 15 years ago # -
The link doesn't seem to be valid anymore.
Anyway, this seems to be difficult to investigate here.Can you contact us directly please?
Let me know the FTP login to your machform folder as well.I believe this can be solved easily.
Please send to: customer.service [at] appnitro.comMachForm Founder
Posted 15 years ago #
Reply
You must log in to post.