Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. what do you mean by "Page View" ?
  2. change to if(file_exists($con->fetchResult(0,"url"))){ $type = $con->fetchResult(0,"filetype"); $size = $con->fetchResult(0,"filesize"); $name = $con->fetchResult(0,"filename"); $path = $con->fetchResult(0,"url"); #$handle =fopen($path,'r'); $data = file_get_contents($path); #fclose($handle); echo "$path, $type, $size, $name"; //header("Content-type: $type"); //header("Content-length: $size"); //header("Content-Disposition: attachment; filename=$name"); //header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 //header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past //echo $data; exit; } and post results's (from opening the page directly)
  3. <?php $CountNames = ("SELECT *, count(BusinessType) as C FROM `businesses` GROUP BY BusinessType HAVING C < 3"); $findbusinessresult = @mysql_query($CountNames) or die(mysql_error()); $row = mysql_fetch_assoc($findbusinessresult); //<--missing echo $row['BusinessType']; ?>
  4. move session_start(); to the VERY TOP of the page it must be called before anything is sent to the page
  5. your probably missing session_start(); Personally..i would do this.. kinda overkill but works.. session_start(); $_SESSION["myusername"] =""; $_SESSION["mypassword"] =""; unset($_SESSION['myusername']); unset($_SESSION['mypassword']); session_destroy();
  6. okay.. what about setting a $_SESSION['GDCode']..and the GDimage.php read that instead?
  7. What corbin said.. makes life easier!
  8. thats code will have to be in another php script and your need to call it like an image.. ie <img src="GDStuff.php?id=12"> now the id = 12 tell that script where to get the details to draw that image.. i hope that helps
  9. OK you can do it without a self join.. Code if below you need it, Just quote this message to see it.. SELECT *, count(names) as C FROM `TEST` GROUP BY names HAVING C < 3 or Lookup COUNT & GROUP
  10. Yes it can be done.. i'm not sure if you asking how.. but i'll tell you this.. your use a self join and COUNT(*)
  11. Your very welcome, but could you click solved (bottom left) it saves others read the thread wanting to help only to find its solved
  12. yep.. should be mysql_query("DELETE from `contactinfo` WHERE Submission_Number = 1 "); infact, this would be better (will tell you the error) mysql_query("DELETE from `contactinfo` WHERE Submission_Number = 1 ") or die(mysql_error());
  13. try this <?php if ($stage == 1) { $yourname = "ACINL Survey 1"; $youremail1 = "Survey1@domain.com"; //change to your domain if ($previous_page == "") { $previous_page = $root_url; } $i = 0; $from = addslashes($youremail1); $fromName = addslashes($yourname); $subject = "Identifying the Skills We Need Now"; $msg_start .= " "; $msg_end .= ",\n\n<br>"; foreach($_POST['Q1'] as $value) { $msg_end .= "Question 1: $value\n"; } $msg_end .= "Question 1 Other: $Q1Other \n<br>"; $msg_end .= "Question 2: $Q2 \n<br>"; $msg_end .= "Question 3: $Q3 \n<br>"; $msg_end .= "Question 4: $Q4 \n<br>"; $msg_end .= "Question 5: $Q5 \n<br>"; $msg_end .= "Question 6: $Q6 \n<br>"; $msg_end .= "Question 6 Other: $Q6Other \n<br>"; $msg_end .= "Question 7: $Q7 \n<br>"; $msg_end .= "Question 8: $Q8 \n<br>"; $msg_end .= "Question 9: $Q9 \n<br>"; $msg_end .= "Question 10: $Q10 \n<br>"; foreach($_POST['Q11'] as $value) { $msg_end .= "Question 11: $value\n"; } $msg_end .= "Question 11 Other: $Q11Other \n<br>"; $msg_end .= "Question 12: $Q12 \n<br>"; $msg_end .= "Question 13: $Q13 \n<br>"; foreach($_POST['Q14'] as $value) { $msg_end .= "Question 14: $value\n"; } $msg_end .= "Question 14 Other: $Q14Other \n<br>"; $msg_end .= "Question 15: $Q15 \n<br>"; $msg_end .= "Question 15 Other: $Q15Other \n<br>"; $msg_end .= "Question 16: $Q16 \n<br>"; $msg_end .= "Question 17: $Q17 \n<br>"; $msg_end .= "Question 18: $Q18 \n<br>"; $msg_end .= "Question 19: $Q19 \n<br>"; $msg_end .= "Question 20: $Q20 \n<br>"; $msg_end .= "Question 21: $Q21 \n<br>"; $msg_end .= "Question 22: $Q22 \n<br>"; foreach($_POST['Q23'] as $value) { $msg_end .= "Question 23: $value\n"; } $msg_end .= "Question 23 Other: $Q23Other \n<br>"; $msg_end .= "Question 24: $Q24 \n<br>"; $msg_end .= "Question 25: $Q25 \n<br>"; foreach($_POST['Q26'] as $value) { $msg_end .= "Question 26: $value\n"; } $msg_end .= "Question 26 Other: $Q26Other \n<br>"; $msg_end .= "Question 27: $Q27 \n<br>"; $msg_end .= "Question 28: $Q28 \n<br>"; $msg_end .= "Question 29: $Q29 \n<br>"; $msg_end .= "Question 29 Other: $Q29Other \n<br>"; $msg_end .= "Question 30: $Q30 \n<br>"; $email5 = "bookninja@gmail.com"; $realname5 = "Indentifying the Skills We Need Now"; $subject = "ACINL Survey 1"; $msg = $msg_start.$realname5.$msg_end; $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "*************"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "***************"; // SMTP username $mail->Password = "**************"; // SMTP password $mail->From = $youremail1; $mail->FromName = $yourname; $mail->AddAddress("$email5", "$realname5 "); $mail->AddReplyTo("$email1","$name"); //$mail->WordWrap = 50; // set word wrap //$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); $mail->IsHTML(true); // send as HTML $mail->Subject = $subject; $mail->Body = $msg; $mail->AltBody = $msg; $mail->Send(); $sent_to .= " &#38;#149; $realname5 ($email5)<br>\n"; echo "\n<br>\n<br>Your responses have successfully been sent anonymously to ACI. Thank you for participating in this ACI research project."; } else { } ?>
  14. can you describe what your trying to get.. as your logic is wrong, so without know what you want is very hard to correct..! a bit of a shot in the dark.. but i think your searching for records where verdict is empty, and staff1, 2 or 3 are empty BUT Staff1 or 2 are set to Adminben, so if staff1 is empty but staff2 is Adminben then ignore it.. something like $sql=mysql_query(" SELECT * FROM report WHERE `verdict` = '' AND (`staff1` = '' OR `staff2` = '' OR staff3` = '') AND NOT (`staff1` = 'Adminben' OR `staff2` ='Adminben') ORDER BY `dtreported` ASC");
  15. in which case..why is this done? $mail->From = $youremail1; $mail->FromName = $yourname; i guess you could change to.. $yourname = "ACINL Survey 1"; $youremail1 = "Survey1@domain.com"; if ( (!empty($yourname)) && (!empty($youremail1)) ) {
  16. the logic makes sense, but i "think" you mean todo this $sql=mysql_query("SELECT * FROM report WHERE (`verdict` = '') AND ((`staff1` = '') OR (`staff2` = '') OR (`staff3` = '')) AND (`staff1` != 'Adminben') ORDER BY `dtreported` ASC");
  17. can you post the form.. that is used.. the one you use to enter your name and your email
  18. okay.. this may fix it.. change if ( ($yourname != "") && ($youremail1 != "") ) { to $yourname = $_POST['yourname']; $youremail1 = $_POST['youremail']; if ( (!empty($yourname)) && (!empty($youremail1)) ) {
  19. here try this.. <?php if ($stage == 1) { if ( ($yourname != "") && ($youremail1 != "") ) { if ($previous_page == "") { $previous_page = $root_url; } $i = 0; $from = addslashes($youremail1); $fromName = addslashes($yourname); $subject = "Identifying the Skills We Need Now"; $msg_start .= " "; $msg_end .= ",\n\n<br>"; foreach($_POST['Q1'] as $value) { $msg_end .= "Question 1: $value\n"; } $msg_end .= "Question 1 Other: $Q1Other \n<br>"; $msg_end .= "Question 2: $Q2 \n<br>"; $msg_end .= "Question 3: $Q3 \n<br>"; $msg_end .= "Question 4: $Q4 \n<br>"; $msg_end .= "Question 5: $Q5 \n<br>"; $msg_end .= "Question 6: $Q6 \n<br>"; $msg_end .= "Question 6 Other: $Q6Other \n<br>"; $msg_end .= "Question 7: $Q7 \n<br>"; $msg_end .= "Question 8: $Q8 \n<br>"; $msg_end .= "Question 9: $Q9 \n<br>"; $msg_end .= "Question 10: $Q10 \n<br>"; foreach($_POST['Q11'] as $value) { $msg_end .= "Question 11: $value\n"; } $msg_end .= "Question 11 Other: $Q11Other \n<br>"; $msg_end .= "Question 12: $Q12 \n<br>"; $msg_end .= "Question 13: $Q13 \n<br>"; foreach($_POST['Q14'] as $value) { $msg_end .= "Question 14: $value\n"; } $msg_end .= "Question 14 Other: $Q14Other \n<br>"; $msg_end .= "Question 15: $Q15 \n<br>"; $msg_end .= "Question 15 Other: $Q15Other \n<br>"; $msg_end .= "Question 16: $Q16 \n<br>"; $msg_end .= "Question 17: $Q17 \n<br>"; $msg_end .= "Question 18: $Q18 \n<br>"; $msg_end .= "Question 19: $Q19 \n<br>"; $msg_end .= "Question 20: $Q20 \n<br>"; $msg_end .= "Question 21: $Q21 \n<br>"; $msg_end .= "Question 22: $Q22 \n<br>"; foreach($_POST['Q23'] as $value) { $msg_end .= "Question 23: $value\n"; } $msg_end .= "Question 23 Other: $Q23Other \n<br>"; $msg_end .= "Question 24: $Q24 \n<br>"; $msg_end .= "Question 25: $Q25 \n<br>"; foreach($_POST['Q26'] as $value) { $msg_end .= "Question 26: $value\n"; } $msg_end .= "Question 26 Other: $Q26Other \n<br>"; $msg_end .= "Question 27: $Q27 \n<br>"; $msg_end .= "Question 28: $Q28 \n<br>"; $msg_end .= "Question 29: $Q29 \n<br>"; $msg_end .= "Question 29 Other: $Q29Other \n<br>"; $msg_end .= "Question 30: $Q30 \n<br>"; }else{ $msg_start ="youremail1 or yourname was not set correclty"; } $email5 = "bookninja@gmail.com"; $realname5 = "Indentifying the Skills We Need Now"; $subject = "ACINL Survey 1"; $msg = $msg_start.$realname5.$msg_end; $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "*************"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "***************"; // SMTP username $mail->Password = "**************"; // SMTP password $mail->From = $youremail1; $mail->FromName = $yourname; $mail->AddAddress("$email5", "$realname5 "); $mail->AddReplyTo("$email1","$name"); //$mail->WordWrap = 50; // set word wrap //$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); $mail->IsHTML(true); // send as HTML $mail->Subject = $subject; $mail->Body = $msg; $mail->AltBody = $msg; $mail->Send(); $sent_to .= " &#149; $realname5 ($email5)<br>\n"; echo "\n<br>\n<br>Your responses have successfully been sent anonymously to ACI. Thank you for participating in this ACI research project."; } else { } ?> if you get an email say it will prove my point..
  20. adding this echo "yourname = '$yourname', youremail1 = '$youremail1'~~"; should show something like this yourname = 'blar', youremail1 = 'blar'~~ if you get yourname = 'blar', youremail1 = ''~~ or yourname = '', youremail1 = 'blar'~~ then thats where the problem is
  21. Did you check the values ?
  22. the problem is probably here if ( ($yourname != "") && ($youremail1 != "") ) as, this stops the questions being added but does not stop the email sending.. change to echo "yourname = '$yourname', youremail1 = '$youremail1'~~"; if ( ($yourname != "") && ($youremail1 != "") ) and see if they have values set.. i have re-tabbed the code to make it more clear <?php if ($stage == 1) { if ( ($yourname != "") && ($youremail1 != "") ) { if ($previous_page == "") { $previous_page = $root_url; } $i = 0; $from = addslashes($youremail1); $fromName = addslashes($yourname); $subject = "Identifying the Skills We Need Now"; $msg_start .= " "; $msg_end .= ",\n\n<br>"; foreach($_POST['Q1'] as $value) { $msg_end .= "Question 1: $value\n"; } $msg_end .= "Question 1 Other: $Q1Other \n<br>"; $msg_end .= "Question 2: $Q2 \n<br>"; $msg_end .= "Question 3: $Q3 \n<br>"; $msg_end .= "Question 4: $Q4 \n<br>"; $msg_end .= "Question 5: $Q5 \n<br>"; $msg_end .= "Question 6: $Q6 \n<br>"; $msg_end .= "Question 6 Other: $Q6Other \n<br>"; $msg_end .= "Question 7: $Q7 \n<br>"; $msg_end .= "Question 8: $Q8 \n<br>"; $msg_end .= "Question 9: $Q9 \n<br>"; $msg_end .= "Question 10: $Q10 \n<br>"; foreach($_POST['Q11'] as $value) { $msg_end .= "Question 11: $value\n"; } $msg_end .= "Question 11 Other: $Q11Other \n<br>"; $msg_end .= "Question 12: $Q12 \n<br>"; $msg_end .= "Question 13: $Q13 \n<br>"; foreach($_POST['Q14'] as $value) { $msg_end .= "Question 14: $value\n"; } $msg_end .= "Question 14 Other: $Q14Other \n<br>"; $msg_end .= "Question 15: $Q15 \n<br>"; $msg_end .= "Question 15 Other: $Q15Other \n<br>"; $msg_end .= "Question 16: $Q16 \n<br>"; $msg_end .= "Question 17: $Q17 \n<br>"; $msg_end .= "Question 18: $Q18 \n<br>"; $msg_end .= "Question 19: $Q19 \n<br>"; $msg_end .= "Question 20: $Q20 \n<br>"; $msg_end .= "Question 21: $Q21 \n<br>"; $msg_end .= "Question 22: $Q22 \n<br>"; foreach($_POST['Q23'] as $value) { $msg_end .= "Question 23: $value\n"; } $msg_end .= "Question 23 Other: $Q23Other \n<br>"; $msg_end .= "Question 24: $Q24 \n<br>"; $msg_end .= "Question 25: $Q25 \n<br>"; foreach($_POST['Q26'] as $value) { $msg_end .= "Question 26: $value\n"; } $msg_end .= "Question 26 Other: $Q26Other \n<br>"; $msg_end .= "Question 27: $Q27 \n<br>"; $msg_end .= "Question 28: $Q28 \n<br>"; $msg_end .= "Question 29: $Q29 \n<br>"; $msg_end .= "Question 29 Other: $Q29Other \n<br>"; $msg_end .= "Question 30: $Q30 \n<br>"; } $email5 = "bookninja@gmail.com"; $realname5 = "Indentifying the Skills We Need Now"; $subject = "ACINL Survey 1"; $msg = $msg_start.$realname5.$msg_end; $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "*************"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "***************"; // SMTP username $mail->Password = "**************"; // SMTP password $mail->From = $youremail1; $mail->FromName = $yourname; $mail->AddAddress("$email5", "$realname5 "); $mail->AddReplyTo("$email1","$name"); //$mail->WordWrap = 50; // set word wrap //$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); $mail->IsHTML(true); // send as HTML $mail->Subject = $subject; $mail->Body = $msg; $mail->AltBody = $msg; $mail->Send(); $sent_to .= " &#149; $realname5 ($email5)<br>\n"; echo "\n<br>\n<br>Your responses have successfully been sent anonymously to ACI. Thank you for participating in this ACI research project."; } else { } ?>
  23. probably a problem in the code.. can you post that please form and code that sends (remove and passwords etc) also please use code tags (use the # button) example
  24. OK a simple test <?php $from = "tester@domain.com"; $to = "test@domain.com"; $subject = "Testing"; $body = "This is a <b>test</b> <img scr=\"http://domain.com/test.jpg\">"; $plainbody = strip_tags($body); $headers = "From: $from\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $boundary = uniqid(md5(time)); $headers .= "Content-Type: multipart/alternative" . "; boundary = $boundary\r\n\r\n"; $headers .= "This is a MIME encoded message.\r\n\r\n"; //plain text version of message $headers .= "--$boundary\r\n" . "Content-Type: text/plain; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode($plainbody)); //HTML version of message $headers .= "--$boundary\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode($body)); //send message mail($to, $subject, "", $headers); ?>
×
×
  • Create New...

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.