Re: [PHP] Command line socket server and SSL

2007-09-04 Thread Greg Donald
On Tue, 4 Sep 2007, Paul wrote:
> > Which part do you need help with? The SSL part or the command line or the
> > port or ... ?
> >
> > http://www.php.net/openssl
> > http://www.php.net/sockets
> >
> I am familiar with the above links. What I cannot locate is anything that
> indicates that a cmd line socket program in PHP can do SSL. Can you locate
> such? Is it in the openssl document somewhere and I missed it?

Whether the script is command line or not has nothing to do with it's ability 
to connect to a host on a specific port.  You just connect to the port the 
secure socket is located on, usually 443.

#!/usr/bin/env php
http://cyberfusionconsulting.com/

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



Re: [PHP] urldecode & header

2007-09-04 Thread Greg Donald
On Tue, 4 Sep 2007, alexus wrote:
> i have a form that user suppose to fill out that then get submitted to
> index.php (current setup)
>
> now what i need is another let's say index2.php that would take
> everything from that form, rewrite one of the field and spits it back
> to index.php
>
> now, i dont know but as far as i know stuff that form spits out is
> urlencoded, so i need to use urldecode function (
> http://us.php.net/urldecode ) to decode and then header function (
> http://us2.php.net/header ) to spit it back to index.php

urlencode() and urldecode() are handy for passing text in urls.

In index.php you would have something like:

$msg = urlencode( 'whatever message you want to send' );

header( "Location: http://example.com/index2.php?msg=$msg"; );
exit;

Then on the index2.php

$msg = isset( $_REQUEST[ 'msg' ] ) ? urldecode( $_REQUEST[ 'msg' ] ) : '';

At this point you can mangle $msg however you like and send it somewhere
else with another header() call.



-- 
Greg Donald
Cyberfusion Consulting
http://cyberfusionconsulting.com/

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



Re: [PHP] Command line socket server and SSL

2007-09-04 Thread Paul

Chris wrote:

Paul wrote:
I need to program a socket server in PHP that can use a certificate 
and communicate over SSL. I'm doing fine without SSL. Can't use port 
443 or the web server for this, so it needs to be a command line app. 
Can't seem to find any documentation about how to set that up. Can 
anyone help or point me in the right direction?


Which part do you need help with? The SSL part or the command line or 
the port or ... ?


http://www.php.net/openssl
http://www.php.net/sockets

I am familiar with the above links. What I cannot locate is 
anything that indicates that a cmd line socket program in 
PHP can do SSL. Can you locate such? Is it in the openssl 
document somewhere and I missed it?


Paul W

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



Re: [PHP] Command line socket server and SSL

2007-09-04 Thread Chris

Paul wrote:
I need to program a socket server in PHP that can use a certificate and 
communicate over SSL. I'm doing fine without SSL. Can't use port 443 or 
the web server for this, so it needs to be a command line app. Can't 
seem to find any documentation about how to set that up. Can anyone help 
or point me in the right direction?


Which part do you need help with? The SSL part or the command line or 
the port or ... ?


http://www.php.net/openssl
http://www.php.net/sockets

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

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



Re: [PHP] Pragmatically changing a "Record Number"

2007-09-04 Thread brian

tedd wrote:

At 12:11 PM -0400 9/4/07, brian wrote:


You are confusing a product ID with this index number. They are
very much not the same thing. A product ID (PLU, serial #,
whatever) should not change. This index does change, any time a row
is removed from the database. How can you suggest that this index
can be "associated with their widget" if the value can change at
any time? There's no one-to-one relationship between the widget and
this index. At least, not over the life of the widget's record in
the database.


No, the problem is not that I am confusing widget numbers, but rather
 your definition of what  widget numbers should be doesn't meet the
needs of the client. You have one note in your songbook.


I have not once "defined" what a widget number, product code, whatever
should be. You're imagining things now. There LARGE_NUMBER of formats
that a "widget number" can have. I couldn't care less how you (or your
client) chooses to do so.


The problem here is that you're being argumentative instead of trying
to understand that not everyone is limited to your perspective. I've
 understood everything that you've said, and agree with most of it,
but you fail to acknowledge a single statement I've made. This is
very similar to how we started this thread in the first place when
you completely misread something I wrote and then turned it all
around to your liking. Apparently, you are doing it again.


Why are you getting all pissy now? I certainly haven't been. Have i not
been including enough smileys or something?

The client I have, who wants his record numbers to work the way I 
described, is a photographer. When he works with his db of pictures

he wants to see record numbers as he steps through his listing. If he
see's something he wants to edit in his database, then he wants write
down that record number so that he can go back and find it again
during that specific editing session. Likewise, if he wants to remove
a picture from his from his database, then it he wants it to be gone
now.


Well, if your client needs to print out something that relates back to 
the record, print out the primary key. Print out the PLU.. Print out the 
[insert UNIQUE_VALUE here].


Better yet: design the app so your client doesn't have to get out a 
pencil. But i digress ...



He understands, and doesn't care, that the next time he travels
through his database that the numbers above his last deletion have
changed. In fact, I don't even have to keep the numbers in a field in
his database


So why all the fuss about having to keep this problem-child "index"
field in the table, then? If it doesn't have to be in there then why are 
you insisting on including it?



-- instead I could easily use the creation data-stamp for a sort and
 present his pictures to him that way. But, he wants that field
number there, so that he can continue his editing later, if he
decides to quit -- he wants his current editing session to remain
"as-is" until he changes it -- so the field is there for him.

The point is -- this is an example of a reference number that the
client wants and uses successfully. Who am I to argue with him. In
fact, who is anyone to argue with something that works for him? You?
You want to impose your view of how he should work? Keep in mind,
this is the client and they say, and pay for, what they want.


Not one thing that you've described here comes anywhere close to making 
a case for designing a database schema in such a manner. All of the 
above can be accomplished without having to re-order your table each 
time a record is removed.



I think you'll find in life that not all aspects of dealing with
clients fall nicely into the way you think things should be done.
It's probably best for you to get used to it now than later.


You're being pissy again. It really reflects poorly on you and, i 
suspect, it's keeping you from truly understanding what it is that i'm 
trying to help you with.



Enough said on this subject, besides I don't think you're reading
what I write correctly anyway.


I read it twice ("correctly", even!). Mostly because your stubborness 
fascinates me. Like a moth to a flame, really.


brian :-)

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



Re: [PHP] MySQL, PHPMyAdmin, GRANT, headaches

2007-09-04 Thread tedd

