[PHP] dynamic website screenshot/screen capture

2003-02-21 Thread olinux
Hi all - 
While I know that this is not possible with PHP alone,
Does anyone know how to capture website screen shots
using PHP. I have recieved many spam mails featuring a
screen shot of our company website and I imagine that
it would be quite possible combined with some sort of
web browser.

It would be great for a couple projects I'm working on
to use this in the same style as alexa.com. (featuring
screenshots next to search results.).

thanks for any info!

olinux

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



[PHP] cookie problem..

2003-02-21 Thread Terry Lau
Hello,
I want to set a cookie when I enter a text into the text field, and it 
shows the text I submitted immediately, thus I write a sample php code like 
this:


(I set the text field is Name and the data will be sent to another page)
In another page, I insert  in the 
beginning of the code.

Is the code right?

Then I run the test, I enter a name into the text field and submit it. But 
it shows "Notice: Undefined index: name in ..", it can't show the name I 
submitted.
Why?Anything wrong??

Thanks!!
Terry


_
¤µ¤é¬P®y  http://www.msn.com.hk/fortune/west/ ¹Bµ{ 

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


RE: [PHP] selection in form-field

2003-02-21 Thread John W. Holmes
Client side issue. Use javascript or DHTML.

---John W. Holmes...

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

> -Original Message-
> From: Michiel van Heusden [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 21, 2003 4:47 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] selection in form-field
> 
> i have quite an easy question:
> 
> is there a way in PHP to trace the selection in a certain form-field?
> i need this for building a simple html-edit application,
> which allows a user to select his/her text within a field, and then
click
> 'bold' for instance..the PHP should insert  before the selection,
and
>  after the selection.
> 
> 1) should i use PHP or is this a typical JavaScript-thing? (or a
> combination?)
> 2) if you could help with a function or small script I would me most
> grateful
> 
> grace
> michiel
> 
> 
> 
> --
> 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] Memory used by script...

2003-02-21 Thread John W. Holmes
> Hi... I got a big site, which is not very well constructed inside, and
the
> script began to throw (rather often, but NOT always) a fatal error "
Fatal
> error: Allowed memory size of 8388608 bytes exhausted ", every time in
> different places. I wonder how should I debug that, as there is pretty
> much
> code inside, and I hardly got aqcuainted with it in a whole.
> 
> SO THE QUESTION: Are there any functions or smth., to check, how much
> memory
> is used at some particular moment of execution of the script??? If I
could
> state, that for example after some class instantiaton memory usage
greatly
> increases, I would be able to localise the problem.

I remember asking about this a while ago. There were no answers. I don't
think there's any way for PHP to monitor it. Some web servers will store
the total amount of memory your script took up. So if you parse those
logs you may get the info you need. 

---John W. Holmes...

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



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



RE: [PHP] session expiration

2003-02-21 Thread John W. Holmes
> >> I'm using sessions for authentication in a content management
system
> and
> >> experiencing rare but occasional problems with the session
apparently
> >> expiring unexpectedly. I've checked the manual and I've reviewed
the
> > session
> >> configuration on the commericial host I'm using. I don't see
anything
> > wrong,
> >> but there are some settings that I don't understand:
> >>
> >> session.gc_maxlifetime 1440 -- Garbage collection after 24 minutes?
> Does
> >> this mean that the session id and session variables will be cleared
> after
> > 24
> >> minutes of inactivity? (Surely not; that doesn't make sense.) And
> cleared
> >> from where, the directory specified in session.save_path?
> >
> > Yes and Yes. After 1440 seconds of not being accessed, they are
deleted
> the
> > next time the garbage collection routine is ran.
> 
> So how did my tests of going up to 2 hours without activity succeed?

Like I said, it's a probability thing. Garbage collection has a 1%
chance of being iniated. It may take two hours for that 1% chance to hit
and clean up any data that's over 1440 seconds old. Other times, it may
hit it a couple times in a row quickly, so you lose your data very close
to 1440 seconds. 

[snip]
> > Another option would be to use session_save_path() within your
> application
> > to save the session files to a separate directory that's writable by
the
> web
> > server. Since this directory is different from session.save_path
> specified
> > in php.ini, garbage collection will never occur, so the files will
not
> be
> > deleted.
> 
> This seems like the answer I was looking for. So the setting
> session.gc_maxlifetime only relates to garbage collection from the
/tmp
> directory? If I use session_save_path() to define a different
directory
> for
> saving session data, then garbage collection will never occur for that
> directory?

Garbage collection is only triggered in the directory identified by
session.save_path, whatever it is. If you change it to something else in
your code, it's not affected by garbage collection. 

> > Why not just use a cookie to "remember me" though, instead of
keeping
> the
> > sessions persistant? You're going to end up with a file on your
computer
> for
> > _every_ person that visits the site and the file will not go away.
Seems
> > like it'd be better to just use a cookie and load their data if it's
not
> > already present, like on their first visit.
> 
> This is for a content management system, with less than 10 people
> authorized
> to access it, so I don't see the number of session files as a problem.

Have fun!

---John W. Holmes...

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



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



RE: [PHP] Re: including in shtml

2003-02-21 Thread John W. Holmes
> anyone?

Do you want everyone on the list to send you a message saying they're
not sure what to do?? Just be patient and if someone has an idea,
they'll let you know. 

---John W. Holmes...

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

> 
> "Hans Prins" <[EMAIL PROTECTED]> schreef in bericht
> news:[EMAIL PROTECTED]
> > Hello,
> >
> > I have a problem with including a "test.php" into a "test.shtml" and
> passing
> > a variable to the "test.shtml" which should be processed in the
> "test.php"
> >
> > the "test.php" document includes the following:
> > ---
> >
> >  >
> > if ($HTTP_GET_VARS['theValue']) {
> > print $HTTP_GET_VARS['theValue'];
> > } else {
> > print"
> > 
> > 
> > 
> > 
> > ";
> > }
> >
> > ?>
> >
> > the "test.shtml" document includes the following:
> > -
> >
> > 
> > 
> > poll
> > 
> > 
> > 
> > 
> > 
> >
> > I've also tried using the POST method but I got an error stating
that
> post
> > is not a valid method in shtml.
> >
> > I have also considered a session variable but since a session needs
to
> > initiated or continued before anything is output to the browser that
> wont
> > work (I think).
> >
> > does anyone have a solution to get this to work?
> >
> > thanks,
> > Hans



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



RE: [PHP] preg_match question: locating unmatched HTML tags

2003-02-21 Thread John W. Holmes
> I'm trying to build a regexp that would parse user-supplied text and
> identify cases where HTML tags are left open or are not properly
> matched-e.g.,  tags without closing  tags. This is for a sort
of
> message board type of application, and I'd like to allow users to use
> some HTML, but just would like to check to ensure that no stray tags
are
> input that would screw up the rest of the page's display. I'm new to
> regular expressions, and the one below is as far as I've gotten. If
> anyone has any suggestions, they'd be very much appreciated.

Letting users enter HTML is a bad idea. Even if you only let them use
 tags, they can still put ONCLICK and mouseover effects for the bold
text to screw with your other users.

Use a BB style code, such as [b] for bold, [i] for italics, etc. This
way, you only match pairs and replace them with HTML and use
htmlentities on anything else. This way an unmatched [b] tag won't be
replaced with  and mess up your code. 

---John W. Holmes...

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



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



RE: [PHP] Re: including in shtml

2003-02-21 Thread Matt Honeycutt
I'll check, but I'm pretty sure my host only allows me to edit the
existing *.shtml files to customize my error pages.  I don't think it
will allow me to set the error pages to different URL's.

---Matt

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 21, 2003 11:45 PM
To: 'Matt Honeycutt'; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: including in shtml

> If you figure out how to do this successfully, please share.  I'm
forced
> to use SHTML for my error pages (404.shtml and whatnot), but I'd like
to
> get those to interact with PHP as well.

Most any web server will allow you to set a URL as the error handler, so
you can have it as a PHP page. Is there a specific reason why you can't?

---John W. Holmes...

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






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



RE: [PHP] MAC address user recognition?

2003-02-21 Thread Larry Brown
One other thing you could do is simply set up SSL with your own certificate
so that it will encrypt the connection and then run code via JAVA or some
other client side applet that will get the MAC address from the client
machine directly.  You can then check the MAC against the addresses allowed.
Since the connection is encrypted nobody knows that that is what you are
checking.  Of course there is still a potential for someone that you
previously allowed access to find out how you are identifying them and use
it against you later on, but there are also problems with identifying
someone by their computer unless they keep the computer locked in a closet
while they are away.  I guess it depends on what you are protecting.
National secrets etc.  By the way, open SSL with self signed certs is a free
method but it is not a good idea if you are needing to verify your
credentials to the person coming in.

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

-Original Message-
From: Leo Spalteholz [mailto:[EMAIL PROTECTED]
Sent: Friday, February 21, 2003 12:59 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] MAC address user recognition?

On February 20, 2003 08:13 pm, Jason Sheets wrote:
> MAC addresses are used for on a LAN and not the Internet.  Using a
> MAC address might work for identification on a LAN BUT in most
> operating systems you can easily change the effective MAC address
> on the card.

Good call.  I thought there was some fundemental problem I just
couldn't remember enough from my networking class to put my finger on
it.

> It would probably be better to look for some other form of
> identification like SSL certificates or a cookie with the secure
> bit on so it will only be sent over an SSL connection.

Yeah I'm not super concerned about security and such, this is only a
personal page so something simple will do the job.  I think I'll just
end up hacking together my own encryption algorithm and then storing
encrypted passwords in a cookie.
Hehe.  Security through obscurity, everyones favorite way :)

Thanks,
Leo

--
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: including in shtml

2003-02-21 Thread John W. Holmes
> If you figure out how to do this successfully, please share.  I'm
forced
> to use SHTML for my error pages (404.shtml and whatnot), but I'd like
to
> get those to interact with PHP as well.

Most any web server will allow you to set a URL as the error handler, so
you can have it as a PHP page. Is there a specific reason why you can't?

---John W. Holmes...

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



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



RE: [PHP] PHP running on Win 2000 and IIS

2003-02-21 Thread John W. Holmes
> I wish to run PHP on a Win 2000 server, MS SQL and IIS. Can someone
please
> guide me to some place where there are some tutorials on how to
install
> and run the above?

The PHP manual has an installation channel the works. 
 
> Also are there any problems by running PHp on Win 2000, MS SQL and
IIS?

Not that I've noticed. I use all that except for MSSQL, thankfully.

---John Holmes...



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



RE: [PHP] Array instead of Switch

2003-02-21 Thread John W. Holmes
> >Let's say I need to take one of 20 actions depending on a form
selection.
> I
> >could use a switch statement with 20 cases, but I could also do
something
> >like:
> >
> >// Pretend this comes from a form
> >$formchoice = "mars";
> >
> >
> >$response = array(
> > "mars" => "go_mars()",
> > "mercury" => "go_mercury()",
> > "earth" => "go_earth()");
> >
> >foreach ($response as $choice => $action)
> >{
> > if (strtoupper($formchoice) == strtoupper($choice))
> >  {
> >  eval("$action;");
> >  }
> >}
> >
> >But are there even better ways?

You know you can use a variable as the name of a function??

So, if you had the functions mars(), mercury() and venus(), and you had

$formchoice = 'mars';

You can just call

$formchoice();

and it'll be just like calling mars(). It works the same for the other
functions. You'll still want to validate it so you know it's calling on
of the functions you want called. A simple array with valid planets and
a call to in_array will solve that. 

---John W. Holmes...

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



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



[PHP] Re: passing variables to flash

2003-02-21 Thread Lord Loh.
See the flash docs. There are ways of making javascript and flash interact.
So make a dynamically generated javascript which will pass variable to
flash!

Or are there special reasonds to use only GET ?

Lord Loh.



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



Re: [PHP] Array instead of Switch

2003-02-21 Thread David Otton
On 22 Feb 2003 03:28:22 -, you wrote:

>Let's say I need to take one of 20 actions depending on a form selection. I 
>could use a switch statement with 20 cases, but I could also do something 
>like:
>
>// Pretend this comes from a form
>$formchoice = "mars";
>
>
>$response = array(
> "mars" => "go_mars()",
> "mercury" => "go_mercury()",
> "earth" => "go_earth()");
>
>foreach ($response as $choice => $action)
>{
> if (strtoupper($formchoice) == strtoupper($choice))
>  {
>  eval("$action;");
>  }
>}
>   
>But are there even better ways? 

