Jump to content

AbydosGater

Members
  • Posts

    435
  • Joined

  • Last visited

    Never

Everything posted by AbydosGater

  1. Hey guys, Sorry for the silly question.. Been awhile.. If i have one string .. how do i go about searching it to see if it contains another string? Thanks, Andy
  2. Yes. I used all of these methods to come up with a good mix. And yes Daniel is right. You shouldnt use globals like that. Just return both manned and unmanned as an array and split them . But thank you very much. Andy
  3. Great. Thank you soooo much. Works like a charm.. all methods Thank you very much Andy
  4. Sneamia: Interesting Idea .. I have it all working. Thank you
  5. Hi, Ive been doing some work on a basic game.. and it is all working out well. Except for this bit. Every player gets a planet.. and on these planets the can have farmers and farms. So lets say $farms is the number of farms and $farmers is the number of farmers. If you want to use X as farms and Y as farmers thats ok . Each farm can man 1 and only 1 farmer.. so every farm gets one farmer.. How would i go about working out how many farms have a farmer and how many farms dont have farmers? Wow i just realized how confusing that all sounds. Just for example .. lets say there are 10 farms.. and 8 farmers.. straight off we know that there will be 8 manned farms and 2 unmanned farms. But how could i go about doing this inside a script with different numbers for each user? Thank you Andy
  6. Wow.. Three years in PHP and im still learning every day. Thank you. This is very interesting.. Will come in helpful Andy
  7. Hey Wildteen, Thanks for the quick reply. I am going to use this method One question though.. I have seen code .. Like yours.. Using "?" and other in brackets. Would you be able to explain the line: <?php $mins_left = ($cur_min == 59) ? 0 : 60 - $cur_min; ?> To me please.. Why are you using comparrison operators ( the ==) on 59 and the ? puts me off. I have seen code like this around.. But never understood it. Andy
  8. Hi guys, I need to work out how many minutes there is until the next hour.. Server time that is. I have a cron that updates user information.. And i would like to display a message to say how in many minutes the update will be. I have looked around but cant seam to find any methods of doing this. Do any of you know how? I would be very greatfull. Thank you Andy Dam guys haha.. As soon as i post i think of a way. Im going to use date() to figure out how many minutes have passed since last hour.. like 31 minutes.. and then take that away from 60 to give me whats left. Sorry for wasting your time. If you know of any other methods though please tell me. Andy
  9. Hey guys, I have an extensive site running on my local. Images are all over the place. I know its possible to use a PEAR Module to get all the links from a html page.. But i was wondering if it was possible to save all <img src"VALUES"> all the links (Values) to an array so that i can then write a script to copy the file to the images folder? Andy
  10. Yeah that should do exactly what you want then Andy
  11. pocobueno1388: No matter who gets there first.. different methods of coding techniques..are always helpful. phpSensei.. No Prob! Glad to be of some help. Andy
  12. Im going to take it that you want it to be random ... If you dont say .. Also you would have the chance of the same one coming up more then once but it can be maded to stop that.. $randomImages = array("dog", "cat"); $rand = array_rand($randomImages); echo "<img src='/images/$rand.gif'></img>"; Will randomly select dog or cat and display it.. If you dont want it random just make other code to change the $rand variable that declares what image to be displayed.. Andy
  13. Simon: You should really use the PM system for those kind of messages. Im going to mark this topic as solved guys cause i found some good stuff. But if anyone has any further input or advice it is greatly appriciated! Andy
  14. Yeah someone else said that to me. I have it on my laptop.. Which i dont have anything else on. I want to run my tuts from the computer cause it has my IDE's and files.. and dev server setup. I have windows movie maker.. But no encoder. I thought this was very odd when i first noticed it. Is there anyway i could get it? If not its ok i seam to have found this "Super Screen Recorder" For free and its doing a great job. Andy
  15. Yeah im on Windows. didnt know Windows Movie Maker could record screen and voice? Not only for piecing it all together? Andy
  16. Hey Guys, I have googled and sourceforged this one. With little look at finding a good one. I was wondering if anyone knew of an free OKish screen recorder that could include Mic voice aswell. I have decided to take a crack at some PHP Video tutorials to help people. I know they really helped me but most sites seam to have stopped. Anyone know any good programs? Doesnt have to be the best thing in the world. But free if possible. Thanks Andy
  17. I would like to suggest www.apthost.com, Been with them for years. NEVER Had any downtime. Always great support.. all the features you could want. At an affordable price. Andy
  18. Changes. Days off.. up to 15 Hours on computer. maybe 6 Sleeping. Weekdays with school.. 5 Hours on comp.. 6 hours sleeping. Andy
  19. Dont know if this is a coding error or something that someone did but... http://obb.awardspace.com/index.php?page=viewtopic&forum=2&topic=4 Mysql_fetch_array errors. Andy Btw: Nice work i really like it. Alot more work to be done but keep it up!
  20. Hey i know this topic is dead, But you never know.. Might be helpful... If your still looking for an answer.. You could use something like this, It will gather all the links for you. Then you just have to go through each link and see what it ends with.. If it ends with what you want save it to an array. Andy <?php function storeLink($url,$gathered_from) { $query = "INSERT INTO links (url, gathered_from) VALUES ('$url', '$gathered_from')"; mysql_query($query) or die('Error, insert query failed'); } $target_url = "http://www.somesite.com/"; $userAgent = 'Your Web Crawlers Name'; // make the cURL request to $target_url $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); curl_setopt($ch, CURLOPT_URL,$target_url); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $html= curl_exec($ch); if (!$html) { echo "cURL error number:" .curl_errno($ch); echo "cURL error:" . curl_error($ch); exit; } // parse the html into a DOMDocument $dom = new DOMDocument(); @$dom->loadHTML($html); // grab all the on the page $xpath = new DOMXPath($dom); $hrefs = $xpath->evaluate(”/html/body//a”); for ($i = 0; $i < $hrefs->length; $i++) { $href = $hrefs->item($i); $url = $href->getAttribute(’href’); storeLink($url,$target_url); echo “Link stored: $url”; } ?>
  21. Hey Guys, Thanks for the replys. Hmm. I do like the idea. Although those codes are for the wrong image.. I adapted it for the order button but even when using a span and the following code: <tr> <th width="52%" scope="col"><span class="style14"><img src="images/2600.png" alt="Dedicated Server" width="97" height="31"></span></th> <th width="48%" scope="col"><span desc="Dedicated Server" class="order"> </span></th> </tr> With the above css for .order{} class.. The order button on the page still appears above the blue background. Has anybody else got any other ideas? This is really important and any help is greatly appriciated! Andy
  22. Hey Guys,Having a bit of a problem with an image. Im using the following HTML to display a blue <table width="100%" border="0"> <tr> <th width="52%" scope="col"><span class="style14"><img src="images/2200.png" alt="Dedicated Server" width="97" height="31"></span></th> <th width="48%" scope="col"><a href="somelink" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/order_bo.gif',1)"><img src="images/order_b.gif" name="Image37" width="50" height="19" border="0"></a><a href="somelink" target="_top" onClick="MM_nbGroup('down','group1','order_b','images/order_bo.gif',1)" onMouseOver="MM_nbGroup('over','order_b','images/order_bo.gif','images/order_bo.gif',1)" onMouseOut="MM_nbGroup('out')"></a></th> </tr> </table> And The links use javascript to change on move in and move out.. I dont know the javascript but it can all be found on http://apthost.com/dedicated.php. Dont worrie about the class of style14.. it doesnt exist yet. Now if you open IE and look at the page.. it all looks perfect. But if you open In FireFox everything for the "Order" buttons is above the blue background it was ment to be in. Does anyone know why firefox is messing this up? It looks good in IE? Andy
  23. Yay thanks guy. ill test that out when i get this dam server to boot.
  24. Aw man you are a life saver! Works perfectly! Thank you so much! Andy
×
×
  • 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.