Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. Did you read the topic about session errors? Post some code.
  2. check out substr, str_replace, etc string functions.
  3. You're trying to have a page on someone else's domain redirect to your site? OMG HAX!
  4. Did you try searching for info about cron?
  5. Found a function in the comments that does exactly what I want. http://us3.php.net/manual/en/function.eval.php#71045 Nevermind ;)
  6. Perhaps the people who are prohibiting you from posting it would have the solution ;)
  7. post on the javascript forum if you need help with javascript
  8. Basically, the goal is to loop through some numbers and run mathematical functions on them. I am trying to use eval to run the math, perhaps that isn't the right function... Here's what I've got: [code]$start = 1; $end = 4; $nums= range($start,$end); $ops = array('+', '-', '*', '/'); $combos = array(); foreach($nums AS $s1){ foreach($nums AS $s2){ foreach($nums AS $s3){ foreach($nums AS $s4){ $combos[] = array($s1, $s2, $s3, $s4); } } } } print '<p>There are '.count($combos).' combos for 4 digits containing '.$start.'-'.$end.'</p>'; foreach($combos AS $c){ print '<b>'.$c[0].' '.$c[1].' '.$c[2].' '.$c[3].'</b><br />'; foreach($ops AS $o1){ foreach($ops AS $o2){ if($o2 != $o1){ foreach($ops AS $o3){ if($o3 != $o1 && $o3 != $o2){ $str = $c[0].' '.$o1.' '.$c[1].' '.$o2.' '.$c[2].' '.$o3.' '.$c[3]; print $str.' = '.eval($str.';').'<br />'; } } } } } }[/code] So here is some sample output from it: [quote]1 1 1 1 1 + 1 - 1 * 1 = 1 + 1 - 1 / 1 = 1 + 1 * 1 - 1 = 1 + 1 * 1 / 1 = 1 + 1 / 1 - 1 = 1 + 1 / 1 * 1 = 1 - 1 + 1 * 1 = 1 - 1 + 1 / 1 = 1 - 1 * 1 + 1 = 1 - 1 * 1 / 1 = 1 - 1 / 1 + 1 = 1 - 1 / 1 * 1 = 1 * 1 + 1 - 1 = 1 * 1 + 1 / 1 = 1 * 1 - 1 + 1 = 1 * 1 - 1 / 1 = 1 * 1 / 1 + 1 = 1 * 1 / 1 - 1 = 1 / 1 + 1 - 1 = 1 / 1 + 1 * 1 = 1 / 1 - 1 + 1 = 1 / 1 - 1 * 1 = 1 / 1 * 1 + 1 = 1 / 1 * 1 - 1 = [/quote] So basically for the first one, I send the string '1 + 1 - 1 * 1' to eval and I expect to get the number 1 back. Instead of nothing after the = it should be printing the result of the math. Any ideas?
  9. For php code to run, the file extension must be .php
  10. First of all, You just use one & Secondly, you can have as many sets in a url as you want. .php?one=1&two=2&three=3&bob=fred
  11. instead of echoing the whole form, just end your PHP and start the html\ [code] if($x){   ?><p>Hi</p><? }else{   ?><p>Bye!</p><? }[/code]
  12. Gah. Stupid code. Do this: [code][img]image[/img]<br />[b]Text 1[/b] Text2[/code] or this: [code][img]image[/img] [b]Text 1[/b] Text2[/code]
  13. you'd have to do [img]http://image[/img]<br />[b]Text 1[/b] Text2 not [img]http://image[/img]<br /> [b]Text 1[/b] Text2 There's a NL in there, plus an existing BR. So, you get two BRs. That IS what you've asked for.
  14. Regular Expression is the official term. Google it and you'll find tons of resources.
  15. NOW() is the command for mysql current time on a DATE or DATETIME. Or you could use time() in php if the fieldtype is an INT
  16. run str_replace() on the $domain to take out the www, and only store the address without it.
  17. You said you're stuck at 677 - but your auto-increment is at 2501. Why is that? What is the highest 'id'?
  18. That's a very odd number to stop at. Can you post the structure of the table? What is the datatype of the PK
  19. http://www.google.com/search?q=paypal+api+php&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a
  20. If you want it to look nice, add [code]<pre>[/code] in front ;)
  21. print_r($arran); Is that what you mean?
  22. How are you trying to save it? Right click and...
  23. Go to your php.ini or use ini_set() - I think ini_set will work.
  24. lol I read the question too fast - good one Thorpe :)
×
×
  • 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.