Re: [PHP] Error in variable when looping

2003-01-14 Thread menezesd

Sorry Rick. Thanks.

I could not understand your question. Are you asking for more of the code? I did not 
include that as I thought it would be too long in the mail.

Thanks
Denis

--- Rick Emery <[EMAIL PROTECTED]> wrote:

> so where is $rowe set?
> 
> Show us code that calls this page
> - Original Message -
> From: "menezesd" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, January 13, 2003 6:21 PM
> Subject: [PHP] Error in variable when looping
> 
> 
> Hello friends,
> 
> I have made the following table of data and a button on every row to
> view the details. The code is
> working fine and the table is displayed with the buttons.
> 
> The problem I have is that the $SelectedItemNumber posted to the
> next page remains the same number
> no matter which row button I click. I have my relevant code below.
> Please help me. I know I am
> making a mistake somewhere but I cannot figure out where.
> 
> Quote :
> 
> 
> while($row=mysql_fetch_array($result)){
> 
> Print "  ";
> Print " bgcolor=\"#bf\"> color=\"#00\">" ;
> Print   "  $row[OrgName]
> ";
> print "   ";
> Print " bgcolor=\"#bf\"> face=\"Tahoma\" color=\"#00\">" ;
> Print  $row[OrgCountry];
> print "   ";
> Print " bgcolor=\"#bf\"> face=\"Tahoma\" color=\"#00\">" ;
> Print  $row[OrgNumber];
> print "   ";
> Print " bgcolor=\"#bf\"> face=\"Tahoma\" color=\"#00\">" ;
> Print  $row[Orgaddress];
> print "   ";
> Print " bgcolor=\"#bf\"> face=\"Tahoma\" color=\"#00\">" ;
> Print  $row[OrgChief];
> print "   ";
> Print " bgcolor=\"#b7b700\"> face=\"Tahoma\" color=\"#00\">" ;
> Print" Name=\"Details\">";
> print "";
> Print" $row[Id]";
>   Print "";}
>   }
> ?>
> 
> 
> 
> Unquote
> 
> Thanks
> Denis
> 
> --
> 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] restore_error_handler() to default error handler

2003-01-14 Thread Brian T. Allen
Hi,

I was playing around with error handlers, and tried this:



Which worked just fine.  A little too good, in fact.

I got over 1,200 emails in a matter of minutes (high traffic site).

I was finally able to get it to stop by re-declaring the function
without the mail() call, but how do I restore PHP's default error
handler?

I haven't had any success with restore_error_handler();

Thanks,
Brian


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




Re: [PHP] Error in variable when looping

2003-01-14 Thread Tim Ward
you're not differentiating between form elements on different rows.
all the hidden elements have the same name and are in the same
form so only the last one will be available as all the submit buttons
are in the same form.

you need to put ... tags around each submit/hidden
pair.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: menezesd <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 12:21 AM
Subject: [PHP] Error in variable when looping


> Hello friends,
>
> I have made the following table of data and a button on every row to view
the details. The code is working fine and the table is displayed with the
buttons.
>
> The problem I have is that the $SelectedItemNumber posted to the next page
remains the same number no matter which row button I click. I have my
relevant code below. Please help me. I know I am making a mistake somewhere
but I cannot figure out where.
>
> Quote :
>
>
>
le($row=mysql_fetch_array($result)){ 
> 
> Print "  ";
> Print "face=\"Tahoma\" color=\"#00\">" ;
> Print   "  $row[OrgName] ";
> print "   ";
> Print "size=\"2\" face=\"Tahoma\" color=\"#00\">" ;
> Print  $row[OrgCountry]; 
> print "   ";
> Print "size=\"2\" face=\"Tahoma\" color=\"#00\">" ;
> Print  $row[OrgNumber]; 
> print "   ";
> Print "size=\"2\" face=\"Tahoma\" color=\"#00\">" ;
> Print  $row[Orgaddress]; 
> print "   ";
> Print "size=\"2\" face=\"Tahoma\" color=\"#
00\">" ;
> Print  $row[OrgChief];
> print "   ";
> Print "" ;
> Print"";
> print "";
> Print"   Print "";}
>   }
> ?>
>
>
>
> Unquote
>
> Thanks
> Denis
>
> --
> 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] Weird Errors

2003-01-14 Thread Tim Ward
surely you can post the part of the code that checks 
the e-mail is blank or not?

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message - 
From: Mike Bowers <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 12:04 AM
Subject: [PHP] Weird Errors


> The errors aren't actually generadted inside the PHP but the problem im
> having makes no sense to me.
> The pages validate.php feed out:
> Please veify below that all your details are correct. If there are any
> errors, they will be lsited first.
> Error 1: Primary e-mail address was left blank.
> Error 2: Please specify whether or not your license has ever been
> revoked.
> Fatal Error: You did not agree to the terms listed.
> Errors were found in your submission. Please use your bowsers back
> button to go back and fix them.
> There were 4 errors found.
> 
> The problem lies within the fact that these errors are not actually
> being triggered. The errors are told to trigger if the field is left
> blank. The problem is are the field are not left blank. The form that
> feeds to the file is at http://www.skyfor.planetmodz.com/shsapp.html and
> the PHP  script is  http://www.skyfor.planetmodz.com/validate.php .. The
> text of both are too long to post in here. I checked myself to make sure
> the form fields line up. Could someone please try to see if they can
> figure out my error?
> 
> Thanks in advace,
> 
> Mike Bowers
> PlanetModz Gaming Network Webmaster
> [EMAIL PROTECTED]
> ViperWeb Hosting Server Manager
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> All outgoing messages scanned for viruses
> using Norton AV 2002
> 
> 
> -- 
> 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: permission denied

2003-01-14 Thread Lars Olsson
Hi Anthony!

Have you tried giving the full path of 'data.txt' to fopen? Like this:

$file = fopen("d:\\inetpub\\www.blahblah.org\\formtest.php", "a+");

Is it you or your ISP that uses win98?


Kindly

/Lars Olsson ([EMAIL PROTECTED])



Anthony Ritter wrote:

Using MS Win98 / php 4:

Any ideas on how I can change my permssion settings on a file called
data.txt so it can be read to and written to or do I have to take that up
with my ISP.

I get the following after I submit a form:

Warning: fopen("data.txt", "a+") - Permission denied in
d:\inetpub\www.blahblah.org\formtest.php on line 80
Your submission was not processed.

Thank you for your time and help.
TR









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




[PHP] Re: problems to get image informations form local harddrive using"getimagesize"

2003-01-14 Thread Lars Olsson
Hi!

It could be a permission problem. What OS are you using? Win98? Win2000? 
WinXP?


Kindly

/Lars Olsson ([EMAIL PROTECTED])



Harald Mohring wrote:
isn't it possible to get image informations from the local harddrive?

$fotoinfo=getimagesize("C:\\Files\\Temp\\Image.jpg");

if i use that code, the errormessage is always
Unable to access c:\Files\Temp\Image.jpg
getimagesize: unable to open file for reading

got anybody a solution?





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




[PHP] Re: imap_open failure

2003-01-14 Thread Lars Olsson
Hi!

Shouldn't it be:

$pop_inbox = imap_open("{$mailserver:110/pop3}INBOX", $login, $password);

(as on http://www.php.net/manual/en/function.imap-open.php)


Kindly

/Lars Olsson ([EMAIL PROTECTED])



Jeff Schwartz wrote:

I'm using imap_open in PHP 4.3.0 to successfully access every pop server I've tried - except 1: "mail.fea.net". I know the mail server, port, login, and password are correct because I can successfully log into the pop server with both telnet and Outlook.

Here's the code:

if ($pop_inbox = imap_open("{".$mailserver."/$mailbox_type:$port/notls}",$login,$password)):

I've tried every variation of the code, such as using "notls" or not. In any event, I know the code works because I can log into every other pop server I've tried.

imap_last_error() returns: Can not authenticate to POP3 server

Has anyone else run into this? Is there a way to see more about the interaction between imap_open and the pop server?

Jeff



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now



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




[PHP] regular expression

2003-01-14 Thread Corin Langosch
hi,
i wrote a regular expression to match email adresses:
$text = preg_replace("/([a-z0-9_]|\\-|\\.)+@([^[:space:]<>]*)([[:alnum:]-])/i", "mailto:\\1\";>\\1", $text);

unluckily also things like ftp:[EMAIL PROTECTED] were matched.
so i rewrote it to:
$text = 
preg_replace("/(?]*)([[:alnum:]-]))/i",
 "mailto:\\1\";>\\1", $text);

but this gives me:
http:[EMAIL PROTECTED] -> http:[EMAIL PROTECTED]
ftp:[EMAIL PROTECTED] -> ftp:[EMAIL PROTECTED]
[EMAIL PROTECTED] -> [EMAIL PROTECTED]

thanks for your help! :)



[PHP] HTTP_ACCEPT - Reliabilty?

2003-01-14 Thread SED
I'm using Flash very often within websites. Like you know, sometimes the
user doesn't have the Flash-plug-in so I was wandering if I could depend
on this $_SERVER['HTTP_ACCEPT'] variable to look for "shockwave-flash".
If found, the visitor has Flash-plugging, if not, he doesn't.

So my question really is, can I base my Flash-detection on this global
variable or is too uncertain? (e.g. when the user is using Netscape,
Opera etc., Linux, Mac etc.) 

Regards,
Sumarlidi E. Dadason

SED - Graphic Design
_
E-mail: [EMAIL PROTECTED]
website: www.sed.is


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




Re: [PHP] HTTP_ACCEPT - Reliabilty?

2003-01-14 Thread Danny Shepherd
Hi,

No, I wouldn't rely on it at all, I couldn't find a browser that *does* have
that mime-type in it's header! - Here's what IE6 sends :

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/msword, */*
Accept-Language: en-gb
Accept-Encoding: gzip, deflate

Flash, along with a multitude of other plugins, is installed and working
fine.

FWIW, Mozilla 1.3a sends:

Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate,compress;q=0.9

Opera 7 sends:

Accept: text/html, image/png, image/jpeg, image/gif, image/x-xbitmap,
*/*;q=0.1
Accept-Language: en
Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0



- Original Message -
From: "SED" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 10:22 AM
Subject: [PHP] HTTP_ACCEPT - Reliabilty?


> I'm using Flash very often within websites. Like you know, sometimes the
> user doesn't have the Flash-plug-in so I was wandering if I could depend
> on this $_SERVER['HTTP_ACCEPT'] variable to look for "shockwave-flash".
> If found, the visitor has Flash-plugging, if not, he doesn't.
>
> So my question really is, can I base my Flash-detection on this global
> variable or is too uncertain? (e.g. when the user is using Netscape,
> Opera etc., Linux, Mac etc.)
>
> Regards,
> Sumarlidi E. Dadason
>
> SED - Graphic Design
> _
> E-mail: [EMAIL PROTECTED]
> website: www.sed.is
>
>
> --
> 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] upgrading from 4.0.6 to 4.3.0

2003-01-14 Thread gamin
Hi,

I have currently working a Red Hat 7.2 system that installs PHP 4.0.6
from the CD and it works fine. I want to upgrade to ver 4.3.0  what would be
the simplest way to do this without breaking any of the old modules etc. I
wont mind making changes to my scripts in case of changes between versions.

Do i need to remove the old PHP installation before building the new one
?

Would using the configure command that shows in the 
currently (with 4.0.6) work with the ver 4.3.0 ?

Thank you

gamin.



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




Re: [PHP] regular expression

2003-01-14 Thread Chris Hayes
At 10:49 14-1-03, you wrote:

hi,
i wrote a regular expression to match email adresses:
$text =
preg_replace("/([a-z0-9_]|\\-|\\.)+@([^[:space:]<>]*)([[:alnum:]-])/i", "
href=\"mailto:\\1\";>\\1", $text);

unluckily also things like ftp:[EMAIL PROTECTED] were matched.
so i rewrote it to:
$text =
preg_replace("/(?]*)([[:alnum:]-]))/i", 

"mailto:\\1\";>\\1", $text);

but this gives me:
http:[EMAIL PROTECTED] -> http:[EMAIL PROTECTED]
ftp:[EMAIL PROTECTED] -> ftp:[EMAIL PROTECTED]
[EMAIL PROTECTED] -> [EMAIL PROTECTED]


This seems to work:

