Jump to content

stylusrose

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by stylusrose

  1. insert a re-direct code on your php page. otherwise everytime the user refreshes, it will refresh your php validation.
  2. well... you could turn it into a function <a class="<?php pageName($index)?>" or change pageName() to link_home() or something like that...
  3. first of I do believe you're on the wrong board, second off: http://www.yourhtmlsource.com/javascript/formvalidation.html answer
  4. basically you can put php functions into the string, and then using the string like you would the "include" statement
  5. I'm not to hot with mysql, but you could do this: $data_array; //Put e-mail contents into this array $erase_array = array(); for ($index = 0; index < $data_array.length(); index++) { $erase_array[ $data_array[index] ] = 1; } $end_array = array_keys( $erase_array ); //put end array back into database This essentially turns all the emails into a data key for the array each with a value of one. And then you use array_keys to turn the data keys into an array. And then you should have no repeats of any emails.
  6. Aha, there we are. Thanks a bunch!
  7. is there anyway to execute a string as code in php? other than saving $string to an outside file and then including that file and running it. just like: <?php $string = "echo( "potatoes" );" run $string; ?>
  8. well.. he could put an if statement in for leap year, and instead of the 365, put 366...
  9. oh, well that was easy o.o; thanks! ^.^
  10. oh my, lack of sleep is not good >_> you totally got me. for my code, you'd have to add in another line that gets the day using "%D"; and then an else if ((birthmonth == currentmonth) && (birthday < currentday)) >_> i think by now, I'd just use "zenag's" code, tho I really wish he added comments.
  11. hehe... I was actually wondering if there was a way to do it without mysql 0___0
  12. I'm sure the above works fine, but I couldn't understand half of it. >_> anyway, this is the way I would have done it. <?php $birthTime = mktime(0,0,0,11,27,1987); $birthYear = strftime("%Y", $birthTime); //get's the birth year $birthMonth = strftime("%m", $birthTime); //get's birth month $currentYear = strftime( "%Y", time() ); //get's the current year $currentMonth = strftime( "%m", time() ); //get's current month $age = $currentYear - $birthYear; //your age if ($birthMonth > $currentMonth) $age--; //if your birth month hasn't past, you aren't a year older! echo "You are ". $age . "year's old!"; ?>
  13. I was trying to write a script that outputs to a file. the problem is, I don't want more than one user to be able to run that script at time. I know, mysql would probably be a better idea. But I'm just tinkering around with ideas. So, is there anyway to prevent a user to access a script whilst it is in use?
×
×
  • 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.