Re: [PHP] how to force a refresh?

2003-03-13 Thread - Edwin
 There is an HTML solution, but I can't remember offhand what it 
 is.

meta http-equiv=refresh content=1;url=http://where2go.after; 
/

?

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



[PHP] session variables

2003-03-13 Thread Shaun van den Berg
Hi,

Is it wise or wrong to put long strings into a session variable ? Is it
better to keep the values short ?

Thanks
Shaun

--
Novtel Consulting
Tel: +27 21 9822373
Fax: +27 21 9815846
Please visit our website:
www.novtel.co.za



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



Re: [PHP] how to force a refresh?

2003-03-13 Thread - Edwin
Or, just:

  meta http-equiv=refresh content=1 /

...if the same page.

Note: 1 is the number of seconds...

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



Re: [PHP] php errors while displaying database fields

2003-03-13 Thread Ernest E Vogelsinger
At 23:30 12.03.2003, Boulytchev, Vasiliy said:
[snip]
I have searched the archives, and have found nothing on these errors
I am getting.  Here is the apache error logs capture:

PHP Notice:  Undefined index:  REMOTE_ADDR in
/home/www/customflagcompany/phpshop/modules/admin/lib/ps_session.inc on
line 39
PHP Notice:  Undefined variable:  page in
/home/www/customflagcompany/phpshop/bin/index.php3 on line 53
[snip] 

These are notices only, not errors (notices being the least severe level of
issues PHP may warn you about). You may adjust the error reporting level
with the error_reporting() function, or the corresponding setting in the
php.ini file.

Undefined index: this means that the associative array doesn't have  an
index field with a particular name defined. PHP will return null in this case.
Workaround: if (array_key_exists('REMOTE_ADDR'))...

Undefined variable: the variable you're using has not been defined and
never been assigned to. PHP will return null in this case.
Workaround: if (isset($page))...


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] RE: what is session_name?

2003-03-13 Thread Uttam
it is the name of cookie variable which stores the unique session ID string.

suppose you set session.name to SESSID in php.ini then a cookie variable
named SESSID will be sent to client in which session ID string will be
stored by client browser.  If URL is used to propogate session variable then
this is the name of GET variable which stores session ID string.

e.g.:
SESSID=sess_ab80d8a12221d9bf03f4e830c7e4fb74

The value of this cookie variable (unique session ID string) is used to
restore related session variables in the called script.

regards,

-Original Message-
From: Joseph Bannon [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 10:29
To: [EMAIL PROTECTED]
Subject: what is session_name?


I read the description on php.net, but what is
session_name really used for?

Thanks,

Joe.

__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com


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



Re: [PHP] Force refresh of graphic - how?

2003-03-13 Thread Ernest E Vogelsinger
At 23:33 12.03.2003, Justin French said:
[snip]
Put this code in your shared library of functions (adapted from manual,
untested):
?
function randNumber($min=1000,$max=9)
{
// build a seed
list($usec, $sec) = explode(' ', microtime());
$seed = (float) $sec + ((float) $usec * 10);

// seed random generator
srand($seed);

// return random number
return rand($min,$max);
}
?
[snip] 

May I?

It's usually not a good idea to re-seed the randum number generator during
a single script instance, as this might use the same seed more than once,
resulting in the identical random sequence...

To avoid reseeding, you could e.g. use a static variable in your
randNumber() function:

function randNumber($min=1000,$max=9)
   {
static $is_seeded = false;
if (!$is_seeded) {
$is_seeded = true;
   // build a seed
   list($usec, $sec) = explode(' ', microtime());
   $seed = (float) $sec + ((float) $usec * 10);
   // seed random generator
   srand($seed);
}
...

I prefer to add a string generated by uniqid(), such as
img src=myimg.jpg?r=?php echo uniqid('',true);?

uniqid() uses the entropy generated by the opsys random device (if
available) in an attempt to make this truly random.




-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] Re user Identifying

2003-03-13 Thread Peter Goggin
My site uses shopping baskets to record what the user wants to but. These
records are stored in a database against the user.   This requires the user
to register and log onto the site. Is it possible to avoid this by the use
of cookies or some other method?

Is it  possible to use both methods in parallel. so that the user can choose
either method. i.e. choose to register as a customer, or use the default id
(perhaps via the cookie) and enter customer information at the time of
placing the order?


Any advice on the best way of doing this would be greatly appreciated.
Regards

Peter Goggin


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



Re: [PHP] Follow-up to Hacker problem

2003-03-13 Thread Ernest E Vogelsinger
At 23:42 12.03.2003, Pag said:
[snip]
   Your tips were nice, guys, thanks a lot. I tried a few things and i 
decided to go for making all the checks server side, cant go safer than that.
   Just have a doubt on one of the checks, at least so far.
   I have a check for long words, because the shoutbox is in a IFRAME,
 so if 
someone posted a long word, the infamous horizontal scroll bar would 
appear. How can i check for long words on a string and remove them before 
they get written on the DB?
[snip] 

Check the archives - within the last 2 days there was a thread about
breaking up long words to avoid inappropriate posts to clutter the page layout.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] removing appended chars - please help, quite urgent

2003-03-13 Thread Adriaan Nel
Hi every1,

I need to update records in a mysql dbase, from a .csv file, everything
works fine, but the index column, $npr_nr from below sometimes has a space
at the end, this causes the dbase index not to match this one, therefore
this record isn't updated.  Do any1 know how I can check for spaces here,
and remove them if present

Please help, this is quite urgent.
Thanks
Adriaan


/*++
++
+ checking for new records, not yet in dbase...
++

*/
$lines = file ('../includes/new1.csv');

foreach ($lines as $line_num = $line) {
list($npr_nr,$npr_exvat,$npr_desc) = explode(,,$line);

$query = SELECT product_id, product_nr from products;
$currentprs = mysql_query ($query, $db_connection) or die (mysql_error());
while (list ($currentprs_id, $currentprs_nr) = mysql_fetch_row
($currentprs))
{
if ($npr_nr == $currentprs_nr) {
   mysql_query (DELETE from tmpprods where product_nr =
'$currentprs_nr',$db_connection) or die (mysql_error());
   } // end if
} // end while
} // end foreach

/*++
++
+ Finish checking for new records, not yet in dbase...
+++

*/



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



Re: [PHP] removing appended chars - please help, quite urgent

2003-03-13 Thread Ernest E Vogelsinger
At 09:59 13.03.2003, Adriaan Nel said:
[snip]
I need to update records in a mysql dbase, from a .csv file, everything
works fine, but the index column, $npr_nr from below sometimes has a space
at the end, this causes the dbase index not to match this one, therefore
this record isn't updated.  Do any1 know how I can check for spaces here,
and remove them if present
[snip] 

have a look at trim()


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] include dosn't after Provider-Change

2003-03-13 Thread Oliver Witt
Hallo,

after a Provider-Change my counter-script dosn't work again.

My entry is: ?php include (counter/rcounter.php) ; ? in an
html-document.
Is there an Error inside?
My server show no error-messages...

Thanx for Help.

Olly


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



Re: [PHP] removing appended chars - please help, quite urgent

2003-03-13 Thread - Edwin
Hi,

Adriaan Nel [EMAIL PROTECTED] wrote:

 Do any1 know how I can check for spaces here,
 and remove them if present

  http://www.php.net/manual/en/function.trim.php ?
  http://www.php.net/manual/en/function.rtrim.php ?
  http://www.php.net/manual/en/function.lrim.php ?

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



Re: [PHP] include dosn't after Provider-Change

2003-03-13 Thread Leif K-Brooks
You can't execute PHP from an HTML page.  My guess is that your old 
provider had PHP parsing enabled for .html files, shich most don't.

Oliver Witt wrote:

Hallo,

after a Provider-Change my counter-script dosn't work again.

My entry is: ?php include (counter/rcounter.php) ; ? in an
html-document.
Is there an Error inside?
My server show no error-messages...
Thanx for Help.

Olly

 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


RE: [PHP] Re: Your script possibly relies on a session side-effect which existed until PHP 4.2.3

2003-03-13 Thread Rudolf Visagie
I would have thought a genius would be able to spell geniuses.

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 2:46 AM
To: chris; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Your script possibly relies on a session
side-effect which existed until PHP 4.2.3


on 13/03/03 11:23 AM, chris ([EMAIL PROTECTED]) wrote:

 Now, if any other geniouses would like to help me (or any other frustrated
 4.3.1 users) figure out a solution for this vague error message, don't
 follow Justin's very unhelpful footsteps.

Well I'll certainly never make the mistake of attempting to help you again.

People make mistakes.  I sincerely apologise for ruining your whole day by
not reading the rest of your thread.  Shsh.


Justin


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



RE: [PHP] Re: Your script possibly relies on a session side-effect which existed until PHP 4.2.3

2003-03-13 Thread Niklas Lampén
LOL! :D

-Original Message-
From: Rudolf Visagie [mailto:[EMAIL PROTECTED] 
Sent: 13. maaliskuuta 2003 10:56
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Your script possibly relies on a session side-effect
which existed until PHP 4.2.3


I would have thought a genius would be able to spell geniuses.

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 2:46 AM
To: chris; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Your script possibly relies on a session side-effect
which existed until PHP 4.2.3


on 13/03/03 11:23 AM, chris ([EMAIL PROTECTED]) wrote:

 Now, if any other geniouses would like to help me (or any other 
 frustrated 4.3.1 users) figure out a solution for this vague error 
 message, don't follow Justin's very unhelpful footsteps.

Well I'll certainly never make the mistake of attempting to help you again.

People make mistakes.  I sincerely apologise for ruining your whole day by
not reading the rest of your thread.  Shsh.


Justin


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

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail. For
more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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



[PHP] PHP/HTML table layout?

2003-03-13 Thread Bev
Is there any simple way to stop the Cells of a Table from Moving, say for a
simple table I want the first column to be always fixed at 100 pixels(col A)
and the second to be fixed at 500(col B).

Thing is though, I have specified pixels for each column BUT they still let
me type on past the fixed amounts I specified.

 I wanted to fixed sized cells and that when I type do not increase/decrease
the surronding cells.Can this be done?

Bev





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



Re: [PHP] PHP/HTML table layout?

2003-03-13 Thread Leif K-Brooks
This has absolutley nothing to do with PHP.  I believe that it will stay 
if you set the width with CSS, but no promises.

Bev wrote:

Is there any simple way to stop the Cells of a Table from Moving, say for a
simple table I want the first column to be always fixed at 100 pixels(col A)
and the second to be fixed at 500(col B).
Thing is though, I have specified pixels for each column BUT they still let
me type on past the fixed amounts I specified.
I wanted to fixed sized cells and that when I type do not increase/decrease
the surronding cells.Can this be done?
Bev





 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP] include dosn't after Provider-Change - I have it!

2003-03-13 Thread Oliver Witt
After the Tip: You can't execute PHP from an HTML page. My guess is that
your old provider had PHP parsing enabled for .html files, shich most don't.

Now I have created an .htaccess in the home-folder with: AddType
application/x-httpd-php .php .php4 .html

It works...

Thanxs!

Olly

-Ursprüngliche Nachricht-
Von: Oliver Witt [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 13. März 2003 10:03
An: [EMAIL PROTECTED]
Betreff: [PHP] include dosn't after Provider-Change


Hallo,

after a Provider-Change my counter-script dosn't work again.

My entry is: ?php include (counter/rcounter.php) ; ? in an
html-document.
Is there an Error inside?
My server show no error-messages...

Thanx for Help.

Olly


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



[PHP] Is there any reason...

2003-03-13 Thread Leif K-Brooks
That replies on this list go to the person who originally posted the 
message by default?  It seems to me that the reply-to header should be 
set to the list, or is it not possible with the mailing list system this 
list uses?

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


Re: [PHP] Threading objects

2003-03-13 Thread alex
As i rember apache can not handle a threading php ... if you whant threads
you need to run php from command prompt in a linux/unix enviroment(windows
dosen't support threads i I'm not wrong).Look for a threads project in 
PEAR(http://pear.php.net/).
Hope it helps,
Best regards,
Alex.
 Is it possible to some how thread a php script threw apache. There has
 to be something you can do, it seems there is always something you can
 do :) What I want is the following.
 I administer a mailing list that has a few hundred thousand subscribed
 recipients.
 I've written a script that runs threw the DB and validates the email
 address.
 First by format then by connecting to the mail server.
 This script takes way to long to run as it has to do one at a time. I
 want to some how thread this so it can be validating multiple emails at
 a time.
 Please excuse my ignorance on the subject my web programming experience
 is rather limited.

 Thanks

 Kris



 - Original Message -
 From: Rasmus Lerdorf [EMAIL PROTECTED]
 To: Kris [EMAIL PROTECTED]
 Cc: W. Enserink [EMAIL PROTECTED]; PHP List
 [EMAIL PROTECTED] Sent: Thursday, March 13, 2003 1:04 AM
 Subject: Re: [PHP] Threading objects


  All I'm really asking is how do you initiate threading with PHP? A
  small example would be nice

 You don't.  This is a web scripting language, not Java.

 -Rasmus

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




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



Re: [PHP] removing appended chars - please help, quite urgent

2003-03-13 Thread Adriaan Nel
Thanks, I tried the trim function and it solves most of my problems, but I
still get duplicatesit's so weird, could any1 please just quickly
check through these lines of code and tell me if you see anything thats
wrong

The records in the dbase are uploaded with another php file, which does just
that, no problem over therethis problem is given even if I upload the
same file to the dbase, it's then supposed to not display anything on
screen, cause all records exists allready, but it displays a whole lists of
supposedly new records...??

Here is the code that's giving the problem:

/*++
++
+ checking for new records, not yet in dbase...
++

*/
$lines = file ('../includes/new1.csv');

foreach ($lines as $line_num = $line) {
list($npr_nr,$npr_exvat,$npr_desc) = explode(,,$line);

$npr_nr = trim($npr_nr,  );

$query = SELECT product_id, product_nr from products;
$currentprs = mysql_query ($query, $db_connection) or die (mysql_error());
while (list ($currentprs_id, $currentprs_nr) = mysql_fetch_row
($currentprs))
{
if ($npr_nr == $currentprs_nr) {
   mysql_query (DELETE from tmpprods where product_nr =
'$currentprs_nr',$db_connection) or die (mysql_error());
   } // end if
} // end while
} // end foreach

/*++
++
+ Finish checking for new records, not yet in dbase...
+++

*/


Thanks again
Adriaan


- Edwin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 Adriaan Nel [EMAIL PROTECTED] wrote:

  Do any1 know how I can check for spaces here,
  and remove them if present

   http://www.php.net/manual/en/function.trim.php ?
   http://www.php.net/manual/en/function.rtrim.php ?
   http://www.php.net/manual/en/function.lrim.php ?

 - E

 __
 Do You Yahoo!?
 Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/




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



Re: [PHP] PHP/HTML table layout?

2003-03-13 Thread - Edwin
Hi,

Bev [EMAIL PROTECTED] wrote:

[snip]
  I wanted to fixed sized cells and that when I type do not 
 increase/decrease the surronding cells.Can this be done?
[/snip]

Try having your table with a fixed width as well:

Ex.

  table width=600

then with your columns:

  td width=100/td
  td width=500/td

I think you also have to take note of your cellspacing and 
cellpadding... (Default is 3, I think.)

And, yes, this has nothing to do with PHP ;)

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



Re: [PHP] removing appended chars - solved!!! Thanks

2003-03-13 Thread Adriaan Nel
Thanks, I solved it


Adriaan Nel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Thanks, I tried the trim function and it solves most of my problems, but I
 still get duplicatesit's so weird, could any1 please just quickly
 check through these lines of code and tell me if you see anything thats
 wrong

 The records in the dbase are uploaded with another php file, which does
just
 that, no problem over therethis problem is given even if I upload the
 same file to the dbase, it's then supposed to not display anything on
 screen, cause all records exists allready, but it displays a whole lists
of
 supposedly new records...??

 Here is the code that's giving the problem:


/*++
 ++
 + checking for new records, not yet in dbase...
 ++


 */
 $lines = file ('../includes/new1.csv');

 foreach ($lines as $line_num = $line) {
 list($npr_nr,$npr_exvat,$npr_desc) = explode(,,$line);

 $npr_nr = trim($npr_nr,  );

 $query = SELECT product_id, product_nr from products;
 $currentprs = mysql_query ($query, $db_connection) or die (mysql_error());
 while (list ($currentprs_id, $currentprs_nr) = mysql_fetch_row
 ($currentprs))
 {
 if ($npr_nr == $currentprs_nr) {
mysql_query (DELETE from tmpprods where product_nr =
 '$currentprs_nr',$db_connection) or die (mysql_error());
} // end if
 } // end while
 } // end foreach


/*++
 ++
 + Finish checking for new records, not yet in dbase...
 +++


 */


 Thanks again
 Adriaan


 - Edwin [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hi,
 
  Adriaan Nel [EMAIL PROTECTED] wrote:
 
   Do any1 know how I can check for spaces here,
   and remove them if present
 
http://www.php.net/manual/en/function.trim.php ?
http://www.php.net/manual/en/function.rtrim.php ?
http://www.php.net/manual/en/function.lrim.php ?
 
  - E
 
  __
  Do You Yahoo!?
  Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/
 





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



RE: [PHP] session variables

2003-03-13 Thread John W. Holmes
 Is it wise or wrong to put long strings into a session variable ? Is
it
 better to keep the values short ?

The more data you put into your session, the more data that has to be
read and written to a file on your server each time someone accesses a
page. More data is going to slow things down. 

If it's your only option, then use it. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] sessions garbadge

2003-03-13 Thread John W. Holmes
 My gc_maxlifetime = 3600 (1 hour) and my probability = 100 , just for
 testing . When i create a session on my site and i dont log out , the
 session var will still remain on the server , ok , after an hour (not
 exactly an hour) , when i surf the site , the collector destroys that
var
 on
 the server (linux server) ! That is how it should work ! But when i
create
 a
 session at say 23:36 , the session var will still be on the server at
8:16
 (after the carbadge collector came around) , why does this happen ,
does
 php
 work in a 12 cicle only , or what is wrong ?

How do you know the garbage collector was started? There is a (by
default) 1% chance that upon each request to your server, garbage
collection will be initiated. So, even though you have your time limit
set for an hour, it could be longer than that before the actual 1%
chance is triggered. It could take quite a while longer if there is not
a whole lot of traffic to your site. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] Pagination Part 2

2003-03-13 Thread Ford, Mike [LSS]
 -Original Message-
 From: conbud [mailto:[EMAIL PROTECTED]
 Sent: 12 March 2003 19:12
 
 
 Hi, Ive been trying to get this to work but I keep getting this error
 
 Parse error: parse error, unexpected $ in 
 /home/conbud/nrlug/test3.php 
 on line 72
 
 line 72 is just the ending php bracket,

Well, this is a pretty cryptic PHP error message -- $ in this context just means end 
of file (similar to its use in preg/ereg patterns!).  The most likely cause of this 
is that you have an unmatched opening brace {.

  heres what I got:
 
 ?php
 
  @mysql_connect(localhost, root, boing_boing) or 
 die(ERROR--CAN'T 
 CONNECT TO SERVER);
  @mysql_select_db(nrlug) or die(ERROR--CAN'T CONNECT TO DB);
 
  $limit= 2;
  $query_count= SELECT lnkname FROM links;
  $result_count= mysql_query($query_count);
  $totalrows= mysql_num_rows($result_count);
 
  if(empty($page))
  $page = 1;
 
 
  $limitvalue = $page * $limit - ($limit);
  $query = SELECT * FROM links LIMIT $limitvalue, $limit;
  $result= mysql_query($query) or die(Error:  . 
 mysql_error());
 
  if(mysql_num_rows($result) == 0)
  echo(Nothing to Display!);
 
  $bgcolor = #E0E0E0; // light gray
 
  echo(table);
 
  while($row = mysql_fetch_array($result)){

brace level: 1

  if($bgcolor == #E0E0E0)
  $bgcolor = #FF;
  else
  $bgcolor = #E0E0E0;
 
  echo(tr bgcolor=.$bgcolor.\ntd);
  echo($row['lnkname']);
  echo(td\n\td);
  echo($row['id']);
  echo(td\n/tr);
  }

brace level: 0

 
  echo(/table);
 
  if($page != '1'){

brace level: 1

  $pageprev = $page--;
 
  echo(a href=\$PHP_SELFpage=$pageprev\PREV/anbsp;);
  }else

brace level: 0

  echo(PREVnbsp;);
 
  $numofpages = $totalrows / $limit;
 
  for($i = '1'; $i = $numofpages; $i++){

brace level: 1

  if($i == $page)
  echo($i.nbsp;);
  else
  echo(a href=\$PHP_SELFpage=$i\$i/anbsp;);
 
 
  if(($totalrows % $limit) != '0'){

brace level: 2

  if($i == $page)
  echo($i.nbsp;);
  else
  echo(a href=\$PHP_SELFpage=$i\$i/anbsp;);
 
  if(($totalrows - ($limit * $page))  '0'){

brace level: 3

  $pagenext = $page++;
 
  echo(a href=\$PHP_SELFpage=$pageprev\NEXT/a);
  }else

brace level: 2

  echo(nbsp; NEXT .$limit);
 
  mysql_free_result($result);
 
 ?

Uh -- brace level is still 2, which means you have 2 unclosed opening braces.  Put 
those in at the appropriate places (and your indentation is pretty suggestive of where 
that is!) and all should be fine.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 


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



RE: [PHP] Re: Your script possibly relies on a session side-effect which existed until PHP 4.2.3

2003-03-13 Thread Ford, Mike [LSS]
 -Original Message-
 From: chris [mailto:[EMAIL PROTECTED]
 Sent: 13 March 2003 00:24
 To: [EMAIL PROTECTED]
 
 1.  Registered globals are off.
 2.  Using super globals ($_SESSION instead of $HTTP_SESSION_VARS)
 3.  Setting via $_SESSION['var'] = $var instead of 
 session_register('var')
 4.  Always calling $_SESSION['var'] instead of $var 
 (registered globals are 
 off, so it really isn't an option, now is it?)
 5.  Unsetting via unset($_SESSION['var']) instead of 
 session_unregister('var')

Well, all of that is exactly what you need to do to avoid the buggy behaviour.  Are 
you using *any* other session_*() calls apart from session_start()?

If not, and you are 101% certain that all your pages are coded in the style you've 
enumerated, then your best bet is just to change the setting of one or both of the 
session.bug_compat_* configure options.  If you only turn bug_compat_warn off, you 
will suppress the warning whilst still retaining the old behaviour (just in case!).  
But if you're sure you're not relying on the buggy behaviour, why not just turn 
bug_compat_42 off?  If you've got it right, your scripts will still work; if not, then 
you should at least have some clues to help you find and fix the erroneous code.

As to why you're still getting the warning, even though your session code appears to 
be safe, I think there's a clue in the first few words of the message itself: Your 
script possibly relies   Note that possibly.  Why the changes you refer to 
should determine whether or not the warning is evoked I have no idea, but something in 
there is triggering it.  Again, if you're sure that that possibly doesn't apply to 
you, just turn off one or both of the configure options.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP] sessions garbadge

2003-03-13 Thread Ford, Mike [LSS]
 -Original Message-
 From: John W. Holmes [mailto:[EMAIL PROTECTED]
 Sent: 13 March 2003 10:24
 
  My gc_maxlifetime = 3600 (1 hour) and my probability = 100 
 , just for
  testing . When i create a session on my site and i dont log 
 out , the
  session var will still remain on the server , ok , after an 
 hour (not
  exactly an hour) , when i surf the site , the collector 
 destroys that
 var
  on
  the server (linux server) ! That is how it should work ! But when i
 create
  a
  session at say 23:36 , the session var will still be on the 
 server at
 8:16
  (after the carbadge collector came around) , why does this happen ,
 does
  php
  work in a 12 cicle only , or what is wrong ?
 
 How do you know the garbage collector was started? There is a (by
 default) 1% chance

Ahem!  Even when poster has reported that ... my probability = 100 ...?

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 


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



Re: [PHP] array_sum help

2003-03-13 Thread Marek Kilimajer
There should not be any problem with zeros, as long as they are in 
array. The warning tells you, you are not passing an array, so there 
must be some broken logic in your code. Try putting print_r($the_array) 
before line 154

Beauford.2002 wrote:

Hi,

I have a mysql database in which some values are loaded into an array - the
problem is that some fields may contain zeros. The problem is the following.
If there happens to be zeros in certain column's (which there will be from
time to time) then I get this error. How do I get around this?
Funny thing about this is I have the exact same thing duplicated on my
Windows PC and it doesn't cause this problem. (the problem one is on Linux
which is the production one). All versions of mysql, PHP, apache are the
same on both. Note that as soon as I put in a number it works fine.
   Warning: The argument to array_sum() should be an array in
/usr/local/apache/htdocs/main/viewstats.php on line 154
TIA



 



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


Re: [PHP] what is session_name?

2003-03-13 Thread David T-G
Joe --

...and then Joseph Bannon said...
% 
% I read the description on php.net, but what is
% session_name really used for?

Uttam's answer is technically correct, but it may not really provide the
info you seek.  [That's not meant as a slight upon Uttam, of course; it's
a very good and thorough answer.]

It's a way to name your session, and in particular it's what people will
see when their browser says this site would like to set a cookie or
when they peruse their cookie collections.  It can be a way to better
identify yourself -- particularly for those cases where the visitor might
accept the cookie or might not.


% 
% Thanks,
% 
% Joe.


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Re: PHP Books

2003-03-13 Thread David T-G
Hi, all --

...and then rotsky said...
% 
...
% 'PHP Developer's Cookbook' - Sterling Hughes with contributions by Andrei
% Zmievski (Sams). Still playing with this one. Definitely not for beginners
% as it assumes (IMHO) a fairly well-developed familiarity with PHP concepts
% and procedures and general wirehead argot. But I get the feeling that I'll
% be turning to this one more and more as it is a resource of solutions to
% specific problems.

I have this as well, and I like it but I find it too limited.  That is, I
get some good examples, and they cover a lot of ground, but it's not at
all a reference book.  I'm a perl guy as well, and I compare it to the
Perl Cookbook (which itself covers much more ground than the PHP Dev CB)
rather than a nice fat reference *and* instruction book like Programming
Perl.

I must be  a wirehead, since I hadn't touched PHP when I got the book and
I kept up if not outpaced it as I worked through it :-0


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] RSS

2003-03-13 Thread Sebi

Hi,
Does some one know where I can find a RSS parser exmple?

Tnx


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



Re: [PHP] RSS

2003-03-13 Thread - Edwin
Hi,

Sebi [EMAIL PROTECTED] wrote: 
   
   Hi,
   Does some one know where I can find a RSS parser exmple?

I think you can find one here:

  http://www.google.co.jp/search?q=PHP+RSS+parserie=UTF-8oe=UTF-8hl=
enlr=

;)

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



[PHP] Writing a fileparser

2003-03-13 Thread Alexander Gruber
Hi together,

i´m currently working on a php script to read a txt file into a mysql 
database. but i have several problems i don´t know how to fix.
the file looks like the following example:

category 1
   Data1 ::#:: 27
   Data2 ::#:: 0
   Data3 ::#:: (152)
category 2
   Data1 ::#:: 2b3
   Data2 ::#:: 234
   Data3 ::#:: (1)
the qeuestion i have is how can i parse each line and use the category 
fields as identifier for the tables, the left side of ::#:: as 
identifier for the row´s and the right side as the data. the problem is 
collecting the several pieces of data in different variables.

perhaps someone can give me some help or a url where i can find some 
documentation.

many thanks!

alex

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


Re: [PHP] Writing a fileparser

2003-03-13 Thread - Edwin
Hi,
(B
(BAlexander Gruber [EMAIL PROTECTED] wrote: 
(B Hi together,
(B 
(B i$B%((Bm currently working on a php script to read a txt file into a mysql 
(B database. but i have several problems i don$B%((Bt know how to fix.
(B the file looks like the following example:
(B 
(B category 1
(B Data1 ::#:: 27
(B Data2 ::#:: 0
(B Data3 ::#:: (152)
(B 
(B category 2
(B Data1 ::#:: 2b3
(B Data2 ::#:: 234
(B Data3 ::#:: (1)
(B 
(B the qeuestion i have is how can i parse each line and use the 
(B "category" fields as identifier for the tables, the left side of ::#:: 
(B as identifier for the row$B%((Bs and the right side as the data. the 
(B problem is collecting the several pieces of data in different 
(B variables.
(B
(BWell, one way you could do this is:
(B1. Use file() to read your txt file and the contents into an array.
(B2. Loop thru the array using foreach()
(B3. While you're looping, check each value, perhaps using strstr(),
(B   if it has "category" then assign it as identifier. If not, you're 
(B   probably on the row:data line so use explode() to explode the value 
(B   into two parts, using "::#::" as your separator. Assign them again 
(B   accordingly.
(B
(BThen, after that, you can now do something with the variables...
(B
(B perhaps someone can give me some help or a url where i can find some 
(B documentation.
(B
(BCheck the manual for those functions.
(B
(BNOTE: There must be some other, more elegant, way of doing it but this 
(Bis just to give you an idea.
(B
(BHTH,
(B
(B- E
(B
(B__
(BDo You Yahoo!?
(BYahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] how to force a refresh?

2003-03-13 Thread Michael Sims
On Thu, 13 Mar 2003 02:25:57 -0800, you wrote:

Ok, well I have a form that uploads images, but of course the problem is, is
that IE caches the uploaded images. The only way to clear the cache is to
refresh, but that isn't a very user friendly approach. I've tried the
following header tags:

You can force a refresh of the same page by using a header redirect:

header('Location: '.$_SERVER['PHP_SELF']);

Also, if the problem is images being cached, I've seen some people use
this trick:

img src=/path/to/image.jpg?uniq=?=urlencode(md5(microtime()))?

Basically you pass a bogus URL parameter after the image name that is
different each time and this should force IE to download it again.  I
haven't had a chance to try this myself, but I believe it should
work...

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



[PHP] Dinamic Object Creation

2003-03-13 Thread Piero B. Contezini
Hello, 
I'm developing a project where i need to access some XML files as
objects, i've seen the dom_xmltree function but it makes me a tree of
arrays of objects, too complicated to manipulate and hard to find the
content within the object.
Anyone have manipulated dinamic objects? I am reading the manual and
doesnt say anything about how to create them, i'm using the normal way
but when i try to create child objects it simple dont work.
Let me show:

$name = $node-tagname 

$children = $node-children();

while($child = array_shift($children)) {

$obj-$name = $child-content;

}

This works fine, but when i try to create a object with a xml like this

?xml version=1.0 ?

config
database
host10.0.9.250/host
port3306/port
usernameroot/username
password/password
dblogs/db
/database
/config

The resulting object would be something like this

stdClass Object
(
[config] = stdClass Object
(
[database] = stdClass Object
(
[host] = 10.0.9.250
[port] = 3306
)
)

)

But i just can't create the empty object config, because there is no
class for it, when i try just to
$obj = $obj-$name;

Php don't create the new object.

Can anyone tell me how to do this?


Piero


It occurred to me by intuition, and music was the driving force behind
that intuition. My discovery was the result of musical perception. 
Albert Einstein 


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



[PHP] Can't seem to be able to do a get request

2003-03-13 Thread Mathieu Dumoulin
I got this script i wish to run like it was a seperate thread on the server
cause i can't run anything with a crontab but i can't seem to do a valid GET
request thru fsockopen. If anyone can help me please.


$fp = fsockopen (sandbox.lhjmq.xl5.net, 80);
if ($fp) {

fputs ($fp, GET /lang_fr/index.php HTTP/1.1);
while (!feof($fp)) echo fgets ($fp,128);
fclose ($fp);
}

I run the script from the web but nothing happens. If i run it also with the
real URL i want to get (I cannot show this url for security reasons) my
processor and mysql process should go up to 80% each for like 40 seconds and
my top command in shell would show it, but it's not happenning. Now i
tried index.php and still nothing!

Please help me out

Mathieu Dumoulin



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



[PHP] http-https-http redirection causes browser to show alert dialog

2003-03-13 Thread Jean-Christian Imbeault
I have a login page with a form where users enter there login and
password. The form's action is https://mysite.com/login.php;.
login.php authenticates the user and if the authentication is successful
it ends with a:
header(Location: http://mysite.com/welcome.html?a=bc=etc...;);

The problem I am facing is that the flow of event is:

http - https - http

and this causes IE and Netscape to put up an alert box telling
users that they are leaving a secured site.
The IE messages is:

You are about to be redirected to a connection that is not secure. The
information you are sending to the current site might be retransmitted
to a non-secure site. Do you wish to continue?
I only want to use HTTPS for the parts of my web site that actually need
  it and nothing else. The way I have things set up now I receive the
data through HTTPS, use it, and then put the user back on a regular
HTTP connection since I don't need https anymore. But I get browsers
throwing up these warnings 
Is there a way around this? The messages are annoying at best and
probably scary to users ...
Thanks,

Jc

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


Re: [PHP] http-https-http redirection causes browser to show alert dialog

2003-03-13 Thread CPT John W. Holmes
 I have a login page with a form where users enter there login and
 password. The form's action is https://mysite.com/login.php;.

 login.php authenticates the user and if the authentication is successful
 it ends with a:

 header(Location: http://mysite.com/welcome.html?a=bc=etc...;);

 The problem I am facing is that the flow of event is:

 http - https - http

 and this causes IE and Netscape to put up an alert box telling
 users that they are leaving a secured site.

 The IE messages is:

 You are about to be redirected to a connection that is not secure. The
 information you are sending to the current site might be retransmitted
 to a non-secure site. Do you wish to continue?

 I only want to use HTTPS for the parts of my web site that actually need
it and nothing else. The way I have things set up now I receive the
 data through HTTPS, use it, and then put the user back on a regular
 HTTP connection since I don't need https anymore. But I get browsers
 throwing up these warnings 

 Is there a way around this? The messages are annoying at best and
 probably scary to users ...

You'll have to output a message on the HTTPS page, like Thank you, click
here to continue, otherwise there's no way around the message. It's a
client side issue, other browsers may or may not do it.

---John Holmes...


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



Re: [PHP] sessions garbadge

2003-03-13 Thread CPT John W. Holmes
   My gc_maxlifetime = 3600 (1 hour) and my probability = 100
  , just for
   testing . When i create a session on my site and i dont log
  out , the
   session var will still remain on the server , ok , after an
  hour (not
   exactly an hour) , when i surf the site , the collector
  destroys that
  var
   on
   the server (linux server) ! That is how it should work ! But when i
  create
   a
   session at say 23:36 , the session var will still be on the
  server at
  8:16
   (after the carbadge collector came around) , why does this happen ,
  does
   php
   work in a 12 cicle only , or what is wrong ?
 
  How do you know the garbage collector was started? There is a (by
  default) 1% chance

 Ahem!  Even when poster has reported that ... my probability = 100 ...?

Yeah, i'm an idiot. Maybe I should read the questions? I'll start doing that
when newbies start searching the archives!! :)

I don't know why the session isn't deleting.

---John Holmes...


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



Re: [PHP] http-https-http redirection causes browser to show alert dialog

2003-03-13 Thread - Edwin
Hi,

Jean-Christian Imbeault [EMAIL PROTECTED] wrote: 

[snip]
 Is there a way around this? The messages are annoying at best and
 probably scary to users ...
[/snip]

This is a browser issue and is actually a security feature. Unless the 
users themselves turn it off, the messages would appear again, and 
again, and again...

Well, just hope I'm wrong :)

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



Re: [PHP] http-https-http redirection causes browser to show alertdialog

2003-03-13 Thread Jean-Christian Imbeault
Cpt John W. Holmes wrote:
You'll have to output a message on the HTTPS page, like Thank you, click
here to continue, otherwise there's no way around the message. It's a
client side issue, other browsers may or may not do it.
Yuck.

I see that Hotmail does something similar, You login though HTTPS and 
are sent to a blanks page that redirects you to another. I guess they 
use some kind of META redirect tag?

Thanks,

Jc

PS Love you columns (and all of) php|a.

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


RE: [PHP] http-https-http redirection causes browser to show alert dialog

2003-03-13 Thread Sysadmin
Why don't you just leave them in https?  Is this a performance issue?

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 9:07 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] http-https-http redirection causes browser to show
alert dialog


 I have a login page with a form where users enter there login and
 password. The form's action is https://mysite.com/login.php;.

 login.php authenticates the user and if the authentication is 
successful
 it ends with a:

 header(Location: http://mysite.com/welcome.html?a=bc=etc...;);

 The problem I am facing is that the flow of event is:

 http - https - http

 and this causes IE and Netscape to put up an alert box telling
 users that they are leaving a secured site.

 The IE messages is:

 You are about to be redirected to a connection that is not secure. 
The
 information you are sending to the current site might be retransmitted
 to a non-secure site. Do you wish to continue?

 I only want to use HTTPS for the parts of my web site that actually 
need
it and nothing else. The way I have things set up now I receive the
 data through HTTPS, use it, and then put the user back on a regular
 HTTP connection since I don't need https anymore. But I get browsers
 throwing up these warnings 

 Is there a way around this? The messages are annoying at best and
 probably scary to users ...

You'll have to output a message on the HTTPS page, like Thank you, 
click
here to continue, otherwise there's no way around the message. It's a
client side issue, other browsers may or may not do it.

---John Holmes...


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



[PHP] Splitting a string

2003-03-13 Thread Christopher J. Crane
I have a CSV file that has 7 fields. One of the fields has a number, and
some of the numbers start with a S. If that number start with a S, I
want to strip it off. I am not sure how to do that. I first wrote the script
to open the file, load each line into an array and split the array by field.
Then split the variable where there is a S. The problem showed up when
there is another S in the field. I only want to split the first S at the
beginning of the field. Isn't there an additional value to add to the split
function that will only split by the qualifier once.

Here is what I have now.
?php
$OutputFile = fopen(2ndrun.txt, w) or die(Can't open File);
fwrite($OutputFile,
\Contract\,\PN\,\SN\,\Uin\,\Type\,\Descrip\,\Qty\,\Ship
Date\\n);

$fp = fopen (original.txt,r);
$Row = 1;
while($data = fgetcsv($fp, 1000, ,)) {
 if($Row != 1) {
  //Contract,PN,SN,Uin,Type,Descrip,Qty,Ship Date
  fwrite($OutputFile, \$data[0]\,\$data[1]\,);
 list($SN1, $SN2) = split(S, $data[2]);
  fwrite($OutputFile,
\$SN2\,\$data[3]\,\$data[4]\,\$data[5]\,\$data[6]\,\$data[7]\\n
);
  }
 $Row++;
 }
fclose ($fp);
fclose ($OutputFile);
print Done!\n;
?



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



Re: [PHP] Is there any reason...

2003-03-13 Thread Chris Hewitt
Leif K-Brooks wrote:

That replies on this list go to the person who originally posted the 
message by default?  It seems to me that the reply-to header should be 
set to the list, or is it not possible with the mailing list system 
this list uses? 


Yes, the From field is the poster and the Reply-To field is not set 
by the mailing list software. The Redhat Install mailing list I feel 
does correctly by always setting the Reply-To field to the list. I 
don't know what software it uses, its at [EMAIL PROTECTED]

If the software on this list has the facility I think the Reply-To 
field should be set to the list. What do others think?

Regards

Chris

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


[PHP] Problems (Apache + PHP) and conection to Oracle8i

2003-03-13 Thread Jaime Villarroel Valdera
I have problems to pass HTML content that contains accentuated characters
from a form (editor) to an Oracle9i database ... through PHP. It is a
problem of character set? or It is a problem of php?. Somebody knows this
situation and how it is possible repair?
Thanks !!
Jaime Villarroel



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



Re: [PHP] PHP/HTML table layout?

2003-03-13 Thread Chris Hewitt
- Edwin wrote:

Hi,

Bev [EMAIL PROTECTED] wrote:

[snip]

I wanted to fixed sized cells and that when I type do not 
increase/decrease the surronding cells.Can this be done?

[/snip]

Try having your table with a fixed width as well:

The reason why html varies the size of cells is to fit in with the 
resolution of the client's browser. This could be set from 640*480 to 
1280*1024 so a fixed cell size will not display well in anything other 
than what it was designed for. Unless, that is, you want to use some 
JavaScript (if enabled on the browser) to get the resolution and vary 
the cell width accordingly (a lot of work), I'd suggest you consider not 
having fixed width cells.

HTH
Chris



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


[PHP] Problems (Apache + PHP) and conection to Oracle8i

2003-03-13 Thread Jaime Villarroel Valdera
I have problems to pass HTML content that contains accentuated characters
from a form (editor) to un Oracle9i database ... through PHP. It is a
problem of character set? or It is a problem of php?. Somebody knows this
situation and how it is possible repair?
Thanks !!
Jaime Villarroel



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



Re: [PHP] Splitting a string

2003-03-13 Thread - Edwin
Hi,

Christopher J. Crane [EMAIL PROTECTED] wrote: 

[snip]
 If that number start with a S, I want to strip it off.
[/snip]

Why don't you just check whether the first character is an S then 
return only the rest of the string if it is? Like:

?php
  $my_string = 'S12345';
  if ($my_string{0} == 'S'){
$rest_of_the_string = substr($my_string, 1);
  }
  echo $rest_of_the_string;
?

Of course, there could be some other way...

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



Re: [PHP] http-https-http redirection causes browser to show alertdialog

2003-03-13 Thread Jean-Christian Imbeault
[EMAIL PROTECTED] wrote:
Why don't you just leave them in https?  Is this a performance issue?
Performance and also the fact that (if I remember correctly) session 
variables are not passed from http to https nor vice versa.

And more importantly any relative links in page will turn to https links 
when they should be http links 

Jc

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


Re: [PHP] Is there any reason...

2003-03-13 Thread CPT John W. Holmes
 If the software on this list has the facility I think the Reply-To
 field should be set to the list. What do others think?

There is already enough traffic on the list. Just use Reply-All if you want
to include the list in your reply. This is how most lists I've seen are, you
just have to get used to it.

This comes up every couple months, btw...

---John Holmes...


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



Re: [PHP] http-https-http redirection causes browser to show alert dialog

2003-03-13 Thread Chris Hewitt
Jean-Christian Imbeault wrote:

snip--
The problem I am facing is that the flow of event is:
http - https - http

and this causes IE and Netscape to put up an alert box telling
users that they are leaving a secured site.
---snip-

This is normal and is the browser deciding to do it. In most browsers 
this is configurable (you can turn it off) but it is on by default. I 
feel this is good behaviour for a browser. Besides suggesting to your 
users that they turn this off (but that would affect all sites the 
browser visits), I can only suggest you use SSL for all the pages, or none.

Sorry I can't think of a better solution.

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


Re: [PHP] Splitting a string

2003-03-13 Thread David Otton
On Thu, 13 Mar 2003 09:13:35 -0500, you wrote:

Then split the variable where there is a S. The problem showed up when
there is another S in the field. I only want to split the first S at the
beginning of the field. Isn't there an additional value to add to the split

$line = 'S12345';
if ($line[0] == 'S') {
/* do stuff */
}


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



Re: [PHP] PHP/HTML table layout?

2003-03-13 Thread - Edwin
Chris Hewitt [EMAIL PROTECTED] wrote: 

[snip]
 I'd suggest you consider not having fixed width cells.
[/snip]

Good idea esp. if you can do better without having one. But sometimes,  
you really just need to have one ;)

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



Re: [PHP] Splitting a string

2003-03-13 Thread David Rice

Then split the variable where there is a S. The problem showed up 
when
there is another S in the field. I only want to split the first S 
at the
beginning of the field. Isn't there an additional value to add to the 
split
$line = 'S12345';
if ($line[0] == 'S') {
/* do stuff */
}
$str = S12345;
$str1 = ltrim($str,S);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] pop-up problem

2003-03-13 Thread -{ Rene Brehmer }-
On Tue, 11 Mar 2003 21:37:37 +0100, Ernest E Vogelsinger wrote about Re:
[PHP] pop-up problem what the universal translator turned into this:

At 21:02 11.03.2003, -{ Rene Brehmer }- said:
[snip]
On Mon, 20 Jan 2003 21:48:22 +, Sean Burlington wrote about Re: [PHP]
pop-up problem what the universal translator turned into this:

I would do

a href=foo.php target=Foo onclick=window.open('foo.php', 'Foo',
  'height=480,width=640,status=yes,scrolling=no,scrollbars=no');return
  false;Click Here/a

as this will still work on non-js browsers - albeit without being able 
to size/position the window.

But you'd also get the same page in two windows ... one with dressing, one
without. Atleast in IE ... it runs both the href code, and the onclick
code ... when the JIT is enabled.

On browsers where the JIT is disabled, only HREF is executed.
[snip] 

No - if the onClick handler returns false, nothing will happen. That's the
original reason for the onClick handler to be there - it can take control
if a link is actually performed or not.

My IE doesn't care about that ... it kicks both into action ... which is
bothersome as I normally used '#' in the href when onclick was used to
open windows... so everytime you clicked the link, it'd scroll the page to
the top, while opening the new window.

The same thing happens with target (if target is _new) and # in href.
It'll load a new window, with the current page in, and try to run the
onclick function there...

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



[PHP] form/text area input problem

2003-03-13 Thread Poon, Kelvin (Infomart)
Hi,

I was wondering if anyone could give me some idea to help me solve this
problem.  I am creating a KnowledgeBase for my company.  In this
knowledgeBase, the employees will input articles in the database.  I decided
to store it as such: a column for the title, a column for the content.  

I have a page that lets the employees input these aticles, and in my form I
would have a text box for the title and a text area that lets the user to
input the content.  And when the user press submit, the page will store
these information into the database.  

My problem is, for the text area.  Obviously the content of the aritcle is
going to be longer than one line.  However when I get the value of the text
area, everything the user typed in the text area becomes one line (unless
the user press enter but that isn't neccessary because once the text
approaches the edge of the text area it will automanticly take you to the
next line).  Because of that, me content is all in one line.  When I
retrieve this content and display it in a page, the content becomes a really
long one line paragraph.  I hope you understand what I am trying tto say.  I
was just wondering if there is any way I can fix this.  Right now I
basically wrote my own function, and it reads the content..and adds a BR
tag for every let's say 100 characters.but that isn't too efficient coz
sometimes it can add the BR int he middle of a word, therefore it cuts of
the word.  Also if the user press ENTER somewhere in the textarea, then it
would crash this function.  I am just looking for a more efficient way of
solving this, can anyone give me any idea?


Kelvin

THANKS!

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



RE: [PHP] Splitting a string

2003-03-13 Thread Crane, Christopher
This is perfect. I was not sure how to use the brackets with a variable for
position. Thank you very much

Christopher J. Crane 
Network Manager - Infrastructure Services 
IKON The Way Business Gets Communicated 
755 Winding Brook Drive
Glastonbury, CT 06078
Phone - (860) 659-6464
Fax - (860) 652-4379




-Original Message-
From: - Edwin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 13, 2003 9:30 AM
To: Christopher J. Crane; [EMAIL PROTECTED]
Subject: Re: [PHP] Splitting a string


Hi,

Christopher J. Crane [EMAIL PROTECTED] wrote: 

[snip]
 If that number start with a S, I want to strip it off.
[/snip]

Why don't you just check whether the first character is an S then 
return only the rest of the string if it is? Like:

?php
  $my_string = 'S12345';
  if ($my_string{0} == 'S'){
$rest_of_the_string = substr($my_string, 1);
  }
  echo $rest_of_the_string;
?

Of course, there could be some other way...

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


Re: [PHP] Can't seem to be able to do a get request

2003-03-13 Thread Ernest E Vogelsinger
At 14:50 13.03.2003, Mathieu Dumoulin said:
[snip]
I got this script i wish to run like it was a seperate thread on the server
cause i can't run anything with a crontab but i can't seem to do a valid GET
request thru fsockopen. If anyone can help me please.


$fp = fsockopen (sandbox.lhjmq.xl5.net, 80);
if ($fp) {

fputs ($fp, GET /lang_fr/index.php HTTP/1.1);
while (!feof($fp)) echo fgets ($fp,128);
fclose ($fp);
}

I run the script from the web but nothing happens. If i run it also with the
real URL i want to get (I cannot show this url for security reasons) my
processor and mysql process should go up to 80% each for like 40 seconds and
my top command in shell would show it, but it's not happenning. Now i
tried index.php and still nothing!
[snip] 

If you perform an HTTP request indicating a version of 1.0 or higher, a bit
more info is required for the server to process the request. Your simple
GET statement would probably work if you indicate HTTP/0.9, but it is
questionable if the receiving server would direct the request to the
correct domain (would only be if this was the default domain for the IP
address).

For a complete reference on the HTTP protocol look at RFC2616
ftp://ftp.rfc-editor.org/in-notes/rfc2616.txt

In short for your request to work you should at least transmit these lines:
GET /lang_fr/ index.php HTTP/1.1 [CRLF]
Host: www.myhost.com [CRLF]
Accept: */* [CRLF][CRLF]

where [CR] is a _complete_ CarriageReturn/LineFeed sequence \r\n. Of
course you may add more headers to it.

You might also want to check out cURL for threaded requests.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



Re: [PHP] Splitting a string

2003-03-13 Thread - Edwin
Hi,

David Rice [EMAIL PROTECTED] wrote: 
 
 $str = S12345;
 $str1 = ltrim($str,S);

Good idea but you'd have problem if you have $str = SS12345; and you 
only want to get rid of the first one...

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



Re: [PHP] Is there any reason...

2003-03-13 Thread Ernest E Vogelsinger
At 15:36 13.03.2003, Chris Hewitt said:
[snip]
If the software on this list has the facility I think the Reply-To 
field should be set to the list. What do others think?
[snip] 

I join our respected CPT John Holmes - there's enough traffic here already :)

If the Reply-To field would be set to the list you'd need to manually
copy/paste the sender's address to for a private reply. This could only be
circumvented IMHO if Reply-To was set to both the list address and the
poster's.

My vote: leave it as-is, and use ReplyToAll if you want to.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



Re: [PHP] pop-up problem

2003-03-13 Thread Ernest E Vogelsinger
At 15:52 13.03.2003, -{ Rene Brehmer }- said:
[snip]
My IE doesn't care about that ... it kicks both into action ... which is
bothersome as I normally used '#' in the href when onclick was used to
open windows... so everytime you clicked the link, it'd scroll the page to
the top, while opening the new window.

The same thing happens with target (if target is _new) and # in href.
It'll load a new window, with the current page in, and try to run the
onclick function there...
[snip] 

You might use a href=javascript:void(0); onClisk=... here - however
note that this won't do _anything_ if JS is disabled.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



Re: [PHP] Checking for a Valid Email String.

2003-03-13 Thread -{ Rene Brehmer }-
Jumping in...

On Tue, 11 Mar 2003 20:19:36 -0500 (PET), David E.S.V. wrote about Re:
[PHP] Checking for a Valid Email String. what the universal translator
turned into this:

you mean something like this?

//checking if the email is valid

if 
(eregi(^[0-9a-z]([-_.]?[0-9a-z])[EMAIL PROTECTED]([-.]?[0-9a-z])*\\.[a-z]{2,3}$, 
$email, $check))
 {
  if ( !getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp) )
$mensaje=server not valid;
  

  // checking DNS
  if(!checkdnsrr(substr(strstr($check[0], '@'), 1),ANY))
 $mensaje=server not valid;
 
 }

Now I haven't really checked up on ereg ... but besides I don't check with
DNS, can anyone tell me if my version (below), actually checks for all
possible invalids (I know I'm missing high-bit char tests)...

  function ValidEmail($email) {
  // function for verification of e-mail address
  // needs modification to test for high-bit chars
$invalidChars = array( ,/,:,,,;);
if ($email == ) {
  return false;
}
for ($n = 0; $n  count($invalidChars); $n++) {
  if (strpos($email,$invalidChars[$n]) != false) {
return false;
  }
}
$atPos = strpos($email,@,1);
if ($atPos === false) {
  return false;
}
if (strpos($email,@,$atPos + 1) != false) {
  return false;
}
$dotPos = strpos($email,.,$atPos);
if ($dotPos === false) {
  return false;
}
if ($dotPos + 3  strlen($email)) {
  return false;
}
return true;
  }

I created this a few months ago by converting a JS script, and haven't
really looked at it since. It works mostly like intended, but could
probably need some tweaking. It checks for all non-accepted chars, double
@s, and impossible dot-positions. It doesn't check for high-bit chars, and
doesn't actually verify the address. It's for subbing to my maillist, so
the mailserver actually does the verification itself.

Any comments ??? Or suggestions ???

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



Re: [PHP] Is there any reason...

2003-03-13 Thread Leif K-Brooks
The way I see it, part of the point in a mailing list is for people with 
the same question to only have to ask once.  Replies not going to the 
list by default defeats this purpose.

CPT John W. Holmes wrote:

There is already enough traffic on the list. Just use Reply-All if you want
to include the list in your reply. This is how most lists I've seen are, you
just have to get used to it.
--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



Re: [PHP] Checking for a Valid Email String.

2003-03-13 Thread -{ Rene Brehmer }-
On Wed, 12 Mar 2003 14:49:11 +1300, Philip J. Newman wrote about Re:
[PHP] Checking for a Valid Email String. what the universal translator
turned into this:

You have used the ' in sted of the  i assume that there is no difference?

The difference is that when you use , PHP looks for variables to be
filled in. With ' it doesn't...

I can't produce the correct results with ' though. Maybe it's because I'm
too used at basic and JS ... PHP is a tad different...

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



Re: [PHP] form/text area input problem

2003-03-13 Thread CPT John W. Holmes
[snip]
 My problem is, for the text area.  
[snip]

www.php.net/nl2br

---John Holmes...

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



Re: [PHP] form/text area input problem

2003-03-13 Thread - Edwin
Hi,

Poon, Kelvin (Infomart) [EMAIL PROTECTED] wrote: 

[snip]
 I am just looking for a more efficient way of solving this, can anyone 
 give me any idea?
[/snip]

I think you'll save yourself from so much trouble if:
1. You just leave those long text. If they didn't press ENTER, it means 
that they were typing a looong paragraph, no?
2. Use the nl2br() function to make sure that those parts where they 
pressed ENTER (a newline), would be turn into br /.

  http://www.php.net/manual/en/function.nl2br.php

Just my idea...

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



Re: [PHP] Is there any reason...

2003-03-13 Thread CPT John W. Holmes
 There is already enough traffic on the list. Just use Reply-All if you
want
 to include the list in your reply. This is how most lists I've seen are,
you
 just have to get used to it.

 The way I see it, part of the point in a mailing list is for people with
 the same question to only have to ask once.  Replies not going to the
 list by default defeats this purpose.

Yeah, that is the point. And that happens, though, because people get in the
habit of using reply-all. Sometimes I don't want to send me answer to the
list, though, so it's convenient to be able to reply directly to the poster.
I find it very annoying when I can't reply directly to the sender and I have
to cut and paste addresses (like someone else mentioned) in order to email
them.

Even worse, but unrelated, is Outlook express's inability to reply to
postings that are made from the newsgroup... very annoying!

---John Holmes...


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



Re: [PHP] Problems (Apache + PHP) and conection to Oracle8i

2003-03-13 Thread - Edwin
Hi,

Jaime Villarroel Valdera [EMAIL PROTECTED] wrote: 
 I have problems to pass HTML content that contains accentuated 
 characters from a form (editor) to an Oracle9i database ... through 
 PHP.

I'm not sure what you meant exactly by accentuated but if you mean 
single quotes (') then perhaps you can try escaping it using another 
single quote. (You can use str_replace() to replace one single quote 
character with two.)

 It is a problem of character set?

Maybe, maybe not. Maybe you need to give more details...

 or It is a problem of php?.

I don't think so ;)

 Somebody knows this situation and how it is possible repair?

Probably...

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



Re: [PHP] RE: Calculates time elapsed between two date

2003-03-13 Thread -{ Rene Brehmer }-
This is actually a nice example of why it would be better to have type
declaration on the variables.

Calculating with dates is easier if PHP knew that the var you throw at it
is a date. So if you've got:

date $date1
date $date2

and then do

$result = $date2 - $date1

PHP would know how to subtract two dates and return the serial (in theory,
if it had type declaration). It's how I always do it in Excel (where I do
alot of date calculations), and it seems weird to have type declaration
and automated date calc in something as simple as VBA (and VB), and not
having it in PHP, which in so many ways are far more advanced.

When you store a date in a date variable in VB (believe Java also does it
this way), it's actually stored as a serial number relative to the number
of days passed since 1 Jan 1900 (dates before that are negative). Hours,
mins, and so on, are converted to fractions of a day and put after the
decimal point ... Then you can do whatever math on it without having to
convert it back on forth. You'd then only have to convert them for the
sake of echo-ing or storing in DB.

Just my 2 €

Rene

On Wed, 12 Mar 2003 18:22:46 +0100, Marek Kilimajer wrote about Re: [PHP]
RE: Calculates time elapsed between two date what the universal
translator turned into this:

Get timestamp of these dates, subtract them and use math to find out 
days, hours etc from the difference

YC Nyon wrote:

Hi,

I need to get the time/date (ie. 1 day 12 hours 11 min 4sec) between 2 time
dates.
Can't seem to find any of these functions in the PHP manual.

Thanks
Nyon

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



[PHP] regex problem

2003-03-13 Thread Simon De Deyne
hi,

suppose there's a string
$string=I like my(hot) coffee with sugar and (milk)(PHP);

I would like to get an output of all possible combinations of the sentence 
with the words between brackets:
eg. 
I like my hot coffee with sugar and
I like my hot coffee with sugar and milk
I like my hot coffee with sugar and milk php
I like my coffee with sugar and
I like my coffee with sugar and milk php
etc.etc.

The number of the words between brackets can differ and they can occur 
everywhere. The most important is that all combinations are returned but the 
sentence (not between brackets) should be there.

I got something like:
preg_match(/\((.*?)\)(.*)\((.*?)\)+/,$string,$regresult);


but the \((.*?)\) part that matches the things between brackets is fixed. 
There can be a variable number of these words between brackets. How do i do 
this? And how could i easily get the combinations? Can i do it all just with 
preg_match or should i construct the combinations with some additional code?

thanks;
Simon



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



Re: [PHP] Force refresh of graphic - how?

2003-03-13 Thread WilsonCPU
Thanks for your suggestions. I had been thinking that it
must be the URL that was causing the caching (same URL,
same thing, right? Sounds good...), so I was planning
on trying something along the lines of what you suggest.
But I was thinking, why a random number? Why not just 
append the current time value? (time()) ... it won't be
the same for any single user more than once, so that
should force the re-fetch of the graphic, just like the
random would. Shouldn't this work too? (Said he without
having time to test either approach!)

- Mark


---
Mark Wilson, Computer Programming Unlimited
Web:   http://www.cpuworks.com/
Email: [EMAIL PROTECTED]
Our motto: Getting the Job Done

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



Re: [PHP] form/text area input problem

2003-03-13 Thread Poon, Kelvin (Infomart)

for 2, yes nl2br() will do it.  THanks.

but for 1, if the user don't press enter (yes they were typing a long
paragraph), then the variable will contain one LONG string.  

ANd if I retrieve this data and put it in the html page, it would appear as
a one lined long string.  DO you know what I am trying to say?


Let's say in the paragraph the user input in the text area is somethign like
this:

Hi, this is a longg paragraph  that iss
about our knowledgease.  I have NEVE
press enter in this text area at alll.


then this content will be stored in the database and I would retrieve this
and display it in a html page.

the problem is when I display it it would be a one lined paragraph.   THe
page's format is ruin since this is one long line and the user will have to
scroll across to read the paragraph which look pretty bad. 

I hope you know what i am trying to say.  

Thank you for the suggestions anyways

Kelvin

-Original Message-
From: - Edwin [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 10:14 AM
To: Poon, Kelvin (Infomart); '[EMAIL PROTECTED]'
Subject: Re: [PHP] form/text area input problem


Hi,

Poon, Kelvin (Infomart) [EMAIL PROTECTED] wrote: 

[snip]
 I am just looking for a more efficient way of solving this, can anyone 
 give me any idea?
[/snip]

I think you'll save yourself from so much trouble if:
1. You just leave those long text. If they didn't press ENTER, it means 
that they were typing a looong paragraph, no?
2. Use the nl2br() function to make sure that those parts where they 
pressed ENTER (a newline), would be turn into br /.

  http://www.php.net/manual/en/function.nl2br.php

Just my idea...

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/

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



[PHP] cropping an image script

2003-03-13 Thread Anthony Ritter
In the following php script, the function takes the original file and crops
to the destination file.

I've ran the script using a .png file and a .jpg file.

The .png works fine whereas the .jpeg file returns only part of the image
along with a blue rectangle.

For instance - where the original image is a 200 x 300 jpeg called:

1_data.jpeg

and the destination iamge is 75x75 called:

 2_data.jpeg

and starting at the x,y coordinates of 0,0 - the script returns a 75x 75
file but only a sliver of the .jpg image is within the 75x75 blue square.

Any help will be of assistance.
Thank you.
Tony Ritter



The following is the php cropping script (with author credit):

?

//
//image crop fuction . [EMAIL PROTECTED]
//info at http://obala.net/en
//
// Yes the proses could be executed with imagecopyresized build-in function
// but with this function you get the idea of how an image color set is
constructed
//
// $cropX = source starting X
// $cropY = source starting Y
// $cropW = crop weigth
// $cropH = crop heigh
// $source = source filename
// $destination = destination filename
// $type = image type

function
im_crop($cropX,$cropY,$cropH,$cropW,$source,$destination,$type='jpeg') {

// switch known types and open source image
switch ($type) {
case 'wbmp': $sim = ImageCreateFromWBMP($source); break;
case 'gif': $sim = ImageCreateFromGIF($source); break;
case 'png': $sim = ImageCreateFromPNG($source); break;
default: $sim = ImageCreateFromJPEG($source); break;
}

// create the destination image
$dim = imagecreate($cropW, $cropH);

// pass trought pixles of source image
for ( $i=$cropY; $i($cropY+$cropH); $i++ ) {
for ( $j=$cropX; $j($cropX+$cropW); $j++ ) {
// get RGB color info about a pixel in the source image
$color = imagecolorsforindex($sim, imagecolorat($sim, $j, $i));
// insert the color in the color index of the new image
$index = ImageColorAllocate($dim, $color['red'],
$color['green'], $color['blue']);
// plots a pixel in the new image with that color
imagesetpixel($dim, $j-$cropX, $i-$cropY, $index);
}
}

// whe dont need the sorce image anymore
imagedestroy($sim);


// switch known types and save
switch ($type) {
case 'wbmp': ImageWBMP($dim, $destination); break;
case 'gif': ImageGIF($dim, $destination); break;
case 'png': ImagePNG($dim, $destination); break;
default: ImageJPEG($dim, $destination); break;
}

// free the used space of the source image
imagedestroy($dim);

}

// example
im_crop(0,0,75,75,'1_data.jpeg','2_data.jpeg','jpeg');

?




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



Re: [PHP] form/text area input problem

2003-03-13 Thread CPT John W. Holmes
 for 2, yes nl2br() will do it.  THanks.

 but for 1, if the user don't press enter (yes they were typing a long
 paragraph), then the variable will contain one LONG string.

 ANd if I retrieve this data and put it in the html page, it would appear
as
 a one lined long string.  DO you know what I am trying to say?


 Let's say in the paragraph the user input in the text area is somethign
like
 this:

 Hi, this is a longg paragraph  that iss
 about our knowledgease.  I have
NEVE
 press enter in this text area at alll.


 then this content will be stored in the database and I would retrieve this
 and display it in a html page.

 the problem is when I display it it would be a one lined paragraph.   THe
 page's format is ruin since this is one long line and the user will have
to
 scroll across to read the paragraph which look pretty bad.

use wordwrap() to place it into a table.

---John Holmes...


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



Re: [PHP] form/text area input problem

2003-03-13 Thread - Edwin
Poon, Kelvin (Infomart) [EMAIL PROTECTED] wrote: 
[snip]
 the problem is when I display it it would be a one lined paragraph.   
 THe page's format is ruin since this is one long line and the user 
 will have to scroll across to read the paragraph which look pretty bad.
 
 I hope you know what i am trying to say.  
[/snip]

Hmm, I guess I know what you're trying to say but *that* is NOT the 
normal behaviour (if I may say). Putting one long paragraph inside
p/p tags should automagically wrap it... If not, you can probably 
use CSS to limit the width of your p/p's (paragraphs) so it wouldn't 
destroy the format of your page.

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



[PHP] open_dir v safe_mode fighting security

2003-03-13 Thread Brandon Saccone
Hi all,

currently i have a linux apache server with php 4.1.2

Right now on a domain /home/someuser and have safe_mode enabled and so
this will stop anybody opening any file that is not owned by them, ie will
not allow you to open someone else's html pages, scripts etc. However it
does not stop them to navigate these files ie webadmin.php. The feature of
going back in the tree with ..
Now the rest of the domains have the open_dir restriction turned ON so they
are secure but lack the functionality of the copy function and other
functions.

My question would be how do i set it up so that that the server is secure
but copy functions and other functions work?

Any ideas
Thanks

Brandon Saccone
[EMAIL PROTECTED]



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



[PHP] Authenticate against LDAP database

2003-03-13 Thread Greg
Hi-
I'm using Samba and OpenLDAP with smbldap tools.  I have users stored in the
LDAP database that I would like my PHP pages to authenticated against.  I
have 2 fields for user passwords, lmpassword and ntpassword.  How would I go
about authenticating against one of these fields, preferably ntpassword.
Thanks!
-Greg



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



Re: [PHP] PHP/HTML table layout?

2003-03-13 Thread - Edwin
I think you meant to send this to the list... :)

- E

bev [EMAIL PROTECTED] wrote: 
 Chris, I took off the nowrap (as all that dones is makes same line 
bigger...)
 
 I have the table cells defined as 250 pixels etc so thats fixed width 
but I can still type more into each cell as they keep streching, there 
must be  a way of having fixed pixel based column. 
 
 See below simply example that lets me type over the 100 pixel wide 
cell, have a look in any editor...
 
 html
 head
 /head
 body
 
 table STYLE=table-layout:fixed 
 border=1 cellpadding=0 cellspacing=0 style=border-collapse: 
collapse bordercolor=#FF width=760
   tr
 td width=740 height=400 
 div align=left
   table border=0 cellpadding=0 cellspacing=0 style=border-
collapse: collapse bordercolor=#11 width=226
 tr
   td  width=100nbsp;nbsp;nbsp;nbsp;nbsp; 
abcdefghijklmnopqrstuvwxyz01234567890666
c6/td
   td  width=126nbsp;/td
 /tr
 tr
   td  width=100nbsp;/td
   td  width=126nbsp;/td
 /tr
   /table
 /div
 /td
   /tr
   tr
 td width=600 height=400nbsp;/td
   /tr
 /table
 /body
 /html
   - Original Message - 
   From: - Edwin 
   To: Chris Hewitt 
   Cc: Bev ; [EMAIL PROTECTED] 
   Sent: Thursday, March 13, 2003 2:37 PM
   Subject: Re: [PHP] PHP/HTML table layout?
 
 
   Chris Hewitt [EMAIL PROTECTED] wrote: 
 
   [snip]
I'd suggest you consider not having fixed width cells.
   [/snip]
 
   Good idea esp. if you can do better without having one. But 
sometimes,  
   you really just need to have one ;)
 
   - E
 
   __
   Do You Yahoo!?
   Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/
 
 
 

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



RE: [PHP] form/text area input problem

2003-03-13 Thread Poon, Kelvin (Infomart)
THanks guys, I think I will use wordwarp()



-Original Message-
From: - Edwin [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 11:07 AM
To: Poon, Kelvin (Infomart); '[EMAIL PROTECTED]'
Subject: Re: [PHP] form/text area input problem


Poon, Kelvin (Infomart) [EMAIL PROTECTED] wrote: 
[snip]
 the problem is when I display it it would be a one lined paragraph.   
 THe page's format is ruin since this is one long line and the user 
 will have to scroll across to read the paragraph which look pretty bad.
 
 I hope you know what i am trying to say.  
[/snip]

Hmm, I guess I know what you're trying to say but *that* is NOT the 
normal behaviour (if I may say). Putting one long paragraph inside
p/p tags should automagically wrap it... If not, you can probably 
use CSS to limit the width of your p/p's (paragraphs) so it wouldn't 
destroy the format of your page.

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/

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



Re: [PHP] http-https-http redirection causes browser to showalert dialog

2003-03-13 Thread Pablo
On 03/13/2003 8:49 AM, Chris Hewitt ([EMAIL PROTECTED]) wrote:

 Jean-Christian Imbeault wrote:
 
 The problem I am facing is that the flow of event is:
 
 http - https - http
 
 and this causes IE and Netscape to put up an alert box telling
 users that they are leaving a secured site.
 
 This is normal and is the browser deciding to do it. In most browsers
 this is configurable (you can turn it off) but it is on by default. I
 feel this is good behaviour for a browser. Besides suggesting to your
 users that they turn this off (but that would affect all sites the
 browser visits), I can only suggest you use SSL for all the pages, or none.

Has anyone actually found a way to turn off this 'feature' in IE 5 or 6 for
Windows? I haven't found an option to do this in 6.0.2800.

On 03/13/2003 7:46 AM, Jean-Christian Imbeault ([EMAIL PROTECTED]) wrote:

 Is there a way around this? The messages are annoying at best and
 probably scary to users ...

I'm having the same issue. The only workaround I've found is to redirect to
a secure page that uses some combination of JavaScript, refreshing via
meta and plain links. Browsers don't seem to think these kinds of
redirects are worthy of alerts.

Pablo


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



Re: [PHP] PDF - PHP (on the fly using templates??)

2003-03-13 Thread RIVES Sergio SOFRECOM
was it what she was asking ?
I am not sure but you are right ! at the moment, the class fpdf doesn't
manage to manipulate existing pdf-files.

Martin Mandl a écrit :

 it's not possible (at the moment) to manipulate existing pdf-files with
 fpdf.

 Rives Sergio Sofrecom wrote:
  maybe the link didn't work... www.fpdf.org
  sorry

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



[PHP] Re: [RegExp] extracting anchors

2003-03-13 Thread Jens Lehmann
Jome wrote:
Jens Lehmann wrote:

Hello,

I want to extract the name-attribute of all anchors out of an
HTML-source-code which don't have the href-attribute. I can use this
code to get the name-attribute:
preg_match_all('/a([^]*?)name=[ \'\](.*?)[
\'\](.*?)/is',$src,$ar);
The name-attributes are now in $ar[2]. How can I exclude all links
which have the href-attribute? I didn't find an easy way how to say
that a string must _not_ be part of a pattern match. I hope you can
give me some advise.
This is one lousy solution but hey - it's a solution after all; you
can simply remove all a tags containing href before doing the
preg_match_all()-call, something like this below should do it I think.
$src = preg_replace('/a[^]*?href=[^]*?/is', '', $src);
This is of course a working solution, but I'm still interested if it can 
be done directly with just one regular expression. Thanks anyways.

Jens

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


RE: [PHP] Checking for a Valid Email String.

2003-03-13 Thread Julien Wadin
Here's a script I've made
The script checks if the mail looks like a valid one

?
if (checkmail($mail)) {
print(Adresse correcte);
} else {
print(Adresse invalide);
}


function checkmail($mail){
$mail2 = trim($mail);
$lg=strlen($mail2);
$pos1=strrpos($mail2,.);
$pos2=strrpos($mail2,@);
if(ereg(@,$mail2) and $pos1$pos2 and $lg5 and $pos2=1)
{
if (ereg( ,$mail2)) {
return false;
} else {
return true;
}
}
else
{
return false;
}
}
?


__
WADIN JULIEN
URL : www.campinfm.be.tf



-Message d'origine-
De : -{ Rene Brehmer }- [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 13 mars 2003 16:13
À : Philip J. Newman; [EMAIL PROTECTED]
Objet : Re: [PHP] Checking for a Valid Email String.


On Wed, 12 Mar 2003 14:49:11 +1300, Philip J. Newman wrote about Re:
[PHP] Checking for a Valid Email String. what the universal translator
turned into this:

You have used the ' in sted of the  i assume that there is no difference?

The difference is that when you use , PHP looks for variables to be
filled in. With ' it doesn't...

I can't produce the correct results with ' though. Maybe it's because I'm
too used at basic and JS ... PHP is a tad different...

Rene

--
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



[PHP] http_session_vars

2003-03-13 Thread Dennis Gearon
do the session vars get treated with magic quotes? The last comment at the bottom of:

http://www.php.net/manual/en/function.get-magic-quotes-gpc.php

Seems to think so. He's  written good code, but I have my doubts as to whether it 
should be applied 
to session vars.



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



[PHP] php 4.3.1 and apache 2.0.44 dont work on file uploads

2003-03-13 Thread Ronald Petty
I get files that twice the size when uploaded then the original.  I am
going to try the previous version of php and see if it works.  If not
Ill try the previous version of apache.

Has anyone else seen this?  I have scoured the archives and I am not the
only person with this problem.

Ron


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



[PHP] table cell space under image in IE

2003-03-13 Thread Larry Brown
Has anyone had to address this problem before?  I've created a table and
placed an image inside.  The image is around 12 pxl high and when the table
is displayed in Mozilla the cell border is up against the image on all
sides.  On IE however, the top of the image is up against the cell border
but the bottom has aprox 10pxl of space.  It is only there with the images,
only under the image, and only in IE (I've only checked v6).  If anyone has
seen this and has an idea of how to fix it, PLEASE let me know.  I've tried
setting cellspacing=0, cellpadding=0, and setting spacing to a range of
sized to see the effect and the smallest size it will move to is approx
10pxls below the bottom of the image.  Very frustrating!

I know this is not exactly on topic but I produce all html by php and I
don't want to go out and add myself to an html list (if there is such a
thing).

TIA

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




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



Re: [PHP] http_session_vars

2003-03-13 Thread CPT John W. Holmes
 do the session vars get treated with magic quotes? The last comment at the
bottom of:

 http://www.php.net/manual/en/function.get-magic-quotes-gpc.php

 Seems to think so. He's  written good code, but I have my doubts as to
whether it should be applied
 to session vars.

The gpc stands for GET, POST, and COOKIE. So I'm going to say No.

---John Holmes...


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



Re: [PHP] regex problem

2003-03-13 Thread CPT John W. Holmes
 suppose there's a string
 $string=I like my(hot) coffee with sugar and (milk)(PHP);

 I would like to get an output of all possible combinations of the sentence
 with the words between brackets:
 eg.
 I like my hot coffee with sugar and
 I like my hot coffee with sugar and milk
 I like my hot coffee with sugar and milk php
 I like my coffee with sugar and
 I like my coffee with sugar and milk php
 etc.etc.

 The number of the words between brackets can differ and they can occur
 everywhere. The most important is that all combinations are returned but
the
 sentence (not between brackets) should be there.

 I got something like:
 preg_match(/\((.*?)\)(.*)\((.*?)\)+/,$string,$regresult);


 but the \((.*?)\) part that matches the things between brackets is fixed.
 There can be a variable number of these words between brackets. How do i
do
 this? And how could i easily get the combinations? Can i do it all just
with
 preg_match or should i construct the combinations with some additional
code?

I'm just thinking outloud here. I'll see if I can get some time to write
actual code later.

1. match all words between paranthesis and place into $match.

2. replace words with placeholders, something like %1%, %2%, etc...

3. count how many words you matched (assume 3 for this example).

4. Now, i'm thinking of making all of your sentences sort of like a binary
number. Since we have three matches, we have a 3 digit binary number. To
diplay all of the words in all of the combinations, we have to count from
000 to 111 where 0 is the word not showing up and one is it showing up.

000 = I like my coffee with sugar and
001 = I like my coffee with sugar and PHP
010 = I like my coffee with sugar and milk

101 = I like myhot coffee with sugar and PHP
etc...

5. So if you have $z matches, you'll want to loop from $x = 0 until
$x=bindec(str_repeat(1,$z))

6 make a copy of $x... $copy = $x.

7 While ($copy != 0)

8. if($copy  1), then replace placeholder %$x% with $match[$x]

9. Shift the bits in $copy one to the right. ($copy1) and go back to #7.

10. Once $copy is zero, replace any placeholders left with an empty string
and display the sentence.

11. Go back to #5 and increment x (next for loop).

I hope that's confusing enough... or not confusing.. either way. I can write
some actual code if you want, but it'll be later today after work. Let me
know.

---John Holmes...



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



Re: [PHP] authorization

2003-03-13 Thread Ray Hunter
The problem here is that most people work and do not have the time to
help out.  

The best thing would to contract this portion out to the lowest bid.

--

Ray

On Wed, 2003-03-12 at 23:41, [EMAIL PROTECTED] wrote:
 Hello,
 
 I'm wonding if someone can please assist me with the following addition I
 would like to make to a music artists site using PHP.
 
 The site has a mailing list, guestbook,  videos -
 when the user goes to access the guestbook and videos, I want to be able to
 check if they're signed-up to the mailing list.. and if not, then they need
 to join to view the content.
 
 I don't want a login area.
 
 When a user goes to sign the guestbook, they enter their name, email
 address  post code, along with their guestbook message. When the message
 is processed it also checks the mailing list to see if they're registed (
 adds them if they're not). 
 
 Also, it would be neat to have a cookie stored on the users computer that
 once they have verified themselves, if they access another feature that
 wants their details first - the form is austomatically filled.
 
 Can someone please point me in the right direction with this - or if you
 have done this before I would greatly appreciate you stepping me through
 the process.
 
 This would be a great learning experience for - thank you for your interest
 in helping me out.
 
 Thanks
 Tim Burgan
 
 
 mail2web - Check your email from the web at
 http://mail2web.com/ .
 
 


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



Re: [PHP] table cell space under image in IE

2003-03-13 Thread CPT John W. Holmes
 Has anyone had to address this problem before?  I've created a table and
 placed an image inside.  The image is around 12 pxl high and when the
table
 is displayed in Mozilla the cell border is up against the image on all
 sides.  On IE however, the top of the image is up against the cell border
 but the bottom has aprox 10pxl of space.  It is only there with the
images,
 only under the image, and only in IE (I've only checked v6).  If anyone
has
 seen this and has an idea of how to fix it, PLEASE let me know.  I've
tried
 setting cellspacing=0, cellpadding=0, and setting spacing to a range of
 sized to see the effect and the smallest size it will move to is approx
 10pxls below the bottom of the image.  Very frustrating!

Do you have your code like tdimg/td with no other whitespace? IE might
be displaying a space or whitespace for some reason, whereas other browsers
will ignore it.

 I know this is not exactly on topic but I produce all html by php and I
 don't want to go out and add myself to an html list (if there is such a
 thing).

Oh man... How horrible would that be?!? an HTML list???

---John Holmes...


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



Re: [PHP] install php

2003-03-13 Thread Ray Hunter
make sure you config line has the location of you mysql install..

example:
/.configure --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.14
--enable-track-var

--
Ray

On Thu, 2003-03-13 at 00:14, sonjaya wrote:
 dear milist 
 i want' instal php with mysql , itry 
 like this :
 #./configure --with-mysql --with- 
 apache=../apache_1.3.14 --enable-track-
 var
 and get error message like this :
 #ext/mysql/libmysql/my_tempnam.o: In 
 function `my_tempnam':
 /usr/local/src/php-
 4.3.1/ext/mysql/libmysql/my_tempnam.c:1
 03: the use of `tempnam' is dangerous, 
 better use `mkstemp'
 collect2: ld returned 1 exit status
 make: *** [sapi/cli/php] Error 1
 i have install mysq in : 
 /usr/local/msqyl .
 any body can help me 
 
 


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



[PHP] time() question

2003-03-13 Thread Tom Ray
Is there an easy way to display the epoch time given by time() in a human
readable format? Basically, if I do $time = time(); and the insert that
data into my mysql database and then pull that information out again how
do I make it look like 2003-03-13 or a variant of that?

TIA


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



Re: [PHP] Re user Identifying

2003-03-13 Thread Ray Hunter
Yes you can set up both in parallel...however, that is going to be tons
of work for your system to manage.

You can set up both that allows either sessions or cookies.

--
Ray


On Thu, 2003-03-13 at 01:55, Peter Goggin wrote:
 My site uses shopping baskets to record what the user wants to but. These
 records are stored in a database against the user.   This requires the user
 to register and log onto the site. Is it possible to avoid this by the use
 of cookies or some other method?
 
 Is it  possible to use both methods in parallel. so that the user can choose
 either method. i.e. choose to register as a customer, or use the default id
 (perhaps via the cookie) and enter customer information at the time of
 placing the order?
 
 
 Any advice on the best way of doing this would be greatly appreciated.
 Regards
 
 Peter Goggin
 


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



Re: [PHP] authorization

2003-03-13 Thread -{ Rene Brehmer }-
On Thu, 13 Mar 2003 01:41:46 -0500, [EMAIL PROTECTED] wrote about
[PHP] authorization what the universal translator turned into this:

The site has a mailing list, guestbook,  videos -
when the user goes to access the guestbook and videos, I want to be able to
check if they're signed-up to the mailing list.. and if not, then they need
to join to view the content.

That's a crappy concept. You shouldn't try to force your mailing list upon
people. Especially because it's how many sites score addresses for the
spammers. So you'll get alot of people that steers away from your site
because you force them to accept listmail just to view a video.

Mailing lists should always be optional. Not everyone enjoys extra mail
just to access a website.

Even with a privacy statement (which you really should have everytime you
ask someone for their mail address on your site), the users cannot be sure
that you'll also follow it.

I'm fully for content being exclusive for signed up users, but don't
include a maillist requirement in that.

I don't want a login area.

If users are to enter their name and mail address to view anything, then
they essentially have to login nomatter what ... so I don't see how you
can avoid it one way or the other.

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



[PHP] Re: table cell space under image in IE

2003-03-13 Thread Roman Sanchez
If you write

tdimage src='yourimage.gif'
/td

the CR-LF before /td counts as an space wich wraps to the next line. It
might be helpful to write

tdimage src='yourimage.gif'/td (in the same line)

instead.

 I know this is not exactly on topic but I produce all html by php and I
 don't want to go out and add myself to an html list (if there is such a
 thing).

Frankly, it´s not on topic at all and no matter how you produce the final
html output you should know how to deal with it.





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



[PHP] PHP 4.3.2RC1 released.

2003-03-13 Thread Jani Taskinen

This is the first release candidate of the upcoming
maintenance release of PHP 4.3.2.

Please download and test it as much as possible on real-life
applications to uncover any remaining issues.

Sources: 
  
  http://www.php.net/~jani/RC/php-4.3.2RC1.tar.gz

Windows binaries: 

  http://www.php.net/~jani/RC/php-4.3.2RC1-Win32.zip


List of additions/changes/fixes can be found here:

  
http://cvs.php.net/diff.php/php4/NEWS?login=2r1=1.1247.2.35.4.1r2=1.1247.2.134ty=h

   


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



Re: [PHP] time() question

2003-03-13 Thread Larry E. Ullman
Is there an easy way to display the epoch time given by time() in a 
human
readable format? Basically, if I do $time = time(); and the insert that
data into my mysql database and then pull that information out again 
how
do I make it look like 2003-03-13 or a variant of that?
If you are pulling a date/time out of a MySQL database, use MySQL's 
DATE_FORMAT() function to format the value. For that matter, you can 
use MySQL's NOW() function (or others) when inserting the time.

Otherwise, just in PHP, you can use the DATE() function to format dates.

Larry

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


Re: [PHP] Re user Identifying

2003-03-13 Thread -{ Rene Brehmer }-
On Thu, 13 Mar 2003 19:55:04 +1100, Peter Goggin wrote about [PHP] Re
user Identifying what the universal translator turned into this:

My site uses shopping baskets to record what the user wants to but. These
records are stored in a database against the user.   This requires the user
to register and log onto the site. Is it possible to avoid this by the use
of cookies or some other method?

To retain a users identity, when the users ain't on your site, you've got
no way around cookies.

Be aware that the cookie should only (for security reasons) contain the
user's ID, not his/her login or password.

When the user returns to the site, you'll need to look for the cookie, and
then compare the userID to the database, and provide auto-login by
retrieving login and password from the database.

I don't use cookies myself, so can't help beyond that.

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



  1   2   3   >