Re: [PHP] Regarding variable reference

2004-06-16 Thread Justin Patrin
Ulrik S. Kofod wrote: Justin Patrin sagde: Ulrik S. Kofod wrote: Why are you using eval? Eval is slow and is a hack... Just do: $y = $$x; if(isset($y)) { echo "$x:$y"; } } True ! I just tested it with both eval and $$, and $$ seems to be about 3 t

Re: [PHP] Namespace issues

2004-06-15 Thread Justin Patrin
Shaunak Kashyap wrote: Hi, Facts: 1. I have the following four scripts: a.php, b.php, c.php and d.php 2. a.php defines a function named foo. 3. b.php includes c.php 4. c.php defines a function named foo Case I: d.php looks like this: include "b.php"; include "a.php"; This causes a fatal error tha

[PHP] Re: Unit Testing

2004-06-15 Thread Justin Patrin
Rick Fletcher wrote: Has anyone done any PHP unit testing? I've been looking around for a unit testing library to try out. Below are the ones I've found so far: SimpleTest: http://www.lastcraft.com/simple_test.php PHPUnit (dead?): http://phpunit.sourceforge.net/ Pear PHPUnit: http://pear.php.net/pa

[PHP] Re: referencing an existing object

2004-06-15 Thread Justin Patrin
Torsten Roehr wrote: "Justin Patrin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Bernie wrote: Howdy, I am writing a program that has a handful of classes. I would like to be able to get information from one object to the other. I have a couple of my classes

[PHP] Re: how could I call "mail" command in PHP file

2004-06-15 Thread Justin Patrin
Min Wang wrote: Hello, all! So glad to join this maillist. I'm a beginner of PHP. I'd like to call a "mail" command in a "mail.php" like the following: There was no error, but it didn't send the mail as I wished. Other command lines like: worked. "my.txt" lies in the same directory as "mail.php"

[PHP] Re: referencing an existing object

2004-06-15 Thread Justin Patrin
Bernie wrote: Howdy, I am writing a program that has a handful of classes. I would like to be able to get information from one object to the other. I have a couple of my classes extending others, but are there other ways to do this? For example: If I have a database class and a separate c

Re: [PHP] Regarding variable reference

