Page 1 of 1
Designing a website in Php
Posted: Tue Jan 20, 2004 1:27 am
by singh
Hi guys,
SEA[RCH
Posted: Tue Jan 20, 2004 11:21 am
by ol4pr0
Well..
you could use $_REQUEST['term']
for example you could use something like this
example;
if you have a html page you must add this between the <body> tags of that page.
Code: Select all
echo "
<body>
<!-- search-start -->
// youre html page
<!-- search-end-->
</body>";
Than to match the search term against just like title, author inside the html comments, change the $body_regex to:
Code: Select all
$body_regex ='#<!--search-start -->(.*' . preg_quote($_REQUEST['term'], '#').'.*)<!--search-end -->#Sis';
If you dont want to search term to match text thats inside HTML or PHP tags in youre pages, add a call to ,
to the code
that load the contents of the file for searching.
Hope this will give you enough info on what to look for.. or atleast 1 solution on how to do it.
?>
You're sort of wrong
Posted: Wed Jan 21, 2004 9:58 am
by singh
I am not sure if you read my post carefully,
I am either looking for a website/tutorial that can help me
work on this assignment. Can you help me what that, because
you just splurt out code [which I don't get].
.
Posted: Wed Jan 21, 2004 10:12 am
by ol4pr0
Well lets see, i am still strugling with php coding myself however...
for accessing a search on a database you could start with
http://www.mysql.com
since that is really what you are asking.
to have you update databases you could start reading up on
CREATING tables and INSERT INTO& UPDATE where for inserting new information into youre database and updating it. if you will install the mysql, inside youre mysql install dir you will find a manual.html.
Hope that something better to start on.
Posted: Wed Jan 21, 2004 10:44 am
by Dr Evil
The thing is: you posted your request in the PHP-Code section. So code flies around very fast in this section.
You could look around a few tutorial/script sites such as:
http://www.hotscripts.com/PHP/index.html
http://www.onlyphp.com/index.php
http://www.phpfreaks.com/
I started with hotscripts.
Dr Evil