Re: [PHP] Best way to transfer session IDs

2003-07-25 Thread Chris Shiflett
--- "Matthew A. Blasinski" <[EMAIL PROTECTED]> wrote:
> So, I'm thinking a plausible session id could be made by hashing
> their identification (to make it useful to the rightful owner
> only) with a private key (to make it hard to get and guess). I
> think the identification could be their IP, user agent, and maybe
> one or two more constant headers. The private key, of course,
> could be anything unguessable and kept secure.

A few comments...

This session ID doesn't have to be generated from any user data. It can be a
completely random and unique string that you generate for any user who arrives
at your site without an active session. Even though it is probably very
difficult to reverse or guess a valid ID from your method above, the extra risk
isn't necessary.

Also, the IP address isn't a very good piece of data to use, because it is not
necessarily consistent. So, while it might make things harder for the bad guys
(to spoof the good guy's IP), it could also can make things hard for the good
guys (they are AOL users, lose their modem connection, etc.).

So doesn't this contradict everything I mentioned previously? No, the data I
mentioned keeping (User-Agent is my favorite example) is data that you can keep
on the server within the session, such as:

$_SESSION['user_agent'] = $_SERVER['USER_AGENT'];

That would be the first tme, of course. Since session variables aren't sent
to/from the client (unless you output one, of course), they are safer than
things transmitted across the public Internet. So, the session ID doesn't have
to have any data within it that makes it useless to anyone but the rightful
owner - the session that it is associated with on the server can instead. This
might make things simpler for you. 

> This leads me to one more question - would it be better to pass
> this by PUTing it in the URL or generating it at the start of
> each page. Passing is pretty simple, but I think generating it
> has the added benefit of the end user being unable to forge it
> because it never leaves the server or comes from the client.

You lost me with that bit. While it is good that you want to eliminate any
unnecessary transmission of data across the Internet, the session ID is the one
thing the client *must* send you in order for you to maintain session. It is
how you identify who it is.

Maybe you can rephrase what you're asking?

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] funny output

2003-07-25 Thread Chris Shiflett
--- Ryan A <[EMAIL PROTECTED]> wrote:
> So how do i get my scripts working again? the authentication part
> was working perfectly but now it just kicks me back to the login
> page...
> 
> plus it looks like I am unable to set sessions properly, and i
> suspect thats why i am getting kicked back to the login page.

You're probably right.

This is a wild guess, but I bet register_globals is disabled on your new host.
Check the archives for lots of good information about what this means, what you
need to do, etc. This question comes up weekly, so there should be plenty of
information.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Best way to transfer session IDs

2003-07-25 Thread Curt Zirzow
* Thus wrote Matthew A. Blasinski ([EMAIL PROTECTED]):
> Thanks for the response Chris, that's just the type of thing I was 
> looking for!
> 
> So, I'm thinking a plausible session id could be made by hashing their 
> identification (to make it useful to the rightful owner only) with a 
> private key (to make it hard to get and guess).  I think the 
> identification could be their IP, user agent, and maybe one or two more 
> constant headers.  The private key, of course, could be anything 
> unguessable and kept secure.

Using the IP of the user may force things to break on the client
easily.  There are a number of users who are behind proxies that
change per request (ie aol users.) thus their session would become
obsolete on their next request.

Another issue would be inactivity for the session. You could also
keep keep track of an internal last_requested variable that would
expire after a certain amount of time. 

> 
> This leads me to one more question - would it be better to pass this by 
> PUTing it in the URL or generating it at the start of each page. 
> Passing is pretty simple, but I think generating it has the added 
> benefit of the end user being unable to forge it because it never leaves 
> the server or comes from the client.  Does this seem reasonable and 
> worthwhile?  (I have a habit of overcomplicating things like this :-))

I suppose it would depend on how secure you want your session to be
from SID hijaking.  A generation of key hash  per request would be
perhaps a little over kill if you are just keeping track of a last
page the person was on.  Handling sensitive information, however is
a different story (ie cc numbers).


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Best way to transfer session IDs

2003-07-25 Thread John W. Holmes
Matthew A. Blasinski wrote:
I'm trying to track session data and merge several related services 
through a common server-side session (using Apache).  One condition is 
that it won't use cookies to store the user data OR the session ID. 
Another is that the services we're merging use different languages, 
including PHP and Perl (Apache::Session module) so whatever I use needs 
to be supported by both of these.

My question - what is the best way to "know" the session id between 
pages?  Posting it in the URL and using $_GET["PHPSESSID"] is one 
solution, but this seems like a hassle and is also open to attack if 
someone could "guess" a valid session ID.  Or, would it better to avoid 
transferring session ids altogether and generate unique "names" on each 
page?  What works well for generating the name?  I'm thinking something 
like a hash of their IP plus a private key, but maybe someone knows 
problems with this or has a better/easier solution.
If you don't want to use cookies, then you need to pass a session ID 
through the URL. That's your only answer. Or use POST forms everywhere 
to "hide" the session id. I don't understand what you mean by "unique 
names on each page" but I don't think that's any way to maintain state.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





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


Re[2]: [PHP] Display Records (brief summary and full details)

2003-07-25 Thread Tom Rogers
Hi,

Saturday, July 26, 2003, 7:28:16 AM, you wrote:
PSG> Thanks Tom,

PSG> I appreciate your help ! however I have a 2 quick questions...

PSG> 1.)  should we not save the names of the companies as $companies[$row] 
PSG> = $row['company'];
PSG> 2.)  the approach of accessing the variable as $details = 
PSG> $_SESSION['link']['$_GET['name']] is not
PSG> working , when I try to echo the $details is get something else. 
PSG> I am not sure how we use the
PSG> $_SESSION[ ] [ ] with 2 variables as shown.


PSG> any help will be appreciated.

PSG> regards
PSG> --Pushpinder

No that won't work
What we are trying to achieve is

array['companyname'] = row[]
send the code you have so far and i'll have a look.
After the loop use

echo '';
print_r($companies);
echo '';

That will show the array structure you have created.

Do the same for $_SESSION on the next page and it will all become
clear :)
-- 
regards,
Tom


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



Re: [PHP] Best way to transfer session IDs

2003-07-25 Thread Matthew A. Blasinski
Thanks for the response Chris, that's just the type of thing I was 
looking for!

So, I'm thinking a plausible session id could be made by hashing their 
identification (to make it useful to the rightful owner only) with a 
private key (to make it hard to get and guess).  I think the 
identification could be their IP, user agent, and maybe one or two more 
constant headers.  The private key, of course, could be anything 
unguessable and kept secure.

This leads me to one more question - would it be better to pass this by 
PUTing it in the URL or generating it at the start of each page. 
Passing is pretty simple, but I think generating it has the added 
benefit of the end user being unable to forge it because it never leaves 
the server or comes from the client.  Does this seem reasonable and 
worthwhile?  (I have a habit of overcomplicating things like this :-))

Thanks again,

Matt

Chris Shiflett wrote:
--- "Matthew A. Blasinski" <[EMAIL PROTECTED]> wrote:

My question - what is the best way to "know" the session id between 
pages? Posting it in the URL and using $_GET["PHPSESSID"] is one 
solution, but this seems like a hassle and is also open to attack if 
someone could "guess" a valid session ID.


As a side note, you should probably use a word like "put" to describe placing
data in the URL like that, because "post" refers to a different method
altogether. :-)
As for session IDs, there are basically three ways you can have the client send
that to you:
1. In a Cookie header
2. In the URL
3. In the content section (POST)
These are all quite open to attack, especially over non-SSL connections (which
is the more popular case). In your case, cookies are probably not an option if
you are dealing with multiple domains. At the very least, they can only help to
track a session on one domain, and you'll have to develop a way to transfer the
session across domains anyway. POST is sort of a hassle, because you have to
make sure every request from your users is a POST. So, sending data in the URL
is probably your best choice.
Try to focus on two tasks as you try to secure this data transfer:

1. Try to make the session ID hard to get and hard to guess.
2. Try to make a stolen session ID useless to anyone but the rightful owner.
Too often, developers try to focus on (and depend on) task 1. While trying to
keep session IDs secret is good, task 2 is at least equally as important.
How do you achieve this? Consider an HTTP request from your legitimate user:

GET /blah.php?session_id=1234 HTTP/1.1
Host: example.org
User-Agent: Mozilla (Gecko) Linux 2.4.1.2.3.4
There are usually many more headers, but this example will suffice. Now,
depending on specific HTTP headers is never a good plan (you might notice
people warning against depending on the Referer header), but this is only if
you do this for every user. The headers that the *same* user sends are going to
be much more consistent. In the above example, you can be pretty certain that,
regardless of HTTP proxies or anything else, the user is going to send the same
User-Agent header in each request. So, why not store this in the session (on
the server), and check to make sure it matches every time? This approach
shouldn't adversely affect your users, but it should complicate impersonation.
And that is how you play the game of security - try to make things easy for the
good guys and hard for the bad guys. By adding this simple User-Agent check, a
bad guy can't just use a stolen session ID to impersonate someone. The bad guy
has to also send the same User-Agent header. Can this be done? Sure, and it's
not too hard, but it is something, and everything helps.
Hopefully this can get your creative juices flowing.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/


--
Matt Blasinski (mbv)
Internet Infrastructure Applications Technology
Division of Information Technology
3121 Computer Science and Statistics
1210 West Dayton Street
Madison WI 53706
Work (608) 262-2286
Cell (608) 206-4098
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] funny output

2003-07-25 Thread Ryan A
Hey,
Thanks for replying.

So how do i get my scripts working again? the authentication part was
working perfectly but now it just kicks me back to the login page...

plus it looks like I am unable to set sessions properly, and i suspect thats
why i am getting kicked back to the login page.

Kindly reply,
-Ryan


- Original Message -
From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: "Ryan A" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 26, 2003 2:44 AM
Subject: Re: [PHP] funny output


> --- Ryan A <[EMAIL PROTECTED]> wrote:
> > I am having some funny output and funny things happening to my
> > scripts since I changed hosts...
> ...
> > there is a hidden text box appearing in the code that i didnt
> > write...this is it:
> >  > value="ad2e5a31727b2b4eb28b2d0c2d6ee67e" />
> >
> > Also notice that it ends with a slash that I didnt have anything
> > to do with.
>
> Your new host has session.use_trans_sid enabled, and perhaps your old one
did
> not.
>
> The slash at the end is XHTML compliant, which is how PHP tries to add
code (in
> case you care about XHTML compliance).
>
> Hope that helps.
>
> Chris
>
> =
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/
>


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



Re: [PHP] how to make a global scope array

2003-07-25 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Sat, 26 Jul 2003 at
00:50, lines prefixed by '>' were originally written by you.
> Ouch!
> Sometimes I wish global didn't exist

Yes, it can be better to pass in a variable (by reference if you need
to write to it from within a function and not have it as the value
that you return), e.g.

function doSomething(&$a){
$a = 20;
return true; // to signify success
}

$a = 10;
doSomething($a);
echo $a; // prints 20


--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



Re: [PHP] funny output

2003-07-25 Thread Chris Shiflett
--- Ryan A <[EMAIL PROTECTED]> wrote:
> I am having some funny output and funny things happening to my
> scripts since I changed hosts...
...
> there is a hidden text box appearing in the code that i didnt
> write...this is it:
>  value="ad2e5a31727b2b4eb28b2d0c2d6ee67e" />
> 
> Also notice that it ends with a slash that I didnt have anything
> to do with.

