Page 13 of 14 FirstFirst ... 311121314 LastLast
Results 121 to 130 of 137

Thread: javascript? php? simple mailing list database?

  1. #121
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    dj are you any good at MySQL? Have a question...

  2. #122
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I know a little bit, but just enough to get by myself, really... wouldn't claim to be particularly "good".

    As for adding that... the .txt seems to be missing, and I think I'd need to look at the whole thing.

    All you really need to do is find an if that gives an error, if the email is invalid, then add in "|| $email<4" where the || means or.
    Show me the .txt and I can find the right spot.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #123
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok .txt file is all updated

  4. #124
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ah, my error there. I was trying to make it not give errors if it was under 4 characters when it looked for the @ and such, but this will fix both:

    Change this:
    Code:
    if (strlen($email)>4) {
    $filename = "emails.txt";
    $at = strpos($email, "@");
    $dot = strpos($email, ".", $at+2);
    $atnum = substr_count($email, "@");
    To:
    Code:
    if (strlen($email)>0) {
    $filename = "emails.txt";
    if (strlen($email)>4) {
    $at = strpos($email, "@");
    $dot = strpos($email, ".", $at+2);
    $atnum = substr_count($email, "@");
        }

    Oh, also, add to this line:
    Code:
    if (strlen($email)<5 or $at == false or $dot == false or $dot == strlen($email) or $atnum > 1)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #125
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by djr33
    Ah, my error there. I was trying to make it not give errors if it was under 4 characters when it looked for the @ and such, but this will fix both:

    Change this:
    Code:
    if (strlen($email)>4) {
    $filename = "emails.txt";
    $at = strpos($email, "@");
    $dot = strpos($email, ".", $at+2);
    $atnum = substr_count($email, "@");
    To:
    Code:
    if (strlen($email)>0) {
    $filename = "emails.txt";
    if (strlen($email)>4) {
    $at = strpos($email, "@");
    $dot = strpos($email, ".", $at+2);
    $atnum = substr_count($email, "@");
        }

    Oh, also, add to this line:
    Code:
    if (strlen($email)<5 or $at == false or $dot == false or $dot == strlen($email) or $atnum > 1)
    Beautiful! Thanks dj excellent again! Now all I need is just to stop the alert from popping up, but whenever you get time, I know your busy! Thanks again!

  6. #126
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    actually could you check the .txt file? i only noticed the last line after i updated it... did i add it all in the write spot?

  7. #127
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    No.
    Code:
    	if (strlen($email)<5 or $at == false or $dot == false or $dot == strlen($email) or $atnum > 1)
    if ($at == false or $dot == false or $dot == strlen($email) or $atnum > 1)
    ADD the part in bold above to the EXISTING if statement.

    So... just replace those two lines above with:
    Code:
    if (strlen($email)<5 or $at == false or $dot == false or $dot == strlen($email) or $atnum > 1)
    Instead of adding the part in bold, you just added the whole thing again.... shouldn't hurt too much, but you would need an extra close bracket at the end, and it's really not doing you any good to check the same thing twice
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #128
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ha ok all done! (i think )

  9. #129
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ok... here's your body tag, right?
    Code:
    <BODY<?php if ($message == "") { ?> onLoad="alert('Curious? You should be. Sydney&rsquo;s rebel Ronins of streetwear are dropping their Kimono&rsquo;s and picking up gear sharper than any katana from the label that killed the cats you used to love.\r\rLike an army of modern day Mifune, the Samurai of the street blend into their surroundings, snuffing the less than worthy with killer prints and cuts this season.\r\rSleek, clean killers the Curious clothing range Ronin and Geisha are decked out in tees and singlets that reflect the nature of our fine city &ndash; crucifixes in a sombre, demure black print or laughing in the pews with glitzy, ironic silver or gold foil. The hurricane-fence print reminds you of which side of the tracks you hail from&hellip; Skulls bump heads with the clouds in a range that comes from the street, but stretches to the sky. Fashion victims? Maybe&hellip;.\r\rstockists?? + 61 415 397 606');"<?php }?> >
    Replace that with:
    Code:
    <BODY<?php if ($noalert != 1) { ?> onLoad="alert('Curious? You should be. Sydney&rsquo;s rebel Ronins of streetwear are dropping their Kimono&rsquo;s and picking up gear sharper than any katana from the label that killed the cats you used to love.\r\rLike an army of modern day Mifune, the Samurai of the street blend into their surroundings, snuffing the less than worthy with killer prints and cuts this season.\r\rSleek, clean killers the Curious clothing range Ronin and Geisha are decked out in tees and singlets that reflect the nature of our fine city &ndash; crucifixes in a sombre, demure black print or laughing in the pews with glitzy, ironic silver or gold foil. The hurricane-fence print reminds you of which side of the tracks you hail from&hellip; Skulls bump heads with the clouds in a range that comes from the street, but stretches to the sky. Fashion victims? Maybe&hellip;.\r\rstockists?? + 61 415 397 606');"<?php }?> >


    And, add this right below the end of the upper php tag:
    Code:
    if ($message != "") $noalert=1;

    Finally, right below this:
    Code:
    if (strlen($email)>0) {
    Add:
    Code:
    $noalert=1;

    That should fix the alert problem.


    Note that all you need to do is put "$noalert=1;" wherever (like in an if statement) if you don't want the alert to pop up. What I did should work, though.

    Try it out...
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. #130
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hey dj awsome! where does this go sorry?
    if ($message != "") $noalert=1;

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •