Re: [PHP] Reliability of sessions

2002-04-04 Thread Jason Lotito

Another thing to consider, most users on the internet allow cookies, and
those that don't want cookies can usually differentiate between allowing
session cookies and other types of cookies.

In the end, if a user doesn't want to allow cookies, they shouldn't expect
to be able to do e-commerce type stuff like purchasing items, or even have
user accounts.

Considering they don't allow cookies, these same users probably don't want
to sign up and give you their information anyways.

Use sessions, that is what they are there for.

Jason Lotito
www.devnetwork.net - PHP Developer's Network
www.newbienetwork.net

- Original Message -
From: Thomas Deliduka [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Thursday, April 04, 2002 4:54 PM
Subject: Re: [PHP] Reliability of sessions


 On 4/4/02 4:46 PM this was written:

  I am not sure about the reliability of sessions, but the way I do it is
  also through several processes, and the information passed via input
  type=hidden name=name value=$name I can demonstrate it if you want.

 That's what I was wanting to avoid. That's a lot of hidden fields. Not to
 mention if you  have to add to the first step, you need to modify all the
 others.

  Even though sessions are more handy, I still don't know what happens if
  cookies are disabled in the client's browser.

 I pass the session ID in the URL on every page so whether or not cookies
are
 set, the session stays intact.

 I'm thinking that I solved my old problem and I'm going to do it in the
 database and pass the order number. That's probably the best way. I only
 have to provide for order clean-up for those that started the process and
 decided not to check out.

 --

 Thomas Deliduka
 IT Manager
  -
 New Eve Media
 The Solution To Your Internet Angst
 http://www.neweve.com/



 --
 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




Re: [PHP] PHP FAQ (again)

2002-04-03 Thread Jason Lotito

Just for reference, there is www.alt-php-faq.org
as well as www.devnetwork.net the home of the PHP Developer's Network

We might be able to work something out in providing assistance to this
effort.

Jason Lotito
www.devnetwork.net - The PHP Developer's Network
www.newbienetwork.net

- Original Message -
From: Maxim Maletsky [EMAIL PROTECTED]
To: 'Christoph Starkmann' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 3:28 PM
Subject: RE: [PHP] PHP FAQ (again)


 Would be very nice.

 There are dozens of very good sites related to PHP learning on the web.
 It's been a while that we at PHPBeginner.com were thinking to merge with
 some other sites full of useful information in order to create a
 noticeably large knowledge base for anyone interested in PHP.

 Though, it's been always kind of tough to accomplish, and even start.
 Reason: everyone is trying to purge the project in its own way... not
 too easy to agree.

 But, I'd love to follow this idea.


 Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



  -Original Message-
  From: Christoph Starkmann [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, April 03, 2002 4:15 PM
  To: '[EMAIL PROTECTED]'
  Subject: FW: [PHP] PHP FAQ (again)
 
 
  Hi Ray!
 
   I am in total agreement with Justin on this one.  Many of the
   posters use
   need help,  newbie needs help , etc.  We need to have
   some form of FAQ
   with detailed instructions on how to post so that I do not
   have to ask;
 
  There are so many ressources on the web on how to pose questions
  in mailing lists.
  Do you think some extra documentation would help here?
  I am afraid many of these posters wouldn't read this FAQ,
  neither...
 
   I now some mailing lists will not even reply if you do not
   follow specific
   criteria when you post...
 
  That's up to everyone himself... BTW, there are many docs
  on the web, too, on how to quote (avoid full quotes...)
 
  Like someone (Rasmus?) wrote, there is a quite smart PHP
  documentation to cover most of the basic questions, and
  a lot of help here...
 
  Again, do you think someone who isn't checking ouzt
  the online doc would be reading the FAQ?
 
  Regards,
 
  Kiko
 
  -
  It's not a bug, it's a feature.
  christoph starkmann
  -
 
  --
  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



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




[PHP] SafeArrays and Enumerations Doc Questions

2002-03-23 Thread Jason Lotito

In the ChangeLog 4.1.0
Added support for single dimensional SafeArrays and Enumerations. Added an
is_enum() function to check if a component implements an enumeration. (Alan,
Harald) 

Does anyone know about this or know where I can find documentation on this?

I searched the manual, and frankly, the ChangeLog is the only placed
mentioned.

Thak you for your time.

Jason Lotito
A PHP Developer's Network Founder
www.devnetwork.net
www.newbienetwork.net


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




Re: [PHP] HTMLnetscape issue

2002-03-20 Thread Jason Lotito

Try including a nbsp; in the cell

tr
  td background=images/bottomcell_bg.gifnbsp;/td
/tr
- Original Message - 
From: Vlad Kulchitski [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 20, 2002 1:11 PM
Subject: [PHP] HTMLnetscape issue


Hi,

Sorry for repeating myself, but am lost and still can't find a solution
to the following problem, I need to specify a background image for td
like the code below:

tr
  td background=images/bottomcell_bg.gif/td
/tr

This code works EVERYWHERE (in all browsers) but Netscape Navigator 4.xx
versions.

Please help,
Thanks,
Vlad
http://kulchitski.com

-- 
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




Re: [PHP] Hi How to compare two dates using PHP which are from mysql database?

2002-03-12 Thread Jason Lotito

Why not compare them in the SQL Query itself?

Jason Lotito
www.newbienetwork.net

- Original Message -
From: Balaji Ankem [EMAIL PROTECTED]
To: 'Jan Rademaker' [EMAIL PROTECTED]
Cc: Php-General [EMAIL PROTECTED]
Sent: Tuesday, March 12, 2002 8:37 AM
Subject: RE: [PHP] Hi How to compare two dates using PHP which are from
mysql database?


 Hi Jan,
 I want to compare the DTAETIME1,DATETIME2 which are from mysql
 table and want to compare in PHP.
 But strtotime takes only one argument and it checks whether it
 is valid or not.

 Balaji

 -Original Message-
 From: Jan Rademaker [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, March 12, 2002 6:40 PM
 To: Balaji Ankem
 Cc: Php-General
 Subject: Re: [PHP] Hi How to compare two dates using PHP which are from
 mysql database?


 On Tue, 12 Mar 2002, Balaji Ankem wrote:

 http://www.php.net/manual/en/function.strtotime.php

 you can compare the results with   =, etc...

  Hi,
  I would like to compare the two dates (including time stamp)
 using
  php.
  Is it possible?
 
  Any help would be apprciable.
 
  Thanks in advance
  Balaji
 
 

 --
 Jan Rademaker [EMAIL PROTECTED]
 http://www.ottobak.com









 --
 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




Re: [PHP] Makeing $string into CAPS

2002-03-06 Thread Jason Lotito

-- Original Message 
From: Philip J. Newman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 06, 2002 4:18 PM
Subject: [PHP] Makeing $string into CAPS 


How can I make a $string = hello  into $string = HELLO?
-

http://www.php.net/manual/en/function.strtoupper.php

Jason Lotito
Programmer  Developer
Clockmedia Inc.
Designing Tomorrow's Games, Today!
1-877-625-6256
514-908-2800
Fax: 514-908-2803




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




Re: [PHP] Converting arrays

2002-02-25 Thread Jason Lotito

$d = array();
$l = array();
$l[0] = array(1, -360, 1, CHICAGO);
$l[1] = array(1, -420, 1, EDMONTON);
$l[2] = array(1, -540, 1, FAIRBANKS);

- Original Message - 
From: Gary [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 25, 2002 4:15 PM
Subject: [PHP] Converting arrays


 Hi All,
   I am not too bad at building arrays in php but I need to convert a 
 javascript form into php. How wuld I conver the small snippit here?
 
 var d = new Array(), l = new Array();
 l[0] = new Array(1, -360, 1, CHICAGO);
 l[1] = new Array(1, -420, 1, EDMONTON);
 l[2] = new Array(1, -540, 1, FAIRBANKS);
 
 TIA
 Gary
 
 
 -- 
 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




[PHP] PHPUG in Montreal

2002-02-12 Thread Jason Lotito

Hello,

As an American working in Montreal, Canada, I am very much interested in
finding out if there are any english-speaking PHP or Linux User Groups in
the area, or if fellow Montreal PHP users would like to form one.

Lets get together and spread the knowledge =)

Jason Lotito
Programmer  Developer
Clockmedia Inc.
Designing Tomorrow's Games, Today!
1-877-625-6256
514-908-2800
Fax: 514-908-2803


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




Re: [PHP] PHP Work in New York

2002-02-12 Thread Jason Lotito

- Original Message -
From: NDPTAL85 [EMAIL PROTECTED]
  I suppose that's a matter of opinion.  One thing's for sure:  where I
  work, ASP is the official scripting language.  If my boss really knew
  the difference, I'd have to use ASP instead.  I get around it by not
  bringing the subject up and by keeping my head down.
 
  I was talking with John Maddog Hall last week and he shared another
  story of some guys he knew (back in the mid-90s) who had the same
  situation as me -- they basically were told to set up a server.  No
  other instructions.  So they set up a Linux box, recognizing its
  virtues and technical prowess.  When Maddog asked them what their boss
  thought about that, they sheepishly replied that he didn't know -- they
  figured they'd wait a YEAR before telling him so that they'd have a
  good point if it came down to an argument.
 
  Much as I'd love to evangelize my open source philosophy and the merits
  of my Linux/MySQL/PHP installation, it's going to have to wait until
  I'm done with this project.

http://www.newbienetwork.net/content.php?id=56

That article basically sums up my approach on anything this nature.  Of
course, I am lucky enough to be working in a place which uses PHP/MySQL for
practically everything, and Perl in a few others.  And say ASP, and you are
liable to get your head shot off.

Jason Lotito
Programmer  Developer
Clockmedia Inc.
Designing Tomorrow's Games, Today!
1-877-625-6256
514-908-2800
Fax: 514-908-2803


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




Re: [PHP] Forms and IE

2002-02-10 Thread Jason Lotito

Answered below:

- Original Message -
From: Sean Hurley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 10, 2002 11:40 PM
Subject: [PHP] Forms and IE



 Please forgive me if this has been covered before. I have searched the
list
 and could not find reference to a similar problem.

 I am completetly new to PHP and I am stuck. I am creating a very simple
 form. Essentially the user agrees or disagrees to a message. If the user
 agrees, they are sent to another form. It they disagree they are sent
home.

 My script works with Netscape and Opera but not Internet Explorer (ver
 6.0.2) and I cannot figure out why. As I said it is very simple and the
 relevant parts are displayed as follows:
 form method=post action=agree.php
 ..
 I have read the terms and Agree input type=checkbox name=agree[]

agree[] is the problem here. For IE, it hands it to PHP, and so PHP see's it
as an array, or
$array[0]

So, take out the [] and you should be alright.

Jason Lotito
www.newbienetwork.net


 value=agree I Do Not Agree input type=checkbox name=disagree
 value=disagree
 input type=submit name=submit value=Submit
 ...
 agree.php
 ?
 if ($agree)  /* (I have tried this also with ($isset = $agree))  */
 { header (location: ?link=form);
 }
 else
 { header (location: /LETS);
 }
 ?

 As I said, this works fine with Netscape and Opera but not IE.
 Any suggestions and/or advice is appreciated.

 Thanks.



 _
 MSN Photos is the easiest way to share and print your photos:
 http://photos.msn.com/support/worldwide.aspx


 --
 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




Re: [PHP] What can I ask here?

2002-02-05 Thread Jason Lotito

You can also find good information for PHP here:

www.phpdeveloper.org
www.phpbuilder.com
www.newbienetwork.net
www.phpbeginner.com
www.php.net // of course =)
www.devshed.com

Jason Lotito
Programmer  Developer
Clockmedia Inc.
Designing Tomorrow's Games, Today!
1-877-625-6256
514-908-2800
Fax: 514-908-2803

- Original Message -
From: Girish Nath [EMAIL PROTECTED]
To: Scott [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, February 05, 2002 11:18 AM
Subject: Re: [PHP] What can I ask here?


 Hi

 You'll find the mailing list archive an excellent source of info :

 http://marc.theaimsgroup.com/?l=php-generalr=1w=2

 Regards :)


 Girish
 --
 www.girishnath.co.uk


 - Original Message -
 From: Scott [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, February 05, 2002 4:07 PM
 Subject: [PHP] What can I ask here?


 Just want to make sure I am in the right forum...

 I am new to PHP and will be doing alot of coding with it in the near
future.

 So I will be asking alot of newb questions...

 Thanks,

 Batch



 --
 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



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




RE: [PHP] - References Clarification Please -

2001-12-09 Thread Jason Lotito

Actually, $this-db will be a copy of $dbObj.

Here is what you have:

?php
$db = function2createDBObject();

Site($db);

function Site($dbObj)
{
 $this-db = $dbObj;
}

?

What this means is that $dbObj is a reference to $db.  However,
$this-db is a copy.  If you want $this-db to be a reference of $db,
you have to create a reference to $dbObj.

function Site($dbObj)
{
 $this-db = $dbObj;
}

Like that.

Jason Lotito
[EMAIL PROTECTED]
www.NewbieNetwork.net


 -Original Message-
 From: Matt Friedman [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 09, 2001 1:34 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] - References Clarification Please -
 
 
 Hi,
 
 I'm just trying to get my head around references and the uses
 etc... I have reviewed the manual section on this a few times 
 but I'm still a bit fuzzy on it.
 
 First of all, here's some code I'm using to pass a reference
 to an object (which has global scope) to the constructor of a 
 class Site:
 
 function Site($dbObj)
 {
  $this-db = $dbObj;
 }
 
 I think what should happen here is that $this-db is now a
 reference to the global version of the object, by way of the 
  in the function defn. Is this correct? 
 
 Also, I'm not sure about the benefits of using references as
 opposed to copies. If anyone would like to elaborate on the 
 reasons for using a reference instead of a copy, please do 
 so; it would be much appreciated.
 
 
 Many Thanks,
 Matt Friedman
 
 
 
 
 
 --
 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]




RE: [PHP] Help!

2001-12-09 Thread Jason Lotito

What you need to do is make sure the same person doesn't vote twice
either via cookie, session, or comparing IP address.  These are all
simple solutions.  For example, if the IP address is the same as stored
in the DB, then the person as tried to vote twice, and you can prevent
that.

Jason Lotito
[EMAIL PROTECTED]
www.NewbieNetwork.net

 -Original Message-
 From: ryan adorable [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 09, 2001 10:07 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Help!
 
 
 Hi,
 
I created a poll program for my homepage. When i vote some
 field in my database gets incremented, but after successfully 
 voting when i clicked on reload/refresh of my browser the 
 said field is also incremented. How can I fix/avoid this problem?
 
Hoping for a reply.
Thanks
 
 Ryan
 
 _
 Sign up for FREE email from FloppyDisk at
 http://www.floppydiskonline.com
 
 --
 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]




RE: [PHP] application design.

2001-12-07 Thread Jason Lotito

I would suggest Web Application Development with PHP 4.0 
ISBN: 0-7357-0997-1

Excellent book, covering developing applications, methodologies,
concepts and theories, and using PHP to do the work.  A bit old (July
2000) but covers well the concepts.

Jason Lotito
[EMAIL PROTECTED]
www.NewbieNetwork.net

 -Original Message-
 From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]] 
 Sent: Friday, December 07, 2001 1:27 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] application design.
 
 
 Hey,
 Does anyone have any tips or papers on how to design a 
 successfull aplication in PHP? How to seperate each layer of 
 information. I've read all the documents @ phpbuilder, but 
 was wondering how everyone else out there went about making 
 there appz. Regards, Kunal Jhunjhunwala
 
 
 -- 
 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]




