PDA

View Full Version : phpFormGenerator -



kassi59
04-27-2006, 05:31 PM
Ive gotten as far as installing and creating with phpFormGenerator. Now Im not finding how to incorporate that within my site. Its all there in BlueFTP and all, but after searching all morning I cant find any information on how to have it work within my forms page. All I want from it is to be able to have my customers upload a photo.
Any help would be apreciated.
kate

navaldesign
04-27-2006, 05:36 PM
Usually phpFormGenerator forms are not embedded in BV, but used as independent pages. So just give your BV menu a link to the form page created with phpFG

kassi59
04-27-2006, 06:12 PM
Thank you Navaldesign. Im very very inexperienced here. First off my page Im refering to is:
http://www.kateart-cards.com/Appraisal%20Request%20Form.html
Second is that Id like to add an upload so as the customer may upload the photograph in need of repair so as I can give an appraisal cost. so I wouldnt need an elaborate setting for this only a simple..lol..<look at me using that word..something that they may do that.
In BV there is insert/form/file upload...now thats simple enough...yet Im lost after that...right click properties "T1"?...maybe add to the html before tag?, insert some magic into the inside or after tag?..
After installing the phpformgenerator, I have created the upload, yet have not clue to where the "form page" is..this is all very confusing to me. Ive been using my own scripts and reconstructing my own html, then today there was a huge DAH on my part that all that is offered right here..I know very DAH...guess Im a stubborn ole frenchmen..old dog/no tricks..or maybe just dense..haha..
But if there was a way to just use the upload via BV, that would be really simple and awsome..
thank you again,

navaldesign
04-27-2006, 07:54 PM
Creating the form is very simple: drag a Form area in your page, then start placing fields. T1 is the default name BV gives the text field: change it f.e. in "Name" or "email" or whatever the field is for. Add the titles of the fields as simple text. At the end, add an "Upload file" field for the photo to be uploaded. Of course you must add a "submit" button as well, and, if you want, a "Reset" button". Have a look at the tutorials: Form Tutorial 1 (http://www.vodahost.com/DemoDemo/bvt/custom_bluevoda_basicform.htm), Form Tutorial 2 (http://www.vodahost.com/DemoDemo/bvt/custom_bluevoda_formelements.htm)

Now, this is the easy part. The hard part is creating the php script that will actually do the submission and will also upload the file to your site.
If you don't want to loose time, let me know when you will have your form ready and i will provide it to you. Otherwise, just search the forms forum: i have posted many scripts for uploading files.

kassi59
04-27-2006, 08:40 PM
I do believe Im following you...At least reading it makes sense..I did find in the forum a script that you had provided but I will have to take a more indepth look/see at it as it didnt seem to go right, but Im sure its me, I work much better in the mornings when time isnt so crunched..thank you also for the tutorials - I had requested many searches and just couldnt find where the tutorials were..Its looking like Im going to have to stop hanging out in the lounge and get serious and do some reading and learning!
Again you have been a great help!

kassi59
04-27-2006, 09:33 PM
ok - done deal...very simiple using the tutorials...thanx again, Ill work on the scripts in the morning!

kassi59
04-28-2006, 11:03 AM
ok - Im scriptless - but Ill keep looking.

kassi59
04-28-2006, 06:18 PM
Well my search has come up nada. well not completely, I did find some that were so long I fell asleep reading them! I dont think I need that much script...maybe I do..
Heres what Ive come up with so far -
http://kateart-cards.com/test%20form.html

I just threw it up there so as to give an idea of what my needs are - after scripting it and its in working order I can then add the bells n whistles..Right now its set up for email submittal. But as you can see its a very simple thing I need - not a huge gallery. only a one to five photo option for appraisal.

navaldesign
04-28-2006, 06:40 PM
Hi Kate, what are all those hidden fields you have in your form? What they serve for? Also, why did you put in there that "upload" button? You don't need it. The "Submit for appraisal" button will do all the work. Email and Telephone fields have to be named correctly, for now they are both named T1, which is the default name that BV gives them. Just get rid of hidden fields and the "Upload" button, , change the form action in "upload.php", and the encoding in "multipart/form data". Then i'll prepare the script for you.

kassi59
04-28-2006, 07:59 PM
All finished. hidden fields gone,upload gone, form action set as "upload.php" encoded at multipart/form data, T1 corrected. and published..
I do really appreciate this - Ive been looking all day for a way to make this work!

