Log in

View Full Version : PHP email form



vacatia
04-27-2008, 05:59 AM
Hi there,

I'm currently trying to use Dago Designs email script.

I have a page and on there I wanted to have the actual form to fill out.

However I understand I need to create a php file, so I did, the script is as follows and the file is jointheclub3.php:

This script requires you to download the files and upload them onto your server, there is a css file and a php file. The php file I made some changes to as required:



$standalone = 'http://www.mysite.ca/dd-formmailer[1]/dd-formmailer/dd-formmailer.css;

// If you are using the standalone option, enter the relative path to your CSS file so it
// can be declared properly in the header

$path_to_css = 'http://www.mysite.ca/dd-formmailer[1]/dd-formmailer/dd-formmailer.css';

// For those of you including this script in another PHP file, be sure to manually
// add the CSS declaration in the header section of your page:
// <link rel="stylesheet" href="(location of dd-formmailer.css)" type="text/css" media="screen" />

// LANGUAGE SETTING
// The relative path to the language file you want to use.

$language = 'lang/English.php';

// FULL URL TO SCRIPT
// The full URL to dd-formmailer.php (or whatever you have renamed it to)

$script_path = 'http://www.mysite.ca/jointheclub3.php';

// FULL URL TO CONTACT PAGE
// If you are running this script in standalone mode, leave this blank. Otherwise,
// enter the full URL to the page that is displaying the form

$path_contact_page = '';

// RECIPIENT DATA
// If you are just sending email to a single address, enter it here. For more advanced
// usage such as multiple recipients, CC, BCC, etc.. please see the web page for instructions

$recipients = 'whatever@yahoo.com';

// FORM STRUCTURE
// This is used to generate the form. Each form element must be on its own line.
// Detailed usage instructions can be found on the web page

$form_struct = '
type=text|class=fmtext|label=First Name|fieldname=fm_firstname|max=100|req=true
type=text|class=fmtext|label=Last Name|fieldname=fm_lastname|max=100|req=true
type=text|class=fmtext|label=Address|fieldname=fm_address|max=100|req=true
type=text|class=fmtext|label=Home Phone|fieldname=fm_phonehome|max=100|req=true
type=text|class=fmtext|label=Cell Phone|fieldname=fm_phonecell|max=100|req=true
type=text|class=fmtext|label=Email|fieldname=fm_email|max=100|req=true|ver=email
type=text|class=fmtext|label=Subject|fieldname=fm_subject|max=100|req=true
type=verify|class=fmverify|label=Verify
type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|max=1000|rows=6|req=true
';


Now I can't for the life of me get this to work. The php page I created doesn't work, and even if it did, how do it get it on the html page? Or do I not?

Nile
04-27-2008, 06:06 AM
Your problem should be right here:


$standalone = 'http://www.grillmasters.ca/dd-formmailer[1]/dd-formmailer/dd-formmailer.css;

Which should be:


$standalone = 'http://www.grillmasters.ca/dd-formmailer[1]/dd-formmailer/dd-formmailer.css';

You forgot your single quote. ;)
And, no, you cannot put it on your HTML page.

vacatia
04-27-2008, 03:23 PM
Hi there,

Ok I fixed that quote, thanks!

Now if I can't put it on an html page, on my website I have to put a link to my php page right? The page I'm trying to get the script to show up on is jointheclub3.php and it's giving me all these weird errors still, even after fixing that quote

Nile
04-27-2008, 03:25 PM
Can I please see your errors? That may help. ;)
Also make sure that you have all access to include the file, make sure you can access it from your browser, and make sure that your settings in php.ini are right, for more information go here: http://www.dynamicdrive.com/forums/showpost.php?p=140773&postcount=3

vacatia
04-27-2008, 03:27 PM
Sure thing, when I go to www.mysite.ca/jointheclub3.php I see this:


Warning: include() [function.include]: URL file-access is disabled in the server configuration in /var/www/vhosts/grillmasters.ca/httpdocs/jointheclub3.php on line 8

Warning: include(http://www.mysite.ca/dd-formmailer[1]/dd-formmailer/dd-formmailer.php) [function.include]: failed to open stream: no suitable wrapper could be found in /var/www/vhosts/mysite.ca/httpdocs/jointheclub3.php on line 8

Warning: include() [function.include]: Failed opening 'http://www.grillmasters.ca/dd-formmailer[1]/dd-formmailer/dd-formmailer.php' for inclusion (include_path='.:') in /var/www/vhosts/mysite.ca/httpdocs/jointheclub3.php on line 8

The actual code I have on jointheclub3.php is:



<!-- \/ starthtml --><HTML><HEAD><TITLE>The Grilling Club - Join Now</TITLE>

<link rel="stylesheet" href="http://www.mysite.ca/dd-formmailer[1]/dd-formmailer/dd-formmailer.css" type="text/css" media="screen" />
</HEAD>


<?php include('http://www.mysite.ca/dd-formmailer[1]/dd-formmailer/dd-formmailer.php'); ?>



<!-- /\ end html --></FONT></BODY></HTML>

Nile
04-27-2008, 03:28 PM
Check my edit above.

Also make sure that you have all access to include the file, make sure you can access it from your browser, and make sure that your settings in php.ini are right, for more information go here: http://www.dynamicdrive.com/forums/s...73&postcount=3

vacatia
04-27-2008, 03:50 PM
Hi Nile,

Where do I find the php.ini file? I don't see anything like that

thetestingsite
04-27-2008, 03:52 PM
Are you hosting the site yourself (on your own server), or do you go through a webhost? If the latter, then you will need to contact your host and try to convince them to change the settings. Other than that, you are out of luck.

Instead of assigning absolute paths, why not use relative paths in the script. So basically, instead of having http://your-site you would have this: /path/to/file.

Hope this helps.

vacatia
04-27-2008, 03:55 PM
Hey there,

I"m on someone else's server. So he should be able to access the php.ini file?

Nile
04-27-2008, 03:55 PM
He may, he may not. It depends if he knows how. ;) But probably the answer is Yes.

vacatia
04-27-2008, 04:01 PM
Are you hosting the site yourself (on your own server), or do you go through a webhost? If the latter, then you will need to contact your host and try to convince them to change the settings. Other than that, you are out of luck.

Instead of assigning absolute paths, why not use relative paths in the script. So basically, instead of having http://your-site you would have this: /path/to/file.

Hope this helps.

Hi there!

I was wondering about this myself--say my mailer php file (dd-formmailer.php) is located in:
dd-formmailer[1] folder-->dd-formmailer folder-->dd-formmailer.php

On my coding I used those exact folders for example on my php page that I want the form to show up on:

<?php include('http://www.mysite.ca/dd-formmailer[1]/dd-formmailer/dd-formmailer.php'); ?>


Is that wrong?

Nile
04-27-2008, 04:04 PM
You don't wanna include the http. You cannot include something from another website.

vacatia
04-27-2008, 04:08 PM
Hi there,

What should I put instead?

Nile
04-27-2008, 04:10 PM
Well, the file that your including has to been in the same domain/sub domain, so say I have a website: ******.com and I'm trying to include something at: &&&&&&&.com, It won't work. You need to have it at ******.com.

vacatia
04-27-2008, 04:36 PM
Hey there,

Everything is under mysite.ca though (I'm uploading all the files to the same ftp area)