RE: [PHP] Creating multidimensional array dynamically

2001-12-06 Thread Jason Lotito

Something like this?

while( list( $name, $attempts, $completions, $yards, $td, $int ) =
mysql_fetch_row($res) )
{
$quarterbacks[$name] = array( ATTEMPTS = $attempts,
COMPLETIONS =
$completions,
YARDS = $yards,
TD = $td,
INT = $int );
}

echo $quarterbacks[GARCIA][YARDS];

Jason Lotito
[EMAIL PROTECTED]
www.NewbieNetwork.net

 -Original Message-
 From: J. Roberts [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, December 06, 2001 4:08 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Creating multidimensional array dynamically
 
 
 I can't seem to figure out how to create a multidimensional 
 array from a database query.  Here is an example of what I 
 was looking for, using NFL quarterbacks as a statistical 
 foundation... A record contains the following fields:
 
 NAME, ATTEMPTS, COMPLETIONS, YARDS, TD, INT
 
 Now I would like to be able to create an array with NAME as a 
 key containing the array(ATTEMPTS, COMPLETIONS, YARDS, TD, INT).
 
 That way I would be able to do the following:
 
 echo $quarterbacks[GARCIA][YARDS];
 
 and get the output of 3,100 or whatever the case may be.
 
 Thanks,
 -Jamison.
 
 
 
 -- 
 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]




RE: [PHP] Is php safe for e-commerce applications?

2001-12-05 Thread Jason Lotito

Reading the Bug report, it was mentioned if you want precision
mathmatics, use BCMath

http://www.php.net/manual/en/ref.bc.php

That will give you the precision you are looking for.

Jason Lotito
[EMAIL PROTECTED]
www.NewbieNetwork.net

 -Original Message-
 From: George Whiffen [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, December 05, 2001 3:05 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Is php safe for e-commerce applications?
 
 
 What a scary day, and it just gets worse
 
 1. A user finds their account balance is displayed 
 incorrectly on one of my live e-commerce sites.
 
 2. I discover that floor() intermittently gives the wrong 
 answer i.e. 
 
 print floor(10*(8.20 - 0.20)); 
 Answer : 79
 
 print floor(10*(8.10 - 0.10));
 Answer : 80
 
 (php 4.0.6 and 4.0.4.pl1 under Linux 2.2.19.)
 
 3. I find this is a known feature with no intention of ever 
 being fixed. See http://bugs.php.net/bug.php?id=6220 
 
 print floor( (0.7 + 0.1) * 10);
 Answer : 7
 
 
 4. I check the php documentation that was added because of that bug
 (http://www.php.net/manual/en/language.types.float.php) and 
 discover :-
 
   never trust floating number results to the last digit and 
 never compare floating point numbers for equality.
 
 5. I realise that the last digit might also be the first so 
 that means never trust anything except integers!
 
 6. The truth really sinks in... It seems I simply cannot use 
 php for e-commerce applications unless I convert all money to 
 integers e.g. $4.32 must be handled as 432 cents, or all 
 arithmetic operations and comparisons have to be converted to 
 use bc functions.  Instead of :
 
  if ($cost == 10.00)
 you must write 
  if (bcomp($cost,10.00,2)) == 0) 
 etc.,etc.
 
 7. The horror unfolds...  php is just as full of geeko-trash 
 as C/Perl/Java and the rest of them! I will have to spend the 
 rest of my life worrying about types/casts/floating point 
 precision and all that garbage even when I'm just adding up 
 dollars and cents! I can't even escape to Italy and work in 
 Lira, they're switching to  euros with decimal places too! I 
 should have stayed with Java, it may be rubbish but at least 
 it's obviously rubbish!
 
 
 Please someone, tell me I'm wrong!
 
 Tell me that 0.1 + 0.7  can be 0.8 and not almost 0.8!  
 Tell me I don't have to check the last three years of work! 
 Tell me php isn't just for kids waiting to graduate/degradate 
 to Java! Tell me the techno-geeks haven't won!
 
 Hell..
 
 
 George
 
 -- 
 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]




RE: [PHP] XHTML compatible error messages

2001-12-05 Thread Jason Lotito

There is a way to turn off HTML in Errors in PHP.  This is done in
php.ini or you can use the ini_set() function to change the value.

html_errors 
boolean
Turn off HTML tags in error messages

http://download.php.net/manual/en/configuration.php

Jason Lotito
[EMAIL PROTECTED]
www.NewbieNetwork.net

 -Original Message-
 From: Matt McClanahan [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, December 06, 2001 2:05 AM
 To: Jan
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] XHTML compatible error messages
 
 
 On Fri, Aug 17, 2001 at 05:40:07PM +0200, Jan wrote:
 
  Hi out there!
  
  I have got a problem with PHP's standard way of reporting 
 errors. The 
  br in the error messages are making the XML invalid (should be 
  br/). Is there an easy way to do this?
 
 This was done in CVS a few months ago.  It should be in PHP 
 4.1.0 when it comes out shortly.
 
 Matt
 
 -- 
 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]




RE: [PHP] Multiple database seeking

2001-12-03 Thread Jason Lotito

Something like this for the SQL

SELECT ( t1.price + t2.price ) as total FROM table t1, table t2 WHERE
t1.id=1 AND t2.id=5;

Jason Lotito
[EMAIL PROTECTED]
www.NewbieNetwork.net

 -Original Message-
 From: Alen Nonkoviè [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, December 03, 2001 9:31 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Multiple database seeking
 
 
 Hello,
 
 I am trying to make a something like a cooking recipe with 
 some calculations. My problem is too much database querying. 
 Is it really a problem???
 
 Let's suppose there is a table with items and prices:
 item1price1
 item2price2
 item3price3
 ...
 
 Then I have to calculate some new indegrient price, which is 
 a result of calculating other prices:
 (ex: $new_price1 = 2*$price1 + $price2 )
 
 To get wanted prices I used standard query:
 
 
 $result = mysql_query (SELECT  price from price_list where 
 id = '01'); $row = mysql_fetch_array($result); $price1 = 
 $row[price];
 
 $result = mysql_query (SELECT  price from price_list where 
 id = '02'); $row = mysql_fetch_array($result); $price2 = 
 $row[price];
 
 //...and so on for about 30 indegrients.
 
 And on the end:
 $new_price1 = 2*$price1 + $price2;
 print $new_price1;
 
 --
 
 But, is there a quicker way to do this? Am I doing maybe the 
 wholistic mistake in process? Or this is just OK?
 
 Please, help cooking the soup ;)
 
 regards,
 Alen
 
 
 


--
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] Next Book

2001-07-08 Thread Jason Lotito

PHP Developer's Cookbook, most definetly.
http://www.amazon.com/exec/obidos/ASIN/0672319241/telvinsarchive

