[PHP] How to Popup a Window Using PHP Code

2002-08-02 Thread Hakkan Lui

Dear all,

As the title state, is there any method to popup a window (like
"window.open" in Javascript), using PHP code?

Thanks for your help.


Regards,
Hakkan Lui



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




[PHP] Reg- array_unique

2002-08-02 Thread SenthilVelavan

Hello All,

I tried a program using array_unique.It shows different outputs in PHP4.06 
and PHP4.22

Program:



Output:

PHP4.06
Index 0 Content snp 
PHP4.22
Index 2 Content snp 

Why the index is differed in two version?
Whether the function array_unique is handled in a different way in PHP4.22.
Any help is appreciated.

Advance thanks and regards,
SenthilVelavan.P




Re: [PHP] Reg- array_unique

2002-08-02 Thread Andrey Hristov

Post that on [EMAIL PROTECTED]

Andrey

- Original Message -
From: "SenthilVelavan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002 10:54 AM
Subject: [PHP] Reg- array_unique


Hello All,

I tried a program using array_unique.It shows different outputs
in PHP4.06 and PHP4.22

Program:



Output:

PHP4.06
Index 0 Content snp
PHP4.22
Index 2 Content snp

Why the index is differed in two version?
Whether the function array_unique is handled in a different way in PHP4.22.
Any help is appreciated.

Advance thanks and regards,
SenthilVelavan.P




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




Re: [PHP] How to Popup a Window Using PHP Code

2002-08-02 Thread René Moonen

Hakkan Lui wrote:

>Dear all,
>
>As the title state, is there any method to popup a window (like
>"window.open" in Javascript), using PHP code?
>
>Thanks for your help.
>
>
>Regards,
>Hakkan Lui
>
>
>
>  
>
Yep there is:

window.open();"
?>

But I suppose it is not what you had in mind. ;-)



You can do anything in PHP as long as your actions are on the server. 
Javascript runs on the client and PHP is not in control than. So if you 
need to open a new window you will need PHP to produce HTML code that 
does just that. That HTML can include Javascripts.

René



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




Re: [PHP] Can somebody explain this scripts to me?

2002-08-02 Thread Jason Wong

On Friday 02 August 2002 14:58, L.Jacquiline wrote:
> I have attached.

If you seriously want people to look at it please resend it again as inline 
text and not as an attachment.

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

/*
"Of all the tyrannies that affect mankind, tyranny in religion is the worst."
- Thomas Paine
*/


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




[PHP] Re: Need help to choose hosting!

2002-08-02 Thread JJ Harrison

I would recommend Infinology Smart Consumers:
http://smartconsumers.infinology.com/

You should look at them. I use them and I am very pleased with their
service. Their servers have very fast response times and the give you
plentiful features.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

"Mantas Kriauciunas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hey php-general,
>
>   i want to buy hosting. but i can't find good one for me. maybe
>   someone could point some links. but this is what i need!
>
>   Storage up to 100MB
>   normal transfer limit(best would be without)
>   CGI/Perl/PHP/ASP/SSI/SSL
>   MySQL database (can be only 1)
>   some pop3 mailboxes
>   free domain transfer (maybe free domain if i pay for 1 year ahead)
>   FTP access
>   SSH access
>   Shell capability
>   up to 3 background processes
>
>   if anyone know combination like that i would appreaciate your help!
>   thanks
>
> --
> Best regards,
>  Mantas
>
> Contacts:
> [EMAIL PROTECTED]
>



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




Re: [PHP] Can somebody explain this scripts to me?

2002-08-02 Thread 1LT John W. Holmes

> On Friday 02 August 2002 14:58, L.Jacquiline wrote:
> > I have attached.

Looks like someone trying to steal stuff off of CNN. 

---John Holmes...


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




[PHP] ODBC under linux + PHP + Apache problem.

2002-08-02 Thread Jose Morales

I write a few days ago to the list with a problem trying to find my ODBC DSN under 
linux debian. Well, i solve the problem, now i can find my dsn from PHP code, but its 
seems like it crash when i do a odbc_connect(...)

I know that unixodbc works becouse i test it with isql.

I have no warnings trying to find DSN, but now nothing happens. I suppose that it 
finds dsn but there is another error somewhere. But there is no logs, there is no 
output in the browser...  i dont know what to do, i have no information to try to 
resolve the error.

somebody can help me?

this is the reply from the browser;
The following error was encountered: 
Zero Sized Reply 
Squid did not receive any data for this request. 


this is my code:
^M
REGISTRO DE LLAMADAS^M
^M
";
$cx=odbc_pconnect("cdr2","mylogin","mypasswd","");
echo "connected";
?>






thanks in advance!

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




[PHP] StripSlashes Problem

2002-08-02 Thread Mark Colvin

I use the following php code to build a dynamic table retrieving values from
a MySQL databases that have been inserted with slashes added -

 echo "";

The problem is, if the value to be displayed is for example O'Neill, then
the output will look something like -



Quite correctly, when this page is rendered, all that will be displayed is O
as the apostrophe after the O will be treated as a closing parenthesis. I
understand AddSlashes and StripSlashes but how can I utilise them to resolve
this issue.



This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




[PHP] htaccess

2002-08-02 Thread Theo Richel

Hi,

 

I am told that I should edit my .htaccess file because I want to include
a file during the execution of a script, but apparently I do something
wrong because I keep getting error messages like these:

 

Warning: Failed opening 'header.html' for inclusion
(include_path='.:/var/www/html/brokenlink/login') in
/home/virtual/site161/fst/var/www/html/brokenlink/login/index.php3 on
line 32

 

There was no improvement when I added this line to the .htaccess file:
php_value include_path ".:/var/www/html/brokenlink/login"

 

Can anyone tell me what I should put in?

 

I thank you very much in advance.

Theo Richel




[PHP] Some suggestions

2002-08-02 Thread Saci

If you want a serius one , not the cheaper one try pair.com

I use they services for more than 5 years and are very happy, the main issue
is reliability.

If you are more interested on price try dreamhost.com



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




Re: [PHP] StripSlashes Problem

2002-08-02 Thread 1LT John W. Holmes

> I use the following php code to build a dynamic table retrieving values
from
> a MySQL databases that have been inserted with slashes added -
>
>  echo " maxlength='20' readonly value='".StripSlashes(mysql_result($badgedetails,
> $i, 'descr'))."' tabindex='1'/>";
>
> The problem is, if the value to be displayed is for example O'Neill, then
> the output will look something like -
>
>  readonly value='O'Neill' tabindex='1'/>
>
> Quite correctly, when this page is rendered, all that will be displayed is
O
> as the apostrophe after the O will be treated as a closing parenthesis. I
> understand AddSlashes and StripSlashes but how can I utilise them to
resolve
> this issue.

HTML doesn't understand that a slash means to escape a character. What you
need to do is use htmlentities() or htmlspecialchars() on the data before
you place it between your quotes.

echo "";

Note: You should not have to be doing stripslashes() on data coming from
your database unless magic_quotes_runtime is ON. If your data is coming out
with slashes in it, or you can SEE the slashes in the actual data in the
database, then you are calling addslashes() twice on your data somehow.

I also kind of question why you have mysql_result in there. It's faster to
use the mysql_fetch_* functions...

---John Holmes...


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




Re: [PHP] htaccess

2002-08-02 Thread Alexander Kuznetsov

Hello Theo,

Friday, August 02, 2002, 1:11:32 PM, you wrote:
TR> I am told that I should edit my .htaccess file because I want to include
TR> a file during the execution of a script, but apparently I do something
TR> wrong because I keep getting error messages like these:

TR> Warning: Failed opening 'header.html' for inclusion
TR> (include_path='.:/var/www/html/brokenlink/login') in
TR> /home/virtual/site161/fst/var/www/html/brokenlink/login/index.php3 on
TR> line 32

TR> There was no improvement when I added this line to the .htaccess file:
TR> php_value include_path ".:/var/www/html/brokenlink/login"

TR> Can anyone tell me what I should put in?

try to set include_path from / directory, like this

php_value include_path ".:/home/virtual/site161/fst/var/www/html/brokenlink/login"


-- 
Best regards,
Alexander Kuznetsov



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




[PHP] Re: Need help to choose hosting!

2002-08-02 Thread lallous

have you tried:

http://www.hostrix.com

?

//Elias
"Mantas Kriauciunas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hey php-general,
>
>   i want to buy hosting. but i can't find good one for me. maybe
>   someone could point some links. but this is what i need!
>
>   Storage up to 100MB
>   normal transfer limit(best would be without)
>   CGI/Perl/PHP/ASP/SSI/SSL
>   MySQL database (can be only 1)
>   some pop3 mailboxes
>   free domain transfer (maybe free domain if i pay for 1 year ahead)
>   FTP access
>   SSH access
>   Shell capability
>   up to 3 background processes
>
>   if anyone know combination like that i would appreaciate your help!
>   thanks
>
> --
> Best regards,
>  Mantas
>
> Contacts:
> [EMAIL PROTECTED]
>



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




RE: [PHP] StripSlashes Problem

2002-08-02 Thread Mark Colvin

John,

Thank you for your reply. My magic_quotes_runtime is set to 'Off'. As you
said, I shouldn't have to use StripSlashes but would I still need to use
AddSlashes when inserting/updating? I can see the slashes in the database
when I look at the tables but I am fairly sure that I do not add slashes
twice? Are they being added automatically somewhere as a result of a setting
in the php.ini file?
With regards to my use of mysql_result as opposed to mysql_fetch_*
functions, I was ignorant of the performance hit and I will now re think
around my database code.




