Re: [PHP] Re: include_once vs require_once

2001-08-04 Thread Andrew Sterling Hanenkamp

Perhaps the manual should be made to reflect this since, my 
understanding came from the online version of the manual.

Sterling

Philip Olson wrote:

 Yes, this is essentially true.  Zeev posted this to the list awhile ago,
 see the following :
 
   http://www.faqts.com/knowledge_base/view.phtml/aid/6/
 
 Essentially the difference now is the type of error that's produced, one
 being a warning (include) while the other being FATAL! (require).
 
 Regards,
 Philip
 
 
 On Tue, 31 Jul 2001, CC Zona wrote:
 
 
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Mike Cullerton) wrote:


so the difference is _when_ they happen.

ok, another question then.

if my script includes the line
 require_once($file);

and $file contains the line
 include_once($other_file);

what happens then?

Rasmus has stated before that there is no longer any difference between 
include_once() vs. require_once(), or include() vs. require().  I forget 
which version that became the case, but if you are using a current version 
of PHP the above two lines should produce identical results.

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Regex question

2001-07-31 Thread Andrew Sterling Hanenkamp

You're making your expressions too complicated. To test for just that 
string,

eregi(HTTP/1\.[01] 302, $output)

should work.

Later,
Sterling

Boaz Yahav wrote:

 I'm trying to find if a string exists inside a string. Instead of using
 strstr() twice I want to use eregi() once.
 
 What I want to check is if HTTP/1.1 302 or HTTP/1.0 302 exists in
 some $output.
 
 I'm trying something like : 
 
 eregi([\HTTP/1.\]+[0-1]+[\ 302\],$output)
 eregi([HTTP/1.]+[0-1]+[ 302],$output)
 eregi(HTTP/1.+[0-1]+ 302,$output)
 
 But I must be off cause it doesn't work.
 
 Anyone?
 
 thanks
 
 
 berber
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Sort by bigger count(*)

2001-07-31 Thread Andrew Sterling Hanenkamp

Unless you've used GROUP BY you'll only return one row. I think that 
something like

SELECT x, count(y)
FROM table
GROUP BY y
ORDER BY count(y);

Ought to work.

Later,
Sterling

Elias wrote:

 Hello,
 
 I made a query that uses count(*)
 now how can i get the results sorted following the biggest count(*) result?
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: also window.open(javascript)

2001-07-31 Thread Andrew Sterling Hanenkamp

Javascript occurs on the client side, so the second page you are opening 
will not be passed the file. If you are going to try and pass the file 
like this you could try saving the file to disk temporarily in the first 
PHP script. Then, pass an identifier to the file in the query string of 
window.open() to identify the file's location. (Sending the filename 
itself would probably be imprudent security-wise.) Then, the second 
script can find the file in the temp folder on the server from the 
passed identifier.

Cheers,
Sterling

Eduardo Kokubo wrote:

 I know I sent I message to this list 10 seconds ago, but I have  forgot to ask this, 
it's a different problem. I asked for a file name to upload via html form and tried 
to pass this file to another page using window.open to redirect to a new window (I 
submited first and tried to redirect it from the following page) but it didn't work. 
Can I do anything about this?
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Syntax Error On Line 1

2001-07-31 Thread Andrew Sterling Hanenkamp

Uh...this is just a guess, but could it be the line endings are 
confusing PHP? Perhaps you have DOS formatted files in Unix or Unix 
files in DOS or Mac files in DOS or DOS files in Mac or ...you get the 
idea... That is, in DOS lines are ended by \n\r, in Unix by \n, and in 
Mac by \r. Lacking the correct line endings often leads to confusion for 
parsers.

Cheers,
Sterling

Php Wannabe wrote:

 I recently just started using PHP. I searched this list's archives first, 
 but couldn't find an answer to my question:
 
 Whenever I get a syntax error it's always reported on line 1, even 
 when it's obviously not on line 1. I *never* get an error reported on any 
 other line #.
 
 Any thoughts on this?
 
 Thanks!
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: include_once vs require_once

2001-07-31 Thread Andrew Sterling Hanenkamp

Did you look at the difference between include() and require()? 
Basically, as I understand it, require() and require_once() are replaced 
during parsing--before code execution. And include() and include_once() 
are replaced during code execution. Thus, a required file is always 
imported into the file whereas an included file is only imported if the 
include() statement is executed. The same is true for the _once() 
versions except that the statement evaluates to nothing if the file has 
already been imported by another statement.

Cheers,
Sterling

Mike Cullerton wrote:

 hey folks,
 
 i'm wondering about the difference between include_once and require_once.
 the manual says 
 
   The require_once() statement replaces itself with the specified file
 
   The include_once() statement includes and evaluates the specified file
 
 so, what is the difference? it's almost like one is a copy/paste and the
 other is some kind of read. is there any different behavior we should expect
 in scripts using one method vs another.
 
 my first guess was that require_once wouldn't evaluate the file, but i can
 execute code from within a file using either method.
 
 thanks,
 mike
 
 
  -- mike cullerton
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Teen Hobos having sex? ..no.. but MAYBE

2001-07-30 Thread Andrew Sterling Hanenkamp

Actually, if you use telnet you can write your own headers and say 
you've been refered by whoever you want to say you were refered by and 
then use the script anyway, because you'll just say you came from 
someplace where they have a form. This script is very bad. I submitted 
an update to the archive which adds an additional constraint to it by 
allowing users to only send to certain domains or only certain 
addresses, but I never received word back so I had assumed that the site 
was not very actively maintained.

Any script you write that allows a user to sendmail should ALWAYS CHECK 
THE RECIPIENT to make sure it's not just anyone. I've quit using that 
script in favor of my PHP script that just translates keys given in the 
form into real addresses so that the formmail doesn't even really get 
the ability to send to just anyone.

Sterling

PS - If you or anyone else is interested in the script, I can send it to 
them. (If I get a lot of requests I just post it on my web site since 
Matt's Script Archive never posted my update.)

Thomas Deliduka wrote:

 This is a classic case of someone not having formmail.pl from Matt's Script
 archive locked down.
 
 I found it very interesting that while Matt's Script Archive is setup to
 block you from using someone else's form as a referer to yours to prevent
 the use of your script from another server, he simply allows you through if
 you have no referer at all. And that's how someone used our server several
 times about 6 months ago. If you format a perfect querystring and simply hit
 enter on the browser, you can successfully send many people e-mail through
 formmail.pl if it's not modified to block 'no referer' references.
 
 On 7/26/2001 8:29 PM this was written:
 
 
Below is the result of your feedback form.  It was submitted by
([EMAIL PROTECTED]) on Thursday, July 26, 2001 at 20:29:47
---

: Join for free Today.
Free Memberships. No Credit Cards Needed.
HUGE Celebrity selection from Jennifer Lopez to Britney Spears.
Also Specializing Streaming Video, Live sex shows for every desire!
This isn't one of those crummy scams where you have touse a credit card!
Take a look and you'll see.
a href=aol://2000:http://coverme1.devil.ru;Enter Here/a


BRBRBRBRBRBRBR

You recived this email because you subscribed to a mailing list. If you would
like to be removed from this mailing list please a
href=mailto:[EMAIL PROTECTED];Click Here!/aBRBRBRBRBRBRBR

---


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Classes and sessions

2001-07-24 Thread Andrew Sterling Hanenkamp

I am having some trouble with storing a class in a session variable. 
According to the information in the manual, an object will be serialized 
at the end of each request and then unserialized at the beginning 
automatically. However, with this code:

?php

session_register(objectvar, stringvar);

if(isset($stringvar)) {
echo stringvar is set\n;
} else {
$stringvar = something;
echo stringvar is not set\n;
}

if(isset($objectvar)) {
echo objectvar is set\n;
} else {
$objectvar = new MyObject;
echo objectvar is not set\n;
}

?

For the first page I will get:

stringvar is not set
objectvar is not set

And for each subsequent page:

stringvar is set
objectvar is not set

Is there something wrong with the way my code works? Is this a possible 
bug? I have had this problem with both 4.0.4pl1 (came with RH7.1) and 
with 4.0.6 (compiled myself). I've been struggling with this for 3 or 4 
days now and some help would be much appreciated.

Thanks,
Sterling


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]