In all honesty, if I had just one book to choose, this would be it, and
along with the PHP Manual online, is a wonderful reference.

Jason Lotito
www.NewbieNetwork.net
PHP Newsletter: http://www.newbienetwork.net/ciao.php
PHP, MySQL, PostgreSQL Tutorials, Code Snippets, and so much more

 -Original Message-
 From: Chris Lott [mailto:[EMAIL PROTECTED]] 
 Sent: Sunday, July 08, 2001 2:24 AM
 To: Php-General (E-mail)
 Subject: [PHP] Next Book
 
 
 Finished with Beginning PHP from Wrox. Am eyeing Advanced PHP 
 from Wrox. Other good books I should think about? 
 Recommendations? Reviews? I know the PHP FAQ has pointers to 
 books, but I am looking for recommendations on what I SHOULD 
 get as I transition from a Cold Fusion person to a PHP devotee :)
 
 Also looking for a good book on MySQL. The MySQL/MSQL book 
 from O'Reilly is pretty dated.
 
 c
 
 -- 
 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]




RE: [PHP] search for a better php source code viewer

2001-06-27 Thread Jason Lotito

You mean something like this:

http://www.newbienetwork.net/phpcodems.php?as=viewcodeid=14

Jason Lotito
www.NewbieNetwork.net
PHP Newsletter: http://www.newbienetwork.net/ciao.php
PHP, MySQL, PostgreSQL Tutorials, Code Snippets, and so much more

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 26, 2001 10:26 AM
 To: [EMAIL PROTECTED]; php
 Subject: Re: [PHP] search for a better php source code viewer 
 
 
 I suggest ConTEXT.  It's free, and it's for windows.
 http://www.fixedsys.com/context
 
 And for Linux, I suggest Nedit.
 http://www.nedit.org/
 
 Tyler
 - Original Message -
 From: Jorg Krause [EMAIL PROTECTED]
 To: php [EMAIL PROTECTED]
 Sent: Tuesday, June 26, 2001 4:35 AM
 Subject: [PHP] search for a better php source code viewer 
 
 
  Hi,
  
  I'think anybody knows highlight_file, highlight_string
  or show_source, but these are not good enough.
  
  For an application I need a more advanced technique,
  which includes line numbers and let me control all formatting 
  instructions (not only font color...).
  
  Is there any script out, written in PHP (and supports PHP and HTML),

  that can be expanded by highlighting my own functions/classes, my 
  own XML-Tags etc.?
  
  Thanx for any idea,
  
  Joerg
  
  
  --
  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 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] Enter to BR

2001-06-26 Thread Jason Lotito

nl2br()
http://www.php.net/nl2br

Jason Lotito
www.NewbieNetwork.net
PHP Newsletter: http://www.newbienetwork.net/ciao.php
PHP, MySQL, PostgreSQL Tutorials, Code Snippets, and so much more

 -Original Message-
 From: Joeri Vankelst [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, June 25, 2001 6:17 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Enter to BR
 
 
 How can I get an Enter typed in a HTML textfield to be 
 inerpreted as a BR or a P tag? Someone sugested I use the 
 split() function, but I wouldn't know how...
 
 Joeri Vankelst
 
 
 
 -- 
 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]




RE: [PHP] -coding help

2001-06-24 Thread Jason Lotito

Oops..was overwriting the $result variable...heheits fixed.

?php

$connection = mysql_connect(***,,);
if ($connection==false)
   {
echo mysql_errno().:.mysql_error().;
exit;
   }

$end = $list + 16;

$query = SELECT * FROM refer ORDER BY hits desc LIMIT $list, $end;
$result = mysql_db_query (celebzone, $query);

$num = mysql_num_rows($result);

$j=0;
$i=0;
echo table border=0\n;

for ($j = 0; $j  $num; $j++)
{
echo 'tr\n';
for ($i = 0; $i = 1; $i++)
{
@$data = mysql_fetch_array($result);
@$id = $data[id];
@$title = $data[title];
  
echo td\n;
echo $title;
echo /td\n;
}
echo /tr\n;
}

echo /table;
echo brbr\n;


?


Jason Lotito
www.NewbieNetwork.net
PHP Newsletter: http://www.newbienetwork.net/ciao.php
PHP, MySQL, PostgreSQL Tutorials, Code Snippets, and so much more

 -Original Message-
 From: McShen [mailto:[EMAIL PROTECTED]] 
 Sent: Sunday, June 24, 2001 10:45 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] -coding help
 
 
 Jason, your scripts works prefectly in creating a table. But, 
 It only ouputs the first query from the databse. Others are 
 not shown. Jason Lotito [EMAIL PROTECTED] wrote in 
 message 000f01c0fc67$abfe3a90$72003bd0@genric">news:000f01c0fc67$abfe3a90$72003bd0@genric...


-- 
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] -coding help

2001-06-23 Thread Jason Lotito

This should work...

?php

$connection = mysql_connect(***,,);
if ($connection==false)
   {
echo mysql_errno().:.mysql_error().;
exit;
   }

$end = $list + 16;

$query = SELECT * FROM refer ORDER BY hits desc LIMIT $list, $end;
$result = mysql_db_query (celebzone, $query);

$num = mysql_num_rows($result);

$j=0;
$i=0;
echo table border=0\n;

for ($j = 0; $j  $num; $j++)
{
echo 'tr\n';
for ($i = 0; $i = 1; $i++)
{
@$result = mysql_fetch_array($result);
@$id = $result[id];
@$title = $result[title];
  
echo td\n;
echo $title;
echo /td\n;
}
echo /tr\n;
}

echo /table;
echo brbr\n;


?

Jason Lotito
www.NewbieNetwork.net
PHP Newsletter: http://www.newbienetwork.net/ciao.php
PHP, MySQL, PostgreSQL Tutorials, Code Snippets, and so much more


 -Original Message-
 From: McShen [mailto:[EMAIL PROTECTED]] 
 Sent: Saturday, June 23, 2001 11:22 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] -coding help
 
 
 Hi
 
 I have a script which queries mySQL and outputs 32 links at 
 once. Here is my scipt
 
 ?php
 
 $connection = mysql_connect(***,,);
 if ($connection==false)
{
 echo mysql_errno().:.mysql_error().;
 exit;
}
 
 $end = $list + 16;
 
 $query = SELECT * FROM refer ORDER BY hits desc LIMIT $list, 
 $end; $result = mysql_db_query (celebzone, $query);
 
 $num = mysql_num_rows($result);
 
 $j=0;
 $i=0;
 echo table border=0\n;
 echo tr\n;
 while ($j!=$num)
 {
 @$r = mysql_fetch_array($result);
 @$id = $r[id];
 @$title = $r[title];
 
   echo td\n;
   echo $title;
   echo /td\n;
 // new row in table every other link
 $i++;
  if (($i % 2)  1)
   {
   echo /tr\ntr\n;
   }
 
 $j++;
 }
 echo /table;
 
 echo brbr\n;
 
 
 ?
 ---
 And here is the link to see it in action 
 http://www.celebritieszones.com/ln.php?list=0
 
 If you check 
 my HTML source, at the end, right before /table, you will 
 see an extra tr. I know the cause of this. It's because of this
 ---
 
 $i++;
  if (($i % 2)  1)
   {
   echo /tr\ntr\n;
   }
 
 -
 
 I don't know how to fix the problem. Please help me re-write 
 the script a bit so that it doesn't add the extra tr.
 
 Thanks in advance.


-- 
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] A web server query

2001-05-24 Thread Jason Lotito

http://badblue.com/

That should be what you are looking for.

Jason Lotito
www.NewbieNetwork.net
PHP Newsletter: http://www.newbienetwork.net/ciao.php
PHP, MySQL, PostgreSQL Tutorials, Code Snippets, and so much more

 -Original Message-
 From: Parag Mehta [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, May 24, 2001 4:50 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] A web server query
 
 
 Hi Guys,
 
 new to the list.
 
 i would like to know if there is any smal webserver like boa 
 or thttpd which supports php ?
 
 best regards,
 
 parag mehta
 
 Kernel panic: I have no root and I want to scream --- 
 perfect error message 
 
 
 -- 
 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]




RE: [PHP] OT PHP Manuals

2001-05-22 Thread Jason Lotito


 
 Matt McClanahan wrote:
 
  On Wed, May 23, 2001 at 10:37:06AM +0930, Joseph Blythe wrote:
  
  Hey all,
  
  Just was wondering if anyone knew what was used to make the php
  manuals
  in the windows help format (.chm), I really like them :-)
  
  
  The manual is availabe in chm in several languages.
  
  http://www.php.net/docs.php
  
  Matt
 
 If you ask a silly question you get silly answers, so far I
 have a why 
 and where to get the actual manual that I was trying to find out what 
 software was used to make it.
 
 LOL :-)
 
 Joseph.


Joseph,

I was actually about to type back in response explaining to everyone
that you asked WHAT was use to make the .chm files.  You must forgive my
colleagues, they sometimes forget to actually read the email, rather
than just scan the email for common key words and phrases signifying a
newbie with a RTFM type question.

While I don't know what was used to create the PHP .chm files, here is a
listing of a set of freeware programs that can be used:

http://www.webattack.com/freeware/webpublish/fwhtmlhelp.shtml

I have not, however, used any personally.

Jason Lotito
www.NewbieNetwork.net
PHP Newsletter: http://www.newbienetwork.net/ciao.php
PHP, MySQL, PostgreSQL Tutorials, Code Snippets, and so much more


-- 
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] Send attachments with an email (Sample Code for you lot :))

2001-05-21 Thread Jason Lotito

Jason, 

I hope you don't mind, but I posted your script in my Code Depository
located here:

http://www.newbienetwork.net/phpcodems.php?as=viewcodeid=24

You are given credit, and hopefully it can get some use out of it.

Either way, thanks for showing us.  =)

Jason Lotito
www.NewbieNetwork.net

 -Original Message-
 From: Jason Murray [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, May 21, 2001 11:34 PM
 To: '[EMAIL PROTECTED]'
 Subject: [PHP] Send attachments with an email (Sample Code 
 for you lot :))
 
 
 Hi folks,
 
 I see this question asked here all the time, and recently had 
 to implement it. Every class and solution I downloaded and 
 tried to use failed for one reason or another, so I threw 
 together this, instead.
 
 Advatages:
  * Quick :)
  * It's a function, so you can call it from most places if 
 it's include()'d.
 
 Disadvantages:
  * Quick, so probably buggy :)
  * I haven't put in any facility for sending a HTML version 
 of your mail text
yet. We don't send HTML mails @ Melbourne IT, so it wasn't needed.
 
 Usage:
 
mailattachments((DestinationAddress), (Subject), (Email 
 Body), (File Attachment Info),
(Extra Headers));
 
File Attachment Info is an array:
 
$fileattach[] = array(filename = 
 /full/path/to/file/on/your/system,
  mimetype = mimetype/here);
 
 And the code guts:
 
 ?
