php-general Digest 10 Nov 2006 11:27:01 -0000 Issue 4451

Topics (messages 244453 through 244463):

Re: php.ini
        244453 by: Jürgen Wind

Re: gethostbyname failing?
        244454 by: Henrik Hudson
        244458 by: Chris

Re: Staff log-in
        244455 by: benifactor
        244460 by: Jochem Maas

Re: http_build_query ... argh
        244456 by: Larry Garfield
        244462 by: Jochem Maas
        244463 by: Jochem Maas

PHP, MySQL- Interested?
        244457 by: John Sladek

Read Through PHP Files
        244459 by: Kevin

Re: Spam using email on website
        244461 by: Nisse Engström

Administrivia:

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

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

To post to the list, e-mail:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
PHP is not supposed to look for php.ini in PATH.
(from http://bugs.php.net/bug.php?id=39432)


zerof wrote:
> 
> Alain Roger escreveu:
>> Hi,
>> 
>> everytime i install PHP, my "php.ini" must be installed in "C:\windows\"
>> folder.
>> 
>> How can i do to force system to read "php.ini" file from "C:\PHP\" folder
>> only ?
>> thanks.
>> 
>> Alain
>> 
> ----
> You need to put the c:\php folder in the path of the system.
> 
> Control Panel ---->
> 
> OPEN System ---->
> 
> ----> Tab Advanced ----> Environment Variables ---->
> 
> ----> Select the variable Path ----> Click Edit ---->
> 
> ----> Add at the end, the term: ;C:\php;
> 
> + Click OK, OK, . . . to conclude.
> 
> ex-corde,
> zerof
> http://www.educar.pro.br/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/php.ini-tf2603259.html#a7268994
Sent from the PHP - General mailing list archive at Nabble.com.

--- End Message ---
--- Begin Message ---
Thanks for the input everyone. It seems it Apache itself can't do lookups 
either (ie: Hostnamelookups On  ..doesn't actually do anything..so, going to 
hunt down the issues inside Apache...)

funny thing is I've got a test server with the same exact port versions and 
almost identical config files, so..I don't know...perl scripts and php from 
the CLI work fine..so my actual DNS resolution is working okay..just Apache 
is losing it somewhere...if anyone has some thoughts..let me know :)

On Thursday 09 November 2006 15:27, Henrik Hudson <[EMAIL PROTECTED]> sent a 
missive stating: 
> Hey List-
>
> running: apache 2.2, freebsd 6.2 and php 4.4.4
>
> I've got a wierd issue. I've got a script that does this:
>
> $domain = "www.google.com";
> $ip = gethostbyname($domain);
> echo $ip;
>
> $hostname = gethostbyaddr("72.14.205.99");
> echo $hostname;
>
>
> Using dig, ping, etc... to confirm name resolution is working works fine.
> Running that script from the CLI is fine (ie: php test.php). However, when
> running from the web it doesn't work.
>
> I tried it on a php 5.1.x box and it works fine there.
>
> Thoughts?
>
>
> Henrik
> --
> Henrik Hudson
> [EMAIL PROTECTED]
> ------------------------------
> "God, root, what is difference?" Pitr; UF (http://www.userfriendly.org/)

-- 
Henrik Hudson
[EMAIL PROTECTED]
------------------------------
"God, root, what is difference?" Pitr; UF (http://www.userfriendly.org/)

--- End Message ---
--- Begin Message ---
Henrik Hudson wrote:
Thanks for the input everyone. It seems it Apache itself can't do lookups either (ie: Hostnamelookups On ..doesn't actually do anything..so, going to hunt down the issues inside Apache...)

funny thing is I've got a test server with the same exact port versions and almost identical config files, so..I don't know...perl scripts and php from the CLI work fine..so my actual DNS resolution is working okay..just Apache is losing it somewhere...if anyone has some thoughts..let me know :)

Hostname lookups has *nothing* to do with this issue. It only affects apache.
http://httpd.apache.org/docs/1.3/mod/core.html#hostnamelookups

As someone else mentioned, freebsd has issues with this stuff when it's running inside a chroot'ed environment.

Are you running in a chroot'ed or selinux or anything like that?

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
give us (the list) the website address.
----- Original Message ----- From: "Brynjar Guðnason" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Thursday, November 09, 2006 11:16 AM
Subject: [PHP] Staff log-in


Hi,

I need a little php script. Staff log in by entering username and password
and then the next time they enter their username and password they log out. The script has to take down the time they log in and log out. Then I should
be able to read old log-ins and log-outs.

I unfortunately can't make it myself because I don't have the knowledge, can
anyone of you do this for me? It's for a small non-profit orginisation.

Thanks in advance,
Brynjar Gudnason.


--- End Message ---
--- Begin Message ---
John Nichel wrote:
> Brynjar Guðnason wrote:
>> Why did you bother to answer me ?
> 
> Please send all your replies to the list.
> 
> 1)  You asked if anyone could do this.
> 2)  I gave you my rates.
> 3)  Non-profit companies pay for services.
> 4)  If you didn't want to pay, you should have specified that
>     a)  If you want someone on this list to do it for you out of the
>         goodness of their heart because you *claim* it is for a non-
>         profit organization, then you're going to need to pony up
>         some proof to collaborate your word.
>     b)  The people on this list donate their time to the list to help
>         answer questions.  I think it is safe to say that all of us
>         have bills to pay, and don't want to give our services away
>         for free.  So, try not to get your panties in a knot when we
>         want to be paid for our work.
> 5)  $80.00 is my *reduced* rate.

ah - I was worried you might have been factoring in age-related brain 
depreciation ;-)

> 
>> 2006/11/9, John Nichel <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:
>>
>>     Brynjar Guðnason wrote:
>>      > Hi,
>>      >
>>      > I need a little php script. Staff log in by entering username and
>>     password
>>      > and then the next time they enter their username and password
>>     they log out.
>>      > The script has to take down the time they log in and log out.
>>     Then I should
>>      > be able to read old log-ins and log-outs.
>>      >
>>      > I unfortunately can't make it myself because I don't have the
>>     knowledge,
>>      > can
>>      > anyone of you do this for me? It's for a small non-profit
>>     orginisation.
>>      >
>>
>>     $80.00 an hour.  8 hour minimum.  I am a *for-profit* individual.
>>
> 

--- End Message ---
--- Begin Message ---
On Thursday 09 November 2006 10:22, Jochem Maas wrote:

