php-general Digest 27 Feb 2005 05:10:48 -0000 Issue 3308

Topics (messages 209509 through 209526):

Re: Quoting and $_POST['Name']  problem
        209509 by: John Holmes

http referer
        209510 by: Sebastian
        209525 by: Stan F

Re: source code protection
        209511 by: Joe Wollard
        209516 by: Gustav Wiberg
        209517 by: Guillermo Rauch

Re: getting mac id
        209512 by: Lancer Emotion 16
        209513 by: M. Sokolewicz
        209523 by: Tyler Replogle
        209524 by: Tyler Replogle

Trouble Compiling 4.3.10 on FreeBSD 5.X
        209514 by: Tim Traver

seach engines that don't suck
        209515 by: Colin Olkowski

Re: help with adding
        209518 by: Guillermo Rauch

Re: PHP slowness
        209519 by: Rasmus Lerdorf

file uploads
        209520 by: Jeremy Freedman

Re: HOWTO read PHP source code into a textarea
        209521 by: Tim Burgan
        209526 by: John Holmes

mail() takes a long time to process
        209522 by: Dustin Krysak

Administrivia:

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

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

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message --- zzapper wrote:
Hi,
It's been a long day, but what's wrong here?.

echo $_POST['Location']; # good
echo "<br>";
echo "$_POST['Location']"; # bad nothing appears

If you're going to display an array value within a string, put it in brackets.


echo "my value: {$array['key']}";

This also works:

echo "my value $array[key]";

but it's better to use the brackets so it's clear exactly what variable you are displaying.

--

---John Holmes...

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

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
ok, so i made a file manager and i need to prevent people from linking
directly to files that do not come from another part of the site.

i know i can use http_referer, but i wonder how fool proof it is, i dont
want to spit out errors to a legit user that actually came from a valid page
before trying to access the file url. some people have said http_referer is
not always accurate.

any examples, snips, would be helpful.

--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Sebastian" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, February 26, 2005 8:31 PM
Subject: [PHP] http referer


> ok, so i made a file manager and i need to prevent people from linking
> directly to files that do not come from another part of the site.
>
> i know i can use http_referer, but i wonder how fool proof it is, i dont
> want to spit out errors to a legit user that actually came from a valid
page
> before trying to access the file url. some people have said http_referer
is
> not always accurate.

Never rely on it. It might be not set at all, it's easy to spoof. I would
think about sessions here.

btw this topic has been discussed much, so you probably should STFA.

>
> any examples, snips, would be helpful.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Shabanip,

Zend provides a package for doing just this, but it comes with a price tag starting nigh to $1,000. You can find it here: http://www.zend.com/store/products/zend-encoder.php
They do offer a free evaluation so you can "try before you buy" ;-)


shabanip wrote:

is there any way to protect PHP files source code?
thanks,
Payam Shabanian
shabanip -at- avapajoohesh.com




--- End Message ---
--- Begin Message ---
Hi there!

What's the point of doing that? The PHP-codes are well protected if they are on a well
configured server.


/G
@varupiraten.se

----- Original Message ----- From: "shabanip" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, February 26, 2005 4:43 PM
Subject: [PHP] source code protection



is there any way to protect PHP files source code?
thanks,
Payam Shabanian
shabanip -at- avapajoohesh.com

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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.0 - Release Date: 2005-02-25





-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 266.5.0 - Release Date: 2005-02-25

--- End Message ---
--- Begin Message ---
> Hi there!
> 
> What's the point of doing that? The PHP-codes are well protected if they are
> on a well
> configured server.
Sometimes you want to sell protected code $.$
> 
> /G
> @varupiraten.se

--- End Message ---
--- Begin Message ---
But think that not everbody has a computer in his house,especially in
3rd world countries. Here in Peru and in another countries from
Sudamerica,lot of people play this mmorpgs,like Knigths Online,WoW or
Mu,in lan houses. If you ban the pc, none of the users who will play
at this computer will be able to do it.


On Fri, 25 Feb 2005 15:52:02 -0800, Tyler Replogle <[EMAIL PROTECTED]> wrote:
> Hey,
> 
> I've been on this mailing list for quite a while, but i think this is my
> first question. I'm not sure though.
> 
> Well here goes.
> 
> I'm working at this site that has an MMORPG, a big online game, and we have
> this ban script. it bans the ip for the user and the user acount for an
> amount of time. This doesn't seem to be doing its job because people just
> change there ip and make a new user.
> 
> I know there isn't any full way to ban some one from a site, but i've been
> think and getting the mac id of a computer would work a lot better then ip.
> I'm not sure how to get teh mac id of a computer though. If any of you know
> how to can you please tell me. It doesn't just have to be with use php we
> own the server can we can installl other apps, but many others are on the
> server anyways.
> 
> So how do i get the mac id of a user that is going on to my server?
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
lancer emotion 16

--- End Message ---
--- Begin Message --- you can't get the mac-address from a remote (client) computer via PHP because PHP is server-sided (server). The mac-address isn't part of any sort of standard header the browser sends, thus the server will never see it. And if the server can't see it, then PHP can't see it either. The only way to get it would be to run a local script which would pick it up, and send it over. This however would require something like a JAVA applet / application. The mac address is usually hidden away quite well so people can't get it and start pretending to be someone else. Although the idea is good, it most likely will not be possible (relativly easily)

- tul

Lancer Emotion 16 wrote:
But think that not everbody has a computer in his house,especially in
3rd world countries. Here in Peru and in another countries from
Sudamerica,lot of people play this mmorpgs,like Knigths Online,WoW or
Mu,in lan houses. If you ban the pc, none of the users who will play
at this computer will be able to do it.


On Fri, 25 Feb 2005 15:52:02 -0800, Tyler Replogle <[EMAIL PROTECTED]> wrote:

Hey,

I've been on this mailing list for quite a while, but i think this is my
first question. I'm not sure though.

Well here goes.

I'm working at this site that has an MMORPG, a big online game, and we have
this ban script. it bans the ip for the user and the user acount for an
amount of time. This doesn't seem to be doing its job because people just
change there ip and make a new user.

I know there isn't any full way to ban some one from a site, but i've been
think and getting the mac id of a computer would work a lot better then ip.
I'm not sure how to get teh mac id of a computer though. If any of you know
how to can you please tell me. It doesn't just have to be with use php we
own the server can we can installl other apps, but many others are on the
server anyways.

So how do i get the mac id of a user that is going on to my server?

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






--- End Message ---
--- Begin Message ---
Yeah i thought of that but banning the ip iwon't do any better.

