Jump to content

brooksh

Members
  • Posts

    139
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

brooksh's Achievements

Regular Member

Regular Member (3/5)

1

Reputation

  1. Here is my code, but it misses a lot of searches just by missing a word, or it pulls too many invalid search results. Any ideas how to make it better? Here is what I have: $sql = "select * from questions where (Question LIKE '%$quest_search%' OR Answer LIKE '%$quest_search%') AND (active='yes')"; $result = mysql_query ($sql); $count = mysql_num_rows( $result ); if($count == "0"){ $sql = "SELECT * FROM questions WHERE MATCH(Question,Answer) AGAINST ('$quest_search' IN BOOLEAN MODE) AND (active='yes')"; }
  2. There are several URL's in the page that include $id in them. The one I need does not have any special tags, just a long URL that I can't seem to get because of special characters. I'm using a wildcard, but it take it. Can i get any help? URL: <a href="http://thewebsite.com/?bhtid=8774&sdop=1&amp" rel="nofollow" target="_blank"> foreach ( $page->find("a[href*=$id&amp]") as $url){ //doesn't work
  3. Is there a better way? All I need is when a visitor visits a certain page and clicks on agree, it remembers it in a cookie and they won't have to click on the link again. But I want them to click agree on multiple pages. page1.php (agree yes then display page) page2.php (not agree, don't display page)
  4. I want to show and hide all of them at once no matter which button I click on. I'm sure there is an easy way, but I don't know javascript. <script type="text/javascript"> function showDiv() { document.getElementById('welcomeDiv').style.display = "block"; } function showDiv2() { document.getElementById('welcomeDiv2').style.display = "none"; } </script> <div id="welcomeDiv" style="display:none;" class="answer_list" > WELCOME</div> <div id="welcomeDiv2" style="display:block;" class="answer_list" > <input type="button" name="answer" value="Show Div" onclick="showDiv();showDiv2();" /></div> <div id="welcomeDiv" style="display:none;" class="answer_list" > WELCOME2</div> <div id="welcomeDiv2" style="display:block;" class="answer_list" > <input type="button" name="answer" value="Show Div" onclick="showDiv();showDiv2();" /></div> <div id="welcomeDiv" style="display:none;" class="answer_list" > WELCOME3</div> <div id="welcomeDiv2" style="display:block;" class="answer_list" > <input type="button" name="answer" value="Show Div" onclick="showDiv();showDiv2();" /></div>
  5. I'm trying to set dynamic cookies. Why isn't it working? Here is my code. setcookie('mycookie[$id]',$id, time()+3600*24); Then to call it I use $_COOKIE['mycookie']['$id']
  6. <a href="redirect.php?34344" target="_blank" onClick="window.opener.location.reload();">
  7. This opens a new window and opens the url in parent page. I just want to refresh parent, and open new window at the same time. <a href="redirect.php?=34344" onclick="window.location.reload(); window.open(this.href,'popupwindow');" >
  8. I had <input type="text" value="<?=$row[description]?>" name="description"> instead of <input type="text" value="<?=$row[description]?>" name="description[]">
  9. When I submit my form, it limits the update to 1 character. For example if I put "Description" as the description, it inserts "d" in the database. What is wrong with my code? $size = count($_POST['checkbox']); // start a loop in order to update each record $i = 0; while ($i < $size) { // define each variable $title2= $_POST['title'][$i]; $description2= $description[$i]; $edit= $_POST['checkbox'][$i]; mysql_query("UPDATE `categories` SET `title`='$title2',`description`='$description2' WHERE id ='$edit'"); ++$i; }
  10. <body onload="parent.jQuery.prettyPhoto.close(); parent.location.href=parent.location.href;">
  11. I'm using pretty photo. I want to refresh the parent page when I close the modal window which is an iframe. This script closes the modal, but does not refresh the parent frame. <a href="#" onclick="window.parent.jQuery.prettyPhoto.close();">Close</a>
  12. Thanks, that solved it. For some reason my posted password had a space in it.
  13. If I set my password in the script it works, but if I submit the password in a form it doesn't. When echoing the password, both show the same thing. The login_pass2 encrypts correctly, but the login_pass does not. I've also tried doing $login_pass = "$_POST[login_password]"; but it doesn't work. Can anyone figure out why this isn't working? $login_pass = $_POST['login_password']; //posted = pass1234 $login_pass2 = "pass1234"; echo "$login_pass and $login_pass2";// shows pass1234 and pass1234 $encrypted_pass = data_encrypt($login_pass,$key); $encrypted_pass2 = data_encrypt($login_pass2,$key); echo "$encrypted_pass and $encrypted_pass2"; // shows 9lf8xG573pp+8DkhzK/Bu7GPFQQzg40mZZEGIF9Qg7c= and Ex20uB9BVZgqOqjjEu5hDXN+JQu0b4qPn15CXsKOlls=
  14. If the number 12 is found within the array, I want it to echo yes.
×
×
  • 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.