Jump to content

Archived

This topic is now archived and is closed to further replies.

lazi

HELP HELP HELP

Recommended Posts

Hiya guys below is the script for my form mail action can some1 please tell me why it doesnt work! Also posted id the html for the form it refers to! Stick with it and read it guys and your eternal place in heaven will be secured!!! I have spent too long on this!!
[code]
<?

// ------------- CONFIGURABLE SECTION ------------------------


$mailto = 'oders@lazyiphotography.com' ;
$subject = "Feedback Form" ;
$formurl = "http://www.lazyiphotography.co.uk/htdocs/form.htm" ;
$errorurl = "http://www.lazyiphotography.co.uk/htdocs/error.htm" ;
$thankyouurl = "http://www.lazyiphotography.co.uk/htdocs/ty.htm" ;

$uself = 1;

// -------------------- END OF CONFIGURABLE SECTION ---------------

$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$pid = $_POST['photoID'] ;
$email = $_POST['email'] ;
$name = $_POST['name'] ;
$hname = $_POST['housename'] ;
$ad = $_POST['ad'] ;
$ad1 = $_POST['ad1'] ;
$ad2= $_POST['ad2'] ;
$ad3 = $_POST['ad3'] ;
$county = $_POST['county'] ;
$pc = $_POST['pc'] ;
$phone = $_POST['phone'] ;
$A4Q= $_POST['A5Q'] ;
$A6Q = $_POST['A6Q'] ;
$A5Q = $_POST['A4Q'] ;
$Format = $_POST['format'] ;
$http_referrer = getenv( "HTTP_REFERER" );

if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($format) || empty($housename) || empty($ad1) || empty($ad2) || empty($ad3) || empty(county) || empty($pc) || empty($phone) || empty($A5Q) || empty($A4Q) || empty($A6Q) || empty($pid) || )) {
header( "Location: $errorurl" );
exit ;
}
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email) || ereg( "[\r\n]", $pid ) || ereg( "[\r\n]", $housename ) ereg( "[\r\n]", $ad ) || ereg( "[\r\n]", $ad1) || ereg( "[\r\n]", $ad2 ) || ereg( "[\r\n]", $ad3 ) ereg( "[\r\n]", $pc ) || ereg( "[\r\n]", $format) || ereg( "[\r\n]", $county) || ereg( "[\r\n]", $phone ) || ereg( "[\r\n]", $A5Q ) ereg( "[\r\n]", $A6Q ) || ereg( "[\r\n]", $A4Q) ) {
header( "Location: $errorurl" );
exit ;
}

if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}

$messageproper =

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name of sender: $name\n" .
"Email of sender: $email\n" .
"Photo ID: $pid\n"
"House Name: $housename\n"
"Adress : $ad\n"
"Adress 1: $ad1\n"
"Adress 2: $ad2\n"
"Adress 3: $ad3\n"
"County: $county\n"
"Postcode: $pc\n"
"Phone number: $phone\n"
"A4 quantity: $A4Q\n"
"A5 quantity: $A5Q\n"
"A6 quantity: $A6Q\n"
"Format : $format\n"