$text =
preg_replace("/([^\/a-z0-9_])(([a-z0-9_]|\\-|\\.)+@([^[:space:]<>]*)([[:alnum:]-]))/i", 

"\\1mailto:\\2\";>\\2", $text);

I did not check the entire regexp but it seems to do what you need.
Um, the NOT thingy in a regexp is the ^ in stead of the !.

And my line will not tagify any email preceded by a forward slash.

Chris Hayes


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



[PHP] Re: upgrading from 4.0.6 to 4.3.0

2003-01-14 Thread Jean-Christian Imbeault
Gamin wrote:


I have currently working a Red Hat 7.2 system that installs PHP 4.0.6
from the CD and it works fine. I want to upgrade to ver 4.3.0  what would be
the simplest way to do this without breaking any of the old modules etc. I
wont mind making changes to my scripts in case of changes between versions.


If your old PHP was automatically installed by RH then just do an "rpm 
-e php" (maybe rpm-r php-4.0.6. To find out the write string to use to 
rpm -qa | grep php)

Do i need to remove the old PHP installation before building the new one
?


No, if you don't you need to take extra steps. And I can't see why you 
want to keep the old version around anyway.

Would using the configure command that shows in the 
currently (with 4.0.6) work with the ver 4.3.0 ?


Most probably. SO I suggest downloading the 4.3.0 source files and doing 
a ./configure with the options you can from phpinfo() and then compiling :)

Jc


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



[PHP] Serial device /dev/ttyS0

2003-01-14 Thread Scott Houseman
Hi.

Would it be possible to use PHP to communicate with
a serail device e.g. a modem.
I would like to send AT commands to a GSM modem &
be able to read the resulting output.

I know PHP may not be ideal for this, but I think if
it's possible, it would be the quickest way of knocking something
together.

Thanks

Scott
--
Scott Houseman
Senior Software Developer
Junk Mail Publishing (Pty) Ltd
T + 27 12 342 3840 ext 2806 F +27 12 342 3876
E [EMAIL PROTECTED] | www.junkmail.co.za
A 1312 Pretorius Street, Hatfield, Pretoria
P O Box 6574, Pretoria, 0001, South Africa
+27 82 491 8021


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




[PHP] globals off in function

2003-01-14 Thread Michael Bevz
Hi, all!!!
I've such trouble:
( register_globals = off )

in function i call to $smarty variable
"
function showLoginForm(){

   global $db, $smarty; // $smarty = new Smarty in main code

  $smarty->assign("message", $message); // 
"
and i receive this error message
"
Fatal error: Call to a member function on a non-object in
/usr/home/elastic.org/work/svyatoshin/system/common_func.php on line 22
"

Imho, globals don't working with "globals off", nut i can't find this in
manual.

Who can help me?



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




Re: [PHP] Error in variable when looping

2003-01-14 Thread Denis L. Menezes
Hello Tim.

Could you help me a little further and tell me exactly where to put this?

Thanks
Denis
- Original Message -
From: "Tim Ward" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 5:16 PM
Subject: Re: [PHP] Error in variable when looping


> you're not differentiating between form elements on different rows.
> all the hidden elements have the same name and are in the same
> form so only the last one will be available as all the submit buttons
> are in the same form.
>
> you need to put ... tags around each submit/hidden
> pair.
>
> Tim Ward
> http://www.chessish.com
> mailto:[EMAIL PROTECTED]
> - Original Message -
> From: menezesd <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 14, 2003 12:21 AM
> Subject: [PHP] Error in variable when looping
>
>
> > Hello friends,
> >
> > I have made the following table of data and a button on every row to
view
> the details. The code is working fine and the table is displayed with the
> buttons.
> >
> > The problem I have is that the $SelectedItemNumber posted to the next
page
> remains the same number no matter which row button I click. I have my
> relevant code below. Please help me. I know I am making a mistake
somewhere
> but I cannot figure out where.
> >
> > Quote :
> >
> >
> >
> le($row=mysql_fetch_array($result)){
> >
> > Print "  ";
> > Print "" ;
> > Print   "  $row[OrgName]
";
> > print "   ";
> > Print "" ;
> > Print  $row[OrgCountry];
> > print "   ";
> > Print "" ;
> > Print  $row[OrgNumber];
> > print "   ";
> > Print "" ;
> > Print  $row[Orgaddress];
> > print "   ";
> > Print " 00\">" ;
> > Print  $row[OrgChief];
> > print "   ";
> > Print " bgcolor=\"#b7b700\">" ;
> > Print"";
> > print "";
> > Print" >   Print "";}
> >   }
> > ?>
> >
> >
> >
> > Unquote
> >
> > Thanks
> > Denis
> >
> > --
> > 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] globals off in function

2003-01-14 Thread Jason Wong
On Tuesday 14 January 2003 18:46, Michael Bevz wrote:

> I've such trouble:
> ( register_globals = off )

The register_globals setting in php.ini has ...

> in function i call to $smarty variable
> "
> function showLoginForm(){
>
>global $db, $smarty; // $smarty = new Smarty in main code

... nothing to do with the 'global' statement.

>   $smarty->assign("message", $message); // 
> "
> and i receive this error message
> "
> Fatal error: Call to a member function on a non-object in
> /usr/home/elastic.org/work/svyatoshin/system/common_func.php on line 22
> "

> Who can help me?

Assuming line 22 is (it would help if you told us _which_ is line 22)

  $smarty->assign("message", $message);

and assuming that you _really_ have defined $smarty in the main code then I 
cannot see what you're doing wrong.

Does $smarty->assign("message", $message work in the main loop (ie when not in 
a function)?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
In Oz, never say "krizzle kroo" to a Woozy.
*/


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




Re: [PHP] Error in variable when looping

2003-01-14 Thread Tim Ward
print "";
print"";
print"";

you'll  then have as many forms as you have rows and which
one is submitted will depend on which button is pressed.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: Denis L. Menezes <[EMAIL PROTECTED]>
To: Tim Ward <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 11:50 AM
Subject: Re: [PHP] Error in variable when looping


> Hello Tim.
>
> Could you help me a little further and tell me exactly where to put this?
>
> Thanks
> Denis
> - Original Message -
> From: "Tim Ward" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, January 14, 2003 5:16 PM
> Subject: Re: [PHP] Error in variable when looping
>
>
> > you're not differentiating between form elements on different rows.
> > all the hidden elements have the same name and are in the same
> > form so only the last one will be available as all the submit buttons
> > are in the same form.
> >
> > you need to put ... tags around each submit/hidden
> > pair.
> >
> > Tim Ward
> > http://www.chessish.com
> > mailto:[EMAIL PROTECTED]
> > - Original Message -
> > From: menezesd <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 14, 2003 12:21 AM
> > Subject: [PHP] Error in variable when looping
> >
> >
> > > Hello friends,
> > >
> > > I have made the following table of data and a button on every row to
> view
> > the details. The code is working fine and the table is displayed with
the
> > buttons.
> > >
> > > The problem I have is that the $SelectedItemNumber posted to the next
> page
> > remains the same number no matter which row button I click. I have my
> > relevant code below. Please help me. I know I am making a mistake
> somewhere
> > but I cannot figure out where.
> > >
> > > Quote :
> > >
> > >
> > >
> > le($row=mysql_fetch_array($result)){
> > >
> > > Print "  ";
> > > Print " bgcolor=\"#bf\">" ;
> > > Print   "  $row[OrgName]
> ";
> > > print "   ";
> > > Print " bgcolor=\"#bf\">" ;
> > > Print  $row[OrgCountry];
> > > print "   ";
> > > Print " bgcolor=\"#bf\">" ;
> > > Print  $row[OrgNumber];
> > > print "   ";
> > > Print " bgcolor=\"#bf\">" ;
> > > Print  $row[Orgaddress];
> > > print "   ";
> > > Print " bgcolor=\"#bf\"> > 00\">" ;
> > > Print  $row[OrgChief];
> > > print "   ";
> > > Print " > bgcolor=\"#b7b700\">"
;
> > > Print"";
> > > print "";
> > > Print" $row[Id]";
> > >   Print "";}
> > >   }
> > > ?>
> > >
> > >
> > >
> > > Unquote
> > >
> > > Thanks
> > > Denis
> > >
> > > --
> > > 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] globals off in function

2003-01-14 Thread Chris Hayes


