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
Lining up columns nicely.
Hello everyone, I'm having problems with making columns line up properly. Here is my code:
Windows Authentication
I have a website which is windows authenticated.now i want something more on this application.I want to add login as different user link which will open the login form to authenticate other user
Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a backflush code, or not populated with a code. I am aware of looking each part individually, but
Javascript using window.location seems to lose state
Not sure what forum so let me know if I'm in the wrong place.
Php script to read msword file
hi,I need to read a msword file and i want to print the contents in that word file.i used the fgets() and its working for text file. but its not working for word file.Help me in this.Thanks
GET vs SUBMIT Button to show sections on one index.php page?
Just curious if one of these ways is better (i.e. more efficient) than the other. I have an index.php page where there is a menu across the top with 5 choices. For example, HOME | MONKEYS | CATS |
Remove directories not empty
hi,i have an array that contains some names (1,4,6,56...). Every integer is a name of a folder.I must to delete only the folders in array, i use this code:Code: $all_folders = array();while ($row =
Login page problems
I developed a website a few months ago and I am now having an issue with logging into it. The place that it is hosted just did some upgrades to their servers and for some reason, now my login page
Class not found error
I am getting Class 'index' not found in Eval function://write config $path = dirname(__FILE__).DS.'..'.DS.'paymentclass'; if ( $model->payment_class ) { if
am I using this for loop correctly
Dear buddies!