Jump to content

turbocueca

Members
  • Posts

    62
  • Joined

  • Last visited

    Never

Everything posted by turbocueca

  1. Thanks for your help. The DB is created and the file is created but now I don't know how to call the download.
  2. How can I make a downlaod hit counter with PHP? I want to know how many downloads the people do on ym website. Thanks before.
  3. Dont bother replying, I figured out I have many problems in my code that doesn't let this work properly.
  4. [code]<?php     if (isset($_POST['query'])) {                 $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM usbextreme WHERE name LIKE '%$query%' OR system LIKE '%$query%' OR postedby LIKE '%$query%'"),0);                 if ($total_results!=0) {                 echo '<span class="style79">Searched results:</span> <span class="style80">'.$total_results.' - <a href="index.php">Reset</a></span'; } else { echo '<span class="style79">No results</span> - <a href="index.php">Reset</a>'; } }                      elseif (isset($_POST['select'])) {                 if ($_POST['select']="today") {                 $now=date(dmy);                     $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM usbextreme WHERE ins_date LIKE $now"),0);                 if ($total_results!=0) {                 echo '<span class="style79">Filtered results:</span> <span class="style80">'.$total_results.' - <a href="index.php">Reset</a></span>'; } else { if (!isset($_POST['select'])) { echo '<span class="style79">No results</span> - <a href="index.php">Reset</a>'; } } } }                                  else {                 $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM usbextreme WHERE system LIKE '$filter' OR work_status LIKE '$filter'"),0);                 if ($total_results!=0) {                 echo '<span class="style79">Filtered results:</span> <span class="style80">'.$total_results.' - <a href="index.php">Reset</a></span>'; } else { echo '<span class="style79">No results</span> - <a href="index.php">Reset</a>'; } } ?> [/code] [a href=\"http://infocenter.awardspace.com/inter/ps2ub/index.php\" target=\"_blank\"]http://infocenter.awardspace.com/inter/ps2ub/index.php[/a] If you enter this link, you will find something at the bottom of the page like this "No results - Reset", that shouldn't be there without searching the db or using the filter. For any reason, I'm not being able to make it disappear. Please check the code.
  5. I get a result from a database , for example "hello", and i put it in a variable, how can I limit the number of chars to 3? changing the variable value automatically to "hel" ?
  6. How to limit a field's char length using PHP without changing anything to the db atributes?
  7. Hello again. Now that the basics of my dynamic page are done I want to improve some things. [a href=\"http://infocenter.awardspace.com/inter/ps2ub/index2.php\" target=\"_blank\"]http://infocenter.awardspace.com/inter/ps2ub/index2.php[/a] The pagination here works properly. However when doing a search on the database the pagination doesn't work properly anymore. It writes the number of pages fine but when clicking in one of those pages, it returns to the whole database and shows the page that has been clicked but of the whole database and not from the search. Please test it and tell me how to make this work properly please. Thanks before.
  8. problem solved, had '%query%' instead of '%$query%'
  9. [b]A code that works:[/b] [code]<form method="POST" action=""> Search Word: <input type="text" name="query"> <input type="SUBMIT" value="Search!"> </form> <? include 'db.php'; if (isset($_POST['query'])) { $result = mysql_query("SELECT name,system FROM usbextreme WHERE name LIKE '%$query%'") or die (mysql_error()); while(list($column1, $column2)=mysql_fetch_array($result)){ echo "Result: $column1, $column2 <br />"; } } ?>[/code] [b]My code:[/b] [code]<form method="POST" action=""> Search:<input type="text" name="query"> <input type="SUBMIT" value="Search!"> </form> <?php    if (isset($_POST['query']))         {         include 'db.php';         $execute=mysql_query("SELECT name,system,work_status,postedby,comments FROM usbextreme WHERE name LIKE '%query%'") or die (mysql_error());         while (list($name,$sys,$stat,$user,$comment)=mysql_fetch_array($execute))         {         echo "$name   $sys   $stat   $user   $comment";         }         } else         {         echo "You didn't press the button!";         } ?>[/code] Can someone please tell me what's wrong with my code, 'cause it doesn't search anything.
  10. no problem thanks. I managed to get the page working. Just added two ' on the search string.
  11. Here is what happen: [a href=\"http://infocenter.awardspace.com/inter/ps2ub/search.php\" target=\"_blank\"]http://infocenter.awardspace.com/inter/ps2ub/search.php[/a] [code]<html> <head><title>ola</title></head> <body> <form method="POST" action=""> Search Word: <input type="text" name="query"> <input type="SUBMIT" value="Search!"> </form> <? include 'db.php'; // PHP Search Script $result = mysql_query("SELECT name, work_status FROM usbextreme WHERE name LIKE '". $_POST['query']. "' OR work_status LIKE '". $_POST['query']. '"') or die (mysql_error()); while(list($column1, $column2)=mysql_fetch_array($result)){ echo "Result: $column1, $column2 <br />"; } ?> </body> </html>[/code]
  12. just let me eat somethin' and i'll test the code
  13. whats this? : Parse error: parse error, unexpected '\"' in /home/www/infocenter.awardspace.com/inter/ps2ub/search.php on line 50 [code]$sql = mysql_query("SELECT name, work_status FROM usbextreme WHERE name LIKE "" . $_POST['query'] . "" OR work_status LIKE "" .$_POST['query'] . """) or die (mysql_error());[/code] Note: I did the first way and mysql said something about the syntax, then I tried with the way justin16l told and it gave this error.
  14. cool, where can i find a simple tutorial to search mysql results?
  15. Yeah the manual said the same thing, but is this too important ?
  16. Hello people, long time no see. I've been studying some manuals of PHP, but there was one thing I didn't understand, what are classes and objects? Can someone please explain to me?
  17. thanks people for everything, i finally could implement two link styles at my website: [a href=\"http://infocenter.awardspace.com/inter/news2.php\" target=\"_blank\"]http://infocenter.awardspace.com/inter/news2.php[/a]
  18. I understand +/-, but whats the problem in here, it doesnt work correctly: [code]<html> <head> <title>Untitled Document</title> <style type="text/css"> <!-- #navlink a:link, #navlink a:active, #navlink a:visited {     color: #FF0000; } #navlink a:hover {     color: #00FF00; } --> </style> </head> <a href="home.html" id="navlink">Home</a> <body> </body> </html>[/code]
  19. where am I supposed to put that? What's that #?
  20. I want to know if it is possible to have two or more a:link on the css styles, 'cause I want to make two different colors for the links of my website.
  21. I want a page with a style and another page with another style. The main page must have default link color and the included page the style I did. But if I try not to use a style at the main page or use another style, it always use the style from the included file
  22. the included file doesnt need to change the color, I want make the links color on the main page by default.
  23. I'm having some problems in including pages in pages, I used a php statement to include a page. Alright it includes but the problem is that I DON'T want to share the styles. the first page has a style that makes the link text color white, and I don't want it to be white if there is a link on the second page. This is making me really nervous. Can someone help me please? see: [a href=\"http://infocenter.awardspace.com/inter/news2.php\" target=\"_blank\"]http://infocenter.awardspace.com/inter/news2.php[/a]
  24. C'mon, how can I make a field NOT required?
  25. wow, i fixed it. i changed from $error("...") to $error="..." and then tested with different data, on different boxes and works fine, now the problem is that if there is one form to fill up it says try again, but I only want it to try again if one of the required fields arent filled up, they are the ones with stars *. How can i do that? Ignore the success message as it always appear if the submit button is clicked. One more thing, is there any code to make the browser return to a previous page without deleting the values written on the fields?
×
×
  • 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.