2004-06-15 Thread Justin Patrin
Ulrik S. Kofod wrote: [EMAIL PROTECTED] sagde: Hi, I have variables called Cookie1 to Cookie35. I would like to print the values of Cookie1 to Cookie35 using for loop. Could anybody correct the below code to print the variables. =for($i=1;$i<34;$i++) { $x="Cooki

Re: [PHP] [PHP5] Super constructor?

2004-06-14 Thread Justin Patrin
Hmm, looks like my reply got lost. Here's my ideas: Instead of parent::__construct() use Class1::__construc(). This way, you go straight to the top-level constructor without going through the middle constructors. This means that you *must* overload __construct in all child classes or else the co

[PHP] Re: [PHP5] Super constructor?

2004-06-14 Thread Justin Patrin
Franciccio wrote: If i'm not wrong php has only 1 level of depth for child class. That means you can only extends from 1 level up the class. In your example you have the class OneMore that extends down from the "grandfather" Base. It is not a problem in C++ but should not work in php or either java

Re: [PHP] Re: Cookie Security?

2004-06-14 Thread Justin Patrin
Robert Cummings wrote: On Mon, 2004-06-14 at 14:02, Justin Patrin wrote: [snip] As well as much harder for AOL subscribers (whose IP's change per-request) to use the site. [snip] I don't think it changes per request, but rather has the potential to change between requests. I still don

[PHP] Re: creating a nested multidimensional array from a query

2004-06-14 Thread Justin Patrin
PLEASE stop posting the same qustion over and over. If you're not subscribed to the list (or reading it via news.php.net) you need to be to see responses. I sent a response to this question earlier today. [EMAIL PROTECTED] wrote: Hi :) I am on my second week of php so be gentle I am creating an

Re: [PHP] Re: Cookie Security?

2004-06-14 Thread Justin Patrin
[snip} As well as much harder for AOL subscribers (whose IP's change per-request) to use the site. [snip] WHAT?? Are you sure of this? AOL really breaks internet browsing this much? Sorry, I can't believe this. If this was true, many things would break. I know that dial-up users get different IP

[PHP] Re: Cookie Security?

2004-06-14 Thread Justin Patrin
Phpmail wrote: My login script sets unique, secure, cookies that identify the user. Some of my pages only display content if a secure cookie is present. Is this a bad idea for secure pages with sensitive details as I have heard that cookies can be faked? I am always interested in creating a secure

[PHP] Re: Multidimensional Array advice from a newbie

2004-06-14 Thread Justin Patrin
Is this what you need? (See below for inline suggestions). [EMAIL PROTECTED] wrote: Hi :) I am creating an XML file out of a mysql query with nested arrays. Currently I can get 1 element and 1 child with a properly formatted XML file with the below script . My question is: How do I add 3 to 4 m

[PHP] Re: PHP 5/OOP, Functionality similar to an Abstract method?

2004-06-12 Thread Justin Patrin
Chris wrote: I have an abstract class with quite a few 'children'. Essentially I want to be able to interchange calls between children (Take a script, written with ClassA and redefine the variable as ClassB etc.) Though there is a large subset of methods all of these children declare, there are

Re: [PHP] addslashes

2004-06-11 Thread Justin Patrin
Chris Shiflett wrote: --- Jough P <[EMAIL PROTECTED]> wrote: My goal is to never have to use the addslashes() function. Any suggestions? There's probably nothing you can do about your Web host, but you can use the fix_magic_quotes() function listed here: http://phundamentals.nyphp.org/PH_storingr

[PHP] Re: addslashes

2004-06-11 Thread Justin Patrin
Torsten Roehr wrote: "Jough P" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Greetings all, I'm doing all my PHP development on my iBook running OS X. I'm currently working on a messaging tool for a website. When the messages are posted on my iBook the single quotes are escaped prop

[PHP] Re: choosing another smtpserver with PHPs mail function

2004-06-11 Thread Justin Patrin
Manuel Lemos wrote: Hello, On 06/10/2004 07:05 PM, Oôv as&äönsson wrote: I having a little problem with PHPs build in function mail(). The mailserver isnt located on the webserver, its on another machine. I have tryed ini_set("SMTP", "ipaddress"); with no result. The system I'm on runs on an Linux

Re: [PHP] passing a function as a parameter

2004-06-11 Thread Justin Patrin
call_user_func($func) and $func() are much better alternatives. Daniel Clark wrote: Can you use eval() ? I want to pass a function as a parameter and execute it in another function. A callback. :-) For example: function a() { echo "a"; } function b( $func ) { func(); echo "b"; } The ou

[PHP] Re: passing a function as a parameter

2004-06-11 Thread Justin Patrin
Torsten Roehr wrote: "Bob Lockie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I want to pass a function as a parameter and execute it in another function. A callback. :-) For example: function a() { echo "a"; } function b( $func ) { func(); echo "b"; } The output of "b(

[PHP] Re: Changing the directory that PHP runs from (CLI)

2004-06-11 Thread Justin Patrin
Phil Ewington - 43 Plc wrote: Hi All, I have read the manual page for 'Using PHP from the command line' thoroughly and cannot find the answer to my problem. I have a script that needs to be accessed from both the command line and from web browsers. I tested the script from the command line and all

Re: [PHP] Re: Binary mah

2004-06-10 Thread Justin Patrin
Knightking wrote: On Thu, 10 Jun 2004 20:08:08 -0700, Justin Patrin <[EMAIL PROTECTED]> wrote: Mark wrote: [snip] I'm not sure what's wrong with the code you have, but for the 4-digit one you have: $packed = 4-bit var with ABCD encoded in it $a = $packed & 1; $b = $pack

Re: [PHP] Re: Undiscovered Firefox...

2004-06-10 Thread Justin Patrin
John Nichel wrote: Justin Patrin wrote: BTW, you should really use strstr($_SERVER['HTTP_USER_AGENT'], 'Firefox'); or stristr I'm an old Perl guy. Me likes perl regular expressions. :) Sure, I love PREGs myself, but it's way overkill for such a simple operati

[PHP] Re: Undiscovered Firefox...

2004-06-10 Thread Justin Patrin
John Nichel wrote: Okay, I'm sitting at home, writing a bit of code for one of my personal sites, and I'm currently working on a function to detect different browser types. Well, I think I have the URL to a page on one of my boxes which echo's out the HTTP_USER_AGENT in my clipboard. However,

[PHP] Re: Binary mah

2004-06-10 Thread Justin Patrin
Mark wrote: Hey gang, I've got a complex algorithm that I'm trying to work out. I'm trying to store and retrieve a set of switches in a decimal representation of a binary number. I have four checkboxes, call them A, B, C, and D. They can be represented by a (decimal) number from 0 to 15 in binary (

[PHP] Re: choosing another smtpserver with PHPs mail function

2004-06-10 Thread Justin Patrin
Oôv as&äönsson wrote: Hello everybody :). I having a little problem with PHPs build in function mail(). The mailserver isnt located on the webserver, its on another machine. I have tryed ini_set("SMTP", "ipaddress"); with no result. The system I'm on runs on an Linux box. Can this be done or must

[PHP] Re: Undefined index ????

2004-06-09 Thread Justin Patrin
Michael Jonsson wrote: Hi Why do I get an error if the $_SESSION['user_status'] is emty (it's not set to anything) ??? in my redhat 9 it did mork, but when I moved to Fedora Core 2 it's not working... Script## session_start(); echo $_SESSION['user_status']; #error## Notice: Undef

[PHP] Re: an easy (perhaps dumb) question about PHP

2004-06-07 Thread Justin Patrin
Cere Davis wrote: I haven't been able to glean anything about this from the Oreilly books, php web site, or anywhere else so I am breaking down and asking on this list. In other scripting languages like Perl/Ruby/Python (that aren't meant to live in the web environment exclusively) there usuall

[PHP] Re: Adding Attaching to the mail function

2004-06-07 Thread Justin Patrin
Paul Brasseur wrote: Hello: I am Virtual Volunteer developing a PHP Script that processes a Form for a Youth Charity. Can anyone tell me how to add an attachment to the mail function's fourth parameter or point me to a good tutorial on the subject ? Regards, Paul Brasseur (Victoria, B.C.

Re: [PHP] image resize looks horrible..

2004-06-07 Thread Justin Patrin
Are you using gd2 or not? If you're not, that's probably your problem. Edward Peloke wrote: Any ideas as to how I can fix this function??? -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED] Sent: Thursday, June 03, 2004 4:18 PM To: Php-General Subject: [PHP] image resize looks