This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




Re: [PHP] StripSlashes Problem

2002-08-02 Thread 1LT John W. Holmes

If magic_quotes_gpc is ON, then the data is getting addslashes()
automatically on a form submission. If you are doing it again, that's where
the problem is.

---John Holmes...

- Original Message -
From: "Mark Colvin" <[EMAIL PROTECTED]>
To: "'1LT John W. Holmes'" <[EMAIL PROTECTED]>
Cc: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002 6:37 AM
Subject: RE: [PHP] StripSlashes Problem


> John,
>
> Thank you for your reply. My magic_quotes_runtime is set to 'Off'. As you
> said, I shouldn't have to use StripSlashes but would I still need to use
> AddSlashes when inserting/updating? I can see the slashes in the database
> when I look at the tables but I am fairly sure that I do not add slashes
> twice? Are they being added automatically somewhere as a result of a
setting
> in the php.ini file?
> With regards to my use of mysql_result as opposed to mysql_fetch_*
> functions, I was ignorant of the performance hit and I will now re think
> around my database code.
>
>
>
> 
> This e-mail is intended for the recipient only and
> may contain confidential information. If you are
> not the intended recipient then you should reply
> to the sender and take no further ation based
> upon the content of the message.
> Internet e-mails are not necessarily secure and
> CCM Limited does not accept any responsibility
> for changes made to this message.
> Although checks have been made to ensure this
> message and any attchments are free from viruses
> the recipient should ensure that this is the case.
> 


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




Re: [PHP] StripSlashes Problem

2002-08-02 Thread Petre

I would suggest you rather do the following ( over and above the 
htmlentities as already suggested )

In stead of doing
echo " ";
to rather
echo '';

The reason is; there is a difference between echo 'stuff' ; and echo 
"stuff";
The first (single quotes) is treated as literal content, ie, PHP justs 
echo's, does no parsing, while the double-quotes means PHP will look at 
the content between the quotes and parse any variables etc.
So, if you are not echoing anything that needs to be parsed, use single 
quotes.

eg.
';
echo "$var";
?>
produses:

$var
testing

It just saves on overhead, and in your case, you would not have run into 
this problem...




Mark Colvin wrote:

>John,
>
>Thank you for your reply. My magic_quotes_runtime is set to 'Off'. As you
>said, I shouldn't have to use StripSlashes but would I still need to use
>AddSlashes when inserting/updating? I can see the slashes in the database
>when I look at the tables but I am fairly sure that I do not add slashes
>twice? Are they being added automatically somewhere as a result of a setting
>in the php.ini file?
>With regards to my use of mysql_result as opposed to mysql_fetch_*
>functions, I was ignorant of the performance hit and I will now re think
>around my database code.
>
>
>
>
>This e-mail is intended for the recipient only and
>may contain confidential information. If you are
>not the intended recipient then you should reply
>to the sender and take no further ation based
>upon the content of the message.
>Internet e-mails are not necessarily secure and
>CCM Limited does not accept any responsibility
>for changes made to this message. 
>Although checks have been made to ensure this
>message and any attchments are free from viruses
>the recipient should ensure that this is the case.
>
>



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




RE: [PHP] StripSlashes Problem

2002-08-02 Thread Mark Colvin

John,

Thank you. This solves the problem.

Petre,

Thank you for your reply. I wasn't aware of the difference and will bear
this in mind.




This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




Re: [PHP] Re: Need help to choose hosting!

2002-08-02 Thread Andrey Hristov

http://ispcheck.com is the place. Listing of many webhostings. Go and see.

Regards,
Andrey

> > Hey php-general,
> >
> >   i want to buy hosting. but i can't find good one for me. maybe
> >   someone could point some links. but this is what i need!
> >
> >   Storage up to 100MB
> >   normal transfer limit(best would be without)
> >   CGI/Perl/PHP/ASP/SSI/SSL
> >   MySQL database (can be only 1)
> >   some pop3 mailboxes
> >   free domain transfer (maybe free domain if i pay for 1 year ahead)
> >   FTP access
> >   SSH access
> >   Shell capability
> >   up to 3 background processes
> >
> >   if anyone know combination like that i would appreaciate your help!
> >   thanks
> >
> > --
> > Best regards,
> >  Mantas
> >
> > Contacts:
> > [EMAIL PROTECTED]
> >
> 
> 
> 
> -- 
> 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] Why do i get this Notice Message?

2002-08-02 Thread Jürgen

Hello!

Could someone please tell me why i get the following Notice Message

Notice: Undefined variable: PHP_SELF in
g:\apache_web\intern\looney\index.php on line 101

Code affected:

function WriteNewArticle()
{
Line 100:  $smarty = new Smarty;
Line 101:  $smarty->assign("PHPSELF", $PHP_SELF);
// etc.

Thanks alot in advance for your time,
Jürgen




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




[PHP] Re: Why do i get this Notice Message?

2002-08-02 Thread lallous

In your function do this:
> function WriteNewArticle()
> {
GLOBAL $PHP_SELF;

...
}


//Elias

"JüRgen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello!
>
> Could someone please tell me why i get the following Notice Message
>
> Notice: Undefined variable: PHP_SELF in
> g:\apache_web\intern\looney\index.php on line 101
>
> Code affected:
>
> function WriteNewArticle()
> {
> Line 100:  $smarty = new Smarty;
> Line 101:  $smarty->assign("PHPSELF", $PHP_SELF);
> // etc.
>
> Thanks alot in advance for your time,
> Jürgen
>
>
>



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




RE: [PHP] Why do i get this Notice Message?

2002-08-02 Thread John Holmes

> Could someone please tell me why i get the following Notice Message
> 
> Notice: Undefined variable: PHP_SELF in
> g:\apache_web\intern\looney\index.php on line 101
> 
> Code affected:
> 
> function WriteNewArticle()
> {
> Line 100:  $smarty = new Smarty;
> Line 101:  $smarty->assign("PHPSELF", $PHP_SELF);
> // etc.

Why? Because $PHP_SELF is an undefined variable. There is nothing
assigned to it and you're trying to use it in a function. 

But, you say, $PHP_SELF is supposed to be the current page. Yes,
normally it would with register_globals ON, but you are inside of a
function, so it is a whole new variable now. 

So, like someone else suggested, make it global inside your function

Global $PHP_SELF;

Or, if you're on a new version, just use $_SERVER['PHP_SELF'] and you
don’t have to worry about global.

---John Holmes...


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




RE: [PHP] Need help to choose hosting!

2002-08-02 Thread Daniel Kushner

You should check out The Hosting Company
http://www.thehostingcompany.us/

The PHP config comes with many flavors:
http://www.thehostingcompany.us/info.php

--Daniel


> -Original Message-
> From: Mantas Kriauciunas [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 02, 2002 2:31 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Need help to choose hosting!
>
>
> Hey php-general,
>
>   i want to buy hosting. but i can't find good one for me. maybe
>   someone could point some links. but this is what i need!
>
>   Storage up to 100MB
>   normal transfer limit(best would be without)
>   CGI/Perl/PHP/ASP/SSI/SSL
>   MySQL database (can be only 1)
>   some pop3 mailboxes
>   free domain transfer (maybe free domain if i pay for 1 year ahead)
>   FTP access
>   SSH access
>   Shell capability
>   up to 3 background processes
>
>   if anyone know combination like that i would appreaciate your help!
>   thanks
>
> --
> Best regards,
>  Mantas
>
> Contacts:
> [EMAIL PROTECTED]
>
>
> --
> 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] Undefined Index

2002-08-02 Thread Jürgen

It's me again, i don't mean to be a bugger, but i really like to learn as
much as possible, that's why i ask (or will ask so many questions).

Consider the following (i shortened this a lot, but it will do the trick)

$op = $_GET['op'];
switch ( $op )
{
 case "admin":
  DoLogin();
  break;

 default:
  ShowHomepage();
  break;
}

PHP shoots a Notice Message telling me that there is an undefined index
Undefined index: act in g:\apache_web\intern\looney\index.php on line 177

This accects the code shown above.

Ok, am i correct in assuming that it pops this message because $op is not
defined as anything yet?

If so,should i always just do this

$_POST['op'] = '';
$op = $_GET['op'];
switch ( $op )
{
//Code here
}

Or would it be better and more space efficient to do this
$op = isset($_GET['op']);
switch ( $op )
{
//Code here
}
Cause if i do that the Notice Message dissapears for some reason i yet fail
to grab.
I would really appreciate if somebody could explain to me why the Notice
dissapears when using isset(), and also what is the best method to use
rather then the two shown above?
How do you guys&girls handle this?

Thanks a lot in advance for your time and patience!

Best regards from Vienna,
Jürgen




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




[PHP] Date Stuff...

2002-08-02 Thread Brian McGarvie

Given a date how would you work out number of months elapsed between
DateInPast and DateNow?



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




[PHP] mktime() question

2002-08-02 Thread Jay Blanchard

Good morning!

I need to subtract months by their abbreviated month name, so shouldn't this
work?

print(date("M", mktime(date("M")-$i));

and if I loop;

Aug
Jul
Jun
May


Thanks!

Jay

What if the hokie pokie really is what it is all about

***
* *
* Texas PHP Developers Meeting*
* Spring 2003 *
* T Bar M Resort & Conference Center  *
* New Braunfels, Texas*
* Interested? Contact;*
* [EMAIL PROTECTED] *
* *
***



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




[PHP] Re: Undefined Index

2002-08-02 Thread Lars Olsson

Hi!

JüRgen wrote:
> It's me again, i don't mean to be a bugger, but i really like to learn as
> much as possible, that's why i ask (or will ask so many questions).
> 
> Consider the following (i shortened this a lot, but it will do the trick)
> 
> $op = $_GET['op'];
> switch ( $op )
> {
>  case "admin":
>   DoLogin();
>   break;
> 
>  default:
>   ShowHomepage();
>   break;
> }
> 
> PHP shoots a Notice Message telling me that there is an undefined index
> Undefined index: act in g:\apache_web\intern\looney\index.php on line 177

You get this error message whenever $_GET doesn't contain anything.

> This accects the code shown above.
> 
> Ok, am i correct in assuming that it pops this message because $op is not
> defined as anything yet?
> 
> If so,should i always just do this
> 
> $_POST['op'] = '';
> $op = $_GET['op'];
> switch ( $op )
> {
> //Code here
> }
> 
> Or would it be better and more space efficient to do this
> $op = isset($_GET['op']);
> switch ( $op )
> {
> //Code here
> }
> Cause if i do that the Notice Message dissapears for some reason i yet fail
> to grab.

This doesn't work since the result of isset($_GET['op']) is either true 
or false, not a string value. You need to write it like this:

if (isset($_GET['op']) {
   $op = $_GET['op'];

   switch ($op)
   {
 //Code here
   }
}

> I would really appreciate if somebody could explain to me why the Notice
> dissapears when using isset(), and also what is the best method to use
> rather then the two shown above?
> How do you guys&girls handle this?
> 
> Thanks a lot in advance for your time and patience!
> 
> Best regards from Vienna,
> Jürgen
> 
> 
> 

Hope this helps!

/lasso ([EMAIL PROTECTED])


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




Re: [PHP] Why do i get this Notice Message?

2002-08-02 Thread lallous

even on old versions of PHP,
he can then just use: $GLOBALS['PHP_SELF'] w/o worrying about the Global
keyword!

Elias
"John Holmes" <[EMAIL PROTECTED]> wrote in message
001001c23a1e$601f5050$b402a8c0@mango">news:001001c23a1e$601f5050$b402a8c0@mango...
> Could someone please tell me why i get the following Notice Message
>
> Notice: Undefined variable: PHP_SELF in
> g:\apache_web\intern\looney\index.php on line 101
>
> Code affected:
>
> function WriteNewArticle()
> {
> Line 100:  $smarty = new Smarty;
> Line 101:  $smarty->assign("PHPSELF", $PHP_SELF);
> // etc.

Why? Because $PHP_SELF is an undefined variable. There is nothing
assigned to it and you're trying to use it in a function.

But, you say, $PHP_SELF is supposed to be the current page. Yes,
normally it would with register_globals ON, but you are inside of a
function, so it is a whole new variable now.

So, like someone else suggested, make it global inside your function

Global $PHP_SELF;

Or, if you're on a new version, just use $_SERVER['PHP_SELF'] and you
don't have to worry about global.

---John Holmes...




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




[PHP] Re: Undefined Index

2002-08-02 Thread lallous

do this:

$op = isset($_GET['op']) && !empty($_GET['op']) ? $_GET['op'] : '';


"JüRgen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> It's me again, i don't mean to be a bugger, but i really like to learn as
> much as possible, that's why i ask (or will ask so many questions).
>
> Consider the following (i shortened this a lot, but it will do the trick)
>
> $op = $_GET['op'];
> switch ( $op )
> {
>  case "admin":
>   DoLogin();
>   break;
>
>  default:
>   ShowHomepage();
>   break;
> }
>
> PHP shoots a Notice Message telling me that there is an undefined index
> Undefined index: act in g:\apache_web\intern\looney\index.php on line 177
>
> This accects the code shown above.
>
> Ok, am i correct in assuming that it pops this message because $op is not
> defined as anything yet?
>
> If so,should i always just do this
>
> $_POST['op'] = '';
> $op = $_GET['op'];
> switch ( $op )
> {
> //Code here
> }
>
> Or would it be better and more space efficient to do this
> $op = isset($_GET['op']);
> switch ( $op )
> {
> //Code here
> }
> Cause if i do that the Notice Message dissapears for some reason i yet
fail
> to grab.
> I would really appreciate if somebody could explain to me why the Notice
> dissapears when using isset(), and also what is the best method to use
> rather then the two shown above?
> How do you guys&girls handle this?
>
> Thanks a lot in advance for your time and patience!
>
> Best regards from Vienna,
> Jürgen
>
>
>



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




Re: [PHP] Date Stuff...

2002-08-02 Thread Stas Maximov

(YearsDifference*12)+FullMonthsDifference :)

Regards, Stas.

- Original Message - 
From: "Brian McGarvie" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002 1:50 PM
Subject: [PHP] Date Stuff...


> Given a date how would you work out number of months elapsed between
> DateInPast and DateNow?
> 
> 
> 
> -- 
> 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] include hassle

2002-08-02 Thread lallous

I have this:

//file1.php


now lib1.php:


If i run file1.php ->includes lib1.php -> fails to include helper.php ! !

how can i solve that?

p.s: currently, i'm chdir()ing to the ../libs path, then i return to current
dir...
my code cannot make use of Apache's help. (like setting the include path
inside .htaccess)

thank you,
Elias



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




Re: [PHP] Date Stuff...

2002-08-02 Thread Chris Boget

> Given a date how would you work out number of months elapsed
> between DateInPast and DateNow?

( $monthTo - $monthFrom ) + (( $yearTo - $yearFrom ) * 12 )

I believe that's the correct equation for figuring out the number of months.

Chris



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




Re: [PHP] Undefined Index

2002-08-02 Thread Chris Hewitt

Jrgen wrote:

>
>$op = $_GET['op'];
>switch ( $op )
>
>PHP shoots a Notice Message telling me that there is an undefined index
>Undefined index: act in g:\apache_web\intern\looney\index.php on line 177
>
If there is not a get variable in the url you will get the warning.

>Ok, am i correct in assuming that it pops this message because $op is not
>defined as anything yet?
>
Yes,

>
>If so,should i always just do this
>
>$_POST['op'] = '';
>$op = $_GET['op'];
>switch ( $op )
>{
>//Code here
>}
>
If there is not a get variable callled "op" you should still get the 
warning.

>$op = isset($_GET['op']);
>switch ( $op )
>{
>//Code here
>}
>
Now $op will be a boolean assigned the value true (if there is a get 
variable called "op" in the url) or false if not. As $op will have a 
value then there is no warning.

What I tend to do when I have an optional item of data is:

if (isset($_GET["op"])) [
$op = $_GET["op"];
}
else
{
$op = "no value";// set to something you can test for in 
your switch statement.
}
though there may be a better way.

>
>Best regards from Vienna,
>Jrgen
>
.. thanks, and best regards to you from Essex, England.

HTH
Chris



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




[PHP] Re: Protect PHP coding

2002-08-02 Thread lallous

So...
Is this equivalent to Zend Encoder?

Elias
"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> On 08/01/2002 01:58 PM, Yc Nyon wrote:
> > Is there any method to encrypt PHP files.
>
> Use bcompiler which is free and is part of PEAR/PECL official PHP
> extensions repository:
>
> http://pear.php.net/package-info.php?pacid=95
>
> --
>
> Regards,
> Manuel Lemos
>



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




[PHP] Re: Favorite Calendar Anyone?

2002-08-02 Thread lallous

have you searched hotscripts.com ?


"Shane" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Anyone have a favorite Calendar script out there they would like to share?

- NorthBayShane



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




[PHP] PHP Hosting

2002-08-02 Thread Matt Babineau

If any PHP hosts are out there I have a question:
 
How do you keep users from erasing / altering files out side of their
web folder with PHP? Doesn't PHP run in the system user context? Is is
possible to prevent a user from using PHP to alter anything but in their
Web folder?
 
Matt Babineau
MCWD / CCFD
-
e:   [EMAIL PROTECTED]
p: 603.943.4237
w:   http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105
 



RE: [PHP] Protect PHP coding

2002-08-02 Thread Matt Schroebel

> From: YC Nyon [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, August 01, 2002 12:59 PM
> Subject: [PHP] Protect PHP coding

There is the PHP Obfuscator/Obscurer: http://pobs.mywalhalla.net/

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




Re: [PHP] include hassle

2002-08-02 Thread Reuben D. Budiardja

On Friday 02 August 2002 10:02 am, lallous wrote:
> I have this:
> //file1.php
>  include('../libs/lib1.php');
> ?>
> now lib1.php:
>  include ('helper.php');
> ?>
> If i run file1.php ->includes lib1.php -> fails to include helper.php ! !
> how can i solve that?

We need more information that this. What's the error message? what do you mean 
fails?
In anycase, you should be able to run lib1.php first without error, before 
trying file1.php. If the former causes error, resolve that first.

rdb



>
> p.s: currently, i'm chdir()ing to the ../libs path, then i return to
> current dir...
> my code cannot make use of Apache's help. (like setting the include path
> inside .htaccess)
>
> thank you,
> Elias


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




[PHP] question about references

2002-08-02 Thread Jesse Vitrone

Tried to post this to the news group before, but I'm having trouble getting
to my news server from work - hopefully I'm not posting a duplicate.


I think I'm seeing the problem I'm seeing because I'm getting a copy of a
var instead of a reference to it, but I'm not sure the best we to get around
this problem.

In my little sample script, I've got an array of objects.  When I use
foreach to loop through the array and make a change to an item, it doesn't
change the object in the array, just the var that I have while I'm in the
foreach loop.

What's the right way to loop through this array if I really want to change
homer's name to marge in this example?  The way it is now, I see my echo
saying that I'm changing the name, but when I do the second var_dump, it's
the same as the first var_dump.

Thanks in advance,
   Jesse

firstName = $first;
$this->lastName = $last;
}
}

$names[] = new Name("joe", "shmo");
$names[] = new Name("billy", "bob");
$names[] = new Name("homer", "simpson");

?>





firstName, "homer") == 0) {
echo "changing homer to marge";
$name->firstName = "marge";
break;
}
}
?>







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




[PHP] Re: Date Stuff...

2002-08-02 Thread Brian McGarvie

ta guys...

works fine :)

had a brain-freeze :)

"Brian McGarvie" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Given a date how would you work out number of months elapsed between
> DateInPast and DateNow?
>
>



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




Re: [PHP] Re: Dynamically check radio buttons

2002-08-02 Thread Shew

Hey Mark,

Thanks. I understand. I'm actually a Cold Fusion programmer.

I've tried what you suggested but can't seem to get it work - code attached.
However, I can display the radio button if I use the $_POST function.

I'm not sure if it's the version of php I'm using. Stats - windows 2000 Sp1,
Apache 2.039, php 4.2.2.

Thanks for taking the time!!

"Mark Middleton" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> It looks like your code could use "variable variables" to help you out.
>
> ::: OLD CODE 
>
> > > for ($GameIdx = 1; $GameIdx <= 17; $GameIdx++) {
> > >  /* instead "hardcoding each radio button name - just do it
> > programmatically
> > > by concatenating / creating the name */
> > >  $frmGame = "Game" + $GameIdx;
> > >  if ($frmGame) {
>
> ::: END OF OLD CODE :
>
> ** this check will always be true - because you just set $frmGame equal to
a
> value... ***
> What you want to do at this point is use variable variables (where the
> variable name is actually
> a variable itself.
>
> : NEW CODE :::
>
> > >  $var_frmGame = "Game" + $GameIdx;
> > >  $frmGame = $$var_frmGame;   // The "$$" is used for variable
variables
> > >  if ($frmGame) {
>
> :: END OF NEW CODE :::
>
> ** the above snippett is was I wrote to show the results of the dynamic
> (looped-through) variable $Game1, $Game2, ...
>
> I use this method when the number of form elements is variable.  Instead
of
> hardcoding the number "17" you might make a variable in the incoming form
> with the count of form elements (simply increment a variable with each
> printing of the form variable... then at the end of the form make  type="hidden" name="elementcount" value="$count">)
>
> Then you can make the above for-statement look like this:
>
> > > for ($GameIdx = 1; $GameIdx <= $elementcount; $GameIdx++) {
>
> Does any of this make sense or help in any way?
>
> -Mark
>
>


begin 666 InsertPicks3.php
M/"%$3T-465!%($A434P@4%5"3$E#("(M+R]7,T,O+T141"!(5$U,(#0N,"!4
MPT*"7!R:6YT(")G86UE,2 ]("(@*R D7U!/
M4U1;)V=A;64Q)UT@*R B/$)2/B([('T-"@D-"B\O(" D=F%R7V9R;4=A;64@
M/2 B1V%M92(@*R D1V%M94ED>#L-"B\O(" D9G)M1V%M92 ]("0D=F%R7V9R
M;4=A;64[(" @+R\@5&AE("(D)"(@:7,@=7-E9"!F;W(@=F%R:6%B;&4@=F%R
M:6%B;&5S#0HO+R @:68@*"1FPT*"0D))$=E=$YU;6)EPT*"0D))$=E
M=$YU;6)E"D@>PT*"0D)<')I;G0@(EEE86@@36%T8V@@+2 D1V%M
M94E$(#T@)$=A;65)9'@@/$)2/B([#0H)"0DO*B!/2RP@:&5R92!I3X-"CPO:'1M
";#X`
`
end


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




Re: [PHP] include hassle

2002-08-02 Thread lallous

I mean this:

i have this tree:

./libs/*.php
./user/file1.php

now i'm in ./user/ directory
i run file1.php
it includes ../libs/lib1.php which in turn will include helper.php
(./users/helper.php) <-- will fail!

how can i programmatically set the include path?

Elias

"Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Friday 02 August 2002 10:02 am, lallous wrote:
> I have this:
> //file1.php
>  include('../libs/lib1.php');
> ?>
> now lib1.php:
>  include ('helper.php');
> ?>
> If i run file1.php ->includes lib1.php -> fails to include helper.php ! !
> how can i solve that?

We need more information that this. What's the error message? what do you
mean
fails?
In anycase, you should be able to run lib1.php first without error, before
trying file1.php. If the former causes error, resolve that first.

rdb



>
> p.s: currently, i'm chdir()ing to the ../libs path, then i return to
> current dir...
> my code cannot make use of Apache's help. (like setting the include path
> inside .htaccess)
>
> thank you,
> Elias




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




[PHP] Re: question about references

2002-08-02 Thread lallous

yes, true!

try this patch:
> if (strcmp($name->firstName, "homer") == 0) {
> echo "changing homer to marge";
> $name->firstName = "marge";
$names[key($names)]->firstName = "marge";

good luck,

Elias

"Jesse Vitrone" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Tried to post this to the news group before, but I'm having trouble
getting
> to my news server from work - hopefully I'm not posting a duplicate.
>
>
> I think I'm seeing the problem I'm seeing because I'm getting a copy of a
> var instead of a reference to it, but I'm not sure the best we to get
around
> this problem.
>
> In my little sample script, I've got an array of objects.  When I use
> foreach to loop through the array and make a change to an item, it doesn't
> change the object in the array, just the var that I have while I'm in the
> foreach loop.
>
> What's the right way to loop through this array if I really want to change
> homer's name to marge in this example?  The way it is now, I see my echo
> saying that I'm changing the name, but when I do the second var_dump, it's
> the same as the first var_dump.
>
> Thanks in advance,
>Jesse
>
> 
> class Name {
> var $firstName;
> var $lastName;
>
> function Name($first, $last) {
> $this->firstName = $first;
> $this->lastName = $last;
> }
> }
>
> $names[] = new Name("joe", "shmo");
> $names[] = new Name("billy", "bob");
> $names[] = new Name("homer", "simpson");
>
> ?>
>
> 
> 
> 
> 
>  foreach ($names as $name) {
> if (strcmp($name->firstName, "homer") == 0) {
> echo "changing homer to marge";
> $name->firstName = "marge";
> break;
> }
> }
> ?>
> 
>
> 
> 
> 
>



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




RE: [PHP] PHP Hosting

2002-08-02 Thread John Holmes

Safe_mode = ON

Open_basedir restrictions

Use PHP in CGI mode and each runs as it's own user with access to only
it's own file (may require separate Apache's, too...)

---John Holmes...

> -Original Message-
> From: Matt Babineau [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 02, 2002 9:04 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP Hosting
> 
> If any PHP hosts are out there I have a question:
> 
> How do you keep users from erasing / altering files out side of their
> web folder with PHP? Doesn't PHP run in the system user context? Is is
> possible to prevent a user from using PHP to alter anything but in
their
> Web folder?
> 
> Matt Babineau
> MCWD / CCFD
> -
> e:   [EMAIL PROTECTED]
> p: 603.943.4237
> w:   http://www.criticalcode.com
> PO BOX 601
> Manchester, NH 03105
> 


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




Re: [PHP] PHP Hosting

2002-08-02 Thread Danny Shepherd

Take a look at this directive :
http://www.php.net/manual/en/configuration.php#ini.open-basedir

Danny.

- Original Message -
From: "Matt Babineau" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002 2:04 PM
Subject: [PHP] PHP Hosting


> If any PHP hosts are out there I have a question:
>
> How do you keep users from erasing / altering files out side of their
> web folder with PHP? Doesn't PHP run in the system user context? Is is
> possible to prevent a user from using PHP to alter anything but in their
> Web folder?
>
> Matt Babineau
> MCWD / CCFD
> -
> e:   [EMAIL PROTECTED]
> p: 603.943.4237
> w:   http://www.criticalcode.com
> PO BOX 601
> Manchester, NH 03105
>
>


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




[PHP] isset($var) && !empty($var) same time!

2002-08-02 Thread lallous

I have wrote this function:

function issne($var)
{
   return isset($var) && !empty($var) ? true : false;
}


which can be called as: if (issne(&$mightbeundefinedvariable)) echo "using
this variable";


is there is any builtin function that does that? (one function call).


//Elias



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




RE: [PHP] mktime() question - SOLVED

2002-08-02 Thread Jay Blanchard

[snip]
I need to subtract months by their abbreviated month name, so shouldn't this
work?

print(date("M", mktime(date("M")-$i));

and if I loop;

Aug
Jul
Jun
May

[/snip]

Apparently not. But you can subtract by total hours in a given period, so
for an average I chose 30 days * 24 hours (720);

$i = 36;
$h = 720;
while($i > 0){
print(date("M", mktime(date("M")-$h)));print(date("Y"));print("");
$i--;
$h = $h + 720;
}

which results in

Jul2002
Jun2002
May2002
Apr2002
Mar2002
Feb2002
Jan2002
Dec2002
Nov2002
Oct2002
Sep2002
Aug2002
Jul2002
Jun2002
May2002

So now all I have to do is sove the year rollover, which I think I can do
the same way. It'd be so much easier if mktime worked as the documentation
said, but after many iterations of different things this is what I was able
to come up with.

Jay

Carpe Ductum - Sieze the tape

*
* Texas PHP Developers Meeting  Spring 2003 *
* T Bar M Resort & Conference Center*
* New Braunfels, Texas  *
* Interested? Contact;  *
* [EMAIL PROTECTED]   *
*



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




RE: [PHP] Problem with "" inside the PHP code, due to "?"

2002-08-02 Thread Brinkman, Theodore

Turn off the short tag option in the PHP ini file, and always use 'mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 1:03 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Problem with "" inside the PHP code, due
to "?"


Thank you all for the feedback!  I was trying to say the problem lie with
the "?", not with the quote or double quote.  Because PHP use " wrote in message
019701c23974$f29b78a0$0100a8c0@developerx">news:019701c23974$f29b78a0$0100a8c0@developerx...
>  $XML = "<\?xml version='1.0'
> encoding='UTF-8'\?>Apple";
> echo $XML;
> ?>
>
> Try this?
>
> Matt Babineau
> MCWD / CCFD
> -
> e: [EMAIL PROTECTED]
> p: 603.943.4237
> w: http://www.criticalcode.com
> PO BOX 601
> Manchester, NH 03105
>
>
> -Original Message-
> From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 01, 2002 12:03 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Problem with "" inside the PHP code, due to
> "?"
>
>
> Anyone know the workaround with the situation here?  Here is the sample
> script.  The problem is I include the XML tag into the PHP variable and
> it messed up everything.  It all had to do with "?" here since PHP use
> it also.
>
> --clip--
>  $XML = "Apple";
> echo $XML;
> ?>
>
> Thanks,
>  FletchSOD
>
>
>
> --
> 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: Dynamically check radio buttons

2002-08-02 Thread Mark Middleton

Shew,

http://www.whirledweb.com/phptest/InsertPicks3.php

It looks like the issue here is Capitalization.  PHP is very capitalization
sensative. (which I believe that Cold Fusion is less picky about) And your
code looks great, save a couple little issues that may have made it even
more confusing.  :-)

1.  the concatenation character in PHP is the "." not "+", so line 45 or so
was having issues (it was literally adding "Game" to the contents of the
variable... so it gave odd output results.)  This also messed up your
concatenation at about line 54.

2.  (this is pretty arbitrary) The HTML input tag doesn't need a closing
tag.  I do think however, you can make it XML compliant by writing it this
way: The closing slash
shows that there is no closing tag needed. (not sure why one would need to
make it XML compliant...)  I'm not an expert in this specific little area,
so somebody with a bigger brain on this list might clear that up.

3.  Then, there are several capitalization inconsistencies.  The variable
name in your form is "game1" but then you were checking for "Game1"...
except in your $_POST function, where you went back to all lower case.  I
cleaned that up, and it seems to work great now.

I hope some of this helps!
-Mark


>
> Thanks. I understand. I'm actually a Cold Fusion programmer.
>
> I've tried what you suggested but can't seem to get it work -
> code attached.
> However, I can display the radio button if I use the $_POST function.
>
> I'm not sure if it's the version of php I'm using. Stats -
> windows 2000 Sp1,
> Apache 2.039, php 4.2.2.
>
> Thanks for taking the time!!
>
> "Mark Middleton" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > It looks like your code could use "variable variables" to help you out.
> >
> > ::: OLD CODE 
> >
> > > > for ($GameIdx = 1; $GameIdx <= 17; $GameIdx++) {
> > > >  /* instead "hardcoding each radio button name - just do it
> > > programmatically
> > > > by concatenating / creating the name */
> > > >  $frmGame = "Game" + $GameIdx;
> > > >  if ($frmGame) {
> >
> > ::: END OF OLD CODE :
> >
> > ** this check will always be true - because you just set
> $frmGame equal to
> a
> > value... ***
> > What you want to do at this point is use variable variables (where the
> > variable name is actually
> > a variable itself.
> >
> > : NEW CODE :::
> >
> > > >  $var_frmGame = "Game" + $GameIdx;
> > > >  $frmGame = $$var_frmGame;   // The "$$" is used for variable
> variables
> > > >  if ($frmGame) {
> >
> > :: END OF NEW CODE :::
> >
> > ** the above snippett is was I wrote to show the results of the dynamic
> > (looped-through) variable $Game1, $Game2, ...
> >
> > I use this method when the number of form elements is variable.  Instead
> of
> > hardcoding the number "17" you might make a variable in the
> incoming form
> > with the count of form elements (simply increment a variable with each
> > printing of the form variable... then at the end of the form make  > type="hidden" name="elementcount" value="$count">)
> >
> > Then you can make the above for-statement look like this:
> >
> > > > for ($GameIdx = 1; $GameIdx <= $elementcount; $GameIdx++) {
> >
> > Does any of this make sense or help in any way?
> >
> > -Mark
> >
> >
>
>
>


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




Re: [PHP] isset($var) && !empty($var) same time!

2002-08-02 Thread Analysis & Solutions

On Fri, Aug 02, 2002 at 04:48:17PM +0200, lallous wrote:
> 
> function issne($var)
> {
>return isset($var) && !empty($var) ? true : false;
> }
> 
> is there is any builtin function that does that? (one function call).

Yes.  Just use empty().  It automatically checks if the variable is:
   not set
   null
   an empty string
   zero

If any of them are true, the empty() function returns true.  You don't
need your function at all.

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

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




[PHP] .htaccess

2002-08-02 Thread Oliver Witt

Hi!
Using an .htaccess file to limit access to some web files, is there a
way to get the name and password into a variable used by a user to log
on?
Kind regards,
Oliver


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




Re: [PHP] .htaccess

2002-08-02 Thread Andrey Hristov

The password that user used is available in some var
var_dump($HTTP_SERVER_VARS); or var_dump($GLOBALS);

Andrey
 
- Original Message - 
From: "Oliver Witt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002 5:21 PM
Subject: [PHP] .htaccess


> Hi!
> Using an .htaccess file to limit access to some web files, is there a
> way to get the name and password into a variable used by a user to log
> on?
> Kind regards,
> Oliver
> 
> 
> -- 
> 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] Problems with HTML forms and PHP. Please Help !!

2002-08-02 Thread Sebastian Tomasino

Hi! i have instaled PHP 4.2.2 in a slack 8.1 running apache 2.0.39.
i have a proble with a very basic script (pass variables to a php 
script). Is seems not recieve variables, because print somthing like this:

Your first name is .
Your last name is .
Your E-mail address is .
This is what you had to say:

In the server log say the variables appear don´t exist.
Here i send this windows files (i try in XP with iis 5.1 and PJP 4.2.2 
and is the same problem) to help you to help me :)
ah! php is working because i test the  stuff and works !!!

Tanks



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


Re: [PHP] Re: Dynamically check radio buttons

2002-08-02 Thread Shew

Hi Kirk,

Thanks. Never knew you could do that. I'll try it out.

Shew

"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
01A4B59FD1EBD311838100A0C98BE0D9023C49D1@chef">news:01A4B59FD1EBD311838100A0C98BE0D9023C49D1@chef...
> If you made an array for your buttons, then you could use PHP's looping
> constructs to process the array. Write the input tag like this:
>
> Chicago
>
> The processing code will then have access to the array $Game indexed by
the
> game number, e.g., $Game[1].
>
> Good luck!
>
> Kirk
>
>
> > -Original Message-
> > From: Shew [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, August 01, 2002 9:19 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Re: Dynamically check radio buttons
> >
> >
> > OK, changed the subject to what I think it should be about.
> >
> > Anybody?
> >
> > "Shew" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Hi - I'm a TOTAL php NEWBIE - my 1st bit of code!!!.
> > >
> > > Basically the input form page has 17 sets of radio buttons, each
> > > representing one game with 2 options - team 1 and team 2.
> > What I want to
> > do
> > > is a better way of checking each radio button value instead
> > of using an if
> > > statement for each. This code doesn't really work - it
> > finds that vars
> > > ALWAYS exist.
> > >
> > > IE:
> > >
> > > Chicago
> > > whatever
> > >
> > > Minny
> > > Nobody
> > >
> > > Code above is processed by the following code:
> > >
> > > for ($GameIdx = 1; $GameIdx <= 17; $GameIdx++) {
> > >  /* instead "hardcoding each radio button name - just do it
> > programmatically
> > > by concatenating / creating the name */
> > >  $frmGame = "Game" + $GameIdx;
> > >  if ($frmGame) {
> > >   /* U want to check if the length is 5 or 6 bytes because
> > it could be
> > > "game1" or "game14" */
> > >   $Length = strlen($frmGame);
> > >   if ($Length == 5) {
> > >$GetNumber = 1;
> > >   }
> > >   else {
> > >$GetNumber = 2;
> > >   }
> > >
> > >   $GameID = intval(substr($frmGame, $Length - $GetNumber,
> > $GetNumber));
> > >   print "Game ---> $GameIdx - $frmGame - $GetNumber - $GameID ";
> > > if ($GameID == $GameIdx) {
> > >print "Yeah Match - $GameID = $GameIdx ";
> > >/* OK, here is where U want to do the actual insert */
> > >   }
> > >  } /* $frmGame endif */
> > > }
> > >
> > > ?>
> > >
> > >
> > > Thanks
> > >
> > >
> > >
> >
> >
> >
> > --
> > 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] include hassle

2002-08-02 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Lallous) wrote:

> how can i programmatically set the include path?

http://php.net/ini-set

-- 
CC

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




Re: [PHP] .htaccess

2002-08-02 Thread Andrew Brampton

place a phpInfo() page behind the .htaccess and you will see what varibles
php has :)
I'm pretty sure there is ones contianing the username/password that was
entered

Andrew
- Original Message -
From: "Oliver Witt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002 3:21 PM
Subject: [PHP] .htaccess


> Hi!
> Using an .htaccess file to limit access to some web files, is there a
> way to get the name and password into a variable used by a user to log
> on?
> Kind regards,
> Oliver
>
>
> --
> 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] FATAL: emalloc(): Unable to allocate -83128 bytes

2002-08-02 Thread Klaus Svarre

I get the error msg mentioned above when I use the ereg() function.
What is it, that I don't know?
Best regards
Klaus



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




Re: [PHP] PHP Hosting

2002-08-02 Thread Andrew Brampton

This has been discussed in great detail before..
but the simplist solution is running PHP in safe mode, it does limit the
user to certain things, but it stops them bringing the server down or
altering others files

andrew
- Original Message -
From: "Matt Babineau" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002 2:04 PM
Subject: [PHP] PHP Hosting


> If any PHP hosts are out there I have a question:
>
> How do you keep users from erasing / altering files out side of their
> web folder with PHP? Doesn't PHP run in the system user context? Is is
> possible to prevent a user from using PHP to alter anything but in their
> Web folder?
>
> Matt Babineau
> MCWD / CCFD
> -
> e:   [EMAIL PROTECTED]
> p: 603.943.4237
> w:   http://www.criticalcode.com
> PO BOX 601
> Manchester, NH 03105
>
>


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




Re: [PHP] Why Protect PHP coding?

2002-08-02 Thread Nick Oostveen

Check out the Zend Encoder at http://www.zend.com to generate encoded php 
files.  It is, however, a bit pricey.

At 12:47 AM 8/2/2002 -0400, php @ banana wrote:
>Just out of curiosity when and why?
>
> >Is there any method to encrypt PHP files.
> >
> >Nyon
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>--__-__-__
>eat pasta
>type fasta
>
>
>--
>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] isset($var) && !empty($var) same time!

2002-08-02 Thread Jürgen

But if this is true what you say, that empty() checks for
not set
   null
   an empty string
   zero

Why would i ever want to use isset() then?

If i understood you correctly, would the following

op = isset($_GET['op']) && !empty($_GET['op']) ? $_GET['op'] : '';

be the same as

op = !empty($_GET['op']) ? $_GET['op'] : '';

?

*confused*


"Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Fri, Aug 02, 2002 at 04:48:17PM +0200, lallous wrote:
> >
> > function issne($var)
> > {
> >return isset($var) && !empty($var) ? true : false;
> > }
> >
> > is there is any builtin function that does that? (one function call).
>
> Yes.  Just use empty().  It automatically checks if the variable is:
>not set
>null
>an empty string
>zero
>
> If any of them are true, the empty() function returns true.  You don't
> need your function at all.
>
> --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



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




[PHP] HELP with forms

2002-08-02 Thread Dave Leather

Is there a way to read a FORM varaiable into PHP variable.  The kicker here
is the form variable is in a framed window.

Example, I have my main page in a 2 part frame (90%/10%).  The bottom 10%
has a form on it called 'fileform' with one text box called filevalue

-- source snippit --

  

-- end snippit --

Now inside the 90% window, I have ANOTHER frameset (broken into 3 parts.. a
left menu bar, a bottom instructional bar, and a main window.  I NEED the
main window to grab the value from the 'fileform.filevalue' and return it to
a PHP variable.

Any ideas
Dave




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




Re: [PHP] HELP with forms

2002-08-02 Thread Michael Sweeney

What do you mean, "return it to a php variable"?

The closest I can come to understanding your question is that you want
the form input in your bottom frame to be sent to another frame in your
top window for submission.

If that's any place close to correct, you need a javascript solution. In
any case, it won't/can't become a "php variable" until it is sent back
to the server. So why not submit the form from your bottom frame with a
target of the frame that you need the variable in and refresh that
frame?

..michael..

On Fri, 2002-08-02 at 10:14, Dave Leather wrote:
> Is there a way to read a FORM varaiable into PHP variable.  The kicker here
> is the form variable is in a framed window.
> 
> Example, I have my main page in a 2 part frame (90%/10%).  The bottom 10%
> has a form on it called 'fileform' with one text box called filevalue
> 
> -- source snippit --
> 
>   
> 
> -- end snippit --
> 
> Now inside the 90% window, I have ANOTHER frameset (broken into 3 parts.. a
> left menu bar, a bottom instructional bar, and a main window.  I NEED the
> main window to grab the value from the 'fileform.filevalue' and return it to
> a PHP variable.
> 
> Any ideas
> Dave
> 




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




Re: [PHP] include hassle

2002-08-02 Thread Reuben D. Budiardja

On Friday 02 August 2002 10:41 am, lallous wrote:
> I mean this:
>
> i have this tree:
>
> ./libs/*.php
> ./user/file1.php
>
> now i'm in ./user/ directory
> i run file1.php
> it includes ../libs/lib1.php which in turn will include helper.php
> (./users/helper.php) <-- will fail!
>
> how can i programmatically set the include path?
>
> Elias
>
- You can use an absolute path. 
- You can also specified all the includes path that will be find by php 
automatically in your php.ini. You might want to specify your /libs directory 
there, if you're including a lot of files from that directory.
Either or both should work

Rdb

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




[PHP] HELP with fOpen

2002-08-02 Thread Shane

No lock in the archives, so here it goes...
Greetings all, I am using fOpen to try and create a new file in a local directory on a 
remote server. Each time I run my script is says "PERMISSION DENIED" but the sys admin 
swears the entire directory is set to 777.

Does anyone know if a setting has to be set in PHP for dynamic file creation to take 
place?
I can use fOpen to read a file, I just cant write without the above error.

Please, any help is appreciated, my deadline is looming.

Thanks
- NorthBayShane

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




Re: [PHP] isset($var) && !empty($var) same time!

2002-08-02 Thread Analysis & Solutions

Folks:

On Fri, Aug 02, 2002 at 07:01:38PM +0200, Jürgen wrote:
> 
> Why would i ever want to use isset() then?

Because sometimes you just want to check if something is set due to null, 
'' and 0 being important.

   $var = '';
   empty($var);  // evaluates to true
   isset($var);  // evaluates to true

   unset($var);
   empty($var);  // evaluates to true
   isset($var);  // evaluates to false


> If i understood you correctly, would the following
> 
> op = isset($_GET['op']) && !empty($_GET['op']) ? $_GET['op'] : '';
> 
> be the same as
> 
> op = !empty($_GET['op']) ? $_GET['op'] : '';

Yes.  They do the same thing.  Couple things to think about, though.  If 
$_GET['op'] is 0, those commands will turn it into ''.  Probably not what 
you want.  Also, though less important, if it's already '', there's no 
need to do the step of resetting it to ''.  Sometimes, a cleaner test is:

  $op = isset($_GET['op']) ? $_GET['op'] : '';

--Dan

PS:  Don't be lazy.  Trim unneeded parts of prior postings.

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

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




[PHP] Gracias

2002-08-02 Thread Sebastian Tomasino

Muchas gracias fernando por tu explicacion !!  Con Mas detalle Imposible  !!
todavia no se como es que me llego tu respuesta a mi correo y no aparece 
aca en el news group (soy nuevo usando news) pero igual muchas gracias..

Sebastian.


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




[PHP] Thanks Matt

2002-08-02 Thread Sebastian Tomasino

thank you matt for explain what´s wrong.. short but helpfull !!!

Sebastian


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




[PHP] Function search utility

2002-08-02 Thread Brian V Bonini

There used to be a utility that let you search php functions from the
address bar in your browser by simply appening PHP to the function name eg,
php mail I thikn it might of been an IE only thing...

I can't remember were I originally got it form and can not find it again,
does anyone know?

-Brian


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




Re: [PHP] Need help to choose hosting!

2002-08-02 Thread Michael Sweeney

I just moved my domain over to phpwebhosting.com. The transfer went very
smoothly and so far I've been satisfied. The only hitch I can see in
your requirements might be the background processes (bots, what?). But
it's probably worth asking them about. 

..michael..

On Thu, 2002-08-01 at 23:31, Mantas Kriauciunas wrote:
> Hey php-general,
> 
>   i want to buy hosting. but i can't find good one for me. maybe
>   someone could point some links. but this is what i need!
> 
>   Storage up to 100MB
>   normal transfer limit(best would be without)
>   CGI/Perl/PHP/ASP/SSI/SSL
>   MySQL database (can be only 1)
>   some pop3 mailboxes
>   free domain transfer (maybe free domain if i pay for 1 year ahead)
>   FTP access
>   SSH access
>   Shell capability
>   up to 3 background processes
> 
>   if anyone know combination like that i would appreaciate your help!
>   thanks
> 




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




Re: [PHP] Re: Protect PHP coding

2002-08-02 Thread Randy Johnson

Does the bcompiler below improve performance?  

make scripts run  faster?

anybody have a testimonials on it's use??


Thanks,

Randy
- Original Message - 
From: "Manuel Lemos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 01, 2002 9:14 PM
Subject: [PHP] Re: Protect PHP coding


> Hello,
> 
> On 08/01/2002 01:58 PM, Yc Nyon wrote:
> > Is there any method to encrypt PHP files.
> 
> Use bcompiler which is free and is part of PEAR/PECL official PHP 
> extensions repository:
> 
> http://pear.php.net/package-info.php?pacid=95
> 
> -- 
> 
> Regards,
> Manuel Lemos
> 
> 
> -- 
> 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] fsockopen limits

2002-08-02 Thread Ilja Polivanovas

Hi to all,


1. does any body know how to limit number of attempts to connect to the
remote pc. not by time but for attempts.
(sorry, offtopic ) 2. can anybody explain why sometimes connection attempt
to a closed ports hangs-up remote link, and sometimes not? the remote pc is
the same.


Thanks.



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




[PHP] Reading in contents of URL

2002-08-02 Thread Mike C

I am trying to create a really simple proxy using PHP.

Basically, i need to:

1. read in the contents of a URL.
2. get the content-type
3. set the content type for the response
4. write the contents of the URL to the response.

here is what i have thus far:

$dataURL = "http://www.foo.com/data.xml";;
$fp = fopen($dataURL, "r");
$content = fread($fp, true);
echo($content);
fclose($fp);

I am running into two problems. One, the second param for fread takes 
the size of the file / content. how do i get this?

there is a comment at:
http://www.php.net/manual/en/function.fread.php

which says to just specify a constant and it will work, but what ever 
number i specify, that is the amount of data that is read.

how do i retrieve the content type?

thanks for any help...

mike c

[EMAIL PROTECTED]


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




[PHP] ODBC

2002-08-02 Thread Ashley M. Kirchner


Can PHP be used on an Apache server (linux) to connect to a (remote) MS
Access server (NT) through ODBC?  If so, does anyone have examples of how this
is done?  And if not, what other choices do I have?

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




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




[PHP] Re: Function search utility

2002-08-02 Thread Lars Olsson

It still works...try http://www.php.net/mysql or 
http://www.php.net/fopen for example...

/lasso ([EMAIL PROTECTED])



Brian V Bonini wrote:
> There used to be a utility that let you search php functions from the
> address bar in your browser by simply appening PHP to the function name eg,
> php mail I thikn it might of been an IE only thing...
> 
> I can't remember were I originally got it form and can not find it again,
> does anyone know?
> 
> -Brian
> 


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




[PHP] wonder why php as apache module can work with virtual host

2002-08-02 Thread Ryan

I dunno why some webhosting company can do virtual host by php as apache
module. That means they seem to work fine with the virtual host uid/gid
permission when using php. But they use php as apache modulehow do
to that ??

Thx all !!


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




[PHP] Re: value submit button

2002-08-02 Thread Ryan

ug

Florian SchäFer wrote:
> Hallo out there,
> 
> i hava an document, with one form and two Submit buttons.
> How can i check in the target document wich button is pressed?
> tried something like   if ($submit == 'xxx') .
> anyone has a hint?
> 
> 


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




[PHP] test

2002-08-02 Thread Ryan

test


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




[PHP] share librearies from repository

2002-08-02 Thread Ricardo Javier Aranibar León

Hi List,
I need your help.
I wrote my classes with php where I defined my objects, then I created my 
repository in  /usr/share/php , in this directory are my clasess.
Now, from my directory web I like to call to my classes, then I modified my 
php.ini (/etc/php.ini) and inserted this line, in the option "Paths and 
Directories"
   include_path = ".:/usr/share/php"
and restart apache.
In my page index.php I call to my class with this form
   
But when I like to see my page I have two message:
1) Warning: Failed opening 'plantilla.class' for inclusion 
(include_path='.:/usr/share/php')in /usr/local/httpd/htdocs/index.php on 
line 2

2)Fatal error: Cannot instantiate non-existent class: pagina in
/usr/local/httpd/htdocs/index.php on line 3

If somebody can help me I'll tahnkfull, my box linux is SuSE 7.3, PHP 4.04 
and Apache.

_
MSN Fotos: la forma más fácil de compartir e imprimir fotos. 
http://photos.msn.es/support/worldwide.aspx


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




[PHP] xml/mysql experts

2002-08-02 Thread ibi

Looking for people who understand the xml/php/mysql/.
Has anyone seen an xml/php application with mysql.   If you have
please send me the link.  thanks.   For those wanting to try an xml
server,
this is the place ixiasoft.http://www.ixiasoft.com/?from=textmldemo


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




[PHP] re:Using PHP to reboot the linux server

2002-08-02 Thread Harpreet Kaur

I am using the below command in the php page to reboot the linux server. But 
nothing happens . Where am i wrong or do i have to give a path or nething . 
Please help.


$output = shell_exec(`reboot`);
echo $output;



_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




[PHP] Re: Using PHP to reboot the linux server

2002-08-02 Thread Ryan

Is it `reboot -n` ??

Harpreet Kaur wrote:
> I am using the below command in the php page to reboot the linux server. 
> But nothing happens . Where am i wrong or do i have to give a path or 
> nething . Please help.
> 
> 
> $output = shell_exec(`reboot`);
> echo $output;
> 
> 
> 
> _
> Join the world’s largest e-mail service with MSN Hotmail. 
> http://www.hotmail.com
> 


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




Re: [PHP] re:Using PHP to reboot the linux server

2002-08-02 Thread Nick Oostveen

Does the user apache is running as have access to reboot the server?

At 07:18 PM 8/2/2002 +, you wrote:
>I am using the below command in the php page to reboot the linux server. 
>But nothing happens . Where am i wrong or do i have to give a path or 
>nething . Please help.
>
>
>$output = shell_exec(`reboot`);
>echo $output;
>
>
>
>_
>Join the world's largest e-mail service with MSN Hotmail. 
>http://www.hotmail.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




[PHP] Vars passed via URL disappearing

2002-08-02 Thread Monty

I just upgraded to PHP 4.2.2 and am trying to make my sites work with
register_globals turned OFF. I notice, however, that with register_globals
turned off any variables I pass via the URL don't seem to be recognized by
the script it was passed to.

So, if I pass "http://my.site.com/page.php?id=2002";, the variable "id" is
empty when I try to access it in page.php ...

if (!empty($id)) { do stuff...}
else { echo "error"; }

With register_globals OFF, the above produces the error message. With
register_globals ON, it works fine.

I thought register_globals only affected session, cookie and get type
variables? Why is PHP ignoring the variables passed via the URL?

Thanks. 

Monty


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




[PHP] User Authentication Problem.

2002-08-02 Thread Tony Harrison

Hi, I need to authenticate users on an included page on my website, but the
problem is, I cant get it to work.
view it included at http://members.lycos.co.uk/ajohnh/ (Source at
http://members.lycos.co.uk/ajohnh/source/index.txt)
the actual file:
http://members.lycos.co.uk/ajohnh/templates/twoShea/head.php (source at
http://members.lycos.co.uk/ajohnh/source/head.txt)
the location of the script that sets the cookie (I hard-coded the user and
password combo for user ramonezrule into it):
http://members.lycos.co.uk/ajohnh/templates/twoShea/setcookie.php (source
at: http://members.lycos.co.uk/ajohnh/source/setcookie.txt)



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




Re: [PHP] Vars passed via URL disappearing

2002-08-02 Thread Steve Edberg

At 3:29 PM -0400 8/2/02, Monty wrote:
>I just upgraded to PHP 4.2.2 and am trying to make my sites work with
>register_globals turned OFF. I notice, however, that with register_globals
>turned off any variables I pass via the URL don't seem to be recognized by
>the script it was passed to.
>
>So, if I pass "http://my.site.com/page.php?id=2002";, the variable "id" is
>empty when I try to access it in page.php ...
>
>if (!empty($id)) { do stuff...}
>else { echo "error"; }
>
>With register_globals OFF, the above produces the error message. With
>register_globals ON, it works fine.
>
>I thought register_globals only affected session, cookie and get type
>variables? Why is PHP ignoring the variables passed via the URL?


'variables passed via the URL' = 'GET variables'

-steve


-- 
++
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
++
| The end to politics as usual:  |
| The Monster Raving Loony Party (http://www.omrlp.com/) |
++

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




Re: [PHP] Re: ldap_add() - null values in fields produce an "value #0 invalid per syntax" error on ldap server

2002-08-02 Thread Stig Venaas

On Thu, Jul 18, 2002 at 08:17:59PM -0500, Richard Lynch wrote:
> #0 is basically just LDAP's way to represent NULL, most likely.
> 
> >$info["mail"]="";  // <- NULL VALUE HERE
> >// The following lines also produce the same result...
> >//$info["mail"]=NULL;  // <--- NULL value here
> >//$info["mail"]="\0";  // <--- NULL value here
> >//$info["mail"];   // <--- NULL value here
> 
> Whoa!
> 
> Never mind.
> 
> Something is very broken in the LDAP stuff if '' and NULL from PHP are being
> turned into NULL in LDAP, and then LDAP complains about it...

Nah... "" and NULL (and I suppose "\0") are all being changed to the
string "" before PHP attempts to add it. What I think the LDAP server
tries to say, is that the syntax doesn't accept an empty string as
value. I tried to create an LDIF file containing an attribute with no
value, like this:

dn: cn=stig,o=photos,dc=venaas,dc=no
objectClass: photo
cn: stig
description:

and I got exactly the same error from ldap_add(1). So this is in my
opinion an LDAP issue and not a PHP issue. OpenLDAP 2 has more
proper schema checking. Perhaps you could try to turn off schema
checking? Or I guess in theory the syntax for the relevant attribute
could be made more relaxed. You could try to ask about this on the
openldap-software list if you need more LDAP help.

Stig

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




Re: [PHP] ldap_modify parameters?

2002-08-02 Thread Stig Venaas

On Thu, Aug 01, 2002 at 09:52:12AM -0400, Chad Day wrote:
> Also tried that, no success, unless I am missing something.
> 
> ...
>   $info["st"]="stchanged!";
> ...
> 
>   ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $info);
> 
> Fatal error: LDAP: Unknown Attribute in the data in
> /usr/local/www/sites/online-leagues.com/htdocs/ldapform.php on line 31

The problem is that $info contains not just the LDAP data, but also
a list of attributes, like say $info[2] == "st". I wish that were
never put in there, but we have to live with it now. You either have
to create a new array with exactly you want in the entry (or I guess
remove these extra values, use var_dump($info) and you should see
what I'm talking of), or instead use ldap_mod_replace() using say

$mods["st"] = "stchamged";
ldap_mod_replace($ds, 'uid=testing,cn=online-leagues.com', $mods);

Stig

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




[PHP] Re: Using PHP to reboot the linux server

2002-08-02 Thread Scott Fletcher

First thing first!  Open up the terminal and log in.  Then type the command,
if the machine doesn't reboot or if you got an error message, it meant the
command is not correct.  Once you get the correct command then use it in
PHP.  It's much simplier that way.  If PHP can't reboot the machine then it
mean many things, like no authority to do it or path statement, shell, etc.

For linux, it use "shutdown -r now"
For some UNIX, it use "shutdown -Fr" or "shutdown -r", etc.

"Ryan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is it `reboot -n` ??
>
> Harpreet Kaur wrote:
> > I am using the below command in the php page to reboot the linux server.
> > But nothing happens . Where am i wrong or do i have to give a path or
> > nething . Please help.
> >
> >
> > $output = shell_exec(`reboot`);
> > echo $output;
> >
> >
> >
> > _
> > Join the world's largest e-mail service with MSN Hotmail.
> > http://www.hotmail.com
> >
>



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




[PHP] PHP and MySQL

2002-08-02 Thread Erich Kolb

Is there any way to speed up MySQL queries?



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




[PHP] share libraries from repository

2002-08-02 Thread Ricardo Javier Aranibar León

Hi List,
I need your help.
I wrote my classes with php where I defined my objects, then I created my 
repository in  /usr/share/php , in this
directory are my clasess.
Now, from my directory web I like to call to my classes, then I modified my 
php.ini (/etc/php.ini) and inserted
this line, in the option "Paths and Directories"
   include_path = ".:/usr/share/php"
and restart apache.
In my page index.php I call to my class with this form
   
But when I like to see my page I have two message:
1) Warning: Failed opening 'plantilla.class' for inclusion 
(include_path='.:/usr/share/php')in
/usr/local/httpd/htdocs/index.php on line 2

2)Fatal error: Cannot instantiate non-existent class: pagina in
/usr/local/httpd/htdocs/index.php on line 3

If somebody can help me I'll tahnkfull, my box linux is SuSE 7.3, PHP 4.04 
and Apache.



_
Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com


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




[PHP] Parsing XML into PHP array.

2002-08-02 Thread Scott Fletcher

I'm having trouble getting the XML string to be broken up into the PHP
array.  Here's how it work.  I send the XML request in a string to the
credit bureau through cURL and vice versa.  Most of the PHP scripting I
found everywhere spoke about breaking up the xml tag into the array only
when they come from the file and is use for parsing.  Problem here is it is
illegal to store the credit inquiry information to a file on the server
except temporary storing it in the RAM but then it will have to be destroyed
when it is done.  I don't need to parse it, just want to use the tag name as
the name in the array with the data from the tag as data to that array name.
What is the work around for this??

Thanks,
 FletchSOD



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




RE: [PHP] PHP and MySQL

2002-08-02 Thread Shane

-Original Message-
here any way to speed up MySQL queries?
--
Sure, ask for only the data you need. or halt your query when you have what you need.

HTH

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




[PHP] Re: ODBC

2002-08-02 Thread Scott Fletcher

Yes!  Unfortunately, you'll have to install the special driver on the
Linux/Unix becuase of the communication difference between UNIX & Windows as
well as the language difference between these two.  I tried using iODBC and
openLINK.  After 1 1/2 years, I decided that open source code for this is no
good because they are not compactable and it is such a big, big pain in the
butt!!!  So, I ended up moving the website on UNIX to windows.  Why, because
of the way the data type is being coverted between 2 platform and character
length or type is strictly limited.  I have not tried to buy such a $600 or
$800 driver software to see how well it does because it is a waste of money
and MS kept changing the programming in the MS Access and MS SQL making the
drivers useless.

"Ashley M. Kirchner" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Can PHP be used on an Apache server (linux) to connect to a (remote)
MS
> Access server (NT) through ODBC?  If so, does anyone have examples of how
this
> is done?  And if not, what other choices do I have?
>
> --
> W | I haven't lost my mind; it's backed up on tape somewhere.
>   +
>   Ashley M. Kirchner    .   303.442.6410 x130
>   IT Director / SysAdmin / WebSmith . 800.441.3873 x130
>   Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
>   http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
>
>
>



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




[PHP] Re: PHP and MySQL

2002-08-02 Thread Monty

Indexes

Putting strings in single quotes instead of double (WHERE id = 'something')

Normalized database design.

- Monty

> From: [EMAIL PROTECTED] (Erich Kolb)
> Organization: R&B Receivables Management, Inc.
> Reply-To: "Erich Kolb" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Date: Fri, 2 Aug 2002 15:13:24 -0500
> To: [EMAIL PROTECTED]
> Subject: PHP and MySQL
> 
> Is there any way to speed up MySQL queries?
> 
> 


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




[PHP] Email failure????

2002-08-02 Thread Scott Fletcher

What give??  I post the command and replied to some other posting.  It made
it through and was posted without a problem!  I kept getting the email from
PHP server saying "
Sorry. Your message could not be delivered to:

brian-phplist,emc (The name was not found at the remote site. Check that

the name has been entered correctly.)"   This for every other users??




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




RE: [PHP] Email failure????

2002-08-02 Thread Shane

Yes Scott, I get that too. But hey, it's friday!

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




[PHP] Help!!! CVS install broke for me!

2002-08-02 Thread Rick Kukiela

ok, i do a make and it makes fine but when the make install i get an
infinite loop of this error:

Warning: mkdir(): File exists in /usr/local/src/php4/pear/System.php on line
235

I went to the code and i tried putting a line that says this:

if(file_exists("$newdir")) { $ret = exec("/bin/rm -rf $newdir"); }

I put that right above the line thats erroring in the while loop. It fixed
the problem with that but then when it gets to XML_RPC the CPU usage goes up
to 100% and will not output any errors or anything. It looks  like its
caught in a loop

anyway, anyone have any ideas??

my systems is FreeBSD 4.6
apache 1.3.26
libtool 1.4
autoconf 2.53
automake 1.5

configure line:
./configure --with-imap=/usr/local --with-xml --with-mysql --enable-track-va
rs --with-mm=/usr/local --with-gettext --with-mcrypt=/usr/local --enable-ftp
 --enable-sockets --with-apache=../apache_1.3.26





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




[PHP] PHP4 and MySql - Search Results Question?

2002-08-02 Thread Jason Caldwell

I'm using PHP4 and MySQL --

I'm trying to write a small search engine -- got it working, however, what
I'd like to do is return the TOTAL records found.

You see, right now I am using LIMIT within my SQL -- so I only return 15
results at a time.

How do I get the total (say for example there are 2000 records) -- do I need
to COUNT(*) first, then perform another SELECT query for my search?

Or, is there a PHP/MYSQL command that returns the total records matching my
SELECT query irregardless of the LIMIT ??

Thanks
Jason



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




[PHP] Regular expressions test code

2002-08-02 Thread Børge Strand


I'm starting work on regular expressions in PHP these days. Just
thought I'd share my test code for others out there who are fresh
starters with the language and regular expressions.


file parser.php:
\n";
print "\n";
print "Testing regular expressions\n";
print "\n";
print "\n";

$string = $_REQUEST['string'];
$pattern = $_REQUEST['pattern'];

print '' . "\n";
print 'STRING:' . 
"\n";
print 'PATTERN:' 
. "\n";
print '' . "\n";
print '' . "\n";
print 'preg_match("' . $pattern . '","' . $string . '") says: ' . "\n";

//$pattern = "/^[a-z\-0-9]+_[a-z\-0-9]+_[0-9]+$/"; // example pattern
if (preg_match($pattern, $string))
print 'YES';
else
print 'NO';

print "\n";
print "\n"

?>


--
Børge

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




RE: [PHP] Help!!! CVS install broke for me!

2002-08-02 Thread R'twick Niceorgaw

I also got exactly the same errors this morning. Thought may be its
because I'm using a beta version of RedHat Linux (Limbo).

-Original Message-
From: Rick Kukiela [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 02, 2002 4:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Help!!! CVS install broke for me!

ok, i do a make and it makes fine but when the make install i get an
infinite loop of this error:

Warning: mkdir(): File exists in /usr/local/src/php4/pear/System.php on
line
235

I went to the code and i tried putting a line that says this:

if(file_exists("$newdir")) { $ret = exec("/bin/rm -rf $newdir"); }

I put that right above the line thats erroring in the while loop. It
fixed
the problem with that but then when it gets to XML_RPC the CPU usage
goes up
to 100% and will not output any errors or anything. It looks  like its
caught in a loop

anyway, anyone have any ideas??

my systems is FreeBSD 4.6
apache 1.3.26
libtool 1.4
autoconf 2.53
automake 1.5

configure line:
./configure --with-imap=/usr/local --with-xml --with-mysql
--enable-track-va
rs --with-mm=/usr/local --with-gettext --with-mcrypt=/usr/local
--enable-ftp
 --enable-sockets --with-apache=../apache_1.3.26





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




  1   2   >