At 3:00 PM -0400 9/4/07, brian wrote:
I'm setting up a site and am having loads of problems with MySQL 
(which i don't use much, being a Postgres fan). The server is not 
controlled by myself and I'm waiting on a reply from the admin. In 
the meantime:


PHP 4.3.9
Mysql 4.1.10a (server) 3.23.49 (client)

The database has been set up along with PHPMyAdmin (i also rarely 
use this). I have been provided with a user & pass for PHPMyAdmin, 
as well as a user & pass for the DB. Using the former, i have 
created the tables and copied in my data. Within that interface, i 
can make any query i'd like.


However, from within a PHP script (and using the second user & 
pass), i seem to be SOL. Even the most basic queries return empty 
results. Debugging has been a royal pain because interfaces such as 
MDB2, DB, etc. are also not available. That means relying on 
mysql_error() which is frustrating.


After much dicking around, i've come to the conclusion that the 
problem must be that the user does not have permission to select 
from the DB. A comment on the mysql_error() manual page [1] says 
that, in the case of "Access denied ..." mysql_error() returns the 
empty string.


I feel like i've taken crazy pills! Please, someone tell me this 
isn't true! How does one debug a problem like this? How can i know 
if i have SELECT rights to the table?


[1] http://ca3.php.net/manual/en/function.mysql-error.php#44168

brian



Show us your code.

tedd
--
---
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] Dealing with auto-increment in MySQL

2007-09-04 Thread tedd

At 8:12 PM -0400 9/4/07, brian wrote:

tedd wrote:

Jason:

Well, at least you read and comprehended what was said -- that's 
better than some.


Cheers,

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



Nice. Good luck with your database endeavours!

brian


Never had any problems before.

And, good luck with clients.

Cheers,

tedd
--
---
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] Pragmatically changing a "Record Number"

2007-09-04 Thread tedd

At 12:11 PM -0400 9/4/07, brian wrote:

tedd wrote:

At 6:18 PM -0400 9/3/07, brian wrote:

It may be just fine in your case, but from a DB design standpoint 
it most certainly is not efficient. Why re-order the entire table 
for something like this? Altering an entire table because one row 
has been deleted suggests to me that the schema needs to revisited.


...

However, we (or at least I) often work with clients who don't see 
that. Instead they see records that they place into their database 
that hold information about their widgets and they like to see a 
record number associated with their widget. And, when they add a 
new widget record, they want to see that count increased and when 
they delete a widget record they want to see it gone and a gap, 
where they can renumber at their will.


You are confusing a product ID with this index number. They are very 
much not the same thing. A product ID (PLU, serial #, whatever) 
should not change. This index does change, any time a row is removed 
from the database. How can you suggest that this index can be 
"associated with their widget" if the value can change at any time? 
There's no one-to-one relationship between the widget and this 
index. At least, not over the life of the widget's record in the 
database.



No, the problem is not that I am confusing widget numbers, but rather 
your definition of what  widget numbers should be doesn't meet the 
needs of the client. You have one note in your songbook.


The problem here is that you're being argumentative instead of trying 
to understand that not everyone is limited to your perspective. I've 
understood everything that you've said, and agree with most of it, 
but you fail to acknowledge a single statement I've made. This is 
very similar to how we started this thread in the first place when 
you completely misread something I wrote and then turned it all 
around to your liking. Apparently, you are doing it again.


The client I have, who wants his record numbers to work the way I 
described, is a photographer. When he works with his db of pictures 
he wants to see record numbers as he steps through his listing. If he 
see's something he wants to edit in his database, then he wants write 
down that record number so that he can go back and find it again 
during that specific editing session. Likewise, if he wants to remove 
a picture from his from his database, then it he wants it to be gone 
now.


He understands, and doesn't care, that the next time he travels 
through his database that the numbers above his last deletion have 
changed. In fact, I don't even have to keep the numbers in a field in 
his database -- instead I could easily use the creation data-stamp 
for a sort and present his pictures to him that way. But, he wants 
that field number there, so that he can continue his editing later, 
if he decides to quit -- he wants his current editing session to 
remain "as-is" until he changes it -- so the field is there for him.


The point is -- this is an example of a reference number that the 
client wants and uses successfully. Who am I to argue with him. In 
fact, who is anyone to argue with something that works for him? You? 
You want to impose your view of how he should work? Keep in mind, 
this is the client and they say, and pay for, what they want.


I think you'll find in life that not all aspects of dealing with 
clients fall nicely into the way you think things should be done. 
It's probably best for you to get used to it now than later.


Enough said on this subject, besides I don't think you're reading 
what I write correctly anyway.


Cheers,

tedd

--
---
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] Dealing with auto-increment in MySQL

2007-09-04 Thread brian

tedd wrote:

Jason:

Well, at least you read and comprehended what was said -- that's better 
than some.


Cheers,

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



Nice. Good luck with your database endeavours!

brian

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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-04 Thread tedd

At 4:05 PM -0400 9/4/07, Robert Cummings wrote:

On Tue, 2007-09-04 at 14:28 -0400, Greg Gay wrote:
 > Rob/mlists


So, you can get that much?  :-)

I knew my MSc would pay off some day.

Cheers,

tedd

--
---
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] Dealing with auto-increment in MySQL

2007-09-04 Thread tedd

At 12:08 PM -0400 9/4/07, Jason Pruim wrote:

On Sep 4, 2007, at 7:15 AM, Satyam wrote:

I was wondering if people is asking this in the 
belief that the autoincrement field is the 
record position in the database table and that 
by not reusing those positions, the space of 
the deleted records is wasted. Perhaps when 
they say renumbering what they are meaning is 
compacting the database reusing the empty slots 
they assume those autoincrement fields point 
to.  Someone remembers dBaseIII .dbf files? 
Well, perhaps that is the picture they have in 
mind.


As the person who started the other thread about 
this, my big thing was having a continuous 
record number that I could display to the 
customer much the way excel displays record 
numbers.


But after discussing it, I see where my thinking 
was wrong in how I wanted to achieve it, and 
also my misunderstanding of the way databases 
worked. I'm pretty new working with databases, 
and PHP. HTML and CSS I've done for awhile, just 
never needed a database or programming language 
until recently :)


so to put my 2¢ in on this, I would say to leave 
alone the auto increment field especially if 
it's included in an index. If you need a record 
number, either store it in the database in a 
separate field as tedd suggested, and leave the 
main auto increment field alone. OR use PHP (Or 
your favorite programming language) to add a 
"Record number" to the display.


Okay I'm done now :)


Jason:

Well, at least you read and comprehended what was 
said -- that's better than some.


Cheers,

tedd
--
---
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] PHP Debugger

