php-general Digest 4 Feb 2007 13:52:56 -0000 Issue 4607
Topics (messages 248263 through 248276):
Re: include file identifier
248263 by: Larry Garfield
248264 by: Robert Cummings
Billing client for studying documentation
248265 by: Mike Mannakee
248266 by: Christopher Weldon
Stuffing code into variable
248267 by: Albert Padley
248269 by: Christopher Weldon
248270 by: Albert Padley
248271 by: Paul Novitski
248272 by: Albert Padley
248273 by: Paul Novitski
Re: Matching numbers 1-100
248268 by: bit-bucket
Imprimir cierta cantidad de caracteres
248274 by: Anuack Luna
LDAP constants GSLC_SSL_...
248275 by: Petric Frank
Read file on file system
248276 by: Bagus Nugroho
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Saturday 03 February 2007 7:27 pm, Eli wrote:
> Robert Cummings wrote:
> > Looking at the code above... it would seem you want:
> >
> > include_once()
>
> It's not the idea..
>
> I'm not trying to make that code work, I want to know which exact
> include (of the same file) does what..
Huh?
> Say you got a loop of self-include:
> e.g:
> === a.php
> <?php
> echo "\nRunning ".__FILE__." (id=X)!\t";
> if ($visited<5) {
> echo "You are visiting here!";
> $visited++;
> include(__FILE__);
> }
> else {
> echo "That's enough! Bye!";
> }
> ?>
>
> In "(id=X)!".. what's the X? You may say you can use $visited as an
> identifier, but it's not the point I mean.. I want a global include file
> identifier, that is not dependent on other variables.
realpath(__FILE__) will give you the absolute path on the server of the
current file, which is unique. Why you want that for what you're doing I
have no idea, but it's the only unique identifier I can think of that isn't a
variable or constant. (Well, it is a constant, but you get the idea. I
suppose.)
The fact that you even want something like that, however, scares me.
--
Larry Garfield AIM: LOLG42
[EMAIL PROTECTED] ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
--- End Message ---
--- Begin Message ---
On Sun, 2007-02-04 at 03:27 +0200, Eli wrote:
> Robert Cummings wrote:
> > Looking at the code above... it would seem you want:
> >
> > include_once()
> It's not the idea..
>
> I'm not trying to make that code work, I want to know which exact
> include (of the same file) does what..
>
> Say you got a loop of self-include:
> e.g:
> === a.php
> <?php
> echo "\nRunning ".__FILE__." (id=X)!\t";
> if ($visited<5) {
> echo "You are visiting here!";
> $visited++;
> include(__FILE__);
> }
> else {
> echo "That's enough! Bye!";
> }
> ?>
>
> In "(id=X)!".. what's the X? You may say you can use $visited as an
> identifier, but it's not the point I mean.. I want a global include file
> identifier, that is not dependent on other variables.
Make one...
<?php
if( !isset( $GLOBALS['include_counter'][__FILE__] ) )
{
$GLOBALS['include_counter'][__FILE__] = 1;
}
else
{
$GLOBALS['include_counter'][__FILE__]++;
}
echo "\nRunning ".__FILE__." (id=X)!\t";
if( $GLOBALS['include_counter'][__FILE__] < 5 )
{
echo "You are visiting here!";
include(__FILE__);
}
else
{
echo "That's enough! Bye!";
}
?>
The actual counter stuff could be put in a function which could be in an
include file you load so that you do the following at the top:
<?php
include( 'someFunctions.php' );
register_include( __FILE__ );
?>
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
I have a php project I have been working on for several months. The
client's requirements have expanded to include interfacing to an online
service using xml, which I was familiar with but have never worked with
prior to this project. I have spent a good number of hours reading up on
xml, and learning how to use it to integrate with this online service. I
have also spent hours poring over hundreds of pages of documentation for the
online service itself.
My question is this - should I be billing the client for this time? It is
needed to properly work with this framework, but it is not programming time
in itself. Googling the topic has been useless.
Any advice?
Mike
--- End Message ---
--- Begin Message ---
On Feb 3, 2007, at 8:09 PM, Mike Mannakee wrote:
I have a php project I have been working on for several months. The
client's requirements have expanded to include interfacing to an
online
service using xml, which I was familiar with but have never worked
with
prior to this project. I have spent a good number of hours reading
up on
xml, and learning how to use it to integrate with this online
service. I
have also spent hours poring over hundreds of pages of
documentation for the
online service itself.
My question is this - should I be billing the client for this
time? It is
needed to properly work with this framework, but it is not
programming time
in itself. Googling the topic has been useless.
Any advice?
Mike
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
If the client didn't request this to begin with, and if you told them
that you'd have to research how to do it when they asked you to do
it, then absolutely! But, if you told them that you were proficient
in that area, then did the research, and choose to bill the client
for the hours you did for the research, then you may have a difficult
time justifying the extra hours put into it if you are questioned.
In general, however, some research will always be required when
dealing with outside sources/services because you have to learn how
they transmit their data, how to interpret it, etc. This is all part
of the development and "coding" for the project and should be billed
to the client appropriately.
--
Christopher Weldon
President & CEO
Cerberus Interactive, Inc.
[EMAIL PROTECTED]
(866) 813-4603 x605
--- End Message ---
--- Begin Message ---
It's late and I've been at this a long time today so I throw myself
on the mercy of the list.
I have an echo statement that I use in conjunction with a MySQL query.
echo "<tr>\n<td class=\"tabletext\">" . $row['time'] . "</td>\n<td
class=\"tabletext\">" . $row['field'] . "</td>\n<td class=\"tabletext
\">" . $row['division'] . "</td>\n";
This works perfectly fine. However, I will be using the same code
numerous times on the page and wanted to stuff it all into a
variable. At this point I can't remember the proper syntax and
quoting to get this right. Any takers?
Thanks.
Al Padley
--- End Message ---
--- Begin Message ---
On Feb 3, 2007, at 9:09 PM, Albert Padley wrote:
It's late and I've been at this a long time today so I throw myself
on the mercy of the list.
I have an echo statement that I use in conjunction with a MySQL query.
echo "<tr>\n<td class=\"tabletext\">" . $row['time'] . "</td>\n<td
class=\"tabletext\">" . $row['field'] . "</td>\n<td class=
\"tabletext\">" . $row['division'] . "</td>\n";
This works perfectly fine. However, I will be using the same code
numerous times on the page and wanted to stuff it all into a
variable. At this point I can't remember the proper syntax and
quoting to get this right. Any takers?
Thanks.
Al Padley
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
You could always make it a function...ie:
function drawTableRow($sqlRow) {
return "<tr>\n<td class=\"tabletext\">". $sqlRow['time'] ."</td>
\n<td class=\"tabletext\">".$row['field']."</td>"; // Simplified for
time purposes.
}
// Execute the query
foreach ($row = mysql_fetch_array($query)) {
echo drawTableRow($row);
}
/me pours you a cold frosty one to soothe the pain of the long struggle
--
Christopher Weldon
President & CEO
Cerberus Interactive, Inc.
[EMAIL PROTECTED]
(866) 813-4603 x605
--- End Message ---
--- Begin Message ---
On Feb 3, 2007, at 9:09 PM, Christopher Weldon wrote:
On Feb 3, 2007, at 9:09 PM, Albert Padley wrote:
It's late and I've been at this a long time today so I throw
myself on the mercy of the list.
I have an echo statement that I use in conjunction with a MySQL
query.
echo "<tr>\n<td class=\"tabletext\">" . $row['time'] . "</td>\n<td
class=\"tabletext\">" . $row['field'] . "</td>\n<td class=
\"tabletext\">" . $row['division'] . "</td>\n";
This works perfectly fine. However, I will be using the same code
numerous times on the page and wanted to stuff it all into a
variable. At this point I can't remember the proper syntax and
quoting to get this right. Any takers?
Thanks.
Al Padley
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
You could always make it a function...ie:
function drawTableRow($sqlRow) {
return "<tr>\n<td class=\"tabletext\">". $sqlRow['time'] ."</td>
\n<td class=\"tabletext\">".$row['field']."</td>"; // Simplified
for time purposes.
}
// Execute the query
foreach ($row = mysql_fetch_array($query)) {
echo drawTableRow($row);
}
That's perfect. I should of thought of using a function.
Thanks.
Al
--- End Message ---
--- Begin Message ---
On Feb 3, 2007, at 9:09 PM, Albert Padley wrote:
I have an echo statement that I use in conjunction with a MySQL query.
echo "<tr>\n<td class=\"tabletext\">" . $row['time'] . "</td>\n<td
class=\"tabletext\">" . $row['field'] . "</td>\n<td class=
\"tabletext\">" . $row['division'] . "</td>\n";
This works perfectly fine. However, I will be using the same code
numerous times on the page and wanted to stuff it all into a
variable. At this point I can't remember the proper syntax and
quoting to get this right. Any takers?
At 2/3/2007 08:09 PM, Christopher Weldon wrote:
You could always make it a function...ie:
function drawTableRow($sqlRow) {
return "<tr>\n<td class=\"tabletext\">". $sqlRow['time']
."</td> \n<td class=\"tabletext\">".$row['field']."</td>"; // Simplified for
time purposes.
}
Good suggestion. I like heredoc's clean presentation:
__________________________________
function drawTableRow($sqlrow)
{
return <<<_
<tr>
<td class="tabletext">{$sqlrow['time']}</td>
<td class="tabletext">{$sqlrow['field']}</td>
<td class="tabletext">{$sqlrow['division']}</td>
</tr>
_;
}
__________________________________
By the way, if every cell in every row is class "tabletext" why have
a class at all? You could simply apply the desired styles to the td element.
Regards,
Paul
__________________________
Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com
--- End Message ---
--- Begin Message ---
On Feb 3, 2007, at 10:04 PM, Paul Novitski wrote:
On Feb 3, 2007, at 9:09 PM, Albert Padley wrote:
I have an echo statement that I use in conjunction with a MySQL
query.
echo "<tr>\n<td class=\"tabletext\">" . $row['time'] . "</td>\n<td
class=\"tabletext\">" . $row['field'] . "</td>\n<td class=
\"tabletext\">" . $row['division'] . "</td>\n";
This works perfectly fine. However, I will be using the same code
numerous times on the page and wanted to stuff it all into a
variable. At this point I can't remember the proper syntax and
quoting to get this right. Any takers?
At 2/3/2007 08:09 PM, Christopher Weldon wrote:
You could always make it a function...ie:
function drawTableRow($sqlRow) {
return "<tr>\n<td class=\"tabletext\">". $sqlRow['time'] ."</
td> \n<td class=\"tabletext\">".$row['field']."</td>"; //
Simplified for
time purposes.
}
Good suggestion. I like heredoc's clean presentation:
__________________________________
function drawTableRow($sqlrow)
{
return <<<_
<tr>
<td class="tabletext">{$sqlrow['time']}</td>
<td class="tabletext">{$sqlrow['field']}</td>
<td class="tabletext">{$sqlrow['division']}</td>
</tr>
_;
}
__________________________________
By the way, if every cell in every row is class "tabletext" why
have a class at all? You could simply apply the desired styles to
the td element.
Regards,
Paul
I'm using heredoc elsewhere on the page so that's a good idea.
As far as the CSS on the <td>, other cells in the table have
different styling.
Al
--- End Message ---
--- Begin Message ---
On Feb 3, 2007, at 10:04 PM, Paul Novitski wrote:
By the way, if every cell in every row is class "tabletext" why
have a class at all? You could simply apply the desired styles to
the td element.
At 2/3/2007 10:05 PM, Albert Padley wrote:
As far as the CSS on the <td>, other cells in the table have
different styling.
If all the cells in a row are styled the same, consider applying the
style to the row itself:
<tr class="tabletext">
<td>{$sqlrow['time']}</td>
<td>{$sqlrow['field']}</td>
<td>{$sqlrow['division']}</td>
</tr>
Paul
--- End Message ---
--- Begin Message ---
On Sat, 3 Feb 2007 12:58:19 -0500, tedd wrote:
> At 5:09 PM +0000 2/3/07, Wikus Moller wrote:
>>Hi.
>>
>>I want to know if anyone can help me with my code which matches a
>>number to a range e.g. 1-15 and echoes an image if the number is in
>>the range.
>>
>>The code would use the if statement and check if a variable for
>>example 5 matches the range like 4-10 and if it does it echoes a
>>certain image.
>>
>>Anyone know which function I should use and what regex I should use?
>>
>>Thanks
>
> Hi:
>
> Wasn't this same question just asked by Chilling Lounge Admin?
Probably a homework assignment. It's early in the semester and about
when simple problems like this would be assigned.
--- End Message ---
--- Begin Message ---
Hola foreros. Tengo esta duda
Realice un juego de registro
Lo mande a imprimir
El texto es grande. Me preguntaba que código coloco con el fin que me
muestre hasta cierta cantidad de caracteres y cuando le de clic me muestre
el resto? EJEMPLO: http://anuack.com/macromedia/ampliar_info.htm
He utilizado <?php echo
substr($row_detail2foro_respuesta['respuesta'],0,200)."..."; ?>, pero no
permite ampliar la información cuando le doy clic como muestra en el
tutorial
Gracias y espero respuesta
--- End Message ---
--- Begin Message ---
Hello,
actually i am workinh with the ldap functions of php5.
Reading the docs i found the constants
GSLC_SSL_NO_AUTH
GSLC_SSL_ONEWAY_AUTH
GSLC_SSL_TWOWAY_AUTH
They are simply documented, but i can't find any docs about them. Neither at
php.net not via google.
So - what they are for and how to use them ?
regards
Petric
--- End Message ---
--- Begin Message ---
Hi All,
If I have file on[windows] c:\test.csv.
How I can read the entire contents of this file?
I have try file_get_contents, fgetcsv and etc but didn't work.
May I'm mis-understanding about using those function.
Thanks in advance
Regards,
bn
--- End Message ---