Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by phppup

  1. Thanks requinix. I'm slapping leading zeros all over the place!!!
  2. I've got a date input from a dropdown menu and want to add a leading zero to the first 09 numbers. if(document.getElementById("month").value < 10) { ("0" + document.getElementById("month").value) = month; } Is apparently an incorrect application. I have seen ("0" + (yourDate.getMonth() + 1)).slice(-2) but cannot seem to get that working either. Please help.
  3. From an open browser window, I am using code to open 2 new tabs window.open("http://www.yahoo.com"); window.open("http://www.google.com"); They open sequentially, leaving browser tab that has GOOGLE open, active, and visible. Can I use JavaScript to indicate that I want the ORIGINAL tab to STILL be the ACTIVE window of focus?
  4. Thanks Barand. I was considering separating YYYY and mm/dd into separate fields. I will try your method. Obviously, I'll be doing more reading on MySQL and handling dates. Ginerjim: I'm glad I was able to enlighten you by being the first to offer a new explanation for not choosing PDO as my favorite option. My needs do not require me to integrate with other db formats, and the 'shorthand' it utilizes is less easily understood than other choices. It is not an excuse, it is my opinion; just as you have your own opinion, which appears NOT to be so humble, although you stated "IMHO". Perhaps "a re-read with comprehension" will change my mind in the future, but not this week.
  5. Thank you Brand to the rescue. Glad to see I was on the right track again. Now let's see how far I can take it.
  6. Did WE read the very first post. Maybe are-read with comprehension would help. To clarify: The SQL query would deliver it's result(s) in a format that not only provides a list of people, but ALSO ads functioning checkboxes for use as it's own form.
  7. PDO is my least favorite method. It is too abbreviated for me, and I get lost in its application. Also, the link does not address the initial question: what is the best way to achieve a resulting form with usable checkboxes next to each valid response to the query?
  8. Yes, you are correct on birthdate. It was a silly typing error. The DB is pretty well established. My thought process now is how best to implement having a query response that creates a form with usable checkboxes.
  9. I'm looking for some direction as I approach a new challenge. I have a table named friends_and_family and it contains name, email, and age fields. I'm planning a party and want to invite 10 of the people that are between 20 and 35 years old. The format I am considering would query the table and provide a list of those members that fit the age requirement. I would like to generate that result (which I should be capable of handling) so that each person listed has a checkbox next to their name. I imagine I will be creating a resultant form, so that I can then evaluate the result and select the checkboxes for those specific people that I want to invite. Upon submission, an email will be sent to the people with selected checkboxes. How should I approach this best? A for each loop? Implode an array? I'm not very good with AJAX, so I'm thinking along these lines.
  10. I thought it would get easier, but I was wrong. LOL Took maxxd advice and added to the top of my script, <?php $status = ""; $mail->SMTPDebug = 2; $subject = "Sending Email Using PHP Mailer"; but I didn't see any change in the Error Message which simply states: Mailer Error: SMTP connect() failed In other news, I did get a 'supposedly correct' relay-server for outgoing SMTP mail and confirmed that emails sent from my domain name are going out through that server. I was also told that NO AUTHENTICATION is required. So now the question is whether to eliminate Username and Password OR use empty quotes (as they suggested). Still struggling here. PS to requinix: YES, while testing the outbound server to confirm that my mail was sending, I tested to my cell and it did display the sender's info.
  11. If I get it working again I'll let you know. I found this sample code that is SUPPOSED to work, but something is causing it to provide: Mailer Error: SMTP connect() failed. <?php $status = ""; $subject = "Sending Email Using PHP Mailer"; $body ='<p>Congratulations!</p>'; $body .='<p>You have successfully received an email from.</p>'; // Enter Your Email Address Here To Receive Email $email_to = "my_yahoo_email@yahoo.com"; $email_from = "myTESTemail@my_domain.com"; // Enter Sender Email $sender_name = "Mister Mail"; // Enter Sender Name require("PHPMailer/PHPMailerAutoload.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "mail.my_domain.com"; // Enter Your Host/Server $mail->SMTPAuth = true; $mail->Username = "myTESTemail@my_domain.com"; // Enter Sender Email $mail->Password = "theTESTpassword"; //If SMTP requires TLS encryption then remove comment from it //$mail->SMTPSecure = "tls"; $mail->Port = 25; //tried 25 and 587 $mail->IsHTML(true); $mail->From = $email_from; $mail->FromName = $sender_name; $mail->Sender = $email_from; // indicates ReturnPath header $mail->AddReplyTo($email_from, "No Reply"); // indicates ReplyTo headers $mail->Subject = $subject; $mail->Body = $body; $mail->AddAddress($email_to); // If you know receiver name using following //$mail->AddAddress($email_to, "Recepient Name"); // To send CC remove comment from below //$mail->AddCC('username@email.com', "Recepient Name"); // To send attachment remove comment from below //$mail->AddAttachment('files/readme.txt'); /* Please note file must be available on your host to be attached with this email. */ if (!$mail->Send()){ $status = "Mailer Error: " . $mail->ErrorInfo; }else{ $status = "<div style='color:#FF0000; font-size:20px; font-weight:bold;'> An email has been sent to your email address.</div>"; } ?> <html> <head> <title>Send Email in PHP Using PHPMailer - AllPHPTricks.com</title> </head> <body> <?php echo $status; ?> <br /><br /> </body> </html> Not exactly sure if it's a C-Panel email issue, or the code, or just my lack of expertise. Any suggestions for finding a solution.
  12. I'll give it a try later on. Do emails sent this way display the Yahoo information, or are the headers modified. Thanks for the help.
  13. So you're talking about setting up SMTP through Yahoo/Gmail etc.? Am I on the right path?
  14. How would I be able to use one of those mailers?
  15. Sorry, but I did immediately make the change that you suggested. I just didn't convert it properly when cutting and pasting from the previous post. In fact, I agree with your appraisal and had experienced getting caught by those filters before. At this point I have used both my Yahoo addresses and my me@mydomainname.com and gotten similar results. The regular email (when not intercepted by spam filter) arrived in my inbox, but not a single text message has arrived on my phone via MetroPCS (except for an initial test sent directly from my Yahoo account, but not through PHP mail).
  16. Sent identical messages: one to email, another to cellphone. Only received the email. So I guess this proves (barring any code to provide support) that the email function is sending outbound messages. mail( '1231231234@mymetropcs.com', "How are you", "Your packaged has arrived!", "From: Me <MyOtherEmail@yahoo.com>\r\n"); mail( 'myemail@yahoo.com', "How are you", "Your packaged has arrived!", "From: Me <MyOtherEmail@yahoo.com>\r\n"); Are there any new issues with MetroPCS since they merged with T-Mobile in the USA? (MetroPCS personnel are essentially worthless in this matter.)
  17. I have an old script for sending a text message to cellphone via PHP mail. The script has not changed in a year, and it did work approximately 9 months ago. Now, after dusting off the script and trying it, no message is received on the cellphone. When sent directly from my email account to 1231231234@mymetropcs.com, a text message arrives nearly immediately. But when sent through my email server script, even as a simplified test script <?php mail( '1231231234@mymetropcs.com', "How are you", "Your packaged has arrived!", "From: Me <MyEmail@yahoo.com>\r\n"); //OR even mail( '1231231234@mymetropcs.com', "", "Your packaged has arrived!", "From: Me <MyEmail@yahoo.com>\r\n"); ?> there is still nothing received on cellphone. How can I resolve this? Are there anti-spam filters generally in place and how can I overcome them? Is there a way to validate that the message I am sending is actually leaving the server? Or are there settings [there were none before and normal email messages are sent without any problems] that need to be adjusted to send a text message? Thanks for the help.
  18. I have a simple ALERT that will NOT display a phrase that contains a space between words. I've tried OnClick and OnMouseOve, but the result is the same. onmouseover=alert('HelloBoysandGirls'); //works fine as a pop-up onmouseover=alert('Hello evrybody'); //refuses to operate Solution? Reason?
  19. I am trying to implement a CONFIRMATION dialogue box before the processing of a form. The dialogue box uses some variables from a previous script, so it seems that calling the confirmation box needs to be done through a function. And it seems that using a function to address the "action" is a tiny bit more complicated than just slapping a confirmation into the element. My issue at this point is an inability to direct to the processing.php page function confirm() { if(confirm("Are you sure you want to do this with $blah1 $blah2 $blah3 )== true) { window.location.href = "https://www.example.com"; //would actually be "processing.php" } else { return false; } } The browser shows an indication of 'thought' but will not advance to the next page (or an error page) - it simply refreshes. Oddly, when I modified the end of the script to say this, it seemed to work } else { return false; alert("bye"); } } (but I don't understand why). Answers? Solutions? Remedies? Explanations? Please enlighten me.
  20. That makes an incredible amount of sense. Will something like if($value=null) or value==zero work for me?
  21. I am using this code to evaluate whether checkboxes within a group have been selected: function IsChecked($chkname,$value) { if(!empty($_POST[$chkname])) { foreach($_POST[$chkname] as $chkval) { if($chkval == $value) { return true; } } } return false; } Now, I've decided that I want to add a message upon finding NO SELECTED checkbox items, but it is not functioning as desired. if(empty($_POST[$chkname])) { echo("You didn't select any checkboxes."); } How can I get this or something similar to trigger?
  22. Works GREAT!!!! Thanks again. [yes, did internet search last night and got a better understanding] Enjoy the holiday cheer.
  23. Not having much luck with double quotes inside the double quotes. It seems as though the script is interpreting the second double quotes as the end of the statement rather than a continuation. Am I missing some sort of syntax rule? Is there a requirement of double-single-double (or similar) in order to work along those lines?
  24. Thanks for the additional info. I will give it a try. I hadn't realized that the '(?)' was for the prepared statement. I thought it was for me to add parameters of my own. The shortcuts in PDF tend to confuse me. Thanks again.
  • 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.