Re: [PHP] Printing a PHP Class

2002-07-31 Thread Jerome Houston

Also, you could use print_r($obj);
to look at everything in the class, with arrays already expanded for you.


http://www.php.net/manual/en/function.print-r.php

jerome

>From: Marty McGowan <[EMAIL PROTECTED]>
>
>PHPers,
>   In a genaology application, where I add individuals to
>an array:
>
>  $everyone[] = new Individual($id);
>
>I'd like to print the indiviuals' attributes.  Some of these are
>in array's themselves: like a list of event's in one's life.
>
>My problem is:
>when printing the Class Variables using the "standard" approach:
>=
>function print_vars($obj) {
> $arr = get_object_vars($obj);
> while (list($prop, $val) = each($arr))
>   {
>   echo "$prop\t$val\n";
>   }
>}
>=
>I see the message:
>
>  Variables: Person: Added RELI attribute
>
>id I6
>last McGOWAN
>first Martin James
>suffix Sr.
>
>sex M
>
>lifeevent Array
>attribute Array
>
>
>   My question is:
>  How does one print out the "Array"?
>
>   My attempt at testing .
>
>(strcmp($val,"Array") == 0)
>
>   was fruitless, as the print value of
>  $var is always a string, but not always
>  in other contexts.
>
>   What am I missing?
>
>Thanks,
>  -- Marty McGowan
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] Reading URL in address bar

2002-08-26 Thread Jerome Houston

CGI.referrer?  are you a foxweb user? :-)

you can use  $_SERVER['REQUEST_URI'] for the page itself, plus (i think...) 
$_SERVER['SERVER_NAME'] if you need the hostname (of the server), too.

check out 
http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server

jerome


>From: "YC Nyon" <[EMAIL PROTECTED]>
>
>I want to pass the current url (appearing on the browser address bar), say
>http://www.mydomain.com?cat.php=234 to appear in a form field
>in the a new page, say category.php.
>I am sure it's something to do with HTTP_variables or CGI.referrer but 
>can't
>seem to get the one needed.
>
>TIA
>Nyon
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




Re: [PHP] PHP with Sql Server

2002-08-27 Thread Jerome Houston


http://www.php.net/manual/en/function.mssql-connect.php

>From: "Skyhawk" <[EMAIL PROTECTED]>

>Please, How do I make to access a database Sql Server 2000?
>
>
>Thaks
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_
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




Re: [PHP] php server on Windows

2002-06-13 Thread Jerome Houston

Ditto on all that for me.  use apache.  the instructions on how to get them 
working together are good as long as you are diligent about reading *every* 
word.  no half-ass instruction following will do.  mysql is just as easy to 
set up, and you have to do *zero* configuration of php to get it working.

i've used this comination before, and at the time i had NEVER used php or 
mysql before, and it all worked together nonetheless.

jerome


Original Message Follows
From: Stuart Dallas <[EMAIL PROTECTED]>

On Thursday, June 13, 2002 at 7:54:30 PM, Phil Schwarzmann wrote:
 > I know that PHP on Windows has some limitations as compared to Linux.
 > What are these limitations?

There are limitations? Where did you hear this? If there are any I haven't 
come
across them yet.

 > Which version of Windows would be best ?

The most stable version for server use is currently Win2k.

 > Is this gonna be a real pain in the ass to get PHP & MySQL & Apache &
 > Windows to get along well?

No. It's like they were made to work together.

 > Can I use IIS instead of Apache ?

If you really want to, but I can't think of many reasons why you would want 
to.

 > Thanks!

No problem.

--
Stuart


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


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] Ascii Value

2002-06-18 Thread Jerome Houston


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

Original Message Follows
From: "James Drabb" <[EMAIL PROTECTED]>


Hey *,

In C I can cast a char 'j' to an int and get it's ascii value.  Is there a 
funciton in PHP
to do this with a string containing a single char (i.e. "j")?  I could write 
a big
switch for all the chars of the alphabet, however I was hoping for a better 
approach?

Jim Drabb

--
-
Never ask a geek why, just nod your head and slowly back away
-
James Drabb JR
Programmer Analyst
Darden Restaurants
Business Systems
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] New to PHP...preliminary question

2002-06-18 Thread Jerome Houston


Hi,
>I am interested in setting up PHP on my web server.  I have a RH 7.3 Linux
>server that is running apache v1.3.19 with Frontpage v5.0 extensions.  Will
>the installation of PHP affect my current server...meaning will it kill 
>anything (web server stop working).  I just don't want to start anything
>until I know what to expect.

shouldn't.  you will need to restart the webserver once you've changed your 
httpd.conf file to enable php, tho.

>Also, I keep seeing references to MySQL...I do not have SQL loaded on this
>server.  Is it necessary?

nope.  use what you like.

-
>Thanks,
>Chris Guest, WAN Administrator

welcome.

jerome


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] Image aliasing

