php-general Digest 31 May 2002 10:09:27 -0000 Issue 1377

Topics (messages 100015 through 100072):

Re: Help with example session class (second request)
        100015 by: Michael Davey
        100026 by: John Holmes

Re: migrating PWS to Apache
        100016 by: Analysis & Solutions

array question
        100017 by: Michelle
        100018 by: Martin Towell
        100020 by: Analysis & Solutions

Re: Help with a trivial session example.
        100019 by: Daevid Vincent
        100021 by: Michael Davey
        100024 by: Daevid Vincent
        100025 by: John Holmes
        100027 by: Michael Davey
        100065 by: Ford, Mike               [LSS]

Trouble with PHP XMLRPC on Solaris
        100022 by: Michael Sweeney

Apache 1.3.24 + PHP 4.2.1 Install Problem - Undefined Symbol
        100023 by: Samantha Savvakis

Failed opening '' for inclusion...
        100028 by: Jeff Lewis
        100029 by: Martin Towell
        100030 by: Jeff Lewis
        100031 by: Martin Towell
        100033 by: Jeff Lewis

'Couldn't compile code. And I'm not smart enough to tell you why, sorry.' -- Any ideas?
        100032 by: Sqlcoders.com Programming Dept

Slow Access to SMTP is Causing Slow mail()
        100034 by: Bruce Vander Werf
        100035 by: Manuel Lemos
        100038 by: Miguel Cruz

Re: Undefined variables
        100036 by: Christopher J. Crane
        100037 by: Miguel Cruz
        100052 by: Christopher J. Crane
        100053 by: Martin Towell

Re: fdup & Pipes? (New Thread)
        100039 by: Miguel Cruz

Re: PHP commands inside a MySQL Database
        100040 by: Miguel Cruz

Re: Newbie redirect problem
        100041 by: Miguel Cruz

Re: Creating IMAP accounts
        100042 by: Miguel Cruz

Re: Design Problem
        100043 by: Miguel Cruz

Mcrypt Function - New to it
        100044 by: Tom Ray
        100047 by: Tom Rogers
        100050 by: Tom Ray

Re: newbie: cron jobs
        100045 by: Miguel Cruz

user auth
        100046 by: Justin Blake
        100048 by: Daniel Tryba
        100049 by: Miguel Cruz

PHP.INI Lockdown
        100051 by: David Redmond

Graphs using PHP
        100054 by: Jason Soza

compile problem with gd 2.0.1
        100055 by: Michael Geier

pdf with POST
        100056 by: Josep R. Raurell
        100058 by: Miguel Cruz

Re: nested if parse error
        100057 by: Miroslav Figlar
        100062 by: Ford, Mike               [LSS]

Apache 2.0.36  and PHP
        100059 by: Herman Pool
        100060 by: Stuart Dallas

Multiple queries
        100061 by: Caspar Kennerdale

Replacing Number with Month(newbie)
        100063 by: webmaster.tececo.com
        100066 by: Jon Haworth
        100071 by: Ford, Mike               [LSS]

how to detect if the client's browser accepts cookies ?
        100064 by: David Eisenhart
        100068 by: Nick Talbott

Cache Control
        100067 by: Jeroen Timmers
        100069 by: Jon Haworth
        100070 by: Jeroen Timmers
        100072 by: Jon Haworth

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
As I said...

>Not quite sure where you got this $login class instance from, but it
>appears to be from thin air.  If you have a session class then you would
need >to instantiate it first with:
>
>$login = new XYZSessionClass(); // plus any constructor arguments

And to quote from the manual page you gave the link to:

"To use this class, simply create a new object $login = new
mySession("name");"

"Daevid Vincent" <[EMAIL PROTECTED]> wrote in message
003c01c20826$451f3dd0$45193e04@telecom">news:003c01c20826$451f3dd0$45193e04@telecom...
> Thank you john for the prompt reply, however I must be completely
> retarded. I do this:
>
> <?php
> session_start();
>
> if( $login->getSessionVar("login") )
> {
> $booth_id = $login->getSessionVar("booth_id");
> $booth_name = $login->getSessionVar("booth_name");
> echo "\n<BR>booth_id = $booth_id and booth_name =
> $booth_name<BR>\n";
> }
> else
> {
> Header("Location: ../index.phtml\n\n");
> exit;
> }
>
> echo "this session is named: ".session_name()."<BR>\n";
>
> include("../globalassets/include/header.phtml");
> ?>
>
> And I get this error:
>
> Fatal error: Call to a member function on a non-object in content.phtml
> on line 4
>
> > -----Original Message-----
> > From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 30, 2002 12:19 PM
> > To: Daevid Vincent; PHP general mailing list
> > Subject: Re: [PHP] Help with example session class (second request)
> >
> >
> > Call session_start() on your second page...
> >
> > ---John Holmes...
> >
> > ----- Original Message -----
> > From: "Daevid Vincent" <[EMAIL PROTECTED]>
> > To: "PHP general mailing list" <[EMAIL PROTECTED]>
> > Sent: Thursday, May 30, 2002 3:10 PM
> > Subject: [PHP] Help with example session class (second request)
> >
> >
> > > Sorry for posting this again so soon, but until I get sessions
> > > working, I'm blocked on this project.
> > >
> > > D.
> > > -----------
> > >
> > > I'm just learning sessions, and thought the class looked
> > interesting
> > > on this page: http://www.php.net/manual/en/ref.session.php
> > >
> > > So I have this on an index.phtml page and I can see the
> > variables are
> > > being set and all looks good there, however upon successful
> > "login" I
> > > wish to redirect to content.phtml At the very top of content.phtml I
> > > have:
> > >
> > > <?php
> > > if( $login->getSessionVar("login") )
> > > {
> > > $booth_id = $login->getSessionVar("booth_id");
> > > $booth_name = $login->getSessionVar("booth_name");
> > > echo "\n<BR>booth_id = $booth_id and booth_name =
> > > $booth_name<BR>\n";
> > > }
> > > else
> > > {
> > > Header("Location: ../index.phtml\n\n");
> > > exit;
> > > }
> > > ?>
> > >
> > > But it doesn't seem that $login exists or is defined now on
> > this page?
> > >
> > > So my question is basically, how can I use the class and
> > the session
> > > variables across multiple pages? Do I need to move the class to an
> > > include file? Do I need to re-create it on each page somehow? Can
> > > someone show me a real working example of this scenario?
> > >
> > > Daevid Vincent
> > > http://daevid.com
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>


--- End Message ---
--- Begin Message ---
This object $login (wherever that comes from) doesn't have one of the
functions you are trying to call. 

---John Holmes...