2007-09-04 Thread Nathan Nobbe
ive been working with xdebug lately.
you wont find me paying for zend studio;
im on the open source tip :)

i must admit though, the experience has been anything but painless.
however, if you work w/ legacy spaghetti code, or youre just sick
of writing echo statements on the server,
xdebug is definitely worth trying.

so far ive worked w/ protoeditor and eclipse pdt.  they both have pros / and
cons
but im already used to the eclipse environment, so ill probly settle on pdt.

-nathan
On 9/4/07, Eric Gorr <[EMAIL PROTECTED]> wrote:
>
> I would suggest taking a look at Zend Studio.
>
>
> http://www.zend.com/products/zend_studio
>
>
> On Sep 4, 2007, at 5:28 PM, shiplu wrote:
>
> > Hello,
> >  i need a good php debugger. It should provide the facility of step
> > by step
> > execution in real time.
> > Is there any?
> > Do any of you know about this?
> > I am having a bug. I can't trace where it is.
> >
> > --
> > shout at http://shiplu.awardspace.com/
> >
> > Available for Hire/Contract/Full Time
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] PHP Debugger

2007-09-04 Thread Eric Gorr

I would suggest taking a look at Zend Studio.


http://www.zend.com/products/zend_studio


On Sep 4, 2007, at 5:28 PM, shiplu wrote:


Hello,
 i need a good php debugger. It should provide the facility of step  
by step

execution in real time.
Is there any?
Do any of you know about this?
I am having a bug. I can't trace where it is.

--
shout at http://shiplu.awardspace.com/

Available for Hire/Contract/Full Time


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



[PHP] PHP Debugger

2007-09-04 Thread shiplu
Hello,
 i need a good php debugger. It should provide the facility of step by step
execution in real time.
Is there any?
Do any of you know about this?
I am having a bug. I can't trace where it is.

-- 
shout at http://shiplu.awardspace.com/

Available for Hire/Contract/Full Time


Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-04 Thread Robert Cummings
On Tue, 2007-09-04 at 14:28 -0400, Greg Gay wrote:
> Rob/mlists
> 
> You're certainly not encouraging PHP programmers to get involved with
> paid open source projects. That's a guaranteed $50,000 a yr, a little
> low perhaps by industry standards, but it is a reasonable starting rate,
> and gets your foot in the door.
> 
> You should have a look at who the employer is, and what they do. They
> (we) are
> looking for a person who has done their research. This is more than
> just a job. It has the potential to introduce applicants to a world of
> experience, not just code crunching, but getting involved with the
> groups who introduce new technologies and working on leading edge
> projects (groups like the W3C, IMS, ISO, AICC, and many others) .
> Experiences you won't get as a programmer for your average software
> developer. The ATRC is involved with most standards bodies around the
> world, and has dozen of open source projects on the go.
> 
> Becoming university staff takes a couple years, after which salaries are
> competivitive with the going rates. Not to mention a full set of
> benefits, pension, excellent working environment, including flexible
> working hours, travel benefits, free university course (get a masters or
> phd for nothing) etc. Most staff start on a casual/contract basis before
> being moved into the main stream. Our established programmers do earn in
> the 90-100G per year, with benefits on top of that. All included, that's
> somewhere in the $60/hr range, with $0 expenses.
> 
> You're auto machanic btw, has overhead included in that rate, so that's
> a rather poor comparison. How much do you think he really makes an hour,
> after paying expenses out of that $99? And of course 4% isn't a bonus.
> Contract workers are paid that weekly, while staff accumulate it so they
> can take holidays and get paid.

See, now that's a much better job post. Although it's still $25/hr after
5 years of experience on a contract basis with no guarantee of future
contracts with good performance. As a contractor one generally charges
more to cover the dry times, self-development, dental, prescriptions,
retirement, etc, etc. It's not about being greedy, well not for me
anyways, it's about covering one's ass in the present and in the future.
Have you ever seen the way it usually works in government and any other
large businesses... contractors earn more per hour than the regular
employees, that's because they need to. Contractors often can't just
jump onto any job with stars in their eyes hoping to get a hold of a
"maybe" brass ring several years down the road.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] MySQL, PHPMyAdmin, GRANT, headaches

2007-09-04 Thread brian

Janet Valade wrote:
>
> First, if you are having an access denied problem, you will get a PHP
> error message. Perhaps you have errors turned off in your PHP script.
> Turn them on until you get it working.

I forgot to mention that i've temporarily set:

ini_set('track_errors', TRUE); // to access $php_errormsg
error_reporting(E_ALL);

I've determined that i can, indeed, connect to the DB. It's selecting 
from a table that *seems* to be the problem.


> Second, you should be able to use phpMyAdmin to see what the
> permissions are for the account you are using.

I poked around for that. Apparently, phpMyAdmin has a "Privileges" page 
but i can't locate it. On the "operations" page, i find this at the bottom:


Error
The additional features for working with linked tables have been 
deactivated. To find out why click here.


When i follow the link i get:

PMA Database ... not OK[ Documentation ]
General relation features Disabled

David Giragosian wrote:

use your phpmyadmin account to get the permissions for the second
username/password login.

Show grants for [EMAIL PROTECTED];



Argh! It's always the simple things one forgets to do, isn't it?

GRANT USAGE ON *.* TO ...
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP...

So, i'm back to square one, i see.

brian

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



Re: [PHP] Dealing with auto-increment in MySQL

2007-09-04 Thread brian

Jason Pruim wrote:


On Sep 4, 2007, at 12:20 PM, brian wrote:


Jason Pruim wrote:

so to put my 2¢ in on this, I would say to leave alone the auto   
increment field especially if it's included in an index. If you  
need  a record number, either store it in the database in a  separate 
field  as tedd suggested, and leave the main auto  increment field 
alone. OR  use PHP (Or your favorite programming  language) to add a 
"Record  number" to the display.



Except that, should this seperate field be used, as soon as some  row 
in the table is deleted, *that* index column value will *also*  
suddenly have a gap and you're back to re-ordering.


idPLUindex
1foo-3241
2foo-8942<- delete this row
3foo-9293
4foo-6534



I see what you're getting at, but if PHP is controlling a "Record  
Number" you could have it loop through the results find the gaps and  
truncate the table to provide a record number. No idea how to do it,  
just that I'm sure it can be done :)


I assume you mean truncate the resultset. But there's no need to do 
that, either. One only needs to set up a counter variable when 
displaying the results.


Given the simple table above (with an extra 'name' column, the second 
row deleted, and no 'index' column):


query('SELECT id, name, PLU FROM my_table');

/* this is the counter used in place of the 'index' column
 */
$count = 0;