in function i call to $smarty variable
"
function showLoginForm(){

   global $db, $smarty; // $smarty = new Smarty in main code
Fatal error: Call to a member function on a non-object in


Are you sure
$smarty = new Smarty
is in the main code?
Can it be in another function?

Try setting
global $smarty;
just before you create $smarty.

Does that help?


( register_globals = off )
Imho, globals don't working with "globals off", nut i can't find this in
manual.

no, register_globals is only about the automatical production of variables 
from FORM, GET and other data input.
But i fully agree the name is confusing.


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



[PHP] Cookie, header, output problems

2003-01-14 Thread J. Alden Gillespy
I'm creating an e-commerce website, and I just need clarification as to
whether a MySQL query is considered as "browser output".  I ask because
I have the following code, but the cookie isn't being set:

if ($op == "login") {
if (!isset($username) && !isset($userpass)) {
} else {
if ($username == "" || $userpass == "") {
$errormsg = "Invalid username or password.
Please try again.";
} else {
if (mysql_num_rows(mysql_query("select * from
`$cart->user_table` where username=\"$username\" and
userpass=\"$userpass\"", $cart->dblink)) == 1) {
setcookie("jackloren_user",
"$username:$userpass", time() + 2592000); // expires in 30 days
header("Location:
http://www.jackloren.com/";);
//  echo "test";
/*  if ($rd != "") {
redirectURL($rd,"");
} else {
redirectURL("","");
} */
} else {
$errormsg = "Invalid username or
password.  Please try again.";
}
}
}
}

However, if I comment out the header and uncomment the echo statement,
then the cookie is added, no problem.  It seems as if the browser is
freaking out when there isn't any output after a cookie is set and a
header is sent.

I'm also having another similar problem with this function:

function auth($redirect_url) {
global $HTTP_COOKIE_VARS;

if (!isset($HTTP_COOKIE_VARS['jackloren_user'])) {
header("Location: http://www.jackloren.com/login.php";);
//  echo "test";
} else {
$userinfo = explode(":",
$HTTP_COOKIE_VARS['jackloren_user']);
$username = $userinfo[0];
$userpass = $userinfo[1];
echo "$username | $userpass";
if (mysql_num_rows(mysql_query("select * from
`$cart->user_table` where username=\"$username\" and
userpass=\"$userpass\"", $cart->dblink)) != 1) {
redirectURL("login.php", $redirect_url);
} else {
echo "success";
// nothing
}
}
}

If I leave the script the way it is, the browser isn't redirected no
matter what I put in the header() statement.  However, if I uncomment
the echo statement, giving the browser some output, then the redirect
works fine.

Has anyone experienced this?  And if so, how do I fix it?  Thanks.

J. Alden Gillespy (aka Dogga)
Microsoft Beta Tester:
- Office 11
- Content Management Server (CMS) 2002
- Systems Management Server (SMS) 2003


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




Re: [PHP] restore_error_handler() to default error handler

2003-01-14 Thread Michael Sims
On Tue, 14 Jan 2003 01:20:54 -0700, you wrote:

>Hi,
>
>I was playing around with error handlers, and tried this:
[...]
>Which worked just fine.  A little too good, in fact.
>
>I got over 1,200 emails in a matter of minutes (high traffic site).

I'm not sure whey restore_error_handler() isn't working, but I have
something else which may help you.  When you use a custom error
handler your function will handle ALL errors, regardless of your
current error_reporting level.  To make your function honor the
current error_reporting level, put this line at the top of your
function:

if (!($_ErrorNumber_ & error_reporting())) return;

This will also allow your function to ignore errors on function calls
that you have prefixed with an '@', since the '@' temporarily sets the
error_reporting level to 0.

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




[PHP] Persistent global data ?

2003-01-14 Thread Mathias Rockel
Hi all !

I am currently writing some kind of Document/File-Library in a LAMP
environment.

As the library should be able to handle various file types, and most file
types have to be handled differently internally, I would like to use
Objects/Classes to make the code for the Library iself independent from the
stuff that is individual to the different file types.

Now I noticed early that when I use Objects in PHP and have to create many
for them each time a script runs it slows the system down considerably. It
seems you can now save objects in sessions which AFAIR was not possible last
time I tried. But then I would have to read the whole file index (which is
actually a tree) into a session variable for each user, and I don't know if
thats a good idea performancewise. It would be a rather large
multi-dimensional array.

So I would like to know if there is any possibility in PHP to create my own
persistent superglobal, a variable which can be read by any script running.
I think something similiar is available as the "Application" Object in ASP
under IIS. I know I have to take care of locking and stuff (although the
end-user scripts would only need read access to it), but if I could write
some functions which just would check if the tree is already in memory or
not (after a server shutdown or whatever), and if not just read it in from
the database to make it available in every other script.

The only thing I've found so far which I think may be a possibility is the
shared memory stuff that PHP supports, but I don't know anything about that
on the system level, and its not explained in much detail in the PHP manual.
Is that something I should follow, or can't I use it ? Can I somehow use the
underlying Apache ? Are there better options ?

any help/suggestions/hints are greatly appreciated !

mathias rockel


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




[PHP] Re: Amount of data in the database

2003-01-14 Thread Lars Olsson
A pretty easy way of doing it is to add a size field to the table. 
Whenever you INSERT INTO or UPDATE the table, update this field to 
contain the size of the data for the current record. Then, whenever you 
need to check the amount of data for a particular user, just use this query:

"SELECT SUM(size) FROM sometable WHERE user=someuser"

Hope this helps


/Lars Olsson ([EMAIL PROTECTED])

PS. Ive done this in a file upload script I created a while ago. If you 
want, I can mail you the relevant bits and bytes. DS.



Denis L. Menezes wrote:
Hello friends.

I have a need for checking how much data(in kb) exists of each of the user members in the MySQL so that when they upload more data I can restrict/warn them of the amount of data they have on the server at present.

can anyone please tell me how to check the amount of data on the mysql for each record?

thanks very much
Denis



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




php-general Digest 14 Jan 2003 13:36:55 -0000 Issue 1822

2003-01-14 Thread php-general-digest-help

php-general Digest 14 Jan 2003 13:36:55 - Issue 1822

Topics (messages 131498 through 131543):

Re: forms
131498 by: Rick Emery
131499 by: Cal Evans
131500 by: cj
131502 by: David Freeman
131505 by: Chris Shiflett
131507 by: cj
131509 by: Chris Shiflett
131510 by: Rick Emery
131518 by: cj
131520 by: Jason Wong

Re: pass by reference
131501 by: Tom Rogers

cprelogin cookie data
131503 by: Robert Samuel White

Getting info with WHILE
131504 by: Ezequiel Sapoznik
131508 by: Tom Rogers

quota class?
131506 by: UberGoober

increment numbers...
131511 by: Senani
131512 by: Sean Malloy
131513 by: Senani
131514 by: Rick Emery
131516 by: Senani

Re: occasional mcrypt problems
131515 by: Steve Yates
131517 by: Steve Yates

imap quota
131519 by: Roger Thomas

Re: Error in variable when looping
131521 by: menezesd
131523 by: Tim Ward
131536 by: menezesd
131538 by: Tim Ward

restore_error_handler() to default error handler
131522 by: Brian T. Allen
131541 by: Michael Sims

Re: Weird Errors
131524 by: Tim Ward

Re: permission denied
131525 by: Lars Olsson

Re: problems to get image informations form local harddrive using "getimagesize"
131526 by: Lars Olsson

Re: imap_open failure
131527 by: Lars Olsson

regular expression
131528 by: Corin Langosch
131532 by: Chris Hayes

HTTP_ACCEPT - Reliabilty?
131529 by: SED
131530 by: Danny Shepherd

upgrading from 4.0.6 to 4.3.0
131531 by: gamin
131533 by: Jean-Christian Imbeault

Serial device /dev/ttyS0
131534 by: Scott Houseman

globals off in function
131535 by: Michael Bevz
131537 by: Jason Wong
131539 by: Chris Hayes

Cookie, header, output problems
131540 by: J. Alden Gillespy

Persistent global data ?
131542 by: Mathias Rockel

Re: Amount of data in the database
131543 by: Lars Olsson

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

--- Begin Message ---
Do you mean like two SUBMIT buttons?  Yes.
- Original Message - 
From: "cj" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 7:32 PM
Subject: [PHP] forms


G'day All
Just a quick question
This is really a html more than a php question.

Is it possible to have two buttons and have different actions for each
button in the same form?

Thanks
CJ





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




--- End Message ---
--- Begin Message ---
yes but it's more of an HTML/JavaScript thing.

use INPUT Type='BUTTON' to put a second button on your form.  Then use the
onClick method to assign an action to it.  If you want it to submit your
form then call document.formName.submit();

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: cj [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 7:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] forms


G'day All
Just a quick question
This is really a html more than a php question.

Is it possible to have two buttons and have different actions for each
button in the same form?

Thanks
CJ





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



--- End Message ---
--- Begin Message ---
Would you know of any tutorial web sites which would explain how to do this?
As I have not done any java programing before.

-Original Message-
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 14 January 2003 12:43 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] forms


yes but it's more of an HTML/JavaScript thing.

use INPUT Type='BUTTON' to put a second button on your form.  Then use the
onClick method to assign an action to it.  If you want it to submit your
form then call document.formName.submit();

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: cj [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 7:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] forms


G'day All
Just a quick question
This is really a html more than a php question.

Is it possible to have two buttons and have different actions for each
button in the same form?

Thanks
CJ





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


--- End Message ---
--- Begin Message ---
G'day CJ

 > This is really a html more than a php question.

Yep, it probably is...

 > Is it possible to have two buttons and have different
 > actions for 

Re: [PHP] Re: Amount of data in the database

2003-01-14 Thread Denis L. Menezes
Thanks Lars.

Sorry, then I have another question. How do I find the size of the record?

Thanks
Denis
- Original Message -
From: "Lars Olsson" <[EMAIL PROTECTED]>
To: "Denis L. Menezes" <[EMAIL PROTECTED]>
Cc: "PHP general list" <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 9:36 PM
Subject: [PHP] Re: Amount of data in the database


> A pretty easy way of doing it is to add a size field to the table.
> Whenever you INSERT INTO or UPDATE the table, update this field to
> contain the size of the data for the current record. Then, whenever you
> need to check the amount of data for a particular user, just use this
query:
>
> "SELECT SUM(size) FROM sometable WHERE user=someuser"
>
> Hope this helps
>
>
> /Lars Olsson ([EMAIL PROTECTED])
>
> PS. Ive done this in a file upload script I created a while ago. If you
> want, I can mail you the relevant bits and bytes. DS.
>
>
>
> Denis L. Menezes wrote:
> > Hello friends.
> >
> > I have a need for checking how much data(in kb) exists of each of the
user members in the MySQL so that when they upload more data I can
restrict/warn them of the amount of data they have on the server at present.
> >
> > can anyone please tell me how to check the amount of data on the mysql
for each record?
> >
> > thanks very much
> > Denis
>
>
> --
> 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] mail client?

2003-01-14 Thread Henning Olsen
Does anyone know any reliable php/mysql mail-clients with support for pop3?

Yours

Henning


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




Re: [PHP] Persistent global data ?

2003-01-14 Thread Rick Emery
cookies?

- Original Message - 
From: "Mathias Rockel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 7:33 AM
Subject: [PHP] Persistent global data ?


Hi all !

I am currently writing some kind of Document/File-Library in a LAMP
environment.

As the library should be able to handle various file types, and most file
types have to be handled differently internally, I would like to use
Objects/Classes to make the code for the Library iself independent from the
stuff that is individual to the different file types.

Now I noticed early that when I use Objects in PHP and have to create many
for them each time a script runs it slows the system down considerably. It
seems you can now save objects in sessions which AFAIR was not possible last
time I tried. But then I would have to read the whole file index (which is
actually a tree) into a session variable for each user, and I don't know if
thats a good idea performancewise. It would be a rather large
multi-dimensional array.

So I would like to know if there is any possibility in PHP to create my own
persistent superglobal, a variable which can be read by any script running.
I think something similiar is available as the "Application" Object in ASP
under IIS. I know I have to take care of locking and stuff (although the
end-user scripts would only need read access to it), but if I could write
some functions which just would check if the tree is already in memory or
not (after a server shutdown or whatever), and if not just read it in from
the database to make it available in every other script.

The only thing I've found so far which I think may be a possibility is the
shared memory stuff that PHP supports, but I don't know anything about that
on the system level, and its not explained in much detail in the PHP manual.
Is that something I should follow, or can't I use it ? Can I somehow use the
underlying Apache ? Are there better options ?

any help/suggestions/hints are greatly appreciated !

mathias rockel


-- 
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] Persistent global data ?

2003-01-14 Thread Mathias Rockel
Hi!

I'm not sure if that would be a good idea in respect to performance, also
AFAIR cookies cannot save objects (can they?), and there are size
limitations on cookies, so I probably cannot use them because they could not
contain all the data ... and also, if I have the complete file structure
saved on the client side its very easy to modify the data, possibly getting
access to stuff that is not meant to be seen ... no cookies =).

thanks anyway !

 mathias rockel

- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Mathias Rockel" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 3:06 PM
Subject: Re: [PHP] Persistent global data ?


> cookies?
>
> - Original Message -
> From: "Mathias Rockel" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 14, 2003 7:33 AM
> Subject: [PHP] Persistent global data ?
>
>
> Hi all !
>
> I am currently writing some kind of Document/File-Library in a LAMP
> environment.
>
> As the library should be able to handle various file types, and most file
> types have to be handled differently internally, I would like to use
> Objects/Classes to make the code for the Library iself independent from
the
> stuff that is individual to the different file types.
>
> Now I noticed early that when I use Objects in PHP and have to create many
> for them each time a script runs it slows the system down considerably. It
> seems you can now save objects in sessions which AFAIR was not possible
last
> time I tried. But then I would have to read the whole file index (which is
> actually a tree) into a session variable for each user, and I don't know
if
> thats a good idea performancewise. It would be a rather large
> multi-dimensional array.
>
> So I would like to know if there is any possibility in PHP to create my
own
> persistent superglobal, a variable which can be read by any script
running.
> I think something similiar is available as the "Application" Object in ASP
> under IIS. I know I have to take care of locking and stuff (although the
> end-user scripts would only need read access to it), but if I could write
> some functions which just would check if the tree is already in memory or
> not (after a server shutdown or whatever), and if not just read it in from
> the database to make it available in every other script.
>
> The only thing I've found so far which I think may be a possibility is the
> shared memory stuff that PHP supports, but I don't know anything about
that
> on the system level, and its not explained in much detail in the PHP
manual.
> Is that something I should follow, or can't I use it ? Can I somehow use
the
> underlying Apache ? Are there better options ?
>
> any help/suggestions/hints are greatly appreciated !
>
> mathias rockel
>
>
> --
> 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: Amount of data in the database

2003-01-14 Thread Lars Olsson
Hello again!

Basically...you can't. What I meant was that when you insert the data 
into the table, you need to store the size as well.

Consider the following table (called files):

dataID			user	filename	size	filedata
[int, autoincremented]	[int]	[varchar]	[int]	[blob]

Now, let's say user 3 uploads the file 'airplane.jpg' to the server. We 
need to have the following information:

$filename = The name of the file
$filedata = The actual file
$size = The size of the uploaded file

You can find out about how to get these variables from 
http://www.php.net/manual/en/features.file-upload.php

Then you insert the data into your table;

"INSERT INTO files(user, filename, size, filedata)
	VALUES (3, $filename, $size, $filedata)"

This means that every time some user upload a file, the size of the file 
 will be tied to a particular record. Then you just use MySQLs built-in 
SUM function to find out the total amount of data (check my previous post)

Kindly


/Lars Olsson ([EMAIL PROTECTED])



Denis L. Menezes wrote:
Thanks Lars.

Sorry, then I have another question. How do I find the size of the record?

Thanks
Denis



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




[PHP] PHP locks up in WIndows - Help!

2003-01-14 Thread Bil Click
Hello -

I am trying to use a simple email script. When the php file is called, the
browser just hangs. If I look in Task Manager, the php.exe has stopped -
shows no activity. I am a PHP novice, so have tried several email scripts
from the 'Net. Currently trying the PHP Email Responder from
http://www.abspoel.com/roel-karin/download.php

New install of 4.3.0 on Windows 2000 Server/IIS5 in CGI mode. Executables
are in c:\php, php.ini in c:\winnt. I gave all "Read/Execute permissions by
IUSR_machine" per documentation. Set register_globals = true, no change.

