[PHP] default/optional parameters in function

2002-07-03 Thread Chris Lott
I have a function that writes meta tags... if a tag (or tags) is not specified, then it gets a default value... is there a cleaner way to do this? function print_pmeta ($type) { if ($type["description"]) { print ''; } else { print ''; } if ($type["keywords"]) { print '';

Re: [PHP] default/optional parameters in function

2002-07-03 Thread Analysis & Solutions
On Wed, Jul 03, 2002 at 05:44:28PM -0800, Chris Lott wrote: > > I have a function that writes meta tags... if a tag (or tags) is not > specified, then it gets a default value... is there a cleaner way to > do this? Not that I can think of. I do have some thoughts, though... > if ($type["desc

Re: [PHP] Authentication

2002-07-03 Thread Alberto Serra
Chris Shiflett wrote: > Alberto Serra wrote: >> If you want to avoid even this small window, just store on a db file >> the session numbers you give away, along with the IP address of the >> user who got it. Then when you get a new request for that session >> check the IP you are getting it f

Re: [PHP] default/optional parameters in function

2002-07-03 Thread Chris Lott
On Wed, 3 Jul 2002, Analysis & Solutions wrote: > On Wed, Jul 03, 2002 at 05:44:28PM -0800, Chris Lott wrote: > > > > I have a function that writes meta tags... if a tag (or tags) is not > > specified, then it gets a default value... is there a cleaner way to > > do this? > > Not that I can think

Re: [PHP] default/optional parameters in function

2002-07-03 Thread Analysis & Solutions
On Wed, Jul 03, 2002 at 06:03:59PM -0800, Chris Lott wrote: > On Wed, 3 Jul 2002, Analysis & Solutions wrote: > > > Note use of single quotes around the array key names, as well. > > Why is this better-- I assume because PHP doesn't have to check for > variables to interpolate with single quotes

Re: [PHP] Multiple Forms and 1 SQL table

2002-07-03 Thread Analysis & Solutions
On Wed, Jul 03, 2002 at 07:18:45PM -0600, CM wrote: > > What do you do if you have a huge form that you want broken up into several > different forms but each time the submit button is pressed the info is saved > to the sql table. > > Do you just create the table on the first form submit and then

Re: [PHP] Multiple Forms and 1 SQL table

2002-07-03 Thread Alberto Serra
CM wrote: > What do you do if you have a huge form that you want broken up into several > different forms but each time the submit button is pressed the info is saved > to the sql table. > > Do you just create the table on the first form submit and then on each > subsequent form you just update t

[PHP] Re: Recognition: Richard Lynch

2002-07-03 Thread Manuel Lemos
Hello, On 07/03/2002 07:01 PM, Ed Lazor wrote: > Richard Lynch: It's amazing to see how many helpful and informative > messages you're able to rattle off on a daily basis. You're a major > contribution to the community - Good job! Yeah, for many years Richard is entitled to the Mr-PHP-Help awa

[PHP] storing echo to MySQL or converting to a variable

2002-07-03 Thread Jose Arce
Hi, i want to know if i can convert this: echo fgets($conexion,256); to a variable, or store it to a MySQL database, and then email that variable or data in the MySQL database...thx :D _ MSN Fotos: la forma más fácil de compartir

[PHP] Re: Problem with menu

2002-07-03 Thread JJ Harrison
Thx. I a bit of a n00b so don't always understand. I is a lot clearer now thank you -- JJ Harrison [EMAIL PROTECTED] www.tececo.com "Richard Lynch" <[EMAIL PROTECTED]> wrote in message news:20020703212954.BFUU903.sccrmhc03.attbi.com@[192.168.1.103]... > >when I echo menu($id) I get the current

[PHP] Re: Simple Example of Passing on a file through a PHP script

2002-07-03 Thread JJ Harrison
Thx. I can output the file using readfile(). But the problem is that it appears to output the data in it's raw form. How can I get it to open in the right application? I wasn't going to put the file in the DB. I am just working on a stats program for a couple of sites. One had about 50 downloads

Re: [PHP] Authentication

2002-07-03 Thread Chris Shiflett
Alberto Serra wrote: > So you mean I have a 32 byte MD5 session id to identify the current > visit, plus another such thing to identify the step within it, right? > But why decrypting it? A presentation attack would give it back to > server in the encrypted form anyway. What do we lose by just

Re: [PHP] Authentication

2002-07-03 Thread Alberto Serra
Chris Shiflett wrote: > > These are just some ideas, mind you. Many people (you sound like such a > person) can develop their applications quite securely once they can step > back and see the big picture and follow a few general guidelines, such > as not trusting data from the client. In this

Re: [PHP] storing echo to MySQL or converting to a variable

2002-07-03 Thread Analysis & Solutions
On Wed, Jul 03, 2002 at 08:23:11PM -0600, Jose Arce wrote: > Hi, i want to know if i can convert this: > > echo fgets($conexion,256); > > to a variable, or store it to a MySQL database, and then email that > variable or data in the MySQL database...thx :D Yes. Anything you can echo you can pu

Re: [PHP] Authentication

2002-07-03 Thread Alberto Serra
Jason Wong wrote: > On Thursday 04 July 2002 09:09, Chris Shiflett wrote: > > >>As a caveat to Mr. Serra's suggestion, remember that there are *many* >>users who will go through an IP masquerading gateway or proxy, so their >>IP may fluctuate, even though they are actively browsing. For this >>r

Re: [PHP] Authentication

2002-07-03 Thread Miguel Cruz
On Thu, 4 Jul 2002, Alberto Serra wrote: >> As a caveat to Mr. Serra's suggestion, remember that there are *many* >> users who will go through an IP masquerading gateway or proxy, so >> their IP may fluctuate, even though they are actively browsing. For >> this reason, it is often necessary to tol

Re: [PHP] Question about using XSLT_Process?

2002-07-03 Thread Chris Wesley
You just need the XML and/or XSL as a string. xmldoc() is creating a DOM object, which xslt_process() can't use. In you example that does not work properly, change this: $xsl = xmldoc(implode("",file("test.xsl"))); $xml = xmldoc(implode("",file("test.xml"))); to not use xmldoc(), like this: $

Re: [PHP] Re: Simple Example of Passing on a file through a PHP script

2002-07-03 Thread Jason Wong
On Thursday 04 July 2002 10:46, JJ Harrison wrote: > I can output the file using readfile(). But the problem is that it appears > to output the data in it's raw form. How can I get it to open in the right > application? You _do_ want it to output the data in it's raw form. However it is your re

Re: [PHP] Authentication

2002-07-03 Thread Alberto Serra
Miguel Cruz wrote: > > I'd suggest ignoring IP altogether and focusing on other tactics. There > are just too many pitfalls in trusting IPs and too much user annoyance > possible from not trusting them. Well, the way I made it admins get emailed each every time a user gets refused because of

[PHP] Strange MySQL Query Problem

2002-07-03 Thread eat pasta type fasta
I already got some replies for this but it wasn't it, here is the problem: I have a simple form which queries the database based on 2 pop-up menu choices and keywords entered by the user, it passes on the variables as follows: pop-up1=choice1, pop-up2=choice2, textfield=user specified data the

Re: [PHP] Strange MySQL Query Problem

2002-07-03 Thread Jason Wong
On Thursday 04 July 2002 12:32, eat pasta type fasta wrote: > $result = mysql_query("SELECT some_id, some_description, some_feature > FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND > some_feature LIKE '%$pop-up2'"); Again: echo $result; -- Jason Wong -> Gremlins Associates -> w

Re: [PHP] Security: PHP: how to "harden" PHP scripts?

2002-07-03 Thread Jean-Christian Imbeault
Justin French wrote: > This list really does work best (ie best results for you) if you come to us > with a specific problem, rather than something general. I totally agree. Sorry to have asked such a wide question but in this case it is a bit of a chicken-or-the-egg situation. To make your

Re: [PHP] Re: Simple Example of Passing on a file through a PHP script

2002-07-03 Thread JJ Harrison
It sort of works now. Here is my script so far: The problem is that with excel files it asks me if I want to download twice. Also it opens in excel not IE. Sometimes PDFs open in IE sometimes the don't. What is wrong? Also would I be better of collecting my stats then using a header to re-di

[PHP] PHP: Script Security: Best coding practices

2002-07-03 Thread Jean-Christian Imbeault
I am trying to figure out what are some Bad Things (tm) when it comes to secure PHP programming and how to avoid them. I am looking for a kind of "best practices for security" list for PHP programming. Do's and Don't, or a list of common pitfalls and how to avoid them. Can anyone point me to

[PHP] Appologies

2002-07-03 Thread Brandon
I've posted to this newsgroup a few times and some of you have replied back via email. Recently I had a virus on my machine that sent out a TON of email to people i've recieved email from - I just wanted to appologize if you recieved any of this spam. I now have updated Anti-Virus software so it

[PHP] Re: Script Security: Best coding practices

2002-07-03 Thread Peter James
A suggestion would be to make sure that the variables you're receiving are coming from where you think they're coming from... For instance, $_SESSION['logged_in'] is also (generally) $logged_in but so is $_GET['logged_in'] A smart user could fake it if they wanted to... check the $_SESSION or

Re: [PHP] Re: Simple Example of Passing on a file through a PHP script

2002-07-03 Thread Terence Kearns
I have had "inconsistency" issues when outputing diffrent content-types to IE. It seems to cache the type for a articular file somewhere and deleting temporary files in the usaer agent is no good. I have to shut-down all instances of IE then re-launch it for it to behave like it is supposed to _co

[PHP] Re: PHP: Script Security: Best coding practices

2002-07-03 Thread Manuel Lemos
Hello, On 07/04/2002 02:24 AM, Jean-Christian Imbeault wrote: > I am trying to figure out what are some Bad Things (tm) when it comes to > secure PHP programming and how to avoid them. > > I am looking for a kind of "best practices for security" list for PHP > programming. Do's and Don't, or a

[PHP] Model View Controller (MVC) frameworks in PHP

2002-07-03 Thread Terence Kearns
I've been developing an open source MVC framework in PHP and it's going OK. However, I wanted to find out about any other frameworks around the place that do a similar thing. I want to see how other people approach this design pattern. Here are my main aims: 1) standardise development patterns

Re: [PHP] Re: mac ie and force download

2002-07-03 Thread Miguel Cruz
On Tue, 2 Jul 2002, Richard Lynch wrote: > If you can't do .htaccess, for whatever reason, second-best choice is: > > HREF=download.php/filenameyouwant.doc?filename=filenameyouwant.doc>Download< > /A> > > Apache and PHP are gonna ignore the bogus /filenameyouwant.doc part, while > the browser s

[PHP] Weird preg problem

2002-07-03 Thread SP
Hi I am trying to check if a word contains only capital letters. For some reason it's not working. The below example is checking the word "weird" to see if it's all capital letters but it's saying it's matches. I've tried checking for only lower case letters with "WEIRD" and it's not working th

[PHP] fopen with external file

2002-07-03 Thread morka ++
i try to open the external file using fopen() function. I use the example from php.net: $filename = http://www.aaa.com/index.html; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); fclose ($fd); however I always get the error "stat failed for http://www.aaa.com/index.ht

[PHP] how to get calling method identity?

2002-07-03 Thread Alberto Serra
Hi! I already made this question, but probably I kinda made it in obscure terms. Trying to get clearer. let's look at this: function utility() { } Class a { function some_method() { utility(); } } now, how can utility know that it's being called by a::some_method()? What I nee

Re: [PHP] Strange MySQL Query Problem

2002-07-03 Thread Alberto Serra
eat pasta type fasta wrote: > $result = mysql_query("SELECT some_id, some_description, some_feature > FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND > some_feature LIKE '%$pop-up2'"); have this query echoed to video and then cut it and paste it to mysql terminal. Most probably

Re: [PHP] Weird preg problem

2002-07-03 Thread Miguel Cruz
On Thu, 4 Jul 2002, SP wrote: > Hi I am trying to check if a word contains only capital letters. For > some reason it's not working. The below example is checking the word > "weird" to see if it's all capital letters but it's saying it's matches. > I've tried checking for only lower case lette

Re: [PHP] addslahes and magic quote woes

2002-07-03 Thread Miguel Cruz
On Wed, 3 Jul 2002, Jean-Christian Imbeault wrote: > Erik Price wrote: >> Turn off magic_quotes and do addslashes() explicitly every time you do >> a database insert. Then make sure you always stripslash() data >> returned from a database query. >> >> magic_quotes is convenient for newbies, but

[PHP] Java in PHP4

2002-07-03 Thread Idaham
Hi, I'm really new to Java in PHP, and curious to this great features. Q: How do I convert the sample code below so that it can run within PHP? === import com.my.sm.api.*; import com.my.sm.api.interfaces.*; public class my1 { public st

[PHP] fsockopen question

2002-07-03 Thread Jose Arce
Hi, i'm making a script to transfer all the zips from my old server to my new one, i mean, server to server. That's the easy part. The cuestion is: Can i open more than just one instance for fsockopen to retrieve more files in the same script, at the same time? i mean, not one by one (that will

Re: [PHP] fopen with external file

2002-07-03 Thread Analysis & Solutions
On Thu, Jul 04, 2002 at 08:04:59AM +0100, morka ++ wrote: > i try to open the external file using fopen() function. > I use the example from php.net: > $filename = http://www.aaa.com/index.html; > $fd = fopen ($filename, "r"); > $contents = fread ($fd, filesize ($filename)); "This function will n

RE: [PHP] fsockopen question

2002-07-03 Thread Martin Towell
you can do more than one fsockopen(), but since php isn't multi-threaded - you'll still only be able to download one file at a time. -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:39 PM To: [EMAIL PROTECTED] Subject: [PHP] fsockopen question

[PHP] Re: PHP: Script Security: Best coding practices

2002-07-03 Thread Jean-Christian Imbeault
Manuel Lemos wrote: > > Check out http://www.phpadvisory.com/ . An ok site but only three articles, of which two are on security. One article is too general and the other too specific :) Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.p

Re: [PHP] checking the path from which someone has arrived at aspecific script

2002-07-03 Thread Miguel Cruz
On Fri, 28 Jun 2002, Kris Vose wrote: > Basically I want to check to see if a user has gone to PayPal.com and > paid for a product before I disseminate the username and password > through a script called thankyou.php. > > I tried using an if statement that checks the global variable > $HTTP_REFER

RE: [PHP] fsockopen question

2002-07-03 Thread Jose Arce
So...i can do more than one fsockopen()...but is not multi-thread? i don't understand...i mean...if i can open more than one fsockopen...it is multithread, or in wich cases php open more than one fsockopen? thx :D >From: Martin Towell <[EMAIL PROTECTED]> >To: 'Jose Arce' <[EMAIL PROTECTED]>, [

RE: [PHP] Weird preg problem

2002-07-03 Thread SP
Thanks Miguel it works now! $str = "abcA"; if (preg_match('/^[a-z]*$/', $str)) echo "The string '$str' contains only lower-case letters."; -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: July 4, 2002 2:29 AM To: SP Cc: [EMAIL PROTECTED] Subject: Re: [PHP] W

RE: [PHP] fsockopen question

2002-07-03 Thread Martin Towell
I mean, you can do each of the fgets()'s will be executed sequentially. But there's two sockets open... -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:48 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question

Re: [PHP] checking the path from which someone has arrived at a specific script

2002-07-03 Thread Tracker 1
"Miguel Cruz" <[EMAIL PROTECTED]> wrote in message... > > > > Unfortunately...This is not working. I went to the php manual and it > > basically stated that not all web sites will post the $HTTP_REFERER. I > > believe that is what is happening in this case. > > Also, anyone can fake HTTP_REFERER

RE: [PHP] Re: PHP: Script Security: Best coding practices

2002-07-03 Thread SP
I thought it was a good site. I was reading up on the security bugs found and now I know what not to do. -Original Message- From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] Sent: July 4, 2002 2:41 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: PHP: Script Security: Best coding pra

Re: [PHP] gc_probability: requests tallied per server or domain?

2002-07-03 Thread Miguel Cruz
On Tue, 2 Jul 2002, Johnson, Kirk wrote: > Is the number of requests (used for garbage collection), tallied on a per > server basis, or on a per domain basis? What about in a load-balanced > environment? Pretty fair bet it's a per-server basis. miguel -- PHP General Mailing List (http://www.p

Re: [PHP] fsockopen question

2002-07-03 Thread Tracker 1
you can do more than one fsockopen, which means you will have multiple sockets open, however, these are part of the same thread in the same process.. in other words, you can't do two things at once by default.. with php-gtk, you can maybe have multiple user events.. and not sure if you can emulate

RE: [PHP] PHP in South Africa

2002-07-03 Thread Rudolf Visagie
Rudolf Visagie Principal Software Developer Digital Healthcare Solutions Tel: +27 11 2655484 Cell: 082 895 1598 -Original Message- From: MindHunter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 4:19 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP in S

[PHP] Re: Weird preg problem

2002-07-03 Thread Tracker 1
the /i means case insensitive, remove the i, and it will work as intended. -- === Michael J. Ryan - tracker1[*at*]theroughnecks.com Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net ===

RE: [PHP] fsockopen question

2002-07-03 Thread Jose Arce
now it's clear thx :D is not the same thing as: while ($i < 100) { $sock = fsockopen($host, 80); fputs($sock, "GET /file".$i".html HTTP/1.0\r\n\r\n"); } isn't? >From: Martin Towell <[EMAIL PROTECTED]> >To: 'Jose Arce' <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >Subject: RE: [PHP] fsockop

Re: [PHP] Re: Handling of constants in strings

2002-07-03 Thread Miguel Cruz
On Tue, 2 Jul 2002, Uwe Birkenhain wrote: > A question - since english is not my first language - what do you mean with > >It's not all that common to bury constants in strings > > Is something bad about it? I think so. It would slow parsing down to a crawl and create a host of ambiguities if ev

RE: [PHP] fsockopen question

2002-07-03 Thread Martin Towell
That's still running sequentially -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 5:01 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question now it's clear thx :D is not the same thing as: while ($i < 100) { $s

<    1   2   3