/* We want to display a list of product names along with the
 * PLU. We also want to have a running count. Each product
 * PLU will be a link to some other script, passing the row's id
 * (the AUTO_INCREMENT Primary Key).
 * Pretend the HTML table has already been opened.
 */
while (++$count && $row = $result->fetchRow())
{
?>
  

">
  


  


Thus, we have a set of rows, indexed without any gaps, and the primary 
key is not shown at all (unless someone looks at the URL). It doesn't 
matter what the id is, as long as it always points to the correct row.


brian

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



Re: [PHP] MySQL, PHPMyAdmin, GRANT, headaches

2007-09-04 Thread Janet Valade

brian wrote:
I'm setting up a site and am having loads of problems with MySQL (which 
i don't use much, being a Postgres fan). The server is not controlled by 
myself and I'm waiting on a reply from the admin. In the meantime:


PHP 4.3.9
Mysql 4.1.10a (server) 3.23.49 (client)

The database has been set up along with PHPMyAdmin (i also rarely use 
this). I have been provided with a user & pass for PHPMyAdmin, as well 
as a user & pass for the DB. Using the former, i have created the tables 
and copied in my data. Within that interface, i can make any query i'd 
like.


However, from within a PHP script (and using the second user & pass), i 
seem to be SOL. Even the most basic queries return empty results. 
Debugging has been a royal pain because interfaces such as MDB2, DB, 
etc. are also not available. That means relying on mysql_error() which 
is frustrating.


After much dicking around, i've come to the conclusion that the problem 
must be that the user does not have permission to select from the DB. A 
comment on the mysql_error() manual page [1] says that, in the case of 
"Access denied ..." mysql_error() returns the empty string.


I feel like i've taken crazy pills! Please, someone tell me this isn't 
true! How does one debug a problem like this? How can i know if i have 
SELECT rights to the table?


[1] http://ca3.php.net/manual/en/function.mysql-error.php#44168


First, if you are having an access denied problem, you will get a PHP 
error message. Perhaps you have errors turned off in your PHP script. 
Turn them on until you get it working.


Second, you should be able to use phpMyAdmin to see what the permissions 
are for the account you are using.


Janet






brian




--
Janet Valade -- janet.valade.com

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



Re: [PHP] Dealing with auto-increment in MySQL

2007-09-04 Thread Jason Pruim


On Sep 4, 2007, at 12:20 PM, brian wrote:


Jason Pruim wrote:


As the person who started the other thread about this ...


As one of the people responsible for dragging that thread out ...

But after discussing it, I see where my thinking was wrong in how  
I  wanted to achieve it, and also my misunderstanding of the way   
databases worked. I'm pretty new working with databases, and PHP.   
HTML and CSS I've done for awhile, just never needed a database  
or  programming language until recently :)



Which is why i think it's important to discuss this. Given that yet  
another thread has already begun on this topic, it seems worthy of  
dscussion.


so to put my 2¢ in on this, I would say to leave alone the auto   
increment field especially if it's included in an index. If you  
need  a record number, either store it in the database in a  
separate field  as tedd suggested, and leave the main auto  
increment field alone. OR  use PHP (Or your favorite programming  
language) to add a "Record  number" to the display.


Except that, should this seperate field be used, as soon as some  
row in the table is deleted, *that* index column value will *also*  
suddenly have a gap and you're back to re-ordering.


id  PLU index
1   foo-324 1
2   foo-894 2   <- delete this row
3   foo-929 3
4   foo-653 4



I see what you're getting at, but if PHP is controlling a "Record  
Number" you could have it loop through the results find the gaps and  
truncate the table to provide a record number. No idea how to do it,  
just that I'm sure it can be done :)





Okay I'm done now :)


me too, i think

brian

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




--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]

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



[PHP] MySQL, PHPMyAdmin, GRANT, headaches

2007-09-04 Thread brian
I'm setting up a site and am having loads of problems with MySQL (which 
i don't use much, being a Postgres fan). The server is not controlled by 
myself and I'm waiting on a reply from the admin. In the meantime:


PHP 4.3.9
Mysql 4.1.10a (server) 3.23.49 (client)

The database has been set up along with PHPMyAdmin (i also rarely use 
this). I have been provided with a user & pass for PHPMyAdmin, as well 
as a user & pass for the DB. Using the former, i have created the tables 
and copied in my data. Within that interface, i can make any query i'd like.


However, from within a PHP script (and using the second user & pass), i 
seem to be SOL. Even the most basic queries return empty results. 
Debugging has been a royal pain because interfaces such as MDB2, DB, 
etc. are also not available. That means relying on mysql_error() which 
is frustrating.


After much dicking around, i've come to the conclusion that the problem 
must be that the user does not have permission to select from the DB. A 
comment on the mysql_error() manual page [1] says that, in the case of 
"Access denied ..." mysql_error() returns the empty string.


I feel like i've taken crazy pills! Please, someone tell me this isn't 
true! How does one debug a problem like this? How can i know if i have 
SELECT rights to the table?


[1] http://ca3.php.net/manual/en/function.mysql-error.php#44168

brian

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



[Fwd: Re: [PHP] PHP Developer Required]

2007-09-04 Thread Greg Gay
Rob/mlists

You're certainly not encouraging PHP programmers to get involved with
paid open source projects. That's a guaranteed $50,000 a yr, a little
low perhaps by industry standards, but it is a reasonable starting rate,
and gets your foot in the door.

You should have a look at who the employer is, and what they do. They
(we) are
looking for a person who has done their research. This is more than
just a job. It has the potential to introduce applicants to a world of
experience, not just code crunching, but getting involved with the
groups who introduce new technologies and working on leading edge
projects (groups like the W3C, IMS, ISO, AICC, and many others) .
Experiences you won't get as a programmer for your average software
developer. The ATRC is involved with most standards bodies around the
world, and has dozen of open source projects on the go.

Becoming university staff takes a couple years, after which salaries are
competivitive with the going rates. Not to mention a full set of
benefits, pension, excellent working environment, including flexible
working hours, travel benefits, free university course (get a masters or
phd for nothing) etc. Most staff start on a casual/contract basis before
being moved into the main stream. Our established programmers do earn in
the 90-100G per year, with benefits on top of that. All included, that's
somewhere in the $60/hr range, with $0 expenses.

You're auto machanic btw, has overhead included in that rate, so that's
a rather poor comparison. How much do you think he really makes an hour,
after paying expenses out of that $99? And of course 4% isn't a bonus.
Contract workers are paid that weekly, while staff accumulate it so they
can take holidays and get paid.


greg




