RE: [PHP] This is getting ridiculous

2003-08-20 Thread Chris W. Parker
Dan Anderson 
on Wednesday, August 20, 2003 12:37 PM said:

>>   Blocking the users is not solving the issue...
> 
> Don't just block random users.  Create a rule something like:

First of all he didn't mean any random user as if someone would just
willy-nilly block someone.

Second, it would be better if the list owners would do something about
it.


Chris.

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



RE: [PHP] This is getting ridiculous

2003-08-20 Thread Chris W. Parker
Dan Anderson 
on Wednesday, August 20, 2003 1:06 PM said:

> Sure, I absolutely agree with you.  But there are a lot of lists /not/
> doing anything about it.  So whatever.  Don't spend a half hour
> bitching about the spam  -- spend 5 minutes blocking it and be done
> with it. 

1. I can see that you have issues with anger. Have you thought about
seeing a therapist?

2. So because other lists aren't doing it, this one shouldn't also? I
wonder, would you jump off a bridge if everyone else was doing it too?

3. I'm not talking about spam sir. I'm talking about the addresses that
are subscribed to this mailing list that when sent an email immediately
send back some sort of stupid response like our friend [EMAIL PROTECTED]
did. Either he's been removed from the list or he's cleaned his inbox so
that emails are being accepted again.

4. Also it wastes bandwidth for the list owners and the people
subscribed. It just adds bloat and confusion. Here's analogy:

When I was little kid I used to go camping with my grandparents about
once a year. One of my favorite things to do was gather as many dry
leaves as I could carry and dump them on the fire. If I could carry
enough leaves, the fire would be completely covered and look like it had
been put out. But after waiting a few seconds the fire would consume all
the leaves and end up burning a little bigger than before.

Instead of throwing as many leaves on the fire as we can we should
instead put the fire out with water or sand.

The comparison is that your solution does not stop or even lessen the
problem, it just masks it. That's not how problems get solved.


Chris.

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



RE: [PHP] Re: rich text editing

2003-08-20 Thread Chris W. Parker
DvDmanDT 
on Wednesday, August 20, 2003 1:32 PM said:

> Look into activeX stuff... That's how they do it...

Umm.. that's how they do what?

Oh I see what happened... you forgot to include the text you were
replying to in your email so that anyone reading your response could
understand the context!


c.

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



[PHP] functions/methods and what they should return

2003-08-20 Thread Chris W. Parker
Hi people.

I'm working on a large application right now (complete ecom store) and
I'd like to get some feedback on something.

Each product that is in the database can have at least one attribute to
it (i.e. color, size, etc.). Right now I've got a method in my Products
class called ShowAttributes($id). This method, based on the ID passed to
it, will query the db and ultimately return a string that makes up the
drop down box for a form.

Am I better off doing this sort of thing in a function or having the
function only return the records I need and let the calling page handle
the display of the records?


What do you think about this?


Thanks,
Chris.

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



RE: [PHP] functions/methods and what they should return

2003-08-20 Thread Chris W. Parker
Dan Anderson 
on Wednesday, August 20, 2003 3:04 PM said:

> You want to break off things into as many functions and components as
> possible.

Hmm.. Ok. So right now I've got this (psuedo code):

function displayAttributes($id)
{
// query db
// store results in array

// perform logic that builds HTML string

// return HTML string
}

But instead you think I should do this:

function GetAttributes($id)
{
// query db

// get records

// return record array
}

function BuildAttributes($id)
{
$attributes = GetAttributes($id);

// format $attributes

// return HTML string
}

Is that what you're suggesting?

> The idea is that if you want to change the way tables are
> displayed with the data, for instance, you can't break the way data is
> queried.

I don't understand this exactly. What do you mean by "can't break the
way data is queried"?

> I usually have a bunch of different files like
> "inc.function.something.php" and use lots of require_once()
> statements. 

Hmm.. Although this sounds like a good idea at first, it seems like it
would get pretty complicated really fast. Am I missing something?


Thanks.
Chris.

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



RE: [PHP] functions/methods and what they should return

2003-08-20 Thread Chris W. Parker
Dan and Ray,

Thanks for your help. This helps clear some things up for me!


Chris.

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



RE: [PHP] virus on the list

2003-08-21 Thread Chris W. Parker
electroteque 
on Thursday, August 21, 2003 2:34 AM said:

> i am aware of this, is there any way to filter it? i'll shut up now ;\

Yes. But this depends on how your setup is. You could try filtering by
filetype. Don't accept files with a .pif extension. You could filter by
subject (this virus/worm is called SoBig.F). You can find a list of
subjects this virus uses by visiting any one of the anti-virus vendor
websites.

As far as filtering what comes through the list, some people think that
shouldn't happen and other's think it should. Regardless, no one seems
to know how to get in contact with the list owners anyway so probably
nothing is going to happen.


c.

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



RE: [PHP] Capturing script output

2003-08-21 Thread Chris W. Parker
Joel Konkle-Parker 
on Thursday, August 21, 2003 9:17 AM said:

> Can anyone offer some advice as to what I should do here?

1. Remove the buffering calls that are within the script your trying to
buffer.
2. Have the child script write it's output to a file on the server and
then have the parent script read that file.
3. Try a completely different code design so that you don't have to
worry about all this mess.



Chris.

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



RE: [PHP] Mailing List Weirdness

2003-08-21 Thread Chris W. Parker
Curt Zirzow 
on Thursday, August 21, 2003 1:09 PM said:

> The issue has been resolved, I am currently getting these
> autoresponders off the list.

Hurray!

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



RE: [PHP] Date Validation, Kinda'

2003-08-21 Thread Chris W. Parker
Jay Blanchard 
on Thursday, August 21, 2003 12:30 PM said:

> Has anyone written any date validation function or sequence.

Now that I'm thinking about it, what is your goal with this? Is it to
make sure the date entered is within a certain range when compared to
another date? i.e. The date entered cannot be more than absolutevalue(10
days) away from the first date or is it just to make sure it's in the
proper format?


Chris.

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



RE: [PHP] Any similiar function to number_format????

2003-08-21 Thread Chris W. Parker
And now to send my response to the entire list.

--

Scott Fletcher 
on Thursday, August 21, 2003 1:12 PM said:

> Wondering if there is any similiar function to a php
> number_format(). This time, without a period.  For example, if I get
> a '1', I would like to format it to be '01' in two digit.

Don't know about that but you could easily make your own.



Or I guess I could make one for you.


Chris.

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



RE: [PHP] Date Validation, Kinda'

2003-08-21 Thread Chris W. Parker
Jay Blanchard 
on Thursday, August 21, 2003 1:24 PM said:

> It is to make sure that the user has entered a valid future date in
> the MMDD format into the form.

(You may very well already know of these two functions and already
thought of what I'm going to tell you but I thought I should share
anyway.)

In that case maybe these two functions will get you going:

www.php.net/checkdate
www.php.net/getdate

I'm thinking this:

1. you get the date from the user
2. validate it using checkdate()
3. get the current date
4. compare the two dates to see if the users date is later than todays
date
5. return true or return false

Sound good?


Chris.

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



RE: [PHP] File upload and deletion

2003-08-21 Thread Chris W. Parker
Steven Murphy 
on Thursday, August 21, 2003 1:40 PM said:

> http://www.pfohlsolutions.com/projects/mailer/mailer.zip. I'm having

Are you wanting me to download this file, unzip it, stick it on my
server, run/test it, and then report back to you with where you've made
a mistake or give you a solution?

No thanks, I prefer to do my own homework.

BUT! What I will do* is try to answer specific questions.

> What should happen is:
> -The user should be able to attach or not attach a file.
> -If a file is uploaded it is mailed then deleted.
> -If a file is not attached then the attachment section is ignored and
> everything else is mailed.

