Page 9 of 14 FirstFirst ... 7891011 ... LastLast
Results 81 to 90 of 137

Thread: javascript? php? simple mailing list database?

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

    Default

    hmmm couldn't get it to work... have a look at the .txt file, i updated it for ya!

  2. #82
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    also the alert still pops up if the user doesn't enter anything or if there email is invalid... can we disable that too? this is going to be the ULTIMATE subscribe me form!!!! :P

  3. #83
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    strpos() will never return "". It will return false if the search string was not found. However, it can also return 0 if the search string is at the very beginning, so you should check its value with
    Code:
    ... === false
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #84
    Join Date
    Jul 2005
    Location
    UK
    Posts
    159
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    Whoa, I haven't been recieving email notification about replys to this thread, so I thought no one had replied. Now there are pages and pages of stuff!

    Can we back up for a minute, I obviously missed something or you all went in a different direction.

    I did what you said and changed the index extention to php, I am getting this error:

    Warning: Wrong parameter count for strpos() in /home/.ambassador/moscarda/moscarda.com/php/index.php on line 6
    Your email was added to the mailing list.
    Redirecting to the last page.

    Upon which point, it does redirect back to the last page. It never writes the text file either. Did you already solve this?

  5. #85
    Join Date
    Jul 2005
    Location
    UK
    Posts
    159
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    okay, i just saw the part about uploading the txt file myself, i did that, and it IS indeed writing correctly.

    now i need to figure out the parts about making sure that it doesn't give you the error. and, ideally, i'd like for it to NOT redirect you to a new page. it'd be cool if there was just a html label beneath the form that displayed the success or error alerts, and upon doing so, would clear the contents of the email field.

    and i also need to look over the code you all posted about verifying that an email address is valid, and making sure there are no duplicates. if you could write back in one post, explaining the steps one more time, i would appreciate it. i'm not sure if things were changed for tomyknoker's project. thank you!!

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

    Default

    Things were changed slightly to fix his page, but yours sounds fairly similar.

    There is no new page.... the alert IS displayed near (actually above, easy to move) the form. The email doesn't need to be left in the form... that was just so they'd have that there if they misspelled it. Easy to take out. (Or put an if so it doesn't display if it was correct).

    As for explaining all the steps... what do you mean, exactly?

    I believe it's pretty much flawless checking/adding/deleting emails, except for one thing, which I've been thinking about how to write.
    It removes an email if you leave the list; but if you take out an email from:
    email, email, email
    you'll have:
    email, , email
    giving you an extra annoying space.
    I'll figure that out... just weird, especially considering that it might fall on the ends, which would be different than the middle to fix.
    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

  7. #87
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i did some testing, if they put nothing in the field and submit, i think they need an error... also if they put a space and a letter they don't get an error... however it doesn't submit... so i guess thats ok, what do you think?

    also a few posts back you said
    Change the mail thing I posted above too
    , wasn't sure if i did it though... can you check my txt file to see... i got confused...

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

    Default

    According to what Twey said, I suppose we should change this:
    if (strpos($filecontents, $email) != "") {
    to

    if (strpos($filecontents, $email) != false) {

    Twey, I've had weird stuff go on every time I try === (not sure if I have tried !==).... can I just use != in this case?


    No, you didn't update the mail command. Check back to that post to see what to replace it with.


    I'm sorry guys; Graduation is tomorrow and life is really hectic.
    I'll help you figure it out, tomy, and you get started, moscarda.

    However, moscarda, feel free to look at his txt file
    http://www.curiousclothing.com/index.txt
    and copy the code out of there to replace what you have now.

    It functions a little differently, so be selective in what you choose.

    I'll help you both more when I get more time.
    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

  9. #89
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks again dj... your helps been unreal!

    Ok couldn't work out what to change so updated the txt file, can you let me know what is wrong?

    Good luck with the Graduation tomorrow!

  10. #90
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Twey, I've had weird stuff go on every time I try === (not sure if I have tried !==).... can I just use != in this case?
    No. You must use !==, because 0 will evaluate as "false" with type conversion allowed, causing your check to fail if the needle is at the beginning of the haystack.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •