[PHP] PHP search function for MySQL db

2002-08-22 Thread Kristoffer Strom

I've set up a mysql db to store all news updates at our site and I'm
thinking about setting up a search function so our visitors can search the
news db after specifics words or strings.
Is there somewhere some nice place that have posted a
change-some-variables-then-its-ready-to-go PHP file some where ? Or do I
have to start all from scratch ?

/Kris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Problem with echo

2002-08-11 Thread Kristoffer Strom

Works like a charm, thx

/Kris

Bas Jobsen [EMAIL PROTECTED] wrote in message
02081115573503.02483@bjobsen">news:02081115573503.02483@bjobsen...
 Op zondag 11 augustus 2002 16:42, schreef Kristoffer Strom:
  Got a problem when echo:ing a variable containing alot of text.
  When echoing it backslashes (\) every apostrophe (') and quote ().
  This I don't like.
  And I can't use HTMLSPECIALCHARS or HTMLENTITIES since the text has alot
of
  html tags that I want to keep intact.
 
  /Kris

 echo stripslaches($var);



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] How to create basic LOGIN procedure

2002-08-10 Thread Kristoffer Strom

This PHP stuff is still pretty new to me (still prefer IBM's NetData), so I
need help to create a login procedure for a website.
The point being to make sure only authenticated people can access the admin
pages and post/edit news items and stuff. Should be simple, huh?

Anyways, the three objectives are:
1. Login that checks the username and password with a user defined table in
a MySQL database. Not actual authentication for the database!
2. Store the username and load the e-mail for that user from that table and
store them both as a session variable.
3. Make sure that none of the pages in that directory works unless you're
athenticated

Help? Is there some ready function for all of this that I haven't found?
So far I've only run across the actual database authentication, but I don't
wanna add users to the database.

/Kristoffer (from www.NataliePortman.com)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How to create basic LOGIN procedure

2002-08-10 Thread Kristoffer Strom

Found it:
http://www.webmasterbase.com/article/319/95

Thanx!

One more problem, then we're ready to go

/Kris

 Check out Kevin Yank's article restricting page access with php  mysql
 (or something like that!) on webmasterbase.com / sitepoint.com.

 Justin French

 on 10/08/02 7:19 PM, Kristoffer Strom ([EMAIL PROTECTED]) wrote:

  This PHP stuff is still pretty new to me (still prefer IBM's NetData),
so I
  need help to create a login procedure for a website.
  The point being to make sure only authenticated people can access the
admin
  pages and post/edit news items and stuff. Should be simple, huh?
 
  Anyways, the three objectives are:
  1. Login that checks the username and password with a user defined table
in
  a MySQL database. Not actual authentication for the database!
  2. Store the username and load the e-mail for that user from that table
and
  store them both as a session variable.
  3. Make sure that none of the pages in that directory works unless
you're
  athenticated
 
  Help? Is there some ready function for all of this that I haven't found?
  So far I've only run across the actual database authentication, but I
don't
  wanna add users to the database.
 
  /Kristoffer (from www.NataliePortman.com)




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Converting datestamp to text?

2002-08-10 Thread Kristoffer Strom

In my MySQL db I have a date-field on every entry looking like this :
2002-08-10
When presented on a PHP page, I want it converted to Saturday, Augusth
10th, 2002.

How do I achieve that? I've been playing around with the date-command and
strtotime-command but haven't achieved it.

Help please.

/Kris




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Tried that..

2002-08-10 Thread Kristoffer Strom

I've tried that, but as usual rtfm doesn't help me. I need concise examples
:(

How would I write this basic select query to get the date in my format
(Saturday, August 10th, 2002)?
SELECT datum FROM news_items
(where datum is the date-stamp in -MM-DD format)

I've tried the combo's I can think of and still get nothing on the other
side...

/Kris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Newbie question about SQL result formatting

2002-08-09 Thread Kristoffer Strom

Ok, this is totally newbie but I just started messing around with PHP after
programming IBM's NetData for a while.

My first big problem I haven't been able to solve myself is how to format
the result of an SQL query into HTML code.
In the (MySQL) database, I have one field for very long texts. One test
entry looks like this:
--
test

   test

 test
--
But when printing the result, even with HTMLENTITIES and HTMLSPECIALCHARS,
just looks like:
-
test   test   test
-

How do I convert the result to HTML code, I especially want the linebreaks!!

The answer is probably very simple

/Kris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Newbie question about SQL result formatting

2002-08-09 Thread Kristoffer Strom

There we go :)

If there's any consolation, you just helped NataliePortman.com become a
better website :)

Thx

/Kris

Philip Hallstrom [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 see nl2br().  You might also want to convert spaces to nbsp;'s

 On Fri, 9 Aug 2002, Kristoffer Strom wrote:

  Ok, this is totally newbie but I just started messing around with PHP
after
  programming IBM's NetData for a while.
 
  My first big problem I haven't been able to solve myself is how to
format
  the result of an SQL query into HTML code.
  In the (MySQL) database, I have one field for very long texts. One test
  entry looks like this:
  --
  test
 
 test
 
   test
  --
  But when printing the result, even with HTMLENTITIES and
HTMLSPECIALCHARS,
  just looks like:
  -
  test   test   test
  -
 
  How do I convert the result to HTML code, I especially want the
linebreaks!!
 
  The answer is probably very simple
 
  /Kris
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php