navaldesign
04-28-2006, 09:27 PM
Hi Kate,

here you go:

<?php
// Receiving variables
@$Browse_Name = $_FILES['Browse']['name'];
@$Browse_Size = $_FILES['Browse']['size'];
@$Browse_Temp = $_FILES['Browse']['tmp_name'];
@$Browse_Mime_Type = $_FILES['Browse']['type'];
@$NAME = addslashes($_POST['NAME']);
@$YOUR_TOWN_CITY = addslashes($_POST['YOUR_TOWN_CITY']);
@$STATE_AND_ZIP = addslashes($_POST['STATE_AND_ZIP']);
@$YOUR_EMAIL = addslashes($_POST['YOUR_EMAIL']);
@$Photograph_condition = addslashes($_POST['Photograph_condition']);
@$Details = addslashes($_POST['Details']);
@$TELEPHONE = addslashes($_POST['TELEPHONE']);
function RecursiveMkdir($path)
{
if (!file_exists($path))
{
RecursiveMkdir(dirname($path));
mkdir($path, 0777);
}
}

// Validation
if( $Browse_Size == 0)
{
header("Location: error_email.html");
exit;
}
if( $Browse_Size >1000000)
{
//delete file
unlink($Browse_Temp);
header("Location: error_email.html");
exit;
}
$uploadFile = "uploads/".$Browse_Name ;
if (!is_dir(dirname($uploadFile)))
{
@RecursiveMkdir(dirname($uploadFile));
}
else
{
@chmod(dirname($uploadFile), 0777);
}
@move_uploaded_file( $Browse_Temp , $uploadFile);
chmod($uploadFile, 0644);
$Browse_URL = "http://www.kateart-cards.com/uploads/".$Browse_Name ;
if (strlen($NAME) == 0 )
{
header("Location: name_errorpage.html");
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $YOUR_EMAIL))
{
header("Location: email_errorpage.html");
exit;
}
if (strlen($YOUR_EMAIL) == 0 )
{
header("Location: error_email.html");
exit;
}
if (strlen($TELEPHONE) == 0 )
{
header("Location: email_errorpage.html");
exit;
}
// Find Server date and Time
$date = date("l jS F Y, g:i A");
// Find Browser and IPaddress
$browser =$_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['REMOTE_ADDR'];
//Sending Email to form owner
$pfw_header = "From: $YOUR_EMAIL\n"
. "Reply-To: $YOUR_EMAIL\n";
$pfw_subject = "NewPicture Uploaded";
$pfw_email_to = "your_email@kateart-cards.com ";
$pfw_message = "There is a new picture uploaded :\n"
. "-----------------------------------------------------\n"
. "NAME: $NAME\n"
. "EMAIL: $YOUR_EMAIL\n"
. "TOWN/CITY: $YOUR_TOWN/CITY\n"
. "STATE_AND_ZIP: $STATE_AND_ZIP\n"
. "TELEPHONE: $TELEPHONE\n"
. "----------------------------------------------------\n"
. "\n"
. "Photograph_condition: $Photograph_condition\n"
. "Details: $Details\n"
. "----------------------------------------------------\n"
. "Picture link: : $Browse_URL\n"
. "----------------------------------------------------"
. "----------------------------------------------------\n"
. "Received on : $date\n"
. "Browser : $browser\n"
. "IP address : $ip\n"
. "----------------------------------------------------\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: thankyou_page.html");
?>


Please follow these instructions:

1. Copy the code, paste it in notepad, then goto Save As, choose File Type All Files, and save the script as "upload.php". Upload it on your server in the public_html folder, using Blue FTP
2. While you are in your public_html, click somewhere on the right part of your screen. Then click on File > New Folder and in the popup that opens type "uploads" This way you will create a new folder, called "uploads" and that's where the uploaded pictures will end.
3. Browse the content of your site. Find the new folder, "uploads". It will probably be at bottom. Right Click on it , Properties, and you will see a number like 755 . Change it to 777.
4. I have inserted field validation for

a. Empty Name field.
b. Empty email field
c. Non truelike email

I have also inserted a thankyou page. So please create these three pages: "name_errorpage", "email_errorpage", "thankyou_page".

To get an idea of how these pages must be, have a look at :
http://www.navaldesign.info/error_email.html

http://www.navaldesign.info/error_empty_field.html

http://www.navaldesign.info/thankyou_page.html


Save and publish these pages, then test your form.

Please note that in your email you will receive a link like:

Picture Link: http://www.kateart-cards.com/uploads/filename.jpg

By clicking on the file, the picture will open on your browser, then you can sipmly rig***lick it to save it on your computer.

If the file name is more than one words, the file link will look like:

http://www.kateart-cards/uploads/file name.jpg

Of course, you must put your Vodahost account email in the script.

Good luck. let me know if you have problems.

As you see, in this case the link will not work, so you have to download it from your site using blueFTP.

kassi59
04-29-2006, 11:25 AM
I dont know how to thank you Navel. This is just so nice of you to help so much. I wont have time today to work on it but I will however get right on it sunday morning! - I could restore a photo for you in "return" if you would like me to?!...
again, thank you!

navaldesign
04-29-2006, 11:45 AM
No worriws kate, thanks a lot

kassi59
04-30-2006, 11:08 AM
Im busy working on your instructions! Ive gotten the three pages finished and published! now on to the less creative side...lol..

kassi59
04-30-2006, 11:55 AM
"upload.php" is on server, CHMOD set "777" on folder "uploads" All publishing done -
One thing is that I want my email to be : kassi1959****.com and not my vh email...I changed that in the script/did I do a booboo?
I received this error after submitting for appraisal.
Parse error: parse error, unexpected '=' in /home/kateart/public_html/upload.php on line 8

navaldesign
04-30-2006, 04:58 PM
The created folder should be "uploads" not "upload". Otherwise the script has to be modified accordingly.

Yes, sorry i didn't notice it: Modify the name of your YOUR_TOWN/CITY field in your form in YOUR_TOWN_CITY anf of course the script must be modified accordingly (see changes in RED in the script). Save and republish the form page.
It is the "/" thet causes the problem.

kassi59
04-30-2006, 05:13 PM
Gotcha - lol..I think...Ill try...smiles.

navaldesign
04-30-2006, 05:17 PM
Ok, waiting for news

kassi59
04-30-2006, 05:39 PM
alright! I did get thru to the thank you page! the back button doesnt work/and Ive not gotten the email as of yet...hmm . I need to get it at kassi1959****.com for me to be able to see it..

navaldesign
04-30-2006, 06:12 PM
Vodahost uses smtp authentication, which restricts emails sent witout it to the email adressess within the same server. However, i have found out that if you are on ns5/6, or 9/10 it might also work with your aol email. Try it. also check with BlueFTP to see if the picture has been uploaded in your "uploads" folder.

kassi59
04-30-2006, 06:22 PM
Yes I have checked and the photos are in fact going into the proper folder...
Im using ns3 and ns4. im now looking for a way to forward it over to aol..I had been signed up for neomail...

navaldesign
04-30-2006, 06:25 PM
I don't think there is another way to forward the mail, than setting a forwarder in your CP/Mail. Before doing that, why don't you check to see if it comes through your Vodahost email?

kassi59
04-30-2006, 06:49 PM
The only "VH" email I had ever set up with the neomail..I dont know of any other. I have put kassi1959****.com into the script..it was working but now after going thru the form Im getting the incorrect email page..argh..

navaldesign
05-01-2006, 07:01 AM
I tested your form this morning, seems working ok. Now about the email: you should setup a VH email: Goto to CP >Add / Remove / Manage Accounts > Add Account and create an email address f.e. feedback?kate-cards.com (feedback@kate-cards.com) chanhing ? with @ (not good to have your email on the forum). Use this email in the form script. If you want the mail getting to your desktop, just set up your Outlook Expresss to download your emails from your site.

kassi59
05-01-2006, 10:47 AM
ok...Im not that savvy here - I think Ive accomplished it. I created the account - now I have an "email.reg" on my desktop. lol, not quite sure why..My guess would be to upload it via ftp? Im going to try that, and add the email to the script and take a look/see.
Thanks for your patience with me, again its much apreciated.

kassi59
05-01-2006, 11:04 AM
I keep getting the email error page?..

navaldesign
05-01-2006, 11:15 AM
Kate, which is your actual form url?
I tried http://kateart-cards.com/test form.html and works ok. I tried it just two minutes ago. Did you fill in all the fields ?

