Designing a website in Php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
singh
Forum Newbie
Posts: 3
Joined: Tue Jan 20, 2004 1:27 am

Designing a website in Php

Post by singh »

Hi guys,
Last edited by singh on Fri Jan 23, 2004 11:01 am, edited 1 time in total.
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

SEA[RCH

Post 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 ,

Code: Select all

strip_tags()
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.
?>
singh
Forum Newbie
Posts: 3
Joined: Tue Jan 20, 2004 1:27 am

You're sort of wrong

Post 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].
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

.

Post 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.
User avatar
Dr Evil
Forum Contributor
Posts: 184
Joined: Wed Jan 14, 2004 9:56 am
Location: Switzerland

Post 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
Post Reply