Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. first thing that stands out to me is this: $match = $_SESSION['secure']; // the code on the image i don't see a session_start(); at the beginning of your script, so $match is not being set to anything.
  2. http://us3.php.net/manual/en/function.mktime.php
  3. personally i'd just start a cron job to run every minute or so, depending on how often you want it to run.
  4. [code] $starttime = ;// unix timestamp format $enddtime = ;// unix timestamp format $currenttime = time(); if (($currenttime > $starttime) && ($currenttime < $endtime)) {   header("location: temppage.php"); exit; } // normal page code here. [/code]
  5. i don't think that will prove if sessions are enabled or not.  i don't think a session actually starts until you go to a new page. For example, you can remove the session_start() (or comment it out) and your ternary will still return true. at the very least you would have to break that up into 2 scripts.
  6. you sure that's the correct name?
  7. need to throw in some { } around your variable there, to keep php from being confused. [code] <?php mail($toAddress,$recipientSubject,$mailContent,"From:{$row['email']}"); ?> [/code]
  8. assuming that the music is yours (or at least, not copyrighted), sure, you can do that.
  9. the cannot modify headers problem is because you have html output before your header function at the bottom of the script. I see this: <title>sendmail.php</title> at the top of your script.  that's html output.  get rid of it. you can't have any html output before a header function call.  not even a space before your <? tag.  as far as making text bold in your email, you would do it just like normal html.  however the user's email program may or may not be set to allow html code, so it might not show up for them, just FYI.
  10. i'm 28.  married for 7 years. 3 boys and another on the way, due in feb next year.  not sure if it's a boy or girl though.  last ultrasound they couldn't tell. I'm hoping it's a girl. i spend most of my time working at hardees or spending time with my family.  computer related stuff is just kinda on the side as a hobby.  I enjoy piddling around in flash and with php mostly.  There really isn't a whole lot to me.  I try to live my life as simply as possible.  I believe in God and just try to live life simply, not trying to really make a name for myself or gain anything in particular.  p.s.- i'm not really a midget i was joking.
  11. maybe if sony continues this trend of foolishness square enix will take away their FF priveleges
  12. ..well what were you gonna do with your ps2? throw it away? why cant you just keep using your ps2 for your ps2 games?
  13. all the variables inside your function are local. you need to make them global or else return $connection.
  14. [code] <?php function sanitize($value){   if (get_magic_quotes_gpc()) { stripslashes($value); }   if (!is_numeric($value)) { mysql_real_escape_string($value); }      return $value; } $blah = sanitize($blah); ?> [/code]
  15. .josh

    Is it bad

    also depends on what you are doing with $name. for instance, if you are using it inside a query you need to sanitize it first, lest you be vulnerable to sql injection.
  16. how about sorting the array or even usorting it and then looping it, dividing it by simply checking for a new value (like autobot vs. decepticon)
  17. okay fine how about i one up you then! if the only posted variables you have are those 3, then all you have to do is this: $dob = implode('/',$_POST); oh snap! ;D
  18. ^ that's a whole lot of extra work for simply making a string of values seperated by a / ...sure, it might be all fancy looking, but again, this does the same thing: [code] <?php $doba = MakeSafe($_POST[dobd]); $dobm = MakeSafe($_POST[dobm]); $doby = Makesafe($_POST[doby]); $Dob = "$doba/$dobm/$doby"; ?> [/code]
  19. ^ no doubt, lol..
  20. $Dob = "$doba/$dobm/$doby";
  21. it IS in one array. a multi-dimensional array. Just like you specified. there are 2 things happening in that loop: a) you are declaring a new [i]position[/i] in your main array like $plot[0], $plot[1], $plot[2], $plot[3], etc... b) you are inserting an array of information (x and y coords) in each position of that array. the while loop is in essence does this: // remember arrays start at 0 not 1 $plot[0] = array('x' => 1, 'y' => 1); $plot[1] = array('x' => 2, 'y' => 2); $plot[2] = array('x' => 3, 'y' => 3); $plot[3] = array('x' => 4, 'y' => 4); . . . $plot is your one array. for each of the $plot's elements you have another array with two elements, one for your x and one for your y. This makes it a multi-dimensional array. So let's say you want to echo the 3rd one (above it is the x = 3, y = 3), you would do so like this: echo $plot[2]['x']; // echo's the 3 in the 'x' element of position #3 in $plot echo $plot[2]['y']; // echo's the 3 in the 'y' element of position #3 in $plot or if you want to loop through all of them, you would use the examples already displayed above.
  22. sanitizing variables means you check them for potentially malicious code. see my previous post where i have the clean_var function for an example
  23. yeah i pretty much already decided to go for the wii and stuff like this just makes me feel better about my decision.
  24. [code] foreach($_POST as $key => $val) {   echo $$key = $val; } [/code] though extract does pretty much the same thing.  here is what i usually do, more or less: [code] <?php // prevent sql injection function clean_var($value){   if (get_magic_quotes_gpc()) { stripslashes($value); }   if (!is_numeric($value)) { mysql_real_escape_string($value); }      return $value; } // end clean_var // clean the variables of potential malicious code // and create variables named by their key names foreach($_POST as $key => $val) {   $val = clean_var($val);          $$key = $val; } // end foreach $_POST ?> [/code]
  25. yeah you're right barand. i had a fubar moment. i actually do it that way, lol.  I think i just c/ped his example and worked from there or something. [quote author=ak7861 link=topic=112397.msg456177#msg456177 date=1161594419] I dont think you understand what im looking for. I want to select all the results from a certain table and put it into the array. [/quote] that's exactly what we've done. in my example $coords and in barand's example $data - that's the array.
×
×
  • 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.