mail($mailto, $subject, $messageproper,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;

?>

[/code]

and the HTML:

[code]
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="font.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style2 {color: #FF0000}
-->
</style>
</head>

<body onLoad="MM_preloadImages('images/4.JPG')">

<p><img src="images/logo1.JPG" width="154" height="77"></p>
<p class="red">&nbsp;</p>
<form action="feedback.php" method="post">
<p class="hred">Order Form</p>
<p class="font">Thank you for chossing to perchase a photo fom lazyiphotography.</p>
<p class="font">Please take a moment to fill in this quick form.</p>
<p class="font">Photo ID
<input name="photoID" type="text" size="15" maxlength="8">
(apears under your selected photo) </p>
<p class="hred">Photo Size</p>
<p class="font"> <font color="#FFFFFF">.........</font>A6
(10.5cm x 14.8cm)
<input type="checkbox" name="checkbox" value="checkbox">
<font color="#FFFFFF">......</font>Quantiy
<input name="A6Q" type="text" size="5" maxlength="2">
(4.00 each)</p>
<p class="font"><font color="#FFFFFF">.........</font>A5
(##.#cm x ##.#cm)
<input type="checkbox" name="checkbox2" value="checkbox">
<font color="#FFFFFF">......</font>Quantiy
<input name="A5Q" type="text" size="5" maxlength="2">
(5.00 each) </p>
<p class="font"><font color="#FFFFFF">.........</font>A4 (##.#cm x ##.#cm)
<input type="checkbox" name="checkbox3" value="checkbox">
<font color="#FFFFFF">......</font>Quantiy
<input name="A4Q" type="text" size="5" maxlength="2">
(6.00 each)</p>
<p class="hred">Format</p>
<p class="font">Standard print: <span class="style2">1</span> <font color="#FFFFFF">............</font> Frame (5.00 extra): <span class="style2">2</span><font color="#FFFFFF">...... ..</font> Bitmap data CD: <span class="style2">3</span> </p>
<p class="font">
<label>Make your selection (<span class="style2">1,2,3</span>)
<input name="format" type="text" id="format">
</label>
</p>
<p class="hred">Contact info</p>
<p> <span class="style1">.................</span><span class="font">Name:
<input type="text" name="name">
</span></p>
<p class="font"><font color="#FFFFFF">....</font>Email address
<input type="text" name="email">
</p>
<p class="font">House Name/no.
<input type="text" name="housename">
</p>
<p class="font"><font color="#FFFFFF">....</font>Address line 1
<input type="text" name="ad">
</p>
<p class="font"><font color="#FFFFFF">....</font>Address line 2
<input type="text" name="ad2">
</p>
<p class="font"><font color="#FFFFFF">....</font>Address line 3
<input type="text" name="ad3">
</p>
<p class="font"><font color="#FFFFFF">.................</font>County
<input type="text" name="county">
</p>
<p class="font"><font color="#FFFFFF">............</font>Post code
<input type="text" name="pc">
</p>
<p class="font"><font color="#FFFFFF">...</font>Phone number
<input type="text" name="phone">
</p>
<p class="header1">&nbsp;</p>
<p class="hred">payment</p>
<p class="font">After you have recieved confirmation of your order through email, </p>
<p class="font">you are able to pay in one of the following ways: </p>
<p class="font">Paypal:</p>
<p class="red">payment@lazyiphotography.co.uk</p>
<p class="font">or send a cheque through to :</p>
<p class="font">William Kirstein, Ginger Street, Ginger Lane, Land of the ginger, GG1 GG2 </p>
<p class="font">&nbsp;</p>
<p class="hred">postage options</p>
<p class="font">next day delivery
<input type="checkbox" name="nd" value="checkbox">
</p>
<p class="font">standard
<input type="checkbox" name="stan" value="checkbox">
</p>
<p> <span class="font">
<input type=hidden name="recipient" value="orders%lazyiphotography.co.uk@mail.lazyiphotography.co.uk">
<p><input type="submit" value="Send Feedback" />
<input type="reset" value="Clear" name="Clear"></p>
</span> </P>
</form>
<p>&nbsp;</p>
<p class="font">w w w . l a z y i p h o t o g r a p h y . c o . uk </p>
</body>
</html>

[/code]

Share this post


Link to post
Share on other sites
What is the problem?  Also, can you put your code in the [ code ] brackets to save my mousewheel a bit?

Share this post


Link to post
Share on other sites
whenever i press the submit button on the form it just trys to link to the script as a page. I am also unsure of whether the script proofreads right not being an experianced php writer!

Share this post


Link to post
Share on other sites
[quote author=lazi link=topic=112356.msg455912#msg455912 date=1161546362]
whenever i press the submit button on the form it just trys to link to the script as a page. I am also unsure of whether the script proofreads right not being an experianced php writer!
[/quote]
can you elaborate on this a little?
also,be a little more patient :) you've posted a fair bit of code which is mindnumbing to go through to "guess" what the problem is if you dont explain the problem exactly. imagine how many times a script gets posted on here with the claim "it dont work" without anything else...

drop a better description of errors, etc here, crack open a beer, put your feet up and chill :)

Share this post


Link to post
Share on other sites
ok  then guys i will take your advice and exxplain the whole problem. I press the submit button on the form and it just goes to a blank screen instead of either the error or thankyou screen set at the start of code. IM not reali to sure about this whoel php thing and how it works. At the moment i have tried so many things but am not sure whether it is the html code or the php which is coded wrong. As far as i am concerned success is when it comes out with either the error screen or the thankyou for submitting screen and an email sen to me at the moment it does neither and leaves me witha blank web page. PLEASE HELP i have spent so many hours on this tryin to get it to work buit have given in to the fact that i need help!

Share this post


Link to post
Share on other sites
ok it's pretty safe to say that you have an error, only your PHP.INI is probably set up to not display errors. i've not gone through the code with a fine toothcomb, but in your PHP, you have this:

[code]
$messageproper =

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name of sender: $name\n" .
"Email of sender: $email\n" .
"Photo ID: $pid\n"
"House Name: $housename\n"
"Adress : $ad\n"
"Adress 1: $ad1\n"
"Adress 2: $ad2\n"
"Adress 3: $ad3\n"
"County: $county\n"
"Postcode: $pc\n"
"Phone number: $phone\n"
"A4 quantity: $A4Q\n"
"A5 quantity: $A5Q\n"
"A6 quantity: $A6Q\n"
"Format : $format\n"
[/code]
which has no dot (.) at the end of each line to join the strings together, and no semicolon (;) at the end.  put a dot at the end of the rest of the lines (the first 5 already have them) apart from this line:

[code]
"Format : $format\n"; <-- i added a semicolon
[/code]

if you have the means to do it, open your PHP.INI file and find a line that says 'display_errors' and make sure it says [b]On[/b] which will make it easier as you'll at least get a proper description of your error.

cheers
Mark

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.