kassi59
05-01-2006, 11:31 AM
Im going the actual route that the customer would take. That would be from the front page of the restoration and going thru to the appraisal.
I just finished a bit ago creating the email account. And did recieve your test email...looks to be a .gif attached..but (im so sorry for my ignorance) I dont know how to "get" it?
Great - now my site is down again!...

navaldesign
05-01-2006, 11:39 AM
just click on the link in the email. The .gif will open in IE then right click on it and save it anywhere on your computer

kassi59
05-01-2006, 11:43 AM
the picture link brings me directly to my photos website. not to IE...?

navaldesign
05-01-2006, 04:37 PM
Please change this line:

$Browse_URL = "http://www.kateart-cards.com/uploads/".$Browse_Name ;

There was a blank space after the .com and this caused the link to break. It was taking you to your site instead of the uploaded picture. After you do the change, save it again "Save as", File Type "All files", etc. as before, upload it on your site

kassi59
05-01-2006, 07:40 PM
Got it! Did it! and it works! I have to quit for the day, then tomorrow morning Ill get back onto it..Im still here getting the email error page. Im sure its something Ive done somewhere in connecting the site together, misnamed something I dont know but Ill take a fresh look in the morning! At least its mostly fixed!
Thanks!

kassi59
05-02-2006, 12:21 PM
well Ive republished everything and rechecked the upload.php to make sure Ive gotten all the info correct.
I changed the form a bit, maybe thats why Im having problems. cant seem to leave well enough alone! -
http://www.kateart-cards.com/test%20form.html
Im now getting a 404/file cant be found error...I did something wrong.

navaldesign
05-02-2006, 12:33 PM
Please go through the Save As .... procedure and upload the "upload.php" file again

kassi59
05-02-2006, 03:44 PM
should I set the "upload.php" to chmod 777? or just the "uploads" folder.
Ive finis the "save as" and uploaded the "upload.php"....

navaldesign
05-02-2006, 03:51 PM
Just the "uploads" folder. However you must have done something, because i still get a 404

kassi59
05-02-2006, 04:02 PM
I added a seperate box for the zip. I havent changed anything in FTP except the chmod for the "uploads" folder.
I recopied the code that you wrote here/corrected the mistakes/saved as/over wrote the existing file/copied over to html_public in FTP.
Ive also republished all pages...and refreshed inBlueFTP

navaldesign
05-02-2006, 04:42 PM
If you have added another field, the script has to be modified to insert that field in there to. But i still get a 404 error, so there must be some mistake. If you wish, let me know your loggin info (IP, username and password) so i can have a look. You already know my email.

kassi59
05-02-2006, 05:13 PM
I just found one mistake! I had forgotten to name the edit boxes after I re did everything...let me publish and see if it works now!
If its easier I can just take out the extra edit box (zip) I just thought it looked better that way...

navaldesign
05-04-2006, 10:04 AM
You have a mail explaining where the problem is.

kassi59
05-04-2006, 11:09 AM
lol....the problem lays with my tring to "help"!..I fixed my errors.

navaldesign
05-04-2006, 11:31 AM
tESTED THE FORM, SEEMS TO BE WORKING OK, SEE IF THE MAIL GETS TO YOU OK WITH ALL THE INFO AND THE UPLOAD LINK

kassi59
05-04-2006, 11:35 AM
I sent you the email I recieved. I looked in FTP "uploads" file seems fine..chmod 777, but still not recieving link and no photo in file.

navaldesign
05-04-2006, 12:05 PM
Hi Kate, i waited but didn't receive any mail

kassi59
05-04-2006, 12:10 PM
I resent it...should get it right away?..let me know :))

navaldesign
05-04-2006, 12:10 PM
You don't have the file uploaded because the field was originally "Browse", now you have set it to be "browse" And the "Photograph_condition" has become "Photograph condition", no "_"

navaldesign
05-04-2006, 12:14 PM
I did receive the mail. It's as i told you. Change the form and republish it

kassi59
05-04-2006, 12:33 PM
ok, I missed that, Im going to have to get better at minor details when it comes to working with html scripts. I know Im very bad with that.
I just tried it and it works wonderfully! now after I left it alone!
Thank you very much, you are very patient.