Jump to content

TOA

Members
  • Posts

    623
  • Joined

  • Last visited

Posts posted by TOA

  1. // here's your normal mail call to manager

    mail($manager_email, $manager_message);

     

    // here's your conditional call

    if (isset($_POST['checkbox_name'])) {

      mail($assistance_email, $assistance_message);

    }

     

    You just need to see if the checkbox is checked and if it is send another email. That's what I meant. Sorry, I'm  having a hard time being clear today :)

  2. Hi,

     

    Would i need to do separate php codes for each image in the folder? 

     

    That or wrap it in a function so it's re-usable. But as far as I can tell that's not what your original question was. Maybe I'm reading it wrong :shrug:

  3. PHP runs server side so the validation happens when the data is sent to the server. You could do this in your current script, or you could have the form post to a separate script (ie: process.php) which then calls the mailer when validation is complete (This would be the option I suggest). If you want to keep in in one file, look at this thread on how to structure it properly. The topic is different, but the info is still relevant for your questions about structuring a php file.

     

    To validate, there are built in functions such as empty(), isset(), etc that will make it easier for you. Just loop through all the fields you need required making sure they're set or not empty depending on your situation. For example, text fields are sent to the server no matter what, so empty would work for this. Radio buttons only get sent if something is checked, so you can use isset for this, see what I mean? 

     

    Hope that helps

  4. I had thought about doing it with cookies but was worried about anyone who has them disabled being looped to death :D

     

    Some of our clients are in the manufacturing and education industries which are slow to adopt and generally strict with their policies. I checked what stats we have available inhouse and online and from what I can tell by comparing numbers, most of our users are getting logged by google analytics which would infer javascript enabled which would infer (to me at least) cookies enabled, so I think yours may be the more efficient route. I'm going to try some things out and see if I can make your snippet work for me.

     

    Thank you very much for the help.

  5. Ummm, well, that's not quite what I was going for; it would only replace the index on the first visit to the site (each time). Obviously I missed the mark :)

     

    So if they came to the site the first time, they'd get the  splash page. Once they've been in the site, index would still be the home page. At least that was my plan. Maybe that's not a good plan... :shrug:

     

    Does that make any more sense?

     

    The thing that was puzzling me was that with the above code, some people would get caught on the splash page but others wouldn't; so it was kinda working, but from what I gather it was my logic..

     

    Thanks for the help btw.

  6. You might want to point out to them that splash pages kill SEO.

     

    Thanks, I do appreciate that because it does make my job impossible when his actions cause us to fall in ranking or things like that.

     

    I've already lost this argument to the owner though. He wants what he wants. In fact this is the second usability argument I've lost to his narcicism; nobody can tell him anything. So unfortunately I'm stuck. Unless you have some sneaky way of undermining him :pirate:  I need to make this work.

     

    Now that I think about it, his other company's website has a splash page too. Guess he just has a thing for them. :facewall:

     

    I'm going to go at this again today, got pulled away, so if anyone has any ideas on where I was going wrong with that .htaccess file, I'd still love to hear it.

     

    Thanks.

  7. Well, turns out that even the original code I posted causes a loop for some people. It seems like it's on IE9 only but I don't get completely consistent results because of the index.php thing (I think).

     

    I'm just going to start over I think.

     

    Does anyone have any ideas why that code was incorrect? It looked right to me.. :-\

  8. I guess that didn't work, forget I said that!

     

    For some people, they get stuck on the splash page with that last rule in place. Not sure why it would work for some users but not others, but that's what is seeming to happen.

     

    So I guess I'm back to needing help :)

  9. I'm trying to set up my htaccess to support a splash page (I know, I know; I have no choice in the matter). What I'm trying to accomplish (in english) is this:

     

    "If the request is for the home page, either in the form of www.domain.com or www.domain.com/index.php, rewrite it to the welcome url"

     

    Here's what I have so far, which works, but only targets www.domain.com. I can't get it to also target www.domain.com/index.php

    Options +FollowSymLinks
    RewriteEngine On 
    
    #
    # Make sure we use the full url
    #
    
    RewriteCond %{HTTP_HOST} !^www.domain.com$
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301]
    
    #
    # If target is index
    #
    
    RewriteCond %{HTTP_HOST} ^www.domain.com$
    
    #
    # And referrer is not our own
    #
    
    RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)*domain\.com 
    
    #
    # re-write to splash page
    #
    
    RewriteRule ^$ http://www.domain.com/misc.php?page=welcome [L,R=301]
    

    I've tried a few things with no luck, the most recent being

    RewriteCond %{REQUEST_URI} ^index\.php$
    

    Any help is greatly appreciated.

     

    Thanks for reading everyone.

  10. [rant]

    Beggars can't be choosers. If you ask for help, you have to accept the criticisms also.

     

    Sorry to jump in on something that is not my business, but I truly get tired of reading posts like this. Nothing personal hunna03, you sound like you can put a thought together. I just get tired of reading how the help people received wasn't what they wanted to hear. Tough.

     

    And no I haven't run out of cigarette's.

     

    I'll butt out now.

    [/rant]

  11.  

    So each artist produces many albums, but each album comes from only one artist. 

     

     

    What about collabo's? Wouldn't you want it searchable by both artists?

     

    Normalization is also about knowing when to de-normalize.

     

    I definitely agree that you need to re-visit your structure.

  12. From the manual:

     

    array_shift() shifts the first value of the array off and returns it

    *emphasis added

     

    You only need the first result so it just grabs the first one and returns it to the function called. But since it LIMITS to 1, it seems kinda pointless to me, but I just glanced at the code so there might be something I'm missing.

×
×
  • 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.