[PHP] Re: Best solution for creating variables from mysql statements

2004-06-07 Thread Justin Patrin
Nunners wrote: I'm creating an application which has multiple users, with their own logins etc etc. From it, they have a number of links to external websites, to which I need to pass certain details, e.g. http://somewebsite.com/index.php?username=bob

[PHP] Re: A follow up on my question about good coding practice [isset]

2004-06-07 Thread Justin Patrin
Al wrote: I could use one additional clarification regarding good practice. As I understand the php manual the following is acceptable. $foo= TRUE; if($foo) do.. ; where $foo is a binary; but not a variable. $foo is a boolean in this case, but it is still a variable, just like any oth

[PHP] Re: Multiple URL Redirection

2004-06-06 Thread Justin Patrin
[EMAIL PROTECTED] wrote: Hi I have the following situation: I've got a domain that is hosted at a certain host. This host allows me to create subdomains, and also to add several domains to the same account. The thing is if I add a domain like xxx.com to my yyy.com both will be directed to my index.

Re: [PHP] generating graphs

2004-06-06 Thread Justin Patrin
It depends on what you're running it on. Linux (which flavor), Unix (which onw?), Mac OS X, Windows Nitin wrote: At last I've decided to upgrade it. Could you please tell me, which version is best candidate yet to upgrade to? And the procedure to upgrade with tar.. Thanks in advance "Thomas S

Re: [PHP] Newbie question about good coding practice [isset]

2004-06-06 Thread Justin Patrin
Curt Zirzow wrote: * Thus wrote K.Bogac Bokeer ([EMAIL PROTECTED]): When $var is 0? or $var = ''; $var = array(); $var = false; // Output: $var: $var not exists if ( $var ) echo '$var: $var exists'; else Curt or null -- paperCrane -- PHP General Mailing List (http://www.php.net/) T

Re: [PHP] Prevent IE6 from blocking cookies

2004-06-05 Thread Justin Patrin
Nick Wilson wrote: * and then Scot L. Harris declared Face it, if web sites could override such settings there would be a lot more malicious web sites out there. Absolutely. You cant mess with peoples preffered settings. It's EVIL ;-) Best you can do is make provision for those without cookies

[PHP] Re: image resize problems

2004-06-02 Thread Justin Patrin
Edward Peloke wrote: I have looked at several of the functions and tried a few tutorials online but am not having much luck for some reason resizing images. I have this code which works fine but everytime I try to add some resizing code, I get the error that the image is not a valid image resource

[PHP] Re: PHP Newbie needs a little help 1-on-1