$formchoice = "mars";

go_planet ($formchoice);

Keep the high-levels of the script as simple as possible, push the
complexity down into functions where it's hidden from view.

Maybe go_planet() just calls go_mercury(), go_venus(), etc., or, more
likely,  there's enough shared-functionality for only go_planet() to be
necessary.

Either way, you've replaced 11 lines in the main body of your script
with 1 line, and the next person to deal with your code will be
grateful.

[An OO programmer would probably create a planet object...

myPlanet = new Planet()
myPlanet.setType($formchoice)

or something, with the same end (hiding complexity) in mind.]


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



Re: [PHP] "Constants" for dummies, please?

2003-02-21 Thread Philip Olson

Some thoughts on variables and constants:

a) You can't redefine a constant but can redefine
   a variable.

b) Constants are autoglobal (like superglobals) so
   for example:
   

   Had we not used global $variable, the $variable 
   would not have been available inside the function.
   But, the constant is AUTOglobal so it is.  Read:

 Variable Scope:
 http://www.php.net/variables.scope

c) Constants must be scalar values in PHP4, (so
   not arrays, objects, or resources).

d) Constants are cool, variables are cool too.

Regards,
Philip Olson


On Fri, 21 Feb 2003, Chris Corwin wrote:

> Help, please -- I've just started looking at my first line of PHP code.
> 
> :)
> 
> 
> A little background, I am *not really* a programmer: I went to art 
> school. 
> 
> I have taught myself to develop web stuff in another language: Lasso, 
> but have no training.
> 
> In any case, I am looking through a php script that I've downloaded, 
> and most of it makes at least some sense to me, but I have come upon:
> 
>
>   define('BASE', './');
>   include(BASE.'Functions/foo.php');
>   ?>
> 
> 
> Now, like any good lister, I checked the source first: php.net
> 
>  says:
> 
> "A constant is a identifier (name) for a simple value. As the name 
> suggests, that value cannot change during the execution of the script 
> (except the magic constants which aren't actually constants). A 
> constant is case-sensitive by default. By convention constant 
> identifiers are always uppercase. 
> 
> [...]
> 
> The scope of a constant is global--you can access it anywhere in your 
> script without regard to scope."
> 
> 
> 
> 
> So it is apparently *similar*, but not *exactly like* a variable, right?
> 
> Can anyone explain the difference to me?
> 
> A particular question I have is about what this phrase means:
> 
> "The scope of a constant is global--you can access it anywhere in your 
> script without regard to scope."
> 
> 
> 
> When it says "anywhere in your script" does that mean it's available to 
> "all of PHP"?
> 
> Or it is global to the rest of the file currently being processed, 
> regardless of namespace, unlike a "normal" variable which might be 
> unavailable in certain namespaces in the file?
> 
> Also, if anyone knows the subtleties of how any such differences effect 
> the rest of the script, that'd be wonderful, too.
> 
> 
> Thanks for any help!
> 
>   - me
> 
> -- 
> 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] Logging Referer

2003-02-21 Thread Tom Rogers
Hi,

Saturday, February 22, 2003, 9:19:13 AM, you wrote:
MH> Hi all,

MH> I'm working on adding some logging functionality to a PHP image counter
MH> script that I wrote.  The counter outputs an image representing the current
MH> number of hits and is used via an  tag.  After it displays the image,
MH> the counter collects information about the user (browser version and OS,
MH> date and time of visit, ip, etc).  I'd also like for it to log the referer,
MH> but because the counter is triggered via an  tag, the referer is always
MH> the page that has the  tag.  Is there any other way to grab the referer
MH> that actually sent the user to the page that contains the counter?  I'd like
MH> for the counter to work even when included in static HTML pages, so the
MH> including page cannot use any PHP to help facilitate this logging
MH> functionality.

MH> I hope all that makes sense.

MH> Anyone have any suggestions on how to achieve what I'm after?

MH> ---Matt



Probably the only way is with javascript..I did this a while back  (php v2 :)




http://domain.com.au/stats/invisman.phtml?unknown+9"; BORDER=0>



(the +9 was a page id, invisman.phtml returned a transparent gif)

-- 
regards,
Tom


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



Re: [PHP] Array instead of Switch

2003-02-21 Thread David T-G
Chris, et al --

...and then Chris said...
% 
% Let's say I need to take one of 20 actions depending on a form selection. I 
% could use a switch statement with 20 cases, but I could also do something 
% like:
% 
% // Pretend this comes from a form
% $formchoice = "mars";
% 
% 
% $response = array(
%  "mars" => "go_mars()",
%  "mercury" => "go_mercury()",
%  "earth" => "go_earth()");
% 
% foreach ($response as $choice => $action)
% {
%  if (strtoupper($formchoice) == strtoupper($choice))
%   {
%   eval("$action;");
%   }
% }
%   
% But are there even better ways? 

I'm just pulling this out of my ear, but assuming the structure you gave
what about a simple

  eval("$response[$formchoice];") ;

to match if it matches and do nothing if it doesn't?  In fact, I got
curious, so here is some test code I just whipped up; note that when the
choice is 'comet' nothing happens.

  function go_mars()
{ print "Welcome to mars, dude!\n" ; }
  $formchoice = "comet" ;
  $response = array
(
  "mars" => "go_mars()" ,
  "mercury" => "go_mercury()" ,
  // continue ad nauseam
) ;
  print "Will we eval?\n" ;
  eval ("$response[$formchoice];") ;
  print "DONE!\n" ;

Seems like this ought to be pretty safe since you're writing the go_*
functions and otherwise nothing matches and you eval a "".


HTH & HAND

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



pgp0.pgp
Description: PGP signature


[PHP] Utah PHP User

2003-02-21 Thread Ray Hunter
I am thinking of starting a Utah PHP user group.

If there are any Utah php user out there, please let me know if you
would be interested in starting a user group for PHP.

Thanks,

Ray



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



[PHP] PHP running on Win 2000 and IIS

2003-02-21 Thread Denis L. Menezes

Hello friends,

I wish to run PHP on a Win 2000 server, MS SQL and IIS. Can someone please guide me to 
some place where there are some tutorials on how to install and run the above?

Also are there any problems by running PHp on Win 2000, MS SQL and IIS?

Thanks
Denis

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



Re: [PHP] Re: including in shtml

2003-02-21 Thread Tom Rogers
Hi,

Saturday, February 22, 2003, 12:29:36 PM, you wrote:
HP> Im trying to write a poll script that is easy to intergrate into other
HP> documents of a site and thought that since shtml is a much used method, I
HP> want to make it available.

HP> "Hans Prins" <[EMAIL PROTECTED]> schreef in bericht
HP> news:[EMAIL PROTECTED]
>> Hello,
>>
>> I have a problem with including a "test.php" into a "test.shtml" and
HP> passing
>> a variable to the "test.shtml" which should be processed in the "test.php"
>>
>> the "test.php" document includes the following:
>> ---
>>
>> >
>> if ($HTTP_GET_VARS['theValue']) {
>> print $HTTP_GET_VARS['theValue'];
>> } else {
>> print"
>> 
>> 
>> 
>> 
>> ";
>> }
>>
>> ?>
>>
>> the "test.shtml" document includes the following:
>> -
>>
>> 
>> 
>> poll
>> 
>> 
>> 
>> 
>> 
>>
>> I've also tried using the POST method but I got an error stating that post
>> is not a valid method in shtml.
>>
>> I have also considered a session variable but since a session needs to
>> initiated or continued before anything is output to the browser that wont
>> work (I think).
>>
>> does anyone have a solution to get this to work?
>>
>> thanks,
>> Hans
>>
>>

POST won't work easily with .shtml files so you are limited to GET and its
length limitations but the following works for me:




//test.php
';
}
}
print'




';

?>

(parse string seems to like adding slashes)

To use post you will have to post to a .php file to do the processing and
redirect to the .shtml file.

-- 
regards,
Tom


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



[PHP] PHP Job Opening

2003-02-21 Thread Chris
http://www.alaska.edu/hr/jobs/external/tmp19_3.xml

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



RE: [PHP] Re: including in shtml

2003-02-21 Thread Matt Honeycutt
If you figure out how to do this successfully, please share.  I'm forced
to use SHTML for my error pages (404.shtml and whatnot), but I'd like to
get those to interact with PHP as well.

---Matt

-Original Message-
From: Hans Prins [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 21, 2003 8:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: including in shtml

Im trying to write a poll script that is easy to intergrate into other
documents of a site and thought that since shtml is a much used method,
I
want to make it available.

"Hans Prins" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> Hello,
>
> I have a problem with including a "test.php" into a "test.shtml" and
passing
> a variable to the "test.shtml" which should be processed in the
"test.php"
>
> the "test.php" document includes the following:
> ---
>
> 
> if ($HTTP_GET_VARS['theValue']) {
> print $HTTP_GET_VARS['theValue'];
> } else {
> print"
> 
> 
> 
> 
> ";
> }
>
> ?>
>
> the "test.shtml" document includes the following:
> -
>
> 
> 
> poll
> 
> 
> 
> 
> 
>
> I've also tried using the POST method but I got an error stating that
post
> is not a valid method in shtml.
>
> I have also considered a session variable but since a session needs to
> initiated or continued before anything is output to the browser that
wont
> work (I think).
>
> does anyone have a solution to get this to work?
>
> thanks,
> Hans
>
>



-- 
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] Array instead of Switch

2003-02-21 Thread Chris
Let's say I need to take one of 20 actions depending on a form selection. I 
could use a switch statement with 20 cases, but I could also do something 
like:

// Pretend this comes from a form
$formchoice = "mars";


$response = array(
 "mars" => "go_mars()",
 "mercury" => "go_mercury()",
 "earth" => "go_earth()");

foreach ($response as $choice => $action)
{
 if (strtoupper($formchoice) == strtoupper($choice))
  {
  eval("$action;");
  }
}

But are there even better ways? 

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



Re: [PHP] user registration system

2003-02-21 Thread olinux
this is decent 

A Complete, Secure User Login System
by tim perdue 
http://phpbuilder.com/columns/tim2505.php3

and of course - hotscripts.com

--- Dennis Gearon <[EMAIL PROTECTED]> wrote:
> Anybody know of a good user registration system,
> using emailed web addresses for verification of 
> email address?
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



RE: [PHP] Logging Referer

2003-02-21 Thread Matt Honeycutt
Yeah, I had thought about using JavaScript.  I had hoped that there was
another way, but if there is, I can't figure it out.

---Matt

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 21, 2003 8:37 PM
To: Matt Honeycutt; Php-General
Subject: Re: [PHP] Logging Referer

on 22/02/03 10:19 AM, Matt Honeycutt ([EMAIL PROTECTED]) wrote:

> I'd also like for it to log the referer,
> but because the counter is triggered via an  tag, the referer is
always
> the page that has the  tag.  Is there any other way to grab the
referer
> that actually sent the user to the page that contains the counter?
I'd like
> for the counter to work even when included in static HTML pages, so
the
> including page cannot use any PHP to help facilitate this logging
> functionality.

No, not easily :)

On PHP pages, you could get the referrer, and append it to the URL,
forcing
the "correct" REFERRER through to the img script:



And you *could* choose to force .html files through the PHP parser, so
foo.html could use the above code.


I think the other alternative is to use javascript to build the img tag,
because I'm pretty sure JS can figure out the referrer.

But this has the obvious downside of JS being NO WHERE NEAR guaranteed
to be
on each browser.


I think i'm missing something though, because I *think* those free
counter/stat programs DO log a referrer... wait -- just checked
thecounter.com, and they DO use JS for the referrer.


Justin





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



Re[2]: [PHP] Re: Mysql DB connect failure

2003-02-21 Thread Tom Rogers
Hi,

Saturday, February 22, 2003, 2:26:35 AM, you wrote:
M> I see that its looking for mysql.sock in /tmp/mysql.sock
M> but I searched on my system and only found mysql.sock in /var/lib/mysql/

M> is there a section where I need to change this setting? or a conf file?


