Hello again :),
As usual i need to ask more questions :), and this time it is how do i set up a search thing so that people can search for what they want and a page comes up with results ?
As always i will accept help from anyone :)
Printable View
Hello again :),
As usual i need to ask more questions :), and this time it is how do i set up a search thing so that people can search for what they want and a page comes up with results ?
As always i will accept help from anyone :)
What exactly are you trying to accomplish? What do you want the users to search through (the web, your site, etc). I think that your question may just be too vague for any one person to have an answer to (or at least there would be mulitple answers by that one person) or something like that.
Hope this helps.
Thanks for your post :), but i don't know what vague means and what i need is that the search thing can work on my site (not that there is one but i will create a simlple one).
Vague is the opposite of specific, as in your question could be answered many different ways, most of witch your not looking for.
Indeed. For a site search, would you want it to search through the files of your website (in each directory), or using a predefined list in a MySQL database or text file. If the latter, you may want to check out this site:
http://www.cj-design.com/products/fr...jwebsitesearch
Hope this helps
Thanks for your post but i like to understand my things myself then to have software do it for me :).
But would i have to use MySQL for the job ? Because i have no idea what so ever on how to use it :(...
Well, the link I posted above uses text files for the search. So, you don't have to use MySQL. Hope this helps.
Thanks again for your post :),
1) Is using text files and MySQL basically the same or does any one of them have a certain advantage over the other ?
2) And can you please tell me tell me how to increase a value of a number inside of a text file ?
Thanks for your time !:)!
MySQL is a lot more secure than using text files. Also, with text files on a *nix machine you would have to worry about file permissions so that it is writable from the php script as compared to using MySQL.
Depending on how your script reads the file, you should be able to use the variable (that is assigned when you you read the file with the script), then simply increment that by using:Quote:
can you please tell me tell me how to increase a value of a number inside of a text file ?
orCode:$var = $var++;
Then simply write the new variable back in the file.Code:$var = $var+1;
Hope this helps.
Remember to end those with semicolons (;).
Ah yes, fixed now. My fast typing and multitasking got the best of me. Thanks.
$var++; works, and i think that a negligable proformance boost would be attained, as only one operation has to be carried out, and the variable doesnt have to be reassigned.
Probably, though how PHP actually does the operation is not clear, so it might be doing the exact same amount of work.
Use a direct variable if you want to. Link directly to the file searched:
Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Search</title>
</head>
<body>
<form method="get">
Search Term:
<input type="text" name="term">
<br><input type="submit" value="Enter">
</form>
<br>Results:
<br><?php
$t = $_GET["term"];
$ext = ".php";
if ($t != "") {
echo "<a href=\"$t$ext\" target=\"_blank\">$t$ext</a>\n<br>";
}
?>
</body>
</html>