> -----Original Message-----
> From: Daevid Vincent [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 30, 2002 6:07 PM
> To: 'PHP general mailing list'
> Cc: '1LT John W. Holmes'
> Subject: RE: [PHP] Help with example session class (second request)
> 
> Thank you john for the prompt reply, however I must be completely
> retarded. I do this:
> 
> <?php
>       session_start();
> 
>       if( $login->getSessionVar("login") )
>       {
>               $booth_id = $login->getSessionVar("booth_id");
>               $booth_name = $login->getSessionVar("booth_name");
>               echo "\n<BR>booth_id = $booth_id and booth_name =
> $booth_name<BR>\n";
>       }
>       else
>       {
>               Header("Location: ../index.phtml\n\n");
>               exit;
>       }
> 
>       echo "this session is named: ".session_name()."<BR>\n";
> 
>       include("../globalassets/include/header.phtml");
> ?>
> 
> And I get this error:
> 
> Fatal error: Call to a member function on a non-object in
content.phtml
> on line 4
> 
> > -----Original Message-----
> > From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 30, 2002 12:19 PM
> > To: Daevid Vincent; PHP general mailing list
> > Subject: Re: [PHP] Help with example session class (second request)
> >
> >
> > Call session_start() on your second page...
> >
> > ---John Holmes...
> >
> > ----- Original Message -----
> > From: "Daevid Vincent" <[EMAIL PROTECTED]>
> > To: "PHP general mailing list" <[EMAIL PROTECTED]>
> > Sent: Thursday, May 30, 2002 3:10 PM
> > Subject: [PHP] Help with example session class (second request)
> >
> >
> > > Sorry for posting this again so soon, but until I get sessions
> > > working, I'm blocked on this project.
> > >
> > > D.
> > > -----------
> > >
> > > I'm just learning sessions, and thought the class looked
> > interesting
> > > on this page: http://www.php.net/manual/en/ref.session.php
> > >
> > > So I have this on an index.phtml page and I can see the
> > variables are
> > > being set and all looks good there, however upon successful
> > "login" I
> > > wish to redirect to content.phtml At the very top of content.phtml
I
> > > have:
> > >
> > > <?php
> > > if( $login->getSessionVar("login") )
> > > {
> > > $booth_id = $login->getSessionVar("booth_id");
> > > $booth_name = $login->getSessionVar("booth_name");
> > > echo "\n<BR>booth_id = $booth_id and booth_name =
> > > $booth_name<BR>\n";
> > > }
> > > else
> > > {
> > > Header("Location: ../index.phtml\n\n");
> > > exit;
> > > }
> > > ?>
> > >
> > > But it doesn't seem that $login exists or is defined now on
> > this page?
> > >
> > > So my question is basically, how can I use the class and
> > the session
> > > variables across multiple pages? Do I need to move the class to an
> > > include file? Do I need to re-create it on each page somehow? Can
> > > someone show me a real working example of this scenario?
> > >
> > > Daevid Vincent
> > > http://daevid.com
> > >
> > >
> > >
> > > --
> > > 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


--- End Message ---
--- Begin Message ---
On Thu, May 30, 2002 at 04:17:58PM -0400, Steve Clay wrote:
> Hello,
> 
> On winNT I have Personal Web Server, PHP4.1.1, MySQL.
> My target is Apache1.3, PHP4.2.2, Perl, MySQL.

Delete PHP 4.1.1
Download Apache and install.
Download Perl and install.
Download PHP and install.

Edit Apache's httpd.conf file:

   AddType application/x-httpd-cgi .cgi
   Action application/x-httpd-cgi "c:/perl/bin/perl"
   ScriptAlias /cgi-bin/ "c:/perl/bin/perl"
   ScriptInterpreterSource registry

   AddType application/x-httpd-php .html .php
   Action application/x-httpd-php "/phpxyz/php.exe"
   ScriptAlias /phpxyz/ "c:/Program Files/php4/"


Open up Windows Explorer:  View | Options | File Types.  Now, add/or 
edit the Registered File Types for the files you want parsed by Perl.
"Edit" the command for the "open" action by put the following in the 
"Application used to perform action" box:
   c:\Perl\bin\Perl.exe "%1" %*

Of course, put Apache in your system's services startup list, as per 
Apache's instructions.  

If you already have Apached started, your changes to httpd.conf don't 
take effect till the next startup.  If you're editing the file while 
it's running, make sure to make a backup, because errors in the file can 
stop Apache from shutting down.

Pretty simple.

I don't belive there's a need to uninstall PWS, though you might want to 
turn it off.

Enjoy,

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
--- End Message ---
--- Begin Message ---
I'm a newbie at php and I'm sure you will be able to tell by my question. I'm just 
doing a simple form but my head is hurting from trying to figure out the correct 
syntax. 

I'm posting the form to $PHP_SELF

an example from my $form_block =

<p><b>*</b>Your Name:<br />
<INPUT type=\"text\" name=\"sender_name\" value=\"$_POST[sender_name]\" size=30></p>
 
<p><b>*</b>Your E-Mail Address:<br />
<INPUT type=\"text\" name=\"sender_email\" value=\"$_POST[sender_email]\" size=30></p>

<p>Phone Number:<br />
<INPUT type=\"text\" name=\"phone\" value=\"$_POST[phone]\" size=30></p>

which finally leads to my question how do I do the $_POST[var] when it's an 
array(checkbox or radio button)?

ex: <input type=\"checkbox\" name=\"product[]\" value=\"red\">red<br />

Am I making sense? If not please let me know :-) and I will try to remedy it.

Michelle
--- End Message ---
--- Begin Message ---
$_POST["product"][0]
$_POST["product"][1]
etc.


-----Original Message-----
From: Michelle [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 9:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] array question


I'm a newbie at php and I'm sure you will be able to tell by my question.
I'm just doing a simple form but my head is hurting from trying to figure
out the correct syntax. 

I'm posting the form to $PHP_SELF

an example from my $form_block =

<p><b>*</b>Your Name:<br />
<INPUT type=\"text\" name=\"sender_name\" value=\"$_POST[sender_name]\"
size=30></p>
 
<p><b>*</b>Your E-Mail Address:<br />
<INPUT type=\"text\" name=\"sender_email\" value=\"$_POST[sender_email]\"
size=30></p>

<p>Phone Number:<br />
<INPUT type=\"text\" name=\"phone\" value=\"$_POST[phone]\" size=30></p>

which finally leads to my question how do I do the $_POST[var] when it's an
array(checkbox or radio button)?

ex: <input type=\"checkbox\" name=\"product[]\" value=\"red\">red<br />

Am I making sense? If not please let me know :-) and I will try to remedy
it.

Michelle
--- End Message ---
--- Begin Message ---
On Thu, May 30, 2002 at 07:24:49PM -0400, Michelle wrote:

> <p>Phone Number:<br />
> <INPUT type=\"text\" name=\"phone\" value=\"$_POST[phone]\" size=30></p>
> 
> which finally leads to my question how do I do the $_POST[var] when
> it's an array(checkbox or radio button)?
> 
> ex: <input type=\"checkbox\" name=\"product[]\" value=\"red\">red<br />

   echo '<input type="checkbox" name="product[]" value="red"';
   echo ( in_array('red', $_POST['product']) ) ? ' checked' : '' ;
   echo ' />red';

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
--- End Message ---
--- Begin Message ---
Okay, now I'm completely confused...

I made a very simple test page, and even that doesn't work:

http://daevid.com/examples/index.phtml

Notice how I have the right session_id, but the variable didn't pass
onto the second page.

Can someone please explain to me what I am doing wrong? 

Do I not have PHP.ini configured properly or something?

D.

--- End Message ---
--- Begin Message ---
Hmm...

I can't say that I have moved over to the new superglobals yet - I prefer
register_globals cos I am lazy ;)

But it does seem that there are two possible variables that you need to
use - the one in your script ($HTTP_SESSION_VARS), but this is only for
4.0.6 or less, it is $_SESSION otherwise - what version do you have
installed?

regards,

Mikey

"Daevid Vincent" <[EMAIL PROTECTED]> wrote in message
003d01c20830$3d814690$45193e04@telecom">news:003d01c20830$3d814690$45193e04@telecom...
> Okay, now I'm completely confused...
>
> I made a very simple test page, and even that doesn't work:
>
> http://daevid.com/examples/index.phtml
>
> Notice how I have the right session_id, but the variable didn't pass
> onto the second page.
>
> Can someone please explain to me what I am doing wrong?
>
> Do I not have PHP.ini configured properly or something?
>
> D.
>


--- End Message ---
--- Begin Message ---
> I can't say that I have moved over to the new superglobals 
> yet - I prefer register_globals cos I am lazy ;)

Given $myvar = 5;

If you use session_register('myvar');

Then on another page, do you just access it via $myvar?

And if that's the case, isn't it the same to set

$HTTP_SESSION_VARS['myvar'] = $myvar;
Or even
$GLOBALS['myvar'] = $myvar;
Or 
$_SESSION['myvar'] = $myvar;

Not that ANY of these are working for me *sigh*

> But it does seem that there are two possible variables that 
> you need to use - the one in your script 
> ($HTTP_SESSION_VARS), but this is only for 4.0.6 or less, it 
> is $_SESSION otherwise - what version do you have installed?

4.0.6 according to the phpinfo link on the page ;-)

> I made a very simple test page, and even that doesn't work:
>
> http://daevid.com/examples/index.phtml
>
> Notice how I have the right session_id, but the variable didn't pass 
> onto the second page.
>
> Can someone please explain to me what I am doing wrong?
> Do I not have PHP.ini configured properly or something?

--- End Message ---
--- Begin Message ---
You have to use session_register() with 4.0.6

---John Holmes...

> -----Original Message-----
> From: Daevid Vincent [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 30, 2002 7:46 PM
> To: [EMAIL PROTECTED]
> Cc: 'Michael Davey'
> Subject: RE: [PHP] Re: Help with a trivial session example.
> 
> > I can't say that I have moved over to the new superglobals
> > yet - I prefer register_globals cos I am lazy ;)
> 
> Given $myvar = 5;
> 
> If you use session_register('myvar');
> 
> Then on another page, do you just access it via $myvar?
> 
> And if that's the case, isn't it the same to set
> 
> $HTTP_SESSION_VARS['myvar'] = $myvar;
> Or even
> $GLOBALS['myvar'] = $myvar;
> Or
> $_SESSION['myvar'] = $myvar;
> 
> Not that ANY of these are working for me *sigh*
> 
> > But it does seem that there are two possible variables that
> > you need to use - the one in your script
> > ($HTTP_SESSION_VARS), but this is only for 4.0.6 or less, it
> > is $_SESSION otherwise - what version do you have installed?
> 
> 4.0.6 according to the phpinfo link on the page ;-)
> 
> > I made a very simple test page, and even that doesn't work:
> >
> > http://daevid.com/examples/index.phtml
> >
> > Notice how I have the right session_id, but the variable didn't pass
> > onto the second page.
> >
> > Can someone please explain to me what I am doing wrong?
> > Do I not have PHP.ini configured properly or something?
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
> Given $myvar = 5;
>
> If you use session_register('myvar');
>
> Then on another page, do you just access it via $myvar?

That is exactly how it works - I also have session.auto_start turned on as
well.

> And if that's the case, isn't it the same to set
>
> $HTTP_SESSION_VARS['myvar'] = $myvar;
> Or even
> $GLOBALS['myvar'] = $myvar;
> Or
> $_SESSION['myvar'] = $myvar;
>
> Not that ANY of these are working for me *sigh*

As I said - I wouldn't know as I haven't used them yet - but it seems like
it should having read the manual briefly.

> 4.0.6 according to the phpinfo link on the page ;-)

I realised that just after I sent the mail - doh!

Mikey


--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Michael Davey [mailto:[EMAIL PROTECTED]]
> Sent: 31 May 2002 00:37
> 
> I can't say that I have moved over to the new superglobals 
> yet - I prefer
> register_globals cos I am lazy ;)
> 
> But it does seem that there are two possible variables that 
> you need to
> use - the one in your script ($HTTP_SESSION_VARS), but this 
> is only for
> 4.0.6 or less, it is $_SESSION otherwise - what version do you have
> installed?

Nope, that's not true -- $HTTP_*_VARS arrays are still around, as well as $_*, so 
existing scripts using them will continue to work.  The old names aren't even listed 
as deprecated, so it doesn't look like they're going to go away any time soon.

Having said that, if you're starting from scratch on version 4.1.0 or later, you 
should definitely go for the new $_* superglobals.

Cheers!

Mike

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

I'm trying to get some xmlrpc connectivity working through PHP. Current 
configuration is Apache 1.3.22/PHP 4.2.0 on Solaris 7. I've linked to the 
current expat libraries. Configure and compile don't show any problems and 
other PHP scripts (including phpinfo) work fine. The problem is that an 
xmlrpc call to the Solaris host invariably returns a "Method not found" error 
message. The same xmlrpc server code works flawlessly on a Linux system 
similarly configured (Apache 1.3.24/PHP 4.2) with the same requests.

The only thing I can find is that libxml.so is not installed on the Solaris 
system, but my understanding is that that is a gnome specific library and I'm 
not running gnome on the Solaris box - I haven't been able to find any 
indication that that particular library is required for xmlrpc. 

I've looked everywhere I can think of for a hint, but haven't been able to 
find anything so far. Can anyone shed any light on this problem for me?

Michael
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
HI,

Server Details:
OpenUnix 8
Apache 1.3.24
PHP 4.2.1
LIBXML 2.4.16
gcc 2.95.3pl1

I am trying to compile Apache and PHP on OpenUnix 8.

Managed to get PHP to successfully compile and build a module for Apache.

Trying to compile apache, and I'm getting undefined symbol errors with PHP:


gcc  -DTARGET=\"httpsd\" -I/home/samsa/archives/php-4.2.1 -I/home/samsa/arch
ives/php-4.2.1/main -I/home/samsa/archives/php-4.
2.1/main -I/home/samsa/archives/php-4.2.1/Zend -I/home/samsa/archives/php-4.
2.1/Zend -I/home/samsa/archives/php-4.2.1/TSRM -I/home/sa
msa/archives/php-4.2.1/TSRM -I/home/samsa/archives/php-4.2.1 -DUSE_EXPAT -I.
/lib/expat-lite -DAPACHE_SSL `./apaci`    \
              -o httpsd buildmark.o modules.o  modules/ssl/libssl.a
modules/php4/libphp4.a  modules/standard/libstandard.a  main/lib
main.a  ./os/unix/libos.a  ap/libap.a
lib/expat-lite/libexpat.a  -L/usr/ucblib -L/usr/local/lib -L/usr/local/mysql
/lib  -L/usr/ucbli
b -L/usr/local/lib -L/usr/local/mysql/lib -Lmodules/php4 -L../modules/php4 -
L../../modules/php4 -lmodphp4   -lmysqlclient -lz -lnsl -
lsocket -lm -lz -lxml2 -lz -lcrypt -lresolv -lresolv -lm -ldl -lsocket  -lso
cket -lcrypt   -L/usr/local/ssl/lib -lssl -lcrypto
Undefined                       first referenced
symbol                              in file
php_register_variable_ex            libphp4.a(rfc1867.o)
php_std_post_handler                libphp4.a(php_content_types.o)
php_treat_data                      libphp4.a(main.o)
tsrm_strtok_r                       libphp4.a(tsrm_virtual_cwd.o)
__builtin_generic                   libphp4.a(formatted_print.o)
php_register_variable               libphp4.a(mod_php4.o)
php_import_environment_variables    libphp4.a(main.o)
UX:ld: ERROR: Symbol referencing errors. No output written to httpsd
collect2: ld returned 1 exit status
*** Error code 1 (bu21)
UX:make: ERROR: fatal error.

Any ideas? I don't know what library has been left out. PHP built
successfully with gcc.

Thanks,
Sam

--- End Message ---
--- Begin Message ---
I am running PHP 4.2.1 on Windows XP. I had 4.1.2 running perfectly fine and
then decided to get MSSQl running as well. So I ran into a problem where it
failed to load the DLL. I read through the archives and it said to make sure
I have the most up to date DLL, so I then installed 4.2.1.

Now, when I run my scripts I get this error:

2: Failed opening '' for inclusion (include_path='.;c:\php4\pear')

I can NOT find anywhere that this php4\pear is set!

Would appreciate any help that could be offered.

Jeff


--- End Message ---
--- Begin Message ---
have you looked in php.ini ?

-----Original Message-----
From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 10:19 AM
To: PHP General
Subject: [PHP] Failed opening '' for inclusion...


I am running PHP 4.2.1 on Windows XP. I had 4.1.2 running perfectly fine and
then decided to get MSSQl running as well. So I ran into a problem where it
failed to load the DLL. I read through the archives and it said to make sure
I have the most up to date DLL, so I then installed 4.2.1.

