Hi,
at first, great new design!!! I like it,
i got a problem,
I want to list some tekst, but there is a users, users can list they own texts, and all teksts, and find words in all texts and in own texts
somethings is weong in my php code because ist dont work
At first here is the form file:
Code: <div>
   <form name="TextSearchForm" action="<?php print "list_txt_search.php";?>" method="post" target="main">
   
   <div><select name="sn_text_year" style="text-align: center;">
         <option selected="selected"> Year </option>
         <option value="2009">2009</option>
         <option value="2010">2010</option>
         <option value="2011">2011</option>
      </select>
   </div>
   
   <div><select name="sn_text_author" style="text-align: center;">
         <option selected="selected"> choose </option>
         <option value=""> all txt </option>
         <option value="<?php print $UsrNrID;?>"> my txt </option>
      </select>
   </div>
   
      <div><input type="text" name="TextSearch" size="30" /></div>
      <div><input type="submit" name="SubmitTxtSerch" value="LIST" class="Button" /></div>
   </form>
</div>
3 selection is there:
"sn_text_year" (which year is text wroten)
"sn_text_author" (who is the author of the text - this is a cookie whith name of the user)
"TextSearch" (if the user want to find some word in database)
Code: <?php 
   $TextSearch = $_POST['TextSearch'];
?>
<?php 
// UsrIdentify
   $query_user = mysql_query("SELECT * FROM `sn_users` WHERE `sn_users_username` = '".$_COOKIE['loggedin']."'");
         if(!$query_user){
         print mysql_error();
         exit;
         }
      
      $RequestUsrID = mysql_fetch_array($query_user);
      
      
      $UsrID = $RequestUsrID['sn_users_id']; // HERE I CAN TAKE THE USERS ID
?>
<?php 
if ( $TextSearch == '' && $UsrID ) { 
   $QeryUsr = "SELECT * FROM `sn_text` WHERE `sn_text_godina` = '" . $_POST['sn_text_year'] . "' AND `sn_text_author` = '" . $UsrID . "' ORDER BY `sn_text_id` DESC";
}
if ( $TextSearch == '' && $UsrID == '' ) {
   $QeryUsr = "SELECT * FROM `sn_text` WHERE `sn_text_year` = '".$_POST['sn_text_year']."' ORDER BY `sn_text_id` DESC";
}
if ( $TextSearch && $UsrID == '' ) {
   $QeryUsr = "SELECT * FROM `sn_text` WHERE ucase(`area1`) LIKE '%".$TextSearch."%' OR lcase(`area1`) LIKE '%".$TextSearch."%' AND `sn_text_year` = '".$_POST['sn_text_year']."' ORDER BY `sn_text_id` DESC";
}
if ( $TextSearch && $UsrID ) {
   $QeryUsr = "SELECT * FROM `sn_text` WHERE ucase(`area1`) LIKE '%".$TextSearch."%' OR lcase(`area1`) LIKE '%".$TextSearch."%' AND `sn_text_year` = '".$_POST['sn_text_year']."' AND `sn_text_author` = '" . $UsrID . "' ORDER BY `sn_text_id` DESC";
// Admin capacityes
   $query_user = mysql_query( $QeryUsr );
         if(!$query_user){
         print mysql_error();
         exit;
         }
      
      while($request = mysql_fetch_array($query_user)) {
      
      // list
      }
?>
As You see You can choose:
1. Only year of text wroten
2. No text search, but identify User
3. No text search, no User identification - mean ilst all text
4. Search text, and identify User (mean searching word only in Users texts)
So, something is wrong, because:
1. when I choose Year, and list all text - list only my texts
2 when I choose Year, and list my texts - list only my texts
3. when I choose Year, and list my texts, with searching text - list only my text without choose
4. when I choos Year, and list all text, with serching text - its work fine
I see its a complicated, I hope, that You can give mi a solution
thanx
Mass activity scheduling
Hi experts,
Comparing Values
HiI'm reading data from a database and this seems to work OK.Each system has an associated series of references..Code:Code: $dn = "cn=System"; $filter="(objectclass=*)";
rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded in the contact us page of a website that is still on my pc only. The end goal is to place the PHP
include function being weird?
I have a very simple system to grab an IP outputted by a PHP file.. (for a project I have) but it outputs a 1 at the end!!<form method="post" action="<?php echo
Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I am coding a registration form. I ask the user a Yes/No question. Depending on the answer I have an
ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords aligned by our active directory to the same as those used to access the Network. My query is that we
need Array help
This is what I have to do. $teamname[1] = "Red Sox" $teamname[2] = "Giants" $teamname[3] = "White Sox" $teamname[4] = "Cubs" $teamname[5] =
Search function
I am looking for some guidance from the experts.I am trying to create a search function. It will only be searching one table. The search criteria consists of two drop down menus. Each menu lists
gather checkbox data from form into email
Hello all,First, i'd like to thank everyone who responded to my previous posts regarding setting up an SMTP server for my php form. I ended up figuring it out and my form is up and functioning,
re calling a function without including file
Hi,i am new to programming in php, i was just checking the wordpress code and found out in the wordpress code they are calling the function get_header(); at the top of every page but above calling