Your new host has session.use_trans_sid enabled, and perhaps your old one did
not.

The slash at the end is XHTML compliant, which is how PHP tries to add code (in
case you care about XHTML compliance).

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] funny output

2003-07-25 Thread Ryan A
Hi everyone,
I am having some funny output and funny things happening to my scripts since
I changed hosts...
my login scripts were working fine before but now they dont seem to
work...also there is a hidden text box appearing in the
code that i didnt write...this is it:


Also notice that it ends with a slash that I didnt have anything to do with.
Any ideas on why this is happening? you can have a look at the php info for
this site at:
http://bestwebhosters.com/phpinfo.php

Kindly reply,
-Ryan





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



Re: [PHP] Best way to transfer session IDs

2003-07-25 Thread Chris Shiflett
--- "Matthew A. Blasinski" <[EMAIL PROTECTED]> wrote:
> My question - what is the best way to "know" the session id between 
> pages? Posting it in the URL and using $_GET["PHPSESSID"] is one 
> solution, but this seems like a hassle and is also open to attack if 
> someone could "guess" a valid session ID.

As a side note, you should probably use a word like "put" to describe placing
data in the URL like that, because "post" refers to a different method
altogether. :-)

As for session IDs, there are basically three ways you can have the client send
that to you:

1. In a Cookie header
2. In the URL
3. In the content section (POST)

These are all quite open to attack, especially over non-SSL connections (which
is the more popular case). In your case, cookies are probably not an option if
you are dealing with multiple domains. At the very least, they can only help to
track a session on one domain, and you'll have to develop a way to transfer the
session across domains anyway. POST is sort of a hassle, because you have to
make sure every request from your users is a POST. So, sending data in the URL
is probably your best choice.

Try to focus on two tasks as you try to secure this data transfer:

1. Try to make the session ID hard to get and hard to guess.
2. Try to make a stolen session ID useless to anyone but the rightful owner.

Too often, developers try to focus on (and depend on) task 1. While trying to
keep session IDs secret is good, task 2 is at least equally as important.

How do you achieve this? Consider an HTTP request from your legitimate user:

GET /blah.php?session_id=1234 HTTP/1.1
Host: example.org
User-Agent: Mozilla (Gecko) Linux 2.4.1.2.3.4

There are usually many more headers, but this example will suffice. Now,
depending on specific HTTP headers is never a good plan (you might notice
people warning against depending on the Referer header), but this is only if
you do this for every user. The headers that the *same* user sends are going to
be much more consistent. In the above example, you can be pretty certain that,
regardless of HTTP proxies or anything else, the user is going to send the same
User-Agent header in each request. So, why not store this in the session (on
the server), and check to make sure it matches every time? This approach
shouldn't adversely affect your users, but it should complicate impersonation.

And that is how you play the game of security - try to make things easy for the
good guys and hard for the bad guys. By adding this simple User-Agent check, a
bad guy can't just use a stolen session ID to impersonate someone. The bad guy
has to also send the same User-Agent header. Can this be done? Sure, and it's
not too hard, but it is something, and everything helps.

Hopefully this can get your creative juices flowing.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] file_put_contents()?

2003-07-25 Thread Curt Zirzow
* Thus wrote Jonas Thorell ([EMAIL PROTECTED]):
> Another stupid newbie question...(btw, is there a list more geared towards
> the newbies?)
1) the manual
2) the archives
3) see #1 

> 
> Is the file_put_contents() function not available in PHP 4.3.2?
If you notice in the manual under the function name:

file_put_contents
(PHP 5 CVS only)

PHP documentors have been excellent at keeping most documentation
up to par specifying when things become available.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] file_put_contents()?

2003-07-25 Thread Curt Zirzow
* Thus wrote CPT John W. Holmes ([EMAIL PROTECTED]):
> > Another stupid newbie question...(btw, is there a list more geared towards
> > the newbies?)
> 
> Yes, it's called the manual. 
> 
> > Is the file_put_contents() function not available in PHP 4.3.2?
> 
> Seriously: www.php.net/file_put_contents

note: only in version 5 cvs only.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Debugging a Session Problem

2003-07-25 Thread Curt Zirzow
* Thus wrote Lee Stewart ([EMAIL PROTECTED]):
> Using the $_SESSION[] style produces the same results...   Zero length 
> session file in /tmp, and no data passed...   (available at 
> http://4.43.81.92/page1a.php)

You did see my post about space left on /tmp?

> 
> So where do I go from here...Is there any way to debug it?   Like I 
> said, I suspect it's not a PHP code bug, but I'm at a loss as to where to 
> go from here (other than re-writing the entire application in some other 
> language -- which I really don't want to do)...

another language?  how dare you say such thing here on this list :)

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] incrementing string value

2003-07-25 Thread Curt Zirzow
* Thus wrote Curt Zirzow ([EMAIL PROTECTED]):
> * Thus wrote Jeremy ([EMAIL PROTECTED]):
> > let me make sure I understand...
> > 
> > $var = 'a';
> > $var++
> > print($var);
> > 
> > would print "b" to the screen?
> 
> um.. ignore my post ealier.. yes it does print 'b'

I forgot to mention, be sure to check how far you are in your loop
cause last time i checked:

...
var z[];
var {[];

will produce a javascript error.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Reading a file from another server

2003-07-25 Thread Chris Shiflett
--- Thomas <[EMAIL PROTECTED]> wrote: 
> readfile("ftp://username:[EMAIL PROTECTED]/test.txt");
> 
> It doesn't have any errors and comes up blank.
> 
> If I put:
> 
> $result =
> readfile("ftp://username:[EMAIL PROTECTED]/test.txt");
> print ($result);
> 
> it ends up showing a '0'  by iteself.

The readfile() functions outputs the contents of the file and returns the size
of the file in bytes. So, when you assigned $result to the return value, you
demonstrated that readfile() output 0 bytes (which explains why you didn't see
anything).

I'm pretty sure your php.ini is set to allow this, otherwise you would receive
an error. I'm doubting whether that URL actually contains any content. How have
you tested to be sure it does?

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Display Records (brief summary and full details)

2003-07-25 Thread Curt Zirzow
* Thus wrote Pushpinder Singh Garcha ([EMAIL PROTECTED]):
> Thanks Tom,
> 
> I appreciate your help ! however I have a 2 quick questions...
> 
> 1.)  should we not save the names of the companies as $companies[$row] 
> = w['company'];
I'm not sure in what context or what purpose you wish to do so.
There is, in general, nothing wrong with storing your information
like that.

> 2.)  the approach of accessing the variable as $details = 
> $_SESSION['link']['$_GET['name']] is not
>working , when I try to echo the $details is get something else. 
> I am not sure how we use the
>$_SESSION[ ] [ ] with 2 variables as shown.
> 

I assume you mean:
$_SESSION['link'][$_GET['name']];

If you could provide an example on how you set the array that would
be easier to let you know why your output is not comming back
right.

Please Compose a new message and type a subject when starting a new
topic.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



RE: [PHP] Debugging a Session Problem

2003-07-25 Thread Lee Stewart
Using the $_SESSION[] style produces the same results...   Zero length 
session file in /tmp, and no data passed...   (available at 
http://4.43.81.92/page1a.php)

So where do I go from here...Is there any way to debug it?   Like I 
said, I suspect it's not a PHP code bug, but I'm at a loss as to where to 
go from here (other than re-writing the entire application in some other 
language -- which I really don't want to do)...

Help?
Lee
At 04:36 PM 7/25/2003, Johnson, Kirk wrote:
Sorry, I am stumped. I don't see any problems in the .ini file. Have you
tried some simple code in "register_globals off" style?

";
?>
Kirk


--
Lee Stewart, Senior SE
Sytek Services, a Division of DSG
(719) 566-0188 , Fax (719) 566-0655
[EMAIL PROTECTED]
www.sytek-services.com
www.dsgroup.com 

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


[PHP] Best way to transfer session IDs

2003-07-25 Thread Matthew A. Blasinski
Hi,

I'm trying to track session data and merge several related services 
through a common server-side session (using Apache).  One condition is 
that it won't use cookies to store the user data OR the session ID. 
Another is that the services we're merging use different languages, 
including PHP and Perl (Apache::Session module) so whatever I use needs 
to be supported by both of these.

My question - what is the best way to "know" the session id between 
pages?  Posting it in the URL and using $_GET["PHPSESSID"] is one 
solution, but this seems like a hassle and is also open to attack if 
someone could "guess" a valid session ID.  Or, would it better to avoid 
transferring session ids altogether and generate unique "names" on each 
page?  What works well for generating the name?  I'm thinking something 
like a hash of their IP plus a private key, but maybe someone knows 
problems with this or has a better/easier solution.

Also, outside of changing session.use_cookies to false and 
session.save_path to a PHP- and Perl- happy location, are there any 
other php.ini or Apache settings I should be changing?

Any comments or thoughts are greatly appreciated!

--
Matt Blasinski (mbv)
Internet Infrastructure Applications Technology
Division of Information Technology
3121 Computer Science and Statistics
1210 West Dayton Street
Madison WI 53706
Work (608) 262-2286
Cell (608) 206-4098
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] how to make a global scope array

2003-07-25 Thread Curt Zirzow
* Thus wrote Comex ([EMAIL PROTECTED]):
> <[EMAIL PROTECTED]>
> Jack Lee:
> > //I have an array a[] like this:
> >
> >  > $a[]=0;
> >
> > //How to define and use it in a function like this?
> >
> > function myfunc(something)
> > {
> > echo $a[0];  //got error here Notice: Undefined variable:
> >
> > }
> >
> >>
> > //Thanks for any help.!!!
> 
> global $a;

Ouch!

Sometimes I wish global didn't exist 

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] how to make a global scope array

2003-07-25 Thread Jack Lee
It works! Thanks guys!

"David Nicholson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello,

This is a reply to an e-mail that you wrote on Fri, 25 Jul 2003 at
23:51, lines prefixed by '>' were originally written by you.

> <[EMAIL PROTECTED]>
> Jack Lee:
> > //I have an array a[] like this:
> >  > $a[]=0;
> > //How to define and use it in a function like this?
> > function myfunc(something)
> > {
> > echo $a[0];  //got error here Notice: Undefined
variable:
> > }
> > //Thanks for any help.!!!
> global $a;

.. or echo $GLOBALS['a'][0];

David.

-- 
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)



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



Re: [PHP] Rewrite and tags.

2003-07-25 Thread Curt Zirzow
* Thus wrote Simon Fredriksson ([EMAIL PROTECTED]):
> 
> How can I easiest rewrite A and IMG tags? I'm fetching a page with 
> fsockopen() and I need to rewrite these tags before sending it on to a user.
> 
> My own theory is that it's made with Regular Expressions. I just don't 
> know these myself.
 
The documentation for preg_match_all has an excelent pattern for
matching html tags:

preg_match_all ("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $html, $matches);

HTH,

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Debugging a Session Problem

2003-07-25 Thread Curt Zirzow
* Thus wrote Lee Stewart ([EMAIL PROTECTED]):
> The symptom is that when I attempt to save a session variable, it 
> creates the session file in /tmp, but with a zero length - no variable 
> names or values stored.  (/tmp is globally read/write)  This happens not 
> only with the application I'm moving, but also with the "world's 
> simplest global test pages" below.

hmm.. you do have space left on /tmp ?

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] how to make a global scope array

2003-07-25 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Fri, 25 Jul 2003 at
23:51, lines prefixed by '>' were originally written by you.

> <[EMAIL PROTECTED]>
> Jack Lee:
> > //I have an array a[] like this:
> >  > $a[]=0;
> > //How to define and use it in a function like this?
> > function myfunc(something)
> > {
> > echo $a[0];  //got error here Notice: Undefined
variable:
> > }
> > //Thanks for any help.!!!
> global $a;

.. or echo $GLOBALS['a'][0];

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



Re: [PHP] Freeze Pane

2003-07-25 Thread Jason Martyn
I will put up the link to the example later. I'd just like to mention one
thing if anyone else uses this solution:

You may want to put both tables in the  tags and give them both
absolute locations. This eliminates the possiblity of having a mismatched
table as different browsers are used.

- Original Message -
From: "Jason Martyn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 8:49 AM
Subject: [PHP] Freeze Pane


This is probably under the category of javascript, however I would like ot
know if it is possible to be done with php.

Let's say I have a table that is 30 columns wide and so the entire table
doesn't fit on the screen. Is it possible (with php) to "freeze columns"
while scrolling across so you don't lose the original 2 columns?

And since it probably isn't, can someone suggest a language that would cover
this subject?

Thanks,
Jay

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



Re: [PHP] Re: php5 + php4 on same server

2003-07-25 Thread Volker
hi,

you also could run two static compiled versions of apache (if apache) with
php4 and 5 compiled in, but you need another ip-address to bind to - also
have to manage 2 apaches(not a problem or what? ,-).

sorry for my english.
volker
- Original Message -
From: "Comex" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 26, 2003 12:42 AM
Subject: Re: [PHP] Re: php5 + php4 on same server


> <[EMAIL PROTECTED]>
> Comex:
> > <[EMAIL PROTECTED]>
> > Thomas Hochstetter:
> >> Hi guys.
> >>
> >> Sorry, i know that was discussed earlier this month ... i just looked
> >> for the posting again in the archives ... i could only find the
> >> question post ... but there was an answer.
> >>
> >> So, how do you setup the server again to have php4 run on the :80
> >> port and php5 on :8080 (apache server). Does it collide?
> >>
> >> Thanks
> >> Thomas
> >
> > I've done it... but you have to run one as CGI, one can be module or
> > CGI. To run one as CGI and one as module:
> >
> > LoadModule php5_module "/path/to/php4apache.dll"
> > ScriptAlias /php/ "/path/to/php4/folder/"
> > AddType application/x-httpd-php .php5
> > AddType application/x-httpd-php4 .php4
> > Action application/x-httpd-php4 /php/php.exe (I'm using windows)
> >
> > Or to run both as CGI:
> > ScriptAlias /php4/ "/path/to/php4/folder"
> > ScriptAlias /php5/ "/path/to/php5/folder"
> > AddType application/x-httpd-php .php5
> > AddType application/x-httpd-php4 .php4
> > Action application/x-httpd-php4 /php4/php.exe
> > Action application/x-httpd-php /php5/php.exe
>
> Oh, I'm stupid!  That is how you have .php5 as php5 and .php4 as php4...
if
> you're using virtual hosts, you just replace:
> AddType application/x-httpd-php4 .php4
> with:
> AddType application/x-httpd-php4 .php
>
> and put the AddType in the .
>
>
>
> --
> 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] how to make a global scope array

2003-07-25 Thread Comex
<[EMAIL PROTECTED]>
Jack Lee:
> //I have an array a[] like this:
>
>  $a[]=0;
>
> //How to define and use it in a function like this?
>
> function myfunc(something)
> {
> echo $a[0];  //got error here Notice: Undefined variable:
>
> }
>
>>
> //Thanks for any help.!!!

global $a;



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



[PHP] how to make a global scope array

2003-07-25 Thread Jack Lee
//I have an array a[] like this:


//Thanks for any help.!!!



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



Re: [PHP] Re: php5 + php4 on same server