2004-06-02 Thread Justin Patrin
Mike wrote: Ok, I'm a pretty fast learn but syntax and basic lack of serious programming background hinder my efforts. I can make Javascript do what I want it to and usually perl also but I'm in over my head with my PHP project and I'm on a deadline. Objective: To create a set of forms that 1)

[PHP] Re: forms and DB

2004-06-01 Thread Justin Patrin
Justin Patrin wrote: Bigmark wrote: Hi i urgently need a complete ---connect_db/form/results script, does anyone know of a ready to use script available and ready to use today. All i need is a connect.php page, a form to input a users name and one for some text -and also a page that shows

[PHP] Re: IE Buffering

2004-06-01 Thread Justin Patrin
Stephen Lake wrote: Can anyone tell me what size the buffer in IE has to be before it outputs data? I don't know the answer, but I just output a large HTML comment that forces it to display...after every output that I want the user ot see real-time. Of course, this is somewhat inefficient bandwit

Re: [PHP] Spammers

2004-06-01 Thread Justin Patrin
John Nichel wrote: Steve Douville wrote: So, as I hit the send button, I know I'll have 3 messages to delete in a few seconds. No big deal... Set up a filter. Everyone says use a filter, but you need to think of the resource issue as well. There are at least 2 (probably more) servers which have

Re: [PHP] Re: PHP Coding Standards

2004-06-01 Thread Justin Patrin
Travis Low wrote: Justin Patrin wrote: Travis Low wrote: [I hate K&R indenting] And I'm one of them. :-) I like the K&R version because it saves verticaly space and most editors can't really handle correct tabbing... Arrggghh...TABS. Don't even get me started on tabs...

Re: [PHP] Spammers

2004-06-01 Thread Justin Patrin
Steve Douville wrote: Those messages are only broadcast if you happen to send a message to the board cause people have autoresponders set. Given that there are only two and now one bad address returning a message, I find it fairly easy to just hit the delete button three times. I don't think this q

[PHP] Re: forms and DB

2004-06-01 Thread Justin Patrin
Bigmark wrote: Hi i urgently need a complete ---connect_db/form/results script, does anyone know of a ready to use script available and ready to use today. All i need is a connect.php page, a form to input a users name and one for some text -and also a page that shows all the table results . i

Re: [PHP] Re: PHP Coding Standards

2004-06-01 Thread Justin Patrin
Travis Low wrote: I have to say I like everything about the PEAR coding standards except for the K&R bracing style. I much prefer: if( foo ) { blah; } to if( foo ) { blah; } The latter form (K&R) conserves vertical space, but I find it a lot harder to follow. Harder to move

[PHP] Re: nl2br problem

2004-05-28 Thread Justin Patrin
Gerben wrote: If have some problems with the nl2br function. It f*cks up my layout. does anyone know how to create a true nl2br function in stead of a nl2br-and-nl function. i.e. I just want everything on one line. I used: str_replace("\n", "", nl2br($text)); but I don't like it that much and I don

[PHP] Re: how to redirect with post method

2004-05-28 Thread Justin Patrin
Raúl castro wrote: Hello, I have a webpage that I'm redirecting to other page with header command, for instance: header("location:information.php?cod1=$cod1&cod2=$cod2&...codn=$codn"); I need send all vars (cod1, cod2, ..codn) on POST method, How Can I do this? thanks. If you really need to redire

Re: [PHP] Regular expression question

2004-05-27 Thread Justin Patrin
Rob Ellis wrote: On Thu, May 27, 2004 at 09:59:05AM -0700, Dan Phiffer wrote: So I'm trying to implement a simple wiki-like syntax for hyperlinking. Basically I want to match stuff like [this], where the word 'this' gets turned into a hyperlink. I have that working, but I want to be able to esca

[PHP] Re: How to check for a $_GET without throwing a Notice?

