Jump to content

mikefrederick

Members
  • Posts

    247
  • Joined

  • Last visited

    Never

Posts posted by mikefrederick

  1. i have a search script located at http://sites.loado.com/notestock/friendsearch.php

     

    You will see that if you slowly type in names of colleges that each letter will change colors, but if you don't do it slowly a lot of times if only does it every couple of letters and you will have typed in letters that don't change. This is my php code

    that the AJAX reaches for:

    <?php
    
    
    if(isset($_GET['getCountriesByLetters']) && isset($_GET['letters'])){
    $bar = $_GET['letters'];
    $replace[0]="-";
    $replace[1]="the ";
    $replaces[1]="";
    $replaces[0]="";
    
    $bar=str_replace($replace,$replaces,$bar);
    $replacee[0]=" of ";
    $replacee[1]=" in ";
    $replacess[1]=" ";
    $replacess[0]=" ";
    $bar=str_replace($replacee,$replacess,$bar);
    
    $x=explode(" ",$bar);
    $search = "WHERE name LIKE '%" . implode("%' and name LIKE '%", $x) . "%' ";
    $res=mysql_query("select * from schools " . $search . " order by name limit 7");
    while($inf = mysql_fetch_array($res)){
    $t=$inf["name"];
    foreach(explode(" ",$bar) as $x)
    $t= str_replace($x,"<span class='searched'>" . $x . "</span>",$t);
    echo $inf["id"]."###".$t."|"; 
     }	
    }
    ?>
    
    

     

     

     

    any ideas on better optimization strategies? maybe it is dumb to add a span class to each letter

  2. I want to make a video player in flash and I know a fair amount of actionscript but Have no idea where to get started as far as making a flash player. Anyone know where I should start? I want it to interact with variables from php eventually.

  3. i tried without success:

    <?php
    $descr.=substr(htmlentities($fetchdates['description']),0,100)."...";
    $descr.=<<<TEST
    <a class='readmore' href='javascript:void(0);' onclick='window.open(\'events_view.php\',\'Events View\',\'width=300, height=300, scrollbars=no\');'>(read more)</a>;
    TEST;
    }
    

  4. sure....

     

     

    <?php if($desclen>100) {
    $descr.=substr(htmlentities($fetchdates['description']),0,100)."...";
    $xx="<a class='readmore' href='javascript:void(0);' onclick='window.open(\'events_view.php\',\'Events View\',\'width=300, height=300, scrollbars=no\');'>(read more)</a>";
    $descr.= addslashes($xx);
    } else {
    $descr=htmlentities($fetchdates['description']); } ?>
    

     

    i have a link that onmouseover uses the overlib function:

     

    <a  href="calendar.php?id=<?=$fetchdates['id'];?>" onmouseover="return overlib('<div align=\'center\' class=\'boxtitle\'><?=$fetchdates['title'];?></div><div class=\'times\'><?=$times;?></div><div class=\'boxmain\'><?=$descr;?></div><div class=\'boxtype\'><?=$type;?></div>', STICKY, 'refmark<?=$date;?>', ANCHORALIGN, 'UR', 'UR', CAPTION, '<?=$topofbox;?>');" onfocus="this.blur()"><?=$fetchdates['title'];?></a>

     

  5. I cannot figure out how to do the slashes on $xx for this:

     

    onmouseover="return thistitle('<div align=\'center\' class=\'boxtitle\'><?=$xx;?></div>');"

     

     

    $xx="<a class='readmore' href='javascript:void(0);' onclick='window.open(\'events_view.php\',\'Events View\',\'width=300, height=300, scrollbars=no\');'>(read more)</a>";

     

    Basically it is third level apostrophes I need to figure out...I tried the heredoc method, couldn't figure it out...any help is appreciated. Maybe addslashes? I dont know.

  6. I have come across a rare case in which it is understandable that a headers already sent error occurs, but I need the code to remain as is. I would explain further but it is intricate...

    Is there anyway to make it so that the warning does not show up on the page?

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