Function mailattachments( $to, $subject, $body, $attacharray,
 $extraheaders)
{
  // Generate a unique boundary
  $mail_boundary = md5(uniqid(time()));
  
  // MIME-compliant headers
  $mailheaders = $extraheaders
.MIME-Version: 1.0\r\n
.Content-type: 
 multipart/mixed;boundary=\$mail_boundary\\r\n
.\r\n
.This is a multipart MIME message\r\n
.\r\n;
  
  // Body. The part that gets displayed as the message:
  $mailbody = --$mail_boundary\r\n
 .Content-type: text/plain;charset=us-ascii\r\n
 .Content-transfer-encoding: 8bit\r\n
 .\r\n
 .$body
 .\r\n;
  
  // Now, do the attachments
  for ($i = 0; $i  count($attacharray); $i++ )
  {
$fp = fopen($attacharray[$i][filename], r);
$file = fread($fp, filesize($attacharray[$i][filename]));

$file = base64_encode($file); // 
 BASE64-encoded.
 Text. Nice.
$file = chunk_split($file);   // 
 Now in handy
 bite-sized 76-char chunks.
$filename = basename($attacharray[$i][filename]);

$mailbody .= --$mail_boundary\r\n
.Content-type: 
 .$attacharray[$i][mimetype].; name=.$filename.\r\n
.Content-transfer-encoding: base64\r\n
.\r\n
.$file
.\r\n
.\r\n;
  }
  
  // End of mail
  $mailbody .= --$mail_boundary--;
 
  mail($to, $subject, $mailbody, $mailheaders);
}
 ?
 
 Hope this helps someone out there...
 
 Jason
 
 -- 
 Jason Murray
 [EMAIL PROTECTED]
 Web Developer, Melbourne IT
 What'll Scorpy use wormhole technology for?
 'Faster pizza delivery.'
 
 -- 
 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]




RE: [PHP] echo question

2001-05-19 Thread Jason Lotito

You are looking for the function nl2br()

Information here: http://www.newbienetwork.net/article.php?sid=70
And here: http://www.php.net/manual/en/function.nl2br.php

See echo statement below for example implementation.

Jason Lotito
www.NewbieNetwork.net

 -Original Message-
 From: Louis Brooks [mailto:[EMAIL PROTECTED]] 
 Sent: Saturday, May 19, 2001 8:01 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] echo question
 
 
 Hi All:
 
 I need to print out several paragraphs of information stored 
 in a MySql 
 field to a web page. To do this I am using:
 
 $db = mysql_connect(localhost, dbase, password); 
 mysql_select_db(dbase,$db); $sql = SELECT update FROM 
 members WHERE username = 'Don'; $query = mysql_query($sql); 
 $results = mysql_fetch_array($query); $text = $results[update];
 

echo nl2br($text);

 
 but it does not insert the returns between the paragraphs. I 
 think I need 
 to tell it to insert a p in place of the return. There is a 
 way to do 
 this as I have seen it on the PHP site when I was searching 
 for something 
 else. Of course now that I need it I can't find the example. 
 Can someone 
 please help me figure this out?
 
 Thank you,
 
 Louis Brooks
 
 
 -- 
 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]




RE: [PHP] plain text email address to hyperlink?

2001-05-17 Thread Jason Lotito



 -Original Message-
 From: Robert Reed [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, May 17, 2001 10:36 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] plain text email address to hyperlink?
 
 
 I've attempted to use the following snippet to convert an 
 email address in plain text to a hyperlink, and while it 
 works fine in a function to verify an email address, it 
 doesn't seem to work to replace all occurances of an email 
 address within a body of text.
 
 
 $page = 
 eregi_replace(^[0-9a-z]+([-_./]([0-9a-z]+))*@[0-9a-z]+([-.]([
 0-9a-z]+))*\\.
 [a-z]{2,4}$,a href=\\\1\\\1/a,$pageOne);
 
 echo $page;
 
 
 $pageOne is the body of text that has the email address(es) 
 in it.  Is there a better way of doing this, or would I have 
 to bend and use an array to scan each word for an email 
 address and then convert them from there?
 
 Thanks in advance,

You can find the code here:
http://www.newbienetwork.net/phpcodems.php?as=viewcodeid=6

Enjoy.

Jason Lotito
www.Newbienetwork.net


-- 
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] This newsgroup

2001-05-15 Thread Jason Lotito

This is not a Newsgroup.  It is a Mailing List.  That means ALL the
emails are stored on your computer.

So, the answer to both your questions is however much you want to keep.

Jason Lotito
www.NewbieNetwork.net

 -Original Message-
 From: Paulo Rocha [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, May 15, 2001 6:47 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] This newsgroup
 
 
 I am also curious to know how much disk space is php.general taking.
 
 elias wrote:
  
  Just wondering...
  That the first newsgroup i ever joinedand I noticed 
 that it hold 
  almost 100,000 message w/o deleting old one and keeping new ones...
  
  How much can it hold? How much it's owner will allow it to hold 
  messages?
 
 
 -- 
 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]




RE: [PHP] preview function with upload

2001-05-11 Thread Jason Lotito



 -Original Message-
 From: Mark Lo (3) [mailto:[EMAIL PROTECTED]] 
 Sent: Friday, May 11, 2001 4:39 AM
 To: ListPHP Mailing
 Subject: [PHP] preview function with upload 
 
 
 Hi,
 
 Does anyone know how to implement a preview function.  
 That preview function is work after selecting the specific 
 picture to upload in php upload function, when people click 
 the preview function, the the selected upload product will 
 show up on the screen.  Hope, I am clear enough.
 
 Thank you
 
 Mark


Yes.  What you do after they have Browsed (using the appropriate form
functions), you simply capture the actual Client side Machine path of
the image they want to upload, and set that as the Img tags SRC value.
For example:

img src=C:\Documents and Settings\Administrator.GENRIC\My Documents\My
Pictures\Sample.jpg

This will display the image to the person.  While I have not tested it
out on various browsers, I know it works in IE, and don't see any reason
why it wouldn't work on other browsers.  After this, they simply click
agree, and the normal file uploading procedure goes from there.

Jason Lotito
www.NewbieNetwork.net
VI VI VI : Editor of the Beast 


-- 
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] php/postgres display information...

2001-05-08 Thread Jason Lotito



 -Original Message-
 From: Daniel L. Ferrell [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 08, 2001 4:07 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] php/postgres display information...


 hey guys,
alright, I am new to using php to interface with a
 database, right now I
 am trying to display just the primary keys for a table in my database, can
 someone point me in the right direction on how to use php to display this
 information?

  Dan

http://www.newbienetwork.net/sections.php?op=viewarticleartid=21 - For
PostreSQL

http://techdocs.postgresql.org - Other docs on PostreSQL.

Jason Lotito
www.NewbieNetwork.net


-- 
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] Trim a string

2001-05-06 Thread Jason Lotito

 -Original Message-
 From: Kyle Mathews [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, May 06, 2001 4:46 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Trim a string
 
 
 Hello:
 
 I have a signup form that asks for a website address.
 I don't need them to put in the http://, but I'm thinking that 
 some will try
 anyway.
 Is there a way to check for this and remove it when the user submits the
 form?
 
 Thanks,
 Kyle
 [EMAIL PROTECTED]
 http://www.thedip.net


str_replace()

$string = http://www.foo.com;;

$string = str_replace(http://,,$string);

echo $string;

Will echo out:

www.foo.com

For more information:
http://www.php.net/str-replace

Jason Lotito
Webmaster Newbie Network - http://www.NewbieNetwork.net
EIC PHP Weekly Newsletter - http://www.newbienetwork.net/ciao.php



-- 
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] phpsucks.com

2001-04-28 Thread Jason Lotito

  i found this when surfing this morning
  http://www.phpsucks.net/
 -Original Message-
 From: Daevid Vincent [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, April 28, 2001 5:53 PM

 someone has way too much time on their hands...

 what a dick.


Mockery is the biggest form of flattery.  haha..I just laughed and drove on.

Jason Lotito
www.NewbieNetwork.net
http://www.faqts.com/knowledge_base/view.phtml/aid/8720/fid/455 - New to
the List, Read 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]




RE: [PHP] Searching arrayed file... Suggestions?

2001-04-21 Thread Jason Lotito

 And that is all the code I use. Where have I done wrong? You see, the
 problem is that I found only some links, but not all. And if I have a link
 called "Necrolust - Tribute to MayheM", it cannot find the "Necro" nor
 "necRO". And as you can see, I HAVE used uppercase methods to
 find portions
 and so forth. Any help is suggested!!

Seriously consider using MySQL or PosgreSQL, or some other form of DBMS.
They will make your life so much easier.

Jason Lotito
www.NewbieNetwork.net


-- 
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] Weekly Salary for PHP/MySQL or PostgreSQL Programmer

2001-04-20 Thread Jason Lotito

Question: A PHP/MySQL or PostgreSQL Programmer.  How much per week (In
american money) is a good price range for a small but promising startup to
pay said programmer per week?  Understanding everyone has their own opinions
on this matter, if you could include the salary and the reasoning why?
Also, other things to consider.

I am asking this because a recent venture of mine seems to be panning out,
and if it goes as projected will take off rather quickly, and I will need to
hire people on either a contract basis or full time basis, and I am just
looking to see where salary stands (don't want to overpay and lose profit,
but don't want to underpay and insult anyone).

Thanks
Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] Newbie Help!! Please Look!

2001-04-18 Thread Jason Lotito

 -Original Message-
 From: Tony Daniels [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 18, 2001 8:18 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Newbie Help!! Please Look!
 
 
 Hello,
 
 I need to know if there is a program out there that I can use to edit
 the PHP files.

Any text editor.  Example: Notepad.

  I use CuteFTP to download the files from my server as I
 need to change some wording around from time to time.  Does anyone know
 the correct procedure for downloading a php file with CuteFTP and then a
 program that I can use to edit the text I need to edit.

1) Download the php file just like you would a html file.
2) Edit the file using a text editor.

  Then also, the
 correct way to upload it back to the server using CuteFTP.  Do I use
 Binary or ACII.

Neither.  You use ASCII.

 
 Or, if I am way off and there is a program that makes CuteFTP look
 silly, please let me know this also.

I don't think so, though funny is a relative word.  I use WS_FTP.

  I am open for any suggestions, as
 long as they are detailed.  Please email responses to [EMAIL PROTECTED]

You mean to reply to the PHP Mailing list, right?

 .
 
 Thank you!

Your welcome.

-- 
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] __ $8/mo php hosting on 24/7, OC3+ web server ___

2001-04-10 Thread Jason Lotito



 Subject: RE: [PHP] __ $8/mo php hosting on 24/7, OC3+ web server

I wonder if they charge extra for HTML hosting?  =)

But seriously, WoW!  My own dedicated OC3 line!  Man, for only
$8/month..that rocks!

  I am offering php hosting with features at a price no one else has, as
  far as I know.

Nope, your right, some places even offer less!


-- 
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] URL w/o script name

2001-04-09 Thread Jason Lotito

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 09, 2001 4:50 AM
 To: elias
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] URL w/o script name
 
  and sometimes i see:
 
  www.site.com/?asdasdf=adasd
 
  can someone please explain me this process.

 the server looks in its configuration (for example Apache: DirectoryIndex
 index.php) and returns this page - with the GET-Varaibales as well (your
 Browser doesn't have to know, what this page's name is!)

 But I'm sure you can configure your webserver (or put it in your
 script) to
 make a 301/2/3 and redirect to the full URL!

 witty

