Jump to content

mikejs

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mikejs's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi I am using the following code $num_rows = mysql_num_rows($q); ///check no of rows mysql_query("INSERT INTO tags(tag) VALUES('$query') ") or die(mysql_error()); if($num_rows>0){ echo " <b>Your search for the word<font color=blue> " .strtoupper($query). " </font>returned $num_rows results: -\n</b>"; I am stuck with what to put here so it adds the search term to the table VALUES('$query') ") the code above uses " .strtoupper($query). " and displays fine when I check the table its being updated with $query rather than the value anyone help please
  2. Hi is it possible to use java to close a div on this button click <a class="button" id="submitbutton" href="#"><span id="buttontext">Search</span> </a> I did try using onclick="changeme('notice', 'hide');" notice being the name of the div with <script> function changeme(notice, action) { if (action=="hide") { document.getElementById(notice).style.display = "none"; } else { document.getElementById(notice).style.display = "block"; } } </script> in my header but it didn't work any suggestions :-)
  3. Hi I have created a search page using ajax and mysql to display the search results the search works fine, however if I press search without any input it displays the whole database all results ?? driving me crazy any help much appretiated this is my search.php :- if($type == "results") { //run query where search value is like table fields $sql = "SELECT * FROM articles WHERE ( "; $sql .= " UPPER(title) LIKE '%" . $query . "%' OR "; $sql .= " UPPER(category) LIKE '%" . $query . "%' OR "; $sql .= " UPPER(body) LIKE '%" . $query . "%' "; $sql .= ") order by category"; $q = (mysql_query($sql)); // echo $q; $num_rows = mysql_num_rows($q); ///check no of rows if($num_rows>0){ echo " <b>Your search for the word<font color=blue> $query </font>returned $num_rows results: -\n</b>"; echo "<div id=\"scrollWrapper\">"; echo "<div id=\"scroll\">"; // while there are rows echo output to produce page of results while($d = mysql_fetch_array($q)){ $id = $d['id']; $title = $d['title']; $category = $d['category']; $body = $d['body']; $ref = $d['ref']; /// produces page of results echo "<div class =\"results\"><p><strong>Category: </strong>" . $category . "<br>";// using a div to be able to manipulate the output in css echo '<strong>Title: </strong>' . $title . '<br>'; echo '<br>'; echo '' . $body . '<br>'; echo '<br>'; echo '<b>Reference: ' . $ref . '</b><hr>'; echo "</div>"; //end while loop }else { echo"<p>Sorry, no search result. Please change keywords and try again.</p>"; }//end if echo "</div>"; echo "</div>"; } mysql_close($con); ?>
  4. Hi I am working on a small project that requires the user to submit a form the form should include a date box, text box (possibly a wisywig ) and some kind of file up-loader (I have looked at some great ajax file up-loaders) when the form is submitted it would store all the form information in the database for later retrieval. If another user looks at the current forms in the system then they will see the text and files on a page and be able to download the files or upload new files that would link to the same form they are viewing. anyone have any suggestions on where to start thanks M
  5. Hi sorry its a string not an array I kind of have it working now all the inputs are stored in $str as a string how can I add a / charecter in between each group box 1 www box 2 eee current output wwweee I want the output to be www/eee/ etc at the reciving end I want the $str to be put back into varibles that i can use to populate a table
  6. I have the following if(isset($_POST['submit'])) { $str = $_POST['fname'].' ++ '.$_POST['fname2'].' ++ '.$_POST['fname3'].' ++ '.$_POST['fname4'].' ++ '.$_POST['fname5'].' ++ '.$_POST['fname6'].' ++ '.$_POST['fname7'].' ++ '.$_POST['fname8']; do_it($str); } ?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> So in my case I have $str as my array
  7. Hi I tried that I get Warning: implode() [function.implode]: Invalid arguments passed ??
  8. Thanks for the reply I have <input type="text" name="fname[]" value="" > Box1<br /> <input type="text" name="fname[]" value="" /> Box2<br /> <input type="text" name="fname[]" value="" /> Box3<br /> <input type="text" name="fname[]" value="" /> Box4<br /> <input type="text" name="fname[]" value="" /> Box5<br /> <input type="text" name="fname[]" value="" /> Box6<br /> with $data = $_POST['fname']; if I echo $data I should get (value,value,value, etc ?
  9. Hi I have a form with several input boxes I want to take the input into a string $str = $_POST["box ++ box1 ++ box2 ++ box7 ++ box8"]; this is my table <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> <p> <input type="text" name="box" value="" > Box1<br /> <input type="text" name="box1" value="" /> Box2<br /> <input type="text" name="box2" value="" /> Box3<br /> <label> <select name="box7" id="box7"> <option value="1">Red</option> <option value="2">Blue</option> <option value="3">Green</option> </select> </label> Color<br /> <label> <select name="box8" id="box8"> <option value="1">8px</option> <option value="2">10px</option> <option value="3">14px</option> </select> </label> Font size<br /> <input type="submit" name="submit" value="Send"> </p> </form> <?php Any sugestions ? I would then like to take the $str and split it back into its individual ids using explode function maybe thanks M
  10. Hi I am entering my final year of my degree and would like to develop part of a Job Tracker system, with some of the functions found in willow job tracker. I have to do some research around alternative applications and different programming languages that could be used, I appreciate this is a php forum I just wanted some ideas feedback from a developers point of view. why use php over another language? are there any limitations using php? thanks M
×
×
  • 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.