M> "Hans Prins" <[EMAIL PROTECTED]> wrote in message
M> news:[EMAIL PROTECTED]
>> > Would you care to explain to the rest of the list how you intend to use
>> > mysql_error () to return connection failure information?
>> >
>> > It returns the text of the error message from previous MySQL operation
>> > Description: string mysql_error ( [resource link_identifier])
>> >
>> > Seems to me that without a connection, we wouldn't have a valid
>> > link_identifier.
>>
>> maybe so, but it works nonetheless.
>>
>> if for example the username stated in the connection initialization was
>> wrong it will print an error like:
>>
>> "Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)"
>>
>> MI,
>>
>> my code would look somethign like this:
>>
>> $link = @mysql_pconnect("localhost", "test1", "test1");
>>
>> // If connection failed...
>> if (!$link) {
>> // Inform user of error and quit
>> print "Couldn't connect to database server\n";
>> print mysql_error();
>> exit;
>> }
>>
>>
>>
>> "Jason K Larson" <[EMAIL PROTECTED]> schreef in bericht
>> news:[EMAIL PROTECTED]
>> > Would you care to explain to the rest of the list how you intend to use
>> > mysql_error () to return connection failure information?
>> >
>> > It returns the text of the error message from previous MySQL operation
>> > Description: string mysql_error ( [resource link_identifier])
>> >
>> > Seems to me that without a connection, we wouldn't have a valid
>> > link_identifier.
>> >
>> > What you probably should attempt going for is getting something back
>> > from PHP itself regarding the error returned when the mysql_connect
>> failed.
>> >
>> > Here's a snippet from:
>> > http://www.php.net/manual/en/language.operators.errorcontrol.php
>> >
>> > If the track_errors feature is enabled, any error message generated by
>> > the expression will be saved in the global variable $php_errormsg. This
>> > variable will be overwritten on each error, so check early if you want
>> > to use it.
>> >
>> > Hope that clears things up a bit.
>> >
>> > Regards,
>> > Jason k Larson
>> >
>> >
>> >
>> > Hans Prins wrote:
>> > > did you try:
>> > > print mysql_error();
>> > >
>> > > "Ml" <[EMAIL PROTECTED]> schreef in bericht
>> > > news:[EMAIL PROTECTED]
>> > >
>> >
>> >
>>
>>

In php.ini

mysql.default_socket = /var/lib/mysql/mysql.sock

-- 
regards,
Tom


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



[PHP] preg_match question: locating unmatched HTML tags

2003-02-21 Thread Andy Crain
My apologies in advance if this too basic or there's a solution easily
found out there, but after lots of searching, I'm still lost.

 

I'm trying to build a regexp that would parse user-supplied text and
identify cases where HTML tags are left open or are not properly
matched-e.g.,  tags without closing  tags. This is for a sort of
message board type of application, and I'd like to allow users to use
some HTML, but just would like to check to ensure that no stray tags are
input that would screw up the rest of the page's display. I'm new to
regular expressions, and the one below is as far as I've gotten. If
anyone has any suggestions, they'd be very much appreciated.

Thanks,

Andy

 

 

$suspect_tags = "b|i|u|strong|em|font|a|ol|ul|blockquote ";

$pattern = '/<(' . $suspect_tags . '[^>]*>)(.*)(?!<\/\1)/Ui';

if (preg_match($pattern,$_POST['entry'],$matches)) {

   //do something to report the unclosed tags

} else {

   echo 'Input looks fine. No unmatched tags.';

}



Re: [PHP] Logging Referer

2003-02-21 Thread Justin French
on 22/02/03 10:19 AM, Matt Honeycutt ([EMAIL PROTECTED]) wrote:

> I'd also like for it to log the referer,
> but because the counter is triggered via an  tag, the referer is always
> the page that has the  tag.  Is there any other way to grab the referer
> that actually sent the user to the page that contains the counter?  I'd like
> for the counter to work even when included in static HTML pages, so the
> including page cannot use any PHP to help facilitate this logging
> functionality.

No, not easily :)

On PHP pages, you could get the referrer, and append it to the URL, forcing
the "correct" REFERRER through to the img script:



And you *could* choose to force .html files through the PHP parser, so
foo.html could use the above code.


I think the other alternative is to use javascript to build the img tag,
because I'm pretty sure JS can figure out the referrer.

But this has the obvious downside of JS being NO WHERE NEAR guaranteed to be
on each browser.


I think i'm missing something though, because I *think* those free
counter/stat programs DO log a referrer... wait -- just checked
thecounter.com, and they DO use JS for the referrer.


Justin


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



[PHP] Re: including in shtml

2003-02-21 Thread Hans Prins
Im trying to write a poll script that is easy to intergrate into other
documents of a site and thought that since shtml is a much used method, I
want to make it available.

"Hans Prins" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> Hello,
>
> I have a problem with including a "test.php" into a "test.shtml" and
passing
> a variable to the "test.shtml" which should be processed in the "test.php"
>
> the "test.php" document includes the following:
> ---
>
> 
> if ($HTTP_GET_VARS['theValue']) {
> print $HTTP_GET_VARS['theValue'];
> } else {
> print"
> 
> 
> 
> 
> ";
> }
>
> ?>
>
> the "test.shtml" document includes the following:
> -
>
> 
> 
> poll
> 
> 
> 
> 
> 
>
> I've also tried using the POST method but I got an error stating that post
> is not a valid method in shtml.
>
> I have also considered a session variable but since a session needs to
> initiated or continued before anything is output to the browser that wont
> work (I think).
>
> does anyone have a solution to get this to work?
>
> thanks,
> Hans
>
>



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



Re: [PHP] Convert *.PST Files to Something Else (LDAP...)

2003-02-21 Thread David T-G
Michael --

...and then Michael A Smith said...
% 
% Hi,

Hi!


% 
% Is there any way using PHP (or any thing else, preferably PHP) to
% convert a MS Outlook *.PST file to another file that would be usable by

Converting from Outhouse comes up a lot on the mutt-users list.  To date
the only thing of which I know that will do it is Netscape, and therefore
presumably Mozilla; NS has an import function.  You might pull down the
Moz source code and start reading :-)


HTH & HAND & Good luck

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



pgp0.pgp
Description: PGP signature


Re: [PHP] Re: including in shtml

2003-02-21 Thread Tom Rogers
Hi,

Saturday, February 22, 2003, 8:22:44 AM, you wrote:
HP> anyone?

HP> "Hans Prins" <[EMAIL PROTECTED]> schreef in bericht
HP> news:[EMAIL PROTECTED]
>> Hello,
>>
>> I have a problem with including a "test.php" into a "test.shtml" and
HP> passing
>> a variable to the "test.shtml" which should be processed in the "test.php"
>>
>> the "test.php" document includes the following:
>> ---
>>
>> >
>> if ($HTTP_GET_VARS['theValue']) {
>> print $HTTP_GET_VARS['theValue'];
>> } else {
>> print"
>> 
>> 
>> 
>> 
>> ";
>> }
>>
>> ?>
>>
>> the "test.shtml" document includes the following:
>> -
>>
>> 
>> 
>> poll
>> 
>> 
>> 
>> 
>> 
>>
>> I've also tried using the POST method but I got an error stating that post
>> is not a valid method in shtml.
>>
>> I have also considered a session variable but since a session needs to
>> initiated or continued before anything is output to the browser that wont
>> work (I think).
>>
>> does anyone have a solution to get this to work?
>>
>> thanks,
>> Hans
>>
>>

Why are you trying to mix shtml and php ?


-- 
regards,
Tom


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



Re: [PHP] ob_gzhandler problems under 4.3.0???

2003-02-21 Thread Gerard Samuel
Thanks.  Worked like a charm...

Jason Sheets wrote:

PHP is starting output buffering automatically for you and then you are
starting it in your script as well, that is why you are receiving the
message ob_gzhandler can not be used twice.
Use ob_get_level to check if output buffering is not already started.


You may want additional logic that checks to see if the output buffer
hander is ob_gzhandler.
Jsaon
 

--
Gerard Samuel
http://www.trini0.org:81/
http://test1.trini0.org:81/


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


[PHP] ssi problem

2003-02-21 Thread Hans Prins
Could anyone please shed some light on the following issue?

I have a problem with including a "test.php" into a "test.shtml" and passing
a variable to the "test.shtml" which should be available and processed in
the "test.php"

the "test.php" document includes the following:
---





";
}

?>

the "test.shtml" document includes the following:
-



poll






I've also tried using the POST method but I got an error stating that post
is not a valid method in shtml.

I have also considered a session variable but since a session needs to
initiated or continued before anything is output to the browser that wont
work (I think).

does anyone have a solution to get this to work?

thanks,
Hans



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



Re: [PHP] ob_gzhandler problems under 4.3.0???

2003-02-21 Thread Jason Sheets
PHP is starting output buffering automatically for you and then you are
starting it in your script as well, that is why you are receiving the
message ob_gzhandler can not be used twice.

Use ob_get_level to check if output buffering is not already started.



You may want additional logic that checks to see if the output buffer
hander is ob_gzhandler.

Jsaon
 On Fri, 2003-02-21 at 17:12, Gerard Samuel wrote:
> I noticed this problem with one of my scripts when its running under php 
> 4.3.0, Apache 2.0.44.
> It only happens when started with ob_start('ob_gzhandler');
> Even with this test script from the php manual produces this error.
> Any insight would be appreciated.
> 
> 
>  From php.ini ->
> ; Output buffering allows you to send header lines (including cookies) even
> ; after you send body content, at the price of slowing PHP's output layer a
> ; bit.  You can enable output buffering during runtime by calling the output
> ; buffering functions.  You can also enable output buffering for all 
> files by
> ; setting this directive to On.  If you wish to limit the size of the buffer
> ; to a certain size - you can use a maximum number of bytes instead of 
> 'On', as
> ; a value for this directive (e.g., output_buffering=4096).
> output_buffering = 4096
> 
> ; You can redirect all of the output of your scripts to a function.  For
> ; example, if you set output_handler to "mb_output_handler", character
> ; encoding will be transparently converted to the specified encoding.
> ; Setting any output handler automatically turns on output buffering.
> ; Note: People who wrote portable scripts should not depend on this ini
> ;   directive. Instead, explicitly set the output handler using 
> ob_start().
> ;   Using this ini directive may cause problems unless you know what 
> script
> ;   is doing.
> ; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
> ;   and you cannot use both "ob_gzhandler" and 
> "zlib.output_compression".
> ;output_handler =
> 
> ; Transparent output compression using the zlib library
> ; Valid values for this option are 'off', 'on', or a specific buffer size
> ; to be used for compression (default is 4KB)
> ; Note: Resulting chunk size may vary due to nature of compression. PHP
> ;   outputs chunks that are few handreds bytes each as a result of 
> compression.
> ;   If you want larger chunk size for better performence, enable 
> output_buffering
> ;   also.
> ; Note: output_handler must be empty if this is set 'On' 
> ;   Instead you must use zlib.output_handler.
> zlib.output_compression = Off
> 
> ; You cannot specify additional output handlers if zlib.output_compression
> ; is activated here. This setting does the same as output_handler but in
> ; a different order.
> ;zlib.output_handler =
> 
> ---
> Example script ->
> 
>  
> ob_start("ob_gzhandler");
> 
> ?>
> 
> 
> This should be a compressed page.
> 
> 
> 
> -
> Error reported ->
> 
> This should be a compressed page.
> Warning: (null)() [ref.outcontrol]: output handler 'ob_gzhandler' cannot 
> be used twice in Unknown on line 0
> 
> -- 
> Gerard Samuel
> http://www.trini0.org:81/
> http://test1.trini0.org:81/
> 
> 
> 
> -- 
> 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] Convert *.PST Files to Something Else (LDAP...)

2003-02-21 Thread Michael A Smith
Hi,

Is there any way using PHP (or any thing else, preferably PHP) to
convert a MS Outlook *.PST file to another file that would be usable by
PHP, using only PHP scripts, or even a CGI? I am working on an
open-source project called falconmail that needs to be able to import
all sorts of mail files from people's old programs.

Thanks,
-Michael
-- 
Some people's minds are like cement; all mixed up and permanently set.
  Life is full of obstacle illusions.
  Don't buy antique furniture, it never lasts.
  "I'm related to people to whom I don't relate." -Calvin (& Hobbes)
  An elephant is actually a mouse designed by a committee.


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