2002-06-24 Thread Jerome Houston

morgan-
is there any way you can have those img tags (the ones with the height and 
width) changed to reference a php script?  you could write a script that 
reads in the image they're requesting, and takes a height and width as 
inputs, then uses php commands like imagecopyresampled() or 
imagecopyresized() to dynamically output a resized image?  maybe this would 
be too much load on your server, but it sure would cut down on the download 
time, and would almost *positively* give you better image quality.

might look something like this
http://yourserver.com/scriptpath/thumbnail.php?height=100&width=100"; >

with a script something to the effect of thumbnail.php: (assuming the file 
is a jpeg)


jerome


>From: "Morgan Grubb" <[EMAIL PROTECTED]>
>Reply-To: "Morgan Grubb" <[EMAIL PROTECTED]>
>
>Morning,
>
>I'm wondering if anybody has ever figured out a way to get around the
>absolutely abysmal way that Internet Explorer resizes images?
>
>The problem is that the person I'm supplying the images to refuses to use
>two copies (a small one, and a large one) and instead uses one (just the
>large one) and when he needs a small representation of it he slaps the 
>large
>image in and sets the width and height tags.
>
>The problem comes in when I'm trying to supply him with good looking 
>images.
>Sure, the large image looks fine, but that smaller image gets aliased to
>hell and back. Can the large image be recompressed in such a way that it
>doesn't noticeably damage the large version, but improves how it looks when
>arbitrarily shrunk in IE?
>

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




RE: [PHP] Seperating presentation from logic

2002-06-25 Thread Jerome Houston

Is there a particular reason everyone is skipping over the idea of using 
XML/XSLT?  What you're talking about is EXACTLY what XSLT was designed for.  
You can write scripts that access the DB, and output XML.  Then you just use 
XSL files written by your designers to translate your XML into HTML.  they 
get to choose EVERYTHING about what the page looks like.

Granted, your designers need to learn a little XSL, but it sounds like, for 
what you're doing, they wouldn't need to learn much.  If you're going to 
teach them to use something proprietary like pattemplate (as mentioned 
below), why not spend that time teaching them to use XSL, which is easy to 
use and isn't proprietary, it's actually W3 specified.

for info on how to get it working with php, go to:
http://www.webmasterbase.com/article/602

some people may disagree.

-jerome

>Basically, like someone else said, you teach your HTML
>designers to use custom tags that your template engine will recognize
>and place the correct values for.
>
>To make a loop, you'd tell your designers to do something like this
>
>
>{filename}
>
>
>It's not exactly like that, mind you, but you get the idea.
>
>You can't ever completely separate you designers and programmers. What
>you do is provide an easy to understand way for your designers to
>include the programming elements. What's easier, teaching them to put
> or {name} in the document???


_
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




Re: [PHP] large tables scroll down:(

2002-06-26 Thread Jerome Houston

there's a couple problems with your question:

we don't know what tool you're using,
what database you're you're using,
and most importantly,


this is not a PHP question.


please use a hammer for a nail, and a screwdriver for a screw.

thanks.

>From: "Anil Garg" <[EMAIL PROTECTED]>
>Hi,
>for viewing long tables.
>when i say SELECT * FROM abc
>i miss the upper entries of the table as they scroll down.
>is there something by which i can view a table page by page(as | more in
>unix)


_
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




Re: [PHP] Advantage of CURL over using LYNX

2002-06-27 Thread Jerome Houston


I've used both fopen() and the CURL libraries...

> > I need to grab some data from a CGI program running on a different
> > server.  I have been toying around executing LYNX using the passthru
> > command.  I seem to be able to grab the data just fine using "lynx
> > -source -preparsed $URL".   I've started reading about CURL.  I am
> > wondering if it is worth my effort to recompile my server to include
> > CURL support.  Any feedback is appreciated.
>
>Why use curl (or an external program like lynx) when you can use
>file()/readfile()/fopen()/fsockopen(), depending if you just need the
>source from that cgi or need to mangle it a little?
>
>Using PHP build-ins will most likely be faster or at least nicer for
>your resources.
>
>IMHO (never used it) curl is only needed when you need to something
>fancy like post/put requests.

though i was just doing simple GETs to website, i happened to be doing a lot 
of them in nested loops (get one page, parse a bunch of URLs out of it, get 
a sub-page, find a link in it, get a file, etc...)

fopen()/fread() just started to crash after a couple of iterations.  i don't 
know if that's because i'm on win2k or what, but I enabled CURL and tried 
using it instead, and NO PROBLEMS whatsoever.  CURL turned out to be much, 
much more reliable for my use.

just so's ya know,
jerome

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-05 Thread Jerome Houston

If I could elaborate on colin's explanation
Mainly so that there is a fairly recent one of these in the archives
(not that anybody searches them :-)

Like miguel said encryption in an HTTP request/response pair is determined 
by your browser.

if the browser is making a request, and it sees an https:// at the beginning 
of the request URL, it will :
1.  get the domain's public key from a public key server
2.  encrypt the whole request with the domain's public key
3.  submit it to the web server.

If the web server sees that this is an encrypted request, it will :
1.  decrypt the request with it's private key
2.  process it and generate a response (usually in the form of html)
3.  encrypt the response with it's private key
4.  send it back to the browser

When the browser gets the response, it:
1.  decrypts it with the public key
2.  displays the html to the client user
3.  ***shows a lock icon at the bottom of the browser

Now, one of the things that many people are confused about is that they 
think there must be a lock icon at the bottom of the browser when they are 
entering sensitive info (like credit card numbers).  Nope.  The only 
important thing is that the form which takes the sensitive data SUBMITS to 
an https:// URL.  Because (as above) it will encrypt the request (which 
includes the sensitive data) BEFORE it submits it over the internet.  But 
most people don't know how to check that a form submits to an to an https:// 
URL.  So, the standard practice is to have the page containing the form 
which takes the sensitive data ALSO be an https:// URL, so that the lock 
icon is already there when the client user is entering that oh-so-prized 
sensitive data, even though there's nothing really to protect in that HTTP 
request/response pair.

