Jump to content

gwolgamott

Members
  • Posts

    486
  • Joined

  • Last visited

    Never

About gwolgamott

  • Birthday 01/01/2010

Profile Information

  • Gender
    Male
  • Location
    Ludington

gwolgamott's Achievements

Member

Member (2/5)

0

Reputation

  1. You could try to set it in the code. http://php.net/manual/en/function.set-time-limit.php
  2. That depends on when you want to run that. Or use include or require to make it run sometime within the loop when a flag is hit rather then calling it with ajax. it's all highly dependent on when and where. Programmatic method this is possible... of course if you want b to run first you could just you know call it first.
  3. Sorry so long for a reply been sick and sleeping for a number of days... not quite literal but close enough that I never even touch a computer for 4 days. You've already the array with the $loggedInfo //So just loop through that array foreach($loggedInfo as $key => $value) { if($value != "") { echo"$value"; }else{ echo"<a href='edit_profile.php'>edit this!</a>"; } }
  4. Where ever it is you are storing the data and retrieving it from, say you retrieve it all in an array then take that array and foreach through it, if one of the elements is empty fill it with with a string like: '<a href="myedit.html">Edit This</a>' then print all the variables as normal later.
  5. http://www.phpfreaks.com/forums/index.php/board,43.0.html Probably get more responses in that forum.
  6. What do you mean will it add '' between them? That just straight up splits the string up into an array with a length of one for each array element. What alex has shown will take this >>> $str = 'abc' to and do this >>> $arr = array('a', 'b', 'c')
  7. http://woork.blogspot.com/2007/10/load-page-using-url-variables-and-php.html Or if your ambitious enough to create your own here's a good reference for how, read the comments below the page as well, they have different methods for different reasons. At any rate leaves only a separate menu file that you have to update. And if really ambitious create a self-building menu based off of something in a database, folder listing, or something of that nature. Those are awesome to never edit a menu file again... well for content anyways.
  8. It's small and clean. I see nothing wrong with that method. If you want to do a function then it's just dumping your code there into a function and returning an array to the main area you are using this would clean up the main code area if you liked.
  9. Yes it is incomplete in that sense. I took that he wanted an option to sort in descending for either wins or for loses as in a link, button whatever. But I see, however it is not at all hard to do if for both to display on separate rows. This is simplified here //$Teams is your array with the team number arrays for win / loss foreach($Teams as $key => $value) { $array_win[$key] = $value['Win']; $array_loss[$key]=$value['Loss']; } arsort($array_win); arsort($array_loss); //now print the arrays however you want you have both sorted highest to lowest here Here's an example of how to do this with explanation and real output for the sample data below. //Lets say the array $Teams is something like this /* Array ( [293] => Array ( [Win] => 6 [Loss] => 0 ) [298] => Array ( [Win] => 6 [Loss] => 3 ) [297] => Array ( [Win] => 3 [Loss] => 3 ) [302] => Array ( [Win] => 2 [Loss] => 3 ) [304] => Array ( [Win] => 5 [Loss] => 3 ) [295] => Array ( [Win] => 6 [Loss] => 3 ) [299] => Array ( [Win] => 2 [Loss] => 3 ) [292] => Array ( [Win] => 1 [Loss] => 3 ) [301] => Array ( [Win] => 3 [Loss] => 3 ) [294] => Array ( [Win] => 4 [Loss] => 3 ) [306] => Array ( [Win] => 2 [Loss] => 3 ) [305] => Array ( [Win] => 1 [Loss] => 3 ) [300] => Array ( [Win] => 1 [Loss] => 3 ) [291] => Array ( [Win] => 3 [Loss] => 3 ) [303] => Array ( [Win] => 0 [Loss] => 3 ) [296] => Array ( [Win] => 0 [Loss] => 3 ) ) */ foreach($Teams as $key => $value) { $array_win[$key] = $value['Win']; $array_loss[$key]=$value['Loss']; } // Will now have this respectively for win & loss array /* $array_win is: Array ( [293] => 6 [298] => 6 [297] => 3 [302] => 2 [304] => 5 [295] => 6 [299] => 2 [292] => 1 [301] => 3 [294] => 4 [306] => 2 [305] => 1 [300] => 1 [291] => 3 [303] => 0 [296] => 0 ) $array_loss is: Array ( [293] => 0 [298] => 3 [297] => 3 [302] => 3 [304] => 3 [295] => 3 [299] => 3 [292] => 3 [301] => 3 [294] => 3 [306] => 3 [305] => 3 [300] => 3 [291] => 3 [303] => 3 [296] => 3 ) */ arsort($array_win); //use asort($array_win); for lowest to highest instead arsort($array_loss); //use asort($array_loss); for lowest to highest //will sort each array from highest to lowest.... //Will now be /* $array_win is now: Array ( [293] => 6 [295] => 6 [298] => 6 [304] => 5 [294] => 4 [291] => 3 [297] => 3 [301] => 3 [306] => 2 [299] => 2 [302] => 2 [300] => 1 [292] => 1 [305] => 1 [296] => 0 [303] => 0 ) $array_loss is now: Array ( [305] => 3 [306] => 3 [294] => 3 [300] => 3 [291] => 3 [296] => 3 [303] => 3 [301] => 3 [292] => 3 [297] => 3 [298] => 3 [302] => 3 [304] => 3 [299] => 3 [295] => 3 [293] => 0 ) */ //Now print the arrays however you want. You have two arrays sorted from highest to lowest from the original array. Hope this helps. sorry if mislead you earlier.
  10. I think so, not that off top of my head do I know how that would work though.
  11. You could put them in arrays according to their territorial area. Then you could foreach loop through the array when building the drop down to display. $southwest = array("CA", "NV", "UT", "CO", "AZ", "NM"); echo '<select name="southwest"> '; foreach ($southwest as $value) { echo '<option value="'.$value.'">'.$value.'</option>'; } echo '</select> ';
  12. Try a if(pregmatch()) - elseif(!pregmatch()) statement just to see if that works. There must be some logic that I do not see either that must have an issue. The return messing it up is odd. Maybe something with that variable?
  13. Try to simplify it some with a straight mail() function then work away from it slowly with tests. I don't have time today, otherwise I'd take a stab at it, but I'd first take a few steps back do a hardcoded mail() and work back from that and integrate it a piece at the time in your function. $to = "sheilaschook@yahoo.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "someonelse@example.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers);
  14. I wish it was, I don't know honestly if it is. It'd make what I'm working on easier if it was.
×
×
  • 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.