Jump to content

Schlo_50

Members
  • Posts

    468
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Schlo_50's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Just looked at the page source and there aren't any html tags for the image. <img src="image.jpg" />
  2. I don't think it can find the folder which is bringing up your warning. With opendir() you need paths, not URLs I think?
  3. These kind of URL's are indeed the most SEO friendly.
  4. I'd disagree with the statement made about '?' is a stop. I'm sure I've read that that it's a thing of the past to do this. Search engines have surely adapted their rules to carry on past '?' what with the boom of blogs and other dynamic sources of information. Google "25 fancy cartoons" and the first URL to be found is: http://www.dafont.com/theme.php?cat=101&page=2 There's hundreds of pages in Google's rankings that are dynamic.
  5. Sounds like you'd have major security issues doing it that way.
  6. Hmm.. I've tried the following but the the car with the largest 'styling' attribute doesn't display. It only shows when it wins overall as well as on the 'styling' attribute. <?php function getWinner($chosen, $attr = null) { $index = $topStats = 0; foreach ($chosen as $key => $data) { if ($attr != null && $data[$attr] > $topStats) { $topStats = $data[$attr]; $index = $key; continue; } if (array_sum($data) > $topStats) { $index = $key; $topStats = array_sum($data); } } return $chosen[$index]; } echo '<pre>'; // randomSet contains my final array of cars to compare $winner = getWinner($randomSet); $winner_on_attribute = getWinner($randomSet, 'styling'); print "<h1>Overall Winner</h1>"; print_r($winner); print "<h1>Styling attribute Winner</h1>"; print_r($winner_on_attribute); echo '</pre>'; ?>
  7. That would be why I'm struggling. Thanks for the other suggestion.
  8. Hello, If I have the following array, how would I use php's max() function to find the largest number of say the traction attribute? Array ( [0] => Array ( [manufacturer] => Nissan [model] => 350Z [modexp] => 30000 [traction] => 500 [aerodynamics] => 3000 [acceleration] => 1500 [styling] => 6000 ) [1] => Array ( [manufacturer] => Toyota [model] => Celica [modexp] => 15000 [traction] => 500 [aerodynamics] => 3000 [acceleration] => 1500 [styling] => 6000 ) [2] => Array ( [manufacturer] => Nissan [model] => Skyline [modexp] => 50000 [traction] => 500 [aerodynamics] => 3000 [acceleration] => 1500 [styling] => 6000 ) ) I've read the information http://php.net/manual/en/function.max.php here but can't figure out how to apply it to my situation? Thanks in advance!
  9. All makes sense now! Thanks for both you guys help.
  10. I believe to solve this you'd have to change the php config file's memory allowance (php.ini). Although some hosts do not allow you to modify the php.ini file.
  11. Have your made sure that the headers in your script are setup to send html formatted email and not plain text? This tutorial should help you no end, especially the section "Sending HTML Email": http://www.webcheatsheet.com/php/send_email_text_html_attachment.php
  12. Well, my function will output 2 random cars from the initial 3 like this: Array ( [0] => Array ( [manufacturer] => Toyota [model] => Aygo [modexp] => 950 [traction] => 500 [aerodynamics] => 3000 [acceleration] => 1500 [styling] => 6000 ) [1] => Array ( [manufacturer] => Nissan [model] => 350Z [modexp] => 30000 [traction] => 500 [aerodynamics] => 3000 [acceleration] => 1500 [styling] => 6000 ) ) I want to add my players car to the array above to end up with this: Array ( [0] => Array ( [manufacturer] => Toyota [model] => Aygo [modexp] => 950 [traction] => 500 [aerodynamics] => 3000 [acceleration] => 1500 [styling] => 6000 ) [1] => Array ( [manufacturer] => Nissan [model] => 350Z [modexp] => 30000 [traction] => 500 [aerodynamics] => 3000 [acceleration] => 1500 [styling] => 6000 ) [2] => Array ( [manufacturer] => Toyota [model] => Celica [modexp] => 1200000 [traction] => 5000000 [aerodynamics] => 3000000 [acceleration] => 15000000 [styling] => 6000000 ) )
  13. Visit this site: www.apachefriends.org/en/xampp.html Set yourself up with a testing server capable of running php locally. The instructions on that website will show you how to do this AND where to place your php files as well as how to access them in your browser.
  14. If it's another function you're after, you could even try preg_replace().
×
×
  • 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.