Jump to content

Brian W

Members
  • Posts

    867
  • Joined

  • Last visited

Posts posted by Brian W

  1. So i would use this? 

     

    <?php
    
    $email = "someone@example.com";
    
    if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
      echo "Valid email address.";
    }
    else {
      echo "Invalid email address.";
    }
    
    ?>

     

    Looks like it would work

  2. I you want to make sure the email address actually even looks like an email address, Try this tutorial, its came in very handy to me when writing regex. Check the Matching Patterns section for the email validation code.

     

    If you want to validate their email address, once they enter the address you'd create a random string

    (something like md5(rand()."salt string")) and save the string, and there email address in a table with 2 other fields, a unique id and a field determining whether or not the email has been validated. Use the random string in a url like www.domain.com/validate.php?key=flhdi7fgi3hkjnfp92u2hl9f3 and email that to them... they click on the link and when they get there the table is updated to say that that email address has been validated.

  3. if you use the code tags around your php or even html snippets, you will likely get more help

    [ code ]Like this but without the spaces in the tags[ /code ]

    would be

    Like this but without the spaces in the tags

     

    anyways, you can't call a php function w/in the array. As is, as far as php is concerned 'include("random.php")' is a string. You could use eval, but that is very insecure. So what I suggest is use a if statement inside the function put_image_here() that looks to see if the 'default_image' is == "RANDOM" and if so include random.php else use the image URL specified.

  4. I'm not sure where to find what you are looking for. It seems to me that first of all $form is at no point declared any sort of object. What I think you are looking for is essentially $_POST['user'], so i'm not sure where the object comes in.

    Secondly, you appear to be using a third party script. That means this topic is in the wrong place, but I could care less because I've already started helping you out. But, what that does mean is that it seems to me you cut something that was needed for the code you received. Do you have a link to where you got it from?

  5. Sorry, I'm not to huge on classes and objects (I'm that kind of a programmer that doesn't use if I don't need it, learn it when I do).

    Some how you need to get that function or a new function to lookup the user's info based on a parameter like their unique id. I'd just write a query inside your loop to pull their last_active info.

  6. <?php
    
    $dir="./Photos/LA/";
    
    $handle = opendir ($dir);
    echo '<div align="left">';
       while (false !== ($file = readdir($handle))) {
          $filepath = $dir.$file;
          if($file == "info.txt") {
             $array = file($filepath);
             echo '<strong><font color="#5A91AB" size="2" face="Arial, Helvetica, sans-serif">'.$array[0].'</font></strong><br>';
             echo '<font color="#FFFFFF" size="1" face="Arial, Helvetica, sans-serif">'.$array[1].'</font><p>';
          }
          if($file != "." && $file != ".." && $file != "TITLE.jpg" && $file != "TITLE.jpg" && $file != "info.txt") {
             $filepath = $dir.$file;
             #echo $filepath;
             echo ' <a href="Photobucket.php?dir='.$dir.'" target="_blank"><img src="'.$filepath.'" width="138" height="104" border="0"></a> ';
          }
           }
    ?>

    then in the page Photobucket.php, use $_GET['dir'] to find out what directory you'll need to get images from.

  7. Corbin, you have opened my eyes to something I had not known. Why does it allow me to tell it to accept longer numbers such as 16 digits? Numbers over 10 digits long must use float? 16 was just a number I pulled out that I knew should be large enough for the timestamp.

  8. use two fields in your table, join_date and last_filed (use date or int(16) with unix time stamp).

    When they join, set both fields to the date and time they are registering. Then use the several functions out there to determin the difference in days between the current date and those two fields. A few if statements later and you have code that will execute when they try logging in or something.

    Or, you'll need to write a chron job which I don't know anything about but that will allow you to have this done automatically without user/admin interaction.

    Either way, when you making those fields, I'd use the unix time stamp... its easier to handle imo.

     

    I didn't read corbin's post... hope I don't step on toes

     

  9. lonewolf, and then use ajax to built the checkbox or use simple js to change the style.display of the element? Either would work, but this isn't the board for JS.

    Kabucek, this seems to be a good time to use js, but if you want to go pure html and php, here is what you can do.

    They will need to select from the drop down then submit the form. interchange $_GET for $_POST if you are using form method = post

    <option  value='code1'>event 1,IL</option>
    
    <option  value='code2' <?php if($_GET['selectedProd'] == "code2"){ echo "selected"; } ?>>event 2, IL</option>
    </select>
    <?php
    if($_GET['selectedProd'] == 'code1'){
    echo "Box here <input type='checkbox' name='check' value='1'>";
    }
    ?>
    

    you'll probably need to make several adjustments, but essentially that is what you could do.

  10. In the future, please use code tags around your code.

    Currently it outputs an image that links to the image when it is clicked on, correct?

    You want it to take you to your gallery page and have the gallery page know which folder to grab images from, correct?

    It appears you are only grabbing images from one subdirectory using this code, the LA folder. So what is the point?

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