If I run c:\php\php -i  from a DOS prompt I get a screen full of output.

Anyone can check out the config at: http://www.jernlaw.com/phpinfo.php

Any suggestions greatly appreciated!

Bil Click




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




[PHP] Going from 1040601600 to Human time

2003-01-14 Thread Davíð Örn Jóhannsson
I used mktime to make 1040601600 this stirng but I want to go back to
human readable time how should I do that?
 
Thanks, David



[PHP] data move, Please Help..

2003-01-14 Thread Edward Peloke
Ok, I know I have asked this question before and I have asked it on the db
forum, on asp forums, java applet forums,  searched google, etc but can't
really seem to find anything.  I have to come up with a way to move data
from an access db to the mysql db on the webserver.  If I have to, I can
upload the access file to the server and then transfer the data.  Are there
tutorials or samples somewhere of how to do this in php?

Best case scenario would be to come up with a way (using any tool, java,
activex, etc) to connect to the users machine and then upload the data
directly from there.

ANY help would be greatly appreciated!

THANKS,
Eddie


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




Re: [PHP] Going from 1040601600 to Human time

2003-01-14 Thread Chris Boget
> I used mktime to make 1040601600 this stirng but I want to go back to
> human readable time how should I do that?

date();
The first argument is the format specifier and the second argument is a
unix timestamp (ie, what mktime() returns).

Chris


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




Re: [PHP] Going from 1040601600 to Human time

2003-01-14 Thread Jason Wong
On Tuesday 14 January 2003 22:16, Davíð Örn Jóhannsson wrote:
> I used mktime to make 1040601600 this stirng but I want to go back to
> human readable time how should I do that?

strftime()

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
No question is so difficult as one to which the answer is obvious.
*/

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Happiness is a positive cash flow.
*/


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




Re: [PHP] Persistent global data ?

2003-01-14 Thread Rick Emery
Write persistent data to a file on server side

- Original Message - 
From: "Mathias Rockel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 8:12 AM
Subject: Re: [PHP] Persistent global data ?


Hi!

I'm not sure if that would be a good idea in respect to performance, also
AFAIR cookies cannot save objects (can they?), and there are size
limitations on cookies, so I probably cannot use them because they could not
contain all the data ... and also, if I have the complete file structure
saved on the client side its very easy to modify the data, possibly getting
access to stuff that is not meant to be seen ... no cookies =).

thanks anyway !

 mathias rockel

- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Mathias Rockel" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 3:06 PM
Subject: Re: [PHP] Persistent global data ?


> cookies?
>
> - Original Message -
> From: "Mathias Rockel" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 14, 2003 7:33 AM
> Subject: [PHP] Persistent global data ?
>
>
> Hi all !
>
> I am currently writing some kind of Document/File-Library in a LAMP
> environment.
>
> As the library should be able to handle various file types, and most file
> types have to be handled differently internally, I would like to use
> Objects/Classes to make the code for the Library iself independent from
the
> stuff that is individual to the different file types.
>
> Now I noticed early that when I use Objects in PHP and have to create many
> for them each time a script runs it slows the system down considerably. It
> seems you can now save objects in sessions which AFAIR was not possible
last
> time I tried. But then I would have to read the whole file index (which is
> actually a tree) into a session variable for each user, and I don't know
if
> thats a good idea performancewise. It would be a rather large
> multi-dimensional array.
>
> So I would like to know if there is any possibility in PHP to create my
own
> persistent superglobal, a variable which can be read by any script
running.
> I think something similiar is available as the "Application" Object in ASP
> under IIS. I know I have to take care of locking and stuff (although the
> end-user scripts would only need read access to it), but if I could write
> some functions which just would check if the tree is already in memory or
> not (after a server shutdown or whatever), and if not just read it in from
> the database to make it available in every other script.
>
> The only thing I've found so far which I think may be a possibility is the
> shared memory stuff that PHP supports, but I don't know anything about
that
> on the system level, and its not explained in much detail in the PHP
manual.
> Is that something I should follow, or can't I use it ? Can I somehow use
the
> underlying Apache ? Are there better options ?
>
> any help/suggestions/hints are greatly appreciated !
>
> mathias rockel
>
>
> --
> 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] data move, Please Help..

2003-01-14 Thread Rick Emery
try GOOGLE: access mysql php conversion

I did
- Original Message - 
From: "Edward Peloke" <[EMAIL PROTECTED]>
To: "PHP general list" <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 8:48 AM
Subject: [PHP] data move, Please Help..


Ok, I know I have asked this question before and I have asked it on the db
forum, on asp forums, java applet forums,  searched google, etc but can't
really seem to find anything.  I have to come up with a way to move data
from an access db to the mysql db on the webserver.  If I have to, I can
upload the access file to the server and then transfer the data.  Are there
tutorials or samples somewhere of how to do this in php?

Best case scenario would be to come up with a way (using any tool, java,
activex, etc) to connect to the users machine and then upload the data
directly from there.

ANY help would be greatly appreciated!

THANKS,
Eddie


-- 
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] Persistent global data ?

2003-01-14 Thread Mathias Rockel
Hi!

Yeah I know, but as I wrote below then I would need to put the complete file
library into each users session, which first blows that up considerably, and
scond probably is also slower as it is still read by each single script from
hard disk (session data file) and the objects are recreated ... what I'm
looking for is a superglobal which is actually never destroyed until the
server is shut down ... one that is in memory until I explicitely destroy it
... and that is available to each script that is run without the need to
create a copy each time ...

 mathias rockel

- Original Message -
From: "Jason Sheets" <[EMAIL PROTECTED]>
To: "Mathias Rockel" <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 3:26 PM
Subject: Re: [PHP] Persistent global data ?


> Take a look at sessions, $_SESSION is already a super global.
>
> If you want to store an object I believe you have to serialize() it
> first.
>
> Jason
>
>
> On Tue, 2003-01-14 at 06:33, Mathias Rockel wrote:
> > Hi all !
> >
> > I am currently writing some kind of Document/File-Library in a LAMP
> > environment.
> >
> > As the library should be able to handle various file types, and most
file
> > types have to be handled differently internally, I would like to use
> > Objects/Classes to make the code for the Library iself independent from
the
> > stuff that is individual to the different file types.
> >
> > Now I noticed early that when I use Objects in PHP and have to create
many
> > for them each time a script runs it slows the system down considerably.
It
> > seems you can now save objects in sessions which AFAIR was not possible
last
> > time I tried. But then I would have to read the whole file index (which
is
> > actually a tree) into a session variable for each user, and I don't know
if
> > thats a good idea performancewise. It would be a rather large
> > multi-dimensional array.
> >
> > So I would like to know if there is any possibility in PHP to create my
own
> > persistent superglobal, a variable which can be read by any script
running.
> > I think something similiar is available as the "Application" Object in
ASP
> > under IIS. I know I have to take care of locking and stuff (although the
> > end-user scripts would only need read access to it), but if I could
write
> > some functions which just would check if the tree is already in memory
or
> > not (after a server shutdown or whatever), and if not just read it in
from
> > the database to make it available in every other script.
> >
> > The only thing I've found so far which I think may be a possibility is
the
> > shared memory stuff that PHP supports, but I don't know anything about
that
> > on the system level, and its not explained in much detail in the PHP
manual.
> > Is that something I should follow, or can't I use it ? Can I somehow use
the
> > underlying Apache ? Are there better options ?
> >
> > any help/suggestions/hints are greatly appreciated !
> >
> > mathias rockel
> >
> >
> > --
> > 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] Persistent global data ?

2003-01-14 Thread Mathias Rockel
Hi all !

It seems I did not state exactly enough what I need ... if I use the
$_SESSION functions or write the stuff myself makes no difference, actually
then I can just leave it in the database and read it every time ... but that
is just slow ... I want to create it persistant in the system memory so
every script can access the contents without having to recreate the whole
tree each time ...

 mathias rockel

- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Mathias Rockel" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 3:30 PM
Subject: Re: [PHP] Persistent global data ?


> Write persistent data to a file on server side
>
> - Original Message -
> From: "Mathias Rockel" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 14, 2003 8:12 AM
> Subject: Re: [PHP] Persistent global data ?
>
>
> Hi!
>
> I'm not sure if that would be a good idea in respect to performance, also
> AFAIR cookies cannot save objects (can they?), and there are size
> limitations on cookies, so I probably cannot use them because they could
not
> contain all the data ... and also, if I have the complete file structure
> saved on the client side its very easy to modify the data, possibly
getting
> access to stuff that is not meant to be seen ... no cookies =).
>
> thanks anyway !
>
>  mathias rockel
>
> - Original Message -
> From: "Rick Emery" <[EMAIL PROTECTED]>
> To: "Mathias Rockel" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, January 14, 2003 3:06 PM
> Subject: Re: [PHP] Persistent global data ?
>
>
> > cookies?
> >
> > - Original Message -
> > From: "Mathias Rockel" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 14, 2003 7:33 AM
> > Subject: [PHP] Persistent global data ?
> >
> >
> > Hi all !
> >
> > I am currently writing some kind of Document/File-Library in a LAMP
> > environment.
> >
> > As the library should be able to handle various file types, and most
file
> > types have to be handled differently internally, I would like to use
> > Objects/Classes to make the code for the Library iself independent from
> the
> > stuff that is individual to the different file types.
> >
> > Now I noticed early that when I use Objects in PHP and have to create
many
> > for them each time a script runs it slows the system down considerably.
It
> > seems you can now save objects in sessions which AFAIR was not possible
> last
> > time I tried. But then I would have to read the whole file index (which
is
> > actually a tree) into a session variable for each user, and I don't know
> if
> > thats a good idea performancewise. It would be a rather large
> > multi-dimensional array.
> >
> > So I would like to know if there is any possibility in PHP to create my
> own
> > persistent superglobal, a variable which can be read by any script
> running.
> > I think something similiar is available as the "Application" Object in
ASP
> > under IIS. I know I have to take care of locking and stuff (although the
> > end-user scripts would only need read access to it), but if I could
write
> > some functions which just would check if the tree is already in memory
or
> > not (after a server shutdown or whatever), and if not just read it in
from
> > the database to make it available in every other script.
> >
> > The only thing I've found so far which I think may be a possibility is
the
> > shared memory stuff that PHP supports, but I don't know anything about
> that
> > on the system level, and its not explained in much detail in the PHP
> manual.
> > Is that something I should follow, or can't I use it ? Can I somehow use
> the
> > underlying Apache ? Are there better options ?
> >
> > any help/suggestions/hints are greatly appreciated !
> >
> > mathias rockel
> >
> >
> > --
> > 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
>


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




Re: [PHP] Going from 1040601600 to Human time

2003-01-14 Thread Chris Boget
> > I used mktime to make 1040601600 this stirng but I want to go back to
> > human readable time how should I do that?
> strftime()

Wow, that's pretty cool.  I never knew about that function.  I just always
used date().  
There are so many different ways to do something and one of the main
reasons I like this list so much is that you can learn alot of them.

Chris


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




RE: [PHP] mail client?

2003-01-14 Thread Steven Balthazor
I use and recommend Squirrelmail.
http://www.squirrelmail.org/

Steven Balthazor
-Original Message-
From: Henning Olsen [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 7:03 AM
To: [EMAIL PROTECTED]
Subject: [PHP] mail client?


Does anyone know any reliable php/mysql mail-clients with support for pop3?

Yours

Henning


-- 
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: permission denied

2003-01-14 Thread Anthony Ritter
Lars,
I use Win98 and Apache to test the .php script.

My ISP has IIS.
TR



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




RE: [PHP] data move, Please Help..

2003-01-14 Thread Edward Peloke
thanks Rick, I did that and did find more stuff.  I guess I need to find
more odbc info so that I can use that to move the data over.  After I have
uploaded the file, can I create an odbc connection in php and then use php
also to move data from access to the mysql db?

Thanks,
Eddie

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 9:33 AM
To: Edward Peloke; PHP general list
Subject: Re: [PHP] data move, Please Help..


try GOOGLE: access mysql php conversion

I did
- Original Message -
From: "Edward Peloke" <[EMAIL PROTECTED]>
To: "PHP general list" <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 8:48 AM
Subject: [PHP] data move, Please Help..


Ok, I know I have asked this question before and I have asked it on the db
forum, on asp forums, java applet forums,  searched google, etc but can't
really seem to find anything.  I have to come up with a way to move data
from an access db to the mysql db on the webserver.  If I have to, I can
upload the access file to the server and then transfer the data.  Are there
tutorials or samples somewhere of how to do this in php?

Best case scenario would be to come up with a way (using any tool, java,
activex, etc) to connect to the users machine and then upload the data
directly from there.

ANY help would be greatly appreciated!

THANKS,
Eddie


--
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] mail client?

