|
|
|
|
![]() ![]() |
Apr 20 2006, 08:33 PM
Post
#1
|
|
|
Never alone with Christ ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 647 Joined: 22-July 05 Member No.: 9,713 |
I am looking to put a whole Bible on my site, don't worry about copyrights, I already have all that. It will be put into my site book by book. My problem? I need a form that will only search the /Bible part of my database. I need an html form, and then a php code that can be put into just ONE file but that will display a search page afterward. If you could help me out here, I would greatly appreciate it since I will need this in order for it to work. The goal is simple, have an html form, that will lead to a search of my entire inneed.mxweb.co.uk/bible database without searching anything else, but when you get the results, it will display it on another page that will be, say,...results.php. And then I would like to know if I have to save that results page as a php or html file, it will be displaying the results of the search. does anyone know if this is even possible or if it can be done? I know, complicated. Thanks.
|
|
|
|
Apr 20 2006, 09:35 PM
Post
#2
|
|
|
Ephesians 6:10-17 ![]() Group: [MODERATOR] Posts: 1,864 Joined: 22-June 05 From: The World of Gentoo Member No.: 8,528 ![]() |
Sorry that i'm not a database person, but seems like you are trying to do what bibleserver.com already has. What i'd suggest is link to that site, for now, until you get everything ready for your's. If you're lucky, you can somehow email bibleserver.com and if they're willing they can provide you with their coding. Though, i highly doubt it.
|
|
|
|
Apr 20 2006, 10:25 PM
Post
#3
|
|
|
Never alone with Christ ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 647 Joined: 22-July 05 Member No.: 9,713 |
I tried, but it didn't work. None of them want to provide you code. I will wait until there is someone who knows. I really need it though. I found one that was cgi-bin/something I don't know what it was though. I need to know what goes in the process code. I know you make a form, and set the value to get, but then there is the form action part. You know, the part like process.php that runs the whole works. That isn't working and I am not getting any happier
|
|
|
|
Apr 20 2006, 11:15 PM
Post
#4
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 27 Joined: 5-April 06 Member No.: 21,363 |
aight, I made somthing to what I think your asking. If you go to the church site I made: CBF , it has a area where you can search for sermons in a database.
I'm thinking your using PHP 5. aighy, here you go man... just wrote this up real quik for yu, very simple, hope it works for you , Arctic html form: CODE <html> <head> <title>Search Test</title> </head> <body topmargin="0" leftmargin="0"> <form action="search.php" method="post"> Search Term <input type="text" name="searchterm"><br /> <input type="submit" value="Search"> </form> </body> </html> php search.php: CODE <?php /*set varibles from form */ $searchterm = $_POST['searchterm']; trim ($searchterm); /*check if search term was entered*/ if (!$searchterm){ echo 'Please enter a search term.'; } /*add slashes to search term*/ if (!get_magic_quotes_gpc()) { $searchterm = addslashes($searchterm); } /* connects to database */ @ $dbconn = new mysqli('host', 'username', 'password', 'database'); if (mysqli_connect_errno()) { echo 'Error: Could not connect to database. Please try again later.'; exit; } /*query the database*/ $query = "select * from tablename where tablerow like '%".$searchterm."%'"; $result = $dbconn->query($query); /*number of rows found*/ $num_results = $result->num_rows; echo '<p>Found: '.$num_results.'</p>'; /*loops through results*/ for ($i=0; $i <$num_results; $i++) { $num_found = $i + 1; $row = $result->fetch_assoc(); echo "$num_found. ".($row['tablerow'])." <br />"; } /*free database*/ $result->free(); $dbconn->close(); ?> oh, and your right, never alone with Christ, he reigns 4-ever |
|
|
|
Apr 21 2006, 04:26 AM
Post
#5
|
|
|
Never alone with Christ ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 647 Joined: 22-July 05 Member No.: 9,713 |
Hmm, this look good, but I am using version 4.1 Will this display a results page? It all looks good, but I don't know how to edit it so I can use it on my site, if someone could take the time to show me a little more about this, I would really appreciate it. It would search my htt://ineed.mxweb.co.uk/bible database.
Also, it looks like this requires me to set up a MySQL database. Is this a code I can pout in a form and it will work as soon as I put it in? As you can see, I am quite lost in this coding. Thanks for the effort, just need a little more help with it. Thanks. |
|
|
|
Apr 21 2006, 04:49 AM
Post
#6
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 27 Joined: 5-April 06 Member No.: 21,363 |
ok, I should have clarified if you knew very much stuff about this. I'll tell you what... I can't do it now (big chem test) but i'll hook you up with a search thing in no time. few questions. are you using mysql? do you have the whole Bible in it? I'm going to need your table structure, the way you built it (rows columns ect..) and.. when dealing with this kind of stuff, you really should use PHP 5, if your running the server, install it, trust me. if your not running a server and you have no choice... I'll see what I can do. But for now please supply with your table structure in your database. If you don't know what this is, research it. I'll code it, no worries.
in Christ, arctic |
|
|
|
Apr 21 2006, 07:17 PM
Post
#7
|
|
|
Never alone with Christ ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 647 Joined: 22-July 05 Member No.: 9,713 |
What is your email? I will send a zip folder with all the stuff in it. I can't use PHP 5. And I would prefer not to use a mysql. The place to search will be http://inneed.mxweb.co.uk/bible. That is what I will search. I will send you the blank zip folder, because the bible is not in it yet. Thank you SO much for your time, this will be a huge help. Do you have a site, I wil be linking to it if you do. this is great. And really appreciate the time you are spending on this. Thank you!
|
|
|
|
May 15 2006, 12:38 AM
Post
#8
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 141 Joined: 25-April 06 Member No.: 22,477 |
I can't use PHP 5. And I would prefer not to use a mysql. I see your Bible is not up yet. Since you would rather not use mySQL and want it to be completely searchable then I would recommend going to The PHPBible Project website and take a look at Alex Markley's PHPScripture bible study tool. It seems to fit all your needs perfectly and it is GPL'ed. I hope this is helpful. |
|
|
|
May 15 2006, 01:50 AM
Post
#9
|
|
|
Never alone with Christ ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 647 Joined: 22-July 05 Member No.: 9,713 |
Okay thanks. This looks great. I will use this. It look easy. Thanks. Yeah I want to put it on, and it looks like it will work great. I just needed something where people could search the Bible and stuff. It is the one addition to my site I REALLY wanted to make, because as my traffic increases, I want to be able to share the Bible, as well as other services too. And the Bible was that one part that was most important. Now I have it. Thanks again!
|