Now, when I run my scripts I get this error:

2: Failed opening '' for inclusion (include_path='.;c:\php4\pear')

I can NOT find anywhere that this php4\pear is set!

Would appreciate any help that could be offered.

Jeff



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Yes and that isn't in there (php4\pear). I looked in the php.ini in windows
and in php folders...

Jeff
----- Original Message -----
From: "Martin Towell" <[EMAIL PROTECTED]>
To: "'Jeff Lewis'" <[EMAIL PROTECTED]>; "PHP General"
<[EMAIL PROTECTED]>
Sent: Thursday, May 30, 2002 8:20 PM
Subject: RE: [PHP] Failed opening '' for inclusion...


> have you looked in php.ini ?
>
> -----Original Message-----
> From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 31, 2002 10:19 AM
> To: PHP General
> Subject: [PHP] Failed opening '' for inclusion...
>
>
> I am running PHP 4.2.1 on Windows XP. I had 4.1.2 running perfectly fine
and
> then decided to get MSSQl running as well. So I ran into a problem where
it
> failed to load the DLL. I read through the archives and it said to make
sure
> I have the most up to date DLL, so I then installed 4.2.1.
>
> Now, when I run my scripts I get this error:
>
> 2: Failed opening '' for inclusion (include_path='.;c:\php4\pear')
>
> I can NOT find anywhere that this php4\pear is set!
>
> Would appreciate any help that could be offered.
>
> Jeff
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


--- End Message ---
--- Begin Message ---
Do you have an auto-prepend file? If so, maybe it's in there ???
If not, I'm stumped....

-----Original Message-----
From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 10:31 AM
To: Martin Towell; PHP General
Subject: Re: [PHP] Failed opening '' for inclusion...


Yes and that isn't in there (php4\pear). I looked in the php.ini in windows
and in php folders...

Jeff
----- Original Message -----
From: "Martin Towell" <[EMAIL PROTECTED]>
To: "'Jeff Lewis'" <[EMAIL PROTECTED]>; "PHP General"
<[EMAIL PROTECTED]>
Sent: Thursday, May 30, 2002 8:20 PM
Subject: RE: [PHP] Failed opening '' for inclusion...


> have you looked in php.ini ?
>
> -----Original Message-----
> From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 31, 2002 10:19 AM
> To: PHP General
> Subject: [PHP] Failed opening '' for inclusion...
>
>
> I am running PHP 4.2.1 on Windows XP. I had 4.1.2 running perfectly fine
and
> then decided to get MSSQl running as well. So I ran into a problem where
it
> failed to load the DLL. I read through the archives and it said to make
sure
> I have the most up to date DLL, so I then installed 4.2.1.
>
> Now, when I run my scripts I get this error:
>
> 2: Failed opening '' for inclusion (include_path='.;c:\php4\pear')
>
> I can NOT find anywhere that this php4\pear is set!
>
> Would appreciate any help that could be offered.
>
> Jeff
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
Martin,

I appreciate the help...still have NO idea where the php4\pear was coming
from. However, fixed things by turning on register_globals for now. The old
scripts need to be brought up to par to the new methods...so when I was
doing an include_once it wasn't looking for any file.

So off to update the scripts!

Jeff
----- Original Message -----
From: "Martin Towell" <[EMAIL PROTECTED]>
To: "'Jeff Lewis'" <[EMAIL PROTECTED]>; "PHP General"
<[EMAIL PROTECTED]>
Sent: Thursday, May 30, 2002 8:33 PM
Subject: RE: [PHP] Failed opening '' for inclusion...


> Do you have an auto-prepend file? If so, maybe it's in there ???
> If not, I'm stumped....
>
> -----Original Message-----
> From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 31, 2002 10:31 AM
> To: Martin Towell; PHP General
> Subject: Re: [PHP] Failed opening '' for inclusion...
>
>
> Yes and that isn't in there (php4\pear). I looked in the php.ini in
windows
> and in php folders...
>
> Jeff
> ----- Original Message -----
> From: "Martin Towell" <[EMAIL PROTECTED]>
> To: "'Jeff Lewis'" <[EMAIL PROTECTED]>; "PHP General"
> <[EMAIL PROTECTED]>
> Sent: Thursday, May 30, 2002 8:20 PM
> Subject: RE: [PHP] Failed opening '' for inclusion...
>
>
> > have you looked in php.ini ?
> >
> > -----Original Message-----
> > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, May 31, 2002 10:19 AM
> > To: PHP General
> > Subject: [PHP] Failed opening '' for inclusion...
> >
> >
> > I am running PHP 4.2.1 on Windows XP. I had 4.1.2 running perfectly fine
> and
> > then decided to get MSSQl running as well. So I ran into a problem where
> it
> > failed to load the DLL. I read through the archives and it said to make
> sure
> > I have the most up to date DLL, so I then installed 4.2.1.
> >
> > Now, when I run my scripts I get this error:
> >
> > 2: Failed opening '' for inclusion (include_path='.;c:\php4\pear')
> >
> > I can NOT find anywhere that this php4\pear is set!
> >
> > Would appreciate any help that could be offered.
> >
> > Jeff
> >
> >
> >
> > --
> > 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
>
>
>
>


--- End Message ---
--- Begin Message ---
Hiya,
I've been getting the strangest error:
"Couldn't compile code. And I'm not smart enough to tell you why, sorry. in
c3.php on line 25"

Here's a code listing, if anyone can give me a hint as to what's up that
would be great, this is the first time the PHP interpreter has thrown a
wobbly like this on me. Although I have a feeling that this is really a Ming
error which is bubbling up through to the web server for output.
<?php
DL("php_ming.dll");
 $movie = new SWFMovie();
 $movie->setrate(2);
 $movie->setbackground(0xfff,0xfff,0xfff);

 $font = new SWFFont("_sans");
 $text = new SWFTextField(SWFTEXTFIELD_DRAWBOX );
 $text->setBounds(100,15);
 $text->setFont($font);
 $text->setColor(0xff, 0, 0);
 $text->setname("display");

 $container = new SWFSprite();
 $container->add($text);
 $container->nextFrame();

 $handle2 = $movie->add($container);
 $handle2->setname("container");
 $handle2->moveto(10,10);

 $movie->nextframe();
 $movie->nextframe();
$movie->add(new SWFAction("loadVariables('vars.php','_root');"));
 $movie->add(new SWFAction("_root.container.display = _root.date"));
 header('Content-type: application/x-shockwave-flash');
 $movie->output();
?>


Any help would be appreciated,
TIA,
Dw.

--- End Message ---
--- Begin Message ---
Hi,