2003-01-14 Thread Jason Wong
On Tuesday 14 January 2003 22:45, Steven Balthazor wrote:
> I use and recommend Squirrelmail.
> http://www.squirrelmail.org/

Squirrelmail doesn't support POP3 on it's own which is what the OP wanted.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
When we are planning for posterity, we ought to remember that virtue is
not hereditary.
-- Thomas Paine
*/


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




Re: [PHP] mail client?

2003-01-14 Thread Joshua Pierre
> Does anyone know any reliable php/mysql mail-clients with support for pop3?

IMP perhaps ?

Have a look over at http://www.horde.org/

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




Re: [PHP] Going from 1040601600 to Human time

2003-01-14 Thread Jason Wong
On Tuesday 14 January 2003 22:38, Chris Boget wrote:
> > > I used mktime to make 1040601600 this stirng but I want to go back to
> > > human readable time how should I do that?
> >
> > strftime()
>
> Wow, that's pretty cool.  I never knew about that function.  I just always
> used date().
> There are so many different ways to do something and one of the main
> reasons I like this list so much is that you can learn alot of them.

The php manual makes wonderful bedtime reading material (for insomniacs who 
wants to to get some sleep).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Bridge ahead.  Pay troll.
*/


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




Re: [PHP] globals off in function

2003-01-14 Thread Michael Bevz

Chris Hayes <[EMAIL PROTECTED]> ïèøåò â
ñîîáùåíèè:[EMAIL PROTECTED]
>
> >in function i call to $smarty variable
> >"
> >function showLoginForm(){
> >
> >global $db, $smarty; // $smarty = new Smarty in main code
> >Fatal error: Call to a member function on a non-object in
>
> Are you sure
> $smarty = new Smarty
> is in the main code?
> Can it be in another function?
>
> Try setting
> global $smarty;
> just before you create $smarty.
>
> Does that help?
Thanks, that's nice help :)

>
> >( register_globals = off )
> >Imho, globals don't working with "globals off", nut i can't find this in
> >manual.
> no, register_globals is only about the automatical production of variables
> from FORM, GET and other data input.
> But i fully agree the name is confusing.
>



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




Re: [PHP] HTTP_ACCEPT - Reliabilty?

2003-01-14 Thread Chris Shiflett
--- Danny Shepherd <[EMAIL PROTECTED]> wrote:
> No, I wouldn't rely on it at all, I couldn't find a
> browser that *does* have that mime-type in it's
> header!

Danny is right. The reason you cannot depend on the Accept
header is that most browsers will include */* as an
acceptable type (which basically means the browser will
accept any type/subtype) and assign it the lowest quality
factor.

I cannot imagine a Web browser that will prefer Flash
(assigning it anything but the lowest quality factor);
maybe some Web developers should consider that when
designing user interfaces. :-)

Chris

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




Re: [PHP] Cookie, header, output problems

2003-01-14 Thread Chris Shiflett
--- "J. Alden Gillespy" <[EMAIL PROTECTED]> wrote:
> I'm creating an e-commerce website, and I just need
> clarification as to whether a MySQL query is
> considered as "browser output". 

It is not. However, a MySQL error is indeed output. Make
sure your query is successful.

My suggestion would be to simplify your code. Test your
queries independently of setting cookies and redirecting.
You have too many potential cases for error as it is, and
that makes things difficult.

> mysql_query("select * from `$cart->user_table` where
> username=\"$username\" and userpass=\"$userpass\"",
> $cart->dblink)

I'm not sure if it is just formatting or my eyes, but it
looks like you have backticks in your query. Also, you
should consider using single quotes around your values
rather than escaped double quotes.

> setcookie("jackloren_user", "$username:$userpass", time()
> + 2592000);
> header("Location: http://www.jackloren.com/";);

You should test this combination separately. Depending on
several factors, your cookie may not be getting set due to
the Location header redirect. The combination works fine
with most modern Web agents, but it has been known to pose
problems for developers.

Chris

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




Re: [PHP] session_destroy problem

2003-01-14 Thread Tamas Arpad
On Monday 13 January 2003 18:09, Scott Fletcher wrote:
> It's no problem.  We're all very interesting in finding out what can work.
>
> Maybe I can help with one of this problem.  The Gecko browser does have the
> option of blocking the opening of hte unrequest window which is maybe why
> yours doesn't work in Mozilla.  Just wondeirng...
No, the setting called "Open unrequested windows" is turned on in my browser 
(Mozilla 1.0.1), and all other settings on that page are also turned on, so I 
don't know why window.open call doesn't work in onunload event handler.
By the way it's not a problem for me :)) I don't know if it works for the 
original poster.
I try to always avoid using javascript, I think the session expiration is 
still a better way to force logging out a visitor who forgot to click on the 
logout button.
Arpi

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




Re: [PHP] session_destroy problem

2003-01-14 Thread Scott Fletcher
Me too.  I alway try to avoid javascript.  I have one workaround to the
problem that keep me from having a headache with the browser
incompatibilities.  Since I already have a table in the database that deal
with the session number, timestamp and user id.  All I have to do is to
detect the duplicate user id and check to see if if user is online for no
more than 15 minutes by checking the timestamp.  If more than 15 minutes
then I deleted the existing session id then delete the duplicate user.  When
all goes well, then I create a new session id and insert it into the
database along with the user id and a timestamp.  And I do the manual clean
up of the leftover session in the /tmp directory every few weeks.  Not what
I would like to have but there's nothing I can do about browser
incompatibilities and javascript issues.  If we're lucky, this would take 20
years or more for the problem to be fixed.

"Tamas Arpad" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Monday 13 January 2003 18:09, Scott Fletcher wrote:
> It's no problem.  We're all very interesting in finding out what can work.
>
> Maybe I can help with one of this problem.  The Gecko browser does have
the
> option of blocking the opening of hte unrequest window which is maybe why
> yours doesn't work in Mozilla.  Just wondeirng...
No, the setting called "Open unrequested windows" is turned on in my browser
(Mozilla 1.0.1), and all other settings on that page are also turned on, so
I
don't know why window.open call doesn't work in onunload event handler.
By the way it's not a problem for me :)) I don't know if it works for the
original poster.
I try to always avoid using javascript, I think the session expiration is
still a better way to force logging out a visitor who forgot to click on the
logout button.
Arpi



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




[PHP] Data type issues

2003-01-14 Thread Peter Hutnick
I can't get my head around dealing with all the magic that PHP does to my
data.  I'm trying to do the following (in C++):

   char a = 'a';
   a = a + 13;

The resulting value of a is 'n'.  If I do the equivalent in PHP ($a = "a";
$a += 13;) the resulting value is 13.  I tried (int)$a += 13;, but that
doesn't make a difference.

Is there some "whole different way of thinking" I should be engaged in? 
Is there some way to make PHP add an int to the ASCII value of a single
character string (since there seems to be no char type)?


Thanks,

Peter



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




[PHP] Oracle and CLOBs

2003-01-14 Thread Jadiel Flores
Hi, I'm having a big problem with php and Oracle.

I'm using Oracle 8.1.6 and PHP 4.2 with the Oracle component in a Solaris 
server, I can not recompile apache and php to install the oci8 component 
and I'm having lot of problems with CLOBs, I'm receiving this error:

Warning: Ora_Exec failed (ORA-00932: inconsistent datatypes -- while
processing OCI function OEXEC/OEXN) in
/var/www/espejo/includes/con.php on line 107

Line 107 contains this code:
Ora_Exec($this->cursor);

The query is:
SELECT Title, NewsDate, Content FROM inf_news WHERE ID_News = 5

Where:
Title is VarChar, NewsDate is Date and Content is a CLOB

It works fine if the query doesn't contain the CLOB field.

Any suggestion???


Jadiel Flores
-
http://www.abargon.com
[EMAIL PROTECTED]
(52-55) 52-29-80-34



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



[PHP] Re: Data type issues

2003-01-14 Thread Bastian Vogt
Hi Peter,

you're looking for "ord();"

cu,
Bastian

>
> Is there some way to make PHP add an int to the ASCII value of a single
> character string (since there seems to be no char type)?
>
> Thanks,
>
> Peter


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




RE: [PHP] include_files message question

2003-01-14 Thread Jesse Cablek
Allen Byington  scribbled;

[snip]
> 
> *** Error Begins ***
> Fatal error: Failed opening required 'includes/config.inc.php'
> (include_path='/usr/local/lib/php') in
> /opt/apache/htdocs/admin/includes/auth.inc.php on line 24
> *** Error Ends ***
> 

You don't seem to have "." in your include_path, add it in your php.ini:
include_path = "/usr/local/lib/php:."

-jesse


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




[PHP] Parse error

2003-01-14 Thread Brent Lee
I'm new to PHP and am slowly learning it. I have the following code that is
giving me errors could someone take a look and suggest a fix?

Parse error: parse error in /home//public_html/Info/datain.php on
line 7








--

Thanks
__
Brent Lee



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




Re: [PHP] Parse error

2003-01-14 Thread Joseph W. Goff
Try this...

$sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary)
VALUES ('$first','$last','$nickname',)";

- Original Message -
From: "Brent Lee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 10:02 AM
Subject: [PHP] Parse error


> I'm new to PHP and am slowly learning it. I have the following code that
is
> giving me errors could someone take a look and suggest a fix?
>
> Parse error: parse error in /home//public_html/Info/datain.php on
> line 7
>
> 
>  $db = mysql_connect("localhost", "","xx");
> mysql_select_db("learndb",$db);
> $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary)
> VALUES ('$first','$last','$nickname',)
> $result = mysql_query'($sql);
> echo "Thank you! Information entered.\n";
> ?>
> 
>
>
>
>
> --
>
> Thanks
> __
> Brent Lee
>
>
>
> --
> 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] session_destroy problem

2003-01-14 Thread Larry Brown
For those who don't mind working with Javascript I have found a method of
maintaining the sessions to a minimum length.  According to the Javascript
list there is no way to get the url of the site the user is going to next so
there is no way to tell if the onunload is due to a site change or the
movement from one page on your site to another.  So here is my solution...

When the user logs on they are given a code that is derived from the time of
login.  Each pages checks that the decoded number results in a time of less
than 8 hours from login.  If it is greater than 8 they are just prompted to
re-login.  There will be a database entry for each time a page is loaded by
the same user.  This time is checked periodically, every 5 minutes should
do.  If they have not loaded a page in the last 5 minutes the session is
removed.  Now, each page that does not post anything will have a refresh set
to 3 minutes so that people that have their browser set to the site in the
background while they work on other programs etc. won't get kicked off.

This has just been arrived at to solve the session destroy problem but it
looks like it will work.  I also don't know what this would do to a high
volume site either but for me it should be workable.  I hope this helps
some.

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




[PHP] norteh explode

2003-01-14 Thread Clivus2k1
okay guys i have this script to use the first exploded part as the trigger 
then the rest sent in a msg, ive got the trigger but its just the message 
part im having probs with, how do i make it so anything after x is sent; in 
this i need $text to be set as it, any sort of help is greatly appreciated 
:-)

/*CODE*/


- CS



[PHP] PostgreSQL Cursor ROWCOUNT

2003-01-14 Thread typea
Given:
PHP 4.x
PostgreSQL 7.3.x

In 'psql' monitor:
declare foo cursor for select * from humongous_table;
move forward all in foo;

The second query will print out a number which informs one of the actual
number of rows that are in the cursor's query's result set, if one were to
actually fetch them all.  I would like to get to that number in PHP.

Alas, as far as I can tell, there is to way to get that number through the
PHP API...

For sure:
pg_num_rows -- only counts rows actually "fetched"
pg_last_notice -- nope
pg_result_error -- nope
pg_result_status -- nope

No other documented functions seem appropriate, though I may have missed
one...




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




[PHP] Re: Persistent global data ?

2003-01-14 Thread Philip Hallstrom
http://www.php.net/manual/en/ref.shmop.php

On Tue, 14 Jan 2003, Mathias Rockel wrote:

> Hi all !
>
> It seems I did not state exactly enough what I need ... if I use the
> $_SESSION functions or write the stuff myself makes no difference, actually
> then I can just leave it in the database and read it every time ... but that
> is just slow ... I want to create it persistant in the system memory so
> every script can access the contents without having to recreate the whole
> tree each time ...
>
>  mathias rockel
>
> - Original Message -
> From: "Rick Emery" <[EMAIL PROTECTED]>
> To: "Mathias Rockel" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, January 14, 2003 3:30 PM
> Subject: Re:  Persistent global data ?
>
>
> > Write persistent data to a file on server side
> >
> > - Original Message -
> > From: "Mathias Rockel" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 14, 2003 8:12 AM
> > Subject: Re:  Persistent global data ?
> >
> >
> > Hi!
> >
> > I'm not sure if that would be a good idea in respect to performance, also
> > AFAIR cookies cannot save objects (can they?), and there are size
> > limitations on cookies, so I probably cannot use them because they could
> not
> > contain all the data ... and also, if I have the complete file structure
> > saved on the client side its very easy to modify the data, possibly
> getting
> > access to stuff that is not meant to be seen ... no cookies =).
> >
> > thanks anyway !
> >
> >  mathias rockel
> >
> > - Original Message -
> > From: "Rick Emery" <[EMAIL PROTECTED]>
> > To: "Mathias Rockel" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 14, 2003 3:06 PM
> > Subject: Re:  Persistent global data ?
> >
> >
> > > cookies?
> > >
> > > - Original Message -
> > > From: "Mathias Rockel" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, January 14, 2003 7:33 AM
> > > Subject:  Persistent global data ?
> > >
> > >
> > > Hi all !
> > >
> > > I am currently writing some kind of Document/File-Library in a LAMP
> > > environment.
> > >
> > > As the library should be able to handle various file types, and most
> file
> > > types have to be handled differently internally, I would like to use
> > > Objects/Classes to make the code for the Library iself independent from
> > the
> > > stuff that is individual to the different file types.
> > >
> > > Now I noticed early that when I use Objects in PHP and have to create
> many
> > > for them each time a script runs it slows the system down considerably.
> It
> > > seems you can now save objects in sessions which AFAIR was not possible
> > last
> > > time I tried. But then I would have to read the whole file index (which
> is
> > > actually a tree) into a session variable for each user, and I don't know
> > if
> > > thats a good idea performancewise. It would be a rather large
> > > multi-dimensional array.
> > >
> > > So I would like to know if there is any possibility in PHP to create my
> > own
> > > persistent superglobal, a variable which can be read by any script
> > running.
> > > I think something similiar is available as the "Application" Object in
> ASP
> > > under IIS. I know I have to take care of locking and stuff (although the
> > > end-user scripts would only need read access to it), but if I could
> write
> > > some functions which just would check if the tree is already in memory
> or
> > > not (after a server shutdown or whatever), and if not just read it in
> from
> > > the database to make it available in every other script.
> > >
> > > The only thing I've found so far which I think may be a possibility is
> the
> > > shared memory stuff that PHP supports, but I don't know anything about
> > that
> > > on the system level, and its not explained in much detail in the PHP
> > manual.
> > > Is that something I should follow, or can't I use it ? Can I somehow use
> > the
> > > underlying Apache ? Are there better options ?
> > >
> > > any help/suggestions/hints are greatly appreciated !
> > >
> > > mathias rockel
> > >
> > >
> > > --
> > > 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
> >
>
>
> --
> 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] Parse error