Just to point out, the /?asdf=asdf style is poor in my opinion, more so
because I have experienced errors (well, visitors have experienced errors)
with links that were linked like that.  I believe it was a Lynx user, or
maybe Opera, don't remember.  However, the fact is that I suggest actually
putting the script name in there. =)

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] where might I find a good php page

2001-04-08 Thread Jason Lotito

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, April 08, 2001 5:13 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] where might I find a good php page


 I'd really like to learn PHP but where ?
 I know some basic perl but havent lookt that deep in PHP yet. any leads ??
 =)

 sincerly // Ken

www.newbienetwork.net
www.phpbuilder.com
www.phpdeveloper.org
www.devshed.com
www.php.net/manual
www.phpbeginner.com

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] Nearly all (1755) PHP functions in a text file

2001-04-06 Thread Jason Lotito

WoW.  That is UberGeek!  I am humbledcool...fear not, good sir, for that
list will become very handy indeed.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


 -Original Message-
 From: Plutarck [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 06, 2001 12:17 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Nearly all (1755) PHP functions in a text file


 First of all I use Edit Plus, which uses a list of PHP functions to know
 what words to highlight in the code.

 Well now that I have a seriously throbbing headache, I've done
 it. Finally.

 If you use a program that needs a list of functions for syntax
 highlighting,
 I've finally got one that has every function according to PHP
 get_defined_functions (includes quite a few undocumented
 functions), the PHP
 manual, and quite a few others it failed to mention but should be
 highlighted. unset() is a good example, along with print/echo, I
 managed to
 put it together. Every entry on it's own line (so it's seperated by "\n").

 My head feels like it is being used as the repository for Anna Nichole
 Smith's silicone breast implants (both failed and spare parts for future
 use).

 In any case, there are 1755 entries in the blasted thing. If it's
 in the PHP
 manual or get_defined_functions, it's in there. And damn is that alot.

 Here is the link to the text file:
 http://crazyoddball.hypermart.net/php.stx.txt


 However I learned so many cool things with so many functions I'd like to
 use, but I have a severe headache and have to go to work (I'll be in a car
 the whole time, so no computer) in one hour, and I haven't slept.

 And I'm not getting paid for this either.

 Ah yes, this is GeekLife. But I have no caffiene in my system. So this is
 the GranolaGeekLife...GGL...giggle?



 Well whatever I end up doing/not-doing, enjoy! Hopefully the thing will be
 useful.

 I certainly hope so, because compiling the whole thing was overkill if I'm
 the only one that will use it :)



 --
 Plutarck
 Should be working on something...
 ...but forgot what it was.



 --
 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]




RE: [PHP] Print or Echo.

2001-04-06 Thread Jason Lotito



 -Original Message-
 From: Alexander Wagner [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 06, 2001 3:24 PM
 To: [EMAIL PROTECTED]
 Cc: PHP
 Subject: Re: [PHP] Print or Echo.
 
 
 Jeff Oien wrote:
  "As for a print vs. echo, echo gives you more options,
  such as being able to continue output on multiple lines
  like an EOT in perl. Look at the above notes. With print
  you would not be able to accomplish this."
 
 There's another difference. print() returns true on success and false 
 when called after a connection abort. Echo doesn't, and that's why it's 
 slightly (very slightly) faster.
 
 regards
 Wagner
 


http://www.e-gineer.com/articles/php-hackers-paradise.phtml

More details here on Print/Echo/Inline

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] AUTO_INCREMENT with MySQL phpmyadmin

2001-04-06 Thread Jason Lotito



 -Original Message-
 From: Plutarck [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 06, 2001 10:35 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] AUTO_INCREMENT with MySQL  phpmyadmin


 At first I thought this might be better suited on the mysql list,
 but since
 I'm using phpmyadmin I thought it better to ask here.

 My problem is I can't figure out how to create a column with the
 auto_increment attribute. I want to make one called userid whose value is
 one higher than the highest number in the userid column, which
 according to
 the manual is exactly what auto_increment should do.

 But I flat out can't figure out how to do it.

 I'm using the "add new field" attribute in phpmyadmin, and I've
 tried making
 one with no name and with many different names, and I don't get nuttin'.

 Occassionally it will announce that the table was altered with something
 like the message:

 SQL-query:
 ALTER TABLE test_kingdoms_userauth ADD useridi TINYINT not null
 AUTO_INCREMENT

 But according to the display, no matter how many times I refresh it, there
 is no listing of ANY column other than the two I currently have.

 So I'm totally confused, and out of the whole mysql manual I just
 don't know
 what's wrong.


 So the question:

 What kind of selections do I need to make to create an AUTO_INCREMENT
 column?



Can you post the current schema (design) of the table with datatypes, etc.

http://www.newbienetwork.net/sections.php?op=viewarticleartid=10

Also, check out the above link, that my help some.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.



-- 
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] better functionality in query ?

2001-04-05 Thread Jason Lotito


 I'm in process of creating a online whitepages directory for
 a small town phone company and I am having a little difficulty
 in refining my selection. My search form has two fields; last
 and first name. I would like to be able to have more of a wild
 card approach and some refinement when a user enters both a
 first and last name. I am unsure how to go about this, should
 I restructure my query, or make changes to my PHP. here is the
 query I am currently using. and the site is located at
 http://whitepages.maadtelco.com/ any assistance/direction is certainly
 appreciated.

 snip
 $query = "select * from whitepages WHERE last_name LIKE '$last_name' ORDER
 BY last_name" or die("Nothing to see here");
 /snip


$query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' ORDER
BY last_name" or die("Nothing to see here");

Question, why are you 'die'ing on a variable assigntment? Wouldn't you want
to 'die' on the actualy db_query()?

Note the added '%', this is assuming you are using MySQL, though they are
generally the same, I believe, with other DB's.  The % is essentially
wildcard of any amount.  So, if the last_name was BOB

it would find

BOBBY
BOBBER
ADOBOB

$query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%'
$andor first_name LIKE '%$first_name' ORDER
BY last_name" or die("Nothing to see here");

In this query, we are including the First Name.  In this, we are also using
the $andor variable, which you can define as AND, or OR, or allow the user
to define it by using a radio box or the like when making the search.  I
suggest setting a default of OR for the variable $andor.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] about php.ini

2001-04-05 Thread Jason Lotito



 On Thursday 05 April 2001 20:30, you wrote:
  Hi all,
 
  i'm would to know if there is a doc that give all php.ini possiblities
  with all variables that can be set or something like that

 Yes. Most people call it "PHP Manual"

 --
 Christian Reiniger
 LGDC Webmaster (http://sunsite.dk/lgdc/)

Can I get a URL to it?

No, no, Just Kidding, sorry, couldn't resist, sorry... oh...it has been a
long week.

=)

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] better functionality in query ?

2001-04-05 Thread Jason Lotito

   I'm in process of creating a online whitepages directory for
   a small town phone company and I am having a little difficulty
   in refining my selection. My search form has two fields; last
   and first name. I would like to be able to have more of a wild
   card approach and some refinement when a user enters both a
   first and last name. I am unsure how to go about this, should
   I restructure my query, or make changes to my PHP. here is the
   query I am currently using. and the site is located at
   http://whitepages.maadtelco.com/ any assistance/direction is certainly
   appreciated.
  
   snip
   $query = "select * from whitepages WHERE last_name LIKE
 '$last_name' ORDER
   BY last_name" or die("Nothing to see here");
   /snip
 
 
  $query = "SELECT * FROM whitepages WHERE last_name LIKE
 '%$last_name%' ORDER
  BY last_name" or die("Nothing to see here");
 
  Question, why are you 'die'ing on a variable assigntment?
 Wouldn't you want
  to 'die' on the actualy db_query()?
 
  Note the added '%', this is assuming you are using MySQL,
 though they are
  generally the same, I believe, with other DB's.  The % is essentially
  wildcard of any amount.  So, if the last_name was BOB
 
  it would find
 
  BOBBY
  BOBBER
  ADOBOB
 
  $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%'
  $andor first_name LIKE '%$first_name' ORDER
  BY last_name" or die("Nothing to see here");
 
  In this query, we are including the First Name.  In this, we
 are also using
  the $andor variable, which you can define as AND, or OR, or
 allow the user
  to define it by using a radio box or the like when making the search.  I
  suggest setting a default of OR for the variable $andor.
 
  Jason Lotito



 On Thu, Apr 05, 2001 at 04:51:47PM -0700, Jerry Lake wrote:
  Damn, if I'd a known it was that easy ;)
  Thanks for the help, works great now.
 


-Original Message-
 From: Joe Stump [mailto:[EMAIL PROTECTED]]

 NOTE(!): LIKE '%foo%' DOES NOT SCALE. It looks like you are
 making a phone book,
 which could get to be a lot of numbers. On the other hand 'foo%'
 oddly scales to
 hundreds of thousands of records without any problems (make sure
 it's key'd!).

 Which should work fine in your instance - just have people type
 in the first
 4 letters of the persons name.

 --Joe



Very true, good point.  Good thing to keep in mind, and something I
overlooked.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] Reading from a webpage

2001-04-04 Thread Jason Lotito


 Hello List,

 I have a small problem reading information from a webpage. I have
 a list of
 about 40 pages that I need to read (doing it in a loop as the
 layout is the
 same on each page).

 What I would like to know is whether the information read from a
 webpage is
 actually the information that we see or whether it is the
 underlying source
 code. I understand that depending on what it is will mean changes to the
 way I retrieve the information.

 If you need additional information, please contact me and let me know.

 Thank-you.

 James

Go to the website.  Then, View Source in the Browser.  That is what you will
get when you 'read' the web page.  This is because any server side
information is already parsed by the time it sends the information out.  You
should feel happy this is true, I don't want people getting a hold of
passwords or other vital information. =)

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] query 2 databases from one script

2001-04-03 Thread Jason Lotito

 "Michael Roark" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I've a script has many functions in it all of which hit databaseA . I've
  added a new function which is to get data from databaseB how can I go
 about
  this in one script when I try to connect to a database other
 than the one
  defined at the beginning of the script all the functions in the script
  break as if I am setting the wrong database at the top of the
 script. Any
  help would be greatly appreciated.
 
  Michael Roark

I know this is not the direction you wanted to go, however, I have an
important question.  Why would you need 2 databases?  What is the stucture,
what are you trying to accomplish with the script, and why the need for 2
databases?

This sounds more like poor database design, and if solved, would avoid such
problems.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.



-- 
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] Page Counter

2001-04-02 Thread Jason Lotito

http://newbienetwork.net/sections.php?op=viewarticleartid=1

Read it, Learn it.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.

 -Original Message-
 From: Wen Ni [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 02, 2001 3:33 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Page Counter
 
 
 Dear Friends,
 
 I want to do page counter for my web site and I wonder whether PHP can
 do it or not.  I am new in PHP so can you all please give me some idea
 how to solve my problem.
 
 Thank a lot.
 
 regards,
 Wendy
 

-- 
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] Metabase Opinions

2001-04-02 Thread Jason Lotito

Looking into Database Abstraction, and I was recommended to Metabase.  I
have looked over it, and found that I like it.  However, I was looking to
gain further insight as to other people using Metabase, and their
experiences with it, good, bad, problems, no problems, etc.

