Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
error sending form plz help
Old 06-19-2006, 02:13 PM error sending form plz help
Arfan's Avatar
Ultra Talker

Posts: 280
Trades: 0
Hi

here is the link to my website

http://arfan.phpnet.us/index.html

wen i send the mail i keep getting error plz help me

here is the PHP script

PHP Code:
<? /* BEGIN - SECTION 1 */ ?>
<?php
    
    
require($_SERVER["DOCUMENT_ROOT"] . "/FORMfields/FORMfields.php"); 

    
define("SLEEP"4);
    
define("FF_FORM_NAME""contact");
    
define("FF_FORM_TITLE""contact");
    
define("FF_STYLE_FILE"FF_ROOT_URL "/styles/default.css");
    
define("FF_SHOW_W3C_VALIDATOR"false);
    
define("FF_DISPLAY_CONFIRMATION"false);
    
define("FF_INSERT_INTO_DB"false);
    
define("FF_SEND_EMAIL"true);
    
define("FF_EMAIL""Arfan_mahmood_786@hotmail.com");
    
define("FF_CANCEL_URL""http://sdali.netfirms.com/order.html");
    
define("FF_DONE_URL""http://sdali.netfirms.com/");
    
    
define("FF_ENTER"1);
    
define("FF_CONFIRM"2);
    
define("FF_DONE"3);
    
    
$action FF_ENTER;

    
$formBean = new FormBean();
    
$formBean->addField(new SubmitField("_submit""Submit"));
    
$formBean->addField(new SubmitField("clear""Clear"));
    
    if (
FormField::getOrNull("_confirm"$_REQUEST) || FormField::getOrNull("_back"$_REQUEST)) {
        
$formBean->setEditable(false);
    }

    
$formBean->getParameters();
    
    if (
FormField::getOrNull("_back"$_REQUEST)) {
        
$formBean->setEditable(true);
    }
    
    if (
FormField::getOrNull("_submit"$_REQUEST) || FormField::getOrNull("_confirm"$_REQUEST)) {
        if (
$formBean->checkValues()) {
            if (
FF_DISPLAY_CONFIRMATION && !FormField::getOrNull("_confirm"$_REQUEST)) {
                
// CONFIRMATION OPERATION:
                
$formBean->setEditable(false);
                
$formBean->addField(new SubmitField("_back""< Back"));
                
$formBean->addField(new SubmitField("_confirm""Confirm >"));
                
$action FF_CONFIRM;
            } else {
                
// SUBMIT OPERATION:
                
$action FF_DONE;
                if (
FF_SEND_EMAIL)
                    
$formBean->email(FF_EMAILFF_FORM_TITLE " Submission");
                if (
FF_INSERT_INTO_DB) {
                    
$formBean->addField(new DateTimeField("__inserted_on""Inserted On"REQUIREDnull));
                    
$formBean->formFields["__inserted_on"]->getCurrentDateTime();
                    
$formBean->insertValuesIntoDb(FF_FORM_NAME);
                }
            }
        }
    } else if (
FormField::getOrNull("clear"$_REQUEST)) {
        
// CLEAR OPERATION:
        
$formBean->clearAllData();
    } else if (
FormField::getOrNull("cancel"$_REQUEST)) {
        
// CANCEL OPERATION:
        
header("Location: " FF_CANCEL_URL);
    } else if (!
$formBean->getButtonClicked()) {
        
// DEFAULT OPERATION:
        // Enter default values here. Example: 
        // $formBean->setValue("name", "John");
    
}
    