[PHP] ob_gzhandler problems under 4.3.0???

2003-02-21 Thread Gerard Samuel
I noticed this problem with one of my scripts when its running under php 
4.3.0, Apache 2.0.44.
It only happens when started with ob_start('ob_gzhandler');
Even with this test script from the php manual produces this error.
Any insight would be appreciated.

From php.ini ->
; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit.  You can enable output buffering during runtime by calling the output
; buffering functions.  You can also enable output buffering for all 
files by
; setting this directive to On.  If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 
'On', as
; a value for this directive (e.g., output_buffering=4096).
output_buffering = 4096

; You can redirect all of the output of your scripts to a function.  For
; example, if you set output_handler to "mb_output_handler", character
; encoding will be transparently converted to the specified encoding.
; Setting any output handler automatically turns on output buffering.
; Note: People who wrote portable scripts should not depend on this ini
;   directive. Instead, explicitly set the output handler using 
ob_start().
;   Using this ini directive may cause problems unless you know what 
script
;   is doing.
; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
;   and you cannot use both "ob_gzhandler" and 
"zlib.output_compression".
;output_handler =

; Transparent output compression using the zlib library
; Valid values for this option are 'off', 'on', or a specific buffer size
; to be used for compression (default is 4KB)
; Note: Resulting chunk size may vary due to nature of compression. PHP
;   outputs chunks that are few handreds bytes each as a result of 
compression.
;   If you want larger chunk size for better performence, enable 
output_buffering
;   also.
; Note: output_handler must be empty if this is set 'On' 
;   Instead you must use zlib.output_handler.
zlib.output_compression = Off

; You cannot specify additional output handlers if zlib.output_compression
; is activated here. This setting does the same as output_handler but in
; a different order.
;zlib.output_handler =
---
Example script ->


ob_start("ob_gzhandler");

?>


This should be a compressed page.


-
Error reported ->
This should be a compressed page.
Warning: (null)() [ref.outcontrol]: output handler 'ob_gzhandler' cannot 
be used twice in Unknown on line 0

--
Gerard Samuel
http://www.trini0.org:81/
http://test1.trini0.org:81/


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


RE: [PHP] Getting a Multiple Select Form Field's Value

2003-02-21 Thread Barajas, Arturo
Mike:

On the name of the select, use "[]".



That way, you can access the array to see what options were selected.
--
Un gran saludo/Big regards...
   Arturo Barajas, IT/Systems PPG MX (SJDR)
   (427) 271-9918, x448

> -Original Message-
> From: Mike Walth [mailto:[EMAIL PROTECTED]
> Sent: Viernes, 21 de Febrero de 2003 05:45 p.m.
> To: [EMAIL PROTECTED]
> Subject: [PHP] Getting a Multiple Select Form Field's Value
> 
> 
> Hello:
> 
> I'm trying to get the value from the following form field.
> 
> 
>   Value1
>   Value2
>   Value3
> 
> 
> I can get it to return one value, but if I select multiple 
> values I can't
> get all the values form it.  Any ideas would be appreciated.
> 
> Mike Walth
> CinoFusion
> 
> 
> 
> -- 
> 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] Getting a Multiple Select Form Field's Value

2003-02-21 Thread Mike Walth
Hello:

I'm trying to get the value from the following form field.


  Value1
  Value2
  Value3


I can get it to return one value, but if I select multiple values I can't
get all the values form it.  Any ideas would be appreciated.

Mike Walth
CinoFusion



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



[PHP] HELP: Memory exceeding

2003-02-21 Thread Markas
Hi... I got a big site, which is not very well constructed inside, and the
script began to throw (rather often, but NOT always) a fatal error " Fatal
error: Allowed memory size of 8388608 bytes exhausted ", every time in
different places. I wonder how should I debug that, as there is pretty much
code inside, and I hardly got aqcuainted with it in a whole.

SO THE QUESTION: Are there any functions or smth., to check, how much memory
is used at some particular moment of execution of the script??? If I could
state, that for example after some class instantiaton memory usage greatly
increases, I would be able to localise the problem.

Thanks much,
Mark.
Do not hesitate to send Your reply's also on [EMAIL PROTECTED]





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



[PHP] Logging Referer

2003-02-21 Thread Matt Honeycutt
Hi all,

I'm working on adding some logging functionality to a PHP image counter
script that I wrote.  The counter outputs an image representing the current
number of hits and is used via an  tag.  After it displays the image,
the counter collects information about the user (browser version and OS,
date and time of visit, ip, etc).  I'd also like for it to log the referer,
but because the counter is triggered via an  tag, the referer is always
the page that has the  tag.  Is there any other way to grab the referer
that actually sent the user to the page that contains the counter?  I'd like
for the counter to work even when included in static HTML pages, so the
including page cannot use any PHP to help facilitate this logging
functionality.

I hope all that makes sense.

Anyone have any suggestions on how to achieve what I'm after?

---Matt


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



Re: [PHP] Serial communiction

2003-02-21 Thread Ernest E Vogelsinger
At 23:12 21.02.2003, Ian said:
[snip]
>Is it possible to read information on the client serial port and return it
>to the server ?
[snip] 

Sure. But not with PHP.

PHP is working "behind the scenes", at the webserver. Not at the client.

What you can do is write a program (intended for the client operating
system). Associate this plugin with a specific mimetype so the browser will
execute it when this mimetype (or extension) is received from the server,
then let this program respond to the server with serial data.


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



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



[PHP] Serial communiction

2003-02-21 Thread Ian
Is it possible to read information on the client serial port and return it
to the server ?

a newbie.



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



[PHP] DBA / DB2/3/ GDBM Failures

2003-02-21 Thread Mitch Vincent
I've tried all of the DB libs and I can't get any of them to 
compile/work properly..

For GDBM I get :
Driver initialization failed for handler: gdbm: Bad magic number
For the rest I just get

Driver initialization failed for handler: 

Where  is db2 db3 etc..

Can anyone tell me what the the trick is to get this to work?

Thanks!

-M

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


[PHP] Re: php_mcrypt.dll

2003-02-21 Thread J Smith

If all you need is some PHP encryption and don't necessarily need the mcrypt
library, you can try cryptopp-php, which does pretty much the same thing. A
Windows DLL that was compiled for PHP 4.3.0 is available at

http://www.tutorbuddy.com/software/

It should work with PHP 4.3.1, too, as I don't think the PHP module API
changed between the two versions.

(I know, it's a shameless plug and I hate doing it, but it might help...)

J


Daniel Guerrier wrote:

> I'm trying to use the mcrypt function on winXP using
> php 4.3.1 and IIS 5.  First the dll would not load but
> I got past that by placing the libmcrypt.dll in my
> system32.  Now it loads but when I try to use mcrypt I
> get
> 
> Warning: mcrypt_encrypt(): Module initialization
> failed in
> E:\IIS\wwwroot\savehiphop\admin\access\encrypt.php on
> line 6
> 
> I don't think it's the code, it's pretty simple.
> $key = "longencrytionkey";
> $text = "danny";
> echo($text . "");
> 
> $newtext = mcrypt_encrypt("MCRYPT_BLOWFISH",$key,
> $text, "ecb");
> echo($newtext);
> 
> 
> How do I get mycryt extension to work properly on
> windows?
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/


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



[PHP] Re: including in shtml

2003-02-21 Thread Hans Prins
anyone?

"Hans Prins" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> Hello,
>
> I have a problem with including a "test.php" into a "test.shtml" and
passing
> a variable to the "test.shtml" which should be processed in the "test.php"
>
> the "test.php" document includes the following:
> ---
>
> 
> if ($HTTP_GET_VARS['theValue']) {
> print $HTTP_GET_VARS['theValue'];
> } else {
> print"
> 
> 
> 
> 
> ";
> }
>
> ?>
>
> the "test.shtml" document includes the following:
> -
>
> 
> 
> poll
> 
> 
> 
> 
> 
>
> I've also tried using the POST method but I got an error stating that post
> is not a valid method in shtml.
>
> I have also considered a session variable but since a session needs to
> initiated or continued before anything is output to the browser that wont
> work (I think).
>
> does anyone have a solution to get this to work?
>
> thanks,
> Hans
>
>



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



[PHP] Bizarre Assignment Issue

2003-02-21 Thread Steven Walker
I am experiencing some very odd behavior in my classes that I don't 
know how to work around. Apparently, PHP is getting my variables 
'confused' with each other and assigning/returning the wrong data.

My class design is as follows:

class TestClass
{
var $TestLog;
var $Data1;
var $Data2;

function TestClass()
{
$this->$Data1 = 234;
$this->$TestLog = "HELLO";
$this->$Data2 = "wehre";   
}

function Report()
{
return $this->$TestLog;
}
}
and this class is being used in the following manner:

$test = new TestClass;
echo $test->Report();
You would expect the output to read 'HELLO', but instead it reads 
'wehre'. I'm totally confused ¿¿??

Any ideas? Thank you!

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]
On Friday, February 21, 2003, at 01:32 PM, ML wrote:

I am unable to send emails, and there are no errors being generated or
populated in the $php_errormsg variable, since I enabled track errors 
in the
php.ini. So I have no idea why the mail send is failing. Am I supposed 
to
specify
a mail server to use for sending mail? My sendmail was setup 
automatically
in my Redhat Setup and I have not touched its configuration 
options...is
there something I need to change? The sendmail path that is shown in 
the
phpinfo() function display is correct. Any feedback would be greatly
appreciated. Thanks!

-M L



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



[PHP] mcrypt not fully decrypting?

2003-02-21 Thread Tyler Longren
Hi,

I'm going to start encrypting credit cards with the mcrypt functions.  I
encrypted the credit cards like so:
$key = 'test';
  $cc = "1234567890123456";
  $td = mcrypt_module_open ('tripledes', '', 'ecb', '');
  $key = substr ($key, 0, mcrypt_enc_get_key_size ($td));
  $iv_size = mcrypt_enc_get_iv_size ($td);
  $iv = mcrypt_create_iv ($iv_size, MCRYPT_RAND);

  // Initialize encryption handle
  if (mcrypt_generic_init ($td, $key, $iv) != -1) {
   // Encrypt data
   $ciphertext = mcrypt_generic ($td, $cc);
   mcrypt_generic_deinit ($td);

   // Reinitialize buffers for decryption
   mcrypt_generic_init ($td, $key, $iv);
   $plaintext = mdecrypt_generic ($td, $ciphertext);

   // Clean up
   mcrypt_generic_deinit ($td);
   mcrypt_module_close ($td);
print "Ciphertext: $ciphertext";
 print "Plaintext: $plaintext";
  }

Sometimes, when I decrypt a cc it contains binary data...it's not fully
decrypted.  There's some plaintext in it and there's also binary.  Does
anyone know why this happens or how I can fix it?

Thanks,
Tyler


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



[PHP] mail function fails with no error code

2003-02-21 Thread ML
I am unable to send emails, and there are no errors being generated or
populated in the $php_errormsg variable, since I enabled track errors in the
php.ini. So I have no idea why the mail send is failing. Am I supposed to
specify
a mail server to use for sending mail? My sendmail was setup automatically
in my Redhat Setup and I have not touched its configuration options...is
there something I need to change? The sendmail path that is shown in the
phpinfo() function display is correct. Any feedback would be greatly
appreciated. Thanks!

-M L



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



Re: [PHP] What do these errors mean?

2003-02-21 Thread Jim Lucas
in the first line of the code you are refering to $_GET[option]

option in this case is being seen as a constant.

if you were to put single or double quotes it would work.

the second notice means that in the $_GET array, there isn't a key called
option

it would probably work better if you did this.

if(empty($_GET['option'])) {
  your code here
}


- Original Message -
From: "Tyler Longren" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 21, 2003 11:01 AM
Subject: [PHP] What do these errors mean?


> Hi,
>
> I was looking through php.ini and noticed that show_error was set to Off.
I
> turned it On, and now I see these errors on one of my pages:
> Notice: Use of undefined constant option - assumed 'option' in
> /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37
>
> Notice: Undefined index: option in
> /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37
>
> Here's line 37-42:
> if ($_GET[option] == "") {
>  print "Add Credit Card";
>  print "
>  Credit Card Number:  name=cc>
>  ";
> }
>
> What's wrong with that?
>
> Thanks,
> Tyler
>
>
> --
> 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] Cannot find php.ini