> apparently http_build_query() has been 'fixed' so that it now
> urlencodes square brackets (and if you have never used square brackets in
> a url pointing a php script then your obviously new here ;-)
>
> this is fine - apart from the fact that I have a rather complex generic
> thingy that not only uses http_build_query() to build actual URLs but
> also to generate the input names of hidden form fields (sometimes
> one needs/wants to place a stack of request arguments as hidden inputs
> instead of as GET parameters of a URL.

Er, wouldn't the better solution be to fix http_build_query to not break when 
handling fairly typical PHP URLs?

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

--- End Message ---
--- Begin Message ---
Larry Garfield wrote:
> On Thursday 09 November 2006 10:22, Jochem Maas wrote:
> 
>> apparently http_build_query() has been 'fixed' so that it now
>> urlencodes square brackets (and if you have never used square brackets in
>> a url pointing a php script then your obviously new here ;-)
>>
>> this is fine - apart from the fact that I have a rather complex generic
>> thingy that not only uses http_build_query() to build actual URLs but
>> also to generate the input names of hidden form fields (sometimes
>> one needs/wants to place a stack of request arguments as hidden inputs
>> instead of as GET parameters of a URL.
> 
> Er, wouldn't the better solution be to fix http_build_query to not break when 
> handling fairly typical PHP URLs?

http_build_query() was fixed (it's a core function btw) - and the problem is 
the fact
that it now correctly encoded square brackets (as per HTTP specs) , the 
urlencoding
makes using the return value of http_build_query() in the name attribute of a
hidden input impossible unless the relevant square brackets are first decoded.

> 

--- End Message ---
--- Begin Message ---
Arpad Ray wrote:
> Jochem Maas wrote:
>> function inputPostQueryUnBorker($s)
>> {
>>         return preg_replace('#(\?|&(?:amp;)?)([^=]*)=#eU',
>>                             "'\\1'.str_replace(array('%5B','%5D'),
>> array('[',']'), '\\2').'='",
>>                             $s);
>> }
>>
>> so how bad is it
> This is a bit more concise. I doubt there'd be a noticable difference in
> speed though:
> 
> return preg_replace('#%5[bd](?=[^&]*=)#ei', 'urldecode("\0")', $s);

nice! - although I had to test your regexp, I can't figure out
exactly what it's doing but it seems to work exactly like mine...

could you explain your regexp - I'd like to replace my version with
your (if for no other reason than that shorter code is easier to read than
longer code!) BUT until I really understand your regexp I'd feel 100% 
comfortable
making the replacement.

kinds regards,
Jochem

ps - sometimes reading regexps is a lot harder than writing them!

> 
> Arpad

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

I'm looking for people that like messing around with PHP and MySql.  I've 
started a project to help myself learn more about PHP, MySql.  The program 
basically takes database infomation (username, password, database name and 
location) as input and then uses that info to create php scripts to handle the 
basic functions of Create, Remove, Update & Display for each table. Basically 1 
script per table in the database.  Also the program builds a little Application 
framework too.   The script function both inside the Application and also stand 
alone.

Keep in mind I am a beginner @ this stuff and this project is in it's beginning 
stages... I'm just looking for feedback.....  I think it rocks but I am Biased
http://www.iobe.net/proj/


Regards,
John Sladek

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

I am using the function fopen to open a word document, loading the contents into a variable and then using a substr_count to count the number of times a certain string is found, this is allowing me to search through the file and say how many times the word appears, I can even use str_replace to highlight certain words. However Microsoft word seems to put a lot of rubbish in the header and footer, I am wondering is it possible to filter this rubbish out to get the exact document.

I also tried using fopen to open a PDF file, but as PDF is handled differently it came up completely different with no words at all, just full of rubbish. Is there anyway I can get this information using a simple fopen?

I am basically trying to create a search engine which can read within files similar to google. The only problem I would have after I have done all this is actually weighting the search results, however I would probably have to create the results first and then finally go through the results to try to weight them.

Does anyone else have any experience in this or could help me out with any of the problems I am having?

Thanks

Kevin

--- End Message ---
--- Begin Message ---
On Tue, 7 Nov 2006 13:14:54 -0600 (CST), "Richard Lynch" wrote:

> The Bad Guys are probably cramming your $subject and $from data with
> an ENTIRE eamil, so your mail() function is, in effect, and Open
> Relay.  (That's very very very bad.)
> 
> Example:
> Normal Input
> $subject = "Hi!";
> 
> Bad Guy Input
> $subject = "Hi!\r\nCc: [EMAIL PROTECTED]@example.com";
> 
> If you do:
> mail($to, $subject, $body);
> 
> then you are letting THEM control the headers of your email, which
> lets them splice in 1000 recipients to their junk.

   Have you actually tried this? I set up a dummy
sendmail program that logs its input to a file,
and it turned out that PHP's mail() function
converts control characters to white space.

   More specifically, it performed the following
conversions (PHP 5.0.2 on Windows 98SE):

  To: and Subject:
  ----------------

  \x00       ->  Terminates string.
  \x01-\x1f  ->  Replaced by \x20.
  \x20-\x7e  ->  Passed through.
  \x7f       ->  Replaced by \x20.
  \x80       ->  Passed through.
  \x81       ->  Replaced by \x20.
  \x82-\x8c  ->  Passed through.
  \x8d       ->  Replaced by \x20.
  \x8e       ->  Passed through.
  \x8f-\x90  ->  Replaced by \x20.
  \x91-\x9c  ->  Passed through.
  \x9d       ->  Replaced by \x20.
  \x9e-\xff  ->  Passed through.

  Body:
  -----
  \x00       ->  Terminates string.
  \x01-\xff  ->  Passed through.


  --nfe

--- End Message ---

Reply via email to