Jump to content

kellz

Members
  • Posts

    128
  • Joined

  • Last visited

    Never

Everything posted by kellz

  1. that half works.. but some code is missing.. here is a sample output: __FILE__); $com=''; foreach ($lines as $line) { if(rand(0,1) ) { $com .= str_replace("(", "( \n", $line) ; }else{ $com .= str_replace(") ", ") \n", $line) ; } } echo $com; ?>
  2. Well I just made the following function and it *looked* like it would work while writing it but now i have some strange error: Fatal error: Can't use function return value in write context in C:\Program Files\EasyPHP 2.0b1\www\dummy.php on line 6 function DoSplit($line) { $pos; $pr1; $pr2; $add; $m; $O = array(4); $O(0)=chr(44); $O(1)=chr(61); $O(2)=chr(46); $O(3)=chr(38); for ($i = 0; $i < strlen($line); $i++) { $m = substr($line, $i, 1); if ($m = $O(0) || $m = $O(1) || $m = $O(2) || $m = $O(3)) { $pr1 = substr($line, 1, $i); $pr2 = substr($line, $i+1, strlen($line)); if (rand(1,2)==2) { $line = $pr1 . " " . chr(95) . "<br />" . $pr2; } } } return $line; } edit: nevermind...my stupid mistake^^ i'm so used to VB.net and i used the arrays like i would in vb.net..
  3. hey all it's your favorite php freak^^ that no one remembers. well anyway for some reason i had some weird idea (for fun) to do something with the php code in a file. I am trying to randomly split the code (add new lines) after each "(" and ")" character. so as an example below for ($array as $items) { could become for ( $array as $items) { or for ($array as $items ) { or for ( $array as $items ) { ..and so on. but this is the sad part.. I have got as far as splitting 1 line and not even that works! $lines = file(__FILE__); $com='';$m=0; foreach ($lines as $line) { for ($i = 0; $i < strlen($line); $i++) { if ($line[$i] == "(") { $m=strpos($line, "("); $com = substr($line, 0, $m); $com = "$com <br /> " . substr($line, $m, strlen($line)); } } } i'm totally lost! how do i go about doing this? lol i always put myself in stupid situations.
  4. kellz

    my poor cat

    40 years old? lol thats older than my mother!! I'm in germany now, i looooove it here! i guess i might get another cat if my mother allows it.. anyhoo i cant post here much for the next weeks, im enjoying my holiday CHRISTMAS SOOOON!!!!!! so happy xmas people and thx for the replies!
  5. some moron run over my cat, it was such a cute cat! it was all black and only 3 months old, found it laying dead on the road, it was so horrible picking her up :'( she had a brother, he was black aswell and they both had these big cute blue eye's and always played and slept together, now he has no sister and looks for her and meow's allot .. he's always sitting by the cat flap waiting for her, its so sad! I know sometimes drivers don't have time to break (and most don't even bother) but they could atleast stop and take the cat off the road after killing it, maybe its still alive.. when i found her she was still really warm so it must have been just minutes before i found her :'(
  6. I want to make 1 not use someone elses, I just dont know how and there is no instructions or advise or anything about it... And yes at teng84
  7. I give up, and nobody knows how to do it (unless of course it's some kind of big secret)
  8. I saw lots of websites have the search thing that only searches their own website for keywords and I tried to make one, but, not to my surprise it didn't go as planned for long^^ How do the "real" search thingies work? like on this site ??? i want 1!
  9. $check = (mysql_fetch_array(mysql_query( "SELECT `email`, `loginName` FROM `users` WHERE loginName='$username' AND email='$email'")) ); if ($NewUser == $check[1] || $NewEmail == $check[0]) { echo 'that username and/or email address is already in use.'; exit; } oowwps i posted this seconds after you made it solved^^
  10. I started this in the "Christmas Season" topic.. anyhoo What is your most weird obsession like a strange collection of something or anything weird about you.. here are some weird thing's about me, get ready! 1: Collect bottle tops 2: Used to make myself sick to get thin (i know it was stupid! ) 3: Make beeping noises when something reverses 4: play with the TV color buttons so I could watch green people :-\ (I've grown out of that one) That's all.. share your freakish secrets!
  11. eww candy sticks, bad for your teeth and just ugh to much sugar i hate sugar i love my teeth.. eww! That's all I used to get from my family when 1 of them went on holidays YEY CANDY STICKS LETS GET ROTTEN! they are all sticky and way to sweet... I don't know how anyone could like them!? but there are some strange people in this world! I don't know how anyone can like me, but they do it :-\ just proves my point Well, I'm 1 of those strange people, I'm obsessed with bottle tops, I have a huge collection, 100's of them lol btw, do you have any spare bottle tops? Sorry to hijack your topic *leaves silently*
  12. and I could only think of 1 that didn't even work :'(
  13. thx, it works.. but why didn't this work.. shuffle($qa['q']); $question = $qa['q'][0]; $answer= array_keys($qa["q"], $question); echo $question; echo $answer; array_keys is supposed to know where where the question is in the array
  14. I was trying to make a script that would display a question and under it would be the answer: <?php $qa = array( "q" => array('sean is', 'kelsey is', 'I love'), "a" => array('kelseys bf', 'seans gf', 'sean') ); $answer=shuffle($qa['q']); echo $qa['q'][0]; echo $qa['a'][$answer]; ?> Well $answer was supposed to store the array index it had chosen like 0 would be "sean is" so the answer would be "kelseys bf".. the answer is always under the question. But $answer always returns 1
  15. omg I didn't know that! that's useful! thx
  16. hey all I don't know why this prints "ab": $a="abc"; $b=substr($a, 0, -1); echo $b; I found it on a php quiz somewhere (and got the answer wrong) how can it start at 0 and end at -1 ??? thats like.. freakish!
  17. I hate IE, it takes forever to load and even longer to exit it.. So I just use firefox, even my school uses firefox.
  18. It's annoying when some people try to spell thing's out instead of saying them as they were ment to be said. SQL is short for "Structured Query Language" like you don't already know^^ If making a word out of these 3 letters is so important to you than just say "my ess cue-ell" it sounds right lol or "Structured Query Language" that would be right, right? And so far from the videos I watched it's only Americans that do this I think I just started world war 3!^^ The British say "data" differently, British pronounce it like both A's are uppercase and Americans pronounce it like both A's are lowercase. The correct way to say it is dAtA making it sound like both A's are uppercase British: 1 USA: 0 And this wasn't an attack on Americans! you're free to attack me back^^
  19. I guess it's this: foreach($_POST as $name => $val) the $_POST should be $_POST['whatever'] but not the "whatever"
  20. But doesn't the page reload? I only just thought of that so writing it in php wouldn't be any good either^^ like every time the price is calculated the page will reload... ??? if you have say... ten calcualtion to process would you want your page to reload ten times? cheers... errr probably not^^ I just got the wrong idea.. cheers...
  21. But doesn't the page reload? I only just thought of that so writing it in php wouldn't be any good either^^ like every time the price is calculated the page will reload... ???
  22. Maybe he forgot to pass the variables to the mail function.. And no one can check the source code by looking at your website because it's server side code so you'll have to post your code here^^
  23. I would just write it all in PHP.. there is no need for javascript really (in most cases)
  24. really i just say My SQL where "my" is 1 word and SQL are 3 letters.. what's so complicated
×
×
  • 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.