[PHP-DB] regular expression and exact word search...

2002-11-07 Thread BAROILLER Pierre-Emmanuel
Hi!

does someone know how to find an exact word in a content with html tags ?
I'm using a regexp like this :

$searchRegEx = "'\b".$word_search."\b'msi";

to get boundary word results, but... if the searched word is  like 'word or
word. or anything else, the
regular expression doesn't work..

if I remove the \b , I've got all words ( but without bound...)

Any idea?
(the big problem is I'm higlighting found sentences, and .. if the searched
word is part of an html tag, it's very auwfull... )




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




[PHP-DB] Re: losing my session variables

2002-10-29 Thread BAROILLER Pierre-Emmanuel
You only need to add session_start() in your script before storing your data
into the $_SESSION array.
Without session_start(), no session is started by php...

Regards,
P.E. Baroiller

"Seabird" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Hi everyone,
>
> I use a login-script, but for some reason I keep losing my $_SESSION
> variables. Can Anyone tell me why?
>
> Here's my login script:
>
>  if(isset($_POST['submit'])) { // if form has been submitted
>  /* check they filled in what they were supposed to and authenticate */
>  if(!$_POST['uname'] | !$_POST['passwd']) {
>   print '
> 
>maxlength="8">
>name="passwd">
>   
>   
>   please fill in the required
> fields.
>   
> ';
>  }
>  // authenticate.
>  if(!get_magic_quotes_gpc()) {
>   $_POST['uname'] = addslashes($_POST['uname']);
>  }
>  $check = $db_object->query("SELECT username, password FROM users WHERE
> username = '".$_POST['uname']."'");
>  if(DB::isError($check)) {
>   print '
> 
>maxlength="8">
>name="passwd">
>   
>   
>   username doesn\'t exist.  class="header"
> href="javascript:loadPage(\'mainlayer\',null,\'login/signup.php\')">sign
up
> here
>   
> ';
>  }
>  $info = $check->fetchRow();
>  // check passwords match
>  $_POST['passwd'] = stripslashes($_POST['passwd']);
>  $info['password'] = stripslashes($info['password']);
>  $_POST['passwd'] = md5($_POST['passwd']);
>  if($_POST['passwd'] != $info['password']) {
>   print '
> 
>maxlength="8">
>name="passwd">
>   
>   
>   wrong password, try again
>   
> ';
>  }
>
>  // if we get here username and password are correct, register session
> variables and set
>  // last login time.
>  $date = date('m d, Y');
>  $update_login = $db_object->query("UPDATE users SET last_login = '$date'
> WHERE username = '".$_POST['uname']."'");
>  $_POST['uname'] = stripslashes($_POST['uname']);
>  $_SESSION['username'] = $_POST['uname'];
>  $_SESSION['password'] = $_POST['passwd'];
>  $db_object->disconnect();
> ?>
> Welcome 
href="javascript:loadPage('mainlayer',null,'users/edit.php?user= ['username']?>')"> color="white"> href="login/logout.php">Logout
> 
>  }
> else { // if form hasn't been submitted
> ?>
> 
> 
>maxlength="8">
>name="passwd">
>   
>   
>href="javascript:loadPage('mainlayer',null,'login/signup.php')">sign up
> here 
>   
>  }
> ?>
>
> --
> http://seabird.jmtech.ca
>
> Attitude is Everything!
> But Remember, Attitudes are Contagious!
> Is Yours worth Catching
>
>



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




[PHP-DB] Re: Passing string variable to HTML TITLE tag fails within Netscape but works well within IE.

2002-10-16 Thread Baroiller Pierre-Emmanuel

your html is wrong...
you must write :

 

 



With the "head" tag, IE & Netscape will display your title correctly.

Regards.
P.E.
  "Darrian Walker" <[EMAIL PROTECTED]> a écrit dans le message de news: 
01c274b9$2a10a1a0$[EMAIL PROTECTED]
  Passing string variable to HTML TITLE tag fails within Netscape but work
  well within IE.

  I have a single page consisting of inventory items to be sold. When an item
  is selected, it passes the product name to a DETAIL page as part of the
  TITLE tag for the DETAIL page. My problem is: Netscape does not like the
  SPACES between the text and refuses to display the DETAIL page.

  Initially, I thought there might be some way to parse the string and add the
  ascii code for SPACE, but I wasn't sure if I was on the right track. Does
  anyone have a proven solution to this problem?

  I thought the pseudo code might look something like this:
   

   

   
   
  







[PHP-DB] file upload and php (Not a begginer question!)

2002-10-15 Thread Baroiller Pierre-Emmanuel

Hi,

everyone know how to upload files from the browser to your web server using
multipart-form method with move_downloaded_file() php function.

But... It's a slow method for multiple files & huge files transfert.

I'm currently working on a big photo album tool, and I want to provide user
the ability to upload a lot of jpeg files in one time...
The big problem with form is it's too slow...

Does anyone know how to by-pass this ( with java or other tools )?



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