My calls to mail() take a very long time to resolve, so I did a little
investigating. If I try to Telnet to port 25, it takes about 30 seconds for
the SMTP server to respond. Telnet to port 23 on the same address resolves
immediately, as does normal web access (using the same address so I don't
believe DNS is the culprit. Besides, mail() is slow, and that is accessing
the SMTP server locally. What would be taking SMTP so long to respond? Any
configuration parameters I need to look at?

I am using SendMail 8.10.2 on a Cobalt RAQ4.

--
Bruce Vander Werf
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hello,

On 05/30/2002 10:29 PM, Bruce Vander Werf wrote:
> Hi,
> 
> My calls to mail() take a very long time to resolve, so I did a little
> investigating. If I try to Telnet to port 25, it takes about 30 seconds for
> the SMTP server to respond. Telnet to port 23 on the same address resolves
> immediately, as does normal web access (using the same address so I don't
> believe DNS is the culprit. Besides, mail() is slow, and that is accessing
> the SMTP server locally. What would be taking SMTP so long to respond? Any
> configuration parameters I need to look at?

Maybe reverse DNS resolution of the client machine IP and anti-spam 
blackhole verification.


-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
On Thu, 30 May 2002, Bruce Vander Werf wrote:
> My calls to mail() take a very long time to resolve, so I did a little
> investigating. If I try to Telnet to port 25, it takes about 30 seconds for
> the SMTP server to respond. Telnet to port 23 on the same address resolves
> immediately, as does normal web access (using the same address so I don't
> believe DNS is the culprit. Besides, mail() is slow, and that is accessing
> the SMTP server locally. What would be taking SMTP so long to respond? Any
> configuration parameters I need to look at?

Check to make sure your machine's IP address has a PTR record. It's 
probably trying to look up your machine's name to stick in the Received: 
headers, and timing out.

miguel

--- End Message ---
--- Begin Message ---
Darren,
Thanks for the tip on direction to head in. Could you provide an example of
what you are referring to?


"Darren Gamble" <[EMAIL PROTECTED]> wrote in message
078EC26E265CD411BD9100508BDFFC860ED3E64E@shawmail02">news:078EC26E265CD411BD9100508BDFFC860ED3E64E@shawmail02...
> Good day,
>
> Just to clarify, Perl will, in fact, complain if you have undefined
> variables (or variables that you use once) if you have warnings and/or
> strict mode in effect.  Using at least one is strongly recommended.
>
> In PHP, the method you're using for getting form data is deprecated.  You
> should use $HTTP_POST_VARS or $_POST, depending on your version.  Check
the
> docco for more info on those.
>
> If you really have to check variables using this method, use isset() to
see
> if the variables ... have been set. =)
>
> ============================
> Darren Gamble
> Planner, Regional Services
> Shaw Cablesystems GP
> 630 - 3rd Avenue SW
> Calgary, Alberta, Canada
> T2P 4L4
> (403) 781-4948
>
>
> > -----Original Message-----
> > From: Crane, Christopher [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 30, 2002 3:07 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: [PHP] Undefined variables
> >
> >
> > I have an annoying problem, that I know is my own ignorance
> > to PHP. I came
> > from PERL and this was not a problem there but is with PHP.
> >
> > Here's the issue.
> > I have a number of scripts that use a "index.php?Task='some
> > sort of task
> > name'", for example, http://www.foo.com/index.php?Task=ShowVersion
> > <http://www.foo.com/index.php?Task=ShowVersion> .  Then I use
> > an if/else
> > statement to tell the script what to do if it sees the
> > ShowVersion variable.
> > In the ShowVersion example, I would call a function that displays the
> > version information I defined in the script. As a back up, I
> > always provide
> > an else statement to catch variables I have no functions for.
> >
> > If I have a ShowVersion function, GetData function and a CreateImage
> > function and the Task variable is empty or a variable that
> > does not exists
> > comes in like http://www.foo.com/index.php?Task=SomethingDumb
> > <http://www.foo.com/index.php?Task=SomethingDumb>  it would go to the
> > default function of something by using the ELSE part of the if/else
> > statements.
> >
> > I hope I am describing this correctly.....now here is the
> > problem. If I have
> > warnings turned on, or if I have a log written for warnings,
> > the log fills
> > up if someone goes to http://www.foo.com/index.php
> > <http://www.foo.com/index.php>  or http://www.foo.com
> <http://www.foo.com>
> will error messages like undefine variable TASK on line 255. I understand
> the reason, that PHP was expecting the variable Task when it got to the
> if/else statements. So I put in something like if(!($Task)) { function
> Something(); } but it still is looking for the variable so it still
errors.
>
> In Perl, it would simply be ignored. What do I do here.
>
> Here is a simple example of the code.
>
> if ($Task == "ShowVersion") { function ShowVersion(); }
> elseif ($Task == "GetData") { function GetData(); print "$DataOutput"; }
> elseif ($Task == "CreateImage") { function CreateImage(); }
> else { print "Incorrect Variable or no Variable Supplies<br>"; }
>
>
>
>
>
> Christopher J. Crane
> Network Operations Manager
>
> IKON Office Solutions
> 860.659.6464
>
>


--- End Message ---
--- Begin Message ---
On Thu, 30 May 2002, Crane, Christopher wrote:
> if ($Task == "ShowVersion") { function ShowVersion(); }
> elseif ($Task == "GetData") { function GetData(); print "$DataOutput"; }
> elseif ($Task == "CreateImage") { function CreateImage(); }
> else { print "Incorrect Variable or no Variable Supplies<br>"; }

if (isset($Task))
{
  switch($Task)
  {
  case 'ShowVersion':
    ShowVersion();
    break;
  case 'GetData':
    GetData;
    print $DataOutput;
    break;
  case 'CreateImage':
    CreateImage();
    break;
  default:
    print 'Unknown function';
  }
} else {
  print 'No function supplied';
}


--- End Message ---
--- Begin Message ---
I like this piece of code. In fact, I convert all my scripts that use the
older If/Else  code. What would happen if the "break; " wasn't used. Would
it just continue through the rest of the function to find another match???

"Miguel Cruz" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Thu, 30 May 2002, Crane, Christopher wrote:
> > if ($Task == "ShowVersion") { function ShowVersion(); }
> > elseif ($Task == "GetData") { function GetData(); print "$DataOutput"; }
> > elseif ($Task == "CreateImage") { function CreateImage(); }
> > else { print "Incorrect Variable or no Variable Supplies<br>"; }
>
> if (isset($Task))
> {
>   switch($Task)
>   {
>   case 'ShowVersion':
>     ShowVersion();
>     break;
>   case 'GetData':
>     GetData;
>     print $DataOutput;
>     break;
>   case 'CreateImage':
>     CreateImage();
>     break;
>   default:
>     print 'Unknown function';
>   }
> } else {
>   print 'No function supplied';
> }
>
>


--- End Message ---
--- Begin Message ---
if you want to do the same thing for "no task supplied" and "unknown task"
then you could do this:

switch(@$Task)
{
  case 'ShowVersion':
    ShowVersion();
    break;
  case 'GetData':
    GetData;
    print $DataOutput;
    break;
  case 'CreateImage':
    CreateImage();
    break;
  default:
    print 'Unknown function or No function supplied';
}

basically, suppress warnings

-----Original Message-----
From: Christopher J. Crane [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 2:33 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Undefined variables


I like this piece of code. In fact, I convert all my scripts that use the
older If/Else  code. What would happen if the "break; " wasn't used. Would
it just continue through the rest of the function to find another match???

"Miguel Cruz" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Thu, 30 May 2002, Crane, Christopher wrote:
> > if ($Task == "ShowVersion") { function ShowVersion(); }
> > elseif ($Task == "GetData") { function GetData(); print "$DataOutput"; }
> > elseif ($Task == "CreateImage") { function CreateImage(); }
> > else { print "Incorrect Variable or no Variable Supplies<br>"; }
>
> if (isset($Task))
> {
>   switch($Task)
>   {
>   case 'ShowVersion':
>     ShowVersion();
>     break;
>   case 'GetData':
>     GetData;
>     print $DataOutput;
>     break;
>   case 'CreateImage':
>     CreateImage();
>     break;
>   default:
>     print 'Unknown function';
>   }
> } else {
>   print 'No function supplied';
> }
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Thu, 30 May 2002, Jonathan Rosenberg wrote:
> It's been a long time since I've programmed on Unix, but there
> was a common technique used in C programs for invoking a program
> & allowing the invoker to read & write via standard input/output.
> I believe it used a combination of pipes & the fdup function.
> 
> Is it possible to emulate this behavior in PHP?

You may be able to get a bi-directional pipe out of popen. Depends on your 
particular OS.

miguel

--- End Message ---
--- Begin Message ---
On Thu, 30 May 2002, Taylor York wrote:
> I am inserting html/php code into a database that would look something like
> default page <? echo "test"; ?>
> 
> now the problem is, I am getting the field, title, and echoing as so (after
> using mysql_fetch_array and extract
> 
> echo "<TITLE>$title</TITLE>\n";
> 
> the acual title of the page in IE is
> 
> default page <? echo "test"; ?>
> 
> It doesnt parse or execute any of the php.  Any suggestions?

http://php.net/eval

--- End Message ---
--- Begin Message ---
On Thu, 30 May 2002, Jason Tobias wrote:
> When a user submits a form, it redirects them to login if they are not
> logged in.
> Once the user logs in. I want to redirect them to the form that they
> originaly filled out.
> I can define a static redirect and that works fine, just not very practical.
> 
> Is there any way to do this?

The easiest thing is probably to rework your login mechanism so that it
can just be included at the top of each PHP file. That way all your
variables remain in context - you can just post them from page to page in
a big serialized array, or whatever.

miguel

--- End Message ---
--- Begin Message ---
On 30 May 2002, Jackson Miller wrote:
> Is there a way to create IMAP accounts using PHP? I have looked through
> all of the IMAP functions in PHP and do not see one for creating a new
> account.
> 
> I would like to create a new IMAP account when a user registers for a
> website account.

I don't think the IMAP protocol has a mechanism for creating new accounts.

How you do it depends on the IMAP server you have.

If it's something like UW-IMAP, then you just need to create a standard 
login account (though hopefully without a usable shell). Search the 
archive for many discussions of the pros, cons, and mechanics of creating 
Unix system accounts through PHP.

If you're using Cyrus IMAP or some other system that keeps its own 
private account data, then you'll have to go through the API they provide. 
This is a preferable scenario for security reasons, but it's probably not 
an open choice at this point.

miguel

--- End Message ---
--- Begin Message ---
On Thu, 30 May 2002 [EMAIL PROTECTED] wrote:
> search engine spiders will usually disregard the search string of a URL,
> i.e. everything after and including the "?" character.

Not sure about the others, but Google does follow GET args.

miguel

--- End Message ---
--- Begin Message ---
Hi there..some what a new programmer when it comes to all this. I'm 
trying to encrypt some data and then decrypt it. It doesn't have to be 
high bit encryption just something simple like 3DES. But I keep getting 
it wrong. Any help would be greatful. Here's the piece of code:

$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_3DES, 
MCRYPT_MODE_ECB), MCRYPT_RAND);              

$key = md5("Secret Key");
$sample2 = "Hello";

$lockdata = mcrypt_encrypt (MCRYPT_3DES, $key, $sample2, 
MCRYPT_MODE_ECB, $iv);            

echo "$lockdata\n";

$text = mcrypt_decrypt (MCRYPT_3DES, $key, $lockdata, MCRPYT_MODE_ECB, 
$iv);              

echo "$text\n";




--- End Message ---
--- Begin Message ---
Hi
Here are a couple of functions that should help to get you started, iv is 
set to all 0's so it does not have to be passed around or stored in 
sessions. It is base64 encoded so it can be stored or passed to the browser.

Function Code_id($id,$password){
         $eid = 0;
         $td = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, "");
         $iv = pack("a".mcrypt_enc_get_iv_size($td),$iv);
         mcrypt_generic_init ($td, $password, $iv);
         $eid = base64_encode(mcrypt_generic ($td, $id));
         mcrypt_generic_end ($td);
   return $eid;
}
Function Get_id($eid,$password){
         $id = 0;
         $td = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, "");
         $iv = pack("a".mcrypt_enc_get_iv_size($td),$iv);
         mcrypt_generic_init ($td, $password, $iv);
         $id = mdecrypt_generic ($td, base64_decode($eid));
         mcrypt_generic_end ($td);
         return $id;
}
Tom


At 11:07 PM 30/05/2002 -0400, Tom Ray wrote:
>Hi there..some what a new programmer when it comes to all this. I'm trying 
>to encrypt some data and then decrypt it. It doesn't have to be high bit 
>encryption just something simple like 3DES. But I keep getting it wrong. 
>Any help would be greatful. Here's the piece of code:
>
>$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_3DES, MCRYPT_MODE_ECB), 
>MCRYPT_RAND);
>
>$key = md5("Secret Key");
>$sample2 = "Hello";
>
>$lockdata = mcrypt_encrypt (MCRYPT_3DES, $key, $sample2, MCRYPT_MODE_ECB, 
>$iv);
>
>echo "$lockdata\n";
>
>$text = mcrypt_decrypt (MCRYPT_3DES, $key, $lockdata, MCRPYT_MODE_ECB, 
>$iv);
>
>echo "$text\n";
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Well now I have the Encryption problem figured out but when I try to 
decrypt the information, I'm getting this error:

