Jump to content

Cruisecar

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Everything posted by Cruisecar

  1. All emails received by the system I'm working on are being passed into a database - the system can then display all emails (basically a web based email client). When people hit reply in their mail client it adds there reply above previous replys. I need some kind of regular expression that will work like in a GMail (by hiding previous replys). I've made a regex for "At xx:00 xx/xx/xxxx, ? wrote:" So currently using preg_split I have it separating emails where it says, for example (At 13:00 25/05/2008, Someuser wrote:). The problem with this is that every email system seems to have a different way of displaying previous replys. Any ideas?
  2. Firstly thanks for reading! I Have an Array($options) - [9] = [12], [18], [20] [12] = [3], [6] [18] = [19], [13] Basically I want something that can give me all of the possible combinations. within a loop - 1 = 12,3,19 2 = 12,3,13 e.t.c. while(something){ $x++; $insert = "insert into table(`id`,`option`,`value`) values('x','x','x'); $insert = "insert into table(`id`,`option`,`value`) values('x','x','x'); $insert = "insert into table(`id`,`option`,`value`) values('x','x','x'); } So the first combination would be entered as 3 rows into the database as so: $insert = "insert into table(`id`,`option`,`value`) values('100','9','12'); $insert = "insert into table(`id`,`option`,`value`) values('100','12','3'); $insert = "insert into table(`id`,`option`,`value`) values('100,'18','19'); Next lot: $insert = "insert into table(`id`,`option`,`value`) values('101','9','12'); $insert = "insert into table(`id`,`option`,`value`) values('101','12','3'); $insert = "insert into table(`id`,`option`,`value`) values('101','18','13'); Hope somebody can help me. It needs to be something that works no matter how many values there are within the array.
  3. $cwd = getcwd(); $tempfile = tempnam("$cwd/tmp", "temp_image_"); $temphandle = fopen($tempfile, "w"); fwrite($temphandle, $rotated); fclose($temphandle); list($width, $height) = getimagesize($tempfile); The $width and $height variables don't seem to contain any values, is there any easier way to get the image size?
  4. imagecopyresampled($rotated, $rotated, 0, 0, 0, 0, "269", "269", $width, $height); I basicly just need a replacement for this, that will crop the image to 269x269. It's commented out at the moment as this solution doesn't work.
  5. I've been making a roulette script that basicly spins the image in PHP (a roulette wheel), it's working fine except sometimes the image becomes bigger than I want it, the actuall roulette wheel remains the same size. It's obviously because the corners of the image are now extending over the borders, so PHP then compensates for this and fills in the rest of the background. (I hope i'm making sense so far). I want the image to either not be extended over 269x269 in the first place, or to be cropped after rotation. Can anybody help me do this? Here is a sample of the current rotation code. It all goes wrong on the imagecopyresampled() part. I hope someone can help me! Thankyou
  6. You're absolutely right, all the FAQ etc are in the game, that's something that needs changing. Thankyou :)
  7. I have been programming my own online game for the last few months, it has built up quite a strong fan base. But I would like reviews and comments on it. There's some nices features like a changeable theme on your profile page etc. Everything you see on the site has been made by me, including the forum. There are many other behind the scenes features that only admins, moderators, and Help Desk Opterators can read. Check it out: [url=http://www.moblife.co.uk]www.moblife.co.uk[/url] You will have to register, but the process is painless - you'll just receive an email with your password in.
  8. You are a genious! That is exactly what is was looking for. Thankyou.
  9. I have a huge MySQL Database, with many tables, and data within. Currently I backup the Database by running a dump from phpMyAdmin. I need to know the php code needed to do so automaticly (I will program it so it does so every 12 hours). I've made my own script that can backup individual tables, but need a way of backing up the whole database in one go. I cannot use any of the methods mentioned on this site [url=http://www.php-mysql-tutorial.com/perform-mysql-backup-php.php]http://www.php-mysql-tutorial.com/perform-mysql-backup-php.php[/url], due to security features on my host. Any help would be appreciated, Thankyou.
  10. [!--quoteo(post=371726:date=May 5 2006, 11:19 PM:name=Mattyspatty)--][div class=\'quotetop\']QUOTE(Mattyspatty @ May 5 2006, 11:19 PM) [snapback]371726[/snapback][/div][div class=\'quotemain\'][!--quotec--] happy to help :D if you can find the solved button, using it is much appreciated here! [/quote] Erm, where is it?
  11. Your a genious, I knew all of the stuff you said - I just didn't piece it together. Thankyou!
  12. Yes, Sorry for describing it so terribly - and especially the title!
  13. Okay, i'll attempt to re-explain, I guess I did it kind of crappy. I will have whole numbers, 0-100, and based upon those numbers I need a 1 or 0. So say the number was 40, there would be a 40/100 chance the script would return 1/true.
  14. No, I will input a number - 0-100% and I need the script to return true or false based on the percentage. Percentage = 50% - 1/2 chance of it returning true, Percentage = 90% - 9/10 chance of it returning true, I think that should sum it up :D Thanks for the reply.
  15. function random ($no) { //do some equation based on percentage, so eg. xx% chance of getting true, if($something = true){ return true; } else{ return false; } }
  16. Hey, Okay I will have a percentage (0-100%), I need to input that into a function and it to output true or false based on the percentage. Thanks
  17. I guess, i'll change the ranks to number, and make an array with the rank names in. Then link the two.
  18. Hey, I have a mysql set datatype, with many different possible values. I need to fetch the current value from the database, and move up to the next value on the set datatype. I read you could do this with numbers some how (eg adding 1)? In the database the set values are basicly a rank system using words. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] $query = "select * from users where username='$username'"; $result = mysql_query($query, $con); $stats = mysql_fetch_array($result); if($stats['next_lvl'] >= "100") { //Rank up to next level script goes here, } [/quote] Thankyou
  19. Thanks for your fast reply, worked a charm! I will definutely visit here more often.
  20. Hey, Firstly thank you for reading this, my problem is a very simple one, yet it seems to be very hard for me to achieve the needed result. Basicly, I have a string ($money) pulled from a database, it could be any value from 0 or more. I need to add commas into that string every 3 numbers - it must be added from the end to the begining. $money = "1000000" After going through the function it should be "1,000,000". I tried using explode, and attempted using a wildcard - but there is none, also it would make the number "100,000,0". I hope someone can help me! And once again, thankyou for reading.
×
×
  • 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.