2003-02-21 Thread Jim Lucas
the default location for the php.ini file (if installed with the RPM's) is
/etc/php.ini

Jim
- Original Message -
From: "Kevin Paz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 21, 2003 11:03 AM
Subject: [PHP] Cannot find php.ini


>
> I've taken over a redhat server with apache/php4.1.  I need to enable
> register_argc_argv but I can't find the php.ini file (I've searched the
> entire system).
>
> Would creating a new php.ini file with only register_argc_argv line work?
> Where's the default location for php.ini?
>
>
> Thanks in advance,
>
> Kevin
>
>
>
> --
> 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] Cannot find php.ini

2003-02-21 Thread Ernest E Vogelsinger
At 20:03 21.02.2003, Kevin Paz spoke out and said:
[snip]
>
>   I've taken over a redhat server with apache/php4.1.  I need to enable
>register_argc_argv but I can't find the php.ini file (I've searched the
>entire system).

try (as root)
# update the locate database
locate -u
# look for it
locate php.ini

>   Would creating a new php.ini file with only register_argc_argv line
> work?
>Where's the default location for php.ini?

I believe this would be error-prone, although the default values should
work well. The actual location of php.ini is determined at compile time, I
believe. For a RedHat system the default location for php.ini is /etc (at
least our RH7.2 came preconfigured this way).


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


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



RE: [PHP] Cannot find php.ini

2003-02-21 Thread Cal Evans
find / -iname php.ini

or create a page with





Untitled









Save it and then call it form your webserver. It'll tell you where the ini
is.

=C=
* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com


-Original Message-
From: Kevin Paz [mailto:[EMAIL PROTECTED]
Sent: Friday, February 21, 2003 1:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Cannot find php.ini



I've taken over a redhat server with apache/php4.1.  I need to enable
register_argc_argv but I can't find the php.ini file (I've searched the
entire system).

Would creating a new php.ini file with only register_argc_argv line work?
Where's the default location for php.ini?


Thanks in advance,

Kevin



--
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] Cannot find php.ini

2003-02-21 Thread 1LT John W. Holmes
> I've taken over a redhat server with apache/php4.1.  I need to enable
> register_argc_argv but I can't find the php.ini file (I've searched the
> entire system).
>
> Would creating a new php.ini file with only register_argc_argv line work?
> Where's the default location for php.ini?

Load up a page with phpinfo() in it. In the first block, it'll tell you the
location of php.ini that the installation is using. If it's only a
directory, then that's where it expects to find php.ini, but it's not there.
If it's a full path including php.ini, then that's where it is.

If there's still no file present, then you can go to
http://cvs.php.net/co.php/php4/php.ini-dist to get the latest copy from CVS.

---John Holmes...


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




Re: [PHP] What do these errors mean?

2003-02-21 Thread 1LT John W. Holmes
> I was looking through php.ini and noticed that show_error was set to Off.
I
> turned it On, and now I see these errors on one of my pages:
> Notice: Use of undefined constant option - assumed 'option' in
> /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37
>
> Notice: Undefined index: option in
> /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37
>
> Here's line 37-42:
> if ($_GET[option] == "") {
>  print "Add Credit Card";
>  print "
>  Credit Card Number:  name=cc>
>  ";
> }
>
> What's wrong with that?

Where you have $_GET[option], PHP is assuming that _option_ is a constant,
since strings have quotes around them (array indexes are strings). Since
there is no constant with that name, though, PHP will then assume that you
meant to use a string.

The second "warning" is caused because there is no index in the _GET array
named "option", so it's an "undefined index"

You should be using this:

if(isset($_GET['option']))
{ //code... }

---John Holmes...


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




Re: [PHP] What do these errors mean?

2003-02-21 Thread Tyler Longren
The actual name of the variable in that message is display_errors, not
show_error.

tyler

- Original Message -
From: "Tyler Longren" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 21, 2003 1:01 PM
Subject: [PHP] What do these errors mean?


> Hi,
>
> I was looking through php.ini and noticed that show_error was set to Off.
I
> turned it On, and now I see these errors on one of my pages:
> Notice: Use of undefined constant option - assumed 'option' in
> /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37
>
> Notice: Undefined index: option in
> /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37
>
> Here's line 37-42:
> if ($_GET[option] == "") {
>  print "Add Credit Card";
>  print "
>  Credit Card Number:  name=cc>
>  ";
> }
>
> What's wrong with that?
>
> Thanks,
> Tyler
>
>
> --
> 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] Cannot find php.ini

2003-02-21 Thread Tyler Longren
Default location is:
/usr/local/lib/php.ini

You can also do a:
locate php.ini

Good luck,
Tyler

- Original Message - 
From: "Kevin Paz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 21, 2003 1:03 PM
Subject: [PHP] Cannot find php.ini


> 
> I've taken over a redhat server with apache/php4.1.  I need to enable
> register_argc_argv but I can't find the php.ini file (I've searched the
> entire system).
> 
> Would creating a new php.ini file with only register_argc_argv line work?
> Where's the default location for php.ini?
> 
> 
> Thanks in advance,
> 
> Kevin
> 
> 
> 
> -- 
> 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] Cannot find php.ini

2003-02-21 Thread Kevin Paz

I've taken over a redhat server with apache/php4.1.  I need to enable
register_argc_argv but I can't find the php.ini file (I've searched the
entire system).

Would creating a new php.ini file with only register_argc_argv line work?
Where's the default location for php.ini?


Thanks in advance,

Kevin



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




[PHP] What do these errors mean?

2003-02-21 Thread Tyler Longren
Hi,

I was looking through php.ini and noticed that show_error was set to Off.  I
turned it On, and now I see these errors on one of my pages:
Notice: Use of undefined constant option - assumed 'option' in
/usr/local/apache/htdocs/tyler/encodeDecode.php on line 37

Notice: Undefined index: option in
/usr/local/apache/htdocs/tyler/encodeDecode.php on line 37

Here's line 37-42:
if ($_GET[option] == "") {
 print "Add Credit Card";
 print "
 Credit Card Number: 
 ";
}

What's wrong with that?

Thanks,
Tyler


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




[PHP] "Constants" for dummies, please?

2003-02-21 Thread Chris Corwin
Help, please -- I've just started looking at my first line of PHP code.

:)


A little background, I am *not really* a programmer: I went to art 
school. 

I have taught myself to develop web stuff in another language: Lasso, 
but have no training.

In any case, I am looking through a php script that I've downloaded, 
and most of it makes at least some sense to me, but I have come upon:




Now, like any good lister, I checked the source first: php.net

 says:

