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
Saving data from a form into a file
Hey everybody,Sorry, I am really new to PHP coding and such but a project kind of got thrust on me. I need to create a a form for people to input some information and then be able to collect the
foreach and array need help combining
Hi guys.Here's the codeCode: array( 'tag' => 'code', 'type' => 'unparsed_content', 'content' => '<div
IP Based Cron Jobs
I run cronjobs on my website. After one of my visitors got curious and tinkered around he realized he could reset my cron jobs...woohoo....Is there a way to get information from the server to make
Help With editting and deleting form
So look at this image :http://img194.imageshack.us/img194/8272/snapshot5f.png This table prints the titles of entries from a table in a database.. The code that i use for this table is this :Code:
PHP Form to Variable.
Hi! I have written a HTML-form code in DreamWeaver CS3 (in a PHP doc) and I really need it to work soon :/I have a form:(<form name="form1" action=""
Multiple Options for a Single Page
For this example I want to use the Handlers option which is under Fed Admin and all the related coding to the handlers option is found on the handlers.php page which includes a list of handlers with a
Help with PHP and checkboxes
I am posting this for a friend of mine, i wrote a small script for her to process her form data to an email but in testing i am having trouble getting the checkbox data to display in the email it
mysql_real_escape_string
Let me preface this that I am very much a PHP noob, but I have some SQL training (not necessarily MySQL, we used the Microsoft variety in school). I have a weird problem, I'm trying to create a
ALV List Display to point to another report on Double Click
Hi,
Run function every 5 mins ??
I have a function PostMessage()How can I run it every 5 mins ??