Thank you

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] Safety with PHP.

2001-04-02 Thread Jason Lotito

Of course, you can always disable certain functions, etc, that you deem to
insecure.  PHP is as secure as you make it.

~Nuff said

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 02, 2001 10:54 PM
 To: Marthe Kristiansen
 Cc: Php-General
 Subject: RE: [PHP] Safety with PHP.


 So you wrote a script that took a filename as an argument somehow and did
 something with it?  That's always going to be insecure unless you do a lot
 of error checking on it.

 -Rasmus

 On Tue, 3 Apr 2001, Marthe Kristiansen wrote:

  Well, since I'm a newbie and also Norwegian it ain't that easy
 to explain
  very simple.
  What he did was that he entered a file that showed all the users of the
  server, as I said, and he told me this was kindof insecure.
  To prevent it he showed me a code that would help a bit.
 
  $filename=str_replace("..","",$filename);
  $filename=str_replace("/","",$filename);
  $filename=str_replace("%20","",$filename);
 
  He used /, .. and %20 to reach this file on my server.
 
  /Marthe


 --
 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]




RE: [PHP] Safety with PHP.

2001-04-02 Thread Jason Lotito

If you could post the actual thing that he did, the actual script, that
would be helpful.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


 -Original Message-
 From: Marthe Kristiansen [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 02, 2001 11:05 PM
 To: Php-General
 Subject: RE: [PHP] Safety with PHP.


 Is there an easy way to do this when I'm so new at this that I don't quite
 understand what I'm doing wrong and how to prevent all those
 mistakes in the
 beginning?

 /Marthe


-- 
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] Better way (if...elseif...else)

2001-03-29 Thread Jason Lotito




 -Original Message-
 From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 29, 2001 1:56 PM
 To: PHP-General List
 Subject: [PHP] Better way (if...elseif...else)



 Is there a better way to write the following snippet:

 if ($priority == "000") {
   $fcol="high";
   $pstr .= "option value=\"000\" selectedHigh\n";
   $pstr .= "option value=\"050\"Medium\n";
   $pstr .= "option value=\"100\"Low\n";
 } elseif ($priority == "050") {
   $fcol="med";
   $pstr .= "option value=\"000\"High\n";
   $pstr .= "option value=\"050\" selectedMedium\n";
   $pstr .= "option value=\"100\"Low\n";
 } else {
   $fcol="low";
   $pstr .= "option value=\"000\"High\n";
   $pstr .= "option value=\"050\"Medium\n";
   $pstr .= "option value=\"100\" selectedLow\n";
 }

 I just hate having to repeat pieces of code.  This piece here just
 generates a drop down list of items, with the current one being the
 selected one.


$val = array("000","050","100");
$val_name = array("Low","Medium","High");
$count = count($val);
$counter = 0;
while ($counter  $count)
{
if ($val[$counter] == $priority)
{
$selected = " selected";
}
echo "option
value=\"$val[$counter]\"$selected$val_name[$counter]/option";
$counter++;
}


-- 
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] Better way (if...elseif...else)

2001-03-29 Thread Jason Lotito



 -Original Message-
 From: Morgan Curley [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 29, 2001 2:52 PM
 To: PHP-General List
 Subject: RE: [PHP] Better way (if...elseif...else)


 Make sure you reset $selected at the end of the while loop.


OoPs!  Yes, reset $selected, haha.

 if HTML readability is a concern you can also do something like the
 following( for static lists I find it easier this way ):

 ?php $priority_selected[$priority] = 'SELECTED'; ?
 SELECT NAME="priority"
  OPTION VALUE="000" ?php echo($priority_selected['000'])?Low
  OPTION VALUE="050" ?php
 echo($priority_selected['050'])?Medium
  OPTION VALUE="100" ?php echo($priority_selected['100'])?High
 /SELECT

 morgan

 At 05:30 PM 3/29/2001 -0800, Jason Lotito wrote:



   -Original Message-
   From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, March 29, 2001 1:56 PM
   To: PHP-General List
   Subject: [PHP] Better way (if...elseif...else)
  
  
  
   Is there a better way to write the following snippet:
  
   if ($priority == "000") {
 $fcol="high";
 $pstr .= "option value=\"000\" selectedHigh\n";
 $pstr .= "option value=\"050\"Medium\n";
 $pstr .= "option value=\"100\"Low\n";
   } elseif ($priority == "050") {
 $fcol="med";
 $pstr .= "option value=\"000\"High\n";
 $pstr .= "option value=\"050\" selectedMedium\n";
 $pstr .= "option value=\"100\"Low\n";
   } else {
 $fcol="low";
 $pstr .= "option value=\"000\"High\n";
 $pstr .= "option value=\"050\"Medium\n";
 $pstr .= "option value=\"100\" selectedLow\n";
   }
  
   I just hate having to repeat pieces of code.  This piece here just
   generates a drop down list of items, with the current one being the
   selected one.
 
 
 $val = array("000","050","100");
 $val_name = array("Low","Medium","High");
 $count = count($val);
 $counter = 0;
 while ($counter  $count)
 {
  if ($val[$counter] == $priority)
  {
  $selected = " selected";
  }
  echo "option
 value=\"$val[$counter]\"$selected$val_name[$counter]/option";
  $counter++;
 }
 
 
 --
 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]




RE: [PHP] Better way (if...elseif...else)

2001-03-29 Thread Jason Lotito

 -Original Message-
 From: Stephan Ahonen [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 29, 2001 5:20 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Better way (if...elseif...else)


  $val = array("000","050","100");
  $val_name = array("Low","Medium","High");
  $count = count($val);
  $counter = 0;
  while ($counter  $count)
  {
  if ($val[$counter] == $priority)
  {
  $selected = " selected";
  }
  echo "option
  value=\"$val[$counter]\"$selected$val_name[$counter]/option";
  $counter++;
  }

 Not quite... You need to reset $selected so that you don't end up
 with them
 all being selected when $priority="000". It's a pretty clever
 idea, though.


Yeah, someone mentioned that after I posted it, then I took a shotgun to my
foot..haha.  Yeah, well, hey, I release that code as a Beta Version anyways!
=)

Yes, good ole' for, though I have been so inundated with while() that it
just comes naturally.  Hey, at least I don't printf() people to death!

=)

 I've rearranged stuff a bit to make it look prettier, and to match the
 original functionality closer. Nothing personal, but I can't stand it when
 people use while for stuff that looks prettier as a for. =)

 $val = array("000","050","100");
 $val_name = array("High","Medium","Low");
 $fcol_name = array("high","med","low");
 $count = count($val);
 for ($counter = 0; $counter  $count; $counter++) {
  $selected = "";
  if ($val[$counter] == $priority) {
   $selected = " selected";
   $fcol = fcol_name[$counter];
  } //if
  $pstr .= "option
 value=\"$val[$counter]\"$selected$val_name[$counter]/option\r\n";
 } //while

 Sig for a Day
 Stephan Ahonen, ICQ 491101


-- 
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] MS SQL errors...

2001-03-29 Thread Jason Lotito



 -Original Message-
 From: Christian Dechery [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 29, 2001 6:23 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] MS SQL errors...


 why do MS SQL reports errors so poorly on PHP?

 you can do anything with those errors, they're useless... and the worse
 part is the actual important part of the error is in the warning, and not
 on the contents of mssql_get_last_message(), where they should be...

 and, worse... mssql_query() returns false even when they query ran ok...

 I have a script that runs a lot of queries that loads several 'alter
 tables' into mssql to create FKs... for some reason when the query is run
 it generates a warning like this: " Context changed to database
 'LIQUID' ",
 which is not really an error, and the query is executed... but returns
 false... I don't consider this to be a bug... but there's certainly
 something wrong about error handling in mssql_db_functions*()...
 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer

PHP mFAQ

Addition # 32: why do MS SQL reports errors so poorly on PHP?

Because that is the way it is coded.  If something is wrong, fix it, or
report it to the right channels, but this is not the place to ask these
questions.


-- 
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] Variable scope problem

2001-03-28 Thread Jason Lotito

 -Original Message-
 From: Joe Nelson [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 28, 2001 6:17 PM
 To: php list
 Subject: [PHP] Variable scope problem


 I have two functions like the ones below.  If the first one creates a
 variable as global, shouldn't it be accesible to the second function?

 function setGlobal() {
   global $test;

   $test = "123";
 }

 function getGlobal() {
   global $test;

   echo $test;
 }

Global doesn't CREATE global variables, it allows variables to be used as
globals.  For example, in the above setup, you would do this instead:

function setGlobal() {
global $test;

$test = "123";

return $test;
 }

$test = setGlobal();

function getGlobal() {
global $test;

echo $test;
 }

And now, getGlobal will echo $test as:

123

Of course, if you are looking to create global variables in a single
function, then you simply would do something like this:

function setGlobal() {
global $test;

$test[0] = "123";
$test[1] = "456";
$test[2] = "789";

return $test;
 }

and that would return the array $test, and therefore:

$test = setGlobal();

$test would be an array, and then you could set global in any function $test
and be able to use multiple values (as per the array).  This is easier than
globaling 20 or so values you may need.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] scrolling text box

2001-03-28 Thread Jason Lotito



 -Original Message-
 From: Randy Johnson [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 28, 2001 8:49 PM
 Cc: [EMAIL PROTECTED]
 Subject: [PHP] scrolling text box


 in php how would I ready line by line from a scrolling text box


 here are the values I would have in the scrolling text box


 a,1
 b,2
 c,3


 After the user hits the submit  button on the form how can I get
 php to read
 the data line by line sort of like it was reading it line by line from a
 file.


 thanks

 randy


$array = explode("\n", $input);

The input being the stuff fromt he textarea (or the scrolling text box as
you call it)

$array would be an array of the information...$array[0] would be the first
line, $array[1] the second line, etc.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] This PHP list

2001-03-28 Thread Jason Lotito

 -Original Message-
 From: Ian Harris [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 28, 2001 10:36 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] This PHP list



 I was hoping that this PHP list would be of people developing
 with PHP, who
 have reached some level of familiarity with the product and when they have
 had a fair go at solving a problem, they then posted it to the list.  For
 example, we have a problem in our code where the last object in
 an array of
 objects sometimes vanishes into thin air depending on whether you
 comment-out a block of unrelated code further up the script.

 Unfortunately, this list is full of people with questions like "I want to
 access a database with PHP. Can someone please send me the source code".

 Does anyone know of any other PHP lists that are more suited to
 non-trivial,
 expert-related discussions?

 If there aren't any around, I'll start one on Yahoogroups or some other
 similar service.

 regards
 Ian.


Sounds like a conversation that already happend on this mailing list a few
days ago, and then was dropped.  Maybe you should read some of the previous
postings before continuing this line of thought (for reference) and to
prevent the exact type of postings you are trying to avoid, i.e., Posting
from People who do NOT read the FAQ, older posting, etc.

Also, remember this, most of the time, 'experts' who have problems either
(a) can solve the problem themselves, because that is what a programmer
does, or (b) don't have problems.  Sure, a syntax error here or there, but
most 'experts' I know usually fall into the 'A' category.