How exactly is the above not working? Where is the script going wrong?
What specifically are you having trouble doing?


hth,
Chris.

* I can't speak for everyone on this list but I'm sure there's at least
one other person that shares my feelings.

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



RE: [PHP] google style paginating

2003-08-21 Thread Chris W. Parker
Ted Conn 
on Thursday, August 21, 2003 2:01 PM said:

> Hi I am new to this newsgroup and I plan on replying to all the posts
> I can for now...

Hopefully those replies will be useful. ;)

> I'll show you the code I am using
> now for next and back buttons...

Hmm... that's a lot of code. What exactly am I supposed to do with it?


But anways... To do what google does you'll have to figure out how many
records there are in total first. (At least that is how I do it.)

It goes like this.

1. someone searches for something
2. you pull back a complete list of records
3. count them
4. store the number somewhere
5. display the first ten results along with page numbers
6. user clicks next page
7. pass the stored record count to the next page
8. use the LIMIT query to pull back only the next records
9. dislpay the next records, use the stored value (that you passed in
step 7) to create your page numbers
10. rinse repeat


Does that help?


Chris.

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



RE: [PHP] Re: google style paginating

2003-08-21 Thread Chris W. Parker
Robert Cummings 
on Thursday, August 21, 2003 4:46 PM said:

> Don't retrieve ALL the queries then
> only display a subset. Otherwise what's the point of using the LIMIT
> clause for conservation of resources?  The "SELECT COUNT( * ) FROM
> foo" query is usually optimized to be extremely fast so the first
> query is almost negligible in contrast to the second.

Heh... I've never really used COUNT() so I'll have to see how much it
speeds up my searching. :)


Good idea!

Chris.

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



RE: [PHP] Window.status message

2003-08-25 Thread Chris W. Parker
murugesan 
on Monday, August 25, 2003 1:51 AM said:

> echo "Click here ";

Google* is your friend

http://hotwired.lycos.com/webmonkey/96/40/index3a.html?tw=programming


Chris.


* search terms used were "window.status"

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



RE: [PHP] [Newbie Guide] For the benefit of new members

2003-08-25 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Monday, August 25, 2003 5:11 AM said:

> 5. Provide a clear descriptive subject line. Avoid general subjects
> like "Help!!", "A Question" etc.

Change to:

5. Provide a clear descriptive subject line. Avoid general subjects like
"Help!!", "A Question", etc. Especially avoid blank subjects. Many
people see this as rude and will ignore your mail outright, myself
included.


