Jump to content

dtdetu

Members
  • Posts

    86
  • Joined

  • Last visited

    Never

Posts posted by dtdetu

  1. hello, i am making a script and i need to check if current date is between

    mon - thru friday  8 am 5:30 pm , i tried many things but couldnt get it work, can you take a look please , thanks

  2. i edited code to

    $nget=preg_replace("/\b<script>parent.doneLoaded\('{\"meta\":[{\"request\":\"DEPARTMENTS\",\"skip\":\"false\",\"campusActive\":\"true\",\"progActive\":\"true\",\"termActive\":\"true\",\"size\":\"\b.+\b\"}],\"data\":\[{\b/","",$get);

    and it doesnt give error but , it doesnt replace now, anyone?

  3. hello

    i used

    $nget=preg_replace("/\b<script>parent.doneLoaded('{\"meta\":[{\"request\":\"DEPARTMENTS\",\"skip\":\"false\",\"campusActive\":\"true\",\"progActive\":\"true\",\"termActive\":\"true\",\"size\":\"\b.+\b\"}],\"data\":[{\b/","",$get);

     

    but it gives Warning: preg_replace() [function.preg-replace]: Compilation failed: missing terminating ] for character class at offset 169 error

  4. hello , i am trying to remove

    <script>parent.doneLoaded('{"meta":[{"request":"DEPARTMENTS","skip":"false","campusActive":"true","progActive":"true","termActive":"true","size":"$variable"}],"data":[{

    from my str , i tried with preg_replace but couldnt get it work, the $variable is string but always change so i put $variable there, i tried to use [^<]* but it is not working please help

  5. hello , i am trying to use strtotime in a date but it works for

     

    echo strtotime("Today 00:04 EDT");

     

    but it doesnt work for

     

    echo strtotime("06-26-2009 23:14 EDT");

     

    can someone tell me how can i convert 06-26-2009 23:14 EDT to 11 length time value , thanks

  6. hello i have this function to generate tag clouds in my site

     

    <?php
    function tag_cloud($tags) {
        $maxsize = 40;
        $minsize = 20;
    
        $maxval = max(array_values($tags));
        $minval = min(array_values($tags));
    
        $spread = $maxval - $minval;
    
        $step = ($maxsize - $minsize) / ($spread);
    
        foreach ($tags as $key => $value) {
            $size = round($minsize + (($value - $minval) * $step));
            echo '<a href="#" style="font-size: '.$size.'px">'.$key.'</a> ';
        }
    }
    
    $tags = array('php'=>30, 'javascript'=>24, 'java'=>17, 'python'=>26, 'ruby'=>17);
    
    tag_cloud($tags);

     

    i will use it as search tag cloud generator, in my database there are search keywords. my searches stored invidually , so i think i need to use group by in the query.

     

    but i couldnt figure how can i get data from mysql and use in this function. Can someone help me please

  7. hello i want to get the

     

    <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941.html">Post your  Screenshots here.</a><!-- start: forumdisplay_thread_multipage -->
    <span class="smalltext">( <!-- start: forumdisplay_thread_multipage_page -->
    <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941.html">1</a> 
    
    <!-- end: forumdisplay_thread_multipage_page --><!-- start: forumdisplay_thread_multipage_page -->
    <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941-2.html">2</a> 
    <!-- end: forumdisplay_thread_multipage_page --><!-- start: forumdisplay_thread_multipage_page -->
    <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941-3.html">3</a> 
    <!-- end: forumdisplay_thread_multipage_page --><!-- start: forumdisplay_thread_multipage_page -->
    <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941-4.html">4</a> 
    <!-- end: forumdisplay_thread_multipage_page --><!-- start: forumdisplay_thread_multipage_more -->
    ... <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941-16.html">last</a>
    <!-- end: forumdisplay_thread_multipage_more -->)</span>
    <!-- end: forumdisplay_thread_multipage -->

     

    from

     

    <td class="trow1"> <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941.html">Post your PCSX2 0.9.2 Screenshots here.</a><!-- start: forumdisplay_thread_multipage -->
    <span class="smalltext">( <!-- start: forumdisplay_thread_multipage_page -->
    <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941.html">1</a> 
    
    <!-- end: forumdisplay_thread_multipage_page --><!-- start: forumdisplay_thread_multipage_page -->
    <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941-2.html">2</a> 
    <!-- end: forumdisplay_thread_multipage_page --><!-- start: forumdisplay_thread_multipage_page -->
    <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941-3.html">3</a> 
    <!-- end: forumdisplay_thread_multipage_page --><!-- start: forumdisplay_thread_multipage_page -->
    <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941-4.html">4</a> 
    <!-- end: forumdisplay_thread_multipage_page --><!-- start: forumdisplay_thread_multipage_more -->
    ... <a href="post-your-pcsx2-0-9-2-screenshots-here-t-941-16.html">last</a>
    <!-- end: forumdisplay_thread_multipage_more -->)</span>
    <!-- end: forumdisplay_thread_multipage --></td>
    

     

    i am using

     

     preg_match_all("~<td class=\"trow1\"> (.*?)</td>~i", $searchresult, $topics); 

     

    but it show no results can someone point me where do i make the mistake . thanks

  8. hey i used

     

      preg_match("%</small>\s*</p>\s*<p>(.*?)</p>%si", $go, $content);

     

    then i get this error, is % has something

    msnbcLinks {font-size:11px; font-family:Arial, Helvetica, sans-serif; color: #999; margin-top: 5px; background: transparent; text-align: center; width: 425px;} .msnbcLinks a {text-decoration:none !important; border-bottom: 1px dotted #999 !important; font-weight:normal !important; height: 13px;} .msnbcLinks a:link, .msnbcLinks a:visited {color: #5799db !important;} .msnbcLinks a:hover, .msnbcLinks a:active {color:#CC0000 !important;} Visit msnbc.com for Breaking News, World News, and News about the Economy Christmas came early for the Duggar family, in the form of Jordyn-Grace Makiya, born – via C-section – last Thursday. Now that the baby's home, and "sleeping very well," says her father, Jim Bob Duggar, the family of 20 (minus eldest and married son Josh) flashed their collective smiles

     

    it is not i want to get:(

  9. hello can anyone help me how to solve this problem i want to get the content of this string

     

    <p><small>21 December 2008 4:08 PM, PST</small></p>
    
    <p>No, she&#39;s not running nekkid through London&#39;s filthy streets. This time, <a href="/name/nm1561881/">Amy Winehouse</a> is scoring her weekly dose of train-wreckognition by stripping down for a Beach romp on the Caribbean island of St. Lucia.
    
    And we&#39;ve got to say, that in her News of the World slide show frolic, she looks much better than we&#39;d expected. For anyone else, this could be a career crisis, but for Amy it looks like a relatively healthy step in the right direction.
    
    Go figure!</p>
    

     

    i want to get

     

    No, she&#39;s not running nekkid through London&#39;s filthy streets. This time, <a href="/name/nm1561881/">Amy Winehouse</a> is scoring her weekly dose of train-wreckognition by stripping down for a Beach romp on the Caribbean island of St. Lucia.
    
    And we&#39;ve got to say, that in her News of the World slide show frolic, she looks much better than we&#39;d expected. For anyone else, this could be a career crisis, but for Amy it looks like a relatively healthy step in the right direction.
    
    Go figure!

     

    part of the string i am using

     

     preg_match("~<p><small>[^<]*<small>\s*<p>(.*?)</p>~i", $go, $content);

     

    but it doesnt work can anyone help please. thanks

     

  10. did you try this?

     

    and change this:

     

    Code: [select]echo "<input type=checkbox $checked name=is[]  value=$r[id] >$r[isadi]<br>";

     

    to this:

     

    Code: [select]echo "<input type=checkbox checked=$checked name=is[]  value=$r[id] >$r[isadi]<br>";

     

    if so are you getting any errors or what is happening?

     

    yes i tried this now it shows every value as checked

  11. hello i use this checkbox code

     

      <?   
    $q=mysql_query("select * from iss");
    echo "    
        
              <table border=0 cellspacing=5 width=80%><tr valign=top><td width=33%>";
    $i=1;
    while($r=mysql_fetch_array($q))
    {
        
       
        echo "<input type=checkbox name=is[]  value=$r[id] >$r[isadi]<br>";       
        if($i==17) {
            echo   "</td><td width=33%>";
            $i=0;
        }
        $i++;
    }
    echo "</td></tr></table>";
    ?>

    it works but i want to add some kodu to auto check if the post value is checked i used

     

      <?   
    $q=mysql_query("select * from iscesitleri");
    echo "    
        
              <table border=0 cellspacing=5 width=80%><tr valign=top><td width=33%>";
    $i=1;
    while($r=mysql_fetch_array($q))
    {
        
       if($_POST[is][1] == $r[id])
    {
    $checked = "checked";
    }
        echo "<input type=checkbox $checked name=is[]  value=$r[id] >$r[isadi]<br>";       
        if($i==17) {
            echo   "</td><td width=33%>";
            $i=0;
        }
        $i++;
    }
    echo "</td></tr></table>";
    ?>

    but it didnt work can anyone help please

  12. hello i need some help about this query

     

     $q1=mysql_query("select * from projects where isid = '$r[id]' or isid2='$r[id]' or isid3='$r[id]' or isid4='$r[id] or isid5='$r[id]'") or die(mysql_error());
       

     

    it gives me error :

     

     	
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1'' at line 1

     

    can anyone point me the error pls thanks

     

    EDİT: i saw the problem thanks:)

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