From: Lancer Emotion 16 <[EMAIL PROTECTED]>
Reply-To: Lancer Emotion 16 <[EMAIL PROTECTED]>
To: [email protected]
Subject: Re: [PHP] getting mac id
Date: Sat, 26 Feb 2005 12:59:15 -0500
MIME-Version: 1.0
Received: from lists.php.net ([216.92.131.4]) by mc9-f30.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 26 Feb 2005 09:59:51 -0800
Received: from ([216.92.131.4:29512] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 0D/DF-51537-519B0224 for <[EMAIL PROTECTED]>; Sat, 26 Feb 2005 12:59:49 -0500
Received: (qmail 90336 invoked by uid 1010); 26 Feb 2005 17:59:18 -0000
Received: (qmail 90322 invoked by uid 1010); 26 Feb 2005 17:59:18 -0000
X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8=
Return-Path: <[EMAIL PROTECTED]>
X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
list-help: <mailto:[EMAIL PROTECTED]>
list-unsubscribe: <mailto:[EMAIL PROTECTED]>
list-post: <mailto:[email protected]>
Delivered-To: mailing list [email protected]
Delivered-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
X-Host-Fingerprint: 64.233.170.204 rproxy.gmail.com Linux 2.4/2.6
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;s=beta; d=gmail.com;h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references;b=AUwTxkptdTLMJHMTyly+ctuG3HxXmWK2T+FcbF8tKR+YarWJMth7kEmgiVMwtGIdPGcCMU/Yc7kNGX4rtRjd0PO7dHMYmUmb8lpeshQ9+eI+ACF77+Uw4Ju+m44hEkRvkpP5tQAod4I48Jk5Heq50U10n4Wz4XDd500vwCasYtk=
References: <[EMAIL PROTECTED]><[EMAIL PROTECTED]>
X-OriginalArrivalTime: 26 Feb 2005 18:00:04.0786 (UTC) FILETIME=[FFEE1920:01C51C2C]


But think that not everbody has a computer in his house,especially in
3rd world countries. Here in Peru and in another countries from
Sudamerica,lot of people play this mmorpgs,like Knigths Online,WoW or
Mu,in lan houses. If you ban the pc, none of the users who will play
at this computer will be able to do it.


On Fri, 25 Feb 2005 15:52:02 -0800, Tyler Replogle <[EMAIL PROTECTED]> wrote:
> Hey,
>
> I've been on this mailing list for quite a while, but i think this is my
> first question. I'm not sure though.
>
> Well here goes.
>
> I'm working at this site that has an MMORPG, a big online game, and we have
> this ban script. it bans the ip for the user and the user acount for an
> amount of time. This doesn't seem to be doing its job because people just
> change there ip and make a new user.
>
> I know there isn't any full way to ban some one from a site, but i've been
> think and getting the mac id of a computer would work a lot better then ip.
> I'm not sure how to get teh mac id of a computer though. If any of you know
> how to can you please tell me. It doesn't just have to be with use php we
> own the server can we can installl other apps, but many others are on the
> server anyways.
>
> So how do i get the mac id of a user that is going on to my server?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- lancer emotion 16

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


--- End Message ---
--- Begin Message ---
do you think i could get it with javascript?

From: "M. Sokolewicz" <[EMAIL PROTECTED]>
To: [email protected]
Subject: Re: [PHP] getting mac id
Date: Sat, 26 Feb 2005 21:15:47 +0100
MIME-Version: 1.0
Received: from lists.php.net ([216.92.131.4]) by MC6-F37.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 26 Feb 2005 12:16:54 -0800
Received: from ([216.92.131.4:25405] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 58/43-51537-B19D0224 for <[EMAIL PROTECTED]>; Sat, 26 Feb 2005 15:16:27 -0500
Received: (qmail 13001 invoked by uid 1010); 26 Feb 2005 20:15:39 -0000
Received: (qmail 12988 invoked by uid 1010); 26 Feb 2005 20:15:39 -0000
X-Message-Info: JGTYoYF78jH290JDSHtK0Hwmz4NODmcj7i2AMiICo2M=
Return-Path: <[EMAIL PROTECTED]>
X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
list-help: <mailto:[EMAIL PROTECTED]>
list-unsubscribe: <mailto:[EMAIL PROTECTED]>
list-post: <mailto:[email protected]>
Delivered-To: mailing list [email protected]
Delivered-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050106
X-Accept-Language: en-us, en
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
X-Posted-By: 62.131.2.67
X-OriginalArrivalTime: 26 Feb 2005 20:16:54.0784 (UTC) FILETIME=[1D786000:01C51C40]


you can't get the mac-address from a remote (client) computer via PHP because PHP is server-sided (server). The mac-address isn't part of any sort of standard header the browser sends, thus the server will never see it. And if the server can't see it, then PHP can't see it either. The only way to get it would be to run a local script which would pick it up, and send it over. This however would require something like a JAVA applet / application. The mac address is usually hidden away quite well so people can't get it and start pretending to be someone else. Although the idea is good, it most likely will not be possible (relativly easily)

- tul

Lancer Emotion 16 wrote:
But think that not everbody has a computer in his house,especially in
3rd world countries. Here in Peru and in another countries from
Sudamerica,lot of people play this mmorpgs,like Knigths Online,WoW or
Mu,in lan houses. If you ban the pc, none of the users who will play
at this computer will be able to do it.


On Fri, 25 Feb 2005 15:52:02 -0800, Tyler Replogle <[EMAIL PROTECTED]> wrote:


Hey,

I've been on this mailing list for quite a while, but i think this is my
first question. I'm not sure though.

Well here goes.

I'm working at this site that has an MMORPG, a big online game, and we have
this ban script. it bans the ip for the user and the user acount for an
amount of time. This doesn't seem to be doing its job because people just
change there ip and make a new user.


I know there isn't any full way to ban some one from a site, but i've been
think and getting the mac id of a computer would work a lot better then ip.
I'm not sure how to get teh mac id of a computer though. If any of you know
how to can you please tell me. It doesn't just have to be with use php we
own the server can we can installl other apps, but many others are on the
server anyways.


So how do i get the mac id of a user that is going on to my server?

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






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


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

for some reason, I cannot get php to compile a shared object to work with apache 1.3.33...

Here are the config commands that I used for apache and php :

EAPI_MM=SYSTEM ./configure --enable-module=so --enable-module=info --enable-module=status --enable-module=rewrite --enable-module=ssl --enable-shared=ssl --disable-rule=SSL_COMPAT

apache installs and works just fine.

I use this for php :

./configure --with-apxs=/usr/local/apache/bin/apxs --enable-ftp --with-mcrypt=/usr/local -with-openssl -enable-url-fopen-wrapper --enable-ftp --with-gd --with-zlib --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-ttf --enable-gd-native-ttf --with-freetype-dir=/usr/local/lib --enable-shared

It compiles ok, but when I go to install it, it gives an error :

Installing PHP SAPI module:       apache
[activating module `php4' in /usr/local/apache/conf/httpd.conf]
cp libs/libphp4.so /usr/local/apache/libexec/libphp4.so
cp: libs/libphp4.so: No such file or directory
apxs:Break: Command failed with rc=1
*** Error code 1

Stop in /dev/php-4.3.10.

and there is no shared object file in the libs directory.

This works just fine on a FreeBSD 4.10 client, but for some reason it doesn't create the shared object on this 5.3 system.

More info :

System is a Dual Opteron AMD architecture, running a fresh install of FreeBSD 5.3...

thanks,

Tim.
--- End Message ---
--- Begin Message ---
Hi All,

So I've been using my own php to search my site
(http://hiptingle.spydigital.com) and for a while it was fine...But recently
I put in a logging system just to see what people were searching for and
realized they aren't finding what they're seeking.  I wrote all search code
to split words on commas and then builds SQL using LIKE statements (i know,
i know it's bad but i was a newbie when i wrote it).

I checked out PHPDig and it's fine but I was wondering if there's something
out there (a class or a group of classes) that are a good stub that I can
expand on. I guess what I'm looking for is something that I can feed blocks
of text and it will strip out all code and build indexes. That way I can
still search the fields I choose but have an index and not include code
(like img or href tags).

Or if there's something totally fly that I don't know about do tell.

Thanks,

Colin Olkowski

--- End Message ---
--- Begin Message ---
You really don't have to put the index in a single dimension input array.
Just put

qty[]

And you'll get it.

--- End Message ---
--- Begin Message --- Gerard wrote:
How would I go about stracing page requests? I never know which apache child
is going to handle which page.

Run Apache in non-forking mode with -X

-Rasmus
--- End Message ---
--- Begin Message ---
I got the files to upload correctly using <input type="file" and associated php 
expressions but they seem to be ascii encoded cause the jpgs and gifs are not 
displayed at all, just the correct placeholders which means the getImageSize() 
function is returning correct data!
Sincerely,

Jeremy Freedman

--- End Message ---
--- Begin Message ---
Thank you everyone,


I was trying to use file(), with some problems.. thank you for your suggestions to use file_get_contents(). Perfect! You're all right, it works really well.



Thanks

Tim

...

Tim Burgan.
Website & E-Commerce Developer
Web: <www.timburgan.com>
...

--- End Message ---
--- Begin Message --- Tim Burgan wrote:
I was trying to use file(), with some problems.. thank you for your suggestions to use file_get_contents(). Perfect! You're all right, it works really well.

I hope you didn't miss the mention of htmlentities(), also. If you did, then you'll figure it out the first time you try to load a file with the string "</textarea>" in it, I guess.


--

---John Holmes...

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

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message --- Hi there, I have a script that uses the mail() function, but for some reason the script takes a really long time to finish processing (like 5 minutes). there are some other functions performed (like sql insert, etc) that happen immediately as they should. But the mail takes some time to finish processing. If I remove the mail function, the script finishes immediately. Any ideas? I have included my code below (used for the mail). ideas?

$ToMail = $_POST['ccEmail'];

$FromMail = "[EMAIL PROTECTED]";

$FromName = "The Name";

$Subject = "Your membership";

$xmailer = "PHP mailer";

$headers = "From: ".$FromName."<".$FromMail.">\r\n";
$headers .= "Reply-To: ".$FromName."<".$FromMail.">\r\n";
$headers .= "X-Mailer: ".$xmailer."\r\n";
$headers .= "Origin: ".$_SERVER['REMOTE_ADDR']."\r\n";

$Message = "Dear ".$_POST['ccfName']."\n,";
$Message .= "Thanks for joining the Coastal Crew!\n";
$Message .= "Below you will find the information required to verfiy your email address.\n";
$Message .= "Upon verification, an e-coupon will be presented to you in which you can print";
$Message .= " off for 20% off of your next purchase.\n\nBy clicking on this hyperlink:\n";
$Message .= $verify_url."\nand follow the directions in your web browser.\n\n";
$Message .= "Thank you,\nThe Coastal Crew.\n".$_SERVER['SERVER_NAME'];

$mailer = mail($ToMail, $Subject, $Message, $headers);

--- End Message ---

Reply via email to