Warning: mcrypt module initialization failed in test.php on line 11

Here's Line 11:

$text = mcrypt_decrypt (MCRYPT_TripleDES, $key, $lockdata, 
MCRPYT_MODE_ECB, $iv);

again any help would be appreciated.

Tom Rogers wrote:

> Hi
> Here are a couple of functions that should help to get you started, iv 
> is set to all 0's so it does not have to be passed around or stored in 
> sessions. It is base64 encoded so it can be stored or passed to the 
> browser.
>
> Function Code_id($id,$password){
>         $eid = 0;
>         $td = mcrypt_module_open (MCRYPT_TripleDES, "", 
> MCRYPT_MODE_ECB, "");
>         $iv = pack("a".mcrypt_enc_get_iv_size($td),$iv);
>         mcrypt_generic_init ($td, $password, $iv);
>         $eid = base64_encode(mcrypt_generic ($td, $id));
>         mcrypt_generic_end ($td);
>   return $eid;
> }
> Function Get_id($eid,$password){
>         $id = 0;
>         $td = mcrypt_module_open (MCRYPT_TripleDES, "", 
> MCRYPT_MODE_ECB, "");
>         $iv = pack("a".mcrypt_enc_get_iv_size($td),$iv);
>         mcrypt_generic_init ($td, $password, $iv);
>         $id = mdecrypt_generic ($td, base64_decode($eid));
>         mcrypt_generic_end ($td);
>         return $id;
> }
> Tom
>
>
> At 11:07 PM 30/05/2002 -0400, Tom Ray wrote:
>
>> Hi there..some what a new programmer when it comes to all this. I'm 
>> trying to encrypt some data and then decrypt it. It doesn't have to 
>> be high bit encryption just something simple like 3DES. But I keep 
>> getting it wrong. Any help would be greatful. Here's the piece of code:
>>
>> $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_3DES, 
>> MCRYPT_MODE_ECB), MCRYPT_RAND);
>>
>> $key = md5("Secret Key");
>> $sample2 = "Hello";
>>
>> $lockdata = mcrypt_encrypt (MCRYPT_3DES, $key, $sample2, 
>> MCRYPT_MODE_ECB, $iv);
>>
>> echo "$lockdata\n";
>>
>> $text = mcrypt_decrypt (MCRYPT_3DES, $key, $lockdata, 
>> MCRPYT_MODE_ECB, $iv);
>>
>> echo "$text\n";
>>
>>
>>
>>
>>
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>

--- End Message ---
--- Begin Message ---
crontab -e

You'd have to write a pretty clever script. SSH in (or telnet if you 
absolutely must).

miguel

On Thu, 30 May 2002, Edgard Berendsen wrote:
> but how can I acces cron -e?
> with a php script or I have to use telnet?
> 
> "Cal Evans" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > 1: Yes, if your host has given you permission to run cron jobs. Some hosts
> > lock cron to only root or to a specific subset of users. If you have
> > permission to create them, crontab -e will give you the editor to edit
> them.
> > (hint: man crontab.  read it. Now read it again.)
> >
> > 2: man cron,  man crontab,
> > http://www.google.com/search?hl=en&q=cron+tutorial
> >
> > 3: This is one of those, "If you have to ask, you can't afford it"
> > questions. Technically, no, there is nothing special about a "cron job"
> cron
> > is a program that runs other programs or shell scripts at pre-determined
> > intervals. However, it doesn't bother to check to see if it's a good idea
> to
> > run the job or if you are going to eradicate all life on earth by running
> > this job. cron just runs the job.  If I were you, I'd consult with a
> > professional or at least a ranking armature before trying to implement a
> > cron job on any machine you care about.
> >
> > My $0.02 worth,
> > =C=
> > *
> > * Cal Evans
> > * Journeyman Programmer
> > * Techno-Mage
> > * http://www.calevans.com
> > *
> >
> >
> > -----Original Message-----
> > From: Edgard Berendsen [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 30, 2002 8:11 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] newbie: cron jobs
> >
> >
> > Hi,
> > I'm new to cron jobs and I need to do one.
> >
> > 1- It's possible to program cron jobs in a remote server where
> > you can't modify something, for example, a normal web-hosting?
> >
> > 2-Where can I find more informationa about?
> >
> > 3-It's there something special I should know to program one?
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
I will soon be developing a user authentication system with different access levels. I 
will need to check the users against a mysql database. How secure is checking for a 
session var, and then redirecting with header('Location:...') ? Is there a way to get 
around this method of protection?