(Does it make sense to put "urgent help needed!" in your subject? Isn't
everyone's email "urgent" to one degree or another?)

8. It's always a good idea to post back to the list once you've solved
your problem. People usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your solution you're helping
the next person with the same question.


.02

Chris.

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



[PHP] verifying sql INSERTs

2003-08-25 Thread Chris W. Parker
Hi!

(MySQL)

What's the best way to determine a sql INSERT statement has executed
successfully?

What I've got is a function whose sole purpose is to add new staff
members to an app. I've written. There's a basic form that the user
fills out (first name, last name, email address) and submits. Only one
record per email address is allowed.

Here is a pseudo code version of what I have right now.

function insertStaffer($fname, $lname, $email)
{
$sql = "SELECT table WHERE email = '$email'";

if(1 or more records are found)
{
return 0; // means email address is already used
}
else
{
$sql = "INSERT INTO table ...";

return 1; // assume record inserted correctly
}
}

Now for my question: Should I just assume the INSERT INTO has worked
correctly (like I'm currently doing) and return a 1? Or should I verify
that the INSERT worked correctly (by using the MySQL last_insert_id()
function)?

Alternatively... maybe the mysql_query() function returns a true/false
status based on what happens? Hmm... I should look into that.


I'd appreciate any advice you have to give.


Thanks,
Chris.

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



RE: [PHP] Displaying Multidimensional Arrays

2003-08-25 Thread Chris W. Parker
Jason Williard 
on Monday, August 25, 2003 2:00 PM said:

> Would anyone be able to offer some assistance on this front?

Sure... if you give us more info. (i.e. maybe the array layout?)



c.

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



RE: [PHP] verifying sql INSERTs

2003-08-26 Thread Chris W. Parker
John W. Holmes 
on Monday, August 25, 2003 5:37 PM said:

> You should use mysql_error() to ensure your query did not fail for any
> reason. Assuming the query was successful, you can use
> mysql_affected_rows() to see if it actually had any impact on the
> database, i.e. the row was inserted.

Hey good idea. I'll do some experiment'n.


Chris.

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



RE: [PHP] verifying sql INSERTs

2003-08-26 Thread Chris W. Parker
Marek Kilimajer 
on Tuesday, August 26, 2003 3:59 AM said:

> mysql_query() will return true for queries that don't return rows and
> were executed without error, so you can use
> return mysql_query();

> You should also make a UNIQUE index on email column, then you can
> check the number returned by mysql_errno(), one number I don't
> remember signals duplicate entry error.

OOhhh... You know, I already HAVE done this, and I just came to the
realization that if I've already got a constraint on the email column
then why the heck am I checking to see if the value is already there?
That's just a waste of resources.

I should instead just try to perform the INSERT and then if it fails I
know I've already got a record. If it doesn't I know everything is cool.

Good idea!


Chris.

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



RE: [PHP] Website templating schemes

2003-08-26 Thread Chris W. Parker
Joel Konkle-Parker 
on Tuesday, August 26, 2003 9:26 AM said:

> I'm currently using the second method, but I've only seen the first
> used elsewhere. Is there a reason that #1 is better than #2 (or is
> anything else even better than that?)?

Thought about using Smarty? http://smarty.php.net

And I completely don't understand Option #2. What does body() do and why
do you call it? Can you show some pseudo code to help us (or maybe it's
just me) understand how Option #2 works?


Chris.

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



RE: [PHP] Need help - past deadline

2003-08-26 Thread Chris W. Parker
Jay Fitzgerald 
on Tuesday, August 26, 2003 10:40 AM said:

> can someone please look at my code below and tell me why it is only
> working half-way? It is only displaying radio buttons and seats for
> numbers 71, 73, 75, 77, 79, 81, 83, and 85.and it is printing
> seat # 76 since that is the one in the database between seats 81 and
> 83why is this happenening and HOW can i correct it???
> 
> 
> $sql = "SELECT seat, alias FROM attendees";
> $sql_result = mysql_query($sql,$connection) or die("Couldn't execute
> query."); 
> 
> $row = mysql_fetch_array($sql_result);
> $myseat =
>
array('70','71','72','73','74','75','76','77','78','79','80','81','82','
83','84');
> $i = 70;
> 
> foreach ($myseat as $seat)
> {
>  if (($seat) == ($row[0]))
>  {
>  if ($i <= 84)
>  {
>> 
>   class="red">
>}
>  }
> 
>  else
>  {
>  if ($i <= 84)
>  {
>> 
>   class="green">
>}
>  }
> }
>> 
> 
> 
> 
> Jay Fitzgerald, Design Director
> - Certified Professional Webmaster (CPW-A)
> - Certified Professional Web Designer (CPWDS-A)
> - Certified Professional Web Developer (CPWDV-A)
> - Certified E-Commerce Manager (CECM-A)
> - Certified Small Business Web Consultant (CWCSB-A)
> 
> Bayou Internet - http://www.bayou.com
> Toll Free: 888.30.BAYOU (22968)
> Vox: 318.338.2034 / Fax: 318.338.2506
> E-Mail: [EMAIL PROTECTED]
> ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf
> 

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



RE: [PHP] Website templating schemes

2003-08-26 Thread Chris W. Parker
Russell P Jones 
on Tuesday, August 26, 2003 10:44 AM said:

> Agreed with John W. Homes regarding his method of website templating.
> It is used in that fashion for all sites run by demcampaigns.com and
> www.collegedems.com

In that case it CAN'T be a good idea! HAR HAR!



Chris.

p.s. not looking to start a holy/flame war, just thought it'd be funny!

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



RE: [PHP] Need help - past deadline

2003-08-26 Thread Chris W. Parker
Jay Fitzgerald 
on Tuesday, August 26, 2003 10:40 AM said:

Whoops! Sent that first one prematurely. heh...


> can someone please look at my code below and tell me why it is only
> working half-way?

What does print_r($row) show you?


Chris.

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



RE: [PHP] verifying sql INSERTs

2003-08-26 Thread Chris W. Parker
Curt Zirzow 
on Tuesday, August 26, 2003 11:26 AM said:

> Like what happens if for some reason the constraint gets dropped?
> having your progam rely on the constraint will cause all data
> integrity to go to hell.

In that case I hope you're also incrementing your own IDs and not
leaving that up to the db either. You might also do yourself a favor and
write down each transaction instead of hoping the computer will do it's
job correctly. ;)

But seriously, how likely is it for a db/table to just drop it's
constraint? And in what situations would/could that happen?


Chris.

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



RE: [PHP] Website templating schemes

2003-08-27 Thread Chris W. Parker
Joel Konkle-Parker 
on Tuesday, August 26, 2003 1:51 PM said:

> Does that make any sense?

Yes, and that's what I kind of thought you meant but just couldn't
envision it completely.


Chris.

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



RE: Re[2]: [PHP] PHP Interview questions

2003-08-27 Thread Chris W. Parker
Jay Blanchard 
on Wednesday, August 27, 2003 9:13 AM said:

> You are taking a fruit from the crate labeled "apples and oranges",
> right? If so, you would be correct. Well done!

I hate not being able to figure these things out. :(

ME SAD!



c.

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



[PHP] php equivalent to asp's instr()

2003-08-27 Thread Chris W. Parker
Hi.

I don't know why but I've had the darndest time trying to find an easy
equivalent of asp's InStr() function in PHP. I know there is
preg_match(), strpos(), and strstr(), but none of them work like I want
them to.

In fact, except for maybe preg_match(), I can't get any of them to work
right.

I want a function that will return true if the string is found, and
false if it is not found.

Like this:*

$needle = "&";
$haystack = "Belle & Sebastian";

if(FoundInString($needle, $haystack))
{
echo "found!";
}
else
{
echo "not found!";
}


Anyone have a function to share?


Thanks,
Chris.


* Anyone catch the Belle & Sebastian show at the Greek Theatre in LA
this past sunday?

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



RE: [PHP] IS THIS A BUG?

2003-08-27 Thread Chris W. Parker
Steve Todd 
on Wednesday, August 27, 2003 1:28 PM said:

> Is this a bug or can we legally use it.

It's legal. And here is an article that explains it:

http://www.phphideout.com/articleview.php/5

(read near the bottom)


Chris.

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



RE: [PHP] SMTP server response: 550 5.7.1 Unable to relay for

2003-08-27 Thread Chris W. Parker
Àlex Camps 
on Wednesday, August 27, 2003 12:04 PM said:

> i have windows xp with apache,php and argomail
> but i cant send emails from php why?

According to your subject it looks like the computer you are trying to use to send the 
email does not allow relaying.


> thaks.

Thaks? Nah, I prefer chocolate milk.


hth,
Chris.
--
3:38pm

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



[PHP] list so slow... Sobig?

2003-08-28 Thread Chris W. Parker
Just wanted to get the consesus of the other list members... Is it SoBig
that is making the list so slow? It's taking about hour an or more for
my messages to come back to me.


Chris.

p.s. Probably a good idea to send responses off list if it's just to say
"Yeah that's happening to me too!"

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



RE: [PHP] String substiion for flash text

2003-08-29 Thread Chris W. Parker
Luis Lebron 
on Friday, August 29, 2003 12:41 PM said:

> Is there a way I can change something like 
> My Link to My
> Link

Yes. Probably best to use regular expressions. Read up on
www.php.net/preg_replace as a starting point.

If you don't know how to use regular expressions (I'm not that great at
it) I'm sure someone here will be able to write you one.

Also, I think you mean  and not  which stands for
Unordered List.


hth,
Chris.

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



RE: [PHP] Gripe

2003-08-29 Thread Chris W. Parker
Chris Shiflett 
on Friday, August 29, 2003 2:16 PM said:

> if ($foo) { if ($bar) echo 'blah'; else { echo 'else'; }
> ^
> Where is the missing brace? :-) |
  |
Here -/


I'm pretty sure I've seen an error message from something (maybe,
asp.net, or classic asp) that shows a line like i've drawn and points to
where it thinks the problem is. (And no it wasn't always the end of the
last line.) But maybe my memory is a little foggy.



Chris.

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



RE: [PHP] Gripe

2003-08-29 Thread Chris W. Parker
Chris W. Parker <>
on Friday, August 29, 2003 2:23 PM said:

> I'm pretty sure I've seen an error message from something (maybe,
> asp.net, or classic asp) that shows a line like i've drawn and points
> to where it thinks the problem is. (And no it wasn't always the end
> of the last line.) But maybe my memory is a little foggy.

I should also add (before someone corrects me) that is could have been
related to syntax errors only and not missing braces. Thus the "But
maybe my memory is a little foggy." clause in my previous post.



c.

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



RE: [PHP] creating a development log

2003-08-29 Thread Chris W. Parker
Merlin 
on Friday, August 29, 2003 3:03 PM said:

> Unfortuantelley this looks way more complicated than I thought. How to
> group by date and still get the entry, and how can I arange it, that
> it outputs only the one for the date and then closes the list`?

To display the output like you've got in your post you'd do something
like this:

(pseudo code)

$arrayOfEntries = GetEntries();

$previousDate = "";
foreach($arrayOfEntries as $entry)
{
if($previousDate != $entry['date'])
{
// show date header
// show comment for this record
}
else
{
// show comment only
}

$previousDate = $entry['date'];
}


Let me know if this helps (and if it doesn't too).

Chris.

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



RE: [PHP] Gripe

2003-08-29 Thread Chris W. Parker
Curt Zirzow 
on Friday, August 29, 2003 3:12 PM said:

>> Here +--+-/
>|  |
>   Or Here -+--/
>|
>   Or Here -/

Oh yeah of course. But I thought those were obvious.













Me no good at puzzles. :(


Chris.

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



RE: [PHP] Approaches to Logging In

2003-08-29 Thread Chris W. Parker
Seth Willits 
on Friday, August 29, 2003 3:24 PM said:

> Are sessions the way to go?

Well you could use cookies also but those can be tampered with.

Sessions aren't hard to work with really. All you need to do is start
the session, write a variable to $_SESSION if they have authenticated
successfully and then check for the existence of that variable on every
page. If it doesn't exist they have not authenticated.

Those are the basics.


Chris.

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



RE: [PHP] password systems

2003-09-02 Thread Chris W. Parker
Dennis Gearon 
on Sunday, August 31, 2003 12:36 AM said:

> Anyone have any sources of noun/verb/adjective lists for password
> generation?

Sorry I don't have a resource for you, but passwords shouldn't use
dictionary words in the first place. Have you considered creating random
passwords?



Chris.

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



RE: [PHP] Gripe^2 [was Gripe]

2003-09-02 Thread Chris W. Parker
Curt Zirzow 
on Friday, August 29, 2003 7:54 PM said:

> Why do people insist on using their work address so we are plagued
> with privacy notices and autorespond's letting us know that he will
> be gone one extra day over the weekend

Well fortunately for me I don't have a signature nor do I have a
disclaimer added on each email. But I can answer your question anyway. I
use my work email address because I'm not supposed to access any other
email addresses. I mean I can create all the aliases I want for my
account but I can't use a personal email address during work time.

So yeah, that's why.


Chris.
--
"I used to be indecisive, but now I'm indecisive. Wait, something's
wrong..."

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



RE: [PHP] Re: Website templating schemes

2003-09-02 Thread Chris W. Parker
Duncan Hill 
on Tuesday, September 02, 2003 8:07 AM said:

>> Search google for Smarty (I believe it's www.smarty.php) It's a
>> great way of separating output from the logic using templates.
> 
> That'd be smarty.php.net ... didn't know .php was a tld :)

And how about this one? www.microsoft.asp

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



RE: [PHP] evaluating dynamic variable

2003-09-02 Thread Chris W. Parker
Steve Goodman 
on Tuesday, September 02, 2003 12:54 PM said:

> Can someone
> recommend a way to reliably evaluate this variable?

1. (not positive on this point so correct me if I'm wrong) you shouldn't
compare with !==. Instead us !=.

2. What does the following do?

for ($i=1; $i<=$entries; $i++)
{
if(empty($_POST["resolutions".$i]))
{
echo "empty!";
}
else
{
echo "not empty!"
}
}


You might also like to try isset() along with empty().


hth,
Chris.

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



RE: [PHP] evaluating dynamic variable

2003-09-02 Thread Chris W. Parker
Chris W. Parker <>
on Tuesday, September 02, 2003 1:29 PM said:

> 1. (not positive on this point so correct me if I'm wrong) you
> shouldn't compare with !==. Instead us !=.

Ok, turns out I'm wrong on that. I guess I should go look it up!!

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



RE: [PHP] how to include() N lines?

2003-09-02 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Tuesday, September 02, 2003 3:04 PM said:

> i need to include() only a given amount of lines (the first 10 for
> example) instead of a whole file.
> 
> does someone know how this has to be done?

Yes. Remove those first ten lines (assuming they are removable) from the
original file you had them in and then include them in the old file with
include_once().

Then in the file you want to only include the ten lines just include the
smaller file.


Example: (I'm changing your 10 line requirement to 2 lines.)

Original.php:

Line 1
Line 2
Line 3
Line 4
Line 5

Take out Line 1 and Line 2 and put them in 2lines.php.

2Lines.php:

Line 1
Line 2

Then Original.php becomes this:

include_once "2Lines.php";
Line 3
Line 4
Line 5

Then in your other file that you need the 2 lines you can do just this:

NewFile.php:

include_once "2Lines.php";



HTH!
Chris.

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



RE: [PHP] how to include() N lines?

2003-09-02 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Tuesday, September 02, 2003 4:28 PM said:

> instead of including the whole database.php i need to include only a
> given number of lines, always starting with the first one.

I don't think you're going to be able to do this in the way that you
want (I've been wrong before).

I think your only option is to somehow rip the lines that you want into
another file before you do the include.

You could try using the the file system to copy only certain lines to
another temporary file and then include that temp file instead of the
whole thing.

Another option would be to tweak the logic so that it's not so bloated.


Chris.

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



RE: [PHP] Get the lowest value out of different fields

2003-09-03 Thread Chris W. Parker
Frank Keessen 
on Wednesday, September 03, 2003 12:14 PM said:

> I hope you can help me with this:

I hope so too!


> TEST
> 
> fieldnameValue's
> 
> testid  1
> testf1   3
> testf2   4
> testf3   0
> testf4   2
> testf5   0
> 
> (so this is one record!)

Waaahh? Please write out your table definition in a standard format.
Like this: (Doesn't have to be all fancy with the fancy characters, but
it should be horizontal and not vertical at the least.)

++++++
| testid | testf1 | testf2 | testf4 | testf5 |
++++++
| 1  | 3  | 4  | 0  | 2  |
++++++

See how much easier that is to read? (And you don't have to label the
fieldname's or the value's.)

> I want to display the lowest value, except 0.. So the SQL statement
> will be SELECT testf1, testf2, testf3, testf4, testf5 FROM test where
> testid='1' .  

Your query looks fine.

> I can't figure out if i can do this into a SQL statement or put it in
> an Array and sort it.. 

What do you mean you "can't figure out if i can do this into a SQL
statement"? You already did.

> Please help!

I'd really like to but I'm not sure what you want to do! Try explaining
it again please.



Chris.

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



RE: [PHP] Too Advanced? Re: Cookies & Hidden Image

2003-09-03 Thread Chris W. Parker
Nicole 
on Wednesday, September 03, 2003 2:56 PM said:

> But the script just gets a blank cookie when accessed this way(via
> hidden image); However, if the script was accessed directly, or the
> thankyou page resided on the same domain as the tracking script
> (which created the cookie to begin with), the cookie has the value
> that it was set with. 

If I understand you correctly, you are either leaving out important
details that would prevent my "solution" from working, or you're just
making it difficult for yourself because you're a masochist. ;)

Why don't you just send all the data you need to send via the url in the
 tag instead of relying on the cookie?


Chris.

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



RE: [PHP] Thanks Richard Schwartz

2003-09-04 Thread Chris W. Parker
Curt Zirzow 
on Thursday, September 04, 2003 10:58 AM said:

> You should be more careful at whom your including these replies to :)

But public floggings are good every once in a while. :)


c.

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



RE: [PHP] Am I dreaming or what :)

2003-09-04 Thread Chris W. Parker
John Taylor-Johnston 
on Thursday, September 04, 2003 4:57 PM said:

> But how do i get $files ?

What do you mean "get $files"?

This line right here:

>> $files  = split("\n",`ls *gif`);

"get"'s $files.

Try print_r($files); and see what happens.


Chris.


> thanks :)
> John
> 
> Raditha Dissanayake wrote:
> 
>> this is in fact pretty easy.
>> this should get you started
>> 
>> [code]
>> $files  = split("\n",`ls *gif`);
>> srand((double)microtime()*100);
>> 
>> $num = rand(0, count($files));
>> echo "$num = $files[$num]";
>> [/code]
>> 
>> John Taylor-Johnston wrote:
>>> I have a directory jammed-packed with images.
>>> I want to read the directory contents /www/usr/htm/images/
>>> and display randomly any *.gif or *.jpg in said directory.
>>> Do-able? Seriously? Ideas? Places to start?
> 
> --
> John Taylor-Johnston
> -
> "If it's not open-source, it's Murphy's Law."
> Université de Sherbrooke:
> http://compcanlit.ca/

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



RE: [PHP] Re: URGENT: how to make a global "server temporarily down" page?

2003-09-05 Thread Chris W. Parker
David Robley 
on Friday, September 05, 2003 5:59 AM said:

> Well, no - I am sure you can do it with an entry in .htaccess in the
> server root.

Yeah, like a rewrite rule.

RewriteRule ^*$ down.html



Chris.

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



RE: [PHP] countries,states and cities

2003-09-09 Thread Chris W. Parker
Augusto Cesar Castoldi 
on Monday, September 08, 2003 4:16 PM said:

> where can I download a database with all countries and
> states and cities?

I don't know but I would also be interested in this!!

> like:
> http://www.datingplace.com/servlet/NewRegistration

What? No North Korea? ;)



Chris.

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



RE: [PHP] Looking for a real good editor with some specific featrues ...

2003-09-10 Thread Chris W. Parker
Daniel Szasz 
on Sunday, September 07, 2003 6:43 AM said:

> I'm working in programming for many years and I'm looking now for an
> editor for php good like the borland editor in Delphi/CBuilder..
> Also I will be glad to b something with the same shortcuts like there
> ( i'm talking about classic shortcuts) since I'm working with that
> when wordstar was the best editor.

Daniel,

Not everyone is familiar with Delphi/CBuilder and their "classic
shortcuts". In other words, I have no idea what you're talking about
and/or what features you want.

But! I will recommend HTML-Kit from www.chami.com.



Chris.

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



RE: [PHP] Escaping the " ' " character

2003-09-11 Thread Chris W. Parker
Dan Anderson 
on Wednesday, September 10, 2003 5:17 PM said:

> If you don't like somebodys post just ignore it.  I'd bet your 2 cents
> that you don't find every post to this list interesting.  Do you reply
> to those people and ask them to not post stuff that doesn't interest
> you?

Dan,

You've completely misread and misinterpreted Robert's comments. He
didn't say he didn't want to read posts he wasn't interested in and he
didn't ask the poster to not post things he wasn't interested in
reading. He DID however request that people not send html emails to the
list.

How the heck did you turn a request for no html emails into a request
for people to not post things Robert is uninterested in??



Chris.

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



RE: [PHP] loading classes and efficiency

2003-09-11 Thread Chris W. Parker
Dan Anderson 
on Wednesday, September 10, 2003 5:44 PM said:

> require_once() or include_once()
> 
> The files containing the class files before you need them.  They will
> only be loaded when needed that way.

Not true. www.php.net/require_once

The way I understand it (maybe you know something I don't?)
require/include_once only prevent an included file from being included
MORE than one time, hence the character string _once tacked onto the end
of include() and require().

It does NOT however include a file only when it's needed, it merely
includes it once.


Please correct me if I'm wrong.

Chris.

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



RE: [PHP] Japanese on a page

2003-09-12 Thread Chris W. Parker
(now to the entire list)

Mark McCulligh 
on Friday, September 12, 2003 11:48 AM said:

> I am trying to create both an English and Japanese version of a site.
> The English done and I have the Japanese translation in a word doc. 
> Can someone point me in the right direction on how I do this. I know
> it has something to do with the META setting.

I have only dabbled in this so I don't know the proper terms and
technologies used, but I'll try to pass on what I've learned.

It requires a few things.

1. PHP needs to send the proper header. (At the top of each page.)



2. You also need to send the correct language info from within the page
itself. I suggest going to a japanese page and looking at the source.

3. You need an editor that can handle the japanese language. I stopped
trying to make japanese pages because I could not find a suitable editor
(granted I didn't try very hard and I wasn't about to buy something).



Hope this helps!
Chris.

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



RE: [PHP] SNMP mib resoultion

2003-09-12 Thread Chris W. Parker
Guy Fraser 
on Friday, September 12, 2003 1:53 PM said:

> This is my third attempt to send this message and I havn't seen one
> show up yet. :{
> 
> I hope this gets through.

I got it!!

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



RE: [PHP] Is this inefficient?

2003-09-16 Thread Chris W. Parker
Todd Cary 
on Sunday, September 14, 2003 9:34 AM said:

> I may have two buttons on the form and the Form Action has the same
> value as the current form, then at the top of my php script, I may
> have 

I've never done this but can you give the two buttons the same name but
different values? Assuming the value of the button that is clicked is
the only value you sent you can clean up the code a little.

$buttonPressed = $_POST['button'];

($HTTP_POST_VARS is deprecated [afaik])

(also notice i put single quotes around the index, you should too)

your code:

> if ($continue) {
>   //Do something - usually go to another page
> } elseif {
> ($cancel) {
>   // Do something - usually go to another page
> } else {
>   //Do something
> }

my code:

if ($button == "value1")
{
// do this stuff
}
elseif($button == "value2")
{
// do this stuff instead
}
else
{
// do this instead
}

> Is this inefficient or is there a better way to do this?

Yes it is because your testing only for the existence of a value and not
a specific value. This could allow a malicious user to fudge around with
your form, submit their own values, and possibly have your code react in
a way you wouldn't want it to.


your code:
> echo(NL);
> echo('' . $date . "");
> echo(NL);
> echo('' . $place . "");
> echo(NL);
> echo('' . $est_amt .
> ""); echo(NL);
> echo('' . $card . "");
> echo(NL);
> echo('' . $ccn . "");
> echo(NL);
> echo('' . $state . "");
> echo(NL);

How about this instead? (btw, i've never used NL so i'm going to assume
it's the equivalent of \n)

echo "$date\n"
."$place\n"
."$est_amt\n"
."$card\n"
."$ccn\n"
."$state\n";

Isn't that so much easier to read???


HTH,
Chris.

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



RE: [PHP] For Loops and Variables??

2003-09-16 Thread Chris W. Parker
John Ryan 
on Saturday, September 13, 2003 9:26 AM said:

> When I use for loops, at the start of each iteration, the variables
> hold the values from the last loop.

You're doing it wrong then (I think).

1. You should always initialize your loop counters.

i.e.

$x = 0;

while($x < 100)
{
$x++;
}

2. Don't use the same counter name in all your loops.

This is bad:

for($x=0;$x<100;$x++)
{
for($x=0;$x<100;$x++)
{
echo "i'm going to go on forever!!";
}
}

This Is Good(tm):

for($x=0;$x<100;$x++)
{
for($x=0;$x<100;$x++)
{
echo "Me happy now!!";
}
}



Does that help?

Chris.

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



RE: [PHP] For Loops and Variables??

2003-09-16 Thread Chris W. Parker
Chris W. Parker <>
on Tuesday, September 16, 2003 4:07 PM said:

> This Is Good(tm):
> 
> for($x=0;$x<100;$x++)
> {
>   for($x=0;$x<100;$x++)
>   {
>   echo "Me happy now!!";
>   }
> }

Hehe... whoops! Should be:

for($x=0;$x<100;$x++)
{
for($y=0;$y<100;$y++)
{
echo "Me happy now!!";
}
}



BYE!

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



RE: [PHP] Whats wrong with my code?

2003-09-16 Thread Chris W. Parker
Stevie D Peele 
on Tuesday, September 16, 2003 4:08 PM said:

> Okay, I took all the extra spaces out of my code, So it is now 151
> lines. 
> 
> I have attached that code, instead of posting it in my mail. It says

Attachments are even worse. I'll never open an attachment I receive on a
list.

1. Don't post tons of code
2. Don't send attachments.
3. Trim your posts!



Chris.

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



RE: [PHP] Control Structure problem

2003-09-16 Thread Chris W. Parker
Dan J. Rychlik 
on Tuesday, September 16, 2003 5:12 PM said:

> Thank you guys.  I truly know the level of expertise on this mailing
> list, and I know that it proves invaluable.


If by "I truly know the level of expertise on this mailing list" you
meant "I truly don't know the basics of PHP syntax", then yeah, you'd be
right. ;) !!


:)

Chris.

p.s. Or maybe it's me that's doesn't know the basics... ??

p.p.s. I totally think that the syntax you presented is logical and
should be available. It makes much more sense to me to do it the way you
did, but alas...

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



RE: [PHP] Japanese on a page

2003-09-17 Thread Chris W. Parker
- Edwin - 
on Tuesday, September 16, 2003 5:53 PM said:

This japanese page thing was a project I started at home so now that I'm
at work I'll do my best to respond using my memory (good luck, me!).

> Did you check if the Japanese characters are readable inside
> html-kit? In other words, Japanese characters should appear as it is
> inside your editor...

No the japanese characters did not appear correctly.  

>> 7. Save the page
> 
> Did you save it as euc-jp or shift_jis?

No. I don't think there is that option in html-kit, but I think that
this may be the key.

If you (a person) can save the file as the proper type there's probably
no reason to send the header() function, or for that matter there would
probably be no REASON to send the header().

>> 8. open it in the web browser
> 
> Before opening it in your browser, did you try opening again in your
> editor just to see whether you saved it correctly? 

No.

>> 9. cry because it doesn't work
> 
> Hmm... If everything is properly declared inside your  tags,
> your browser *should* automatically render the page correctly.
> Anyway, if it doesn't work, check that the "character coding" in your
> browser is properly selected. (If you're on Netscape or Mozilla,
> choose "View" -> "Character coding" -> your_character_coding_here.)  

Yes this is how I would expect it to work but it ended up not working
that way. But like I said I think it may be because of the type it saves
the file as.

>> A friend later figured out that the header() declaration at the top
>> of the page was what made the difference.
> 
> Did this one work for you?

Yes, adding the header() made the page display correctly from my server.

>> Do you know why it wouldn't work until that php code was added?
> 
> Not really sure. But think about this. People can write HTML pages
> without the help of php and the like and still have Japanese pages
> correctly rendered by their browsers. In other words, I can write an
> HTML page with Japanese characters in it, save it on my desktop (and
> not on my web server), double click it, my browser starts and show me
> the characters correctly--no php code necessary. 

That's how I expected it to work.


> Btw, iirc, phpedit on Win2k worked for me. Just make sure that you
> have Japanese fonts (and an IME) installed and you chose the correct
> (default) font for phpedit. This works even if you have on English
> version of Win2k (or XP).   

Oh cool. I have that already so I'll try it out.


Chris.

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



RE: [PHP] Help!!!

2003-09-18 Thread Chris W. Parker
#meen shari-ah# 
on Thursday, September 18, 2003 1:05 AM said:

Please do not post messages with "Help!!!" as the title. Everyone who
posts to this list needs help in some way. It's much better if you give
a short description of your problem. For example, "can't connect to
database" or "need to optimize this code", etc.


thanks,
c.

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



[PHP] autocomplete not working all of a sudden

2003-09-18 Thread Chris W. Parker
Hi everyone.

Pardon the crosspost but I figure if I'm going to post the same question
to two lists anyway, why not get it over with in one shot?


Ok so in an attempt to lessen Windows2k pro memory footprint I just
turned off three services. (1) TCP/IP NetBIOS Helper Service, (2) IPSEC
Policy Agent, and (3) Distributed Link Tracking Client.

Now the autocomplete functionality of IE is not working. IE used to save
all the search terms for google, now they're not there. I'm also working
on a project that requires a simple login, all my test usernames used to
be stored with the form but now they are not there anymore either.

I have no idea if either of those services had anything to do with or
not (it seems very unlikely that they are related) but it's the only
connection I can see.

Here's what I've done so far:

1. Turned all those services back on and then tried both google and my
login form again. Didn't work.
2. Checked the IE settings for autocomplete. They are correct.


Any ideas on how to get it working again?


Thanks,
Chris.

p.s. IE's address bar is still working (must be a separate function).

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



RE: [PHP] update password cookie

2003-09-18 Thread Chris W. Parker
John Kaspar 
on Thursday, September 18, 2003 4:05 PM said:

> Yahoo makes you reenter your password every time you reopen your
> browser.  I'll check other sites though.  Thanks for the advice.

As it should. You don't want to store password information in a cookie,
that's why yahoo requires you to reenter each time.

The only thing a site should keep in a cookie regarding username and
password is the username. yahoo (as well as many other sites) offer the
option of saving the username in a cookie so that when you get back to
the site your username is automatically filled in. it probably helps
relieve the "i forgot my username" emails.


chris.

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



RE: [PHP] update password cookie

2003-09-18 Thread Chris W. Parker
John Kaspar 
on Thursday, September 18, 2003 4:05 PM said:

> I'm just storing its hash.  Then comparing it to the database hash. 
> Is that bad? Is there a good write-up somewhere discussing
> authentication techniques that you could recommend?

Oh I should respond to this as well.

This is just a little better than storing a plain text password. Reason
being
that the next person that uses that computer can read the cookie and
steal the hash. They would then be able to reverse* it and get the
password so they could log in like a normal user.



Chris.

* By reverse I don't mean "decrypt" or "unencrypt".

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



RE: [PHP] um...

2003-09-19 Thread Chris W. Parker
Ryan A 
on Friday, September 19, 2003 2:36 PM said:

> Hey comon nowwith a cute name like Raquel let the lady do
> whatever she wants

Raquel eh? Reminds me of Raquel Welch, and as I recall Seinfeld made it
pretty clear that Raquel Welch is very mean. I'd be cautious of anyone
named Raquel.



;)

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



RE: [PHP] Shopping Cart Solutions

2003-09-22 Thread Chris W. Parker
Henrik Hudson 
on Monday, September 22, 2003 3:09 PM said:

> My 2 cents. OSCommerce is great if you want to use it out of the box,
> but we tried to extend it and alter some of it's functions and the
> code is very obtuse and making changes in one spot can lead to
> problems in others.

+1

I messed around with it for a few days just trying to add two fields to
the product table but it so difficult to find where all the mysql db
errors were being generated I just gave up and decided to write my own
cart from scratch. ;)

I should clarify a little. I gave up after only trying to add two fields
because the other features that I needed in a shopping cart were WAY
more complicated than the two fields and I reasoned that if it was that
difficult to add two fields it's going to be near impossible to add what
I wanted. So I decided my time would be better spent developing my own
cart (what learning experience it's been!!). I would be able to extend
my own cart much more quickly and efficiently than I could anyone elses
code.

> Also, it tries to throw in the kitchen-sink worth
> of options and if you need something slimmer or more easily
> configured you might be better off starting from another codebase.

+1



Chris.

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



RE: [PHP] PHP Editor - which to use?

2003-09-22 Thread Chris W. Parker
Binay 
on Monday, September 22, 2003 1:58 AM said:

> Please suggest me  a good PHP editor like ( Microsoft's Interdev for
> ASP) to write my php programs/scripts and get a visual feel. 

Doesn't fit in the "visual feel" category but I really like HTML-Kit
available at www.chami.com.



Chris.

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



[PHP] speaking of php editors

2003-09-22 Thread Chris W. Parker
Hey everyone.

I am looking for an editor that will highlight the string
"{$array['index']['index']}" within a string.

For example:

+- gray +
|   |
|  +-- red ---+ |
|  |  | |
$variable = "The amount is {$amount[0]}.";


Is there anything out there that does this?



Thanks,
Chris.

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



RE: [PHP] Subcategories in php

2003-09-22 Thread Chris W. Parker
phpu 
on Saturday, September 20, 2003 7:41 AM said:

> I have been trying to do this for weeks but i just cant figure this
> out. I have categories that have subcategories and i want to insert
> them into database.

If you need more than two levels of classification I would suggest you
use a method called Modified Preorder Tree Traversal. You can read about
it here. http://www.sitepoint.com/article/1105

It's a little complicated at first but once you grasp the idea it starts
to make a lot of sense.


Hope this helps.
Chris.

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



RE: RE: [PHP] PHP Editor - which to use?

2003-09-23 Thread Chris W. Parker
Jim Lucas 
on Tuesday, September 23, 2003 9:56 AM said:

> Plus, one added feature is, is that it will allow you to do internal
> scripting.

What are you able to do with "internal scripting"?



chris.

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



RE: [PHP] PHP Editor - which to use?

2003-09-23 Thread Chris W. Parker
Ryan A 
on Tuesday, September 23, 2003 11:10 AM said:

> O holy genius coder, we bow to you, forgive uswhy did we take the
> straight and easy path instead of the rough and true path...

Because we are not ereet.

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



[PHP] help with arrays

2003-09-23 Thread Chris W. Parker
Hey people.

I've got an array like this:


[0] => Array
(
[0] => j
[fname] => j
[1] => j
[lname] => j
[2] => jj
[state] => jj
[3] => [EMAIL PROTECTED]
[email] => [EMAIL PROTECTED]
[4] => 0
[newsletter] => 0
)

Some cells might be empty so i want to replace every empty cell with
" ". I can easily do this with just the numerical index but I can't
figure out how to do the textual indices also.

Someone have a clue?


Thanks,
Chris.

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



RE: [PHP] help with arrays

2003-09-23 Thread Chris W. Parker
Chris W. Parker <>
on Tuesday, September 23, 2003 1:38 PM said:

> Someone have a clue?

Hmm... maybe www.php.net/array_keys will help me out here.


chris.

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



RE: [PHP] help with arrays

2003-09-23 Thread Chris W. Parker
Robert Cummings 
on Tuesday, September 23, 2003 1:43 PM said:

> It doesn't get much simpler :)

Doh!!

> foreach( $data as $key => $value )

I don't use that syntax much so I'm not familiar with it. Maybe I should
start eh?


Thanks,
Chris.

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



RE: [PHP] SQL statement

2003-09-23 Thread Chris W. Parker
Dan J. Rychlik 
on Tuesday, September 23, 2003 4:58 PM said:

> I know its failing because php doesnt like the quotation before the
> format parameters.  Ive tried to fix this without any luck.  Any
> Ideas ?  

It's failing because the ' before the %d is closing the string.

Here's how I work out SQL stuffs:

$sql = "SELECT username\n"
."  , password\n"
."  , DATE_FORMAT(timestamp, '%d%m%y')\n"
."FROM custlogon";

$query = ($sql);


Althought it looks like it takes a lot more time to write (which is
true) it looks great when you are debugging.

echo "$sql";


Alternatively you should be able to do this:

$query = ("SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y')
FROM custlogon");



chris.

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



RE: RE: [PHP] PHP Editor - which to use?

2003-09-25 Thread Chris W. Parker
Jim Lucas 
on Thursday, September 25, 2003 11:52 AM said:

> I already answered that question two days ago.

I didn't ask you to answer it twice so I don't what you're talking
about.



c,

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



RE: [PHP] PHP coders spare time [OT}

2003-09-29 Thread Chris W. Parker
Curt Zirzow 
on Sunday, September 28, 2003 6:50 PM said:

> And what they do with it...
> 
> http://zirzow.dyndns.org/html/mlists/php_general/

Two comments:

1. Top 10! w00t! w00t!
2. Good job Curt.


Chris.

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



[PHP] captcha WAS Please visit my php program

2003-09-29 Thread Chris W. Parker
Ryan A 
on Saturday, September 27, 2003 12:22 PM said:

> Please visit my captcha program here and tell me if its good or if
> you think i need to make some changes in text,color or anything.

Exactly what is the purpose of this? Let me clarify. I know that it's
supposed to prevent computers from submitting forms automatically
because they cannot read the graphic, but what I don't understand is in
what cases this is useful?

And specifically Ryan, where will you be using this?


I'm trying to gauge whether or not this would be worthwhile for a
project I'm working on right now.


Thanks,
Chris.

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



RE: [PHP] captcha WAS Please visit my php program

2003-09-29 Thread Chris W. Parker
Chris Shiflett 
on Monday, September 29, 2003 10:34 AM said:

> You end up with so many chargebacks that you lose your merchant
> account, and your company loses so much money that you lose your job.
> 
> How's that? :-)

Sounds fine to me thanks!



Chris.

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Angelo Zanetti 
on Tuesday, September 30, 2003 5:43 AM said:

> hi I have a table with rows and each row contains a checkbox ( array)
> and a record. TD of the checkbox:
> echo(" value=". $chkSessionF[$i] .">");

Firstly you should be putting double quotes around every value in your
HTML tags.

Revised: (watch wrap)

echo "";

I also changed

". $chkSessionF[$i] ."

into

{$chkSessionF[$i]}

.

You can do it either way. I prefer the latter.

If you're not sure what a value is use print_r() to determine it.

echo "";
print_r($chk);
echo "";

Quick side note on the above code:

You cannot write it like:

echo "".print_r($chk)."";

It will not work.

> can anyone help. this is very strange.

I think your problem may just be the quotes around the values in the
HTML. Give it a shot.



hth,
chris.

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



[PHP] storing japanese in mysql (or pgsql)

2003-09-30 Thread Chris W. Parker
(I posted this to another list yesterday without response, so if it
looks familiar, that's why.)

Hi.

I'm working on a small study aid for myself (and anyone else that wants
to use it) and I could really use the ability to store Japanese
characters in a MySQL or pgsql db. Right now I've created a very large
array.

What I'd like to do is have a form that will allow me to add new
characters whenever needed. So far my attempts at this have failed. It
always seems that the extended characters get turned into their html
entity equivalents before they are inserted into the db.

I'm using euc-jp as the character set.


I'm pretty much lost with this. Anyone have experience with this that
they'd like to share? (on or off list is fine.)


Thanks,
Chris.

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Jason Wong 
on Tuesday, September 30, 2003 11:06 AM said:

>> echo "".print_r($chk)."";
>> 
>> It will not work.
> 
> You can do this though:
> 
>   echo "", print_r($chk), "";

Well heck, that makes things easier!

What's the difference between using , or . for concatenation? (I thought
they were the same.)



Chris.

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Jason Wong 
on Tuesday, September 30, 2003 11:27 AM said:

 echo "".print_r($chk)."";
 
 It will not work.
> 
> Actually, the above *does* work!

Not for me. (Although we may be testing different things.)

".print_r($pageTitle)."";
?>

Gives me:

Checkout Step One1


If I use the , it's a little closer but still not correct (at least not
what I want). With , I get:

Checkout Step One1

Close but I don't know where the one is coming from. Maybe it's saying
it's 'true'?



Chris.

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
CPT John W. Holmes 
on Tuesday, September 30, 2003 11:32 AM said:

> Note that print_r() will (by default) return a 1 (TRUE) upon success,
> so you end up with a "1" being printed at the end of your data.

[snip]

That answers it!




c.

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Chris Shiflett 
on Tuesday, September 30, 2003 11:39 AM said:

> The comma isn't concatenation; echo can take multiple arguments.

Oh ok, I get it.

> I've heard statements about passing multiple arguments to echo being
> faster than using concatenation, but every benchmark I've tried
> myself shows them to be nearly identical. Feel free to try it
> yourself and post your results. :-) I'd be curious to see if others
> reach the same conclusion. 

I tried this, and I think the comma was just slightly faster than the
period. But then again I didn't always get consistent results because I
was trying this out on a machine that is not very fast so the speed at
which is processes something varies quite a bit.

My conclusion was that it's not fast enough to bother changing all my
code, or start writing in a new way.


Although during some testing I did find that writing loops in the
following way is faster than normal.

$counter = -1;
while(++$counter < $amount)
{
// do stuff
}

It made a big enough difference on my slow machine to merit me writing
as many loops in this way as I can. (I think.)



Chris.

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Eugene Lee 
on Tuesday, September 30, 2003 2:12 PM said:

> A heredoc is more readable:
> 
> echo <<  value="{$chkSessionF[$i]}">
> HTMLTAG;

Yeah, but I don't like those. :P


chris.

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



RE: [PHP] storing japanese in mysql (or pgsql)

2003-10-01 Thread Chris W. Parker
- Edwin - 
on Tuesday, September 30, 2003 7:00 PM said:

> What exactly do you mean by "extended characters"? And, do you mean
> all *other* characters are inserted properly? Anyway,... 

I just mean the characters that you can't type unless you do something
like alt-250, alt-145, etc.

> If they're not "ujis" (for euc-jp), add this to your "my.cnf" file:
> (Under [mysqld] and [client]) 
> 
>   default-character-set = ujis

I added that line to the [mysqld] section but there was no [client]
section so i added the following.

[client]
default-character-set = ujis

> Btw, check your php.ini as well and make sure that your settings
> under [mbstring] are correct. 

Each line in the [mbstring] section was commented out. So I uncommented
them. I also uncommented the mbstring extension.


I'm just about to restart both servers, so we'll see what happens.



Thanks,
Chris.

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



RE: [PHP] documentation on "<<<"

2003-10-01 Thread Chris W. Parker
Rich Fox 
on Wednesday, October 01, 2003 10:08 AM said:

> Can someone point me to documentation on the <<< operator? I am
> wondering if there are some quirks I don't know about. Yet I can't
> find it documented on the php website.

I don't know the answer to your question but...

Did you know that it's called the heredoc operator? You
may be able to find information if you search google for "heredoc php"
and/or "heredoc operator php".


hth,
Chris.

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



RE: [PHP] regex drive me crazy

2003-10-01 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Wednesday, October 01, 2003 1:02 PM said:

> Does this make ANY sense?

Seeing as how you haven't had a response yet, I'll ask this: what
exactly is your question? I'm not sure as to what it is that you want.



c.

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



[PHP] your method for validating forms

2003-10-01 Thread Chris W. Parker
Hey people.

I'm trying to come up with an easy way to validate forms. I've got an
idea and I'd like your feedback as well as suggestions and/or your own
methods.

My idea is to have a multi-dimensional array with fields: data and type.

Let's say you have a form with three fields. First Name (fname), Last
Name (lname), and Phone Number (phone). It's sent to a processing script
via GET. On the processing script you have the basics:



What I'd like to do is get rid of all the if's and what not and throw
them into a function. What I thought of doing to replace all this is:



The validateFormDate() function would be defined something like this:

function validateFormData($input)
{
foreach($input as $field)
{
switch ($field['type'])
{
case 'name':
// do the magic
break;
case 'phonenumber':
// do the magic
break;
}
}
}


The validateFormData() function will return false if there are no errors
to report.

For a form that has a lot of fields to validate I think this can make
things pretty easy.


So... what do you think?



Chris.

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



RE: [PHP] Re: your method for validating forms

2003-10-02 Thread Chris W. Parker
Chris Shiflett 
on Wednesday, October 01, 2003 11:18 PM said:

> There are definitely benefits to saving the extra request and response
> necessary to properly display errors, but I'm not so sure I would
> count usability as one of them. In addition, the user's perception of
> the site's general quality and professionalism may be a concern, and
> a JavaScript popup certainly doesn't improve this.

I went to an ecom site today that used js validation but in a very slick
way. There were no popups to be seen. Instead, when I tried to add a
product to my cart without specifying some attributes a little red
message magically appeared on the page that said "Please choose a
color".

A client-side validation class would be usable imo if it doesn't utilize
popups. Not being experienced with js I can imagine that not using
popups and still warning the customer of a mistake would be complicated.

I prefer server-side but that's mainly just because I don't like js.



Chris.

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



RE: [PHP] PHP Editor

2003-10-02 Thread Chris W. Parker
Nico Berg 
on Thursday, October 02, 2003 5:09 AM said:

> I am pretty new in PHP coding. So for starters i want to know what is
> a good php-editor?
> I like them freeware for windows.

HTML-Kit www.chami.com



c.

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



RE: [PHP] include() problems

2003-10-02 Thread Chris W. Parker
Gustave Bernier 
on Thursday, October 02, 2003 6:20 AM said:

> The address is: http://mydomain.com/forums/ssi.php?a=active
> 
> The code I'm trying now is:
> $_GET['a'] = 'active';
> include('forums/ssi.php');

You're including the parent file in itself. This could be the problem.



c.

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



RE: [PHP] Re: your method for validating forms

2003-10-02 Thread Chris W. Parker
Robert Cummings 
on Thursday, October 02, 2003 12:15 PM said:

> Heeey, a great little response like this to see an alternative
> to a popup and no link for us to check it out *pffft* Where'd
> you learn your posting manners? Were you brought up in a web barn?
> *grin*. Wouldn't happen to know the URL still would ya?

Haha... ummm... I... uhh... don't have a link because I made a mistake.

What really happened was when I clicked on a product on the site a small
popup window appeared. This window had very little information on it and
so was very light. When I clicked Add to Cart it submitted and refreshed
so fast I didn't see a flicker, and therefore it looked like it was
using some kind of client-side validation.

I rechecked it just now and noticed the flicker so that's how I knew I
was wrong.

But still this sort of client-side validation is something that will go
onto my long term todo list. And it's like Curt described, instead of
popping a window you make a  or  or something like that
appear.


Chris.

p.s. Just in case you want to see the site I'm talking about it's
http://www.prana.com/.

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



RE: [PHP] PHP coders spare time [OT}

2003-10-03 Thread Chris W. Parker
Curt Zirzow 
on Friday, October 03, 2003 8:26 AM said:

> Something like this:
>   http://zirzow.dyndns.org/html/mlists/php_general/

Cool page!


But if you would do us all a favor and give your pages some useful
's, because you know, EVERY PAGE IS CALLED "PHP DEVELOPMENT",
that'd be great, thaaannnkkss.


c.

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



RE: [PHP] PHP Editor

2003-10-03 Thread Chris W. Parker
Nico Berg 
on Friday, October 03, 2003 12:38 AM said:

> Hi, I have found the solution to my problem, I share it
> http://phpeditors.linuxbackup.co.uk/

OOH! OOH! OOH! This should be added to the weekly PHP Newbie post!!!



chris.

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



RE: [PHP] Tracking IP Addresses

2003-10-03 Thread Chris W. Parker
Stephen Craton 
on Friday, October 03, 2003 1:19 PM said:

> I'm wanting to track IP addresses by pinpointing their geological
> location (country and whatever) but I have no idea how to go about
> doing this. I've been searching on the net and PHP websites all day
> but with no luck. Can anyone point me towards a tutorial site or
> explain to it for me?

Try here: http://ip-to-country.directi.com/



chris.

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



[PHP] method to prevent multiple logons of same account

2003-10-03 Thread Chris W. Parker
Hi.

Ok I've got the logging in of customer accounts settled but what I need
to work into the system is that of preventing more than one instance of
the same account.

If I logon right now as testuser1 on ComputerA and then go to ComputerB
and login as testuser1 it'll work just fine. What I want to do is one of
the following: (a) prevent the second instance of testuser1 from
succeeding, (b) logoff the first instance of testuser1 when the second
instance authenticates.

I know I'll have to keep a database and store the following: username
(or user id), session id, time of login, and/or time of last action.

Option A is very easy. I can easily look in the database and see if that
person is already logged in. If they are found in the db I just refuse
the second login attempt. Option B on the other hand seems a little more
difficult. As far as I've thought it out so far I'll have to check the
db on each page request to see if the user is still valid. That is to
say, if the second attempt is allowed to login I would have to change
the users session id from the first instance to the second instance.
Then when the first instance goes to a new page the application would
say "Hey wait a minute buddy! Your session id is different than the one
in the database. You've either timed out or someone else has logged in
with the same username."


Am I thinking this through correctly? Comments?



Chris.

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



<    1   2   3   4   5   6   7   8   9   10   >