php-general Digest 8 Mar 2006 09:57:33 -0000 Issue 4004

Topics (messages 231621 through 231648):

class constants
        231621 by: Arnaldo Gandol
        231625 by: Chris
        231627 by: Shaunak Kashyap
        231628 by: Chris
        231629 by: Jared Williams
        231631 by: Arnaldo Gandol
        231635 by: Arnaldo Gandol

Building php-pcre extension on windows
        231622 by: Manish Marathe

Re: LDAP and Single Sign On MORE THOUGHTS
        231623 by: jblanchard.pocket.com

Re: include not working properly?
        231624 by: Chris

Re: Prepared statements
        231626 by: Curt Zirzow

Incremental Date Based ID
        231630 by: Kevin Murphy
        231632 by: Al
        231633 by: Chris
        231634 by: Kevin Murphy
        231636 by: Chris
        231637 by: Shaunak Kashyap
        231638 by: Gerry Danen
        231639 by: Gerry Danen
        231640 by: Miles Thompson
        231641 by: Miles Thompson
        231643 by: Paul Novitski
        231648 by: Björn Bartels

test security of code
        231642 by: Gregory Machin
        231645 by: Barry
        231646 by: gustav.varupiraten.se

Re: Mathematical CAPTCHA
        231644 by: Louie Miranda

Environment Variable
        231647 by: steff

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 ---
how can I to iterate the class constant without knowing their names?, I've
reviewed the Class/Object Functions and Reflexion and nothing, I dont want
to use static class variables, can any one help.

--- End Message ---
--- Begin Message ---
Arnaldo Gandol wrote:
how can I to iterate the class constant without knowing their names?, I've
reviewed the Class/Object Functions and Reflexion and nothing, I dont want
to use static class variables, can any one help.


Constants aren't per class, they are per system. Whether you define them in a class or not won't change this.

You can list all constants using http://www.php.net/manual/en/function.get-defined-constants.php


If you want to look at the class variables:
http://www.php.net/manual/en/function.get-class-vars.php

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
> 
> Constants aren't per class, they are per system. Whether you define
them
> in a class or not won't change this.
> 
> You can list all constants using
> http://www.php.net/manual/en/function.get-defined-constants.php
> 
> 

Actually, PHP5 allows constants per class, aka class constants. I think
that's what the OP is referring to.

Shaunak Kashyap
 
Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036
 
Direct: 323.330.9870
Main: 323.330.9900
 
www.worldpokertour.com
 
Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.

--- End Message ---
--- Begin Message ---
Shaunak Kashyap wrote:
Constants aren't per class, they are per system. Whether you define

them

in a class or not won't change this.

You can list all constants using
http://www.php.net/manual/en/function.get-defined-constants.php




Actually, PHP5 allows constants per class, aka class constants. I think
that's what the OP is referring to.

I have been educated :) I didn't know they existed.

They don't show up in var_dump or anything like it :/

From the looks of things you can't get them - maybe put in a feature request (bugs.php.net) and see what happens for the next version.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Hi,

ReflectionClass

getConstant
getConstants
hasConstant

http://www.ren.dotgeek.org/classbrowser/class.php?class=ReflectionClass 

Jared

> -----Original Message-----
> From: Arnaldo Gandol [mailto:[EMAIL PROTECTED] 
> Sent: 07 March 2006 21:03
> To: [email protected]
> Subject: [PHP] class constants
> 
> how can I to iterate the class constant without knowing their 
> names?, I've reviewed the Class/Object Functions and 
> Reflexion and nothing, I dont want to use static class 
> variables, can any one help.
> 

--- End Message ---
--- Begin Message ---
I've try this with no successful results. the constant rr and gg were not in
the array  $ee.

<?php
class something
{
    const rr = "lala";
    const gg = "ggerer";
}

$ee = get_defined_constants();

foreach ($ee as $key => $value)
    echo $key." => ".$value."</br>";
?>

On 3/7/06, Jared Williams <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> ReflectionClass
>
> getConstant
> getConstants
> hasConstant
>
> http://www.ren.dotgeek.org/classbrowser/class.php?class=ReflectionClass
>
> Jared
>
> > -----Original Message-----
> > From: Arnaldo Gandol [mailto:[EMAIL PROTECTED]
> > Sent: 07 March 2006 21:03
> > To: [email protected]
> > Subject: [PHP] class constants
> >
> > how can I to iterate the class constant without knowing their
> > names?, I've reviewed the Class/Object Functions and
> > Reflexion and nothing, I dont want to use static class
> > variables, can any one help.
> >
>
>

--- End Message ---
--- Begin Message ---
<?php
class something
{
    const rr = "lala";
    const gg = "ggerer";
}
$hh = new ReflectionClass('something');
print_r($hh->getConstants());
?>

Thank you, I've try this above and works, I hadn't seen the message below.
Excuse my english.



On 3/7/06, Jared Williams < [EMAIL PROTECTED]> wrote:
> >
> >
> > Hi,
> >
> > ReflectionClass
> >
> > getConstant
> > getConstants
> > hasConstant
> >
> > http://www.ren.dotgeek.org/classbrowser/class.php?class=ReflectionClass
> >
> > Jared
> >
>

--- End Message ---
--- Begin Message ---
PHP experts everywhere!!

I am building PHP 5.1.2 on windows without pcre-regex extension. I am
building building pcre independently and then I am building the extension
php_pcre.dll.

I build few other extensions too. I keep the extensions in c:\php\extensions
which is set in php.ini.

I am getting an error that php_pcre.dll extension is invalid or corrupt
whenever php call is being invoked.

I believe I am not building php_pcre.dll extension properly, although any
insights as to what could be the problem. Also is OK to build php
--without-pcre-regex extension at all?

Thanks

--
Manish Marathe
SpikeSource, Inc.
http://developer.spikesource.com

--- End Message ---
--- Begin Message ---
[snip]
As far as I can tell you will have to ask the user to login at the web
application level again, but you can verify it against your AD via LDAP
with the basic stuff from http://www.php.net/ldap
[/snip]

We are sitting here having a discussion on login techniques and I cam up
with a thought...why not have a login script write a cookie that then
coulod be read by PHP and compared against the AD via LDAP? Does anyone
see any gotcha's with that kind of process?

--- End Message ---
--- Begin Message ---
robert mena wrote:
Hi,

I am facing a strange problem.  One of my classes uses a include("Log.php")
to enable to to use the Log class that comes with pear.

*Fatal error*: require_once()
[function.require<http://www.manaushoteis.tur.br/function.require>]:
Failed opening required 'Log.php'
(include_path='.:/usr/local/lib/php/:/home/httpd/html/php/:/home/httpd/html/include/php/')
in */var/www/html/domain/php/Conexion.inc* on line *14*
**
*I do have the Log.php*
**
*ls -lsa /usr/local/lib/php/Log.php
20 -rw-r--r--  1 root root 18563 Mai 25  2005 /usr/local/lib/php/Log.php*

The only difference I can see is that I don't have the / on the end of my include paths:

include_path = ".:/usr/share/pear:/usr/local/php/lib/php"

Try removing the / from the end of each folder and see what happens ?

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
On Mon, Mar 06, 2006 at 10:03:10PM +0100, Julius Hacker wrote:
> Curt Zirzow wrote:
> >
> > I assume your loop is something like:
> >   while(condition) {
> >     $auction_parts['id'] = 'some value';
> >     $auction_parts['name'] = 'some value';
> >     ...
> >     $insert->execute();
> >   }
> >   
> Yes, thats it.
> 
> > My first guess would be, if not aleady done, initialize
> > $auction_parts before you do your bind_param() with something like:
> >
> >   $auction_parts = array('id' => null, 'name' => null, ...);
> >   $insert->bind_param("issdsis", $auction_house["id"], ...);
> >   
> Unfortunately it helps nothing :-(

Ok, i didn't really think it would but might have shown a obvious
bug with mysqli. 

According to your original post it was odd that the update prepared
statment didn't complain about a NULL value, but the insert did,
and it does seem to be related to bind_param and prepare.

What are your versions of:
  php?
  mysql_client php is built with?
  mysql server you are connecting to?

> But I think also that it's something because of the declaration and
> initalization of the variables because it works if I have the bind_param
> in the loop after I gave the variables their values.
> But to have the bind_param in the loop isn't the best solution I think.

agreed.

Curt.
-- 
cat .signature: No such file or directory

--- End Message ---
--- Begin Message --- I'm trying to set up an ID field that works like this for news articles that are posted to a website.

2006-03-05a
2006-03-05b

I know how to generate the date, and I am pretty sure I can generate the letter code based on counting the number of rows and then assigning the next letter (we will never have more than 26 in a day... usually its closer to 1 or 2 per day).

The problem is if there has been something deleted.

2006-03-05a
2006-03-05c

If I then Count the rows with this date I get an answer of 2, and so the next letter should be "c" but there already is a "c" because "b" got deleted.

So, is there any way of generating this style ID number automatically?

--
Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326

--- End Message ---
--- Begin Message ---
Kevin Murphy wrote:
I'm trying to set up an ID field that works like this for news articles that are posted to a website.

2006-03-05a
2006-03-05b

I know how to generate the date, and I am pretty sure I can generate the letter code based on counting the number of rows and then assigning the next letter (we will never have more than 26 in a day... usually its closer to 1 or 2 per day).

The problem is if there has been something deleted.

2006-03-05a
2006-03-05c

If I then Count the rows with this date I get an answer of 2, and so the next letter should be "c" but there already is a "c" because "b" got deleted.

So, is there any way of generating this style ID number automatically?

--Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326


Why not simply use the Unix time stamp. time() If more than one can arrive 
within the same second, append a letter.

If users need to see the key, use date() to decode it for them

--- End Message ---
--- Begin Message ---
Kevin Murphy wrote:
I'm trying to set up an ID field that works like this for news articles that are posted to a website.

2006-03-05a
2006-03-05b

I know how to generate the date, and I am pretty sure I can generate the letter code based on counting the number of rows and then assigning the next letter (we will never have more than 26 in a day... usually its closer to 1 or 2 per day).

The problem is if there has been something deleted.

2006-03-05a
2006-03-05c

If I then Count the rows with this date I get an answer of 2, and so the next letter should be "c" but there already is a "c" because "b" got deleted.

So, is there any way of generating this style ID number automatically?


Why do you want to do this? If you want to order your results, make it a timestamp field instead of a date field then:

select * from table order by timestamp_field desc;


If you want to count the number of posts a day, then it depends on which database you are using.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message --- Well, part of the issue is that I want to be able to use this as part of the link:

/news.php?article=2006-03-05a
/news.php?article=2006-03-05b

which i will eventually do a htacess rewrite to make it look like

/news/2006-03-05a.php
/news/2006-03-05a.php

I don't think I can do that with just the Unix timestamp.

On Mar 7, 2006, at 4:56 PM, Al wrote:

Kevin Murphy wrote:
I'm trying to set up an ID field that works like this for news articles that are posted to a website.
2006-03-05a
2006-03-05b
I know how to generate the date, and I am pretty sure I can generate the letter code based on counting the number of rows and then assigning the next letter (we will never have more than 26 in a day... usually its closer to 1 or 2 per day).
The problem is if there has been something deleted.
2006-03-05a
2006-03-05c
If I then Count the rows with this date I get an answer of 2, and so the next letter should be "c" but there already is a "c" because "b" got deleted. So, is there any way of generating this style ID number automatically?
--Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326


Why not simply use the Unix time stamp. time() If more than one can arrive within the same second, append a letter.

If users need to see the key, use date() to decode it for them

--- End Message ---
--- Begin Message ---
Kevin Murphy wrote:
Well, part of the issue is that I want to be able to use this as part of the link:

/news.php?article=2006-03-05a
/news.php?article=2006-03-05b

which i will eventually do a htacess rewrite to make it look like

/news/2006-03-05a.php
/news/2006-03-05a.php

I don't think I can do that with just the Unix timestamp.

That doesn't answer the question about why you care about gaps or why you need the number of posts per day.


On Mar 7, 2006, at 4:56 PM, Al wrote:

Kevin Murphy wrote:

I'm trying to set up an ID field that works like this for news articles that are posted to a website.
2006-03-05a
2006-03-05b
I know how to generate the date, and I am pretty sure I can generate the letter code based on counting the number of rows and then assigning the next letter (we will never have more than 26 in a day... usually its closer to 1 or 2 per day).
The problem is if there has been something deleted.
2006-03-05a
2006-03-05c
If I then Count the rows with this date I get an answer of 2, and so the next letter should be "c" but there already is a "c" because "b" got deleted.
So, is there any way of generating this style ID number  automatically?
--Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326



Why not simply use the Unix time stamp. time() If more than one can arrive within the same second, append a letter.

If users need to see the key, use date() to decode it for them




--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
A possible solution:

Make a composite primary key where the first field is the date and the
second field would be of type enumeration (A..Z, in ascending order).
Then use MAX(<second field>) WHERE <first field> = <today's date> to
figure out the next primary key.

Shaunak Kashyap
 
Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036
 
Direct: 323.330.9870
Main: 323.330.9900
 
www.worldpokertour.com
 
Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.


> -----Original Message-----
> From: Kevin Murphy [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 07, 2006 5:06 PM
> To: [email protected]
> Subject: Re: [PHP] Re: Incremental Date Based ID
> 
> Well, part of the issue is that I want to be able to use this as part
> of the link:
> 
> /news.php?article=2006-03-05a
> /news.php?article=2006-03-05b
> 
> which i will eventually do a htacess rewrite to make it look like
> 
> /news/2006-03-05a.php
> /news/2006-03-05a.php
> 
> I don't think I can do that with just the Unix timestamp.
> 
> On Mar 7, 2006, at 4:56 PM, Al wrote:
> 
> > Kevin Murphy wrote:
> >> I'm trying to set up an ID field that works like this for news
> >> articles that are posted to a website.
> >> 2006-03-05a
> >> 2006-03-05b
> >> I know how to generate the date, and I am pretty sure I can
> >> generate the letter code based on counting the number of rows and
> >> then assigning the next letter (we will never have more than 26 in
> >> a day... usually its closer to 1 or 2 per day).
> >> The problem is if there has been something deleted.
> >> 2006-03-05a
> >> 2006-03-05c
> >> If I then Count the rows with this date I get an answer of 2, and
> >> so the next letter should be "c" but there already is a "c"
> >> because "b" got deleted.
> >> So, is there any way of generating this style ID number
> >> automatically?
> >> --Kevin Murphy
> >> Webmaster - Information and Marketing Services
> >> Western Nevada Community College
> >> www.wncc.edu
> >> (775) 445-3326
> >
> >
> > Why not simply use the Unix time stamp. time() If more than one can
> > arrive within the same second, append a letter.
> >
> > If users need to see the key, use date() to decode it for them
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Kevin,

You can do it with a Unix timestamp, but that would just confuse the issue.

Have you considered using two fields instead of one? An article ID and
and article sub-ID would be retrieved as article ID = date, and all
sub-ID's descending. The first record in the list would contain the
highest sub-ID, irregardless of gaps.

Gerry
http://groups.yahoo.com/group/php_and_mysql/

On 3/7/06, Kevin Murphy <[EMAIL PROTECTED]> wrote:
> Well, part of the issue is that I want to be able to use this as part
> of the link:
>
> /news.php?article=2006-03-05a
> /news.php?article=2006-03-05b
>
> which i will eventually do a htacess rewrite to make it look like
>
> /news/2006-03-05a.php
> /news/2006-03-05a.php
>
> I don't think I can do that with just the Unix timestamp.
>
> On Mar 7, 2006, at 4:56 PM, Al wrote:
>
> > Kevin Murphy wrote:
> >> I'm trying to set up an ID field that works like this for news
> >> articles that are posted to a website.
> >> 2006-03-05a
> >> 2006-03-05b
> >> I know how to generate the date, and I am pretty sure I can
> >> generate the letter code based on counting the number of rows and
> >> then assigning the next letter (we will never have more than 26 in
> >> a day... usually its closer to 1 or 2 per day).
> >> The problem is if there has been something deleted.
> >> 2006-03-05a
> >> 2006-03-05c
> >> If I then Count the rows with this date I get an answer of 2, and
> >> so the next letter should be "c" but there already is a "c"
> >> because "b" got deleted.
> >> So, is there any way of generating this style ID number
> >> automatically?
> >> --Kevin Murphy
> >> Webmaster - Information and Marketing Services
> >> Western Nevada Community College
> >> www.wncc.edu
> >> (775) 445-3326
> >
> >
> > Why not simply use the Unix time stamp. time() If more than one can
> > arrive within the same second, append a letter.
> >
> > If users need to see the key, use date() to decode it for them
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Gerry
http://portal.danen.org/

--- End Message ---
--- Begin Message ---
Should have read the whole thread first, I guess... :)

Gerry
http://groups.yahoo.com/group/php_and_mysql/

On 3/7/06, Shaunak Kashyap <[EMAIL PROTECTED]> wrote:
> A possible solution:
>
> Make a composite primary key where the first field is the date and the
> second field would be of type enumeration (A..Z, in ascending order).
> Then use MAX(<second field>) WHERE <first field> = <today's date> to
> figure out the next primary key.
>
> Shaunak Kashyap

--- End Message ---
--- Begin Message ---
At 08:46 PM 3/7/2006, Kevin Murphy wrote:

I'm trying to set up an ID field that works like this for news
articles that are posted to a website.

2006-03-05a
2006-03-05b

I know how to generate the date, and I am pretty sure I can generate
the letter code based on counting the number of rows and then
assigning the next letter (we will never have more than 26 in a
day... usually its closer to 1 or 2 per day).

The problem is if there has been something deleted.

2006-03-05a
2006-03-05c

If I then Count the rows with this date I get an answer of 2, and so
the next letter should be "c" but there already is a "c" because "b"
got deleted.

So, is there any way of generating this style ID number automatically?

--
Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326


Why make it so HARD??????
Having gone that far, just timestamp your id. Not a timestamp in the sense of it being triggered whenever a record was changed, but the time it was created.

Better yet - use your publish date and assign a sequence number to the article. Doesn't matter what the number is, but you can then use it to roughly - or accurately - sequence articles for publication. If articles have same sequence number they'll appear in whatever order they were added to the database.

For a count of the articles, just count(pub_date).

And yes, if you insist, you can generate the number automatically. Just establish a table for id values. It has two fields, table_name and id_value. Write a function to grab the current id_value, then increment and store it. Note grab first, then increment and store. I still think this is much more work than you need.

Regards - Miles Thompson

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.0/275 - Release Date: 3/6/2006

--- End Message ---
--- Begin Message ---
At 09:05 PM 3/7/2006, Kevin Murphy wrote:

Well, part of the issue is that I want to be able to use this as part
of the link:

/news.php?article=2006-03-05a
/news.php?article=2006-03-05b

which i will eventually do a htacess rewrite to make it look like

/news/2006-03-05a.php
/news/2006-03-05a.php

I don't think I can do that with just the Unix timestamp.
<snip>

Why not - treat the number as a string and assign that to the file.
I was under the impression you were storing the articles in a database.

Alternately, create a directory for each year, one for each month within the year, one for each day within the month, then sequence alphabetically within the day. Does this resemble the structure of the MS knowledgebase? Yep!

The first year Allnovascotia.com was published we did something like that, although the articles just had regular titles.

In any event - have fun.

Cheers - Miles

PS Convention in this group is to bottom post. /mt

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.0/275 - Release Date: 3/6/2006

--- End Message ---
--- Begin Message ---
At 05:05 PM 3/7/2006, Kevin Murphy wrote:
Well, part of the issue is that I want to be able to use this as part
of the link:

/news.php?article=2006-03-05a
/news.php?article=2006-03-05b


With respect, I too think you should re-examine your reasons for wanting to number (or letter) the links consecutively in the database.

To whom does the spelling of an URL really matter? I believe that website visitors rarely care; they care about how things are labelled in the foreground and they want to get to the correct page, but I don't think many people really study the details of the address bar and even fewer make judgements about the quality or completeness of website content on that basis.

There are in fact solid reasons for NOT changing URLs once they're established -- for example, the persistence of bookmarks, links from other websites, and search engine memory. Once you establish an URL pointing to a particular page it's going to be recorded, stored, and repeated by many other entities on the internet. If you're whimsically changing URLs at random intervals, old URLs will no longer point to the same content. You'll be doing your own material a disservice by frustrating one of the most powerful assets the internet can lend you: its persistence of vision.

I wonder if your desire for contiguously lettered URLs can be satisfied by simply assigning consecutive letters to the display text that links to the articles:

HTML:
        <ol>
           <li><a href="/news.php?article=9568367">Title of article</a></li>
           <li><a href="/news.php?article=1937452">Title of article</a></li>
           <li><a href="/news.php?article=4694832">Title of article</a></li>

CSS:
        ol
        {
           list-style-type: lower-alpha;
        }

RESULT:
        a. Title of article
        b. Title of article
        c. Title of article

As others have pointed out, the sequence in which the URLs spill out from the database can be controlled by a timestamp in each record. The lettering of the articles a-z can be controlled by the ordered list for the benefit of the visitor. When an article is inserted into or deleted from the list, the list retains its contiguity IN THE PRESENTATION and you aren't put in the inelegant position of trying to renumber records in a database.

Regards,
Paul
--- End Message ---
--- Begin Message ---

hello there,

i had to deal with such an issue for labeling job-tickets -–
(yymmdd.nn)

so maybe try this...

<code>

// today‘s date : "yymmdd"
$use_akt_Datum = date("ymd");

// how many jobs (artikels) are there today ?
$HeutigeAuftraegeSQL = "SELECT * FROM auftrag WHERE Auftragsnummer LIKE
'".$use_akt_Datum."%' ORDER BY Auftragsnummer ASC;";
$mySQL_Link->query($HeutigeAuftraegeSQL);
for ($ai = 0; $ai < $mySQL_Link->rows; $ai++) {
   $ANs[$ai] = $mySQL_Link->fetch($ai);
}
$at = explode(".", $ANs[$ai-1]["Auftragsnummer"],2); // this gets the
last sub-id
$aktuellerAuftrag = $at[1] + 1;  // incr last sub-id

// build new job(article)-id
$aktuelleAuftragsNR = $use_akt_Datum.".".sprintf("%02d",
$aktuellerAuftrag);

// check if this new id might allready exists...
......
....
..
</code>

hope that helps...
bb

>At 05:05 PM 3/7/2006, Kevin Murphy wrote:
>>Well, part of the issue is that I want to be able to use this as part
>>of the link:
>>
>>/news.php?article=2006-03-05a
>>/news.php?article=2006-03-05b
>
>
>With respect, I too think you should re-examine your reasons for
>wanting to number (or letter) the links consecutively in the database.
>
>To whom does the spelling of an URL really matter? I believe that
>website visitors rarely care; they care about how things are labelled
>in the foreground and they want to get to the correct page, but I
>don't think many people really study the details of the address bar
>and even fewer make judgements about the quality or completeness of
>website content on that basis.
>
>There are in fact solid reasons for NOT changing URLs once they're
>established -- for example, the persistence of bookmarks, links from
>other websites, and search engine memory. Once you establish an URL
>pointing to a particular page it's going to be recorded, stored, and
>repeated by many other entities on the internet. If you're
>whimsically changing URLs at random intervals, old URLs will no
>longer point to the same content. You'll be doing your own material
>a disservice by frustrating one of the most powerful assets the
>internet can lend you: its persistence of vision.
>
>I wonder if your desire for contiguously lettered URLs can be
>satisfied by simply assigning consecutive letters to the display text
>that links to the articles:
>
>HTML:
><ol>
><li><a href="/news.php?article=9568367">Title of article</a></li>
><li><a href="/news.php?article=1937452">Title of article</a></li>
><li><a href="/news.php?article=4694832">Title of article</a></li>
>
>CSS:
>ol
>{
>list-style-type: lower-alpha;
>}
>
>RESULT:
>a. Title of article
>b. Title of article
>c. Title of article
>
>As others have pointed out, the sequence in which the URLs spill out
>from the database can be controlled by a timestamp in each
>record. The lettering of the articles a-z can be controlled by the
>ordered list for the benefit of the visitor. When an article is
>inserted into or deleted from the list, the list retains its
>contiguity IN THE PRESENTATION and you aren't put in the inelegant
>position of trying to renumber records in a database.
>
>Regards,
>Paul
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Björn Bartels
-Development/IT-Services-

----------------------------------------------
dbusiness.de gmbh
digital business & printing gmbh

Greifswalder Str. 152
D-10409 Berlin

Fon: [0.30] 4.21.19.95
Fax: [0.30] 4.21.19.74

www.dbusiness.de
[EMAIL PROTECTED]
ftp://dbusiness.dyndns.org


Björn Bartels
-Development/IT-Services-

----------------------------------------------
dbusiness.de gmbh
digital business & printing gmbh

Greifswalder Str. 152
D-10409 Berlin

Fon: [0.30] 4.21.19.95
Fax: [0.30] 4.21.19.74

www.dbusiness.de
[EMAIL PROTECTED]
ftp://dbusiness.dyndns.org

--- End Message ---
--- Begin Message ---
Hi
Is there an application that can pass source code and report potential
security problem and or the live site ?
Many thanks
--
Gregory Machin
[EMAIL PROTECTED]
[EMAIL PROTECTED]
www.linuxpro.co.za
www.exponent.co.za
Web Hosting Solutions
Scalable Linux Solutions
www.iberry.info (support and admin)

+27 72 524 8096

--- End Message ---
--- Begin Message ---
Gregory Machin wrote:
Hi
Is there an application that can pass source code and report potential
security problem and or the live site ?
Many thanks
--
Gregory Machin
[EMAIL PROTECTED]
[EMAIL PROTECTED]
www.linuxpro.co.za
www.exponent.co.za
Web Hosting Solutions
Scalable Linux Solutions
www.iberry.info (support and admin)

+27 72 524 8096
Nothing that would find every security hole.
Because every developed site is different, has different variables, uses probably flash/cgi/javascript and a MySQL/PostgreSQL/MSAccess Database and so on.

There will be never such a program that can do your specific security test, or it would just cost thousands of dollars and would have to keep better up to date than the developer of your applications.

Best thing is always to test it yourself!

Write down what function you have and what it does, then think about how somone could breach in.

I know there are some people offering such a service.

Probably it's that what you search for ;)

Greets
        Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

--- End Message ---
--- Begin Message ---
> Gregory Machin wrote:
>> Hi
>> Is there an application that can pass source code and report potential
>> security problem and or the live site ?
>> Many thanks
>> --
>> Gregory Machin
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> www.linuxpro.co.za
>> www.exponent.co.za
>> Web Hosting Solutions
>> Scalable Linux Solutions
>> www.iberry.info (support and admin)
>>
>> +27 72 524 8096
> Nothing that would find every security hole.
> Because every developed site is different, has different variables, uses
> probably flash/cgi/javascript and a MySQL/PostgreSQL/MSAccess Database
> and so on.
>
> There will be never such a program that can do your specific security
> test, or it would just cost thousands of dollars and would have to keep
> better up to date than the developer of your applications.
>
> Best thing is always to test it yourself!
>
> Write down what function you have and what it does, then think about how
> somone could breach in.
>
> I know there are some people offering such a service.
>
> Probably it's that what you search for ;)
>
> Greets
>       Barry
> --
> Smileys rule (cX.x)C --o(^_^o)
> Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Or why not post to the list directly... and ask if WE see anything :-)

Best regards
/Gustav Wiberg

--- End Message ---
--- Begin Message ---
What i meant was.

A CAPTCHA for:
example..

one plus 10 = 11
The answer will be the CAPTCHA string


On 3/7/06, Kim Hunter <[EMAIL PROTECTED]> wrote:
>
> a quick google of CAPTCHA php  shows quite a few
>
> On 3/7/06, Louie Miranda <[EMAIL PROTECTED]> wrote:
> > Is there a pear package or class for PHP?
> >
> > --
> > Louie Miranda ([EMAIL PROTECTED])
> > http://www.axishift.com
> >
> > //JSM-W
> >
>



--
Louie Miranda ([EMAIL PROTECTED])
http://www.axishift.com

//JSM-W

--- End Message ---
--- Begin Message ---
Hello,

I want to define my own environemnt variable "APPLICATION_ROOT" and be able to retrieve his value from php. As apache module, cgi, cron and command line.

Now i'm just be able to get it from command line. In other (module,cgi,cron) when I print $_ENV I never get the same environment :(

Is it possible to do it with PHP ???

Thanks.
Steff

--- End Message ---

Reply via email to