PHP is, in a way, completely separate from the HTTP/HTTPS layer.  When PHP 
is started up by the web server, regardless of the encryption (or lack 
thereof) of the original request, PHP gets the non-encrypted (or already 
decrypted) request.  When it sends its response output to the webserver to 
be sent to the client, it sends that output unencrypted.  It's completely up 
to the web server to either encrypt the response, then send it out, or to 
just send it with no modification.

I hope that helps your understanding of what's going on with all this 
HTTP/HTTPS stuff.  I also hope that i've been clear about it.  It's kind of 
easy to get lost in terms.

Jerome

_
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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-05 Thread Jerome Houston

Ah, miguel
good to have you back.
I missed your lovingly superior painstaking attention to detail :-)

jerome

>From: Miguel Cruz <[EMAIL PROTECTED]>
> > if the browser is making a request, and it sees an https:// at the 
>beginning
> > of the request URL, it will :
> > 1.  get the domain's public key from a public key server
> > 2.  encrypt the whole request with the domain's public key
> > 3.  submit it to the web server.
>
>We have public key servers?
>
>Around these parts the client and server use a self-contained process to
>handle the key exchange. The server's key has been signed by a certificate
>authority (Verisign, etc.) whose public key is already stored in the
>browser... or not, in which case the client alerts the user and generally
>continues nevertheless.
>
> > If the web server sees that this is an encrypted request, it will :
> > 1.  decrypt the request with it's private key
> > 2.  process it and generate a response (usually in the form of html)
> > 3.  encrypt the response with it's private key
> > 4.  send it back to the browser
>
>Sort of. The server's key is used to encrypt the exchange of a new key
>which lasts only for the lifetime of the transaction. This ephemeral key
>is what's used to encrypt the actual data. But this nuance is probably not
>very important to understanding the practical issues of working with PHP
>and HTTPs.
>
> > Now, one of the things that many people are confused about is that they
> > think there must be a lock icon at the bottom of the browser when they
> > are entering sensitive info (like credit card numbers).  Nope.  The only
> > important thing is that the form which takes the sensitive data SUBMITS
> > to an https:// URL.  Because (as above) it will encrypt the request
> > (which includes the sensitive data) BEFORE it submits it over the
> > internet.  But most people don't know how to check that a form submits
> > to an to an https:// URL.
>
>Yup. You'd think that the browser developers would come up with a way to
>indicate this (mouse pointer turning to a lock when hovering over a submit
>button, etc.).
>
>miguel
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] PHP and Object-Orientated Programming

2002-07-08 Thread Jerome Houston

oh, mucho disagree-o.

i dunno, maybe the people who say that it will slow you down have HUGE 
projects, and HUGE classes with hundreds of member variables, but i use OO 
for all the DB interactions (i have a class with get, update, insert, delete 
methods, etc. for each table) and i think it works just fine.  i even wrote 
a script to generate those classes, so if the DB structure changes, i only 
have very minimal code editing.

maybe if you're holding hundreds of big classes in memory at a time, this 
could give you a problem, but even if a user is looking at a data set that 
has thousands of results, you're not going to be showing them all on a page 
at once, so you don't need them in memory  just be smart about your 
queries.

even with all the data being in objects, and lots of those objects in 
memory, i don't see a big difference.

my $.02

jerome



>From: "CM" <[EMAIL PROTECTED]>
>
>I have a medium sized project that I'm started in PHP and mySQL.  I think 
>an
>object-orientated approach may be the best to reduce the amount of code.
>My question is if I'm using PHP should I even try to do it an
>object-orientated manner.  I've seen some posts that say that doing it this
>way will really slow down PHP and that if you're doing OO you should really
>do it in a language like Java.


_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