"A constant is a identifier (name) for a simple value. As the name 
suggests, that value cannot change during the execution of the script 
(except the magic constants which aren't actually constants). A 
constant is case-sensitive by default. By convention constant 
identifiers are always uppercase. 

[...]

The scope of a constant is global--you can access it anywhere in your 
script without regard to scope."




So it is apparently *similar*, but not *exactly like* a variable, right?

Can anyone explain the difference to me?

A particular question I have is about what this phrase means:

"The scope of a constant is global--you can access it anywhere in your 
script without regard to scope."



When it says "anywhere in your script" does that mean it's available to 
"all of PHP"?

Or it is global to the rest of the file currently being processed, 
regardless of namespace, unlike a "normal" variable which might be 
unavailable in certain namespaces in the file?

Also, if anyone knows the subtleties of how any such differences effect 
the rest of the script, that'd be wonderful, too.


Thanks for any help!

- me

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




[PHP] LDAP error error

2003-02-21 Thread Todd Rosenberry

   I am getting bizarre results from ldap_errno and ldap_error.  I am 
using PHP 4.0.4pl1, iPlanet web server 4.1SP7 and iPlanet LDAP server 
4.16.  As a test I am trying to add an entry to LDAP that already 
exists.  The link and bind to LDAP work properly and the LDAP log show 
the correct behavior:

[20/Feb/2003:11:07:05 -0800] conn=330913 op=3 ADD 
dn="cn=test4,ou=aliases,ou=Services,dc=mycompany,dc=com"
[20/Feb/2003:11:07:06 -0800] conn=330913 op=3 RESULT err=68 tag=105 
nentries=0 etime=1

but my output is:

Adding cn=test4,ou=Aliases,ou=Services,dc=mycompany,dc=com
Warning: LDAP: add operation could not be completed. in 
/export/vol1/intranet/alias/ldaptest.php on line 30
ERROR: Unknown error (51151544)

Here is a snippet of the code:

print "Adding $entryDN\n";
$ok = ldap_add($ldlink,$entryDN,$attrs);
if (!$ok) {
  $lderrstr = ldap_error($ldlink);
  $lderrno = ldap_errno($ldlink);
  print "ERROR: $lderrstr ($lderrno)\n";
}

Thanks,
- Todd



[PHP] Help with session needed

2003-02-21 Thread Øystein Håland
I use cookies in my web applications, but have reached the 4 kB limit. So I
need to 'convert' all my cookies to session variables. Have got an idea how
I can create such for one variable, but here I have multi element cookies.
Reading the php manual gives me no idea on how to do this.
Here's the recipe for my cookies:
function formCookie() {
 var cookieValue = document.$formname.totalAns.value+'|'; // Using '|' to
split each part of the cookie
 cookieValue +=
document.form1.correct.value+'$test[1]'+document.form1.question1.value+docum
ent.form1.answer.value+'|';
 cookieValue +=
document.form2.correct.value+'$test[1]'+document.form2.question2.value+docum
ent.form2.answer.value+'|';



 document.cookie = '$answercookie='+escape(cookieValue)+';expires=';
}

How can I achieve the same using sessions



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




[PHP] Cascading delete in oracle

2003-02-21 Thread Raven Eve
create table Shop(
ordId NUMBER(7) NOT NULL PRIMARY KEY);

create table Customer(
ordId NUMBER(7) NOT NULL,
FOREIGN KEY (ordId) REFERENCES Shop(ordId) on delete cascade);

so, when i delete a row in shop, the corresponding row in customer will be
deleted.

so, i have created a function in php to execute the query
whereby $sqlStmt = "Delete from Shop where ordId = $ordId";

function executeSql($sqlStmt) //line 524
 {

  //echo $sqlStmt;

   $this->stmt = OCIParse($this->conn, $sqlStmt)or die
("Sorry, cannot parse the sql statement. Please inform the webmistress of
the error messages");

   // verify that SQL is valid
   $this->checkErrors();

  OCIExecute($this->stmt, OCI_DEFAULT) or die //line 534
("Sorry, cannot execute the sql statement. Please inform the webmistress of
the error messages");

  $this->checkErrors();

  //commit to database
  $this->commit();

 }

however, when i tried to execute the sql stmt, an error stmt will occur :
Warning: Missing argument 1 for executesql() in
c:\apache\htdocs\project\ProcessSql.php on line 524

Warning: OCIStmtExecute: ORA-24337: statement handle not prepared in
c:\apache\htdocs\project\ProcessSql.php on line 534
Sorry, cannot execute the sql statement. Please inform the webmistress of
the error messages

This function works for tables that do not have cascading deletes.
How do i get round this problem? thanx :P
--




--




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




Re: [PHP] Dynamic Dropdowns

2003-02-21 Thread David Otton
On Fri, 21 Feb 2003 10:37:42 -0700, you wrote:

>>Quoting Steven Kallstrom <[EMAIL PROTECTED]>:

>>  I am creating dynamic drop down lists... I would like to have an
>> option appear in the drop down list, but have it greyed-out and not be
>> selectable...  I know you can disable selects, but I don't think you can
>> disable individual options in selects...  anyone have any ideas?

>Oh!  Yes you can:
>
>Some Value

Don't assume any data returned from a disabled field will be correct. It
is easy to send malicious data to the form handler, and not all browsers
support the disabled attribute.


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




[PHP] user registration system

2003-02-21 Thread Dennis Gearon
Anybody know of a good user registration system, using emailed web addresses for 
verification of 
email address?



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




[PHP] Cascading delete in php and oracle

2003-02-21 Thread Raven Eve
hi, i have 2 tables in oracle

create table Shop(
ordId NUMBER(7) NOT NULL PRIMARY KEY);

create table Customer(
ordId NUMBER(7) NOT NULL,
FOREIGN KEY (ordId) REFERENCES Orders(ordId) on delete cascade);

so, when i delete a row in shop, the corresponding row in customer will be
deleted.

so, i have created a function in php to execute the query
whereby $sqlStmt = "Delete from Shop where ordId = $ordId";

function executeSql($sqlStmt) //line 524
 {

  //echo $sqlStmt;

   $this->stmt = OCIParse($this->conn, $sqlStmt)or die
("Sorry, cannot parse the sql statement. Please inform the webmistress of
the error messages");

   // verify that SQL is valid
   $this->checkErrors();

  OCIExecute($this->stmt, OCI_DEFAULT) or die //line 534
("Sorry, cannot execute the sql statement. Please inform the webmistress of
the error messages");

  $this->checkErrors();

  //commit to database
  $this->commit();

 }

however, when i tried to execute the sql stmt, an error stmt will occur :
Warning: Missing argument 1 for executesql() in
c:\apache\htdocs\project\ProcessSql.php on line 524

Warning: OCIStmtExecute: ORA-24337: statement handle not prepared in
c:\apache\htdocs\project\ProcessSql.php on line 534
Sorry, cannot execute the sql statement. Please inform the webmistress of
the error messages

This function works for tables that do not have cascading deletes.
How do i get round this problem? thanx :P
--




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




[PHP] Cascading delete in oracle and php

2003-02-21 Thread Raven Eve
hi, i have 2 tables in oracle

create table Shop(
ordId NUMBER(7) NOT NULL PRIMARY KEY);

create table Customer(
ordId NUMBER(7) NOT NULL,
FOREIGN KEY (ordId) REFERENCES Orders(ordId) on delete cascade);

so, when i delete a row in shop, the corresponding row in customer will be
deleted.

so, i have created a function in php to execute the query
whereby $sqlStmt = "Delete from Shop where ordId = $ordId";

function executeSql($sqlStmt) //line 524
 {

  //echo $sqlStmt;

   $this->stmt = OCIParse($this->conn, $sqlStmt)or die
("Sorry, cannot parse the sql statement. Please inform the webmistress of
the error messages");

   // verify that SQL is valid
   $this->checkErrors();

  OCIExecute($this->stmt, OCI_DEFAULT) or die //line 534
("Sorry, cannot execute the sql statement. Please inform the webmistress of
the error messages");

  $this->checkErrors();

  //commit to database
  $this->commit();

 }

however, when i tried to execute the sql stmt, an error stmt will occur :
Warning: Missing argument 1 for executesql() in
c:\apache\htdocs\project\ProcessSql.php on line 524

Warning: OCIStmtExecute: ORA-24337: statement handle not prepared in
c:\apache\htdocs\project\ProcessSql.php on line 534
Sorry, cannot execute the sql statement. Please inform the webmistress of
the error messages

This function works for tables that do not have cascading deletes.
How do i get round this problem? thanx :P
--






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




Re: [PHP] Dynamic Dropdowns

2003-02-21 Thread Richard Whitney
Oh!  Yes you can:

Some Value

Have fun!


Quoting Steven Kallstrom <[EMAIL PROTECTED]>:

### Hey PHP lovers,
### 
### I am creating dynamic drop down lists... I would like to have an
### option appear in the drop down list, but have it greyed-out and not be
### selectable...  I know you can disable selects, but I don't think you can
### disable individual options in selects...  anyone have any ideas?
### 
### Thanks a ton,
### 
### Steven
### 
###  
### 
### 
### 
### 
### -- 
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
### 
### 


-- 
Richard Whitney   *
Transcend Development
Producing the next phase of your internet presence.
[EMAIL PROTECTED]   *
http://xend.net*
602-971-2791
  * *   *
*  *  *__**
 _/  \___  *
 *  /   *\**
  */ * *  \
**/\_ |\
 /   \_  /  \
/  \/\
   /  \ 
  /\
 /  \


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




[PHP] Dynamic Dropdowns

2003-02-21 Thread Steven Kallstrom
Hey PHP lovers,

I am creating dynamic drop down lists... I would like to have an
option appear in the drop down list, but have it greyed-out and not be
selectable...  I know you can disable selects, but I don't think you can
disable individual options in selects...  anyone have any ideas?

Thanks a ton,

Steven

 




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




Re: [PHP] mr. jason wong kind attention

2003-02-21 Thread David T-G
Wilbert --

...and then W. Enserink said...
% 
% hey david,

Hiya!


% 
% should she apologize to you know?? for apologizing twice?:-)

*grin*  Tee hee.


% I'm sorry if offended anyone with this mail.

D'oh!  Sorry if *I* offended anyone with my reply!  Or with this reply!
Or with my apology!


% 
% 
% regards Wilbert
% 
% (counting down: 3 hrs to weekend)

Have a nice one, then!


HAND

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




msg97885/pgp0.pgp
Description: PGP signature


Re: [PHP] ayuda mysql

2003-02-21 Thread Maciek Ruckgaber Bielecki
On Fri, Feb 21, 2003 at 09:03:18AM -0800, Rot Alvarez wrote:
> Bueno gracias..ten??as tod al raz??n...pero haora sale esto:
> 
> Listado de tablas: 
> 
> Warning: Supplied argument is not a valid MySQL result resource in 
>/../web/php_mysql.php on line 40
> 
tiene cara de que le estas pasando algo no valido a fetch array o fetch
row o algo por el estilo ;-)
> _
> Registra gratis tu cuenta email en http://www.exploraiquique.cl
> 
> _
> Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, 
>POP & more! http://www.everyone.net/selectmail?campaign=tag

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




Re: [PHP] ayuda mysql

2003-02-21 Thread Brad Pauly
> estoy tratando de programar un messenger en php y
> sale este mensaje y no se como arreglarlo...no lo entiendo
> 
> Warning: MySQL Connection Failed: Unknown MySQL Server Host 'misitio.cl/' (2) in 
>/../messengerphp/cabesera.php on line 87
> 
> Warning: Supplied argument is not a valid MySQL-Link resource in 
>/../messengerphp/cabesera.php on line 88

Creo que su problema es el '/' al fin de 'misito.cl/'.

Brad



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




Re: [PHP] passing variables to flash

2003-02-21 Thread Michiel van Heusden
thanks for your reply

> What I do in these cases is either having  Or use a file (something.php) which spits text like var1=&var2=.
> Flash can read that file and get the variables
the second one is not a possibility, because I need flash to have the vars
before operating. the variables are used to call on another php-script for
conetnt-details. (for instance: file.swf?id=23 will make flash call on
content.php?id=23 for relevant content)

anybody else for other options?

original question:
> i want to pass variables to a shockwave-flash-file
> currently that's working fine with
>
> print " 
VALUE=\"$movie?idlinks=$idlinks&idcontent=$idcontent&idknoppen=$idknoppen\">
> etc...
>
> but passing the variables through GET makes iexplore think it's loading a
> new *.swf-file
>
> how to fix this?
>
> 1) is there a way around using GET to pass the variables from PHP?
> 2) is there a way to make Iexplore realise the file has been loaded before




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




[PHP] Mail Sending Error

2003-02-21 Thread ML
Im having some more error checking issues :)
This time its with sending email using php.
Im absolutely sure that the email address is correct and that my IMAP module
is enabled for
php as I successfully read emails from my ISP. But when I sent an email
with:

mail($to, $subject, $body, $headers)

it failed and I wanted to know how I can get a more descriptive error from
the failure of this function...
any ideas?

Thanks again, I really appreciate the help.

-ML



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




RE: [PHP] passing variables to flash

2003-02-21 Thread Marios Adamantopoulos
What I do in these cases is either having mailto:[EMAIL PROTECTED]] 
Sent: 21 February 2003 16:37
To: [EMAIL PROTECTED]
Subject: [PHP] passing variables to flash


i want to pass variables to a shockwave-flash-file
currently that's working fine with

print " 
etc...

but passing the variables through GET makes iexplore think it's loading a
new *.swf-file

how to fix this?

1) is there a way around using GET to pass the variables from PHP?
2) is there a way to make Iexplore realise the file has been loaded before
:)?

thanks a lot
michiel



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



Re: [PHP] session expiration

2003-02-21 Thread Lowell Allen
> From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
> 
>> I'm using sessions for authentication in a content management system and
>> experiencing rare but occasional problems with the session apparently
>> expiring unexpectedly. I've checked the manual and I've reviewed the
> session
>> configuration on the commericial host I'm using. I don't see anything
> wrong,
>> but there are some settings that I don't understand:
>> 
>> session.gc_maxlifetime 1440 -- Garbage collection after 24 minutes? Does
>> this mean that the session id and session variables will be cleared after
> 24
>> minutes of inactivity? (Surely not; that doesn't make sense.) And cleared
>> from where, the directory specified in session.save_path?
> 
> Yes and Yes. After 1440 seconds of not being accessed, they are deleted the
> next time the garbage collection routine is ran.

So how did my tests of going up to 2 hours without activity succeed?

>> session.save_path /tmp -- The session id and session variables are stored
> in
>> this directory, and it's more secure to specify a different directory. Is
> it
>> more stable to specify a different directory? Is it more stable to use a
>> database?
> 
> Depends on what else your server is doing and how much traffic you get. If
> you get a lot of traffic, there are going to be a lot of session files
> sitting in this directory. Keeping it separate from /tmp will just reduce
> the number of files in the directory.
> 
> A database adds to much overhead and is only needed in special cases, IMO.
> 
>> session.cache_expire 180 -- The cache expires after 3 hours? If
>> session.cache_limiter is set to nocache, is session.cache_expire relevant?
> 
> Not sure on that one, but it seems logical.
> 
>> Basically, I want users to be able to stay logged in to the content
>> management system indefinitely, but my tests show that after about 2 hours
>> of inactivity, the session expires. (Going to a different page causes the
>> session variable that identifies the user to be checked with
>> session_is_registered(), and access is denied if the variable isn't
>> registered.) Some users have reported this happening after about 30
> minutes.
> 
> Garbage collection isn't exact. It's triggered (by default) on 1% of the
> hits to your site. So if two are triggered close together, then someone can
> be logged out rather quickly at 30 minutes. If there is a long pause where
> the probability just doesn't trigger the garbage collection, then it may
> take longer.
> 
>> I'm on LInux, PHP 4.1.2, session.cookie_lifetime setting is 0,
>> session.use_cookies setting is On, session.use_trans_sid setting is 1, and
>> other configurations as mentioned above. Why are sessions expiring?
> Comments
>> and directions to more information are appreciated.
> 
> Sessions are lost when the file is cleaned up by garbage collection or when
> the user closes the browser (by default). So, if you wanted to use the
> existing session handling routines, you could set the cookie lifetime to a
> large value so the cookie isn't deleted and set the gc_maxlifetime to a
> large value, also. You could possibly turn the gc_probability to zero, go
> garbage collection is never triggered.
> 
> Another option would be to use session_save_path() within your application
> to save the session files to a separate directory that's writable by the web
> server. Since this directory is different from session.save_path specified
> in php.ini, garbage collection will never occur, so the files will not be
> deleted.

This seems like the answer I was looking for. So the setting
session.gc_maxlifetime only relates to garbage collection from the /tmp
directory? If I use session_save_path() to define a different directory for
saving session data, then garbage collection will never occur for that
directory?

> You can also define your own session handler to do what you want.
> 
> Why not just use a cookie to "remember me" though, instead of keeping the
> sessions persistant? You're going to end up with a file on your computer for
> _every_ person that visits the site and the file will not go away. Seems
> like it'd be better to just use a cookie and load their data if it's not
> already present, like on their first visit.

This is for a content management system, with less than 10 people authorized
to access it, so I don't see the number of session files as a problem.

Thanks for the info.

--
Lowell Allen


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




[PHP] passing variables to flash

2003-02-21 Thread Michiel van Heusden
i want to pass variables to a shockwave-flash-file
currently that's working fine with

print " 
etc...

but passing the variables through GET makes iexplore think it's loading a
new *.swf-file

how to fix this?

1) is there a way around using GET to pass the variables from PHP?
2) is there a way to make Iexplore realise the file has been loaded before
:)?

thanks a lot
michiel



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




[PHP] ayuda mysql