-- 
Justin Blake
http://blaix.org/

--- End Message ---
--- Begin Message ---
On Thu, May 30, 2002 at 11:46:29PM -0400, Justin Blake wrote:
> I will soon be developing a user authentication system with different
> access levels. I will need to check the users against a mysql
> database. How secure is checking for a session var, and then
> redirecting with header('Location:...') ? Is there a way to get around
> this method of protection?

I'm no expert on this but I don't think session in PHP them selves have
any security embedded in it by them selves, you could just try to do a
bruteforce attack on sessionIDs (good luck :). 

But what you yourself could do is keep track of eg. the IP adress of the
user and check if it doesn't change... if it does then maybe someone is
trying something fishy.

-- 

  Daniel Tryba

--- End Message ---
--- Begin Message ---
On Thu, 30 May 2002, Justin Blake wrote:
> I will soon be developing a user authentication system with different
> access levels. I will need to check the users against a mysql database.
> How secure is checking for a session var, and then redirecting with
> header('Location:...') ? Is there a way to get around this method of
> protection?

That's the worst security scheme I've ever heard of.

Anyone can just look at where the redirect points to and go there.

You should keep the session active throughout your secured area and check 
against a session variable at the top of each page.

miguel

--- End Message ---
--- Begin Message ---
Hi All,

Is there anyway to lockdown PHP so that only the INI file from C:\WinNT\ is
used?  Currently, you can place an INI file into the same directory as the
php script your viewing through a browser and instead of loading the INI
file located in the C:\WinNT\ directory, it will load the INI file that is
in the current working directory.  Same thing applies to putting the INI
file in the directory where the PHP executable is stored.

Using the -c <dir> command line switch forces PHP to check the directory
that you've specified for the INI file, however setting up the following in
IIS Application Mappings fails to work, although running it from the command
line works fine.

e:\php\php.exe -c C:\WinNT\ %s %s

I've also tried a multitude of variants using "'s, forward-slashes, etc.
without any luck.

Cheers
--- End Message ---
--- Begin Message ---
Just want to run this by you all to check the feasibility of it.

I run a site that deals with cars, people can upload pics of their vehicle
and tell everyone else its year, color, 'generation', and where they're
located.

What I'd like to do is make some graphs on the front page that look like
gauges you'd see in a car, i.e. speedometer, tachometer, oil, etc. but these
would actually be graphs showing, for instance, how many of the cars on the
site are red, or whatever the most popular color is. So if a majority of the
cars were red, and red cars made up 57% of the total cars on the site, I'd
want a graphic of a speedometer with a needle that would be in a position
that represented 57%.

How difficult is this? I looked at some of the imagecreate() functions in
the manual, but they look like a language all their own and I'd like to know
if there's any easier way to do this that I'm overlooking. I'm thinking
doing some kind of image overlay is the way to go, but not sure. Any ideas
or pointers would be great, links to sample scripts would be excellent.
Thanks!

Jason Soza

--- End Message ---
--- Begin Message ---
Linux Redhat 7.3
PHP 4.2.0
GD 2.0.1

during make:
/bin/sh /root/php-4.2.0/libtool --silent --mode=compile gcc  -I. -I/root/php-
4.2.0/ext/gd -I/root/php-4.2.0/main -I/root/php-4.2.0 -
I/usr/local/apache/include -I/root/php-4.2.0/Zend -I/usr/local/mysql/include -
I/usr/local/easysoft/oob/client/include -I/root/php-4.2.0/ext/xml/expat  -
DLINUX=22 -DUSE_HSREGEX -I/root/php-4.2.0/TSRM -g -O2 -prefer-pic  -c gd.c
gd.c: In function `zm_startup_gd':
gd.c:303: `gdArc' undeclared (first use in this function)
gd.c:303: (Each undeclared identifier is reported only once
gd.c:303: for each function it appears in.)
gd.c:304: `gdPie' undeclared (first use in this function)
gd.c:305: `gdChord' undeclared (first use in this function)
gd.c:306: `gdNoFill' undeclared (first use in this function)
gd.c:307: `gdEdged' undeclared (first use in this function)
gd.c: In function `zif_imagecreatetruecolor':
gd.c:588: warning: assignment makes pointer from integer without a cast
gd.c: In function `zif_imagecolorat':
gd.c:1626: structure has no member named `tpixels'
make[3]: *** [gd.lo] Error 1
make[3]: Leaving directory `/root/php-4.2.0/ext/gd'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/php-4.2.0/ext/gd'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/php-4.2.0/ext'
make: *** [all-recursive] Error 1


configure:
 --with-apxs=/usr/local/apache/bin/apxs
 --enable-ftp
 --with-gd
 --enable-force-cgi-redirect
 --with-pear
 --enable-mailparse
 --enable-sockets
 --with-esoob
 --with-mysql=/usr/local/mysql
 --with-zlib-dir=/usr/include
 --with-jpeg-dir=/usr/lib
 --with-png-dir=/usr/lib

any help appreciated
-- 
Michael Geier
    email: [EMAIL PROTECTED]




-------------------------------------------------
This mail sent through CDM Sports Webmail.
--- End Message ---
--- Begin Message ---
Hello.

I do a pdf with a lot of variables from a form, with a GET method.

After make the pdf (in the same script) I sent the headers and the user 
can see the document in your browser:

   $data = $albara->retorna();
   $len=strlen($data);

   header("Content-Type: application/pdf");
   header("Content-Length: $len");
   header("Content-Disposition: inline; filename=$fileName");
   header("Pragma: no-cache");
   header("Expires: 0");
 
   print $data;
   $albara->deleteDoc();

This work OK.
But I want use POST because there are so much variables in the URL, whit 
post the result is a blank scrren (the pdf never apears).
Somebody nows if is posible (with another headers or with other 
solution) to use a POST method to get a pdf made on the fly ?


Thanks.
Josep. R. Raurell


--- End Message ---
--- Begin Message ---
On Fri, 31 May 2002, Josep R. Raurell wrote:
> I do a pdf with a lot of variables from a form, with a GET method.
> 
> After make the pdf (in the same script) I sent the headers and the user 
> can see the document in your browser:
> 
>    $data = $albara->retorna();
>    $len=strlen($data);
> 
>    header("Content-Type: application/pdf");
>    header("Content-Length: $len");
>    header("Content-Disposition: inline; filename=$fileName");
>    header("Pragma: no-cache");
>    header("Expires: 0");
>  
>    print $data;
>    $albara->deleteDoc();
> 
> This work OK.
> But I want use POST because there are so much variables in the URL, whit 
> post the result is a blank scrren (the pdf never apears).
> Somebody nows if is posible (with another headers or with other 
> solution) to use a POST method to get a pdf made on the fly ?

This isn't very helpful, but I can tell you that I have a lot of little 
programs that generate PDFs from POSTed form data (one I use to print my 
personal envelopes, things like that) and they all work fine. So it's 
definitely possible. That suggests that maybe something else is messing up 
in your case.

miguel