2004-05-27 Thread Justin Patrin
Brian Dunning wrote: How do I check for the presence of an optional $_GET param without throwing a "Notice: Undefined index" when the param is not present? Tried all three of these, they all produce the Notice when the param is not passed: if ($_GET['id']) if ($_GET['id'] != "") if (isset $_GET

Re: [PHP] interesting

2004-05-25 Thread Justin Patrin
John W. Holmes wrote: From: "Justin Patrin" <[EMAIL PROTECTED]> IMHO it's just better to use concatenation and single quotes for your string. PHP doesn't have to parse your strings for variables that way and it makes it obvious what parts are variables. To each his

Re: [PHP] interesting

2004-05-25 Thread Justin Patrin
John W. Holmes wrote: From: Daniel Clark echo "\"{$search_for_list[$i][0]}\""; will work, btw. What does the {}around the array mean? It delimits your variable so PHP knows what to interpret as a variable and what to interpret as a string. $ar[1] = 'foo'; echo "Value is {$ar[1]}"; // Value is foo

[PHP] Re: Re robi: Re:[PHP] Is there any good examples of PHPLIB?

2004-05-24 Thread Justin Patrin
[EMAIL PROTECTED] wrote: > Hi~robi! > > Thank you,troby,my friend! > With your guidance I found first time that PEAR is a very good coding tool which > I'd like to learn later.But my server provider do not have it;fortunately,I > overcomed the difficultys of PHPLIB by debugging and t

[PHP] Re: Decompressing files via php

2004-05-21 Thread Justin Patrin
Gerard Samuel wrote: Looking for libraries that are capable of decompressing files, such as those in zip or tar format. Im aware of PCL(Tar/Zip), and was wondering if there were any others out there. Just want to see whats out there before I settle on one of them. Thanks http://pear.php.net/pack

[PHP] Re: World's simplest tutorial on socket_select???

2004-05-20 Thread Justin Patrin
René fournier wrote: I've seen a sweet script for a multi-client, multi-socket server in PHP (http://dave.dapond.com/socketselect.php.txt), but its purpose is quite different from mine, and it's about one billion times more complex than I need. I am building a SIMPLE socket client that makes ON

Re: [PHP] Re: change database from mysql to mssql

2004-05-17 Thread Justin Patrin
Raditha Dissanayake wrote: Torsten Roehr wrote: Hi all I have been using mysql as the database for my PHP application. Now my manager ordered me to use Microsoft SQL Server as the database. I have been using the mysql interface to access the database, so I have to change my code. Which database int

[PHP] Re: Forums

2004-05-17 Thread Justin Patrin
John Taylor-Johnston wrote: Costs money too!? How's that? Just go to the download page and download it. phpBB has always been free. "Steve Magruder - Webcommons.Org" wrote: phpBB (www.phpbb.com) is the best (IMHO), as it has an extensive modder community and it's slap-easy to install and get run

[PHP] Re: PHP and qmail

2004-05-16 Thread Justin Patrin
Manuel Lemos wrote: Hello, On 05/15/2004 04:14 PM, Stephen Lake wrote: Can someone tell me how I can send HTML using qmail from a Script? The MTA I was using was changed from Sendmail to qmail and now my HTML mails actually show the html tags in the mail body. That looks like a bug in the mail()

Re: [PHP] Re: Looking For Easy To Use Shopping Cart

2004-05-14 Thread Justin Patrin
hat complex of a task, or maybe it is? Thanks, Ryan -Original Message- From: Justin Patrin [mailto:[EMAIL PROTECTED] Sent: Friday, May 14, 2004 6:57 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Looking For Easy To Use Shopping Cart Ryan Schefke wrote: Can anyone recommend a good open source

[PHP] Re: Looking For Easy To Use Shopping Cart

2004-05-14 Thread Justin Patrin
Ryan Schefke wrote: Can anyone recommend a good open source shopping cart solution? I built an application for custom websites, now, I just need to interface to a shopping cart. I'm using mysql. Any suggestions? ...looking for something easy. Thanks, Ryan Well... Do you mean that you've create

Re: [PHP] dynamically building insert/update forms from db

2004-05-14 Thread Justin Patrin
Ben Ramsey wrote: CB> I believe there is a PEAR library package that does this. You might CB> want to do some research to see if it fits your needs. Yes, there is. Check out PEAR::DB or PEAR::MDB which both have good classes for preparing INSERT and UPDATE statements, as well as for finding ou

[PHP] Re: dynamically building insert/update forms from db

2004-05-14 Thread Justin Patrin
Edward Peloke wrote: I was up late last night creating insert and update forms for tables in my db and knew there had to be a better way. I do have a class that will generate forms but I still have to create each input..i.e $forms->inputBox(), etc. I want to be able to pass in a table name and ha

[PHP] Re: Reshuffling an array

2004-05-12 Thread Justin Patrin
Todd Cary wrote: I do the following: $eventList = array(); $eventList[] = "Any"; $dbh = db_open($host, $user, $password, $database); if($dbh) { $sthdl = db_get_event_data($dbh); while ($row = mysql_fetch_object($sthdl)) { $eventList[] = $row->EV_EVENT; } } else { $

[PHP] Re: Submit button as image

2004-05-12 Thread Justin Patrin
Sam wrote: What do you do with this? Submit.x=22&Submit.y=13 if($_GET['Submit.x'] > 0) ??? Is there some smarter way of dealing with an image as a submit button? input name="Submit" type="image" value="doesNOTseemTOmatter" Thanks Well, it comes through as an image map in most browsers. I've fou

[PHP] Re: Best way to get mysql table metadata

2004-05-07 Thread Justin Patrin
[EMAIL PROTECTED] wrote: Hi there, I am trying to upgrade my db class, so I can tell if what table type of the table being queried is. More specifically i need to work out if the table is an innodb transaction table, if so I would like to start the transaction and commit and rollback when needed.

[PHP] Re: Returning an object

2004-05-07 Thread Justin Patrin
Aidan Lister wrote: How _should_ this be done? In terms of "best practice". Or: Please don't reply if you really, really don't know what you are talking about. Some earlier versions of PHP5 would not allow returning by reference of a function call or a new call. It was very recently added, bu

Re: [PHP] Re: Pulling out string from a string

2004-05-04 Thread Justin Patrin
d. I need to get the number after the "client" string in /tgwedding/users/client1/sites/testgrabid.php ...so, in the string above I need to pull out the number "1". Any help? -Original Message- From: Justin Patrin [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 04, 2004 5:43 PM

[PHP] Re: Pulling out string from a string

2004-05-04 Thread Justin Patrin
Ryan Schefke wrote: Can anyone help me with the code to pull out "clientxxx" from the below string: /tgwedding/users/client1/sites/testgrabid.php I use $PHP_SELF to get the directory structure of the page and store that string as a variable. Then, I want to pull out the string "clientxx", where "x

[PHP] Re: Separating spaces from the rest

2004-04-30 Thread Justin Patrin
Anguz wrote: Thanks! I was just reading that function in the manual when I got your reply. I tested it but I still have a couple of problems with it. print_r(preg_split('(\s+)', " word1 word2 word3.", -1, PREG_SPLIT_DELIM_CAPTURE)); I get this: Array ( [0] => [1] => word1 [2] =>

[PHP] Re: string replace in files

2004-04-30 Thread Justin Patrin
Steve Buehler wrote: I am trying to write a script that will replace a string in a file. Actually, about 3000 files. And I am stuck. I can get the list of files, but then I pretty much become stuck. I wanted to try str_ireplace (not sure if that is what I should use or not), but I can't ev

Re: [PHP] Register globals off, still not secure?

2004-04-30 Thread Justin Patrin
Patrick Hutchinson wrote: Thanks for the response. I basically have an environment analogous to an internal ISP. A lot of corporate users that have the ability to make web pages for the intranet etc. Basically management wants PHP turned off now because a rogue user could potentially gather and

Re: [PHP] making changes on arrays

2004-04-30 Thread Justin Patrin
Travis Low wrote: Hi Katie, The foreach construct operates on copies of the array values. I usually just stick to C-like syntax: for( $i = 0; $i < count( $array ); $i++ ) { $array[$i] = doSomething( $array[$i] ); } Remember that this will only work for consecutively integer indexed arrays

Re: [PHP] re-keying an array

2004-04-30 Thread Justin Patrin
Richard Harb wrote: Uh, I was wrong... Foreach evaluates only once at initialisation... You can even unset the array once into the loop and it still works perfectly well (not that I recommend this as good practice or whatever, just did some checking to be sure :) Richard That will work because for

Re: [PHP] Why NNTP is not default protocol for php groups

2004-04-22 Thread Justin Patrin
David T-G wrote: Hi -- ...and then T. H. Grejc said... % % Justin Patrin wrote: % >The threading works just fine. The problem is that users have ignorant % >mail software that don't set the thread headers correctly. Even % >newsgroup client software might do this. This is *not

[PHP] Re: includes and classes

2004-04-22 Thread Justin Patrin
Jason Barnett wrote: Dubreuilmedia wrote: Hi I was wondering about includes and classes. I have a class in which depending on a member variable, i should load the proper include, which is really the proper config file for that moment. How does a member variable control this? E.g. you set the

[PHP] Re: objects in sessions again

2004-04-22 Thread Justin Patrin
[EMAIL PROTECTED] wrote: Hi there, needing some more advise, is this function correct ? function create_object($class_name,$dir = null, $serialize = null) { $dir ? $dir = $dir."/" : $dir = ""; require_once("".CLASS_PATH.$dir.$class_name.".ph

[PHP] Re: objects in a session

2004-04-21 Thread Justin Patrin
Electroteque wrote: Hi there going back to the discussions of objects in a session. I would like to know what are the benifits of this, and in what scenarios would it be used. I have an application I am trying to make scalable if possible, it uses a sub class to a phplayers menu class which parses

[PHP] Re: Trouble with thumbnail generation using GD

2004-04-21 Thread Justin Patrin
Haddad Said wrote: Hi, i was trying to create thumbnail using a tutorial on image galleries, I am having problems creating thumbnail images using GD. The thumbnail is created with the sizes prorerly, however the image is black. I have posted a temporary php file i created to investigate the proble

Re: [PHP] PHP and Perl Integration for E-Cart

2004-04-20 Thread Justin Patrin
John Nichel wrote: Pushpinder Singh wrote: Hello all, We are trying to incorporate a CGI Perl based E-Cart module into our PHP driven site. This is because the E-Cart supplied by our merchant uses CGI. I want to check with all of you if its possible to integrate PHP with Perl. Will it be

Re: [PHP] PHP and Perl Integration for E-Cart

2004-04-20 Thread Justin Patrin
Pushpinder Singh wrote: The session ID is not stored in the database, its propagated invisible via a cookie (I think so ;-) ) Is is possible to check for the existance of a PHP session ID on a Perl script ?? This ways I want to be able to send a confirmation email to to the buyer after he compl

Re: [PHP] Why NNTP is not default protocol for php groups

2004-04-19 Thread Justin Patrin
T. H. Grejc wrote: Red Wingate wrote: Same here, just installed some Newsgroup Software and everything works just fine for me :-) OK then, I live in East Europe, so maybe my location is to blame for frequent news server down time. But, there is still question of bandwidth. Why php.net don't w

Re: [PHP] Why NNTP is not default protocol for php groups

2004-04-19 Thread Justin Patrin
Curt Zirzow wrote: * Thus wrote T. H. Grejc ([EMAIL PROTECTED]): Hello, I've seen this subject before, but never really got any answer. PHP have news server at news.php.net but it is 'always' down and it is only a mailing list mirror, so some messages get lost or get 'out of thread'. I've ne

Re: [PHP] addslashes vs. mysql_real_escape_string

2004-04-19 Thread Justin Patrin
John W. Holmes wrote: From: "Hardik Doshi" <[EMAIL PROTECTED]> Currently i am using PEAR DB abstration layer. Which function should i use to escape the ' character? There are couple of functions in the PEAR DB documentation so i don't know which one should i use. I don't use PEAR DB, but it loo

Re: [PHP] Using ' to access session variables?

2004-04-16 Thread Justin Patrin
Michal Migurski wrote: Whats the difference between $_SESSION[foo] and $_SESSION['foo'] I have been using the 's but they seem to be unecessary? Use the single-quotes -- array references often work without them, but the potential for conflict with constants and future PHP incompatibility is a po

[PHP] Re: Looking for good Mail List Manager

2004-04-14 Thread Justin Patrin
James Marcinek wrote: Can any of you guys recommend a good Mail List Manager? I see several on sourceforge but would like to hear from people that have some experience with these... Thanks, James __ Do you Yahoo!? Yahoo! Tax Center - File onl

[PHP] Re: Command line include path?

2004-04-14 Thread Justin Patrin
Mike Zornek wrote: I'm getting started with PEAR's DB_DataObject and am trying to follow along with the tutorial: http://pear.php.net/manual/en/package.database.db-dataobject.intro-purpose.p hp It tells me to create the ini file (which I did) and then run createTables.php from the command line to

[PHP] Re: Problems with mail and php

2004-04-12 Thread Justin Patrin
Luis Lebron wrote: I have a development box that uses our company's Exchange server as an smtp host. All of a sudden, the php mail function has stopped working. I can, however, send a message using mutt. Here's the output of the maillog: Apr 12 10:38:51 localhost sendmail[11879]: i3CFckaV01187

[PHP] Re: The Smarty Aftermath

2004-04-12 Thread Justin Patrin
Justin French wrote: In the aftermath of the Smarty debate (which turned from intelligent to stupid very quickly), I decided to look closely at templating again (though not smarty), and I've found one are where these excel in comparison to PHP. Textpattern [1] is a gamma release CMS/blog tool

Re: [PHP] Understanding sessions

2004-04-09 Thread Justin Patrin
Daniel Clark wrote: As suggested, if I turn off cookies in my browser, then SID is set. So the directive in php.ini does not cause the use of cookies to be completely turned off? My understanding is the php.ini sessions.save_path(?) is for PHP to have a temp directory to write session informatio

[PHP] Re: Need help

2004-04-09 Thread Justin Patrin
Strogg wrote: This the script that is falling over. It calculates everything correct until the amount reaches £1,000, and then it falls over and reads only the 1 before the comma, and then outputs the price to be paid as £1.18 (£1 + the taxrate (0.175 rounded up)) Order Processed at "; echo

[PHP] Re: Sorting through an array

2004-04-09 Thread Justin Patrin
Jamie wrote: I have an array of song artists and songs indexed by an id, i need a way of taking out all the artists names. However as there are multiple lines for each artist i have come accross a problem when only displaying the artist once. Another problem is that the artists are not grouped tog

[PHP] Re: Use PHP to copy MySQL tables

2004-04-09 Thread Justin Patrin
Robb Kerr wrote: Is there an easy way to create an HTML page that uses PHP to copy selected MySQL tables to backup copies on the same MySQL server? I want to create an administration page for my client to be able to "backup" their database whenever they see fit. But, I can't give them direct acces

Re: [PHP] Smarty Summary was Re: [PHP] smarty

2004-04-09 Thread Justin Patrin
Jochem Maas wrote: Chris de Vidal wrote: Jochem Maas said: 1. 'Template Engine' - you can justifyably call PHP a template engine Correct. Seems that Smarty is, for the most part, redundant (see my last post called "PHP makes a great templating engine (Was: smarty)"). I was not intending to pr

[PHP] Re: PHP vs. Outlook problem

2004-04-08 Thread Justin Patrin
R? wrote: Dear all , I got a problem to send a confirmation mail from my Website to auto reply every new registrator . Due to the ISP mail server resist any Web Mail function but personal mailing permitted only through Outlook . Since I used floating IP and asked another dynamic DNS server to po

Re: [PHP] smarty

2004-04-08 Thread Justin Patrin
Robert Cummings wrote: On Wed, 2004-04-07 at 21:35, Kelly Hallman wrote: Apr 8 at 10:26am, Justin French wrote: PHP itself is a great templating language :) '> Uhhh, yeah--that's not a templating, that's called spaghetti code :) You get the concept. Smarty, as you know, basically takes a

[PHP] Re: Adding a new entry using PHP

2004-04-07 Thread Justin Patrin
Alistair Hayward wrote: Hi, I am an ASP user, now learning PHP. When adding a record in ASP, I do this: Recordset.AddNew Field1 = whatever RecordSet.Update How is this done in PHP? I have built a recordset using a query, and have all the information needed to go into the different fields, but

[PHP] Re: Dynamic method calling

2004-04-07 Thread Justin Patrin
Darren Beale wrote: Hi I'm trying to dynamically choose and call a method from within a class but actually calling a method dynamically does not seem to work whatever I try using php 4.3.3 Hopefully this test script will illustrate my point better, I always get to the "I know we get to here"

Re: [PHP] very large and long if statement

2004-04-07 Thread Justin Patrin
Robert Cummings wrote: On Wed, 2004-04-07 at 18:47, Andy B wrote: I have this very large and long if statement: if (!empty($_SESSION['add']['type']) && !empty($_SESSION['add']['start_date'] && !empty($_SESSION['add']['end_date']) && !empty($_SESSION['add']['name']) && !empty($_SESSION['add']['cou

Re: [PHP] assigning NULL to a variable

2004-04-07 Thread Justin Patrin
Marek Kilimajer wrote: William Lovaton wrote: El mar, 06-04-2004 a las 07:41, Marek Kilimajer escribió: Andy B wrote: how would you assign NULL to a variable if its original value is ""? otherwise leave it with its value... if($var === '') $var = NULL; what about: if ($var == '') unset($v

[PHP] Re: writing a class in php to print form elements

2004-04-07 Thread Justin Patrin
Andy B wrote: hi... is it totally usefull/reasonable to write a class in php that prints different different form elements in html... i.e. inputs, buttons, drop downs, multi selects and son? that way (at least i think) then it would be easier to change the element attributes dynamically... Sure i

[PHP] Re: Can someone with list access please remove these two?

2004-04-07 Thread Justin Patrin
Richard Davey wrote: Hi, Subject says it all - they're causing auto-responder junk to any list poster and it's annoying: Information Desk <[EMAIL PROTECTED]> Advance Credit Suisse Bank <[EMAIL PROTECTED]> I second the motion! -- paperCrane -- PHP General Mailing List (http://www.php.net/) To uns

<    1   2   3   4   5   6   >