2003-02-21 Thread Rot Alvarez
estoy tratando de programar un messenger en php y
sale este mensaje y no se como arreglarlo...no lo entiendo

Warning: MySQL Connection Failed: Unknown MySQL Server Host 'misitio.cl/' (2) in 
/../messengerphp/cabesera.php on line 87

Warning: Supplied argument is not a valid MySQL-Link resource in 
/../messengerphp/cabesera.php on line 88


_
Registra gratis tu cuenta email en http://www.exploraiquique.cl

_
Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, 
POP & more! http://www.everyone.net/selectmail?campaign=tag

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




Re: [PHP] Re: Mysql DB connect failure

2003-02-21 Thread ML
Thanks rick, that is a much cleaner solution!


"Rick Emery" <[EMAIL PROTECTED]> wrote in message
009f01c2d9c1$51171d20$0500a8c0@honeybee">news:009f01c2d9c1$51171d20$0500a8c0@honeybee...
> $db = mysql_pconnect("localhost", "test1", "test1") or die(mysql_error());
>
> - Original Message -
> From: "ML" <[EMAIL PROTECTED]>
> To: <>
> Sent: Friday, February 21, 2003 9:33 AM
> Subject: [PHP] Re: Mysql DB connect failure
>
>
> Where exactly would I put the print mysql_error() ?
> Here is the code...
>
> 
>  @ $db = mysql_pconnect("localhost", "test1", "test1")
>or
>die("
> 
> 
> 
> 
> ");
>
>
>
>
>
> "Hans Prins" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > did you try:
> > print mysql_error();
> >
> > "Ml" <[EMAIL PROTECTED]> schreef in bericht
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Currently I have some php code that displays a message if a connect to
> my
> > > database fails. Is there anyway I
> > > can get a more descriptive error message? So I can see exactly why my
> php
> > > can't connect to the Database?
> > > I am pretty sure that the username and password are correct and the
> > username
> > > exists as a mysql user...
> > >
> > >
> > >
> >
> >
>
>
>
> --
> 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: Mysql DB connect failure

2003-02-21 Thread ML
I see that its looking for mysql.sock in /tmp/mysql.sock
but I searched on my system and only found mysql.sock in /var/lib/mysql/

is there a section where I need to change this setting? or a conf file?


"Hans Prins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Would you care to explain to the rest of the list how you intend to use
> > mysql_error () to return connection failure information?
> >
> > It returns the text of the error message from previous MySQL operation
> > Description: string mysql_error ( [resource link_identifier])
> >
> > Seems to me that without a connection, we wouldn't have a valid
> > link_identifier.
>
> maybe so, but it works nonetheless.
>
> if for example the username stated in the connection initialization was
> wrong it will print an error like:
>
> "Access denied for user: 'username@localhost' (Using password: YES)"
>
> MI,
>
> my code would look somethign like this:
>
> $link = @mysql_pconnect("localhost", "test1", "test1");
>
> // If connection failed...
> if (!$link) {
> // Inform user of error and quit
> print "Couldn't connect to database server\n";
> print mysql_error();
> exit;
> }
>
>
>
> "Jason K Larson" <[EMAIL PROTECTED]> schreef in bericht
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Would you care to explain to the rest of the list how you intend to use
> > mysql_error () to return connection failure information?
> >
> > It returns the text of the error message from previous MySQL operation
> > Description: string mysql_error ( [resource link_identifier])
> >
> > Seems to me that without a connection, we wouldn't have a valid
> > link_identifier.
> >
> > What you probably should attempt going for is getting something back
> > from PHP itself regarding the error returned when the mysql_connect
> failed.
> >
> > Here's a snippet from:
> > http://www.php.net/manual/en/language.operators.errorcontrol.php
> >
> > If the track_errors feature is enabled, any error message generated by
> > the expression will be saved in the global variable $php_errormsg. This
> > variable will be overwritten on each error, so check early if you want
> > to use it.
> >
> > Hope that clears things up a bit.
> >
> > Regards,
> > Jason k Larson
> >
> >
> >
> > Hans Prins wrote:
> > > did you try:
> > > print mysql_error();
> > >
> > > "Ml" <[EMAIL PROTECTED]> schreef in bericht
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > >
> >
> >
>
>



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




Re: [PHP] session emergency

2003-02-21 Thread David Otton
On Fri, 21 Feb 2003 08:05:47 -0800 (PST), you wrote:

>Where can I set the session data size?

AFAIK, the only limit to the amount of data stored in a session is the
filesize limit of the underlying OS. What's the problem exactly?


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




Re: [PHP] session emergency

2003-02-21 Thread Jason k Larson
Sessions have a list of options that can be set, but I don't see 
anything remotely similar to a 'data size'.

What error are you getting, or please explain further in more detail.

Regards,
Jason k Larson


Joseph Bannon wrote:
Where can I set the session data size?

Joe.



__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/





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




Re: [PHP] Re: Mysql DB connect failure

2003-02-21 Thread ML
You were right Prins, I got the error:

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

So I guess I need to investigate what this means now...
Thanks!

-ML

"Hans Prins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Would you care to explain to the rest of the list how you intend to use
> > mysql_error () to return connection failure information?
> >
> > It returns the text of the error message from previous MySQL operation
> > Description: string mysql_error ( [resource link_identifier])
> >
> > Seems to me that without a connection, we wouldn't have a valid
> > link_identifier.
>
> maybe so, but it works nonetheless.
>
> if for example the username stated in the connection initialization was
> wrong it will print an error like:
>
> "Access denied for user: 'username@localhost' (Using password: YES)"
>
> MI,
>
> my code would look somethign like this:
>
> $link = @mysql_pconnect("localhost", "test1", "test1");
>
> // If connection failed...
> if (!$link) {
> // Inform user of error and quit
> print "Couldn't connect to database server\n";
> print mysql_error();
> exit;
> }
>
>
>
> "Jason K Larson" <[EMAIL PROTECTED]> schreef in bericht
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Would you care to explain to the rest of the list how you intend to use
> > mysql_error () to return connection failure information?
> >
> > It returns the text of the error message from previous MySQL operation
> > Description: string mysql_error ( [resource link_identifier])
> >
> > Seems to me that without a connection, we wouldn't have a valid
> > link_identifier.
> >
> > What you probably should attempt going for is getting something back
> > from PHP itself regarding the error returned when the mysql_connect
> failed.
> >
> > Here's a snippet from:
> > http://www.php.net/manual/en/language.operators.errorcontrol.php
> >
> > If the track_errors feature is enabled, any error message generated by
> > the expression will be saved in the global variable $php_errormsg. This
> > variable will be overwritten on each error, so check early if you want
> > to use it.
> >
> > Hope that clears things up a bit.
> >
> > Regards,
> > Jason k Larson
> >
> >
> >
> > Hans Prins wrote:
> > > did you try:
> > > print mysql_error();
> > >
> > > "Ml" <[EMAIL PROTECTED]> schreef in bericht
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > >
> >
> >
>
>



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




Re: [PHP] Root Commands

2003-02-21 Thread Patrick Armour
I understand the implications this could cause and appreciate your concerns.
This is on a test machine on a secure network that I've set up just to get
me through the learning process.  Eventually this form will be in a secure
area of the site that only staff have access to.

The script will add a username and password to the system using
$command=("sudo adduser -p $password $username);
system($command . "&> error.txt ");

The problem I am having, is that the password is written to the shadow
passwords file using plain text.  (this also happens when I issue the same
command from the command line)  What I need is to be able to issue the
'password' command and pass the variables to it.  The first part is fairly
easy:  $addpass="sudo passwd $username";  Where I'm running into problems
now is, the password command prompts twice for the correct password.  When I
try to send $password to the shell, the shell thinks they are seperate
commands. Any suggestions to get around this?

Thanks for your help.

Patrick
- Original Message -
From: "Jason Sheets" <[EMAIL PROTECTED]>
To: "Adam Voigt" <[EMAIL PROTECTED]>
Cc: "Patrick Armour" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 8:30 AM
Subject: Re: [PHP] Root Commands


> I would highly recommend against doing this, this would work but it
> would open you up to allowing your webserver user/php to add any user to
> your system.  This is beyond a bad idea.
>
> Jason.
> On Thu, 2003-02-20 at 06:46, Adam Voigt wrote:
> > Check out "sudo", with man pages or what not, you use
> > the command "visudo" to define who can run what commands
> > as root. And then in your php, you just do:
> >
> > exec("sudo adduser");
> >
> > With whatever parameters you need to adduser.
> >
> > On Wed, 2003-02-19 at 18:37, Patrick Armour wrote:
> >
> > I am trying to use a form (password protected of course) that will
> > allow an administrator to add POP accounts to a linux box.  The
> > problem that I seem to have is that the form is trying to give the
> > commands as user 'nobody' and they need to be given by either root
> > or a superuser.
> >
> > Is there any way to accomplish this?  If somebody were to point me
> > in the direction of a tutorial on this subject I would really
> > appreciate it.
> >
> > Sincerely,
> > Patrick Armour
> >
> > www.greatplainsinternet.com
> > --
> > Adam Voigt ([EMAIL PROTECTED])
> > The Cryptocomm Group
> > My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
>
>
> --
> 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: Mysql DB connect failure

2003-02-21 Thread Hans Prins
> Would you care to explain to the rest of the list how you intend to use
> mysql_error () to return connection failure information?
>
> It returns the text of the error message from previous MySQL operation
> Description: string mysql_error ( [resource link_identifier])
>
> Seems to me that without a connection, we wouldn't have a valid
> link_identifier.

maybe so, but it works nonetheless.

if for example the username stated in the connection initialization was
wrong it will print an error like:

"Access denied for user: 'username@localhost' (Using password: YES)"

MI,

my code would look somethign like this:

$link = @mysql_pconnect("localhost", "test1", "test1");

// If connection failed...
if (!$link) {
// Inform user of error and quit
print "Couldn't connect to database server\n";
print mysql_error();
exit;
}



"Jason K Larson" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Would you care to explain to the rest of the list how you intend to use
> mysql_error () to return connection failure information?
>
> It returns the text of the error message from previous MySQL operation
> Description: string mysql_error ( [resource link_identifier])
>
> Seems to me that without a connection, we wouldn't have a valid
> link_identifier.
>
> What you probably should attempt going for is getting something back
> from PHP itself regarding the error returned when the mysql_connect
failed.
>
> Here's a snippet from:
> http://www.php.net/manual/en/language.operators.errorcontrol.php
>
> If the track_errors feature is enabled, any error message generated by
> the expression will be saved in the global variable $php_errormsg. This
> variable will be overwritten on each error, so check early if you want
> to use it.
>
> Hope that clears things up a bit.
>
> Regards,
> Jason k Larson
>
>
>
> Hans Prins wrote:
> > did you try:
> > print mysql_error();
> >
> > "Ml" <[EMAIL PROTECTED]> schreef in bericht
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
>
>



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




[PHP] session emergency

2003-02-21 Thread Joseph Bannon
Where can I set the session data size?

Joe.



__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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




Re: [PHP] Re: Mysql DB connect failure

2003-02-21 Thread Jason k Larson
Would you care to explain to the rest of the list how you intend to use 
mysql_error () to return connection failure information?

It returns the text of the error message from previous MySQL operation
Description: string mysql_error ( [resource link_identifier])

Seems to me that without a connection, we wouldn't have a valid 
link_identifier.

What you probably should attempt going for is getting something back 
from PHP itself regarding the error returned when the mysql_connect failed.

Here's a snippet from: 
http://www.php.net/manual/en/language.operators.errorcontrol.php

If the track_errors feature is enabled, any error message generated by 
the expression will be saved in the global variable $php_errormsg. This 
variable will be overwritten on each error, so check early if you want 
to use it.

Hope that clears things up a bit.

Regards,
Jason k Larson



Hans Prins wrote:
did you try:
print mysql_error();

"Ml" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...





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




Fw: [PHP] Re: Mysql DB connect failure

2003-02-21 Thread Rick Emery
$db = mysql_pconnect("localhost", "test1", "test1") or die(mysql_error());

- Original Message - 
From: "ML" <[EMAIL PROTECTED]>
To: <>
Sent: Friday, February 21, 2003 9:33 AM
Subject: [PHP] Re: Mysql DB connect failure


Where exactly would I put the print mysql_error() ?
Here is the code...






");





"Hans Prins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> did you try:
> print mysql_error();
>
> "Ml" <[EMAIL PROTECTED]> schreef in bericht
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Currently I have some php code that displays a message if a connect to
my
> > database fails. Is there anyway I
> > can get a more descriptive error message? So I can see exactly why my
php
> > can't connect to the Database?
> > I am pretty sure that the username and password are correct and the
> username
> > exists as a mysql user...
> >
> >
> >
>
>



-- 
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] function to discover if value is already in array

2003-02-21 Thread 1LT John W. Holmes
> Here is an example array:
>
>
> array(
>  array("1","2"),
>  array("2","3"),
>  array("3","1")
> )
>
> now suppose I get some form inputs with the value 1 and 1. I am trying to
> find a way to figure out if the first coloumn is already in the table and
> if so just add the second coloumn to the first. I have tried various
> combinations of foreaches, in_array and array_search.
>
> Has anyone had a similar problem and found a soloution?

If you can have:

$array = array(array('1','2','3'),array('2','3','1'));

You can use this:

$key = array_search($search_for,$array[0]);
if($key !== FALSE)
{ $array[1][$key] += $add_value; }

Otherwise, with the way you have your array now, you have to search
$array[0][0], $array[1][0], $array[2][0], etc, with a loop.

---John Holmes...


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




Re: [PHP] session expiration

2003-02-21 Thread 1LT John W. Holmes
> I'm using sessions for authentication in a content management system and
> experiencing rare but occasional problems with the session apparently
> expiring unexpectedly. I've checked the manual and I've reviewed the
session
> configuration on the commericial host I'm using. I don't see anything
wrong,
> but there are some settings that I don't understand:
>
> session.gc_maxlifetime 1440 -- Garbage collection after 24 minutes? Does
> this mean that the session id and session variables will be cleared after
24
> minutes of inactivity? (Surely not; that doesn't make sense.) And cleared
> from where, the directory specified in session.save_path?

Yes and Yes. After 1440 seconds of not being accessed, they are deleted the
next time the garbage collection routine is ran.

> session.save_path /tmp -- The session id and session variables are stored
in
> this directory, and it's more secure to specify a different directory. Is
it
> more stable to specify a different directory? Is it more stable to use a
> database?

Depends on what else your server is doing and how much traffic you get. If
you get a lot of traffic, there are going to be a lot of session files
sitting in this directory. Keeping it separate from /tmp will just reduce
the number of files in the directory.

A database adds to much overhead and is only needed in special cases, IMO.

> session.cache_expire 180 -- The cache expires after 3 hours? If
> session.cache_limiter is set to nocache, is session.cache_expire relevant?

Not sure on that one, but it seems logical.

> Basically, I want users to be able to stay logged in to the content
> management system indefinitely, but my tests show that after about 2 hours
> of inactivity, the session expires. (Going to a different page causes the
> session variable that identifies the user to be checked with
> session_is_registered(), and access is denied if the variable isn't
> registered.) Some users have reported this happening after about 30
minutes.

Garbage collection isn't exact. It's triggered (by default) on 1% of the
hits to your site. So if two are triggered close together, then someone can
be logged out rather quickly at 30 minutes. If there is a long pause where
the probability just doesn't trigger the garbage collection, then it may
take longer.

> I'm on LInux, PHP 4.1.2, session.cookie_lifetime setting is 0,
> session.use_cookies setting is On, session.use_trans_sid setting is 1, and
> other configurations as mentioned above. Why are sessions expiring?
Comments
> and directions to more information are appreciated.

Sessions are lost when the file is cleaned up by garbage collection or when
the user closes the browser (by default). So, if you wanted to use the
existing session handling routines, you could set the cookie lifetime to a
large value so the cookie isn't deleted and set the gc_maxlifetime to a
large value, also. You could possibly turn the gc_probability to zero, go
garbage collection is never triggered.

Another option would be to use session_save_path() within your application
to save the session files to a separate directory that's writable by the web
server. Since this directory is different from session.save_path specified
in php.ini, garbage collection will never occur, so the files will not be
deleted.

You can also define your own session handler to do what you want.

Why not just use a cookie to "remember me" though, instead of keeping the
sessions persistant? You're going to end up with a file on your computer for
_every_ person that visits the site and the file will not go away. Seems
like it'd be better to just use a cookie and load their data if it's not
already present, like on their first visit.

---John Holmes...


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




[PHP] Re: Mysql DB connect failure

2003-02-21 Thread ML
Where exactly would I put the print mysql_error() ?
Here is the code...






");





"Hans Prins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> did you try:
> print mysql_error();
>
> "Ml" <[EMAIL PROTECTED]> schreef in bericht
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Currently I have some php code that displays a message if a connect to
my
> > database fails. Is there anyway I
> > can get a more descriptive error message? So I can see exactly why my
php
> > can't connect to the Database?
> > I am pretty sure that the username and password are correct and the
> username
> > exists as a mysql user...
> >
> >
> >
>
>



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




[PHP] Re: Mysql DB connect failure

2003-02-21 Thread Hans Prins
did you try:
print mysql_error();

"Ml" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Currently I have some php code that displays a message if a connect to my
> database fails. Is there anyway I
> can get a more descriptive error message? So I can see exactly why my php
> can't connect to the Database?
> I am pretty sure that the username and password are correct and the
username
> exists as a mysql user...
>
>
>



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




Re: [PHP] Re: session expiration

2003-02-21 Thread Hans Prins
I think a database session would be of more use to you since you would have
more control over the lifetime of the session etc


"Lowell Allen" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > From: "Hans Prins" <[EMAIL PROTECTED]>
> >
> > can you show us the PHP code that you use to manage your session?
>
> Sure. You say in a following post:
>
> > I am asking because if you are using: session_set_cookie_params(), the
> > effect of this function only lasts for the duration of the script.
>
> I'm not using session_set_cookie_params(). The session.cookie_lifetime
> setting is 0; I don't specify anything about cookies.
>
> I have a login function that checks username/password against database
> values, then on the content management system index page I do:
>
> if (login($username, $password) {
> $user = $username;
> session_register("user");
> }
>
> All pages within the cms have session_start(); following a require_once()
> statement, output some HTML, then call check_valid_user(), shown below:
>
> function check_valid_user() {
> global $user;
> if (session_is_registered("user")) {
> echo("Logged in as $user.");
> } else {
> ?>
> Problem: You are not logged in.
> Login
> 
> 
>  exit;
> }
> }
>
> That's it.
>
> --
> Lowell Allen
>
>
> > "Lowell Allen" <[EMAIL PROTECTED]> schreef in bericht
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >> I'm using sessions for authentication in a content management system
and
> >> experiencing rare but occasional problems with the session apparently
> >> expiring unexpectedly. I've checked the manual and I've reviewed the
> > session
> >> configuration on the commericial host I'm using. I don't see anything
> > wrong,
> >> but there are some settings that I don't understand:
> >>
> >> session.gc_maxlifetime 1440 -- Garbage collection after 24 minutes?
Does
> >> this mean that the session id and session variables will be cleared
after
> > 24
> >> minutes of inactivity? (Surely not; that doesn't make sense.) And
cleared
> >> from where, the directory specified in session.save_path?
> >>
> >> session.save_path /tmp -- The session id and session variables are
stored
> > in
> >> this directory, and it's more secure to specify a different directory.
Is
> > it
> >> more stable to specify a different directory? Is it more stable to use
a
> >> database?
> >>
> >> session.cache_expire 180 -- The cache expires after 3 hours? If
> >> session.cache_limiter is set to nocache, is session.cache_expire
relevant?
> >>
> >> Basically, I want users to be able to stay logged in to the content
> >> management system indefinitely, but my tests show that after about 2
hours
> >> of inactivity, the session expires. (Going to a different page causes
the
> >> session variable that identifies the user to be checked with
> >> session_is_registered(), and access is denied if the variable isn't
> >> registered.) Some users have reported this happening after about 30
> > minutes.
> >>
> >> I'm on LInux, PHP 4.1.2, session.cookie_lifetime setting is 0,
> >> session.use_cookies setting is On, session.use_trans_sid setting is 1,
and
> >> other configurations as mentioned above. Why are sessions expiring?
> > Comments
> >> and directions to more information are appreciated.
> >>
> >> --
> >> Lowell Allen
>



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




Re: [PHP] function to discover if value is already in array

2003-02-21 Thread Ray
On Friday 21 February 2003 09:08, you wrote:
> Here is an example array:
>
>
> array(
>  array("1","2"),
>  array("2","3"),
>  array("3","1")
> )
>
> now suppose I get some form inputs with the value 1 and 1. I am trying to
> find a way to figure out if the first coloumn is already in the table and
> if so just add the second coloumn to the first. I have tried various
> combinations of foreaches, in_array and array_search.
>
> Has anyone had a similar problem and found a soloution?

would something like 
array(
  1 => 2,
  2 => 3,
  3 => 1
 )
work?
and use array_key_exists to see if the 1st 'colomn' has a value of one?

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




[PHP] Mysql DB connect failure

2003-02-21 Thread ML
Currently I have some php code that displays a message if a connect to my
database fails. Is there anyway I
can get a more descriptive error message? So I can see exactly why my php
can't connect to the Database?
I am pretty sure that the username and password are correct and the username
exists as a mysql user...




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




Re: [PHP] Php Oracle & Word object

2003-02-21 Thread 1LT John W. Holmes
SELECT it out, send Word headers with header() and echo your data.

---John Holmes...

- Original Message - 
From: "M.ALPER KARASAHIN" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 21, 2003 8:53 AM
Subject: [PHP] Php Oracle & Word object


Hi,
i want to display a blob column, that contain a word object. 

My database is Oracle Ver 8.1.7.
Php version is 4.2.3

How can i do this?

Thanks for your help.

Alper.


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




[PHP] function to discover if value is already in array

2003-02-21 Thread JJ Harrison
Here is an example array:


array(
 array("1","2"),
 array("2","3"),
 array("3","1")
)

now suppose I get some form inputs with the value 1 and 1. I am trying to
find a way to figure out if the first coloumn is already in the table and if
so just add the second coloumn to the first. I have tried various
combinations of foreaches, in_array and array_search.

Has anyone had a similar problem and found a soloution?



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




Re: Re[2]: [PHP] small ads system

2003-02-21 Thread 1LT John W. Holmes
> Thank you for answer, but I need application for personal small ads.
>
> I am looking for application which need to show categorized
> personal small ads and needto allow on-line adding of
> personal small ads (for everyone) and and
> need to have some mechanism for ads administration.
>
>
> I do not need application for banners management.

Ah.. sorry. You mean something like a classifieds system? I misunderstood
you. Best bet is to search hotscripts.com (already suggested) or
sourceforge.net. Something is out there already written.

---John Holmes...


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




Re[2]: [PHP] small ads system

2003-02-21 Thread Nenad Djordjevic
Hello John,

Thank you for answer, but I need application for personal small ads.

I am looking for application which need to show categorized
personal small ads and needto allow on-line adding of
personal small ads (for everyone) and and
need to have some mechanism for ads administration.


I do not need application for banners management.



Best regards,
 Nenad Djordjevic   mailto:[EMAIL PROTECTED]
   
   Diyomi Soft
   http://www.diyomisoft.com/


Friday, February 21, 2003, 3:56:31 PM, you wrote:

>> I need web application (PHP/MySQL) for small ads
>> (personal ads, that is advertisements to buy and
>> sell cars, houses etc).

1JWH> http://www.phpwizard.net/projects/phpAds/

1JWH> ---John Holmes...


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




Re: [PHP] small ads system

2003-02-21 Thread 1LT John W. Holmes
> I need web application (PHP/MySQL) for small ads
> (personal ads, that is advertisements to buy and
> sell cars, houses etc).

http://www.phpwizard.net/projects/phpAds/

---John Holmes...

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




Re: [PHP] list "a", list "b" ...etc

2003-02-21 Thread 1LT John W. Holmes
> how can i sort names by first letter, like, show only names starting 
> with a, then b, c .. etc

Where is the data? In an array? database? file?

If it's a database, then you can just do

SELECT * FROM table WHERE column LIKE 'a%'
or
SELECT * FROM table WHERE LEFT(column,1) = 'a'

---John Holmes...

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




  1   2   >