View previous topic :: View next topic |
Author |
Message |
Modulok Rated XXX
Joined: 19 Oct 2005 Posts: 2120 Location: New Jersey
|
|
Back to top |
|
|
Little Bruin
Boo Boo
Joined: 07 Apr 2003
Posts: 667
Location: Pic-A-Nic Basket |
|
|
Blue|Fusion Rated XXX
Joined: 30 May 2005 Posts: 441 Location: Cleveland, OH
|
Posted: Wed, 08 Nov 2006 15:02:00 Post Subject: |
|
|
My pleasure :-)
_________________ 5 home-built PCs, ASUS A6Jc Laptop, and a PowerEdge 2650 - all running Gentoo. Now if only I can get a car and plane to run it. Take a look at my Gallery! |
|
Back to top |
|
|
Modulok Rated XXX
Joined: 19 Oct 2005 Posts: 2120 Location: New Jersey
|
Posted: Wed, 08 Nov 2006 15:59:56 Post Subject: |
|
|
yeah it works now...but I still get this: Code: | notice: undefined index: |
I click ok for the popup and it redirects back to the domain.com...and I get email which is good. It doesn't really matter because most ppl won't notice it.
|
|
Back to top |
|
|
Blue|Fusion Rated XXX
Joined: 30 May 2005 Posts: 441 Location: Cleveland, OH
|
Posted: Wed, 08 Nov 2006 23:04:58 Post Subject: |
|
|
To stop the notice, try adding a php.ini file to your homedir with the following:
Code: | error_reporting = E_ALL ~E_NOTICE |
Not sure if the php.ini method works with IIS. If not, ask your host if they can do that globally (they should, anyway).
_________________ 5 home-built PCs, ASUS A6Jc Laptop, and a PowerEdge 2650 - all running Gentoo. Now if only I can get a car and plane to run it. Take a look at my Gallery! |
|
Back to top |
|
|
Modulok Rated XXX
Joined: 19 Oct 2005 Posts: 2120 Location: New Jersey
|
Posted: Wed, 31 Jan 2007 16:51:56 Post Subject: |
|
|
OK, I am stuck again with PHP
I'm updating a very old and horrible form for a website. I need the ability to have customers upload files so we can quote new jobs. I found a script from Here and bought the license to use the advanced script for commercial use.
I modified the script(s) and it emails the results from the form as planned. The problem is, like the last time, PHP errors after the form is submitted. Since they are not fatal the form does email and I get the correct result I need.
What I only need is for a redirect after the PHP script is finished so the user isn't stuck at an error page wondering if what they sent went through.
This page is the live form if you would like to try it you may, but please don't send large files to me...thanks for any help.
Here is the php file the form calls: email.php
Code: |
<?php
// -------------------------------------------------------
// required fields should be loaded in a form and POSTed to email.php
// no changes are required in this module
// ------------------------------------------------------
session_start();$f_err = 0; $f_debug = 0; include "inc/econf.php"; include 'inc/efunc1.php'; include 'inc/efunc2.php'; $subject = ""; $header = ""; $template = ""; $message = ""; $name = ""; $footer = ""; $replyemail = ""; $cc = ""; $bcc = ""; $fmt = "text"; $url = ""; $include = ""; $attach = ""; $embed = ""; $mandatory = ""; $web = ""; $dom = "$ref[0]"; $error = "return_mail@$ref[0]"; $f_ch = "iso-8859-1"; if (isset($_POST)) $f_post = $_POST; else $f_post = $HTTP_POST_VARS; $f_r = getenv("HTTP_REFERER"); if ($f_r != "") {$f_x = 0; $f_y = 0; $f_r = strtolower($f_r); while($f_x < sizeof($ref)) {if(strstr($f_r,$ref[$f_x])) {$f_y = "1";}$f_x++;}if(!$f_y) {echo "X0100: Use of this script from $f_r is not permitted."; exit; }} $f_ml = ""; $f_c = 0; $f_ks[0] = ""; $f_vs[0] = ""; $f_n = 0; reset ($f_post); while (list ($f_k, $f_v) = each ($f_post)) {if ($f_k != 'aspam') $_SESSION[$f_k] = $f_v; if ($f_k == 'name') $name = $f_v; if ($f_k == 'web') $web = $f_v; if ($f_k == 'url') $url = $f_v; else if ($f_k == 'subject') $subject = $f_v; else if ($do && $f_k == 'destemail') $destemail = $f_v; else if ($f_k == 'dom') $dom = $f_v; else if ($f_k == 'replyemail') $replyemail = $f_v; else if ($f_k == 'attach') $attach = $f_v; else if ($f_k == 'embed') $embed = $f_v; else if ($f_k == 'fmt') $fmt = $f_v; else if ($f_k == 'cc') $cc = $f_v; else if ($f_k == 'bcc') $bcc = $f_v; else if ($f_k == 'header') $header = $f_v; else if ($f_k == 'template') $template = $f_v; else if ($f_k == 'include') $include = $f_v; else if ($f_k == 'message') $message = $f_v; else if ($f_k == 'footer') $footer = $f_v; else if ($f_k == 'mandatory') $mandatory = $f_v; else if ($f_k == 'f_ch') $f_ch = $f_v;else if ($f_k == 'metoo') $f_c = 1; else if ($f_k == 'ccsender') $f_c = 2;else if ($f_k == 'aspam') $aspam=$aspam; else {$f_ks[$f_n] = $f_k; $f_vs[$f_n] = $f_v; $f_n++;}} if ($f_c == 1) {if ($cc == "") $cc = $replyemail; else $cc .= ",$replyemail";} $f_tp = explode(",",$destemail); $destemail = ""; for ($f_x = 0; $f_x < sizeof($f_tp);$f_x++) {if(!strstr($f_tp[$f_x],"@")) {$f_tp[$f_x] .= "@".$dom;} if ($f_x > 0) $destemail .= ","; $destemail .= $f_tp[$f_x];} $f_e = false; if (errorStop($subject,$destemail,$replyemail,$cc,$bcc,$web)) $f_err = 1; else {if ($include != "") include $include; if ($f_ml != "0") {$f_h = create_mail_headers($fmt, $destemail, $replyemail, $cc, $bcc, $error, $f_ml, $mandatory); $f_msg = format_mail_content($fmt, $header, $template, $message, $footer, $replyemail, $name, $f_ks, $f_vs); $f_h .= create_mail_body($fmt, $f_msg, $message, $attach, $embed); $f_e = mail_send($destemail, $subject, $f_h, $f_q); if ($f_c == 2 && !$f_e) $f_e = mail_send($replyemail, 'CC: '.$subject, $f_h, $f_q);}} if(!$url) {$url = $f_r.'#thanks';} if ($f_e && !$f_err) header("location: $url"); else {print "<p align=\"center\"><a href=\"#\" onclick=\"history.go(-1);return false;\">back</a>"; if (!$f_err) print " <a href=\"$url\">thanks</a></p>";}
?> |
econf.php:
Code: | <?php
//$file = basename(__FILE__);if(eregi($file,$_SERVER['REQUEST_URI'])){die('This file cannot be accessed directly!');}
// place all valid servers in this array
// script will not send email when called from servers not listed
$ref = array("weiss-aug.com","www.weiss-aug.com");
// allow (1,2,3) or disallow (0) override of destination email address in form
// (-1) to only allow listed email addresses
// 2 = invalid if domain, mailserver, or mailbox is confirmed to not exist
// 3 = invalid even if mailserver refuses to verify if mailbox exists or not
$do = 0;
// verify (2,3) reply (sender) email address
// 0 = must be present and contain @
// 2 = invalid if domain, mailserver, or mailbox is confirmed to not exist
// 3 = invalid even if mailserver refuses to verify if mailbox exists or not
$ro = 0;
// destination email address - mandatory
// can be overridden by including destemail field in the form if override is allowed
$destemail = "mfiss@weiss-aug.com";
// list of valid destination addresses (if override = -1)
$val_email = array($destemail,'mfiss@weiss-aug.com');
// anti-spam check - enter any value to turn on anti-spam protection
// The aspam field in the form must then match this value unless this value
// is overridden by a corresponding session variable.
$aspam = '';
//set following to 1 if using qmail
$f_q = 0;
?> |
Description: |
|
Download |
Filename: |
readme.txt |
Filesize: |
9.27 KB |
Downloaded: |
370 Time(s) |
|
|
Back to top |
|
|
edvallie Put Beer Here
Joined: 07 Aug 2005 Posts: 1255 Location: Computer
|
Posted: Thu, 01 Feb 2007 15:23:26 Post Subject: |
|
|
enough to say $modulok != leet;
_________________ ABAP? What did you call me? |
|
Back to top |
|
|
Modulok Rated XXX
Joined: 19 Oct 2005 Posts: 2120 Location: New Jersey
|
Posted: Thu, 01 Feb 2007 15:34:38 Post Subject: |
|
|
I rushed into the thread thinking maybe you had something that would help...
and I'm not sure if that comment is good or bad.
|
|
Back to top |
|
|
Little Bruin
Boo Boo
Joined: 07 Apr 2003
Posts: 667
Location: Pic-A-Nic Basket |
|
|
edvallie Put Beer Here
Joined: 07 Aug 2005 Posts: 1255 Location: Computer
|
Posted: Thu, 01 Feb 2007 18:00:36 Post Subject: |
|
|
Modulok wrote: | I rushed into the thread thinking maybe you had something that would help...
and I'm not sure if that comment is good or bad. |
I'm actually in the process of learning PHP, but I'm afraid I don't know enough to help you here. Sorry buddy. Great language though, I love every minute of learning it.
EDIT - and WOW that is a sloppy mess of code.
_________________ ABAP? What did you call me? |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|