Now, don't get me wrong, I would love to see a more professional, higher end
mailing list, but at the same time, having expected the php-general mailing
list to cater to 'Experts' only is a bit egotistical (not the right word,
sounds to harsh that way, but I can think of a better one, so just us the
cant_think_of_word("egotistical") function and it will be all right).

So, before posting next time, please try and read older posts concerning the
same or similar subject, and also try and understand, that while it may seem
non-trivial to you how to connect to PostgreSQL from XXX Server passing
through YYY Software, to many it may not, and that is why this is the
PHP-General Mailing List, not the PHP-Master Mailing List.

This was NOT a flame, and no flame retardent clothing was needed.  =)

Merely trying to quell a possible brush fire.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] File upload and database optimization questions

2001-03-27 Thread Jason Lotito


  3. At the time of upload, it is possible to specify a list of
  users who can "view" and "modify" the file. Currently I am storing
  this list as a whitespace-separated list in a mySQL TEXT column.
 
  Column "view" data: 3 11 1
 
  At the time of displaying the list, I first SELECT * the entire list
  of files, and then use explode() in combination with a "for" loop to
  split up the "view" field and match each element againt the current
  user's ID. Only if a match is found will I display the filename.
 
  I suspect this approach is not optimal. Can anyone suggest a
  better approach?

 Rather than a whitespace-separated list, store one ID as a "|ID|". So
 your field might look like:

 Column "view" data:  '|3||11||1|'

 That way, knowing the user's ID who is viewing docs, you can select
 blah blah WHERE view LIKE '|$thisusersidnumber|' ... no longer
 any need to step through and explode the array.

 Jason

No.. very bad.  Not good.  I suggest that you read this article on database
optimization (not to sound rude, but I honestly think you might learn
something, heck, I did when I was writing it =)):
http://www.newbienetwork.net/sections.php?op=viewarticleartid=17

Using what you described above with the ||, you have already broken the
first normal form.  Serious problems can develop from that implementation.
Rathers, use this format:

document_id users_allowed
--- -
001 1
002 2
003 1
003 2
003 3

Basically the primary key is in fact both the docid and users_allowed
columns.  This was is the proper way of displaying the above information.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] Newbie - MySQL Question - Finding Unique Names in Column

2001-03-27 Thread Jason Lotito



 -Original Message-
 From: Rami Krayem [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, March 27, 2001 11:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Newbie - MySQL Question - Finding Unique Names in Column


 I have a listing of photos in a table as follows (not actual
 column names):

 Image Name, Image Width, Image Height, Band Name, Venue, City, State, Date


 I would like to have a list of the different bands with photos in the
 archive.  There may be 120 photos of any one band, but I would like to
 select the name of the band only one time and have it printed in the list.
 Is there a MySQL function that would do this, or should I just put the
 different bands into a separate table?

 Any help would be appreciated.

Split the table up into 3 tables, one for bands, one for pictures, and one
for the venue.

table_bands
fields---
band_id (pk)
band_name

table_pictures
fields---
picture_id (pk)
band_id (fk)
venue_id (fk)
picture_name
picture_width
picture_height

table_venue
fields---
venue_id (pk)
venue_name
venue_city
venue_state
venue_date


Read this and you can see how I came up with the tables.  Its covers the 4
Forms of Normalization.
http://www.newbienetwork.net/sections.php?op=viewarticleartid=17



-- 
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] Array in Form Elements

2001-03-27 Thread Jason Lotito

Okay, here is the question, I have a form that will continue to grow in the
number of elements that it contains.  The values are passed into a function,
and then written out to a file.

Currently, I have 38 seperate values that are being passed into this
function, making the arguments for the function very long.  Now, I know I
can pass an array into a function, however, I would like to know if there
was a way to name the elements of the form as in an array, for example:

input name="array[1]" type="text"
input name="array[2]" type="text"
input name="array[3]" type="text"
input name="array[4]" type="text"

and then, rather than having to pass all 38 seperate arguements into the
function, I could simply pass the array like this:

function_name($array);

And then simply dissect the array inside the function like normal?

Thanks

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] i get this for some reason

2001-03-24 Thread Jason Lotito

 -Original Message-
 From: adam [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, March 24, 2001 1:43 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] i get this for some reason


 but i am not talking about running a server, i am just using php on server
 space that has php installed.

 what code would i incluse to get rid of this?


RTM:http://www.php.net/manual/en/function.stripslashes.php

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


-- 
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] Pre-Written Script ?

2001-03-21 Thread Jason Lotito


 Did you read what I wrote ?
 First I do code, and I have coded projects with as many as 60,000
 lines (clipper).

 In this case I run an ISP, work about 85 hours a week ( if that's
 lazy then I the
 laziest ). I have read most of the wrox PHP book (600 pages+), as well as
 havinging coded a complete UAS system, with many features.
 I hired a sub who didn't code modular, organized or for that
 matter logical, so I
 basically re-wrote 85% of the code for the system, BUT not having
 the experience
 in PHP I want to be able to 1 benefit from not having to code to
 do some quick and
 dirty stuff for testing, but also compare how what we have done
 is written to the
 results from this code.  I  consider many things in how I design
 and impliment
 programs that todays programmers don't, like why dump an sql
 result into an array
 because it is easy, when I know that if there are too many
 records returned to the
 array it could lock up a web server, or how efficient modularity
 makes your coding
 along with planning and organized field names, stuctures etc.
 The perfect example is the contractor we hired and his lack of
 experience, we had
 a user database that would be querried for user type,  standard, master,
 administrator etc, well this guy made 5 modules 1 for each type
 of user, and in
 that ALL THAT DUPLICATE CODEstupid.   I rewrote the entire
 module in a simple,
 cleaner and more efficient function which accepts the parameter
 of what client
 type you want.  Now that doesn't make me a PHP guru, it's just
 the right and more
 efficient way to do things, but there are secrets, and more
 efficient ways to do
 things in all languages, and I simply want to see others to see
 how I can benefit
 and learn.

 Before you flame at least read the entire message and make sure
 of what the person
 is saying, not just hey give me some code man..

 Kurth Bemis wrote:

  At 09:08 PM 3/21/2001, Jack Sasportas wrote:
 
  ah - true laziness.this is what gave birth to wysiwyg editors like
  frontpage :-)  do your self a favor and get off your ass and write code
  like everybody else.  I bet that you use frontpage too. Christ!  if your
  going to develop then you can't be lazy.  that's it i'm finished!
 
  ~kurth

1) I use Dreamweaver 4.0.  I coded HTML in a text editor for 2 1/2 years.
So I use DW now because its 10x faster, more efficient to design web pages
in.

I then pull the code into a HTML Editor, and tighten up the code.  Make it
perfect.

Don't assume WYSIWYG means bad.  That only makes yourself look even worse.

2) Obviously you are not a programmer.  If you were, you would know that
programmers are in their very nature lazy.  That is why they create
functions, and classes, and use the same code for different scripts.

Before you go flamming someone, think.

One more thing... I find it very hard to code standing up.  So, can I sit on
my ass and code?

Jason

P.S.  Grammar never hurt.


-- 
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] PHP MYSQL BOOKS

2001-03-18 Thread Jason Lotito



 -Original Message-
 From: YoBro [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, March 18, 2001 3:13 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP  MYSQL BOOKS


 Hello,

 Does anybody know any good books  websites to recommend for PHP  MySql
 together. I am looking to advance my knowledge and would really
 appreciate a
 helpful tip.

 Really looking for a book that explains all the advanced features of PHP4
 and MySql as a compliment.

 Regards,


 YoBro


I have found the following books very userful:
PHP Developer's Cookbook
WROX's Beginning PHP 4
Core PHP Programming
SQL In A Nutshell

The following websites as well:
www.phpbuilder.com (which, if I may say, I had an article accepted there,
and it will soon be released.=))
www.phpdeveloper.org
www.phpbeginner.com
www.hotscripts.com  (Check out the PHP Tutorials section)
www.newbienetwork.net (My site...=P)
www.webmonkey.com
www.devshed.com


-- 
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] highlight_string parsing in an article

2001-03-16 Thread Jason Lotito

Okay, I have a bugger here.  I am working on a script for my site to parse
articles, comments, so that people use a special markup (like [b] [/b] for
b /b, etc).  One of the feature I want to implement is a [code] feature
that will parse the code between [code] and [/code] like it would in
hightlight_string().

The problem is, I want this for all the code that could possible be
represented in a comment or an article.  In some of the articles I write, I
have several examples of the code, and I would like each instance put
through the above process, but not the entire article.

So, I have hit a snag.  First, highlight_string actually prints out the
results, so as far as I know, it doesn't return anything
(http://www.php.net/manual/en/function.highlight-string.php) except for a
true/false result.

What I want to have happen is parse the document, and take the stuff between
the [code] tags, and parse that out.  Of course, the entire article is being
put through, so I imagine I will have to be using regular expressions or
explode(), though I expect more the former.

For example, take this:

-
A quick overview of echo, and how and why you should try and use inline HTML
instead of outputting with echo. Just something real quick and easy that I
think is rather important.

A quick overview of echo, and how it compares to coding your HTML as Inline.
Test results have shown that inline display is 2 times faster than echo.

echo - 0.063347 secs
inline - 0.035276 secs

For example:
[code]
?phpif ($yes != "yes"){echo "Yes is not Yes";}?
[/code]
If you compare that to this:
[code]
?phpif ($yes != "yes"){?Yes is not Yes?php}?
[/code]
While this may not be immediately noticeable in small programs, if the
program is large, or it starts to recieve a lot of hits, than you will
appreciate the little extra speed that inline prints give you.  Sure, it
requires a bit of extra work on your part, but it does make for nicer
programming.

Also, if you think about it, its much easier to use inline than echo'ing
everything you do.  No more escaping the " in the  HTML in the echo's.  And
you should use the " even if you plan on using echo, as its good form.
---

Now, that would be in the database.  When the article is veiwed, it is sent
through a parser.  The parser will pick up the code tags, and parse what is
in between through highlight_string().

Unfortunately, like I said, I cannot figure out how to do this, maintaining
the structure of the article, while keeping it in one area.  I don't want to
create a seperate table to hold the code, and have that inserted into the
articles as need parsed, just doesn't seem efficient enough.

Any help would be appreciated.  If you could point me to even a script that
does something like this, I could hack my way through it, but I have don't
know where to start with this.  Thanks.

Jason Lotito
[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]




RE: [PHP] Re: Invalid or Valid because the same.

2001-03-16 Thread Jason Lotito

Look in the script...

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 16, 2001 10:50 PM
 To: 'PHP General List. (E-mail)'
 Subject: Re: [PHP] Re: Invalid or Valid because the same.


 //HTML headers here

 ?
 if ($Submit == "Submit") {  // If form has been submitted
 $errormsg = array();


 if (!$email)
 {
 $errormsg[] = "Please fill in your email address";
 }


 $count = count($errormsg);

 #echo $count."br";

 if ($count  0) {
 for ($i=0; $icount($errormsg); $i++) {
 echo $errormsg[$i]."br";

 }

 }

 elseif ($count == 0)
  {
 #Insert Database checking ( NO ERROR )

 $host="localhost";
 $dbuser="root";
 $dbpassword="root";

 mysql_connect($host, $dbuser, $dbpassword)
 or die ("Unable to Connect to Database");
 mysql_select_db("secretDB");
 $query = "Select username,password from
 users where email = '$email'";
 $sqlquery = mysql_query($query);


Now, maybe this is just me, but...I would take a strong look at your
mysql_numrows() function...their is an msql_numrows, but unless I am off my
rocker...there is no mysql_numrows function.  That might be part of the
problem...

 $num = mysql_numrows($sqlquery);

 if ($num == 0) #Not valid
 {
 ?
 centerSo sorry, your
 email is not
 valid./body/html
 ?


 }
 else if ($num == 1) #Valid
 {
 ?
 centerSent mail./body/html


 ?

 }

 }

 }
 if ($reset == "Reset"){
 $username = "";
 $real_name = "";
 $password = "";
 $email = "";
 }


 ?

 // Form here


 - Original Message -
 From: "Jason Lotito" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, March 17, 2001 5:59 PM
 Subject: RE: [PHP] Re: Invalid or Valid because the same.


  I have attached a php file together with this email.
 
  I apologize if you are having to download an extra 2k with this message.
 
  Please help me out. Thank you.
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
  Sent: Friday, March 16, 2001 10:36 PM
  To: [EMAIL PROTECTED]; 'PHP General List. (E-mail)'
  Subject: [PHP] Re: Invalid or Valid because the same.
 
 
  Sorry, heres the attached file.
 
 
  Nope, still no file.  You might want to just paste the important stuff
 into
  the email to the group.
 
  Jason Lotito
  [EMAIL PROTECTED]
  www.newbienetwork.net
 


 --
 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]




