Jump to content

robert_gsfame

Members
  • Posts

    876
  • Joined

  • Last visited

Everything posted by robert_gsfame

  1. error occurs on line 916, and this is my code for that line if (copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1)){ echo "<b>Logo Uploaded</b>";
  2. I got this error suddenly! ERROR Warning: copy() [function.copy]: Filename cannot be empty i try to put upload_max_filesize = 2M in php.ini but error still there i need some helps thx
  3. i have this function to highlight search text function highlightWords($text, $words) { foreach ($words as $word) { $word = preg_quote($word); $text = preg_replace("/\b($word)\b/i", '<span class="highlight_word">\1</span>', $text); } return $text; } ?> if i want to highlight let say "Mr" and "George" from "Let me introduce you to Mr George" I found that the word George missing after the word "Mr" highlighted
  4. Is there a non-case sensitive str_replace?
  5. i have below code n it didnt work :confused: $searchtext=explode(" ",$_POST['text']); $countsearchtext=count($searchtext); $product1x=htmlentities($selectimagefetch['product_name']); for($i=0;$i<$countsearchtext;$i++){ if(strpos($product1x,$searchtext[$i])==true){ $product1=str_replace($searchtext[$i],"<b>".$searchtext[$i]."</b>",$product1x);}else{ $product1=$product1x;} } i dont get the bold search text?? thx
  6. I create a search engine for my website, n i wish to have this suppose user type "AA", then i want "Battery AA, aa/battery charger, aa-size battery, AA&BB baterry" how can i do that?? i actually use REGEXP '[[:<:]]".$search[$i]."[[:>:]]'=1 but i only get the first one which is separated with space Battery AA second, third n fourth didnt appear
  7. how can i sort an array from last til the first element thx
  8. okay fast coding assume i have 15 records n i wish each row to have only 2 records to be displayed then i will do like this <table><tr> <?php $myrecord=array("bla","bla","bla","bla","bla","bla","bla","bla","bla","bla","bla","bla","bla","bla","bla"); $td=1; for($i=0;$i<count($myrecord);$i++){ if($td==3){ echo "</tr><tr>"; $td=1;} echo "<td>$myrecord[$i]</td>"; $td++; } ?> </tr></table>
  9. just create a condition then.. $td=1; then loop $td...after reach a total <td> you wish to have then if($td==3){ echo "</tr><tr>"; ==>close and create new line... n dont forget to set back your $td $td=1;} hope it helps
  10. this part is the problem then $check_ignored = mysql_query("SELECT COUNT(`id`) FROM `ignored` WHERE `to`='$to' OR `from`='$from'"); try this $check_ignored = mysql_query("SELECT COUNT(id) FROM ignored WHERE to='$to' OR from='$from'");
  11. okay..i got it! although i rather choose to use str_replace and replace or special character which is not needed... anyway thx
  12. when i use urlencode() assume "Jim Carey", then i will have trouble with the query I will have $query=mysql_query("SELECT * FROM table1 WHERE actor_name='Jim+Carey'"); instead of $query=mysql_query("SELECT * FROM table1 WHERE actor_name='Jim Carey'"); ???
  13. How can i avoid special character to be written on url.. let say i have mypage.php?name=James+Barnwell then when i put special character like %?()* n i will get an error...i know that this is very dangerous but i dont have any idea on how to avoid that i try to use str_replace but not working... $string=$_GET['value']; $replacethis=array('\%','\?','\*'); $replaceby=array('','',''); $string1=str_replace($replacethis,$replaceby,$string);
  14. I have this $string=$_GET['name']; $query=mysql_query(sprintf("SELECT * FROM table1 WHERE username='%s' AND name REGEXP '[[:<:]]$string[[:>:]]'=1", mysql_real_escape_string($username))); and i get the error parse error, unexpected '[', expecting T_STRING or T_VARIABLE or T_NUM_STRING which part should be modified??
  15. Sure you can, use JOIN for example: SELECT table1.*,table2.* FROM table1 JOIN table2 ON table1.username=table2.username WHERE blabla then get the array result
  16. dont forget single quotes DELETE FROM table_name WHERE column = 'x';
  17. not working?? it always goes back to the top of the page when new tab open :confused:
  18. Can anyone point me out how can i create the most efficient search engine for my website.. if i use SELECT * FROM table WHERE record REGEXP '[[:<:]]%s[[:>:]]'= 1 will this avoid me of getting the search result faster when there are million of records in my database?? i try to google n read some article about FULL TEXT but i always find error when using that..i m not really sure what cause this but i have INT, VARCHAR n TEXT type in one of my table thx
  19. so if two users have set their own pc date differently then i they will have different time result?
  20. <script type="text/javascript"> $(document).ready(function() { //Default Action $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active content return false; }); }); </script> n i have this html code <ul class="tabs"> <li><a href="#tab1">Tab1</a></li> <li><a href="#tab2">Tab2</a></li> </ul> <div id="tab1" class="tab_content">blablabla</div> <div id="tab2" class="tab_content">blablabla</div>
  21. let say i have date("Y-m-d, H:i") and assume it was $date=2010-09-03, 11:00 and i wish to find the difference between $date and today's date actually i know how to find it but it always depends on each user's computer date how can i get a fix result so that each user will have the same result even if they try to change their computer date thx
  22. If u use anchor then they will go to where the anchor is, i just dont want to go anywhere
  23. i have a tab menu let say tab1,tab2 and tab3 and i have this <a href="#tab1">tab1</a> to open the first tab there is no problem actually with the tab itself only i always get back to the top of the page after the chosen page open, can i avoid this like when using javascript:void(0)
×
×
  • 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.