473,789 Members | 2,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why Does My PHP Script No Longer Work?

chunk1978
224 New Member
i wrote a custom PHP script last year and everything worked perfectly... recently my webserver upgraded to PHP 5 and now my script doesn't work properly.

what the script does is: users fill out info and optionally can upload images, the user receives and email receipt of all the data they just submitted, and i'm suppose to receive their information in my email.

what still works is that the user will receive their receipt and the images are uploaded to the designated "client_uploads " folder, and i never receive the submitted information in my email address. but it doesn't really make sense to me because when i fill out the form, it does send and will eventually lead me to the thank you page, which according to the script below, will only be visible if the user receives the email and i receive the email... but i never receive the email... *scratches head*

my script is quite long, so i'm cut out parts that aren't important:

[PHP]<?php

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- FILE UPLOADS

$datafiletext = $_POST["datafilete xt"];
$datafiletextcl ass2 = $_POST["datafiletextcl ass2"];
$filedate = date("d-m-Y");
$uploadfolder = "../../../../client_uploads/";
$uploadfileA = $uploadfolder . 'MY_SITE-' . $filedate . '-' . basename($_FILE S['datafile']['name']);

if ($datafiletext != "")
{
$fileAuploaded = @move_uploaded_ file($_FILES['datafile']['tmp_name'], $uploadfileA);
$fileAuploaded ? FileB() :
header ("Location: http://www.mysite.com/english/restoration/assignmentform/error.html");
}
else
{
FileB();
}

function FileB()
{
$datafiletext = $_POST["datafilete xt"];
$datafiletextcl ass2 = $_POST["datafiletextcl ass2"];
$filedate = date("d-m-Y");
$uploadfolder = "../../../../client_uploads/";
$uploadfileB = $uploadfolder . 'MY_SITE-' . $filedate . '-' . basename($_FILE S['datafileclass2 ']['name']);

if ($datafiletextc lass2 != "")
{
$fileBuploaded = @move_uploaded_ file($_FILES['datafileclass2 ']['tmp_name'], $uploadfileB);
$fileBuploaded ? ClientMail() :
header ("Location: http://www.mysite.com/english/restoration/assignmentform/error.html");
}
else
{
ClientMail();
}
}

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- CLIENT MAIL

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PHP VARIABLES

function ClientMail() {

$name = $_POST["name"];
$addressline1 = $_POST["addresslin e1"];
$addressline2 = $_POST["addresslin e2"];
#a bunch of other variables

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND CLIENT EMAIL / MIME BOUNDARY

$mime_boundary = "----MY_SITE----".md5(time( ));

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-- HEADERS

$to = "$email";
$subject = "Assignment Form Online Submission Received";
$headers = "From: MY_SITE <reception@mysi te.com>\n";
$headers .= "Reply-To: MY_SITE <reception@mysi te.com>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative; boundary=\"$mim e_boundary\"\n" ;

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- TEXT FORMAT START

$message = "--$mime_boundary\ n";
$message .= "Content-Type: text/plain; charset=UTF-8\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";


$message .= "$name:\n\n This email is to confirm that MY_SITE has received your assignment via Assignment Form Online.\n\n";


# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- HTML FORMAT START

$message .= "--$mime_boundary\ n";
$message .= "Content-Type: text/html; charset=UTF-8\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";

$message .= "<html>\n";
$message .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:11px; color:#999999;\ ">\n";
$message .= "$name:\n\n This email is to confirm that MY_SITE has received your assignment via Assignment Form Online.\n\n";
$message .= "</body>\n";
$message .= "</html>\n\n";

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- HTML FORMAT END / FINAL BOUNDARY

$message .= "--$mime_boundary--\n\n";





# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO CLIENT
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO CLIENT
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO CLIENT





$mail_sent = @mail( $to, $subject, $message, $headers );
$mail_sent ? MY_SITEMail() :
header ("Location: http://www.mysite.com/english/restoration/assignmentform/error.html");

}



# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO MY_SITE
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO MY_SITE
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO MY_SITE





function MY_SITEMail() {

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PHP VARIABLES

$name = $_POST["name"];
$addressline1 = $_POST["addresslin e1"];
#a bunch of other variables
$ftpuploadfolde r = "ftp://login:password@ mysite.com:21//client_uploads/";
$ftpfileA = 'MY_SITE-' . $filedate . '-' . $datafiletext;
$ftpfileB = 'MY_SITE-' . $filedate . '-' . $datafiletextcl ass2;

# -=-=-=- MY_SITE'S EMAIL HEADERS

$imageemail = "MY_SITE <reception@mysi te.com>";
$imagesubject = "Assignment Form Online Submission";
$imageheaders = "From: $name <$email>\n";
$imageheaders .= "Reply-To: $name <$email>\n";
$imageheaders .= "MIME-Version: 1.0\n";
$imageheaders .= "Content-Type: text/html; charset=UTF-8\n";
$imageheaders .= "Content-Transfer-Encoding: 8bit\n\n";

# -=-=-=- MY_SITE'S HTML (ONLY) EMAIL BODY

$imagemessage = "<html>\n";
$imagemessage .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#999999;\ ">\n";
$imagemessage .= "<br>\n";
$imagemessage .= "Bla Bla Bla\n\n";
$imagemessage .= "</body>\n";
$imagemessage .= "</html>\n\n";

# -=-=-=- SEND MY_SITE MAIL

mail($imageemai l, $imagesubject, $imagemessage, $imageheaders);
header ("Location: http://www.mysite.com/english/restoration/assignmentform/complete/");

}
?>[/PHP]

i'm concerned that server admins changed something (but i don't know what, other than upgrading PHP)... i'm really not amazingly strong at PHP, but i'm 100% certain that this script worked flawlessly and now it doesn't... i've contacted my host and they told me they're not web developers so essentially i'm on my own... would the new PHP version support older syntax?

i really hope someone can help me out here... i'm quite lost.
Aug 14 '08 #1
2 1837
chunk1978
224 New Member
nevermind... my host server contacted me saying "it should work now"... so clearly the script is fine and that the fault lies with them... and yes, it does work now...
Aug 14 '08 #2
pbmods
5,821 Recognized Expert Expert
Heya, Chunk.

Glad to hear you got it all sorted out. Good luck with your project, and if you ever need anything, post back anytime!
Aug 14 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2336
by: lawrence | last post by:
Maybe its late and I'm tired but I don't understand what I'm seeing on the screen. I have this block of code: $choiceMade = $_GET; if ($simpleMode == "y" && $choiceMade == "") { startPage(); printEasyControlPanelOptions(); endPage();
12
4586
by: lawrence | last post by:
I notice that when my weblog software tries to contact www.weblogs.com, to use the update service, my whole site (all PHP) slows down. Contacting www.weblogs.com can take a long time. I can't figure out what is going on, unless the PHP interpreter gets bogged down trying to contact www.weblogs.com, and so is less able to serve up PHP pages to other website visitors. But if the PHP interpreter was that vulnerable to slow-downs, it doesn't...
2
2979
by: news frontiernet.net | last post by:
I have key entered and tried to run example 4-6 from Dany Goodmans DYNAMIC HTML book, version one that is on pages 94-96. This is part of my effort to learn JavaScript. I checked each byte and position back against the book for syntax errors but still cannot get this script to work. I tells me that; 1. Line 49 has a missing ";" at bye 13 2. Line 89 has a missing object at byte 1
2
1614
by: Eric Petzold | last post by:
This is a small excerpt of a larger script, but it is creating alot of frustration. I am trying to query the vaule of a hidden form field via onSubmit... if the function gets called out-right it works okay, but if it gets called onSubmit, only the first form field value gets displayed and the rest are undefined. Help! <script> function showValues() {
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9016
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.