Robert Cummings wrote:
> On Mon, 2007-09-03 at 13:47 -0400, mlists wrote:
>
>>Wow!
>>
>>Spend $100K on a university degree in computer science, work
>>successfully for five years with all the major technologies, and then
>>get paid $25 per hour?
>
>
> The poster didn't mention anything about being competent.
>
>
>>My auto mechanic charges an average of $99 per hour.
>>
>>Sounds like a great deal for the university. Maybe the successful
>>candidate can work off his student loans.
>
>
> Well 100k is a bit high for a 4 year program. And then again it depends
> on whether you had to move away from your parents to attend university.
> If you live within commute range of your university then you can get
> away with 20 to 30k expenses in Canada (depending on University). If you
> have to cover rent then it's a different story :) That said, Toronto is
> one of the most expensive cities in Canada in which to live. IMHO he
> still thinks the tech sector is in a depression and developers with 5
> years experience can be had for a pittance. What made me laugh was the
> "4%" vacation pay. That's a legal requirement in Canada for full time
> employment. Not a bonus.
>
> Cheers,
> Rob.

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



Re: [PHP] Bind function parameters with create_function ('currying')

2007-09-04 Thread Richard Heyes

I have a function which is my callback for preg_replace_callback - and it
needs to be able to access a string and an object outside of itself.
When I call create_function I can insert the string, but without serializing
the object I can't figure out how to make it available to the function
without making it global, which seems nasty.

I've tried 'currying' the function - creating a new function out of it with
the string and object parameters bound, but have the same problem - I can't
get the object into the function.
Can anyone point me towards a good solution? I guess I could also create a
class with the one function, but that seems a wee bit messy to me.


It would be helpful if you could post a bare-bones example.

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



[PHP] Bind function parameters with create_function ('currying')

2007-09-04 Thread Rob Desbois
Hi all,

I have a function which is my callback for preg_replace_callback - and it
needs to be able to access a string and an object outside of itself.
When I call create_function I can insert the string, but without serializing
the object I can't figure out how to make it available to the function
without making it global, which seems nasty.

I've tried 'currying' the function - creating a new function out of it with
the string and object parameters bound, but have the same problem - I can't
get the object into the function.
Can anyone point me towards a good solution? I guess I could also create a
class with the one function, but that seems a wee bit messy to me.

Any ideas?

-- 
Rob Desbois
Eml: [EMAIL PROTECTED]


Re: [PHP] Dealing with auto-increment in MySQL

2007-09-04 Thread brian

Jason Pruim wrote:


As the person who started the other thread about this ...


As one of the people responsible for dragging that thread out ...

But after discussing it, I see where my thinking was wrong in how I  
wanted to achieve it, and also my misunderstanding of the way  databases 
worked. I'm pretty new working with databases, and PHP.  HTML and CSS 
I've done for awhile, just never needed a database or  programming 
language until recently :)



Which is why i think it's important to discuss this. Given that yet 
another thread has already begun on this topic, it seems worthy of 
dscussion.


so to put my 2¢ in on this, I would say to leave alone the auto  
increment field especially if it's included in an index. If you need  a 
record number, either store it in the database in a separate field  as 
tedd suggested, and leave the main auto increment field alone. OR  use 
PHP (Or your favorite programming language) to add a "Record  number" to 
the display.


Except that, should this seperate field be used, as soon as some row in 
the table is deleted, *that* index column value will *also* suddenly 
have a gap and you're back to re-ordering.


id  PLU index
1   foo-324 1
2   foo-894 2   <- delete this row
3   foo-929 3
4   foo-653 4


Okay I'm done now :)


me too, i think

brian

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



Re: [PHP] Pragmatically changing a "Record Number"

2007-09-04 Thread brian

tedd wrote:

At 6:18 PM -0400 9/3/07, brian wrote:

It may be just fine in your case, but from a DB design standpoint it 
most certainly is not efficient. Why re-order the entire table for 
something like this? Altering an entire table because one row has been 
deleted suggests to me that the schema needs to revisited.


...

However, we (or at least I) often work with clients who don't see that. 
Instead they see records that they place into their database that hold 
information about their widgets and they like to see a record number 
associated with their widget. And, when they add a new widget record, 
they want to see that count increased and when they delete a widget 
record they want to see it gone and a gap, where they can renumber at 
their will.


You are confusing a product ID with this index number. They are very 
much not the same thing. A product ID (PLU, serial #, whatever) should 
not change. This index does change, any time a row is removed from the 
database. How can you suggest that this index can be "associated with 
their widget" if the value can change at any time? There's no one-to-one 
relationship between the widget and this index. At least, not over the 
life of the widget's record in the database.


If your client wants a widget number, then, by all means, provide one. 
But if you're going to rely on a figure that is liable to change at the 
drop of a hat your database career will soon be over.


Again: the only relation this index contributes is destroyed just as 
soon as row is removed. So why bother? An entire table should not need 
to be re-ordered every time a row is removed in order to satisfy an 
ill-conceived schema.


This makes no difference to me, I can do anything they want. But the 
point is that customers usually not don't know the finer points to what 
"should" or "should-not" be done, but rather they way they think things 
should be done. Understand? After all, it's their business -- not ours.

>
Our charge is to provide them with as much correct information as they 
can absorb and then do just what they want beyond that.


Believe me, arguing with clients about how things should be done has 
it's limits. At some point, you just have to listen and do what they 
want in spite of what is optimal.


This is utterly beside the point. So, give your widgets a product ID. 
That's obvious. But, why would you want all of your widgets to assume a 
new product ID just because one widget has been taken out of production? 
Try to explain that to the client when absolutely nothing operates 
correctly because none of the widgets has the correct ID.


Again: this index you are proposing cannot be a product ID because it 
changes all the time.


I don't buy that. Doing it that way is attaching unnecessary 
presentation-specific baggage to your data. The column is only as 
relational as it was the last time it changed. That is, it was 
pointing to a completely different record then. This isn't a 
"separating data and presentation" issue?


We are disagreeing if having a record number is necessary or not? From 
my perspective, if it is left up to me -- it's unnecessary and my dB's 
don't have any. However, if the client wants it, then the client get's 
it and it then becomes necessary.


I think we are disagreeing with fundamental tenets of database schema 
design. But whatever ...


As for relational, I'm not talking about a relational dB field, but 
rather a simple record that the client can imagine. Relational fields 
are used to present the record, they certainly would not be involved in 
any renumbering schemes -- don't you see what I am talking about?


No

brian

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



[PHP] Command line socket server and SSL

2007-09-04 Thread Paul
I need to program a socket server in PHP that can use a 
certificate and communicate over SSL. I'm doing fine without 
SSL. Can't use port 443 or the web server for this, so it 
needs to be a command line app. Can't seem to find any 
documentation about how to set that up. Can anyone help or 
point me in the right direction?


TIA,
Paul W

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



Re: [PHP] Dealing with auto-increment in MySQL

2007-09-04 Thread Jason Pruim


On Sep 4, 2007, at 7:15 AM, Satyam wrote:

I was wondering if people is asking this in the belief that the  
autoincrement field is the record position in the database table  
and that by not reusing those positions, the space of  the deleted  
records is wasted. Perhaps when they say renumbering what they are  
meaning is compacting the database reusing the empty slots they  
assume those autoincrement fields point to.  Someone remembers  
dBaseIII .dbf files?  Well, perhaps that is the picture they have  
in mind.


As the person who started the other thread about this, my big thing  
was having a continuous record number that I could display to the  
customer much the way excel displays record numbers.


But after discussing it, I see where my thinking was wrong in how I  
wanted to achieve it, and also my misunderstanding of the way  
databases worked. I'm pretty new working with databases, and PHP.  
HTML and CSS I've done for awhile, just never needed a database or  
programming language until recently :)


