[PHP] Re: [PHP-WEBMASTER] I have a question for a php expert....

2010-06-09 Thread Daniel Brown
On Thu, Jun 10, 2010 at 01:29,   wrote:
>
> It amazes me that I have figured out the hardest parts to do, but I am 
> stumped on this and cannot get the darn thing to include properly, I would 
> appreciate some instruction as now I am at a loss!

Clint;

Send that to the PHP General list and I guarantee that you'll not
only get your answers, but learn even more than you intended (perhaps
more even than you wanted sometimes).

You can subscribe to that list at http://php.net/mailinglists .

To get you started, I've forwarded your message there.  Thanks to
reply-all email, you may even get your answers before you get the
chance to hit the "Subscribe" button.  Those guys and gals are pretty
quick.

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!

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



Re: [PHP] Question - foreach.

2010-06-09 Thread Daniel Brown
On Wed, Jun 9, 2010 at 21:49, Shreyas  wrote:
> PHP'ers,
>
> I am reading a PHP book which explains foreach and at the end says : *'When
> foreach starts walking through an array, it moves the pointer to
> the beginning of the array. You don’t need to reset an array before
> walking through it with foreach.'*
> *
> *
> *Does this mean - *
[snip!]

An easy way to think about it: foreach is cocky and doesn't give a
damn about the rules array functions or placements have set in place.
It'll start from the beginning, and to hell with everyone else.

In other words: foreach will iterate wholly; it will count *for*
*each* key in the loop, not just where another portion of the code
left off.

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!

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



Re: [PHP] Question - foreach.

2010-06-09 Thread Jim Lucas

Shreyas wrote:

PHP'ers,

I am reading a PHP book which explains foreach and at the end says : *'When
foreach starts walking through an array, it moves the pointer to
the beginning of the array. You don’t need to reset an array before
walking through it with foreach.'*
*
*
*Does this mean - *
*1) Before I navigate the array, foreach will bring the pointer to the
starting key?*
*2) After the first index, it goes to 2nd, 3rd, and nth? *


Regards,
Shreyas



Here is your best reference:

http://php.net/foreach

Look at the two Notes sections on the top of the page.

The first says this:

Note: When foreach first starts executing, the internal array pointer is 
automatically reset to the first element of the array. This means that 
you do not need to call reset()  before a foreach  loop.


Basically what you said.  But then the second says this

Note: Unless the array is referenced, foreach operates on a copy of the 
specified array and not the array itself. foreach  has some side effects 
on the array pointer. Don't rely on the array pointer during or after 
the foreach without resetting it.


--
Jim Lucas

A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

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



Re: [PHP] Question - foreach.

2010-06-09 Thread Adam Richardson
On Wed, Jun 9, 2010 at 9:49 PM, Shreyas  wrote:

> PHP'ers,
>
> I am reading a PHP book which explains foreach and at the end says : *'When
> foreach starts walking through an array, it moves the pointer to
> the beginning of the array. You don’t need to reset an array before
> walking through it with foreach.'*
> *
> *
> *Does this mean - *
> *1) Before I navigate the array, foreach will bring the pointer to the
> starting key?*
> *2) After the first index, it goes to 2nd, 3rd, and nth? *
>
>
> Regards,
> Shreyas
>

Number 1.

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


[PHP] Question - foreach.

2010-06-09 Thread Shreyas
PHP'ers,

I am reading a PHP book which explains foreach and at the end says : *'When
foreach starts walking through an array, it moves the pointer to
the beginning of the array. You don’t need to reset an array before
walking through it with foreach.'*
*
*
*Does this mean - *
*1) Before I navigate the array, foreach will bring the pointer to the
starting key?*
*2) After the first index, it goes to 2nd, 3rd, and nth? *


Regards,
Shreyas


Re: [PHP] Re: Passing large object between methods

2010-06-09 Thread Jim Lucas
mrfroasty wrote:
>
> //NOTHING!!!//
>

Well Mr. Froasty, was there a point to your email or do you always send empty
emails with random files attached to them to list the list?  Was their suppose
to be a question along with that email?  You simply forgot to add it?

-- 
Jim Lucas

A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

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



[PHP] Re: Passing large object between methods

2010-06-09 Thread mrfroasty
data = "B foo";

//call a function to add extra info on $obj_A
$obj = $this->addExtraInfo($obj);

//debug
print_r($obj);
echo "";

}

public function addExtraInfo($obj)
{
$obj->recs = "B bar";
return $obj;
}
}

class B
{
public $data;
public $recs;
public function  __construct()
{

}
}

//test
$testObj = new A();
$testObj->someFunction();
?>

data = "D foo";

//call a function to add extra info on $obj
$this->addExtraInfo($obj);

