Jump to content

ManicMax

Members
  • Posts

    38
  • Joined

  • Last visited

    Never

Everything posted by ManicMax

  1. O well how can I name the output ?
  2. thanks for the quick replys. The reason to send $name in my function is so if the $var is $_POST you can name the output $email instead of $_POST everytime.
  3. Hello I have written this function and want to use it within mysql_query's but am unsure whether this will work. I don't fully understand the rules when concerning single quotes within single quotes. function clean($var,$name){ if(!get_magic_quotes_gpc()) { $$name=mysql_real_escape_string($var); }else { $$name=$var; } mysql_query(SELECT * FROM users WHERE email='clean('$_POST[email]','email')' AND pass='clean('$_POST[pass]','pass')')
  4. All these people are signing up specifically to recieve these emails. Could someone explain more about this server I could route my emails through. I will most likely be using GoDaddy as my clients host.
  5. So if I add the optout it will mean I should not get blacklisted?
  6. What this is for is to send updates to members of a site. I'm guessing it will be lets say an email every few days to around 25 -75 users at first, but these arbitrary amounts could greatly increase.
  7. Hello I'm looking for some advice and maybe a point in the right direction. I understand how to use the PHP mail() function, but I would like some advice on how to use this to send to large volumes of people from a hundered to maybe a few thousands. I'm guessing I should use a loop function and if I did this I might be able to have a counter on the page like 1 out of 100 sent and increment as it sends. I also am guessing that the page the script is run off would have to also stay open until it was completed. All help is welcome.
  8. Your a start chigley you really are!! Thats two problems solved by you today ok make it three how do I change the subject title and image of this post to be solved?
  9. it is only letting me update one field at a time. Date field is varchar. the query will only work if i update one field at a time
  10. yes, im also running it directly in phpmyadmin and it says 0 rows affected ran in 0.022 seconds
  11. Here is the mysql query and it is running I have an or die on the end and it doesnt die. is something in my syntax wrong??? UPDATE calendar SET am700='1' AND am730='1' WHERE date='14/04/08'
  12. ok well i have the array times this contains the field names of the fields in my databse. $times[0]='am700'; $times[1]='am730'; $times[2]='am800'; $times[3]='am830'; $times[4]='am900'; $times[5]='am930'; A mysql query is run selects one row and all of the fields. I then want to echo certain ones depending on the script. What I need to do is put which every varaible from the times array is picked into the $row[HERE ]. So at the moment it comes out looking like echo $row[$times[1]]; Along those lines
  13. Here is how the time structure is made up: $times[0]='am700'; $times[1]='am730'; $times[2]='am800'; $times[3]='am830'; $times[4]='am900'; $times[5]='am930'; What I'm trying to do is query a database then echo a result from a particular field. The $times array is the field names and $row is the mysql_fetch_array() variable. I want to combine then like i tried. I need to put the $times variable into the [] of the $row array
  14. I want to define what exact variable to echo but my attempts so far have failed. My code is below but it just will not echo. echo "$row[" . $times[0] . "]";
  15. I'm trying to store the data and time informations is inserted into the database. I don't know what the best method is and also I need to be able to search the data by month and then output the day it was submitted also maybe output the date it was submitted in a dd-mm-yy format. Any Help Appriciated!
  16. could someone explain the syntax for a SQL Query ???
  17. What is the difference between $var = "content"; $var = 'content'; I read somewhere that double quotes should be used if you are defining another variable within something and single quotes if not. The correct use also helps increase efficiency, but of course only on a very small scale. Something has puzzeled me though as for some of my script some of the querys have ended up like this $sql = "SELECT * FROM table WHERE field='$field'"; How come everything is in double quotes but the variable is in single ? and still functions. Any and all help is appreciated.
  18. no it needs to be stored in a database as the user could login the next day or a month from now
  19. I need to store in a database the time in one hour. Then i need to pull the stored time out compare it to the current time and display how long left. If there still is time left until the future time then it should do something and if it has already passed the stored time it should do something else and update the stored time to an hour from now. This has put a brick wall infront of me and a few work friends as we cannot display the time left or be certain that our whole script works as its is a mess of other peoples and has been scraped. Please help or send ideas to me
  20. lol wow that question was my tenth thanks lol
  21. I cant send private messages on this forum am i missing something ?
  22. Is it using sessions or cookies for a user login system? Any help appriciated
  23. Currently I cant get a function to work within an if statement what syntax does it need to work. At the moment I have to put the function into a variable then compare it in the if statement. Any help appriciated
  24. I know how to use these functions but am wondering what the danger (security wise) and uses and real implementations of them would be?? Any help appriciated
  25. I have a script that sends emails to my users and when received the From header reads [email protected] how ca i get it to read Example Admin <[email protected]> ?? The bit of script im focussing on is this and the whole script is below. fputs($socket, "MAIL FROM: <" . $board_config['board_email'] . ">\r\n"); <?php /*************************************************************************** * smtp.php * ------------------- * begin : Wed May 09 2001 * copyright : (C) 2001 The phpBB Group * email : [email protected] * * $Id: smtp.php,v 1.16.2.11 2005/09/27 20:24:35 grahamje Exp $ * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('SMTP_INCLUDED', 1); // // This function has been modified as provided // by SirSir to allow multiline responses when // using SMTP Extensions // function server_parse($socket, $response, $line = __LINE__) { $server_response = ''; while (substr($server_response, 3, 1) != ' ') { if (!($server_response = fgets($socket, 256))) { message_die(GENERAL_ERROR, "Couldn't get mail server response codes", "", $line, __FILE__); } } if (!(substr($server_response, 0, 3) == $response)) { message_die(GENERAL_ERROR, "Ran into problems sending Mail. Response: $server_response", "", $line, __FILE__); } } // Replacement or substitute for PHP's mail command function smtpmail($mail_to, $subject, $message, $headers = '') { global $board_config; // Fix any bare linefeeds in the message to make it RFC821 Compliant. $message = preg_replace("#(?<!\r)\n#si", "\r\n", $message); if ($headers != '') { if (is_array($headers)) { if (sizeof($headers) > 1) { $headers = join("\n", $headers); } else { $headers = $headers[0]; } } $headers = chop($headers); // Make sure there are no bare linefeeds in the headers $headers = preg_replace('#(?<!\r)\n#si', "\r\n", $headers); // Ok this is rather confusing all things considered, // but we have to grab bcc and cc headers and treat them differently // Something we really didn't take into consideration originally $header_array = explode("\r\n", $headers); @reset($header_array); $headers = ''; while(list(, $header) = each($header_array)) { if (preg_match('#^cc:#si', $header)) { $cc = preg_replace('#^cc:(.*)#si', '\1', $header); } else if (preg_match('#^bcc:#si', $header)) { $bcc = preg_replace('#^bcc:(.*)#si', '\1', $header); $header = ''; } $headers .= ($header != '') ? $header . "\r\n" : ''; } $headers = chop($headers); $cc = explode(', ', $cc); $bcc = explode(', ', $bcc); } if (trim($subject) == '') { message_die(GENERAL_ERROR, "No email Subject specified", "", __LINE__, __FILE__); } if (trim($message) == '') { message_die(GENERAL_ERROR, "Email message was blank", "", __LINE__, __FILE__); } // Ok we have error checked as much as we can to this point let's get on // it already. if( !$socket = @fsockopen($board_config['smtp_host'], 25, $errno, $errstr, 20) ) { message_die(GENERAL_ERROR, "Could not connect to smtp host : $errno : $errstr", "", __LINE__, __FILE__); } // Wait for reply server_parse($socket, "220", __LINE__); // Do we want to use AUTH?, send RFC2554 EHLO, else send RFC821 HELO // This improved as provided by SirSir to accomodate if( !empty($board_config['smtp_username']) && !empty($board_config['smtp_password']) ) { fputs($socket, "EHLO " . $board_config['smtp_host'] . "\r\n"); server_parse($socket, "250", __LINE__); fputs($socket, "AUTH LOGIN\r\n"); server_parse($socket, "334", __LINE__); fputs($socket, base64_encode($board_config['smtp_username']) . "\r\n"); server_parse($socket, "334", __LINE__); fputs($socket, base64_encode($board_config['smtp_password']) . "\r\n"); server_parse($socket, "235", __LINE__); } else { fputs($socket, "HELO " . $board_config['smtp_host'] . "\r\n"); server_parse($socket, "250", __LINE__); } // From this point onward most server response codes should be 250 // Specify who the mail is from.... fputs($socket, "MAIL FROM: <" . $board_config['board_email'] . ">\r\n"); server_parse($socket, "250", __LINE__); // Specify each user to send to and build to header. $to_header = ''; // Add an additional bit of error checking to the To field. $mail_to = (trim($mail_to) == '') ? 'Undisclosed-recipients:;' : trim($mail_to); if (preg_match('#[^ ]+\@[^ ]+#', $mail_to)) { fputs($socket, "RCPT TO: <$mail_to>\r\n"); server_parse($socket, "250", __LINE__); } // Ok now do the CC and BCC fields... @reset($bcc); while(list(, $bcc_address) = each($bcc)) { // Add an additional bit of error checking to bcc header... $bcc_address = trim($bcc_address); if (preg_match('#[^ ]+\@[^ ]+#', $bcc_address)) { fputs($socket, "RCPT TO: <$bcc_address>\r\n"); server_parse($socket, "250", __LINE__); } } @reset($cc); while(list(, $cc_address) = each($cc)) { // Add an additional bit of error checking to cc header $cc_address = trim($cc_address); if (preg_match('#[^ ]+\@[^ ]+#', $cc_address)) { fputs($socket, "RCPT TO: <$cc_address>\r\n"); server_parse($socket, "250", __LINE__); } } // Ok now we tell the server we are ready to start sending data fputs($socket, "DATA\r\n"); // This is the last response code we look for until the end of the message. server_parse($socket, "354", __LINE__); // Send the Subject Line... fputs($socket, "Subject: $subject\r\n"); // Now the To Header. fputs($socket, "To: $mail_to\r\n"); // Now any custom headers.... fputs($socket, "$headers\r\n\r\n"); // Ok now we are ready for the message... fputs($socket, "$message\r\n"); // Ok the all the ingredients are mixed in let's cook this puppy... fputs($socket, ".\r\n"); server_parse($socket, "250", __LINE__); // Now tell the server we are done and close the socket... fputs($socket, "QUIT\r\n"); fclose($socket); return TRUE; } ?>
×
×
  • 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.