RE: [PHP] Re: Invalid or Valid because the same.

2001-03-16 Thread Jason Lotito

Yeah..I saw that last line AFTER having posted that.  =)  Goes to show
myself that even when you search for a function, and the manual says it
doesn't exist...it still might.  Haha...

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jack
 Dempsey
 Sent: Friday, March 16, 2001 11:09 PM
 To: Jason Lotito
 Cc: [EMAIL PROTECTED]; 'PHP General List. (E-mail)'
 Subject: Re: [PHP] Re: Invalid or Valid because the same.


 http://www.php.net/manual/en/function.mysql-num-rows.php

 jack

 Jason Lotito wrote:
 
  Look in the script...
 
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
   Sent: Friday, March 16, 2001 10:50 PM
   To: 'PHP General List. (E-mail)'
   Subject: Re: [PHP] Re: Invalid or Valid because the same.
  
  
   //HTML headers here
  
   ?
   if ($Submit == "Submit") {  // If form has been submitted
   $errormsg = array();
  
  
   if (!$email)
   {
   $errormsg[] = "Please fill in your email address";
  

  }
  
  
   $count = count($errormsg);
  
   #echo $count."br";
  
   if ($count  0) {
   for ($i=0; $icount($errormsg); $i++) {
   echo $errormsg[$i]."br";
  
   }
  
   }
  
   elseif ($count == 0)
{
   #Insert Database checking ( NO ERROR )
  
   $host="localhost";
   $dbuser="root";
   $dbpassword="root";
  
   mysql_connect($host, $dbuser,
 $dbpassword)
   or die ("Unable to Connect to Database");
   mysql_select_db("secretDB");
   $query = "Select
 username,password from
   users where email = '$email'";
   $sqlquery = mysql_query($query);
 
  Now, maybe this is just me, but...I would take a strong look at your
  mysql_numrows() function...their is an msql_numrows, but unless
 I am off my
  rocker...there is no mysql_numrows function.  That might be part of the
  problem...
 
   $num = mysql_numrows($sqlquery);
  
   if ($num == 0) #Not valid
   {
   ?
   centerSo sorry, your
   email is not
   valid./body/html
   ?
  
  
   }
   else if ($num == 1) #Valid
   {
   ?
   centerSent mail./body/html
  
  
   ?
  
   }
  
   }
  
   }
   if ($reset == "Reset"){
   $username = "";
   $real_name = "";
   $password = "";
   $email = "";
   }
  
  
   ?
  
   // Form here
  
  
   - Original Message -
   From: "Jason Lotito" [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Saturday, March 17, 2001 5:59 PM
   Subject: RE: [PHP] Re: Invalid or Valid because the same.
  
  
I have attached a php file together with this email.
   
I apologize if you are having to download an extra 2k with
 this message.
   
Please help me out. Thank you.
   
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 10:36 PM
To: [EMAIL PROTECTED]; 'PHP General List. (E-mail)'
Subject: [PHP] Re: Invalid or Valid because the same.
   
   
Sorry, heres the attached file.
   
   
Nope, still no file.  You might want to just paste the
 important stuff
   into
the email to the group.
   
Jason Lotito
[EMAIL PROTECTED]
www.newbienetwork.net
   
  
  
   --
   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 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]




RE: [PHP] FAQ

2001-03-15 Thread Jason Lotito

 How many times are people going to complain about no-brainer questions
 being posted to the list. The fact of the matter is people are going to
 post things on the list without reading the manual or the FAQ. It goes
 with the territory. It annoys me too, but there is no good solution for
 the problem. There is the fact that a lot of people are new and don't
 really know where to go to find answers. Even if they go to the web site,
 they still may not know that they need to be looking for information on
 naming variables with variables or that fopen opens a file or whatever.

 K E I T H  V A N C E

I think the argument has less to do with people asking questions about PHP
and how it works, and more about people asking basica programming questions
without knowing it.  Fundamental programming concepts, like the scope of a
variable, passing by reference or by value, or even looping are things
newbie's simply do not understand.  Why?  Because they don't know they need
to learn the concepts and theories of programming before learning to
program.  It sounds odd, but that is the way it is.

People asking questions about how a loop works are not usually asking how a
PHP loop works.  The same for arrays.  They are really saying: "This is the
first real programming language I am out to learn, and I don't understand
the concept behind a For/Next Loop."  This isn't a bad thing, heck, we were
all newbies at one point, and in a sense, we are all newbies at something.

I think the argument is that their are many people who don't want to learn
how and why a For/Next Loop works, but instead simply want someone to fix
the problem for them.  That isn't programming.  Programming (and yes, I
know, PHP is technically a scripting language, but lets not jump that fence
as well) is about trial and error, logic, and creativity, but most
importantly, problem solving.  Most of the newbies get into PHP expecting a
tutorial on every topic.  If they can't find a tutorial on how to print out
5 numbers, they expect someone to show them how to do it.  They don't try
and solve the problem themselves, and that is a problem.  I don't mind
assisting where I can, however, I don't like rewriting a script for someone
when they don't even take the time to try and learn the fundamentals.  Most
newbies I have met fall into two categories.  The majority start out wanting
to learn PHP because someone said it was easy to learn, which it is, from a
programmers point of view.  However, when in the second week of learning
their first programming language they can't program that PHP Database
Content Management System with Instant Yahoo News Retrival complete with
User Database, Forums, and Real Time Foo, they start getting upset and say
that PHP sucks.  Those same people may also complain because they can't find
a tutorial on how to create a Forum Database, and all they can find are
tutorials on the basics of Database Design.

I think this is the real problem.  Try to run before they have learned to
crawl and walk.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.



-- 
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] FAQ - Newbie perspective

2001-03-15 Thread Jason Lotito


 Hi,

 I don't want to argue about anything, just point out something
 that occurred
 to me.

 First of all, I am a newbie as far as PHP is concerned, though I am more
 than comfortable with programming.

 I recently asked a pretty simple question on this list ("Finding the
 depth"). I could have found out the answer to it in about 10-15 minutes on
 my own, thanks to my experience with programming. Still, I posted the
 question to this list. Why?

 What did I gain:

* I saved time.
* I got to see _PHP_code_ for solving my problem. Any solution from me
  would have been more C++ than PHP. I got to become more familiar with
  thinking the PHP way.

Very reasonable.


 What did I lose:

* Nothing, because reading the code snippet and investigating the
  functions used therein taught me all I needed to know (for this
  instance). Following the "See also" links taught me some more.

 Did I _waste_ somebody else's time? I don't really think so.
 Plus, a posting
 can always be ignored...

Yes, but not dozens of 'wastefull' postings...=(


 An answer saying "RTFM" and pointing me the relevant functions
 (even if they
 were just function names) would have been good enough too. But then I
 wouldn't have gotten to see an experienced person's PHP code.

 The question is: how many of you think that that posting was "ok" and how
 many had to curb the temptation to flame me :-)?

The question itself was fine.  I think the FAQ postings haven't been about
Newbie's to PHP, but newbie's to programming in general asking Programming
questions in the guise of being PHP questions.  There are many resources out
there on the basics of programming, and their is simply no excuse for not
understanding what a variable is, what a loop is, and how a function works.

However, I don't expect the average person to know the Rules of
Normalization for database design, nor do I expect the average PHP person to
understand classes.  These concepts, while common for the experiences
programmer, is something that some people just do not deal with.  These are
the times the questions are okay.  But when you simply don't understand the
concept behind what you want (at least in your post, you understood what you
wanted to accomplish, understood how it could be accomplished, but wanted to
instead find a better/faster way), you are merely hiding the truth.

The mailing list is here not so PHP programmers can program things for
people, but to help people learn (and help out with the occasional problem).
It just bothers me that I spend time learning to program, learning other
languages, learning PHP.  If I can't figure something out, I don't jump
right to the mailing list or the news group.  I take my time, look through
all my manuals, my own code, look back through the PHPManual and logically
deduce what the problem is.  So far that method has worked very well.
Agreed, sometimes a function may not be working like I thought it would, and
I need someone to post some sample code for it in use, but that is not me
not understanding the concepts of programming.  Thats merely syntax.

Programming is 90% creativity.  The rest is just syntax.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.



 Btw, I too don't like all those "PHP editor" and "How to loop" type of
 questions ;-). But then, I simply delete them and that's it!

 --
 Regards,
 Harshdeep Singh Jawanda.




-- 
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] URGENT: Can't see picture

2001-03-14 Thread Jason Lotito

It might not be it, but this stood out...

?PHP
$filedir = "../userpics";

//check for jpg format
if($fupload_type == "image/pjpeg")
{
//copy picture to new directory
   if(copy($fupload, "$filedir/$CUserName.jpg"))
{
//show picture
// You forgot the closing '' tag...and you are escaping the '"'
print ("img src=\"$filedir/$CUserName.jpg\"");
}
}
?

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


 -Original Message-
 From: Mike Yuen [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 14, 2001 9:01 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] URGENT: Can't see picture


 I'm having a ton of trouble trying to get pictures to display.  At first,
 I thought I had the problem fixed - but that's because the pictures reside
 on my machine. So instead of providing a path to the pictures like:
 c:/phpweb/userpics/ I tried absolute paths like ../userpics and that
 doesn't seem to have worked either.

 Here's a snippet of my code and i'm hoping someone can help me out on
 this.

 Thanks,
 Mike

 ?PHP
 $filedir = "../userpics";

 //check for jpg format
 if($fupload_type == "image/pjpeg")
 {
 //copy picture to new directory
if(copy($fupload, "$filedir/$CUserName.jpg"))
 {
   //show picture
   print ("img src=\"$filedir/$CUserName.jpg\");
 }
 }
 ?



 --
 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]