//debug
print_r($obj);
echo "";

}

public function addExtraInfo(&$obj)
{
$obj->recs = "D bar";
}
}

class D
{
public $data;
public $recs;
public function  __construct()
{

}
}

//test
$testObj = new C();
$testObj->someFunction();
?>-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Finding a font.

2010-06-09 Thread Dan Joseph
On Wed, Jun 9, 2010 at 11:14 AM, tedd  wrote:

>
> I came in late on this thread, so please forgive me if I don't hit the
> mark.
>
> Whenever I need to find the name of a font, I use this:
>
> http://new.myfonts.com/WhatTheFont/
>
>
Wow  I just tried this out...  I uploaded an image, it looked at it, and
told me what fonts the letters were using.  Thanks Tedd!

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code "NEWTHINGS" for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


Re: [PHP] Finding a font.

2010-06-09 Thread tedd

On Monday 07 June 2010 22:22:31 Karl DeSaulniers wrote:

Hi Dave,
It is called "Fine Hand" I believe. Found a copy here.

http://www.fonts.com/FindFonts/Detail.htm?pid=203813&/cgi-bin/
MsmGo.exe?grab_id=0&page_id=8346&query=HANDWRITING&SCOPE=Fonts


Thank you Karl,  how did you find it? every google search I did, I could find
all types of fonts, but never could find that "A" to compare it.


I came in late on this thread, so please forgive me if I don't hit the mark.

Whenever I need to find the name of a font, I use this:

http://new.myfonts.com/WhatTheFont/

The service is simply amazing.

Cheers,

tedd

PS: I was absent from this list for a couple of days because somehow 
I was unsubscribed. Interesting.



--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Generic Email

2010-06-09 Thread Richard Quadling
On 9 June 2010 09:08, Amit Bobade  wrote:
> Hi friends,
> I am new in  PHP. I want to know that how to send an email in HTML
> format(i.e. with proper header, footer, etc) in PHP.
>  Please suggest me with code.
>
> --
> Thanks and Regards,
> Amit
>

I use RMail from phpguru.org (previously called html_mime_mail).

http://www.phpguru.org/downloads/Rmail/
http://www.phpguru.org/downloads/Rmail/Rmail%20for%20PHP/
http://www.phpguru.org/downloads/Rmail/Rmail%20for%20PHP/docs.html

Others use PHPMailer.

I came to RMail first and it works fine for me (with the patches
available at the second link).

Richard Quadling.

P.S. Not the same Richard who created RMail. That's Richard Hayes.

-- 
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



Re: [PHP] Pagination?

2010-06-09 Thread Sharl.Jimh.Tsin
yes,LIMIT for mysql is useful.

Best regards,
Sharl.Jimh.Tsin



2010/6/8 Ashley Sheridan :
> On Tue, 2010-06-08 at 11:37 -0300, Paul Halliday wrote:
>
>> I just spent the last 1/2 hour looking at many different solutions for
>> this. Is there a universal favorite?
>>
>> Thanks.
>>
>
>
> It depends what you mean by pagination, as there are two parts to it.
> There is the display of the pagination nav and then the retrieval of
> paginated results:
>
> Use LIMIT in the SQL to paginate the data retrieved. I usually just use
> a few variables to determine the pagination display; $current_page,
> $items_per_page, $total_pages (which can be got by issuing a COUNT() in
> the SQL for all possible records that match.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

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



[PHP] Generic Email

2010-06-09 Thread Amit Bobade
Hi friends,
I am new in  PHP. I want to know that how to send an email in HTML
format(i.e. with proper header, footer, etc) in PHP.
 Please suggest me with code.

-- 
Thanks and Regards,
Amit


[PHP] Re: combo box validation

2010-06-09 Thread Pete Ford

On 07/06/10 18:49, David Mehler wrote:

Hello,
I've got a form with two combo boxes, one for the month one for the
day. Both are required. I've got code that checks the post submission
to ensure neither is empty. My problem is that if a user does not
select anything in the combo boxes January first is sent, this i don't
want. If they haven't selected anything i'd like that to show as an
error.
Thanks.
Dave.


It's not really php, but if you make the default option of each combo return an 
empty value then you can assume that the user didn't choose anything and flag 
the error:


Like:


Select One
January
...


You should find that if the empty option is selected the PHP will not receive a 
value in $_REQUEST['month'], or at least it will be something equivalent to NULL.


--
Peter Ford, Developer phone: 01580 89 fax: 01580 893399
Justcroft International Ltd.  www.justcroft.com
Justcroft House, High Street, Staplehurst, Kent   TN12 0AH   United Kingdom
Registered in England and Wales: 2297906
Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS

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