Jump to content

sKunKbad

Members
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by sKunKbad

  1. SELECT * FROM table1 ORDER BY somedate DESC LIMIT $x
  2. try foreach: $value=array(23,56,23,46,3,0,56,34); foreach ($value as $x){ if($x == '0'){ $lineplot->mark->SetType(MARK_FILLEDCIRCLE); $lineplot->mark->SetFillColor("black"); $lineplot->mark->SetWidth(2); }elseif($x < '0'){ $lineplot->mark->SetType(MARK_FILLEDCIRCLE); $lineplot->mark->SetFillColor("red"); $lineplot->mark->SetWidth(2); } } um, i don't know if that is what you are after
  3. use cURL to post your email to a server that can process the email. If you need a good processing program, try formmail at tectite.com.
  4. just wrap your code in php bbcode tags
  5. Member "sasa" come up with this a while back. It randomizes the choices, and doesn't pick the same choice twice unless the array of choices has been depleted. sasa_array.inc <?php $a_text_files = array( 'file_a.txt', 'file_b.txt' , 'file_c.txt', 'file_d.txt', 'file_e.txt' ); ?> sasa_rand.php <?php session_start(); include('sasa_array.inc'); if (!array_key_exists('rand_text_files', $_SESSION)) $_SESSION['rand_text_files'] = $a_text_files; if (count($_SESSION['rand_text_files']) == 0) $_SESSION['rand_text_files'] = $a_text_files; shuffle($_SESSION['rand_text_files']); $rand_text = $_SESSION['rand_text_files'][0]; unset($_SESSION['rand_text_files'][0]); $handle = file($rand_text); foreach ($handle as $line_num => $line) { echo $line; } ?> You could either use this, or modify it to suit your needs.
  6. I just hand code my validation. I always use a javascript client side validation, with php validation as backup in case the user has javascript disabled. It's twice the work, but it gets the job done.
  7. I've seen and used md5 crackers that were actually pretty good (for most people's lame passwords), but all it was doing was looking through an existing database of passwords. The only good reason I could find to crack passwords was to be able to send it back to a user in case they forgot their password. There are of course alternatives.
  8. Why don't you just make a new, more simple, db connect class or include. Do you really need all of that to connect?
  9. It looks like whatever php is in the head is doing it. Remove the php and it will probably stop.
  10. I'd say that if you didn't have a contractual agreement with THE COMPANY that said that they would retain your copyright info in the template, then you are out of luck. I'm not a lawyer though, and honestly I don't know if it is really worth dealing with in court. My lawyer (for other personal matters) costs $200 per hour USD, and thats actually pretty cheap as far as lawyers go. If you go to court, and this takes a long time (and many court cases do), you might find your total attorney's fees upwards of $50,000. Mine even charges me for phone calls! If you are dealing with unethical individuals, they will most likely lie and twist the truth to the point that all you will be doing is wasting your time and energy. Can you prove that you sold THE COMPANY the exact files that you sold them, and that the files were in some way documented to contain code that was produced soley by you and you alone? It's just a big mess. Since the other guy worked with you, and did produce some of the code, it all comes down to the contract you had with THE COMPANY.
  11. Your really missing the point of CSS. When using CSS, you don't use tables except when displaying data in a spreadsheet type way. If you want to position your images, you need to one of the following: 1) use absolute positioning of divs 2) use relative positioning of divs Absolute positioning is easier, but text that is enlarged by the user can really break the layout of the page. Search around the web for "CSS float tutorial" and you will find what you need to get going with relative positioning.
  12. You can't. Instead of defining variables the way you have them, you will need to use regular variables.
  13. I understand what you are saying, but I've just never had an issue with leaving out the cdata markers. I tried to see if I could use the cdata markers to make a pre type output, but it didn't work.
  14. Is there any real value to declaring CDATA sections like this: <script type="text/javascript"> //<![CDATA[ document.cookie = "js-enabled=yes"; //]]> </script> and here: <style type="text/css" media="screen"> /*<![CDATA[*/ * { margin:0px; padding:0px; font-family:Verdana, Arial, Helvetica, sans-serif; } /*]]>*/ </style> I've never heard of a browser having a problem with a document that didn't have the character data wrapped in CDATA section markers, and it doesn't do anything for validation, so what's the deal?
  15. The SimpleXML extension provides a very simple and easily usable toolset to convert XML to an object that can be processed with normal property selectors and array iterators. See Example 8 on http://www.php.net/manual/en/ref.simplexml.php
  16. if what you want to do is replace the value of $arFriends, which is a string, with an array which has only one key->value, then this is what you want to do. You should check out some php tutorial websites or read some books. w3schools.com is a good site to learn the basics.
  17. What you really want to do is have the gradient that is on the sides be the background of the body. Then you want to center the header/main content area/footer in a big div called "wrapper". Each of these divs would have width:100%; , then you just float them into position. Very simple. You will of course have to add content before they will have any height. <body style="background: url(img/gradient.gif) repeat-x; text-align:center;"> <div id="wrapper" style="width:760px; margin:0px auto;"> <div id="header" style="width:100%; float:left;"></div> <div id="content" style="width:100%; float:left;></div> <div id="footer" style="width:100%; float:left;></div> </div> </body> If you want a "sticky" footer, you best learn how to float divs before trying to accomplish that.
  18. What version of php are you running?
  19. try http://kuler.adobe.com/ you can put in the colors that you are working with, and see what it suggests as a coordinating color. You must have the latest flash player to use the site. #BAC891 is pretty nice
  20. try changing the location of the Items.css file to root, and adjust the href.
  21. relative positioning doesn't use position: relative; and top:185px; take out the top:185; and replace with float:left; you also need to declare a float:left on the footer, and take out its top declaration. Learning how to float stuff is one of the trickier things about CSS. Your top declarations work with absolute positioning, but have no use in relative positioning.
  22. If you already have a variable which is a string, you can't append an array to it using .= If you want to replace the variable value with an array, simply use = not .=
  23. I had a job interview today that didn't go so well. I have fairly decent php skills in my opinion, but don't know enough about OOP to save my life, or in this case get the job. I've read a few php books that had oop basics in them, but I need one that will really teach me well, and after reading it I will be the OOP master. Suggestions please! I don't wanna lose another job opportunity due to being OOPless.
  24. You should try to use the same encoding for the page and the data, or use a function like utf8_decode
  25. I've got a script that sends mail based on quiz answers that are stored in an xml file. The answers have \n newline characters in them, which I convert to <br /> before generating the HTML portion of a multipart email. I was experiencing problems using str_replace to replace all of the \n with <br /> , but nl2br works fine. What is strange is, when using str_replace, I can check the value of the converted string with echo and it looks just as I want, but the mail() function won't accept the string, and mail() fails. Using nl2br works great. I just want to know why the string generated by str_replace isn't accepted by the mail function.
×
×
  • 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.