2003-01-14 Thread M.A.Bond

I'm new to PHP and am slowly learning it. I have the following code that is
giving me errors could someone take a look and suggest a fix?

Parse error: parse error in /home//public_html/Info/datain.php on
line 7


http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Parse error

2003-01-14 Thread Brent Lee
Everything works great now. Thanks for the quick responses everyone.

"Brent Lee" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm new to PHP and am slowly learning it. I have the following code that
is
> giving me errors could someone take a look and suggest a fix?
>
> Parse error: parse error in /home//public_html/Info/datain.php on
> line 7
>
> 
>  $db = mysql_connect("localhost", "","xx");
> mysql_select_db("learndb",$db);
> $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary)
> VALUES ('$first','$last','$nickname',)
> $result = mysql_query'($sql);
> echo "Thank you! Information entered.\n";
> ?>
> 
>
>
>
>
> --
>
> Thanks
> __
> Brent Lee
>
>



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




[PHP] valid MySQL result resource

2003-01-14 Thread Brent Lee
Here is another error I'm getting while trying to view my db. I copied
and pasted these statements from a pdf file I'm using to learn PHP but they
keep creating errors.
I am writing all your tips into my notes to try to keep my questioning
to a minimal.

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in /home/xxx/public_html/Info/viewdb.php on line 8




";
echo"Full NameNick NameSalary";
while ($myrow = mysql_fetch_array($result))
{
echo "";
echo $myrow["firstname"];
echo " ";
echo $myrow["lastname"];
echo "";
echo $myrow["nick"];
echo "";
echo $myrow["salary"];
}
echo "";
?>



--

Thanks
__
Brent Lee



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




Re: [PHP] Re: Persistent global data ?

2003-01-14 Thread Mathias Rockel
Hi!

So this is the only way I guess ...

Do you propose to serialize() the objects in the tree and write that data
into a shared memory block, and then deserialize them at the beginning of
each script that needs the data back into objects ? I would think that that
would impose the same performance penaltys from creating the objects again
(this seems to be what slows php down), only the reading process ist sped up
... not exactly what I would like, but seems PHP provides no other
functionality ...

mathias rockel

- Original Message -
From: "Philip Hallstrom" <[EMAIL PROTECTED]>
To: "Mathias Rockel" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 5:26 PM
Subject: [PHP] Re: Persistent global data ?


> http://www.php.net/manual/en/ref.shmop.php
>
> On Tue, 14 Jan 2003, Mathias Rockel wrote:
>
> > Hi all !
> >
> > It seems I did not state exactly enough what I need ... if I use the
> > $_SESSION functions or write the stuff myself makes no difference,
actually
> > then I can just leave it in the database and read it every time ... but
that
> > is just slow ... I want to create it persistant in the system memory so
> > every script can access the contents without having to recreate the
whole
> > tree each time ...
> >
> >  mathias rockel
> >
> > - Original Message -
> > From: "Rick Emery" <[EMAIL PROTECTED]>
> > To: "Mathias Rockel" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 14, 2003 3:30 PM
> > Subject: Re:  Persistent global data ?
> >
> >
> > > Write persistent data to a file on server side
> > >
> > > - Original Message -
> > > From: "Mathias Rockel" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, January 14, 2003 8:12 AM
> > > Subject: Re:  Persistent global data ?
> > >
> > >
> > > Hi!
> > >
> > > I'm not sure if that would be a good idea in respect to performance,
also
> > > AFAIR cookies cannot save objects (can they?), and there are size
> > > limitations on cookies, so I probably cannot use them because they
could
> > not
> > > contain all the data ... and also, if I have the complete file
structure
> > > saved on the client side its very easy to modify the data, possibly
> > getting
> > > access to stuff that is not meant to be seen ... no cookies =).
> > >
> > > thanks anyway !
> > >
> > >  mathias rockel
> > >
> > > - Original Message -
> > > From: "Rick Emery" <[EMAIL PROTECTED]>
> > > To: "Mathias Rockel" <[EMAIL PROTECTED]>;
> > > <[EMAIL PROTECTED]>
> > > Sent: Tuesday, January 14, 2003 3:06 PM
> > > Subject: Re:  Persistent global data ?
> > >
> > >
> > > > cookies?
> > > >
> > > > - Original Message -
> > > > From: "Mathias Rockel" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Tuesday, January 14, 2003 7:33 AM
> > > > Subject:  Persistent global data ?
> > > >
> > > >
> > > > Hi all !
> > > >
> > > > I am currently writing some kind of Document/File-Library in a LAMP
> > > > environment.
> > > >
> > > > As the library should be able to handle various file types, and most
> > file
> > > > types have to be handled differently internally, I would like to use
> > > > Objects/Classes to make the code for the Library iself independent
from
> > > the
> > > > stuff that is individual to the different file types.
> > > >
> > > > Now I noticed early that when I use Objects in PHP and have to
create
> > many
> > > > for them each time a script runs it slows the system down
considerably.
> > It
> > > > seems you can now save objects in sessions which AFAIR was not
possible
> > > last
> > > > time I tried. But then I would have to read the whole file index
(which
> > is
> > > > actually a tree) into a session variable for each user, and I don't
know
> > > if
> > > > thats a good idea performancewise. It would be a rather large
> > > > multi-dimensional array.
> > > >
> > > > So I would like to know if there is any possibility in PHP to create
my
> > > own
> > > > persistent superglobal, a variable which can be read by any script
> > > running.
> > > > I think something similiar is available as the "Application" Object
in
> > ASP
> > > > under IIS. I know I have to take care of locking and stuff (although
the
> > > > end-user scripts would only need read access to it), but if I could
> > write
> > > > some functions which just would check if the tree is already in
memory
> > or
> > > > not (after a server shutdown or whatever), and if not just read it
in
> > from
> > > > the database to make it available in every other script.
> > > >
> > > > The only thing I've found so far which I think may be a possibility
is
> > the
> > > > shared memory stuff that PHP supports, but I don't know anything
about
> > > that
> > > > on the system level, and its not explained in much detail in the PHP
> > > manual.
> > > > Is that something I should follow, or can't I use it ? Can I somehow
use
> > > the
> > > > underlying Apache ? Are there better options ?
> > > >
> > > > any help/s

Re: [PHP] Re: Persistent global data ?

2003-01-14 Thread Tamas Arpad
> So this is the only way I guess ...
>
> Do you propose to serialize() the objects in the tree and write that data
> into a shared memory block, and then deserialize them at the beginning of
> each script that needs the data back into objects ? I would think that that
> would impose the same performance penaltys from creating the objects again
> (this seems to be what slows php down), only the reading process ist sped
> up ... not exactly what I would like, but seems PHP provides no other
> functionality ...
>
> mathias rockel
There's another way with srm:
http://www.vl-srm.net/doc/features.application-vars.php
But I don't know if it's still maintaned.

Arpi

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




[PHP] Dumping Tables from MySQL

2003-01-14 Thread Don Mc Nair
Hi folks

I am having trouble writing a script to dump the data from tables in MYSQL.
Can anyone provide help on how to use the mysqldump command within PHP
(4.2).

Many thanks

Don

www.complementarymedicines.com


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 31/12/2002



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




Re: [PHP] valid MySQL result resource

2003-01-14 Thread Jason Wong
On Wednesday 15 January 2003 00:53, Brent Lee wrote:
> Here is another error I'm getting while trying to view my db. I copied
> and pasted these statements from a pdf file I'm using to learn PHP but they
> keep creating errors.
> I am writing all your tips into my notes to try to keep my questioning
> to a minimal.

Another tip, please search the archives before you post. In 99% of cases your 
problem has already been encountered and resolved.

> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
> result resource in /home/xxx/public_html/Info/viewdb.php on line 8

In cases like these searching the archives is a no brainer. Just plugin the 
error message and out pops your answer!

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The difference between dogs and cats is that dogs come when they're
called.  Cats take a message and get back to you.
*/


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




Re: [PHP] Dumping Tables from MySQL

2003-01-14 Thread Jason Wong
On Wednesday 15 January 2003 00:50, Don Mc Nair wrote:
> Hi folks
>
> I am having trouble writing a script to dump the data from tables in MYSQL.
> Can anyone provide help on how to use the mysqldump command within PHP
> (4.2).

To execute shell commands from php use shell_exec() and friends.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
One way to make your old car run better is to look up the price of a new 
model.
*/


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




Re: [PHP] Dumping Tables from MySQL

2003-01-14 Thread Chris Hayes
At 17:50 14-1-03, you wrote:
I am having trouble writing a script to dump the data from tables in MYSQL.
Can anyone provide help on how to use the mysqldump command within PHP
(4.2).

Many thanks

Don

Have a look at my wonderful script :) to use mysqldump to get yourself an 
email attachment of a complete database dump.

It's a very helpful script, if you put it on debug mode it checks all sorts 
of things about mysqldump, like the accessability, it finds the path (on 
unix/linux) and it gives helpful comment.
All support text is inside the file. 
http://www.hieris.info/over/backup/backup.php.txt

Pick out what you need. I would like to get a copy of what you do with it.