2003-07-25 Thread Comex
<[EMAIL PROTECTED]>
Comex:
> <[EMAIL PROTECTED]>
> Thomas Hochstetter:
>> Hi guys.
>>
>> Sorry, i know that was discussed earlier this month ... i just looked
>> for the posting again in the archives ... i could only find the
>> question post ... but there was an answer.
>>
>> So, how do you setup the server again to have php4 run on the :80
>> port and php5 on :8080 (apache server). Does it collide?
>>
>> Thanks
>> Thomas
>
> I've done it... but you have to run one as CGI, one can be module or
> CGI. To run one as CGI and one as module:
>
> LoadModule php5_module "/path/to/php4apache.dll"
> ScriptAlias /php/ "/path/to/php4/folder/"
> AddType application/x-httpd-php .php5
> AddType application/x-httpd-php4 .php4
> Action application/x-httpd-php4 /php/php.exe (I'm using windows)
>
> Or to run both as CGI:
> ScriptAlias /php4/ "/path/to/php4/folder"
> ScriptAlias /php5/ "/path/to/php5/folder"
> AddType application/x-httpd-php .php5
> AddType application/x-httpd-php4 .php4
> Action application/x-httpd-php4 /php4/php.exe
> Action application/x-httpd-php /php5/php.exe

Oh, I'm stupid!  That is how you have .php5 as php5 and .php4 as php4...  if
you're using virtual hosts, you just replace:
AddType application/x-httpd-php4 .php4
with:
AddType application/x-httpd-php4 .php

and put the AddType in the .



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



RE: [PHP] Debugging a Session Problem

2003-07-25 Thread Johnson, Kirk
Sorry, I am stumped. I don't see any problems in the .ini file. Have you
tried some simple code in "register_globals off" style? 



";
?>

Kirk

> -Original Message-
> From: Lee Stewart [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 25, 2003 4:27 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Debugging a Session Problem
> 
> 
> I agree that it's probably a config problem -- somewhere...
> 
> Yes, the session ID is passed correctly, but since page1.php 
> doesn't end up 
> with any variables or values in the session file, so 
> regardless that it has 
> the right session ID, there's nothing in the session file to 
> restore...
> 
> The php.ini file is in /etc/php.ini  (but that's where it's 
> supposed to be 
> in this distribution), and phpinfo shows it there, and when I turn 
> register_globals on and off there, I see it change both in 
> phpinfo and from 
> a php script.
> 
> And if you want to look, a copy of my php.ini is available at 
> http://4.43.81.92/phpini.txt

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



[PHP] Re: php5 + php4 on same server

2003-07-25 Thread Comex
<[EMAIL PROTECTED]>
Thomas Hochstetter:
> Hi guys.
>
> Sorry, i know that was discussed earlier this month ... i just looked
> for the posting again in the archives ... i could only find the
> question post ... but there was an answer.
>
> So, how do you setup the server again to have php4 run on the :80
> port and php5 on :8080 (apache server). Does it collide?
>
> Thanks
> Thomas

I've done it... but you have to run one as CGI, one can be module or CGI.
To run one as CGI and one as module:

LoadModule php5_module "/path/to/php4apache.dll"
ScriptAlias /php/ "/path/to/php4/folder/"
AddType application/x-httpd-php .php5
AddType application/x-httpd-php4 .php4
Action application/x-httpd-php4 /php/php.exe (I'm using windows)

Or to run both as CGI:
ScriptAlias /php4/ "/path/to/php4/folder"
ScriptAlias /php5/ "/path/to/php5/folder"
AddType application/x-httpd-php .php5
AddType application/x-httpd-php4 .php4
Action application/x-httpd-php4 /php4/php.exe
Action application/x-httpd-php /php5/php.exe



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



Re: [PHP] Link acting as a submit button

2003-07-25 Thread Ray Hunter
Good point...thanks for catching that

I usually link into forms from other frames if I dont have a submit
button in that form.

--
BigDog

On Fri, 2003-07-25 at 15:49, Comex wrote:
> <[EMAIL PROTECTED]>
> Ray Hunter:
> > On Fri, 2003-07-25 at 05:30, Matt Palermo wrote:
> >> I just remembered (I'm not sure if it makes a difference) that I am
> >> using frames on this page.  Does this matter at all?  Thanks.
> >
> > Yes it matters tons with the javascript call.
> >
> > Here is some info on it...however, these questions are now javascript
> > and not php...
> 
> That's only if you're going between frames, if the whole form (as usual) is
> on one frame it works fine.
> 
> 


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



Re: [PHP] Reading a file from another server

2003-07-25 Thread Thomas
if  I use:

readfile("ftp://username:[EMAIL PROTECTED]/test.txt");

It doesn't have any errors and comes up blank.

If I put:

$result =
readfile("ftp://username:[EMAIL PROTECTED]/test.txt");
print ($result);

it ends up showing a '0'  by iteself.  that's it.  and I knwo the txt file
is full of info.
I'm stumped again.

Cheers. for your help.

Thomas


"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> --- Thomas <[EMAIL PROTECTED]> wrote:
> > I'm having problems creating code to read a file from another
> > server.
> >
> > 1.  Is this even possible?  with a secure server aswell?
>
> Yes.
>
> > this is my code:
> >  > $filename = "http://www.domain.com/test.txt";;
> > $handle = fopen ($filename, "r");
> > $content = fread($handle, filesize ($filename));
> > fclose($handle);
> > echo $content;
> > ?>
>
> This code can be replaced with:
>
> readfile('http://www.domain.com/test.txt');
>
> As far as debugging problems related to this, check your php.ini and make
sure
> the URL wrapper is enabled. Otherwise, you will be restricted to your
local
> filesystem only.
>
> Hope that helps.
>
> Chris
>
> =
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/



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



RE: [PHP] Debugging a Session Problem

2003-07-25 Thread Lee Stewart
I agree that it's probably a config problem -- somewhere...

Yes, the session ID is passed correctly, but since page1.php doesn't end up 
with any variables or values in the session file, so regardless that it has 
the right session ID, there's nothing in the session file to restore...

The php.ini file is in /etc/php.ini  (but that's where it's supposed to be 
in this distribution), and phpinfo shows it there, and when I turn 
register_globals on and off there, I see it change both in phpinfo and from 
a php script.

And if you want to look, a copy of my php.ini is available at 
http://4.43.81.92/phpini.txt

Lee

At 02:51 PM 7/25/2003, Johnson, Kirk wrote:
Your original code works for me, so it is a config issue somewhere.

Add this code to each file, to verify that the session ID is being correctly
passed:
echo "session id is " . session_id() . "";

Also, is your php.ini in /usr/local/lib? If PHP can't find it, it will use
its built-in defaults, which is register_globals off.
Kirk


--
Lee Stewart, Senior SE
Sytek Services, a Division of DSG
(719) 566-0188 , Fax (719) 566-0655
[EMAIL PROTECTED]
www.sytek-services.com
www.dsgroup.com 

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


[PHP] php5 + php4 on same server

2003-07-25 Thread Thomas Hochstetter
Hi guys.

Sorry, i know that was discussed earlier this month ... i just looked for
the posting again in the archives ... i could only find the question post ...
but there was an answer.

So, how do you setup the server again to have php4 run on the :80 port and
php5 on :8080 (apache server). Does it collide?

Thanks
Thomas

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++

Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!


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



[PHP] Re: Reading a file from another server

2003-07-25 Thread Comex
<[EMAIL PROTECTED]>
Thomas:
> Hi Everyone.
>
> I'm having problems creating code to read a file from another server.
>
> 1.  Is this even possible?  with a secure server aswell?
> 2.  I have tried using fopen()but this always gives me an
> error:
>
> Warning: stat failed for http://www.domain.com/test.txt (errno=2 - No
> such file or directory) in
> /home/domain/public_html/php/testphp/test.php on line 4
>
> this is my code:
>  $filename = "http://www.domain.com/test.txt";;
> $handle = fopen ($filename, "r");
> $content = fread($handle, filesize ($filename));
> fclose($handle);
>
> echo $content;
>
>>
>
> can anyone help me.   I need to put this on my server, and read this
> other file form a game serverbut I can't seem to do it.
>
> Cheers for any help

Quote:
If PHP has decided that filename specifies a registered protocol, and that
protocol is registered as a network URL, PHP will check to make sure that
allow_url_fopen is enabled. If it is switched off, PHP will emit a warning
and the fopen call will fail.

But then again, that's not the error it gave...



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



Re: [PHP] Reading a file from another server

2003-07-25 Thread Chris Shiflett
--- Thomas <[EMAIL PROTECTED]> wrote:
> I'm having problems creating code to read a file from another
> server.
> 
> 1.  Is this even possible?  with a secure server aswell?

Yes.

> this is my code:
>  $filename = "http://www.domain.com/test.txt";;
> $handle = fopen ($filename, "r");
> $content = fread($handle, filesize ($filename));
> fclose($handle);
> echo $content;
> ?>

This code can be replaced with:

readfile('http://www.domain.com/test.txt');

As far as debugging problems related to this, check your php.ini and make sure
the URL wrapper is enabled. Otherwise, you will be restricted to your local
filesystem only.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] Re: html and php in the same document

2003-07-25 Thread Comex
<[EMAIL PROTECTED]>
Bill Pilgrim:
> If php and html are to be included in the same document, does the
> document extension always have to be .php  ?
No, but /why/ do you want to change it?



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



Re: [PHP] PHP should know my data!

2003-07-25 Thread Comex
<[EMAIL PROTECTED]>
Manoj Nahar:
> and much needed function
>
> debug_and_test_all_my_code();
>
Which is the most likely of all the functions here.



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



Re: [PHP] Link acting as a submit button

2003-07-25 Thread Comex
<[EMAIL PROTECTED]>
Ray Hunter:
> On Fri, 2003-07-25 at 05:30, Matt Palermo wrote:
>> I just remembered (I'm not sure if it makes a difference) that I am
>> using frames on this page.  Does this matter at all?  Thanks.
>
> Yes it matters tons with the javascript call.
>
> Here is some info on it...however, these questions are now javascript
> and not php...

That's only if you're going between frames, if the whole form (as usual) is
on one frame it works fine.



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



[PHP] Reading a file from another server

2003-07-25 Thread Thomas
Hi Everyone.

I'm having problems creating code to read a file from another server.

1.  Is this even possible?  with a secure server aswell?
2.  I have tried using fopen()but this always gives me an error:

Warning: stat failed for http://www.domain.com/test.txt (errno=2 - No such
file or directory) in /home/domain/public_html/php/testphp/test.php on line
4

this is my code:
http://www.domain.com/test.txt";;
$handle = fopen ($filename, "r");
$content = fread($handle, filesize ($filename));
fclose($handle);

echo $content;

?>

can anyone help me.   I need to put this on my server, and read this other
file form a game serverbut I can't seem to do it.

Cheers for any help




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



Re: [PHP] Display Records (brief summary and full details)

2003-07-25 Thread Pushpinder Singh Garcha
Thanks Tom,

I appreciate your help ! however I have a 2 quick questions...

1.)  should we not save the names of the companies as $companies[$row] 
= $row['company'];	
2.)  the approach of accessing the variable as $details = 
$_SESSION['link']['$_GET['name']] is not
   working , when I try to echo the $details is get something else. 
I am not sure how we use the
   $_SESSION[ ] [ ] with 2 variables as shown.

any help will be appreciated.

regards
--Pushpinder
On Thursday, July 24, 2003, at 08:10 PM, Tom Rogers wrote:

Hi,

Friday, July 25, 2003, 7:13:27 AM, you wrote:
PSG> Hello All,
PSG>   I am trying to create a  small MySQL application using PHP. I 
have a
PSG> table of contacts with each record having over 30 fields. I have a
PSG> search page where a logged-in admin can search for a particular 
record
PSG> on the basis of certain parameters.

PSG> This is a sample code:

PSG>   $sql1 = "SELECT * from `contacts` WHERE $where";

PSG>  while ($row = mysql_fetch_array($result1)) {

PSG>  // Alternate the bgcolor of each row for visibility
PSG>  ($even % 2) == 0 ? $bgcolor = "#EFEFEF" : $bgcolor =
PSG> "#ee";
PSG>  $even = $even + 1;
PSG>  // print the actual row
PSG> echo   "
PSG>  
PSG> face=\"Verdana, Arial, Helvetica, 
sans-serif\">$row[company]
PSG>  
PSG> face=\"Verdana, Arial, Helvetica, 
sans-serif\">$row[name_1]
PSG>  
PSG> face=\"Verdana, Arial, Helvetica, 
sans-serif\">$row[phone_1]
PSG>  
PSG> face=\"Verdana, Arial, Helvetica, 
sans-serif\">$row[city]
PSG>  
PSG> face=\"Verdana, Arial, Helvetica, 
sans-serif\">$row[url]
PSG>  
PSG> face=\"Verdana, Arial, Helvetica, 
sans-serif\">$row[email_1]
PSG>  
PSG> face=\"Verdana, Arial, Helvetica, sans-serif\">
PSG> href=\"profile.php\">Link
PSG> ";

PSG>  // try to register the variable
PSG>$_SESSION['link'] = $row[company];
PSG>  } // end while
PSG> // print the end of the table
PSG>echo "";
PSG> The above tables displays the results of the query in a table form
PSG> with only the main fields of the record.  The last column of the 
table
PSG> contains a link to view the full-contents of the record. when the 
user
PSG> clicks this link, he will go to another script called
PSG> "profile.php" which will display all the contents of the record.  
In
PSG> order to do this I will need to store all the primary keys  (in 
this
PSG> case the name of the company) of each record from the result set 
and
PSG> then use it to retrieve all the contents. I have been successful 
in
PSG> trying to do this for a single row (record) of the result by
PSG> registering it as an session variable called ['link']

PSG> I am at a loss to figure out how to store the names of the first 
column
PSG> of the result set i.e. the company name. Is it possible to create 
an
PSG> array of the session variable ['link']   ??  Another approach 
would be
PSG> to get the names of the companies as a separate query and 
register them
PSG> as an array of session variables.

PSG> any suggestions will be welcome. Thanks in advance.

PSG> --Pushpinder

in the href put

..

Make a seperate array as you loop

$companies[$row['name']] = $row;

in your session store it as

$_SESSION['link'] = $companies;

You can then access it in profile php as

$details = $_SESSION['link']['$_GET['name']]

--
regards,
Tom
--
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: Permission Denied (in FTP)

2003-07-25 Thread Stephen
I've tried a regular user and the root user but both seem to say permission
denied...

Thank you,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.
Lead Programmer/Webmaster
WiredPHP (http://php.melchior.us)


- Original Message - 
From: "Baroiller Pierre-Emmanuel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 3:32 PM
Subject: [PHP] Re: Permission Denied (in FTP)


Hi,

Doest your ftp account have sufficient access rights for deleting theses
files ?
Is your apache user is "nobody" , the chmod will not work ( take a look at
your error log file), so,
only nobody or root will able to remove these entries..

Regards,
P.E. Baroiller

"Stephen" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
Hello,

I'm having some slight issues. I have a script which creates a directory and
then copies a blank file into it 4 times each with different names. Here's
the code which does it:

  

After all that is done, it's fine. The problem I'm having is deleting the
folder in an FTP client. Whenever I go to delete it, it says it cannot
delete desc.txt because permission is denied. Is there any way to make it so
it can be deleted? Please help and reply soon. Thanks!

Thank you,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.
Lead Programmer/Webmaster
WiredPHP (http://php.melchior.us)




-- 
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] Debugging a Session Problem

2003-07-25 Thread Johnson, Kirk
Your original code works for me, so it is a config issue somewhere.

Add this code to each file, to verify that the session ID is being correctly
passed:

echo "session id is " . session_id() . "";

Also, is your php.ini in /usr/local/lib? If PHP can't find it, it will use
its built-in defaults, which is register_globals off.

Kirk

> -Original Message-
> From: Lee Stewart [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 25, 2003 2:00 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Debugging a Session Problem
> 
> 
> At 11:55 AM 7/25/2003, you wrote:
> >If you are relying on cookies to transmit the session ID, 
> make sure you have
> >session cookies enabled in your browser. Also check that you 
> don't have an
> >.htacess file in your directory that is overriding the 
> register_globals
> >setting. Turn your error_reporting up to E_ALL and see if 
> PHP has anything
> >to say to you.
> 
> Yes, cookies are enabled in the browser (and the same browser 
> works with 
> the application on the old system).  And no .htaccess files.
> 
> When I set error_reporting to E_ALL I do get:
>  Notice: Undefined variable: test in 
> /srv/www/htdocs/etrak/page2.php on line 3
> which is the reference to $test in
>  echo "test is $test";
> because $test was to have been a session variable, but wasn't 
> passed.   Other than that, no errors.
> 
> CPT John W. Holmes wrote:
> >Seem to remember something about starting a session and then 
> redirecting
> >with header causing trouble. Try using session_write_close() 
> before you
> >redirect.
> 
> I also tried adding the session_write_close() with no change...
> 
> Each time I get a new session file in /tmp, but all are zero length...
> ls -l /tmp
> drwxrwxrwt6 root root  592 Jul 25 12:48 .
> drwxr-xr-x   18 root root  408 Jul 25 12:47 ..
> -rw---1 wwwrun   nogroup 0 Jul 25 12:49 
> sess_39e04150efb3de58764ce04dae572401
> -rw---1 wwwrun   nogroup 0 Jul 25 11:57 
> sess_4d9573209bf3688c380d33c94f64be47
> -rw---1 wwwrun   nogroup 0 Jul 17 16:55 
> sess_5160b002714849a598a8a1e62a78a2eb
> -rw---1 wwwrun   nogroup 0 Jul 20 08:36 
> sess_7a053a0dd515170e6d0ace739860b71f
> -rw---1 wwwrun   nogroup 0 Jul 25 11:55 
> sess_903ef4579ee2f596981aad08efd3bc9d
> 
> Thanks for any debugging suggestions...
> Lee
> 
> --
> Lee Stewart, Senior SE
> Sytek Services, a Division of DSG
> (719) 566-0188 , Fax (719) 566-0655
> [EMAIL PROTECTED]
> www.sytek-services.com
> www.dsgroup.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] Re: Permission Denied (in FTP)

2003-07-25 Thread Baroiller Pierre-Emmanuel
Hi,

Doest your ftp account have sufficient access rights for deleting theses
files ?
Is your apache user is "nobody" , the chmod will not work ( take a look at
your error log file), so,
only nobody or root will able to remove these entries..

Regards,
P.E. Baroiller

"Stephen" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
Hello,

I'm having some slight issues. I have a script which creates a directory and
then copies a blank file into it 4 times each with different names. Here's
the code which does it:

  

After all that is done, it's fine. The problem I'm having is deleting the
folder in an FTP client. Whenever I go to delete it, it says it cannot
delete desc.txt because permission is denied. Is there any way to make it so
it can be deleted? Please help and reply soon. Thanks!

Thank you,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.
Lead Programmer/Webmaster
WiredPHP (http://php.melchior.us)




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



RE: [PHP] Debugging a Session Problem

2003-07-25 Thread Lee Stewart
At 11:55 AM 7/25/2003, you wrote:
If you are relying on cookies to transmit the session ID, make sure you have
session cookies enabled in your browser. Also check that you don't have an
.htacess file in your directory that is overriding the register_globals
setting. Turn your error_reporting up to E_ALL and see if PHP has anything
to say to you.
Yes, cookies are enabled in the browser (and the same browser works with 
the application on the old system).  And no .htaccess files.

When I set error_reporting to E_ALL I do get:
Notice: Undefined variable: test in 
/srv/www/htdocs/etrak/page2.php on line 3
which is the reference to $test in
echo "test is $test";
because $test was to have been a session variable, but wasn't 
passed.   Other than that, no errors.

CPT John W. Holmes wrote:
Seem to remember something about starting a session and then redirecting
with header causing trouble. Try using session_write_close() before you
redirect.
I also tried adding the session_write_close() with no change...

Each time I get a new session file in /tmp, but all are zero length...
ls -l /tmp
drwxrwxrwt6 root root  592 Jul 25 12:48 .
drwxr-xr-x   18 root root  408 Jul 25 12:47 ..
-rw---1 wwwrun   nogroup 0 Jul 25 12:49 
sess_39e04150efb3de58764ce04dae572401
-rw---1 wwwrun   nogroup 0 Jul 25 11:57 
sess_4d9573209bf3688c380d33c94f64be47
-rw---1 wwwrun   nogroup 0 Jul 17 16:55 
sess_5160b002714849a598a8a1e62a78a2eb
-rw---1 wwwrun   nogroup 0 Jul 20 08:36 
sess_7a053a0dd515170e6d0ace739860b71f
-rw---1 wwwrun   nogroup 0 Jul 25 11:55 
sess_903ef4579ee2f596981aad08efd3bc9d

Thanks for any debugging suggestions...
Lee
--
Lee Stewart, Senior SE
Sytek Services, a Division of DSG
(719) 566-0188 , Fax (719) 566-0655
[EMAIL PROTECTED]
www.sytek-services.com
www.dsgroup.com 

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


[PHP] Re: XML handlers in classes

2003-07-25 Thread Greg Beaver
 Hi Robert,

Yes there is a very stupid reason: no one has written any.

Go to

http://phpdorks.net/docs/api/pear/HTTP/HTTP_Request.html
http://phpdorks.net/docs/api/pear/PEAR/XML_Parser.html
for documentation generated from the source by phpDocumentor

Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
Robert Fitzpatrick wrote:
Use xml_set_object, and away you go.  Perhaps you would benefit from 
using PEAR's XML_Parser or XML_Transformer, or even PEAR's 
HTTP_Request 
class.

http://php.net/xml_set_object
http://pear.php.net/xml_parser http://pear.php.net/xml_transformer
http://pear.php.net/http_request
Thanks for the tip. Is there any reason why I can't find docs for
xml_parser or http_request on the PEAR site?
--
Robert



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


RE: [PHP] Odd escape code behavior

2003-07-25 Thread Chris W. Parker
Meeta Bhaduri 
on Friday, July 25, 2003 12:33 PM said:

> Correct php code would be :
> /mypath/my.gif
> Works only if I remove the ">" :
>  
> Can someone point out where I'm goofing up?

Do this instead:



> Also, I'm not on this list, so I'd appreciate replies
> to my email address mg_bhaduri(at)yahoo(dot)com.

Most people will do this anyway.


hth,
Chris.

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



[PHP] Permission Denied (in FTP)

2003-07-25 Thread Stephen
Hello,

I'm having some slight issues. I have a script which creates a directory and then 
copies a blank file into it 4 times each with different names. Here's the code which 
does it:

  

After all that is done, it's fine. The problem I'm having is deleting the folder in an 
FTP client. Whenever I go to delete it, it says it cannot delete desc.txt because 
permission is denied. Is there any way to make it so it can be deleted? Please help 
and reply soon. Thanks!

Thank you,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.
Lead Programmer/Webmaster
WiredPHP (http://php.melchior.us)



[PHP] RE: XML handlers in classes

2003-07-25 Thread Robert Fitzpatrick
> Use xml_set_object, and away you go.  Perhaps you would benefit from 
> using PEAR's XML_Parser or XML_Transformer, or even PEAR's 
> HTTP_Request 
> class.
> 
http://php.net/xml_set_object
http://pear.php.net/xml_parser http://pear.php.net/xml_transformer
http://pear.php.net/http_request

Thanks for the tip. Is there any reason why I can't find docs for
xml_parser or http_request on the PEAR site?

--
Robert



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



[PHP] Odd escape code behavior

2003-07-25 Thread Meeta Bhaduri
Hi,

I've recently started looking into some PHP code, so please
bear with me if I sound less than a novice...
I have a html file with php code which works only if I
remove the ">" from the ending escape sequence. For example,
Correct php code would be :
/mypath/my.gif
Works only if I remove the ">" :
http://sitebuilder.yahoo.com

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



Re: [PHP] XML handlers in classes

2003-07-25 Thread Marek Kilimajer
If I remember well you can pass an array with object as the first 
element, function name as second:

xml_set_element_handler($xml_parser, 
array($this,'startElement'),array($this,'endElement'));

Robert Fitzpatrick wrote:

I have a class that receives an XML response from a HTTP request and I am
trying to parse the XML after receiving it. The problem I'm having is the
error when trying to use xml set handlers, such as
'xml_set_element_handler'. It seems the class is having trouble seeing the
handler functions. For instance, if I set this:
  xml_set_element_handler($xml_parser, 'startElement','endElement');

Then I receive the error 'Unable to call handler startElement()', I tried to
put $this-> in front of the names of the functions, but same thing. Can
someone show me how to use these handlers in a class?
--
Robert




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


Re: [PHP] Freeze Pane

2003-07-25 Thread Jason Martyn
Thanks Rob.

Your idea on the div tag works perfect. Definitely the preferable
alternative to javascript..

Jay

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



[PHP] Re: Link acting as a submit button

2003-07-25 Thread daemorhedron
Another option might be to use the heredoc syntax, but having php echo your
html is not the most effecient. Just FYI.

http://ca.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc


"Matt Palermo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am trying to create a submit button out of a hyperlink using the
> following
> code:
>
> (this is in a file called index.html)
> this
> page
>
>
> 
> 
> 
>
> This works fine as an html document, however, when I try to echo the
> same code
> out in a PHP page, it gives me javascript errors.  I am using the
> following to
> echo it out in PHP:
>
> echo "
> this
> page
>
>
> 
> 
> 
> ";
>
> This displays the link fine for the submit hyperlink, but it gives the
> javascript error:
>
> Error:  Object doesn't support this property or method.
> Code:  0
>
> Like I said before, this code works perfectly fine if I have it an html
> document.
>
> Anyone got any ideas?
>
> Thanks,
> Matt
>
>
>
>
>



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



Re: [PHP] file_put_contents()?

2003-07-25 Thread CPT John W. Holmes
> Another stupid newbie question...(btw, is there a list more geared towards
> the newbies?)

Yes, it's called the manual. 

> Is the file_put_contents() function not available in PHP 4.3.2?

Seriously: www.php.net/file_put_contents

---John Holmes...

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



Re: [PHP] Link acting as a submit button

2003-07-25 Thread Jim Lucas
Depends, are you trying access the form from a different frame?

Jim Lucas
- Original Message -
From: "Matt Palermo" <[EMAIL PROTECTED]>
To: "Jim Lucas" <[EMAIL PROTECTED]>; "Matt Palermo" <[EMAIL PROTECTED]>;
"php-general" <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 4:30 AM
Subject: RE: [PHP] Link acting as a submit button


> I just remembered (I'm not sure if it makes a difference) that I am using
> frames on this page.  Does this matter at all?  Thanks.
>
> Matt
>
>
>
> >= Original Message From Matt Palermo <[EMAIL PROTECTED]> =
> >Fixing the javascript that you specified still gave me the same
> >errors...  Got any more suggestions?
> >
> >Thanks for your help,
> >
> >Matt
> >
> >-Original Message-
> >From: Jim Lucas [mailto:[EMAIL PROTECTED]
> >Sent: Thursday, July 24, 2003 6:40 PM
> >To: Matt Palermo
> >Subject: Re: [PHP] Link acting as a submit button
> >
> >Your javascript is wrong.
> >
> >change this
> >document.forms[0].action = where;
> >to this
> >document.forms[0].action.value = where;
> >
> >Jim Lucas
> >
> >- Original Message -
> >From: "Matt Palermo" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Thursday, July 24, 2003 3:35 PM
> >Subject: [PHP] Link acting as a submit button
> >
> >
> >> I am trying to create a submit button out of a hyperlink using the
> >> following
> >> code:
> >>
> >> (this is in a file called index.html)
> >> this
> >> page
> >>
> >>
> >> 
> >> 
> >> 
> >>
> >> This works fine as an html document, however, when I try to echo the
> >> same code
> >> out in a PHP page, it gives me javascript errors.  I am using the
> >> following to
> >> echo it out in PHP:
> >>
> >> echo "
> >> this
> >> page
> >>
> >>
> >> 
> >> 
> >> 
> >> ";
> >>
> >> This displays the link fine for the submit hyperlink, but it gives the
> >
> >> javascript error:
> >>
> >> Error:  Object doesn't support this property or method.
> >> Code:  0
> >>
> >> Like I said before, this code works perfectly fine if I have it an
> >html
> >> document.
> >>
> >> Anyone got any ideas?
> >>
> >> Thanks,
> >> Matt
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >--
> >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] PHP should know my data!

2003-07-25 Thread Cesar Cordovez
And he signs "IT Professional" and he wants to go back to COBOL!

LOL

Cesar

John Manko wrote:
I just wrote a web app, but I'm completely disgusted with PHP.  The 
application works great, but PHP is not smart enough to know what data 
belongs in my database.  Really, I have to enter the stuff in myself.  I 
[MORE STUFF DELETED]

John Manko
IT Professional






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


Re: [PHP] Debugging a Session Problem

2003-07-25 Thread Chris Shiflett
--- "CPT John W. Holmes" <[EMAIL PROTECTED]> wrote:
> Seem to remember something about starting a session and then
> redirecting with header causing trouble.

Yeah, I think you're right, and I think that was with IIS. This archive might
be helpful:

http://marc.theaimsgroup.com/?l=php-general&m=102929828515647&w=2

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] mssql_execute problems...

2003-07-25 Thread T. Rader
Hey,

System:  RH9, Apache 1.3.27, PHP 4.3.2, FreeTDS 0.61 connecting to a Win2K
Server, MSSQL Server 2K

Problem: mssql_execute hangs when run.  The script just never comes back.
The code is as follows:
$macn = mssql_connect("SERVER", "UID", "PWD");
mssql_select_db("DB");
$stmt = mssql_init("dbo.Grade2_GET", $macn);
$result = mssql_execute($stmt);

I have compiled PHP with the --with-mssql option so it does find the
functions.  Also, the Stored Proc will run just fine if executed via
mssql_query().  But, I have some stored procedures that have output
parameters and thus I need to use mssql_execute().  I have searched rather
extensively on the 'net, and have seen a couple of posts about people saying
that it works correctly for them, but I am unable to get it to work.  I have
even gone as far as to try the nightly build of FreeTDS (0.62) just to see.
Also, my env for TDSVER = 7.0 per documentation

Does anyone have any ideas?  I am currently stumped and cannot seem to find
any answers via research...

TIA,
Tom




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



[PHP] Re: XML handlers in classes

2003-07-25 Thread Greg Beaver
Hi,

Use xml_set_object, and away you go.  Perhaps you would benefit from 
using PEAR's XML_Parser or XML_Transformer, or even PEAR's HTTP_Request 
class.

http://php.net/xml_set_object
http://pear.php.net/xml_parser
http://pear.php.net/xml_transformer
http://pear.php.net/http_request
Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
Robert Fitzpatrick wrote:
I have a class that receives an XML response from a HTTP request and I am
trying to parse the XML after receiving it. The problem I'm having is the
error when trying to use xml set handlers, such as
'xml_set_element_handler'. It seems the class is having trouble seeing the
handler functions. For instance, if I set this:
  xml_set_element_handler($xml_parser, 'startElement','endElement');

Then I receive the error 'Unable to call handler startElement()', I tried to
put $this-> in front of the names of the functions, but same thing. Can
someone show me how to use these handlers in a class?
--
Robert



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


[PHP] file_put_contents()?

2003-07-25 Thread Jonas Thorell
Another stupid newbie question...(btw, is there a list more geared towards
the newbies?)

Is the file_put_contents() function not available in PHP 4.3.2?

The reason I ask is that I get this error when I try to use it:

Fatal error: Call to undefined function: file_put_contents() 
File_get_contents work though.

Or maybe I am using it wrong?

This is how I try to do it:

$handle=file_put_contents($filename,$fil);

With $fil filled with what I want in the file named $filename (both
$fil and $filename are filled with the appropiate content).

---
"... and pray that there's intelligent life somewhere out in space, because
there's bugger all down here on Earth!" - Eric Idle - the Meaning of Life
---
/Jonas

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14
 


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



[PHP] PHP Email use alternate SMTP

2003-07-25 Thread Tom Vogel
Hi, i'm trying to set up an email form on my website. When I originally ran
the server from windows I could simply set SMTP = mailhost.ucalgary.ca and
it would work. After moving the server to Mac OS X, I can't get it to work.

I've read a bunch of FAQ's but they all seem to insist that I set up my own
mail server using sendmail. All I need to do is send however, and I would
prefer to do that through the network mail servers.

It looks like sendmail sends out to 0.0.0.0 looking for an smtp server, but
on the bio.ucalgary.ca domain that I am on, there is no mail server.

Getting to the point (pardon my deranged yabbering...), all I need to do is
send messages through mailhost.ucalgary.ca from my server
groningen.bio.ucalgary.ca under OS X.2.

Thanks



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



Re: [PHP] Debugging a Session Problem

2003-07-25 Thread CPT John W. Holmes
From: "Lee Stewart" <[EMAIL PROTECTED]>
> I'm moving an application that I'm in the trying to move to a new
> platform.   It was running fine on an older Linux platform with PHP
> 4.0.3 and Apache 1.3.14.  The new platform is also Linux, with PHP 4.2.2
> and Apache 1.2.26 -- with register_globals on.  (I just upgraded it from
> 4.2.2.36 to 4.2.2.69 which is the latest rpm on SuSE's site, with no
> change in the problem.)
>
> The symptom is that when I attempt to save a session variable, it
> creates the session file in /tmp, but with a zero length - no variable
> names or values stored.  (/tmp is globally read/write)  This happens not
> only with the application I'm moving, but also with the "world's
> simplest global test pages" below.
>
> [page1.php]
>  session_start();
> session_register('test');
> $test='foobar';
> header('Location: page2.php');
> ?>

Seem to remember something about starting a session and then redirecting
with header causing trouble. Try using session_write_close() before you
redirect.

---John Holmes...


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



Re: [PHP] Rewrite and tags.

2003-07-25 Thread CPT John W. Holmes
> How can I easiest rewrite A and IMG tags? I'm fetching a page with
> fsockopen() and I need to rewrite these tags before sending it on to a
user.
>
> My own theory is that it's made with Regular Expressions. I just don't
> know these myself.

If you're writing one of those "anonymous" browsing programs where
everything is requested through PHP and shown on your site with the links
rewritten, there's already one written on phpclasses.org. See how they do
it.

---John Holmes...


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



RE: [PHP] Debugging a Session Problem

2003-07-25 Thread Johnson, Kirk
> I'm moving an application that I'm in the trying to move to a new 
> platform.   It was running fine on an older Linux platform with PHP 
> 4.0.3 and Apache 1.3.14.  The new platform is also Linux, 
> with PHP 4.2.2 
> and Apache 1.2.26 -- with register_globals on.  (I just 
> upgraded it from 
> 4.2.2.36 to 4.2.2.69 which is the latest rpm on SuSE's site, with no 
> change in the problem.)
> 
> The symptom is that when I attempt to save a session variable, it 
> creates the session file in /tmp, but with a zero length - no 
> variable 
> names or values stored.

If you are relying on cookies to transmit the session ID, make sure you have
session cookies enabled in your browser. Also check that you don't have an
.htacess file in your directory that is overriding the register_globals
setting. Turn your error_reporting up to E_ALL and see if PHP has anything
to say to you.

Kirk

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



[PHP] XML handlers in classes

2003-07-25 Thread Robert Fitzpatrick
I have a class that receives an XML response from a HTTP request and I am
trying to parse the XML after receiving it. The problem I'm having is the
error when trying to use xml set handlers, such as
'xml_set_element_handler'. It seems the class is having trouble seeing the
handler functions. For instance, if I set this:

  xml_set_element_handler($xml_parser, 'startElement','endElement');

Then I receive the error 'Unable to call handler startElement()', I tried to
put $this-> in front of the names of the functions, but same thing. Can
someone show me how to use these handlers in a class?

--
Robert



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



[PHP] Rewrite and tags.

2003-07-25 Thread Simon Fredriksson
How can I easiest rewrite A and IMG tags? I'm fetching a page with 
fsockopen() and I need to rewrite these tags before sending it on to a user.

My own theory is that it's made with Regular Expressions. I just don't 
know these myself.

Thanks.

//Laban

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


[PHP] Debugging a Session Problem

2003-07-25 Thread Lee Stewart
I'm moving an application that I'm in the trying to move to a new 
platform.   It was running fine on an older Linux platform with PHP 
4.0.3 and Apache 1.3.14.  The new platform is also Linux, with PHP 4.2.2 
and Apache 1.2.26 -- with register_globals on.  (I just upgraded it from 
4.2.2.36 to 4.2.2.69 which is the latest rpm on SuSE's site, with no 
change in the problem.)

The symptom is that when I attempt to save a session variable, it 
creates the session file in /tmp, but with a zero length - no variable 
names or values stored.  (/tmp is globally read/write)  This happens not 
only with the application I'm moving, but also with the "world's 
simplest global test pages" below.

[page1.php]

[page2.php]
";
?>
You can try it yourself at http://4.43.81.92/page1.php and also see 
PHPinfo at http://4.43.81.92/phpinfo.php

Because no one else seems to have this problem, I assume it's something 
on my system, or in the way things are set up, as opposed to a PHP code 
problem.   What I'm looking for is any hints or tips of how to begin 
debugging it and finding how come it will create the session files, but 
leave them with zero length and no information...

Any suggestions would be appreciated...
Lee Stewart
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Detecting If A Variable Arrives At A Page From A Get Or A Post...

2003-07-25 Thread Burhan Khalid
On Thursday, July 24, 2003, 10:47:08 PM, anachronism wrote:

amc> Quick question...

amc> I was wondering if there is a way to detect if any given variable came in to
amc> a page via post, or a get from a form.

if ($_POST['varname']) { came from POST }
if ($_GET['varname'])  { came from GET  }

etc.

Unless you already knew that and wanted something specific.

-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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



Re: [PHP] mysqldump

2003-07-25 Thread Pete James
Sorry to be a stickler... but _technically_ the backtick is shorthand 
for shell_exec().  exec and passthru are a little different.

Mike Migurski wrote, On 2003/Jul/25 11:12 AM:
Thanks for the replies guys but the main reason I'm doing this is
because most times I don't have access to the servers, or not enough
preveleges to install myadmin or any other tools. I wish we had our own
server but I'm trying for a solution where you can't upload any tools and
cannot access system commands.


Curt's suggestion does not require command-line access - the backtick
operator is a shorthand for exec() or passthru(), and is a language
construct of PHP. So yeah, don't reinvent the wheel.
http://php.net/manual/en/language.operators.execution.php

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html



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


RE: [PHP] Detecting If A Variable Arrives At A Page From A Get Or A Post...

2003-07-25 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Thursday, July 24, 2003 12:47 PM said:

> I was wondering if there is a way to detect if any given variable
> came in to a page via post, or a get from a form.

if(empty($_GET['var']))
{
if(empty($_POST['var']))
echo "variable empty";
else
echo "came in on \$_POST";
}
else
echo "came in on \$_GET";


That should give you a hint.



chris.

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



[PHP] Detecting If A Variable Arrives At A Page From A Get Or A Post...

2003-07-25 Thread anachronism
Quick question...

I was wondering if there is a way to detect if any given variable came in to
a page via post, or a get from a form.

Any help would be appreciated.

Thanks,
Dennis



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



Re: [PHP] How Do I Change A Number to Percentage

2003-07-25 Thread Marek Kilimajer
*=100 ?

Joe Harman wrote:

Hey, hope all are doing fine. can someone help me be showing me how
to change the following numbers to represent percentages
 
0.92857142857143
0.071428571428571
1.0
 
Thanks
Joe Harman

http://www.HarmanMedia.com

So we went to Atari and said, `Hey, we've got this amazing thing, even
built with some of your parts, and what do you think about funding us?
Or we'll give it to you. We just want to do it. Pay our salary, we'll
come work for you.' And they said, `No.' So then we went to
Hewlett-Packard, and they said, `Hey, we don't need you. You haven't got
through college yet.' - Steve Jobs, founder of Apple Computer Inc. on
attempts to get Atari and H-P interested in his personal computer. 
 



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


RE: [PHP] How Do I Change A Number to Percentage

2003-07-25 Thread Van Andel, Robbert
Multiple the numbers by 100.

Robbert van Andel 



-Original Message-
From: Joe Harman [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2003 10:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How Do I Change A Number to Percentage


Hey, hope all are doing fine. can someone help me be showing me how
to change the following numbers to represent percentages
 
0.92857142857143
0.071428571428571
1.0
 
Thanks
Joe Harman

http://www.HarmanMedia.com

So we went to Atari and said, `Hey, we've got this amazing thing, even
built with some of your parts, and what do you think about funding us?
Or we'll give it to you. We just want to do it. Pay our salary, we'll
come work for you.' And they said, `No.' So then we went to
Hewlett-Packard, and they said, `Hey, we don't need you. You haven't got
through college yet.' - Steve Jobs, founder of Apple Computer Inc. on
attempts to get Atari and H-P interested in his personal computer. 
 

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



Re: [PHP] incrementing string value

2003-07-25 Thread Marek Kilimajer
JavaScript has arrays too. I'm sure you will find it easier to work with 
them.

var a=new Array();

a[]="";

Jeremy wrote: writing some client side javascript with some dynamic php, and I need to be able to print a dynamic number of variables to the javascript. I need to print: var a=""; var b=""; ...etc. Is there a way to increment a php $var much like $var++ would work? Jeremy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Are left joins more efficient?

2003-07-25 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Monday, August 25, 2003 9:59 AM said:

> At the moment, all queries on the website follow the same format when
> joining tables:
> SELECT * FROM table1,table2 WHERE table1.id=table2.id;
> 
> My question is, would this format be more efficient?
> SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id;

I know this isn't really the answer you were looking for but the best
way to determine this is to create a test page using the product sql
queries and time them. Put them in a loop of maybe 100 iterations and
see how long it takes to execute the two different queries.

Start Timer
For(100 times)
{
Execute my original query
}
Stop Timer

echo Stop Timer minus Start Timer

Start Timer
For(100 times)
{
Execute my new query
}

echo Stop Timer minus Start Timer

That will give you some good info.

Also I've been told that you should never use SELECT *. I've been told
that this causes extra overhead on the db because it has to first query
the table to figure out what columns are in the table and THEN select
them. It's faster to list all the fields, even if you want to select all
of them.

In fact it might be worth your while to try four different tests.

1. Original Query

2. New Query

3. Original Query with Fields Listed

4. New Query with Fields Listed


Let us know what happens.


Chris.

p.s. In case you don't know, look into the microtime() function for
examples of how to time your scripts.

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



RE: [PHP] mysqldump

2003-07-25 Thread Mike Migurski
>Thanks for the replies guys but the main reason I'm doing this is
>because most times I don't have access to the servers, or not enough
>preveleges to install myadmin or any other tools. I wish we had our own
>server but I'm trying for a solution where you can't upload any tools and
>cannot access system commands.

Curt's suggestion does not require command-line access - the backtick
operator is a shorthand for exec() or passthru(), and is a language
construct of PHP. So yeah, don't reinvent the wheel.

http://php.net/manual/en/language.operators.execution.php

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html


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



Re: [PHP] Are left joins more efficient?

2003-07-25 Thread Pete James
THese are very different things, generally.  The first join is an INNER 
join.  It pulls all records that have the matching ids.  The left join 
is an OUTER join.  It pulls ALL records from table1, and any matching 
records from table2.   This is useful if you want customer and address 
info, but want all customers, regardless of whether they have addresses 
or not.

They are very different.

If you are actually meaning to ask about whether this

SELECT * FROM table1,table2 WHERE table1.id=table2.id;

is better or worse than (note the lack of LEFT)

SELECT * FROM table1 JOIN table2 ON table1.id=table2.id;

then that is dependent on your database.  I can't comment on MySQL, but 
PostgreSQL, for instance, will usually optimize the second query better. 
 But it is highly dependent on what you're doing and where you're doing it.

HTH.
Pete.
[EMAIL PROTECTED] wrote, On 2003/Aug/25 10:59 AM:
Hello,

I program for a website that gets massive loads of traffic. Optimisation has
become an important issue lately.
At the moment, all queries on the website follow the same format when
joining tables:
SELECT * FROM table1,table2 WHERE table1.id=table2.id;
My question is, would this format be more efficient?
SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id;
Over the last couple of years I have read and heard two different answers.
Years ago it was said that doing Left Joins are faster and more efficient.
But with recent updates to MySQL I have read that both queries are broken
down and optimised the same way by MySQL.
Any thoughts? I havn't come across any comparisons on the web, so any
answers would be appreciated.
(couldn't find any mysql specific groups so i'm posting in the next best
thing!)
Thanks

-Dennis







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


[PHP] How Do I Change A Number to Percentage

2003-07-25 Thread Joe Harman
Hey, hope all are doing fine. can someone help me be showing me how
to change the following numbers to represent percentages
 
0.92857142857143
0.071428571428571
1.0
 
Thanks
Joe Harman

http://www.HarmanMedia.com

So we went to Atari and said, `Hey, we've got this amazing thing, even
built with some of your parts, and what do you think about funding us?
Or we'll give it to you. We just want to do it. Pay our salary, we'll
come work for you.' And they said, `No.' So then we went to
Hewlett-Packard, and they said, `Hey, we don't need you. You haven't got
through college yet.' - Steve Jobs, founder of Apple Computer Inc. on
attempts to get Atari and H-P interested in his personal computer. 
 


[PHP] Are left joins more efficient?

2003-07-25 Thread anachronism
Hello,

I program for a website that gets massive loads of traffic. Optimisation has
become an important issue lately.

At the moment, all queries on the website follow the same format when
joining tables:
SELECT * FROM table1,table2 WHERE table1.id=table2.id;

My question is, would this format be more efficient?
SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id;

Over the last couple of years I have read and heard two different answers.
Years ago it was said that doing Left Joins are faster and more efficient.
But with recent updates to MySQL I have read that both queries are broken
down and optimised the same way by MySQL.

Any thoughts? I havn't come across any comparisons on the web, so any
answers would be appreciated.

(couldn't find any mysql specific groups so i'm posting in the next best
thing!)

Thanks

-Dennis





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



Re: [PHP] incrementing string value

2003-07-25 Thread Curt Zirzow
* Thus wrote Jeremy ([EMAIL PROTECTED]):
> let me make sure I understand...
> 
> $var = 'a';
> $var++
> print($var);
> 
> would print "b" to the screen?

um.. ignore my post ealier.. yes it does print 'b'

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] incrementing string value

2003-07-25 Thread Curt Zirzow
* Thus wrote Jeremy ([EMAIL PROTECTED]):
> writing some client side javascript with some dynamic php, and I need to be
> able to print a dynamic number of variables to the javascript.
> 
> I need to print:
> var a="";
> var b="";
> ...etc.
> 
> Is there a way to increment a php $var much like $var++ would work?

If I understand this right you want to set a php $var to 'a' then
increment that so it becomes 'b', 'c', 'd', etc..

thus..
$var = ord('a');
while ($var <= ord('z') ) {
  echo chr($var) , '="";', "\n";
  $var++;
}
 
HTH,

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] incrementing string value

2003-07-25 Thread Jeremy
let me make sure I understand...

$var = 'a';
$var++
print($var);

would print "b" to the screen?

Jeremy

"Carl Furst" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Yep that should work as does $var--
>
>
> -Original Message-
> From: Jeremy [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 25, 2003 12:28 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] incrementing string value
>
> writing some client side javascript with some dynamic php, and I need to
be
> able to print a dynamic number of variables to the javascript.
>
> I need to print:
> var a="";
> var b="";
> ...etc.
>
> Is there a way to increment a php $var much like $var++ would work?
>
> Jeremy
>
>
>
> --
> 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] default_charset: problem

2003-07-25 Thread Richard Gennaro
I've got a problem with settings of default_charset: I'd like to view
correctly both special chars (àèìòù...) and htmlentitities (à
è ...) 
I got my .htaccess file with the following line: 
php_value default_charset ISO-8859-1 
In this way it displays correctly htmlentities but not special chars, 
Instead, with
php_value default_charset UTF-8 it displays correctly special chars but
not htmlentities

Any suggest?

RICHARD :-D
http://www.jia.it
http://programmazione.risorse.com
[EMAIL PROTECTED] 
[EMAIL PROTECTED]
[EMAIL PROTECTED]
ICQ: 130902854

RICHARD :-D
http://programmazione.risorse.com
[EMAIL PROTECTED] 
[EMAIL PROTECTED]
[EMAIL PROTECTED]
ICQ: 130902854


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



Re: [PHP] create pop account via fsockopen...

2003-07-25 Thread Marek Kilimajer


Brian McGarvie wrote:

All,

I'm having trouble creating an pop account usaign fsockopen(), here is whaty
I have... is connects ok but does not seem to execite the GET.
   $fp = fsockopen ($host, 2082,$errno,$errstr);
if (!$fp) {
 echo "$errstr ($errno)\n";
 } else {
$authstr = "$cpaneluser:$cpanelpass";
$pass = base64_encode($authstr);
$in = "GET
/frontend/$cpaneltheme/mail/doaddpop.html?email=$newuser&domain=$domain&pass
word=$mpassword"a=$quota\r\n HTTP/1.0\r\nAuthorization: Basic $pass\r\n
";
GET, request uri and protocol must be on single line.

fputs($fp, $in);
fclose ( $fp );
echo "ACCOUNT CREATED";
  }




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


RE: [PHP] mysqldump

2003-07-25 Thread Marios Adamantopoulos
 Thanks for the replies guys but the main reason I'm doing this is because
most times I don't have access to the servers, or not enough preveleges to
install myadmin or any other tools. I wish we had our own server but I'm
trying for a solution where you can't upload any tools and cannot access
system commands.
 
-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED] 
Sent: 25 July 2003 16:54
To: [EMAIL PROTECTED]

I agree with Curt, why reinvent the wheel. I mean even if you are like me
and cannot access the command-line on your web server (which really really
sucks) then there are still other tools that can do this very same thing. If
you just want to click on a link and backup the db why not use the load data
infile (of course this does not backup the database structure just the data)
http://www.mysql.com/doc/en/LOAD_DATA.html. Or why not just get phpMyAdmin
and upload it to your server. It already has these features plus many
others, and of course the best part is it is open source
http://sourceforge.net/projects/phpmyadmin/. So why take the time of
reinventing the wheel?
Of course this is just my dumb opinion...so you can always take it or leave
it.
David



-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2003 10:33 AM
To: '[EMAIL PROTECTED]'
Subject: Re: [PHP] mysqldump


* Thus wrote Marios Adamantopoulos ([EMAIL PROTECTED]):
> This is an attempt to create an backup script for my online databases.
There
> are few things to sort out and the coding is not the most effiecient 
> out there yet!!!
>
> I just wanted to check on what you guys think, am I going the right 
> way,
is
> there anything I should keep in mind?

perhaps something like  would be a whole lot easier:
`mysqldump [options] db tables`;

My general policy is don't revent the wheel unless it isn't round.

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

--
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] Sending POST-data

2003-07-25 Thread John Hicks
Simon--

Why not follow the KISS approach? Generate the GET or POST 
directly from the client. No PHP or server-side processing 
needed.

--John


On Friday 25 July 2003 10:09 am, Simon Fredriksson wrote:
> I'm making a search-engine script for my site that
> redirects users to other search engines. Point is that on
> the website, there's a drop-down box with some engines
> and one textfield.
>
> 1. User enter the search query.
> 2. User selects which engine to use.
> 3. User submits.
> 4. PHP scripts checks which engine and redirects the user
> and the query to  the selected engine.
>
> Now the thing is that some of these engines use POST
> method, which makes it a bit harder to redirect the
> query. For those who use GET I just have to use something
> like Header("Location:
> http://somewnine.com/query=$query";);
>
> So, does anyone have any good solution to this problem?
>
> //Simon

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



RE: [PHP] incrementing string value

2003-07-25 Thread Carl Furst
Yep that should work as does $var--


-Original Message-
From: Jeremy [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2003 12:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] incrementing string value

writing some client side javascript with some dynamic php, and I need to be
able to print a dynamic number of variables to the javascript.

I need to print:
var a="";
var b="";
...etc.

Is there a way to increment a php $var much like $var++ would work?

Jeremy



--
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] create pop account via fsockopen...

2003-07-25 Thread Curt Zirzow
* Thus wrote Brian McGarvie ([EMAIL PROTECTED]):
> All,
> 
> I'm having trouble creating an pop account usaign fsockopen(), here is whaty
> I have... is connects ok but does not seem to execite the GET.
> 
>$fp = fsockopen ($host, 2082,$errno,$errstr);
is this the right port?  

> if (!$fp) {
>  echo "$errstr ($errno)\n";
>  } else {
> $authstr = "$cpaneluser:$cpanelpass";
> $pass = base64_encode($authstr);
> $in = "GET
> /frontend/$cpaneltheme/mail/doaddpop.html?email=$newuser&domain=$domain&pass
> word=$mpassword"a=$quota\r\n HTTP/1.0\r\nAuthorization: Basic $pass\r\n
> ";
> fputs($fp, $in);
> fclose ( $fp );
> echo "ACCOUNT CREATED";
Are you sure it was?

Absolutely no error checking, what is the result code back from the
server? did the fputs work? 

>   }

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] incrementing string value

2003-07-25 Thread Jeremy
writing some client side javascript with some dynamic php, and I need to be
able to print a dynamic number of variables to the javascript.

I need to print:
var a="";
var b="";
...etc.

Is there a way to increment a php $var much like $var++ would work?

Jeremy



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



[PHP] create pop account via fsockopen...

2003-07-25 Thread Brian McGarvie
All,

I'm having trouble creating an pop account usaign fsockopen(), here is whaty
I have... is connects ok but does not seem to execite the GET.

   $fp = fsockopen ($host, 2082,$errno,$errstr);
if (!$fp) {
 echo "$errstr ($errno)\n";
 } else {
$authstr = "$cpaneluser:$cpanelpass";
$pass = base64_encode($authstr);
$in = "GET
/frontend/$cpaneltheme/mail/doaddpop.html?email=$newuser&domain=$domain&pass
word=$mpassword"a=$quota\r\n HTTP/1.0\r\nAuthorization: Basic $pass\r\n
";
fputs($fp, $in);
fclose ( $fp );
echo "ACCOUNT CREATED";
  }



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



Re: [PHP] PHP should know my data!

2003-07-25 Thread Bobby Patel
"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Unfortunately I don't think some people "got" the joke. Next thing you
> know their going to complain that PHP should have told them the
> punchline ;)
>
I guess I got burned on that. I honselty though I could save one soul after
not helping out that beuford guy with the longest thread that I have seen
"I'm really getting annoyed with PHP".

I guess this shows that I'm not over 35 though, since I am not that familiar
with COBOL, and took what John said with a grain of salt.

Anyways, it's good to see some light humour after see that extremely long
eye sore of a thread.

Have a good one.
Bobby

> Cheers,
> Rob.
>




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



[PHP] Re: Search question ..

2003-07-25 Thread James Hatridge
Hi all...

On Wednesday 23 July 2003 22:16, CPT John W. Holmes wrote:
> From: "Curt Zirzow" <[EMAIL PROTECTED]>
>
> > preg_match('#\(.*)\#im', $text, $matches):
>
> Also, if there's ever a case where could have
>
> 
> My Title
> 
>
> i.e. things spread over multiple lines, then you'll need:
>
> preg_match('#(.*)#is',$text,$matches);
>
> or, even better (ungreedy)
>
> preg_match('#([^<]+)#i',$text,$matches);

Thanks for you all's help but,

I've tried all three of these lines and get nothing at all, blank. On the 
other hand I tried 

exec( 'grep "\" ' .$tmp, $match);

I was abe to get the titles. The odd thing was that if for example I had a 
list of 8 hits there would be dups in the list. Checking it closer I found 
that grep was stopping at the sub-dir for example two files, same sub-dir:

/~hatridge/bulletin/summer03/file1.php
/~hatridge/bulletin/summer03/file2.php

/~hatridge/bulletin/spring03/file3.php
/~hatridge/bulletin/spring03/file4.php


The returns would be 

title1
title1

title3
title3

Any ideas?

TIA!

JIM


Jim Hatridge
Linux User #88484
-- 
Our country was colonized by the religious, political, economic, and criminal
rejects of every country in the world. We have been carefully breeding insane, 
obsessive, fanatic lunatics with each other for over 400 years, resulting in 
the glorious strain of humanity known as "Americans". You have to expect 
some... peculiarities. 

Read about new German stamps each quarter:
 http:/www.fecundswamp.net/~hatridge/bulletin



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



RE: [PHP] Link acting as a submit button

2003-07-25 Thread Matt Palermo
Okay, I got it to work.  I just put the "id" parameter in the submit button 
tag and it works fine now.  Thanks for all your help guys...

>= Original Message From [EMAIL PROTECTED] =
>Why do you have a submit button and a link to submit the form.  Dont u
>want them to use the submit button for the form?
>
>--
>BigDog
>
>
>
>On Fri, 2003-07-25 at 09:02, Jay Blanchard wrote:
>> [snip]
>> I found out that it works fine without the submit button that I had in
>> there.
>> When I take the submit button out, it works, if I put it back in there I
>> get
>> the error message again.
>>
>> Any ideas?
>> [/snip]
>>
>> Are you naming the submit buttons? Not just value, but id or name? You
>> must keep them seperate.
>>
>> HTH!
>>
>
>
>--
>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] mysqldump

2003-07-25 Thread David Smith
I agree with Curt, why reinvent the wheel. I mean even if you are like me
and cannot access the command-line on your web server (which really really
sucks) then there are still other tools that can do this very same thing. If
you just want to click on a link and backup the db why not use the load data
infile (of course this does not backup the database structure just the data)
http://www.mysql.com/doc/en/LOAD_DATA.html. Or why not just get phpMyAdmin
and upload it to your server. It already has these features plus many
others, and of course the best part is it is open source
http://sourceforge.net/projects/phpmyadmin/. So why take the time of
reinventing the wheel?
Of course this is just my dumb opinion...so you can always take it or leave
it.
David



-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2003 10:33 AM
To: '[EMAIL PROTECTED]'
Subject: Re: [PHP] mysqldump


* Thus wrote Marios Adamantopoulos ([EMAIL PROTECTED]):
> This is an attempt to create an backup script for my online databases.
There
> are few things to sort out and the coding is not the most effiecient out
> there yet!!!
>
> I just wanted to check on what you guys think, am I going the right way,
is
> there anything I should keep in mind?

perhaps something like  would be a whole lot easier:
`mysqldump [options] db tables`;

My general policy is don't revent the wheel unless it isn't round.

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

--
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] Some SESSION Vars not Registering

2003-07-25 Thread Jeff Stillwall
John and Curt;

Thank you both very much for your help (and persistence) in this matter.
Ultimately, I used John's suggestion: creating $_SESSION['userArray'][vars].
It works.  I get to keep my vars named what I want.  In some ways, it's more
elegant than what I was doing in that it compartmentalizes the user vars.




"Curt Zirzow" wrote:

> I was browsing the php.net site and came accross this:
> 
> http://bugs.php.net/bug.php?id=23354
> 
> Note the last comment on the bug. It seems that person has been
> having the same problem as you.

Yeah - seems similar, but not quite the same.  You (Curt) were able to
execute my code without problem.  My code on my servers failed 100% of the
time, whereas the bug in the report only showed up intermittently.

Thank you both again!
-- 
Jeff Stillwall


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



[PHP] Re: Freeze Pane

2003-07-25 Thread Al
Inline frames http://www.cs.tut.fi/~jkorpela/html/iframe.html

Jason Martyn wrote:

This is probably under the category of javascript, however I would like ot know if it is possible to be done with php.

Let's say I have a table that is 30 columns wide and so the entire table doesn't fit on the screen. Is it possible (with php) to "freeze columns" while scrolling across so you don't lose the original 2 columns?

And since it probably isn't, can someone suggest a language that would cover this subject?

Thanks,
Jay
 



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


[PHP] Re: Freeze Pane

2003-07-25 Thread Rob Adams
I recently had to do something similar, except with the first row, instead
of the the first columns.  The way I did it was by creating two different
tables, and putting the second table inside a  tag something like
follows:



Here is an example I found on MS website about how to use this:

http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollTop.htm

Using this you can set how much data you want to display and then let it
create scroll bars right inside your page.  I think it's a little bit
cleaner than frames.

  -- Rob


"Jason Martyn" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
This is probably under the category of javascript, however I would like ot
know if it is possible to be done with php.

Let's say I have a table that is 30 columns wide and so the entire table
doesn't fit on the screen. Is it possible (with php) to "freeze columns"
while scrolling across so you don't lose the original 2 columns?

And since it probably isn't, can someone suggest a language that would cover
this subject?

Thanks,
Jay



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



Re: [PHP] mysqldump

2003-07-25 Thread Curt Zirzow
* Thus wrote Marios Adamantopoulos ([EMAIL PROTECTED]):
> This is an attempt to create an backup script for my online databases. There
> are few things to sort out and the coding is not the most effiecient out
> there yet!!!
> 
> I just wanted to check on what you guys think, am I going the right way, is
> there anything I should keep in mind?

perhaps something like  would be a whole lot easier:
`mysqldump [options] db tables`;

My general policy is don't revent the wheel unless it isn't round.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Include(remote HTML file) doesn't work since upgrade

2003-07-25 Thread Rob Adams
"Police Trainee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Warning: main(http://143.43.222.103/sga)
> [function.main]: failed to create stream: Invalid
> argument in
> /hsphere/local/home/domain/mydomain.com/includesite.php
> on line 2
>
> Warning: main() [function.main]: Failed opening
> 'http://143.43.222.103/sga' for inclusion
> (include_path='.:/usr/local/lib/php') in
> /hsphere/local/home/domain/mydomain.com/includesite.php
> on
> line 2
>


Ok - this is kinda weird, but I got it to work on my machine after getting
the same error.
I tried including a page off a different server and it worked just fine.  So
I started messing around and got the following to work for the page you're
trying to include:

  include('http://wiu.edu/SGA/');

Of course, the graphics don't show...
Don't ask me why that works instead, but it does for me.  Give it a shot.

  -- Rob






>
> > What happens when you try to include it?  Is there
> > an error?
> >
> >
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com



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



  1   2   >