RE: [PHP] Please Help with LOOP!!

2002-07-18 Thread Jerome Houston

martin-
you're totally right except for one thing

>$count=1;
>while($query_data = mysql_fetch_array($result))
>{
>   $price = $query_data["price_lq"];
>   $RowColor = useColor();
>   // current echo statements here
>}
>$count++;

this code will give him the exact same problem.  the

$count++;

line needs to be *inside* the while loop.  probably a typing mistake on your 
part, but i didn't want this guy to get help that ended him up with the same 
problem =).


-jerome


_
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] MSSQL 2000's 'real' type kills php

2002-05-13 Thread Jerome Houston

Hi,

i'm working on a win2k server running php 4.1.1  accessing MSSQL server 2000 
on a win2k server.

i've got a problem with a table that has 'real' numbers in it.


codeinventory name
PRC01   2.33  Prince Brand Chips
FCA13   9.934E-2  Frozen Calamari


when i
mssql_query("select * from products");
or, more specifically
mssql_query("select inventory from products where code = 'FCA13'");

BOOM!  php crashes, and i get a pop-up window in MSIE that says, "IE cannot 
open the site ..  the connection with the server was reset"

but

mssql_query("select * from products where code = 'PRC01'");
works like a charm.

granted 9.934E-2 isn't an actual number for inventory, it should be 0.10 
.  BUT, i can't help that.  my application is not the only one that uses 
this data.

this happens with various numbers that have high precision.

anyone run into this before?  any suggestions?

thanks VERY much in advance,

jerome

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




[PHP] RE: MSSQL 2000's 'real' type kills php

2002-05-14 Thread Jerome Houston

Thank you for your reply.

i can't tell if your solution works yet because
PHP can't seem to handle multiple SQL statments in one call to 
mssql_query().
when i do what you said:

mssql_query("SET TEXTSIZE 2048 select inventory from products where code = 
'FCA13'");

I get:

Warning: Supplied argument is not a valid MS SQL-result resource in 
utils.php on line 50

AND, from then on, no mssql_*() functions work

Warning: MS SQL: Unable to select database: PRODDB in utils.php on line 48

Warning: MS SQL: Query failed in utils.php on line 50

Warning: Supplied argument is not a valid MS SQL-result resource in 
testms.php on line 72


i thought maybe it was a different incarnation of the same problem, but now 
i REALLY don't think so.  It turns out when i do any query with mutliple 
statements in it (even if i don't use the result set for something), it 
causes the same thing.  all mssql_*() functions are rendered disfunctional.  
even something that doesn't access data in teh DB, like:

mssql_query("declare @P1 float \n set @P1 = 10.00 \n select @P1");

i get the "not a valid MS SQL-result resource" error.

Sorry to just give out more problems, but anyone know anything about this.  
is there a setting i can change to make multiple statements OK for PHP?  I 
know the statements run just fine on the SQL server, because i ran MSSQL 
Profiler on the server to catch all statments and errors, and no errors 
happened.

thanks once again, everyone.

jerome


>From: "Mullin, Reginald" <[EMAIL PROTECTED]>
>To: 'Jerome Houston' <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>Subject: RE: MSSQL 2000's 'real' type kills php
>Date: Tue, 14 May 2002 12:19:47 -0400
>
>Jerome,
>
>I'd had a similar problem a few weeks ago (see
>http://marc.theaimsgroup.com/?l=php-general&m=101960285228542&w=2).
>
>Try modifying your SQL statement like so:
>mssql_query("SET TEXTSIZE 2048 select inventory from products where code =
>'FCA13'");
>
>
>O  From Now 'Till Then,
>\->Reginald Alex Mullin
>/\  212-894-1690
>
> > -Original Message-
> > From:   Jerome Houston [SMTP:[EMAIL PROTECTED]]
> > Sent:   Monday, May 13, 2002 8:52 PM
> > To: [EMAIL PROTECTED]
> > Subject:MSSQL 2000's 'real' type kills php
> >
> > Hi,
> >
> > i'm working on a win2k server running php 4.1.1  accessing MSSQL server
> > 2000
> > on a win2k server.
> >
> > i've got a problem with a table that has 'real' numbers in it.
> >
> > 
> > codeinventory name
> > PRC01   2.33  Prince Brand Chips
> > FCA13   9.934E-2  Frozen Calamari
> > 
> >
> > when i
> > mssql_query("select * from products");
> > or, more specifically
> > mssql_query("select inventory from products where code = 'FCA13'");
> >
> > BOOM!  php crashes, and i get a pop-up window in MSIE that says, "IE
> > cannot
> > open the site ..  the connection with the server was reset"
> >
> > but
> >
> > mssql_query("select * from products where code = 'PRC01'");
> > works like a charm.
> >
> > granted 9.934E-2 isn't an actual number for inventory, it should be
> > 0.10
> > .  BUT, i can't help that.  my application is not the only one that uses
> > this data.
> >
> > this happens with various numbers that have high precision.
> >
> > anyone run into this before?  any suggestions?
> >
> > thanks VERY much in advance,
> >
> > jerome
> >
> > _
> > Send and receive Hotmail on your mobile device: http://mobile.msn.com
> >
>
>
>**
>This email and any files transmitted with it are confidential and
>intended solely for the use of the individual or entity to whom they
>are addressed. If you have received this email in error please notify
>the postmaster at [EMAIL PROTECTED]
>
>
>www.sothebys.com
>**
>


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] help with undefined variables, please

2002-05-14 Thread Jerome Houston

hi-

it is not REQUIRED for variables to be initialized in PHP, but if your error 
reporting is on too high, it will tell you, just to make sure you know.  to 
turn your error reporting to a different level, you can change your php.ini:

http://www.php.net/manual/en/configuration.php#ini.error-reporting

or just change it for this script

http://www.php.net/manual/en/function.error-reporting.php

hope this helps,

jerome

>From: "The Gabster" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [PHP] help with undefined variables, please
>Date: Tue, 14 May 2002 12:21:45 -0500
>
>Hello all!
>
>I have a newsletter script that works fine but I receive some undefined
>variables errors in Apache's error log:
>
>PHP Notice:  Undefined variable:  action in
>C:\Apache\htdocs\easyletter2\easyletter.php on line 73
>PHP Notice:  Undefined variable:  action in
>C:\Apache\htdocs\easyletter2\easyletter.php on line 100
>PHP Notice:  Undefined variable:  pw in
>C:\Apache\htdocs\easyletter2\easyletter.php on line 123
>PHP Notice:  Undefined variable:  pw in
>C:\Apache\htdocs\easyletter2\easyletter.php on line 159
>PHP Notice:  Undefined variable:  disp in
>C:\Apache\htdocs\easyletter2\easyletter.php on line 159
>PHP Notice:  Undefined variable:  found in
>C:\Apache\htdocs\easyletter2\easyletter.php on line 75
>PHP Notice:  Undefined variable:  pw in
>C:\Apache\htdocs\easyletter2\easyletter.php on line 123
>PHP Notice:  Undefined variable:  pw in
>C:\Apache\htdocs\easyletter2\easyletter.php on line 159
>
>Why do I get an undefined variable error for $action, $pw, $disp, $found
>when they do not have to be declared in the script?
>
>And the script is:
>
># Version 1.1 Debugged, please upgrade older ones...
>
>
>
># Global Settings...
>
>
>
># Set the password for the eMail List editor!
>
>$pass="secret";
>
># Name of the datafile
>
>$filelocation="subscribers.txt";
>
># Title of the newsletter, will be displayed in the FROM field of the
>mailclient
>
>$lettername="Test";
>
># Your email, will be the reply-to mail
>
>$youremail="[EMAIL PROTECTED]";
>
>
>
># Displayed Messages
>
>
>
># Welcome message displayed above the form for subscribing/unsubscribing
>
>$welcomemessage = "This is the place to subscribe and unsubscribe for the
>Onlinetools.org Newsletter. I will be sending this letter out every time
>there are some new tools or changes to the page. Your data will not be 
>given
>to anyone and I send out small text mails only.";
>
># Sorrymessage for failed subscription, will be followed by the email!
>
>$sorrysignmessage = "Sorry, there is already an entry for ";
>
># Subscribe message, will be displayed when subscribing
>
>$subscribemessage = "Thank you for subscribing to the newsletter, a
>confirmation email is on its way!";
>
># Subscribemail, will be sent when someone subscribes.
>
>$subscribemail = "Thank you for subscribing to the newsletter.";
>
># Unsubscribemessage for deletion, will be followed by the email!
>
>$unsubscribemessage = "We deleted the following entry: ";
>
># Unsubscribemessage for failed deletion, will be followed by the email!
>
>$failedunsubscriptionmessage = "Sorry, you cannot unssubscribe as we didn't
>find an entry for ";
>
>
>
># Let the code begin...
>
>
>
># Checks if the file exists, if not creates a new one
>
>if (!file_exists($filelocation)) {
>
>$newfile = fopen($filelocation,"w+");
>
>fclose($newfile);
>
>}
>
># Open the datafile and read the content
>
>$newfile = fopen($filelocation,"r");
>
>$content = fread($newfile, filesize($filelocation));
>
>fclose($newfile);
>
># Remove the slashes PHP automatically puts before special characters
>
>$content=stripslashes($content);
>
># Reset the output of the "search result"
>
>$out="";
>
># Put the entries into the array lines
>
>$lines = explode("%",$content);
>
>for ($key=1;$key
># when the email is not in the list, add the old entries
>
>if ($lines[$key] != $email){
>
>$out .= "%".$lines[$key];
>
>}
>
># when it's already in the list, set found
>
>else {
>
>$found=1;
>
>}
>
>}
>
>
>
># Signing in
>
>
>
>if ($action=="sign"){
>
># When there is already a subscription for this email *duh*
>
>if ($found==1){
>
># Display Sorrymessage
>
>echo "align=\"center\">".$sorrysignmessage.$email."";
>
>$disp="yes";
>
>}
>
># otherwise, add the email to the list
>
>else {
>
>$disp="no";
>
>$newfile = fopen($filelocation,"a+");
>
>$add = "%".$email;
>
>fwrite($newfile, $add);
>
>fclose($ne

Re: [PHP] I'm doing something wrong....

2002-05-15 Thread Jerome Houston


http://www.php.net/manual/en/language.types.array.php

An array in PHP is actually an ordered map. A map is a type that maps values 
to keys.


we're not working with C where each array value is right next to each other 
in memory.  it's an abstraction that does the job intelligently, but gives 
you a familiar-looking interface.

-j

Original Message Follows
From: Robert Rothe <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [PHP] I'm doing something wrong
Date: Wed, 15 May 2002 17:10:44 -0400

Thanks.  So the next() and prev() functions just traverse an array using
some type of linked list?  This is what precludes direct access to
specific elements?


"Thalis A. Kalfigopoulos" wrote:
 >
 > In an associative array, there is no notion of the 'n-th' element. So 
AFAIK you can't do that.
 >
 > cheers,
 > thalis
 >
 > On Wed, 15 May 2002, Robert Rothe wrote:
 >
 > > I've created an array.  A very simple array that uses strings as keys.
 > >
 > > aname['one']=something;
 > > aname['two']=something else;
 > >
 > > Isn't there any way to directly access the 'n'th element?
 > >   example: aname[0]?
 > >
 > > I've searched the group, but haven't found anything.  Am I missing
 > > something or can't this be done?
 > >
 > > TIA,
 > >
 > > Rob
 > >
 > > --
 > > 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


_
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




Re: [PHP] I'm doing something wrong....

2002-05-15 Thread Jerome Houston


yah, there's a function. (isn't there almost always?)

http://www.php.net/manual/en/function.array-values.php

it gives you a numerically indexed array of all the values in your current 
array, associative or not.

-j

Original Message Follows
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
Reply-To: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>, "Robert Rothe" <[EMAIL PROTECTED]>
Subject: Re: [PHP] I'm doing something wrong
Date: Wed, 15 May 2002 17:14:58 -0400


There is no [0]...only ['one'] and ['two']...

Look through the array functions, there may be a way to reassign the keys...

---John Holmes...

- Original Message -
From: "Robert Rothe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 15, 2002 4:35 PM
Subject: [PHP] I'm doing something wrong


 > I've created an array.  A very simple array that uses strings as keys.
 >
 > aname['one']=something;
 > aname['two']=something else;
 >
 > Isn't there any way to directly access the 'n'th element?
 > example: aname[0]?
 >
 > I've searched the group, but haven't found anything.  Am I missing
 > something or can't this be done?
 >
 > TIA,
 >
 > Rob
 >
 > --
 > 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



_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




RE: [PHP] uh, oh errors?

2002-05-16 Thread Jerome Houston

one REALLY notable advantage is:

if you us ob_*() functions, instead of writing HTML pages with php tags 
inserted, you can write XML pages with PHP tags inserted.  then after you're 
done, you can pass the contents of the output buffer to an XSLT processer 
like sablotron, THEN outputting an HTML page.

-jerome


Original Message Follows
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] uh, oh errors?
Date: Thu, 16 May 2002 13:43:30 -0400

What are some benefits to using output buffering versus just letting it
generate as it goes?

-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 1:24 PM
To: PHP-general
Subject: Fw: [PHP] uh, oh errors?


Don't feel bad about this.  This is something that messes a lot of
people
up.  The browser knows where your headers end and where content begins
by
adding blank line between the headers and the rest of the page.  ALL
headers
must come before any content is printed to the page.  PHP will give you
that
error if you attempt to write a new header.  So in fact your problem is
not
on Line 13.. but is actually on Line 11.  There are at least two ways to
avoid this...

1. Don't print content before headers.  :)
2. Use output buffering to write the whole page before it is outputed
to the
browser.

Hope this helps,
-Keivn

- Original Message -
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:10 AM
Subject: [PHP] uh, oh errors?


 > Not sure how to resolve this, looked at php.net for the headers
available
 > and this is the error I am recieving:
 >
 > Warning: Cannot add header information - headers already sent by
(output
 > started at /path/to/connection/script/db.php:6) in
/path/to/login/checking
 > file/auth_done.php on line 13
 >
 > Here is the code that is in auth_done.php:
 >
 > session_start();
 > require '/path/to/login/checking file/db.php';
 > $db_table = 'auth_users';
 > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
 > password(\"$p_word\")";
 > $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
 > $num = mysql_numrows($result);
 >  if ($num !=0) {
 >   session_register('u_name');
 >   session_register('p_word');
 >   $msg_success = "Good freakin job poindexter!!";
 >   } else {
 >   header ("Location: index.php"); // This is line 13 that is my error
 > generator
 >   }
 >
 > This is the code for the db.php script:
 >  $dbh = mysql_connect('localhost','username','password') or die('Could
not
 > connect to database, please try again later');
 > mysql_select_db('db_name') or die('Could not select database, please
try
 > again later');
 > ?>
 >
 > Any help would be great!  I am assuming there is another way to
redirect
 > users besides the header function, just not sure what it is or how to
use
 > it.  Thanks in advance,
 > Jas
 >
 >
 >
 > --
 > 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


_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




Re: [PHP] PHP in HTML

2002-05-16 Thread Jerome Houston

yeah, just find in your web server where to tell it what kind of files to 
send through php.

there are also possible good reasons for sending .html files through php.  
like if you don't want users to know that your website is written in php.

-jerome


Original Message Follows
From: Justin French <[EMAIL PROTECTED]>
To: Jeremy <[EMAIL PROTECTED]>

Your Apache config file will be set to only parse PHP pages if they have the
.php extension this is a feature, not a big, because otherwise every
html page on your server will be parsed, rather than just the php ones...
you could modify your apache config iff you wished, but I wouldn't.  .html
for HTML, .php for PHP, all is well.

Justin French


on 17/05/02 12:14 PM, Jeremy ([EMAIL PROTECTED]) wrote:

 > Hi Folks,
 >
 > A simple question that has me puzzled, obviously I have a config file 
wrong
 > somewhere..
 >
 > Why does a filename.php file run as php and a filename.html with php code
 > embedded not produce a php result?
 >
 > cheers,
 >
 > Jeremy Burton
 > Senior Consultant
 > PERTH TOURIST LOUNGE
 >
 > Level 2 Carillon City
 > Murray Street, Perth
 > Ph: +618 9229 2238
 > Fax: +618 9229 2220
 > Email: [EMAIL PROTECTED]
 >
 >
 >


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





_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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




Re: [PHP] Comon guys, please help.

2002-05-17 Thread Jerome Houston

This isn't a php question, which is why you aren't getting any answers...
there are many ways to go about this.  with cybercash and payflow, and all 
other payment gateways, you DO need a merchant account.  specifically, a 
merchant account that is compatible with the payment gateway you're trying 
to use.  Some services will accept credit cards for you, but charge you a 
more hefty percentage of sales (or some other fee system, like a 
per-transaction fee) to make it worth their while to write the software that 
does the credit card processing real-time for your website (like 
www.ezcharge.net).  most important is that you find somebody who gives a 
good deal on what THEY charge YOU, and who you can connect to in a way that 
you have available to you.  Lots of payment gateways just need you to have a 
utility that can send a HTTPS (!note the S !) POST or GET - which PHP by 
itself can't do yet - wait for 4.3 (and even then you'll need OpenSSL 
support compiled in).

maybe that will help, maybe it will further confuse you.  i leave it to the 
gods to decide.
-jerome


Original Message Follows
From: "r" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: [PHP] Comon guys, please help.
Date: Fri, 17 May 2002 19:42:04 -0700

  Hi Guys,
  Special greetings to all of you who have helped me in the past.

  As some of you know i just bought a PHP book called "Php Blackbook" which 
i
  heard is really good.
  Anyway, In chapter 4 it talks about credit cardsand then CyberCash
which
  is owned by verisign and payflow which too is owned by verisign. The book
  also gave me some url and RFCs to look up.
  I dont know if its coz i'm a newbie to PHP or just dumb but I just cant
  understand this...its too damn high funda for me,
  I know google is my pal so I went there, read up on differient RFCs and 
got
  even more confused!

  I just want to know have any of you worked on these systems? eg CyberCash
  and PayFlow?
  Does this mean that if i want to start accepting credit cards on my site i
  wont have to pay for a credit card merchant account?

  PLEASE HELP if you know the answer or can offer any suggestions,comments
  ANYTHING.

  Have a great day,
  -Ryan.

  /*If you see me getting beated up by the cops, put down the camera and 
come
and help me! */



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



_
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] ADODB - whaddya think?

2002-05-17 Thread Jerome Houston

Testimonial time!

Despite ROCK STAR assistance from a PHP developer, I'm having troubles with 
mssql_*() functions.  most of the problems are gone (or being fixed by some 
AWESOME people), but to make use of those fixes, i've got to use php v 
4.3-dev.  and there's other bugs in that (as there should be).  so i've been 
looking for alternatives to using the mssql functions...  and i've found 
something that looks promising: ADODB.  for those of you who don't know, 
some people have just written some code that attempts (and looks as if it 
does a pretty good job) of unifying ODBC calls for lots of different 
databases.  their website: http://php.weblogs.com/ADODB

What i want to know is:  does anyone have experience with these libraries?  
I tested them briefly, and it seemed to work like a charm, but so did the 
mssql_*() functions, until i got into some of the nitty-gritty uses of the 
DB.  Will lots of little bugs come about, the more i use it?  or have they 
ironed most of that out?

thanks for your opinons, and i apologize for possibly spurring another 
loquacious debate amongst smart people :-)

-jerome

_
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




Re: [PHP] Post form values - script flow

2002-05-21 Thread Jerome Houston

Looks good Tim.

if you're going to do it this way, make sure register_globals is set on in 
your php.ini.  also you check isset($srch) AND strlen(trim($srch)).  in most 
cases, both checks won't be necessary.  unless you have high error 
reporting, and php will complain if you check a variable that hasn't been 
set yet.

jerome


Original Message Follows
From: "Tim Greenleaf" <[EMAIL PROTECTED]>

I am very new to PHP about two hours.  I have a search page that I post back
to the same URL.  When the form is loaded I check to see if the seach
variable is set ($srch is the name of the text box on the form) and then
determine what function to call.  I either call a welcome message function
to be printed to the page or a function to search a database and build a
table of results.  I have included my script belowMy question is:  Is
this a good way to handle search forms with PHP?  Since I have no examples
to work from I am not sure what the proper way is.

Thanks for the help.

  if (isset($srch)){
if (strlen(trim($srch)) > 0) {
$srch = strtoupper(trim($srch));
buildtable($srch);
   }
   else {
dispwelcome();
   }
   }
  else {
   dispwelcome();
  }






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



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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




RE: [PHP] image_create(), header.....

2002-05-24 Thread Jerome Houston

While Natalie's solution is a valid one, i have another

first - the error you're getting is because the headers are sent AS SOON as 
you echo, print or output html outside of your  tags. you're echoing 
something before you call ob_start();

second- the reason this doesn't work, is because you're trying to write 
binary image bytes into an text html page  I think what you want is 
something like this (actually 2 scripts):

script1.php :
';
echo '';
?>

script2.php :



Original Message Follows
From: "Leotta, Natalie (NCI/IMS)" <[EMAIL PROTECTED]>

You can save them and then call them up, but then you have to use a cron or
something to empty out the folder.  Here's how I save it:

//Image created and everything up here, this is the very end of it
$myTime = time();
ImagePNG($im, "../spool/jp$myTime.png"); //this creates a unique name
chmod("../spool/jp$myTime.png", 0666); //leading 0, then the code for the
mode you want
ImageDestroy($im);

print "";

I hope this helps!

-Natalie

-Original Message-
From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 24, 2002 2:37 PM
To: PHP
Subject: [PHP] image_create(), header.


Im trying to use dynamic buttons, and Im trying to figure out how to get
around the header call.
I figure use output buffering, but so far Ive only come up with errors.
Anyone see a better way or any errors in my code. Thanks

nb:  Uncomment the echo() statement to get the error.
--
';

function button($word) {
 ob_start();
 header("Content-Type: image/png");
 $im = ImageCreate(100, 50);

 $black = ImageColorAllocate($im, 0, 0, 0);
 $white = ImageColorAllocate($im, 255, 255, 255);

 $start_x = 50 - (strlen($word) * ImageFontWidth(5) / 2);
 $start_y = 25 - ImageFontHeight(5) / 2;

 ImageString($im, 5, $start_x, $start_y, $word, $white);

 ImagePNG($im);
 ImageDestroy($im);
 ob_end_flush();
}

button('Hello World');

?>


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



_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




Re: [PHP] including functions on every php page in a site

2002-05-24 Thread Jerome Houston

go to:

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

and look for "auto_prepend_file"

-jerome
Original Message Follows
From: "Darren Gates" <[EMAIL PROTECTED]>
Reply-To: "Darren Gates" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP] including functions on every php page in a site
Date: Fri, 24 May 2002 15:54:28 -0700
Received: from [216.92.131.4] by hotmail.com (3.2) with ESMTP id 
MHotMailBEB8103D00534004310DD85C8304622C0; Fri, 24 May 2002 15:57:02 -0700
Received: (qmail 41049 invoked by uid 1010); 24 May 2002 22:56:42 -
Received: (qmail 39854 invoked by uid 1007); 24 May 2002 22:54:32 -
>From php-general-return-99175-the_hou_guy Fri, 24 May 2002 15:57:14 -0700
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
list-help: 
list-unsubscribe: 
list-post: 
Delivered-To: mailing list [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.
X-Posted-By: 66.214.14.119

Hello,

I have about 10 function definitions that I want included on every page in
my website. Instead of calling:



on every page, I'd prefer to have the functions automatically loaded into
memory when a user visits any page of my site. I was thinking that there may
be some what to do this with a root-level .htaccess file, but I'm not sure.

Can anyone offer a solution?

Thanks,
Darren



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



_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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