In case it turns out you do not have access to mysqldump i have made a hack 
on PHPmyAdmin to make it email the database as an atachment at a mouseclick.

Chris Hayes


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



[PHP] htmlspecialchars

2003-01-14 Thread Foong
Hi,
I wonder which is the better way to store data into database?
1. stor the data after we call htmlspecialchars with the data (means we
store " as "e; in database)
2. stor the data in non encoded form and call htmlspecialchars whenever we
want to display it.

Foong




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




[PHP] PHP and Oracle

2003-01-14 Thread Jadiel Flores
Hi, I'm having a big problem with php4 and Oracle 8.1.6 and I'd like to 
know if anybody knows how to handle CLOB fields using oracle's functions.

Thanks.


Jadiel Flores
-
http://www.abargon.com
[EMAIL PROTECTED]
(52-55) 52-29-80-34



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



[PHP] query question

2003-01-14 Thread Kelly Meeks
I've got an array of values, that I need to query against a database to see if any 
records have any of the values in the array - the array is a list of zip codes, and 
the database contains a list of stores.  Basically i need to find what stores have zip 
codes in the array.

I know that mysql doesn't support subquerys - is there a workaround for this kind of 
scenario?

TIA,

Kelly



RE: [PHP] Data type issues

2003-01-14 Thread Ford, Mike [LSS]
> -Original Message-
> From: Peter Hutnick [mailto:[EMAIL PROTECTED]]
> Sent: 14 January 2003 15:49
> 
> I can't get my head around dealing with all the magic that 
> PHP does to my
> data.

You need to read, very carefully, several times, the PHP manual section on
Type Juggling: http://www.php.net/manual/en/language.types.type-juggling.php

>  I'm trying to do the following (in C++):
> 
>char a = 'a';
>a = a + 13;
> 
> The resulting value of a is 'n'.  If I do the equivalent in 
> PHP ($a = "a";
> $a += 13;) the resulting value is 13.  I tried (int)$a += 
> 13;, but that
> doesn't make a difference.

Well, in an expression involving the arithmetic operators +-*/, and their
assignment equivalents += etc, all values are automatically converted to
numbers first -- and the numeric conversion of any string not starting with
a digit is 0.  So in your statement

   $a += 13

the content of $a (="a") is first converted to an integer, giving zero, and
then has 13 added to it -- hence 13.

> Is there some "whole different way of thinking" I should be 
> engaged in?

Yes -- probably several -- but in this case I'd say the concepts of loose
typing and automatic type conversion which depends on context, as well as
the way in which the various types get converted from one to another.
Because automatic type-conversion is performed so frequently by PHP, there
is actually very little use for the cast operators, although they do exist.

> Is there some way to make PHP add an int to the ASCII value 
> of a single
> character string (since there seems to be no char type)?

You need ord() and chr() -- yes, PHP is not the most elegant language in
this respect.

(By the by, watch out for the behaviour of ++ and -- when applied to
strings, as it probably isn't what you'd expect from the foregoing: {$b =
"a"; $b++;} will result in $b containing "b"!  And even then it's not
straightforward or totally intuitive -- before you use this behaviour,
figure out why {for ($a="a"; $a<="z"; $a++) echo $a;} *doesn't* display the
letters from a to z!!)

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] query question

2003-01-14 Thread Jason Wong
On Wednesday 15 January 2003 01:47, Kelly Meeks wrote:
> I've got an array of values, that I need to query against a database to see
> if any records have any of the values in the array - the array is a list of
> zip codes, and the database contains a list of stores.  Basically i need to
> find what stores have zip codes in the array.
>
> I know that mysql doesn't support subquerys - is there a workaround for
> this kind of scenario?

This is more of a mysql question and should be asked on the php-db list if not 
the mysql list.

What you need is something like:

  "SELECT doo FROM dah WHERE dee IN('val1', 'val2', ..., 'valN'"

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
PEGGY FLEMMING is stealing BASKET BALLS to feed the babies in VERMONT.
*/


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




Re: [PHP] htmlspecialchars

2003-01-14 Thread Chris Shiflett
--- Foong <[EMAIL PROTECTED]> wrote:
> I wonder which is the better way to store data into
> database?
> 1. stor the data after we call htmlspecialchars with the
> data (means we store " as "e; in database)
> 2. stor the data in non encoded form and call
> htmlspecialchars whenever we want to display it.

Option 2.

Please do not cross-post questions like this to the
developer's list. This list ([EMAIL PROTECTED]) is
the appropriate place for these types of questions.

Chris

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




Re: [PHP] htmlspecialchars

2003-01-14 Thread Jason Wong
On Wednesday 15 January 2003 01:24, Foong wrote:

> I wonder which is the better way to store data into database?
> 1. stor the data after we call htmlspecialchars with the data (means we
> store " as "e; in database)
> 2. stor the data in non encoded form and call htmlspecialchars whenever we
> want to display it.

It mostly depends on what you do with the data. For example:

If you only store the data once (and never re-edit it) then use (1).

If the data is used for other purposes as well (like gets sent in an email) 
then use (2).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
I wouldn't be so paranoid if you weren't all out to get me!!
*/


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




[PHP] --without-mysl in configure command

2003-01-14 Thread gamin
Pretty much of a newbie so please bear with the stupidity.

I have PHP 4.0.6 installed from rpm as part of RH 7.2. phpinfo() shows the
configure command having --without-mysql. But my php scripts seeem to be
able to run mysql commands happily.

Could anybody point out why ? Doin rpm -aq | grep php shows me that
php-mysql-4.0.6-7 is installed, maybe something to do with this.

Thank you

gamin.



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




Re: [PHP] --without-mysl in configure command

2003-01-14 Thread Johannes Schlueter
On Tuesday 14 January 2003 19:16, gamin wrote:
> I have PHP 4.0.6 installed from rpm as part of RH 7.2. phpinfo() shows the
> configure command having --without-mysql. But my php scripts seeem to be
> able to run mysql commands happily.
>
> Could anybody point out why ? Doin rpm -aq | grep php shows me that
> php-mysql-4.0.6-7 is installed, maybe something to do with this.

Yes, the last part is the imortant ;-) The PHP-MySQL-Extension was compile as 
shared extension. It is included in your php.ini file with a command sth. 
like extension=php_mysql.so

johannes

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




[PHP] Re: query question

2003-01-14 Thread Foong
hope this help

// array of zip codes
$zips = array(...);

// can use implode() here if you want
foreach($zips as $zip) {
$zip_list = ",'".$zip."'";
}

// take away the first comma
$zip_list = substr( $zip_list, 1);

$sql = "SELECT stores FROM store_table WHERE zip_code IN('$zip_list')";

$hdl = mysql_query($hdl);


Foong


Kelly Meeks <[EMAIL PROTECTED]> wrote in message
009c01c2bbf5$03496b00$6901a8c0@yourw92p4bhlzg">news:009c01c2bbf5$03496b00$6901a8c0@yourw92p4bhlzg...
I've got an array of values, that I need to query against a database to see
if any records have any of the values in the array - the array is a list of
zip codes, and the database contains a list of stores.  Basically i need to
find what stores have zip codes in the array.

I know that mysql doesn't support subquerys - is there a workaround for this
kind of scenario?

TIA,

Kelly




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




[PHP] Re: valid MySQL result resource

2003-01-14 Thread Foong
put the following line after you call mysql_query(..), you should be able to
see the error:

echo mysql_error();

this line is very handy to see what's wrong with mysql related operation.
Remember to delete it after debugging for security reasons

Foong


Brent Lee <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Here is another error I'm getting while trying to view my db. I copied
> and pasted these statements from a pdf file I'm using to learn PHP but
they
> keep creating errors.
> I am writing all your tips into my notes to try to keep my questioning
> to a minimal.
>
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
> result resource in /home/xxx/public_html/Info/viewdb.php on line 8
>
>
>
> 
>  $db = mysql_connect('localhost', 'x', 'xxx');
> mysql_select_db('learndb',$db);
> $result = mysql_query("SELECT * FROM personnel",$db);
> echo "";
> echo"Full NameNick NameSalary";
> while ($myrow = mysql_fetch_array($result))
> {
> echo "";
> echo $myrow["firstname"];
> echo " ";
> echo $myrow["lastname"];
> echo "";
> echo $myrow["nick"];
> echo "";
> echo $myrow["salary"];
> }
> echo "";
> ?>
> 
>
>
> --
>
> Thanks
> __
> Brent Lee
>
>



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




[PHP] PHP receiving e-mail

2003-01-14 Thread David Russell
Hi all,

I want to develop a script that can read an e-mail from a pop account,
and then perform actions on that e-mail based on characteristics of the
e-mail (e.g. header information, attachments, etc)

Does anyone know of a way to receive e-mails via php, and then to parse
them easily. My assumption would be that there should be a class out
there somewhere that handles it well.

Thanks

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com



smime.p7s
Description: application/pkcs7-signature


[PHP] Re: globals off in function

2003-01-14 Thread Foong
instead of:
global $smarty;
$smarty]->assign("message", $message);

try:
$_GLOBAL['smarty']->assign("message", $message);


Foong


Michael Bevz <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi, all!!!
> I've such trouble:
> ( register_globals = off )
>
> in function i call to $smarty variable
> "
> function showLoginForm(){
>
>global $db, $smarty; // $smarty = new Smarty in main code
>
>   $smarty->assign("message", $message); // 
> "
> and i receive this error message
> "
> Fatal error: Call to a member function on a non-object in
> /usr/home/elastic.org/work/svyatoshin/system/common_func.php on line 22
> "
>
> Imho, globals don't working with "globals off", nut i can't find this in
> manual.
>
> Who can help me?
>
>



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




Re: [PHP] --without-mysl in configure command

2003-01-14 Thread gamin

"Johannes Schlueter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Yes, the last part is the imortant ;-) The PHP-MySQL-Extension was compile
as
shared extension. It is included in your php.ini file with a command sth.
like extension=php_mysql.so

johannes

Thx Johannes for pointing this out.  In the php.ini file i have
extension=mysql.so Now i have another webserver running PHP where the
configure command has --with-mysql=shared. I guess this means the same
thing. Please could you second that and remove all doubts.

thx

g



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




[PHP] Re: htmlspecialchars

2003-01-14 Thread Foong
Thank you guys

Foong

Foong <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> I wonder which is the better way to store data into database?
> 1. stor the data after we call htmlspecialchars with the data (means we
> store " as "e; in database)
> 2. stor the data in non encoded form and call htmlspecialchars whenever we
> want to display it.
>
> Foong
>
>
>



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




Re: [PHP] --without-mysl in configure command

2003-01-14 Thread Johannes Schlueter
On Tuesday 14 January 2003 19:54, gamin wrote:
> Thx Johannes for pointing this out.  In the php.ini file i have

Your welcome ;-)

> extension=mysql.so Now i have another webserver running PHP where the
> configure command has --with-mysql=shared. I guess this means the same
> thing. Please could you second that and remove all doubts.

There is a small difference, if configured using --with-mysql=shared when 
running make it makes a php binary AND  the mysql.so. If congigured 
--without-mysql and then run make it makes only the php binary then you need 
to make the mysql.so yourself (cd ext/mysql; phpize; configure; make). But 
finally you'll get the same result.

johannes

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




Re: [PHP] --without-mysl in configure command

2003-01-14 Thread gamin

"Johannes Schlueter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Tuesday 14 January 2003 19:54, gamin wrote:
> Thx Johannes for pointing this out.  In the php.ini file i have

Your welcome ;-)

> extension=mysql.so Now i have another webserver running PHP where the
> configure command has --with-mysql=shared. I guess this means the same
> thing. Please could you second that and remove all doubts.

There is a small difference, if configured using --with-mysql=shared when
running make it makes a php binary AND  the mysql.so.

How does it make mysql.so, using some code that is provided with the PHP
source or something that is already on the system (it looks for mysql on the
system) ?

If congigured
--without-mysql and then run make it makes only the php binary then you need
to make the mysql.so yourself (cd ext/mysql; phpize; configure; make).

I did not understand how to make mysql.so myself ? Not that i will be doing
this, but it is good to know and understand. Could you elaborate for the
benifit of a beginner. Thx again

 But
finally you'll get the same result.

johannes



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




RE: [PHP] portabily including files

2003-01-14 Thread Jesse Cablek
Tyler BIRD  scribbled;