so to put my 2¢ in on this, I would say to leave alone the auto  
increment field especially if it's included in an index. If you need  
a record number, either store it in the database in a separate field  
as tedd suggested, and leave the main auto increment field alone. OR  
use PHP (Or your favorite programming language) to add a "Record  
number" to the display.


Okay I'm done now :)



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]

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



RE: [PHP] Dealing with auto-increment in MySQL

2007-09-04 Thread Bastien Koert

I just let it go...there is no need to manage that process or you'll just screw 
up the mysql...
it shouldn't be relied on for anything other that uniqueness any way
 
bastien
 
 
 
 
 
> Date: Mon, 3 Sep 2007 23:53:22 -0400> From: [EMAIL PROTECTED]> To: 
> php-general@lists.php.net> Subject: [PHP] Dealing with auto-increment in 
> MySQL> > How're you folks dealing with records that are auto incremented in 
> MySQL> after a delete is made? I've noticed the only way to get a sequential 
> order> back is to truncate the table completely.> > Do you use logic in your 
> code to find a missing ID and insert new records> based on that? Or do you 
> just ignore it, let mysql handle the numbering and> go on with your lives?> > 
> Just curious.> > Thanks!> > - sf
_
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline

Re: [PHP] Dealing with auto-increment in MySQL

2007-09-04 Thread tedd

At 1:15 PM +0200 9/4/07, Satyam wrote:
I was wondering if people is asking this in the belief that the 
autoincrement field is the record position in the database table and 
that by not reusing those positions, the space of  the deleted 
records is wasted. Perhaps when they say renumbering what they are 
meaning is compacting the database reusing the empty slots they 
assume those autoincrement fields point to.  Someone remembers 
dBaseIII .dbf files?  Well, perhaps that is the picture they have in 
mind.


Satyam



Satyam:

I'm sure that's the reasoning and the misconception that some people 
have, but there are all sorts of schemes to manage "slots" (gaps in 
memory or storage). I do not know how MySQL specifically handles 
storage fragmentation, but I am sure it does.


The best scheme I've seen (granted I'm limited) was how the older 
Macs worked with their memory manager. When programming and you asked 
for memory, you didn't receive a pointer to a block of available 
memory, but rather a handle which was a pointer to a pointer to a 
block of memory.


Then at times when the memory manager thought it was opportune (I 
haven't a clue as to how that was determined), it would go in and 
rearrange all memory to optimize the amount of free memory blocks. 
While the address the handles would point to would change, your 
pointer to the handle would remain the same as before. It was cool 
they way it did that and that's one of the reasons why the older Macs 
seldom crashed.


The newer Macs are based upon Unix and I haven't a clue as to how it 
handles memory, but it does a pretty good job from my experience.


I can't help but think that MySQL has had some of the best minds in 
the world working on it and this problem was resolved long ago.


Cheers,

tedd
--
---
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] Pragmatically changing a "Record Number"

2007-09-04 Thread Graham Cossey
Surely we're into basic database design. If you have an auto_increment
record key that needs changing from time to time then you've designed
the database incorrectly. Use a 'normal' key field such as
"Product_Id" and have your application generate the number.

Simple.

No?

On 9/4/07, tedd <[EMAIL PROTECTED]> wrote:
> At 6:18 PM -0400 9/3/07, brian wrote:
> >>Renumbering anything is pretty quick these days. To me, things that
> >>are "horribly inefficient" are also slow. So, I don't agree. If I
> >>remember correctly, I can even renumber a 100K item dB
> >>auto_increment index in less than one second -- but I wouldn't
> >>recommend it. I think that's pretty quick.
> >>
> >
> >It may be just fine in your case, but from a DB design standpoint it
> >most certainly is not efficient. Why re-order the entire table for
> >something like this? Altering an entire table because one row has
> >been deleted suggests to me that the schema needs to revisited.
>
>  From a technical standpoint, I agree with you. It's far better to let
> the records fall as they may according to the sort, whatever that may
> be.
>
> However, we (or at least I) often work with clients who don't see
> that. Instead they see records that they place into their database
> that hold information about their widgets and they like to see a
> record number associated with their widget. And, when they add a new
> widget record, they want to see that count increased and when they
> delete a widget record they want to see it gone and a gap, where they
> can renumber at their will.
>
> This makes no difference to me, I can do anything they want. But the
> point is that customers usually not don't know the finer points to
> what "should" or "should-not" be done, but rather they way they think
> things should be done. Understand? After all, it's their business --
> not ours.
>
> Our charge is to provide them with as much correct information as
> they can absorb and then do just what they want beyond that.
>
> Believe me, arguing with clients about how things should be done has
> it's limits. At some point, you just have to listen and do what they
> want in spite of what is optimal.
>
>
> >>Presentation is made during presentation, obviously, by using css
> >>and proper html and pulling data from your dB to assemble
> >>presentation. If the client wants Roman notation, it's a simple
> >>process to provide that.
> >
> >So now you want to rewrite your triggers to use Roman notation? I
> >wasn't aware that MySQL had such terrific Roman numeral math support.
>
> I rewrite stuff all the time to make the presentation exactly what
> the client expects. Roman numeral math support is really a no brainer
> to create -- that's comp 101 sruff.
>
> >>There is no "separating data and presentation" in this issue.
> >
> >I don't buy that. Doing it that way is attaching unnecessary
> >presentation-specific baggage to your data. The column is only as
> >relational as it was the last time it changed. That is, it was
> >pointing to a completely different record then. This isn't a
> >"separating data and presentation" issue?
>
> We are disagreeing if having a record number is necessary or not?
>  From my perspective, if it is left up to me -- it's unnecessary and
> my dB's don't have any. However, if the client wants it, then the
> client get's it and it then becomes necessary.
>
> As for relational, I'm not talking about a relational dB field, but
> rather a simple record that the client can imagine. Relational fields
> are used to present the record, they certainly would not be involved
> in any renumbering schemes -- don't you see what I am talking about?
>
> Cheers,
>
> tedd
> --
> ---
> 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
>
>