--- End Message ---
--- Begin Message ---
> > could somebody explain me please what is wrong with this
> > piece of code?
> > <?
> >     if (1):
> >         if (1) echo "hello";
> >     else:
> >     endif;
> > ?>
>
>  Well, first off you've broken the golden rule, which is: Don't mix the
:-type syntax with the {}-type or completely bare syntaxes.
>
> In more detail:  on reaching the "else", PHP matches it with the nearest
preceding if; this is the "If (1) echo ..." line, which isn't using :-type
syntax, so it expects the else also not to use :-type syntax -- so the : is
a parse error.

now it's clear to me
anyway it's funny that this works fine :-)
<?
    if (1):
        if (1) echo "hello";
        $a = 1;                // here can be anything else
    else:
    endif;
?>


--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Miroslav Figlar [mailto:[EMAIL PROTECTED]]
> Sent: 31 May 2002 07:26
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] nested if parse error
> 
> 
> anyway it's funny that this works fine :-)
> <?
>     if (1):
>         if (1) echo "hello";
>         $a = 1;                // here can be anything else
>     else:
>     endif;
> ?>

Nope, that makes perfect sense too.  Think about where your second if(1) terminates -- 
is it still "open" when the parser reaches the "else:"?

As I said before, it just gets way too confusing if you try to mix the :-type syntax 
with anything else: if you use it at all, use it for *everything*.

Cheers!

Mike

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

I have installed the binary version of Apache 1.3.23 on my W2000 SP2
machine.
The binary version of PHP 4.1.1 works fine with it.
So far, so good, no problems at all.

I simply installed the binary version of Apache 2.0.36 and PHP 4.1.1 does
not work anymore.
I didn't do anything else than installing the binary version of apache, and
start apache.
Apache starts well, I can see the Apache welcome screen.

What did I do wrong or forget ??

With kind regards,

Herman




**********************************************************************
Dit bericht en alle eventueel meegestuurde documenten
zijn vertrouwelijk en alleen bestemd voor degene aan wie
het bericht geadresseerd is. Indien u dit bericht heeft
ontvangen terwijl u niet de geadresseerde bent, verzoeken
wij u het bericht te vernietigen en ons daarvan in kennis te
stellen.

Dit bericht is tevens gecontroleerd op computervirussen.

This e-mail and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom they are addressed. If you have received this e-mail 
in error, please delete the message and notify us.

This e-mail message has been swept by MIMEsweeper for
the presence of computer viruses.
**********************************************************************
--- End Message ---
--- Begin Message ---
Friday, May 31, 2002, 9:29:52 AM, you wrote:

> I simply installed the binary version of Apache 2.0.36 and PHP 4.1.1 does
> not work anymore.
> I didn't do anything else than installing the binary version of apache, and
> start apache.
> Apache starts well, I can see the Apache welcome screen.

> What did I do wrong or forget ??

You need to upgrade PHP to the latest version which contains experimental
support for Apache 2. PHP 4.1.x doesn't provide any specific support for
Apache 2 and will only work if you use it as a CGI app.

Whn you upgrade, don't forget to change the LoadModule line for PHP in
httpd.conf to load php/experimental/apache2filter.dll instead of
php/sapi/php4apache.dll.

-- 
Stuart

--- End Message ---
--- Begin Message ---
Sorry If this is the wrong list for this topic, I hope someone can shed some
light onto my problem.

I am building a php/ Mysql web site for a client which is a picture gallery.
The web site has 3 frames (required by the designer so that the whole thing
doesnt refresh all the time).
Frame 1- Navigation
Frame 2- Info on selected artworks and other related projects
Frame 3- The artworks/ jpegs

I have one table, with a name and info about the project and upto 5 urls of
where the jpeg lies.

When a project is selected in the navigation I request the record from the
database, I create an array which contains the location of the jpegs and
then display them in Frame 3.

Now, I then have a piece of javascript which tells frame 2 to update itself.
So I have parsed the record ID to it and it then open a query to the
database and outputs the relevant information about the artworks. Lastly a
third query is also sent to the database to see if there are any other
projects in the gallery by the same artist- and then create a list of
related links.

So I have 3 database queries over two pages.

I'm wondering if there is a more efficient way of doing this?



--- End Message ---
--- Begin Message ---
Is there a magical function that I can use to convert 4 into April and 5 into May etc?
 
can I use mktime()
 
One yes no answer will do fine
 
--- End Message ---
--- Begin Message ---
Hi JJ,

> Is there a magical function that I can use to convert 4 
> into April and 5 into May etc?
> can I use mktime()
> One yes no answer will do fine

Yes and no ;-)

You might want to use a combination of mktime() and date().

i.e.

<?php
  $month = 4;
  echo date ("jS F Y", mktime (1, 0, 0, $month, 1, 2002)); 
?>

HTH
Jon
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Jon Haworth [mailto:[EMAIL PROTECTED]]
> Sent: 31 May 2002 10:58
> 
> Hi JJ,
> 
> > Is there a magical function that I can use to convert 4 
> > into April and 5 into May etc?
> > can I use mktime()
> > One yes no answer will do fine
> 
> Yes and no ;-)

Ha! I was just about to say exactly that myself!

> 
> You might want to use a combination of mktime() and date().
> 
> i.e.
> 
> <?php
>   $month = 4;
>   echo date ("jS F Y", mktime (1, 0, 0, $month, 1, 2002)); 
> ?>

Except, to get just the month (and leaving out optional arguments to mktime()), you 
would need:

    date('F', mktime(12, 0, 0, $month));

Also note I've specified 12:00, as opposed to 01:00, just to make sure you're well 
clear of any possible daylight-savings timeshifts!

Cheers!

Mike

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

I am writing a function to construct page links within my site; I want it to
append the session id to the URL's query string if the client does not
accept cookies (and ignore the session id if the client does accept
cookies).

How do I detect if the client browser accepts cookies?
Indeed, has anyone got such a function as described above?

Any help gratefully received.

David



--- End Message ---
--- Begin Message ---
On Friday 31 May 2002 10:53 am, David Eisenhart wrote:
> Hi
>
> I am writing a function to construct page links within my site; I want it
> to append the session id to the URL's query string if the client does not
> accept cookies (and ignore the session id if the client does accept
> cookies).
>
> How do I detect if the client browser accepts cookies?
> Indeed, has anyone got such a function as described above?

Here's one approach you could try.  Set a cookie, send a redirect, and see if 
you get the cookie back ...

Script 1 - cookiecheck1.php

<?php
setcookie("testcookie","ok");
header("Location: cookiecheck2.php");
?>

Script 2  - cookiecheck2.php

<?php
if ($testcookie =="ok")
  print "This browser appears to handle cookies OK.";
else
  print "This browser either doesn't support use of cookies, 
    or has cookie use disabled.";
?>

Regards

- Nick

--- End Message ---
--- Begin Message ---
Where i can find more help about cache control

Thx

Jeroen

--- End Message ---
--- Begin Message ---
Hi Jeroen,

> Where i can find more help about cache control

Here: http://www.google.com/search?q=help+about+cache+control (495,000
results)

Or did you mean something a bit more specific?

Cheers
Jon
--- End Message ---
--- Begin Message ---
indeed

more specific

Jeroen

At 11:00 31-5-2002 +0100, you wrote:
>Hi Jeroen,
>
> > Where i can find more help about cache control
>
>Here: http://www.google.com/search?q=help+about+cache+control (495,000
>results)
>
>Or did you mean something a bit more specific?
>
>Cheers
>Jon
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---

Hi Jeroen,
> > > Where i can find more help about cache control
> >
> > http://www.google.com/search?q=help+about+cache+control
> > Or did you mean something a bit more specific?
>
> indeed
> more specific

Well, seeing as you're not sharing the actual question with the mailing
list, this answer may not be exactly what you're after, but it's probably:

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="<?=$a_GMT_date_in_the_past?>">

;-)

Cheers
Jon
--- End Message ---

Reply via email to