Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by AyKay47

  1. Handling information from a database is a bit different then grabbing data from a static array.

    But as to your question, using inline styles should typically be avoided on large scale projects, as this will lead to alot more code then is necessary.

    Typically you want to use classes and id's to style elements using one ore more external style sheets.

    The author of this code probably just styled them inline for a quick example.

  2. Man1(0), Man1(1), Man1(2), etc.

    Man2(0), Man2(1), Man2(2), etc.

    Man3(0), Man3(1), Man3(2), etc.

     

    that isn't an array

     

    I don't quite understand what you are asking, a foreach loop is fine for looping through an array.

  3. It really depends on how much of the information that you have "learned" you actually understand and are confident using,

    and yes I agree with thorpe regarding the topic you posted in, which I commented on before I saw this thread.

    All that we have to base your knowledge off of is posts on this forum, seems like you have a ways to go.

    My advice would be instead of trying to cram as many languages in as you can, focus on becoming proficient in each language one at a time. Once you feel that you have a firm understanding of one, move on to the next.

  4. It would be neat to call DB as global

     

    global $db;

     

    since you would need db for many different classes and methods, and it's a pain in the but to put them in the constructor all the time.

     

    Or design an abstract class to extend the db object from.

     

    just...no

    I agree it is a pain sometimes, but it's the correct way to do it.

    Never use the global keyword.

  5. remove the break; that you have in the else condition.

    If $sig[0] does not match, the break; will break you out of the for loop and no other $sig values will be compared.

     

    $string = 'TESTSTRING!! I AM AN EMAIL TEXT!!! SO RANDOM! --- I AM A SIGNATURE!! HERP DERP CUT ME OFF';
    
    //define possible sig starts (=filter)
    $sig[0]=("#==");
    $sig[1]=("---");
    $sig[2]=("the name of an enterprise");
    $sig[3]=("___");
    
    for ($i=0; $i <= count($sig);  $i++) 
    {
    $sigpos = strpos($string,$sig[$i]);
    if($sigpos !== false) 
            {
    	$string = substr($string,0,$sigpos);
    	echo trim($string);
    	break;
    }
    }
    echo "<br />";
    //show where the sig is cut off
    echo $sigpos;
    ?>

  6. as far as I know it's always been text/html output.  There used to be a tab at the top that let you switch between html or plain text and that seems to be gone now.  Maybe it remembered your selection so it went to plain text for you by default, not sure if it did that or not.

     

    very well could have, I guess I will have to use a header to get to the proper content-type.

    Thanks for the help.

  7. Do you have an example we can use to reproduce the problem? Saying "sometimes it doesn't work" is about as ambiguous as saying there's a security hole in IE6.

     

    heh, yeah sure.

     

    http://codepad.viper-7.com/20Gd51

     

    it seems that tags are now stripped or something of the sort.

    The behavior seems kind of random to me, as sometimes it parses the string fine and sometimes its stripped.

    This behavior did not occur until maintenance was performed on the site about 2 weeks ago.

     

  8. Is anyone else noticing unexpected behavior with regex functions like preg_match() etc. on codepad.viper-7.com?

    A few tests I have performed have not shown any results at all.

    A pattern like '~.*~'; isn't matching anything when the $subject argument is certain things, other times it will match everything in the $subject argument, very strange.

    I haven't ran enough tests to determine what exactly in the $subject arguments is causing this, just wondering if anyone else has experienced this.

  9. the problem is this line:

     

    $season = $k['season'];

     

    so if the season if 1, at the end of the first iteration of the for loop, $season will be set to 1, and the next iteration of season 1 episode 2, this line will not pass:

     

     if($season!=$k['season']) {

     

    so your credentials will not be wrapped in the season div.

    I'm not sure of the logic for this, but it needs changed.

  10. I think i found the problem, i was using double quoutes in :

    $str = "<i><font color="800080"> man </font></i><p><font color="9898989"> hi </font></p><p><font color="1111111"> cheers </font></p>";

     

    while it should be:

    $str = '<i><font color="800080"> man </font></i><p><font color="9898989"> hi </font></p><p><font color="1111111"> cheers </font></p>';
    

     

    thanks anyways...:)

     

    that or what thorpe suggested.

×
×
  • 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.