dwat
-
Content Count
2 -
Joined
-
Last visited
Posts posted by dwat
-
-
Hi i'm dan from new zealand, right next to my home land australia.
I have been writing php scripts for two years now and just recently none of them have been working.
Please help me out as best as you can, i'm sure it is only something simple.----------------Form 1--------------------------<?php// ---- Customized form script for the HBRC---------------// Receiving variables -----------------------------------@$fn = addslashes($_POST['fn']);@$ln = addslashes($_POST['ln']);@$f1 = addslashes($_POST['f1']);@$f2 = addslashes($_POST['f2']);@$f3 = addslashes($_POST['f3']);//---------------------------------------------------------------//-------Loop for Image relevant variables----------------for ($i = 1; $i <= 3; $i++){$fl = "fl$i";@$fl[$i]= $_FILES[$Image_Upload]['name'];@$fl_Size[$i]= $_FILES[$Image_Upload]['size'];@$fl_Name[$i]= $_FILES[$Image_Upload]['name'];@$fl_Temp[$i]= $_FILES[$Image_Upload]['tmp_name'];}function RecursiveMkdir($path){if (!file_exists($path)){RecursiveMkdir(dirname($path));mkdir($path, 0777);}}//---Upload the files if they exist---------------------------------for ($i = 1; $i <= 8; $i++){if ($fl_Size[$i] < $size and $fl_Size[$i] >0){$uploadFile = "uploads/".$fl_Name[$i];if (!is_dir(dirname($uploadFile))){@RecursiveMkdir(dirname($uploadFile));}else{@chmod(dirname($uploadFile), 0777);}@move_uploaded_file( $Image_Upload_Temp[$i] , $uploadFile);chmod($uploadFile, 0644);$Image_URL[$i] = "../images/uploads/".$fl_Name[$i];}}//---------------------------------------------------------------// Find Server date and Time (note server location-HBRC in US)---$date = date("l jS F Y, g:i A");//---------Sending Email to form owner ---------------------------$nd_header = "From: $pn\n". "Reply-To: $pea\n";$nd_subject = "Upload to the HBRC Website";$nd_email_to = "eitassignment@hbrc.dwat.co.nz";$nd_message = "New File(s):\n". "-------------------------------------------\n". "Senders First Name: $fn\n". "Senders Last Name: $ln\n". "Senders Email Address: $ea\n". "Senders Desired Password: $dp\n". "-------------------------------------------\n". "Fees are up to date: $mf\n". "-------------------------------------------\n";for ($i = 1; $i <= 8; $i++){if (@$Image_Upload_Size[$i] >0){$nd_message .= "Link to image $i : $Image_URL[$i] \n. "-------------------------------------------\n";}}. "-------------------------------------------\n"$nd_message .= "Date of Submission : $date\n". "-------------------------------------------\n"&mail($nd_email_to, $nd_subject ,$nd_message ,$nd_header );header("Location: thankyou.html");?>----------------------------------Form 2 ------------------------------------<?php// ---- Customized form script for the HBRC---------------// Receiving variables -----------------------------------@$fn = addslashes($_POST['fn']);@$ln = addslashes($_POST['ln']);@$dp = addslashes($_POST['dp']);@$ea = addslashes($_POST['ea']);@$mf = addslashes($_POST['mf']);//---------------------------------------------------------------// Find Server date and Time (note server location-HBRC in US)---$date = date("l jS F Y, g:i A");//---------Sending Email to form owner ---------------------------$nd_header = "From: $pn\n". "Reply-To: $pea\n";$nd_subject = "Query from the HBRC website";$nd_email_to = "eitassignment@hbrc.dwat.co.nz";$nd_message = "New Query:\n". "-------------------------------------------\n". "Senders First Name: $fn\n". "Senders Last Name: $ln\n". "Senders Email Address: $ea\n". "Senders Desired Password: $dp\n". "-------------------------------------------\n". "Fees are up to date: $mf\n". "-------------------------------------------\n"$nd_message .= "Date of Submission : $date\n". "-------------------------------------------\n"&mail($nd_email_to, $nd_subject ,$nd_message ,$nd_header );header("Location: thankyou.html");?>-------------------------------------Form 3 -------------------------------<?php// ---- Customized form script for the HBRC---------------// Receiving variables -----------------------------------@$fn = addslashes($_POST['fn']);@$ln = addslashes($_POST['ln']);@$dp = addslashes($_POST['pn']);@$ea = addslashes($_POST['ea']);@$mf = addslashes($_POST['cm']);@$mf = addslashes($_POST['qy']);//---------------------------------------------------------------// Find Server date and Time (note server location-HBRC in US)---$date = date("l jS F Y, g:i A");//---------Sending Email to form owner ---------------------------$nd_header = "From: $pn\n". "Reply-To: $ea\n";$nd_subject = "Query from the HBRC website";$nd_email_to = "eitassignment@hbrc.dwat.co.nz";$nd_message = "New Query:\n". "-------------------------------------------\n". "Senders First Name: $fn\n". "Senders Last Name: $ln\n". "Senders Email Address: $ea\n". "Senders Phone Number: $pn\n". "-------------------------------------------\n". "Query: $qy\n". "-------------------------------------------\n". "Contact Method: $cm\n". "-------------------------------------------\n"$nd_message .= "Date of Submission : $date\n". "-------------------------------------------\n"&mail($nd_email_to, $nd_subject ,$nd_message ,$nd_header );header("Location: thankyou.html");?>--------------------------------The end --------------------------
Thank you for your time. I am in need of these to work as it is for an assignment due in 5 hours time!!!!!
New Found Php Coding Errors I always thought these worked, but suddenly they no longer do?
in Programming
Posted · Report reply
Hey thanks for the replys everybody.I handed the assignment in as it was, much to my disgression. Just last week I got my grades back with a pass result, yay!Anyway I would jsut like to say thanks for the help, and you were right in saying that the php version on my server was recently upgraded, making my code non-compliant with the new requrements.I am not a fan of ASP or anything like that, PHP is my life, so I was worried for a second there that my PHP skills may have become redundant!Anyways just came to say thanks Daniel