-- 
Graham

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



Re: [PHP] Pragmatically changing a "Record Number"

2007-09-04 Thread tedd

At 6:18 PM -0400 9/3/07, brian wrote:
Renumbering anything is pretty quick these days. To me, things that 
are "horribly inefficient" are also slow. So, I don't agree. If I 
remember correctly, I can even renumber a 100K item dB 
auto_increment index in less than one second -- but I wouldn't 
recommend it. I think that's pretty quick.




It may be just fine in your case, but from a DB design standpoint it 
most certainly is not efficient. Why re-order the entire table for 
something like this? Altering an entire table because one row has 
been deleted suggests to me that the schema needs to revisited.


From a technical standpoint, I agree with you. It's far better to let 
the records fall as they may according to the sort, whatever that may 
be.


However, we (or at least I) often work with clients who don't see 
that. Instead they see records that they place into their database 
that hold information about their widgets and they like to see a 
record number associated with their widget. And, when they add a new 
widget record, they want to see that count increased and when they 
delete a widget record they want to see it gone and a gap, where they 
can renumber at their will.


This makes no difference to me, I can do anything they want. But the 
point is that customers usually not don't know the finer points to 
what "should" or "should-not" be done, but rather they way they think 
things should be done. Understand? After all, it's their business -- 
not ours.


Our charge is to provide them with as much correct information as 
they can absorb and then do just what they want beyond that.


Believe me, arguing with clients about how things should be done has 
it's limits. At some point, you just have to listen and do what they 
want in spite of what is optimal.



Presentation is made during presentation, obviously, by using css 
and proper html and pulling data from your dB to assemble 
presentation. If the client wants Roman notation, it's a simple 
process to provide that.


So now you want to rewrite your triggers to use Roman notation? I 
wasn't aware that MySQL had such terrific Roman numeral math support.


I rewrite stuff all the time to make the presentation exactly what 
the client expects. Roman numeral math support is really a no brainer 
to create -- that's comp 101 sruff.



There is no "separating data and presentation" in this issue.


I don't buy that. Doing it that way is attaching unnecessary 
presentation-specific baggage to your data. The column is only as 
relational as it was the last time it changed. That is, it was 
pointing to a completely different record then. This isn't a 
"separating data and presentation" issue?


We are disagreeing if having a record number is necessary or not? 
From my perspective, if it is left up to me -- it's unnecessary and 
my dB's don't have any. However, if the client wants it, then the 
client get's it and it then becomes necessary.


As for relational, I'm not talking about a relational dB field, but 
rather a simple record that the client can imagine. Relational fields 
are used to present the record, they certainly would not be involved 
in any renumbering schemes -- don't you see what I am talking about?


Cheers,

tedd
--
---
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] Create a matrix gallery

2007-09-04 Thread Simon
> What I want to to do is insert a new  after showing 5 thumb images, and
> continue with the next picture on the next row.
> something like this
> __
> |pic1 | pic2 | pic3 | pic4 | pic5 |
> __
> |pic6 | pic7 | pic8 | pic9 | pic10 |
> __
> |pic11 | pic12 | pic13 |
> __

You need to use the math function: modulo.

$MaxRows = 5;
for(...){
  $m = fmod($ImageNumber, $MaxRows);
  if($m == 0){ echo ""; }
  echo "";
  // [...] content of cell here
  echo "";
  if($m == ($MaxRows-1)){ echo ""; }
}

Have fun!
Simon

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



[PHP] Re: Generating foldout menus in php

2007-09-04 Thread zerof

Arno Kuhl escreveu:

This may not be directly php related but I'm hoping that generating the code
with PHP will keep it on topic.

I'm looking for a way to generate dropdown/foldout menus (horizontal and
vertical) on the fly, but all the javascript solutions I've seen use
absolute or relative pixel positioning, which means I can't use them because
I don't know at the time of generating a specific menu item how many pixels
across or down the preceding items have already used. I'm currently using a
javascript menu that works really well, but all the top-level menu items
have to be preset with specific x-y pixel coordinates, and all the
subsequent items are then relative to the top-level items. So I can generate
the second-level and subsequent items on the fly but not the top-level
items. Is there a way to use css or dhtml or something else (maybe something
in javascript that I missed) to do this?

Thanks
Arno


http://phplayersmenu.sourceforge.net/

http://labs.adobe.com/technologies/spry/
--
zerof
http://www.educar.pro.br/
Apache - PHP - MySQL - Boolean Logics - Project Management
--  
You must hear, always, one second opinion! In all cases.
--
Let the people know if this info was useful for you!
--

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



Re: [PHP] Security Issue

2007-09-04 Thread Wouter van Vliet / Interpotential
Karl,

Some simple checks on $contpath could solve your problem. Make sure that:

 - it doesn't start with a /
 - doesn't contain /../
 - it doesn't contain a double slash //, or make sure the URL Fopen wrapper
is disabled:
http://nl3.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen

Usually $contpath = str_replace('/', '', $contpath); takes care of
everything.

On 04/09/07, Karl-Heinz Schulz <[EMAIL PROTECTED]> wrote:
>
>  It was able to call up external includes using the below code which
> resulted that the server was used to send out spam.
>
> How can I protect the code?
>
> TIA
>
> 
> session_start();
>
>
> //---
>
> // index.php
>
>
> //---
>
> include("../inc/const.php");
>
> include("../inc/mysql.php");
>
>  $menu=2;
>
> include("../inc/static.php");
>
> //include("../inc/prolog.php");
>
> $base = getenv("SERVER_NAME").getenv("SCRIPT_NAME");
>
> //$menu = $HTTP_GET_VARS['menu'];
>
> $submenu_list = $HTTP_GET_VARS['submenu_list'];
>
> $contfile = $HTTP_GET_VARS['contfile'];
>
> $id = $HTTP_GET_VARS['id'];
>
> $stk = $HTTP_GET_VARS['stk'];
>
> $contpath = $HTTP_GET_VARS['contpath'];
>
> if ($contpath=="")
>
> { $contpath="./"; }
>
> ?>
>
> 
>
> 
>
> Neuer Wissenschaftlicher Verlag -  $typ_subnav[$menu]?>
>
> 
>
> 
>
> 
>
>  marginwidth="0" link="#00" vlink="#00" alink="#00">
>
>  cellpadding="0" border="0">
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>  background="../../img_pool/bg_left_right.gif"> include("../inc/leftmenu.php");?>
>
>  
>
> 
>
> 
>
> 
>
> 
>
>  background="../../img_pool/bg_left_right.gif">
>
> 
>
> //
>
>   //  Subnavigation
>
>
> //
>
> include("../inc/subnav.php");
>
> ?>
>
> 
>
> 
>
>  
>
>  
>
> 
>
>  
>
>
>
>  
>  ?>
>
>   
>
>  
>
>
>
>  
>
>
>
> 
>
>