?>
<? 
/* END - SECTION 1 */ ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title><?= FF_FORM_TITLE ?></title>
<? /* BEGIN - SECTION 2 */ ?>
<? 
if ($action == FF_DONE) { ?>
    <meta http-equiv="Refresh" content="<?= SLEEP ?>; url=<?= FF_DONE_URL ?>">
<? ?>
<link rel="stylesheet" type="text/css" href="<?= FF_ROOT_URL ?>/FORMfields.css" />
<script type="text/javascript" src="<?= FF_ROOT_URL ?>/FORMfields.js"></script>
<link rel="stylesheet" type="text/css" href="<?= FF_ROOT_URL ?>/tableHelpers.css" />
<link rel="stylesheet" type="text/css" href="<?= FF_STYLE_FILE ?>" />
<style type="text/css">
    /* Sometimes it is useful to specify a label width */
    /*label.notValid, label.isValid, label.disabled, label.display {
        width: 150px;
    }*/
</style>
<? /* END - SECTION 2 */ ?>
</head>

<body onload="setFocus();" class="FORMfields">
<? /* BEGIN - SECTION 3 */ ?>
    <table>
    <tr>
    <td>
    <a name="ffStart"></a>
    <form action="#ffStart" method="post" enctype="multipart/form-data">
        <div class="FORMfields">
            <h1 class="FORMfields"><?= FF_FORM_TITLE ?></h1>
            <? if ($action == FF_DONE) { ?>
                <br />
                <div style="font: normal normal bold 18px verdana;">
                    Thank you for your submission.
                </div>
                <div style="margin-top:20px;font: normal normal bold 12px verdana;">
                    Note: Please click <a href="/">here</a> if your browser does not redirect in <?= SLEEP ?> seconds.
                </div>
                <br />
            <? } else {
                if (
$action == FF_CONFIRM) {
                    
?>
                        <h3 class="FORMfields">
                            Please confirm that the following data is correct:
                        </h3>
                    <?
                
} else {
                    
?>
                        <div style="text-align:right;">
                            <span class="required">*</span><span class="help" style="padding-left:0px;font-size:9px;"> - required</span>
                        </div>
                    <?
                
}
                
                echo 
$formBean->getTableTag();
            } 
?>
            
        </div>
        <div style="text-align:left;margin:10px 3px 10px 3px;">
            <a style="font: normal normal normal 9px verdana,sans-serif;" href="http://www.formfields.com" target="_blank">Form Generated by FORMgen</a>
        </div>
        <? if (FF_SHOW_W3C_VALIDATOR) { ?>
            <div>
                <a href="http://validator.w3.org/check?uri=referer"><img border="0" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a>
                <a href="http://jigsaw.w3.org/css-validator/check/referer"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
            </div>
        <? ?>
    </form>
    </td>
    </tr>
    </table>
<? /* END - SECTION 3 */ ?>
</body>

</html>
__________________

Please login or register to view this content. Registration is FREE


For all your Flash work email me on

Please login or register to view this content. Registration is FREE
Arfan is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-21-2006, 03:50 AM Re: error sending form plz help
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
What is an error?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 06-21-2006, 05:54 AM Re: error sending form plz help
Junior Talker

Posts: 4
Name: Harry Spink
Trades: 0
Ok.

Check this file exists.

var/www//FORMfields/FORMfields.php

an is accesible from apache.

Ok, it does seem the file
Quote:
/var/www//FORMfields/FORMfields.php
is there but not accesible by apache. I would suggest moving the file to he ame folder as your script is. Then instead of /var/www....... just put filename

Last edited by Churk; 06-21-2006 at 05:56 AM..
Churk is offline
Reply With Quote
View Public Profile
 
Old 06-21-2006, 05:55 AM Re: error sending form plz help
Junior Talker

Posts: 4
Name: Harry Spink
Trades: 0
Code:
Warning: main(): open_basedir restriction in effect. File(/var/www//FORMfields/FORMfields.php) is not within the allowed path(s): (/home:/tmp:/var/lib/php4/) in /home/arfan/www/contact.php on line 4

Warning: main(/var/www//FORMfields/FORMfields.php): failed to open stream: Operation not permitted in /home/arfan/www/contact.php on line 4

Fatal error: main(): Failed opening required '/var/www//FORMfields/FORMfields.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/arfan/www/contact.php on line 4
Correct me if im wrong but there the errors he is recieving. al to do wit permissions by the looks of things.

But im prob wrong
Churk is offline
Reply With Quote
View Public Profile
 
Old 06-21-2006, 08:49 AM Re: error sending form plz help
cdwhalley.com's Avatar
Skilled Talker

Posts: 75
Trades: 0
Churk, it is more a security restriction imposed by PHP than whether the file exists or not.
Quote:
open_basedir restriction in effect
Look to your php.ini.
cdwhalley.com is offline
Reply With Quote
View Public Profile Visit cdwhalley.com's homepage!
 
Old 07-01-2006, 08:25 AM Re: error sending form plz help
Arfan's Avatar
Ultra Talker

Posts: 280
Trades: 0
i have know changed my php script aswell as html file but this time there is no error but the message is not send here is the script with html form

here is the html form

HTML Code:
<head>
<title>Contact Page</title>
</head>
<body>

<form action="config/contact.php" method="post" name="contact">
  <p>Name:
    <input name="name" type="text">
    <br>
    <br>
  Email Address:
  <input name="email" type="text">
  </p>
  <p>Comments: 
    <textarea name="comments"></textarea>
    <br>
    <br>
    <input type="submit" name="Submit" value="Submit">
    <input name="reset" type="reset" id="reset" value="Reset">
  </p>
</form>
</body>
</html>
here is the PHP file in config folder named contact.php

PHP Code:
<?php

// Receiving variables
@$pfw_ip$_SERVER['REMOTE_ADDR'];
@
$name addslashes($_POST['name']);
@
$email addslashes($_POST['email']);
@
$comments addslashes($_POST['comments']);

// Validation

if (strlen($name) == )
{
die(
"<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid name</font></p>");
}
if (! 
ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+'$email))
{
die(
"<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid email</font></p>");
}

if (
strlen($email) == )
{
die(
"<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid email</font></p>");
}

if (
strlen($comments) == )
{
die(
"<p align='center'><font face='Arial' size='2' color='#000000'>Please enter a valid comment</font></p>");
}

//Sending Email to form owner
$pfw_header "From: $email\n"
  
"Reply-To: $email\n";
$pfw_subject "Website Mail";
$pfw_email_to "Arfan_mahmood_786@hotmail.com";
$pfw_message "Visitor's IP: $pfw_ip\n"
"Name: $name\n"
"Email: $email\n"
"Comment: $comment\n";
@
mail($pfw_email_to$pfw_subject ,$pfw_message ,$pfw_header ) ;

//Sending auto respond Email to visitor
//Available only in the full version

 
echo("<p align='center'><font face='Arial' size='3' color='#000000'>Email sent we shall try to get back to you as soon as possible</font></p>");
?>
this version is not on the website

because i am sending to hotmail account cud this be the problem?
__________________

Please login or register to view this content. Registration is FREE


For all your Flash work email me on

Please login or register to view this content. Registration is FREE

Last edited by Arfan; 07-01-2006 at 08:53 AM..
Arfan is offline
Reply With Quote
View Public Profile
 
Old 07-01-2006, 10:14 AM Re: error sending form plz help
Unknown.

Posts: 1,693
Trades: 0
Quote:
Originally Posted by Arfan
because i am sending to hotmail account cud this be the problem?
Sending messages to an hotmail account will most likely end up with them in the Junk Email folder.. so check there if you haven't already.
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
Old 07-01-2006, 10:15 AM Re: error sending form plz help
Arfan's Avatar
Ultra Talker

Posts: 280
Trades: 0
i checked junk mail not there
__________________

Please login or register to view this content. Registration is FREE


For all your Flash work email me on

Please login or register to view this content. Registration is FREE
Arfan is offline
Reply With Quote
View Public Profile
 
Old 07-01-2006, 02:40 PM Re: error sending form plz help
ChancesAre's Avatar
Skilled Talker

Posts: 84
Trades: 0
What about check the return value, people always forget that
ChancesAre is offline
Reply With Quote
View Public Profile
 
Old 07-01-2006, 05:08 PM Re: error sending form plz help
Arfan's Avatar
Ultra Talker

Posts: 280
Trades: 0
what do u mean check the return value?

cud u elabrote please
__________________

Please login or register to view this content. Registration is FREE


For all your Flash work email me on

Please login or register to view this content. Registration is FREE
Arfan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to error sending form plz help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30587 seconds with 12 queries