> I'm trying to include
> 'http://www.myserver.com/conted/me.inc';
> portably on several mirrored servers like include
> '/conted/me.inc'
> , I was wondering if there was someway I could include
> files and have the implicity connect
> and down the load me.inc from the local server whatever server it
> happens to be on. 
> 
[snip]
> 
> for example
> on web2 box
> include 'conted/me.inc'; works fine
> 

This example should work on both, as it is a relative path.

Unless you mean you want all the mirrored servers to read off your ONE URL,
then you can include that whole URL (but I think that would defeat the
purpose of mirroring if they all read off main site)


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




[PHP] Authentication programming

2003-01-14 Thread Jordan Elver
Hi,
I'm about to start a new project which will require a login system. The system 
should allow for different types of access on a per page basis. I'm going to 
achieve the login system using sessions, which I have done before.

My problem is that I don't want to have to do much login checking on the 
actual pages within the system. I would like it to be included and handled 
oustide of the main application.



So, you set the permission for the individual page. I would also like to do 
this as a class, which I am not experienced in. I haven't found any very 
elegent solutions to this. Could anyone point out some urls or anything to 
show me in the right direction?

Cheers,
Jord
-- 
Jordan Elver
There's no 'I' in 'team'. But then there's no 'I' in 'useless smug colleague', 
either. And there's four in 'platitude-quoting idiot'. Go figure. -- David 
Brent (The Office)


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




RE: [PHP] data move, Please Help..

2003-01-14 Thread Edward Peloke
Has anyone uploaded a file and then used php to transfer the data between
the two databases??

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 10:27 AM
To: PHP general list
Subject: RE: [PHP] data move, Please Help..


thanks Rick, I did that and did find more stuff.  I guess I need to find
more odbc info so that I can use that to move the data over.  After I have
uploaded the file, can I create an odbc connection in php and then use php
also to move data from access to the mysql db?

Thanks,
Eddie

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 9:33 AM
To: Edward Peloke; PHP general list
Subject: Re: [PHP] data move, Please Help..


try GOOGLE: access mysql php conversion

I did
- Original Message -
From: "Edward Peloke" <[EMAIL PROTECTED]>
To: "PHP general list" <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 8:48 AM
Subject: [PHP] data move, Please Help..


Ok, I know I have asked this question before and I have asked it on the db
forum, on asp forums, java applet forums,  searched google, etc but can't
really seem to find anything.  I have to come up with a way to move data
from an access db to the mysql db on the webserver.  If I have to, I can
upload the access file to the server and then transfer the data.  Are there
tutorials or samples somewhere of how to do this in php?

Best case scenario would be to come up with a way (using any tool, java,
activex, etc) to connect to the users machine and then upload the data
directly from there.

ANY help would be greatly appreciated!

THANKS,
Eddie


--
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] Authentication programming

2003-01-14 Thread Stephen
Devarticles has a series of Authentication tutorails and the  a tutorial on
OOP itself. Here are the links:

http://www.devarticles.com/art/1/349

-- Member Script Tutorial: --
-- There are 6 parts --

http://www.devarticles.com/art/1/241
http://www.devarticles.com/art/1/245
http://www.devarticles.com/art/1/262
http://www.devarticles.com/art/1/285
http://www.devarticles.com/art/1/323

Part six isn't up yet so check back to the same site later...


- Original Message -
From: "Jordan Elver" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 3:07 PM
Subject: [PHP] Authentication programming


: Hi,
: I'm about to start a new project which will require a login system. The
system
: should allow for different types of access on a per page basis. I'm going
to
: achieve the login system using sessions, which I have done before.
:
: My problem is that I don't want to have to do much login checking on the
: actual pages within the system. I would like it to be included and handled
: oustide of the main application.
:
: 
:
: So, you set the permission for the individual page. I would also like to
do
: this as a class, which I am not experienced in. I haven't found any very
: elegent solutions to this. Could anyone point out some urls or anything to
: show me in the right direction?
:
: Cheers,
: Jord
: --
: Jordan Elver
: There's no 'I' in 'team'. But then there's no 'I' in 'useless smug
colleague',
: either. And there's four in 'platitude-quoting idiot'. Go figure. -- David
: Brent (The Office)
:
:
: --
: 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] Windows vs Linux

2003-01-14 Thread Beauford.2002
Hi

I just installed MySQL and PHP on Windows, and I have found that I am
getting all sorts of errors (in both) when I try to use some of the same
commands I use in the Linux versions.  Are their a lot of differences in the
two, and where can I find out what these are - I just got used to using them
in Linux

TIA



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




[PHP] emptying hte array??

2003-01-14 Thread Scott Fletcher
How to do the proper way of emptying hte array??

Example...

$a[0] = "test1";
$a[1] = "test2";
$a[2] = "test3";
$a[3] = "test4";

$a = "";<-- Is this hte proper way to do it

I would like the array to be cleared before being it get to be use over and
over

Thanks...



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




[PHP] Re: emptying hte array??

2003-01-14 Thread Scott Fletcher
Got an email...   The answer to this question is ...

--clip--
$a = array();

--clip--

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How to do the proper way of emptying hte array??
>
> Example...
>
> $a[0] = "test1";
> $a[1] = "test2";
> $a[2] = "test3";
> $a[3] = "test4";
>
> $a = "";<-- Is this hte proper way to do it
>
> I would like the array to be cleared before being it get to be use over
and
> over
>
> Thanks...
>
>



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




Re: [PHP] data move, Please Help..

2003-01-14 Thread TomH

From previous experience with this problem - the most 'relaible' method for me 
was to

(1) use the access/xls/whatever application to dump a CSV-type file
(2) upload the file to the appropriate location on your MySQL server
(3) write a PHJP script that use a standard LOAD DATA INFILE query.

From the MySQL Docs
-
7.15 LOAD DATA INFILE syntax

LOAD DATA [LOW_PRIORITY] [LOCAL] INFILE 'file_name.txt' [REPLACE | IGNORE]
INTO TABLE tbl_name
[FIELDS
[TERMINATED BY '\t']
[OPTIONALLY] ENCLOSED BY '']
[ESCAPED BY '\\' ]]
[LINES TERMINATED BY '\n']
[IGNORE number LINES]
[(col_name,...)]

The LOAD DATA INFILE statement reads rows from a text file into a table at a 
very high speed. If the LOCAL keyword is specified, the file is read from the 
client host. If LOCAL is not specified, the file must be located on the server. 
(LOCAL is available in MySQL 3.22.6 or later.)
-


HTH
Tom Henry


Rick Emery wrote:
try GOOGLE: access mysql php conversion

I did
- Original Message - 
From: "Edward Peloke" <[EMAIL PROTECTED]>
To: "PHP general list" <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 8:48 AM
Subject: [PHP] data move, Please Help..


Ok, I know I have asked this question before and I have asked it on the db
forum, on asp forums, java applet forums,  searched google, etc but can't
really seem to find anything.  I have to come up with a way to move data
from an access db to the mysql db on the webserver.  If I have to, I can
upload the access file to the server and then transfer the data.  Are there
tutorials or samples somewhere of how to do this in php?

Best case scenario would be to come up with a way (using any tool, java,
activex, etc) to connect to the users machine and then upload the data
directly from there.

ANY help would be greatly appreciated!

THANKS,
Eddie




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




Re: [PHP] Windows vs Linux

2003-01-14 Thread Beauford.2002
The php.ini in both are whatever the default settings for these files are. If the 
defaults are different, then maybe - but I have no idea about these files, and really 
don't want to get into it. If the default doesn't work on Windows I will just scrap 
it.  Not worth the head aches.  Same with MySQL - getting errors as well where I get 
none in Linux.

Thanks for the info
  - Original Message - 
  From: [EMAIL PROTECTED] 
  To: [EMAIL PROTECTED] 
  Sent: Tuesday, January 14, 2003 4:02 PM
  Subject: Re: [PHP] Windows vs Linux


  In a message dated 1/14/2003 12:45:03 PM Pacific Standard Time, 
[EMAIL PROTECTED] writes:



I just installed MySQL and PHP on Windows, and I have found that I am
getting all sorts of errors (in both) when I try to use some of the same
commands I use in the Linux versions.  Are their a lot of differences in the
two, and where can I find out what these are - I just got used to using them
in Linux




  There really aren't any differences. Scripts that run on one, run on the other. The 
differences you are experiencing probably have to do with different settings. For 
isntance, you might have the error reporting level settings different. Or you might 
have register_globals set on in one and set off in the other. You need to check your 
php.ini files and make sure the settings are the same.

  Janet



[PHP] Why is my URL encoding itself?

2003-01-14 Thread Don
Hi,

I have a PHP file that displays a form and submits for processing.  The processing 
script redirects to a results page.  I am using formmail.php to process.

In my PHP page, the FORM line reads as:
echo '' . "\n";

When I try in I.E., it works fine.

When I try in Netscape 7, I get a page not found error.  Looking at Netscape's address 
bar, it says:
http://www.lclnav.com/staging_area/login/..%5Cphpscript%5Cgeneral%5Cformmail.php

Why is it encoding my URL???

Thanks,
Don




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


Re: [PHP] Why is my URL encoding itself?

2003-01-14 Thread Chris Shiflett
--- Don <[EMAIL PROTECTED]> wrote:
> In my PHP page, the FORM line reads as:
> echo ' action="..\phpscript\general\formmail.php">' . "\n";
> 
> When I try in I.E., it works fine.
> 
> When I try in Netscape 7, I get a page not found error.

This is something I refer to as Windowsitis. URLs use
slashes, not backslashes:

action="../phpscript/general/formmail.php"

Chris

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




Re: [PHP] Why is my URL encoding itself?

2003-01-14 Thread Don
- Original Message - 
From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: "Don" <[EMAIL PROTECTED]>; "php list" <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 4:24 PM
Subject: Re: [PHP] Why is my URL encoding itself?


> --- Don <[EMAIL PROTECTED]> wrote:
> > In my PHP page, the FORM line reads as:
> > echo ' > action="..\phpscript\general\formmail.php">' . "\n";
> > 
> > When I try in I.E., it works fine.
> > 
> > When I try in Netscape 7, I get a page not found error.
> 
> This is something I refer to as Windowsitis. URLs use
> slashes, not backslashes:
> 
> action="../phpscript/general/formmail.php"
> 
> Chris

Yup.  That was it.

My bad; I should have caught that.

Thanks,
Don


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003

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




[PHP] Re: PHP receiving e-mail

2003-01-14 Thread Philip Hallstrom
You could use fetchmail to get the mail and pipe it into your php script
which would see it as standard input...

Or look on zend.com for a POP class...

On Tue, 14 Jan 2003, David Russell wrote:

> Hi all,
>
> I want to develop a script that can read an e-mail from a pop account,
> and then perform actions on that e-mail based on characteristics of the
> e-mail (e.g. header information, attachments, etc)
>
> Does anyone know of a way to receive e-mails via php, and then to parse
> them easily. My assumption would be that there should be a class out
> there somewhere that handles it well.
>
> Thanks
>
> David Russell
> IT Support Manager
> Barloworld Optimus (Pty) Ltd
> Tel: +2711 444-7250
> Fax: +2711 444-7256
> e-mail: [EMAIL PROTECTED]
> web: www.BarloworldOptimus.com
>


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




RE: [PHP] htmlspecialchars

2003-01-14 Thread John W. Holmes


---John W. Holmes...

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

> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 14, 2003 1:09 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] htmlspecialchars
> 
> On Wednesday 15 January 2003 01:24, Foong wrote:
> 
> > I wonder which is the better way to store data into database?
> > 1. stor the data after we call htmlspecialchars with the data (means
we
> > store " as "e; in database)
> > 2. stor the data in non encoded form and call htmlspecialchars
whenever
> we
> > want to display it.
> 
> It mostly depends on what you do with the data. For example:
> 
> If you only store the data once (and never re-edit it) then use (1).
> 
> If the data is used for other purposes as well (like gets sent in an
> email)
> then use (2).

Even if you're going to edit it, it's better to do htmlspecialchars()
when you save the data. You have to do it anyhow, when you place it as
the value of a text box.

$value = 'This is "the" value';

Now if you try to put that in a text box like this:



Then you'll have problems. Yes, you can use single quotes, but then what
happens when there is a single quote in the data?

The best way to do it is to convert the special characters when you save
it. The only exception to this would be if you ever want to use that
data outside of HTML (i.e. mail, like you said). 

Hope that helps.

---John Holmes...



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




  1   2   >