-- 
Interpotential.com
Phone: +31615397471


[PHP] Security Issue

2007-09-04 Thread Karl-Heinz Schulz
It was able to call up external includes using the below code which resulted
that the server was used to send out spam.
How can I protect the code?

TIA




Neuer Wissenschaftlicher Verlag - 















 










 
 

 
 
 

  
 
 
 
 



smime.p7s
Description: S/MIME cryptographic signature


RE: [PHP] Dealing with auto-increment in MySQL

2007-09-04 Thread Jay Blanchard
[snip]
I was wondering if people is asking this in the belief that the 
autoincrement field is the record position in the database table and
that by 
not reusing those positions, the space of  the deleted records is
wasted. 
Perhaps when they say renumbering what they are meaning is compacting
the 
database reusing the empty slots they assume those autoincrement fields 
point to.  Someone remembers dBaseIII .dbf files?  Well, perhaps that is
the 
picture they have in mind.
[/snip]

Maybe, but it seems as if more of this is about keeping a contiguous
'index' of the records contained in the database. 

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



Re: [PHP] Dealing with auto-increment in MySQL

2007-09-04 Thread Satyam
I was wondering if people is asking this in the belief that the 
autoincrement field is the record position in the database table and that by 
not reusing those positions, the space of  the deleted records is wasted. 
Perhaps when they say renumbering what they are meaning is compacting the 
database reusing the empty slots they assume those autoincrement fields 
point to.  Someone remembers dBaseIII .dbf files?  Well, perhaps that is the 
picture they have in mind.


Satyam



- Original Message - 
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "Steve Finkelstein" <[EMAIL PROTECTED]>; "php-general" 


Sent: Tuesday, September 04, 2007 12:53 PM
Subject: RE: [PHP] Dealing with auto-increment in MySQL



[snip]
Do you use logic in your code to find a missing ID and insert new
records
based on that? Or do you just ignore it, let mysql handle the numbering
and
go on with your lives?
[/snip]

The answer is B. There is a long standing discussion on this right now.

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




--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.485 / Virus Database: 269.13.3/986 - Release Date: 03/09/2007 
9:31





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



RE: [PHP] Dealing with auto-increment in MySQL

2007-09-04 Thread Jay Blanchard
[snip]
Do you use logic in your code to find a missing ID and insert new
records
based on that? Or do you just ignore it, let mysql handle the numbering
and
go on with your lives?
[/snip]

The answer is B. There is a long standing discussion on this right now.

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



RE: [PHP] Generating foldout menus in php

2007-09-04 Thread Arno Kuhl
>This may not be directly php related but I'm hoping that generating the 
>code with PHP will keep it on topic.
>
>I'm looking for a way to generate dropdown/foldout menus (horizontal 
>and
>vertical) on the fly, but all the javascript solutions I've seen use 
>absolute or relative pixel positioning, which means I can't use them 
>because I don't know at the time of generating a specific menu item how 
>many pixels across or down the preceding items have already used. I'm 
>currently using a javascript menu that works really well, but all the 
>top-level menu items have to be preset with specific x-y pixel 
>coordinates, and all the subsequent items are then relative to the 
>top-level items. So I can generate the second-level and subsequent 
>items on the fly but not the top-level items. Is there a way to use css 
>or dhtml or something else (maybe something in javascript that I missed) to
do this?
>
>Thanks
>Arno

Arno:

There's really no way to do this just using php. I can envision a way to use
php with a couple of other languages to provide drop-down and pop-out menus,
but that would be more complicated than just using css with js, like so:

http://sperling.com/examples/menuh/

http://sperling.com/examples/menuv/

Why complicate your life?

Cheers,

tedd

--

Hi tedd

Thanks, that's pretty much what I was looking for. I found something similar
at cssplay, except the examples I saw didn't use .htc file. Like your
examples the cssplay code only runs on IE5.5 and up (and other browsers).
Not sure yet if that would be a problem. I don't have IE5 to test with, so I
don't know if there's a graceful fallback that would still allow the user to
navigate. As you said, it doesn't look like there's a solution to fit all
browsers and versions.

Cheers
Arno

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



RE: [PHP] Generating foldout menus in php

2007-09-04 Thread Arno Kuhl
> I'm looking for a way to generate dropdown/foldout menus (horizontal 
> and
> vertical) on the fly, but all the javascript solutions I've seen use 
> absolute or relative pixel positioning, which means I can't use them 
> because I don't know at the time of generating a specific menu item 
> how many pixels across or down the preceding items have already used. 
> I'm currently using a javascript menu that works really well, but all 
> the top-level menu items have to be preset with specific x-y pixel 
> coordinates, and all the subsequent items are then relative to the 
> top-level items. So I can generate the second-level and subsequent 
> items on the fly but not the top-level items. Is there a way to use 
> css or dhtml or something else (maybe something in javascript that I
missed) to do this?

Is this: http://www.phpguru.org/static/dynContext.example.html what you
mean?

--
Richard Heyes


--
Thanks for the reference Richard. dynContext looks pretty good and is
similar to what I'm already using, but it looks like it also uses x-y
coordinates for the top-level item (looking at the show() function, unless I
misunderstood the manual).

I had problems making it work on my local machine. The
annotated.example.html displayed an error code (I presume) on right click.

BTW I stumbled across cssplay in my search and think it may be the solution.
Just trying to figure if lack of support for IE5 is a problem or not
(supports IE5.5 etc and all other browsers).

Cheers
Arno

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



Re: [PHP] Dealing with auto-increment in MySQL

2007-09-04 Thread Per Jessen
Steve Finkelstein wrote:

> Do you use logic in your code to find a missing ID and insert new
> records based on that? Or do you just ignore it, let mysql handle the
> numbering and go on with your lives?

The latter.


/Per Jessen, Zürich

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