[PHP] Solaris 10 libnetsnmp build failure

2005-12-30 Thread Dean

Posted this to php-install with no response.  See:
http://marc.theaimsgroup.com/?l=php-installm=113579793423896w=2

Hi folks,

I am trying to install php-4.4.1 on sparc-solaris 10, but make fails with:

/bin/sh /root/tmp/php-4.4.1/libtool 90-line snip -o sapi/cgi/php

gcc: /usr/sfw/lib/sparcv9/.libs/libnetsnmp.so: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `sapi/cgi/php'

My configure line is:

./configure --with-mysql --with-snmp

This is almost the right place for libnetsnmp - /usr/sfw/lib, but there
is no .libs directory.

Can someone point me in the right direction?

0 urzatron /root # cat /etc/release
  Solaris 10 3/05 s10_74L2a SPARC

Thanks,
--Dean

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



Re: [PHP] what is the problem with this query?

2005-12-30 Thread sunaram patir
thanks. i have resolved the problem by replacing 'read' with 'read_it'.
On 12/30/05, Michael Gross [EMAIL PROTECTED] wrote:
 read is a reserved word in mysql
 (http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html). You have
 to double-quote reserved words:

 mysql_query(SELECT * FROM mailbox WHERE \read\='');

 Graham Cossey wrote:
  On 12/29/05, Jay Blanchard [EMAIL PROTECTED] wrote:
  [snip]
  could you please tell me what is the problem with this query
  mysql_query(SELECT * FROM mailbox WHERE read='');
 
i always get this warning:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL
  result resource in index.php on line 24
  [/snip]
 
  THere is no apparent problem with the query, but there is a problem with
  mysql_num_rows(). Can you show us he code there?
 
  I would hazard a guess that mysql_num_rows() is not being passed the
  correct query result handle as a parameter.
 
  ie: $result = mysql_query(...);
  $rows = mysql_num_rows($result);
 
  --
  Graham
 

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



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



Re: [PHP] PHPMailer inserting unwanted spaces

2005-12-30 Thread Lam Cheuk Hin
Can You Write The Strings/Text?

On 12/30/05, René Fournier [EMAIL PROTECTED] wrote:

 Has anyone encountered this? I am composing an HTML email with
 PHPMailer, and for some reason PHPMailer is inserted spaces
 periodically, which breaks the formatting. I've looked through the
 docs, but can only find a setting for Word Wrap (which is set to 0).

 ...Rene

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




--
lch2003


Re: [PHP] interfaces - your opinion

2005-12-30 Thread Jochem Maas

hi Marco,

I want to apply the idea to interface implementation not
class extension. that is to say I want to be able to make an
interface only implementable by certain (defined) classes (and their
subclasses) with out imposing any restriction on the classes
themselves (like that they must extend a certain base class in order
to have the 'implementable by' check performed.

IFAICT this is not really possible - but maybe somebody sees a way,
then again maybe it's too silly an idea to even consider it.
regardless thanks for your feedback.

rgds,
jochem

Marco Kaiser wrote:

Hi Jochem,

try this.

?php

abstract class AClass
{
private $allowedClasses = array(
'MyClass',
'MyOtherClass'
);
final public function __construct()
{
if (!in_array(get_class($this), $this-allowedClasses)) {
throw new Exception('not allowed classes: ' . __CLASS__);
}
   
//if (($this instanceof MyClass) ||

//($this instanceof MyOtherClass)) {
//throw new Exception('not allowed class: ' . __CLASS__);
//}
}
}


class MyClass extends AClass {}

class MyOtherClass extends AClass {}

class NotMyClass extends AClass {}

new MyClass();
new MyOtherClass();
new NotMyClass();


--
Marco Kaiser


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



Re: [PHP] Re: php / JS / DOM question

2005-12-30 Thread Jochem Maas

Al wrote:

jonathan wrote:

I know that this is more of a Javascript / DOM question but I cannot  
for the life of me figure this out:


I have this form:

form name=query_form
input type=text name=q/input
input type=button onclick=drawImg('A',document.forms 
['query_form'].elements['q']); value=Search/input

/form


get firefox and learn to use the javascript console, the DOM inspector and
the javascript debugger in that order - in this case the DOM inspector
would have been your biggest friend as it would have shown you 'correct'
name for the element (object) whose value you were trying to grab - in general
the DOM inspector is very handy for learning more about the structure
and the content of the DOM.



When the user clicks on the button, I want the text that is in input  
elment 'q' to be sent to the Javascript function drawImg but when I  
debug it via alerts, it appears to be NULL. Looking at the examples  
online, I feel like this should work. Does anybody know why this  
might not be working correctly?


-jonathan



You need to ask in the JAVASCRIPT newsgroup.  This is not a php question.


anyone every noticed that the question as to where a good javascript mailing
can be found comes up every week or so. and nobody ever has an answer.

so where the  is this 'JAVASCRIPT newsgroup' ??

wait thats not a php question either - maybe we can ask John Nichel
to ajudicate the validity of the question in light of the 'somehow
related to IBM' criteria [which is in fact the true measure of a relevant
question on this list] ;-)





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



[PHP] HAPPY NEW YEAR!!

2005-12-30 Thread Jesús Alain Rodríguez Santos
Happy New Year for all. 
I weish you the best in this new 2006. 
Regards. Alain
-- 
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.



Re: [PHP] interfaces - your opinion

2005-12-30 Thread Marco Kaiser
Hi Jochem,


i know what you mean, but you can't define code in interfaces to implement a
logic. You should use an abstract class to restrict the access. I think a
interface should just define a rude prototype of function 

--
Marco Kaiser


Re: [PHP] Strange Right-Shift Problem

2005-12-30 Thread Jochem Maas

Michael Gross wrote:

Hello
I have to migrate a PHP-application to a new Linux-Box. Both the old and 
the new system are Linux and PHP 5.1.1. (the old one has a Pentium 4, 
the new one two Xeon CPUs). I have a problem using the 
Crypt_Xtea-Extension. I narrowed it down to the following right-shift 


looking at the class I draw the conclusion that it reqires the use of
[some] data in 'long' format (i.e. integers) and the code requires and
assumes that such integers are 32bits long ... which they are on 32bit
systems ... but not on 64bit systems . here in lies the problem, you need
someone more knowledgable than I to give you an actual solution though.


operation:

(-3281063054  11) produces different results:
Old System: 495070


this is what you get with a 32bit CPU


New System: -1048576


this is what you get with a 64bit CPU



I understand that both results are wrong, but everything worked with 
the old behavior and I need that behavior back very urgent.


Maybe someone can explain me in which way the bits are shifted so that 
the result is 495070? If I understand it, I implement my own shift 


$a  $b  Shift left  Shift the bits of $a $b steps to the left (each step means 
multiply by two)
$a  $b  Shift right Shift the bits of $a $b steps to the right (each step means 
divide by two)


function.


thanks a lot
  Michael Gross



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



Re: [PHP] Re: php / JS / DOM question

2005-12-30 Thread Stut

Jochem Maas wrote:


Al wrote:

You need to ask in the JAVASCRIPT newsgroup.  This is not a php 
question.



anyone every noticed that the question as to where a good javascript 
mailing

can be found comes up every week or so. and nobody ever has an answer.

so where the  is this 'JAVASCRIPT newsgroup' ??


comp.lang.javascript

Damn, that was hard to find!

-Stut

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



Re: [PHP] Re: php / JS / DOM question

2005-12-30 Thread Jochem Maas

I eat my shoe. ;-)

... but is comp.lang.javascript any good?

Stut wrote:

Jochem Maas wrote:


Al wrote:

You need to ask in the JAVASCRIPT newsgroup.  This is not a php 
question.




anyone every noticed that the question as to where a good javascript 
mailing

can be found comes up every week or so. and nobody ever has an answer.

so where the  is this 'JAVASCRIPT newsgroup' ??



comp.lang.javascript

Damn, that was hard to find!

-Stut


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



Re: [PHP] Re: php / JS / DOM question

2005-12-30 Thread Stut

A: Yes I did.
Q: Did you fix the to posting?

Jochem Maas wrote:


Stut wrote:


Jochem Maas wrote:


Al wrote:

You need to ask in the JAVASCRIPT newsgroup.  This is not a php 
question.





anyone every noticed that the question as to where a good javascript 
mailing

can be found comes up every week or so. and nobody ever has an answer.

so where the  is this 'JAVASCRIPT newsgroup' ??




comp.lang.javascript

Damn, that was hard to find!

-Stut


I eat my shoe. ;-)

... but is comp.lang.javascript any good?


Pass, but for what should be obvious reasons I would ask JS questions 
there before here.


-Stut

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



Re: [PHP] unable to load perl extension

2005-12-30 Thread Jochem Maas

dev lamp wrote:

On 12/29/05, Jochem Maas [EMAIL PROTECTED] wrote:


dev lamp wrote:


Hi

I am unable to call perl code from PHP, since the extension does not
get loaded !

Scenario 1:
use dl('perl.so'); in the php code and invoke the script from the command line
The script works fine and the perl code gets executed as well.


so the extension is not being loaded automatically right?
but if you dl() it everything is fine, right?
then double check the 'right' ini file is being used!




There is only one php.ini
I have checked the extensions path information using phpinfo().


you not only have to specify the correct extension dir you
also have to specify [in your php.ini] each and every extension that you want
to load e.g:

extension=perl.so

or alternatively (no need for the extension dir to be set):

extension=/complete/path/to/your/perl.so



Is there something else that I need to checkout ?



is the apache module using the php.ini that you think it is ?? -
that kind of thing has caught me out more than once!




How do I check that ?
I downloaded apache sources and compiled it.
Why do I need to specify the path of the php.ini file to the apache web server ?


the php apache module needs to know where the php.ini can be found - usually
set at compile time - the place it's kept varies from OS to OS (which has 
caught me out
before!).




Dev.



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



Re: [PHP] Variables and Strings

2005-12-30 Thread Jochem Maas

Jim Moseby wrote:
Thanks for the responses guys, but what i'm saying is i would 


...



I believe what Jochem is trying to tell you is that when you assign the
string variable, the variable names are expanded to their values, so the
names are no longer available.


exactly - nicely put Jim.



Consider this:

$partname='widget';
$amount=100;

$string=This $partname costs $amount dollars;

/*
$string now equals This widget costs 100 dollars, so when you pass it to
your function, it has no way to know for sure what the variables were, or
that there even were ANY variables involved in the generation of the string.

The variable NAMES are not passed because PHP expands them to their values
and sets $string accordingly.
*/

$string='This $partname costs $amount dollars';

$string now equals This $partname costs $amount dollars.  In this case, I
used single quotes.  The values are not expanded and the variable NAMES are
passed.  The VALUE of the variables are not.  So you could then have a
function look for any word that starts with a $ and return an array of
names.


hopefully thats clear to the OP now - and he can [re]state his goal in
order that we might point him into a more fruitful direction!



That all being said, what in the world are you trying to do with this?  I
bet you $1.78 (the change in my desk drawer) there is a much better way to
solve whatever problem it is than the way you are trying here.


yeah 'Superman' explain what it is you want to do AND why - then maybe we can
give you some help - what you are currently asking is impossible (well actually
Jay Blanchard hinted at a way to do it but I firmly believe that its 
conceptually
over your head atm and very probably not a good solution to what you want to 
acheive -
which is not to say that Jays hint was crap or wrong; more like the problem you
posed originally is moot.)



JM

Because it ruins the flow of the conversation.


evil genius ;-)




Why is top posting a bad thing?





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



[PHP] Which is faster, a MySQL access, or a set of PHP variables?

2005-12-30 Thread Dave M G
PHP General,

I have a site where I will set the interface up to be multilingual.
This means that all the snippets of text which make up the menu and
other elements of navigation common to most pages will be stored as
variables.

In most web site set ups that I have seen, especially on forums, the
text is stored in a PHP script which is just a long list of variables.

I wondered if there was any downside to storing the list of interface
texts in a MySQL database, then calling them as an array when the page
loads?

This would have one minor advantage, which is that as I expand to new
languages, I could build a simple web interface where people could input
new languages into a form.

However, is it a drag on a server to have to reach into the MySQL
database to retrieve the array of texts each time the page loads? Note
that the texts will be something like 20 to 30 small one to four word
phrases like contact and previous page and that sort of thing.

On the surface, it doesn't seem like this would be much different than
accessing a PHP script with a list of variables. But then, I figured
there might be a reason why I've never seen it done this way.

Opinions would be much appreciated.

--
Dave M G

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



RE: [PHP] Variables and Strings

2005-12-30 Thread Jay Blanchard
[snip]
yeah 'Superman' explain what it is you want to do AND why - then maybe we
can
give you some help - what you are currently asking is impossible (well
actually
Jay Blanchard hinted at a way to do it but I firmly believe that its
conceptually
over your head atm and very probably not a good solution to what you want to
acheive -
which is not to say that Jays hint was crap or wrong; more like the problem
you
posed originally is moot.)
[/snip]

We actually wrote a little code doohickey called Variable Hunter in which
the doohickey could be run within a project folder and locate all of the
variables with their respective name spaces and lines numbers. Nifty little
tool.

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



Re: [PHP] Which is faster, a MySQL access, or a set of PHP variables?

2005-12-30 Thread Jochem Maas

Dave M G wrote:

PHP General,

I have a site where I will set the interface up to be multilingual.
This means that all the snippets of text which make up the menu and
other elements of navigation common to most pages will be stored as
variables.

In most web site set ups that I have seen, especially on forums, the
text is stored in a PHP script which is just a long list of variables.

I wondered if there was any downside to storing the list of interface
texts in a MySQL database, then calling them as an array when the page
loads?

This would have one minor advantage, which is that as I expand to new
languages, I could build a simple web interface where people could input
new languages into a form.


true - rather than trying to writing an interface thats _properly_ capable
tf editing phpb-like language files - which although not impossible is a lot
more difficult to make fool-proof than one first imagines (I have very
ingenious 'fools' who want to edit stuff like that!)



However, is it a drag on a server to have to reach into the MySQL
database to retrieve the array of texts each time the page loads? Note
that the texts will be something like 20 to 30 small one to four word
phrases like contact and previous page and that sort of thing.


using var_export() you can write the array to a file on a TMPFS filesystem
(e.g. /dev/shm) as a cache and have a cmdline script or something that you run
whenever you want the lang itmes to be updated - reading a single small file in 
off
disk (which in the case of TMPFS is in RAM - bonus!!!) will be faster in general
than querying MySQL and building the array.

essentially this gives you the best of both world - with the added bonus of
begin able to easily control publication of updates to the lang items.



On the surface, it doesn't seem like this would be much different than
accessing a PHP script with a list of variables. But then, I figured
there might be a reason why I've never seen it done this way.


basically unless you have some killer site thats taking a beating and
needs to take performance very seriously in order to stay in the air then either
way will do fine. a DB call on every request is somewhat wasteful but a low 
traffic
site won't mind one little bit.



Opinions would be much appreciated.

--
Dave M G



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



Re: [PHP] Variables and Strings

2005-12-30 Thread Jochem Maas

Jay Blanchard wrote:

[snip]
yeah 'Superman' explain what it is you want to do AND why - then maybe we
can
give you some help - what you are currently asking is impossible (well
actually
Jay Blanchard hinted at a way to do it but I firmly believe that its
conceptually
over your head atm and very probably not a good solution to what you want to
acheive -
which is not to say that Jays hint was crap or wrong; more like the problem
you
posed originally is moot.)
[/snip]

We actually wrote a little code doohickey called Variable Hunter in which
the doohickey could be run within a project folder and locate all of the
variables with their respective name spaces and lines numbers. Nifty little
tool.


ah heck is that the same code that _we_ (Jay and me, etc) played with to find 
SQL queries?
or something that was based on it?
I remember Robin Vickery coming up with a token based variant which was rather 
nifty -
must look into that agian sometime!

rgds,
JOchem





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



RE: [PHP] Variables and Strings

2005-12-30 Thread Jay Blanchard
[snip]
ah heck is that the same code that _we_ (Jay and me, etc) played with to
find SQL queries?
or something that was based on it?
I remember Robin Vickery coming up with a token based variant which was
rather nifty -
must look into that agian sometime!
[/snip]

They are all variants of that. All nifty little tools. We should gather
those up someplace...shouldn't we?

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



Re: [PHP] Variables and Strings

2005-12-30 Thread John Nichel

Jay Blanchard wrote:

[snip]
yeah 'Superman' explain what it is you want to do AND why - then maybe we
can
give you some help - what you are currently asking is impossible (well
actually
Jay Blanchard hinted at a way to do it but I firmly believe that its
conceptually
over your head atm and very probably not a good solution to what you want to
acheive -
which is not to say that Jays hint was crap or wrong; more like the problem
you
posed originally is moot.)
[/snip]

We actually wrote a little code doohickey called Variable Hunter in which
the doohickey could be run within a project folder and locate all of the
variables with their respective name spaces and lines numbers. Nifty little
tool.



I wrote a doohickey once which searched for all variable searching 
doohickies.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] Variables and Strings

2005-12-30 Thread Jay Blanchard
[snip]
I wrote a doohickey once which searched for all variable searching
doohickies.
[/snip]

I cannot tell you how happy I am to see you use the past perfect tense
correctly there.

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



Re: [PHP] Which is faster, a MySQL access, or a set of PHP variables?

2005-12-30 Thread Miles Thompson

At 10:32 AM 12/30/2005, Dave M G wrote:


PHP General,

I have a site where I will set the interface up to be multilingual.
This means that all the snippets of text which make up the menu and
other elements of navigation common to most pages will be stored as
variables.

In most web site set ups that I have seen, especially on forums, the
text is stored in a PHP script which is just a long list of variables.

I wondered if there was any downside to storing the list of interface
texts in a MySQL database, then calling them as an array when the page
loads?

This would have one minor advantage, which is that as I expand to new
languages, I could build a simple web interface where people could input
new languages into a form.

However, is it a drag on a server to have to reach into the MySQL
database to retrieve the array of texts each time the page loads? Note
that the texts will be something like 20 to 30 small one to four word
phrases like contact and previous page and that sort of thing.

On the surface, it doesn't seem like this would be much different 
than

accessing a PHP script with a list of variables. But then, I figured
there might be a reason why I've never seen it done this way.

Opinions would be much appreciated.

--
Dave M G


Dave,

I did that for an online auction site, now defunct, where the languages 
could be German or English. To expand to Spanish one had only to supply the 
structure and have someone who knew one of the other languages to enter the 
correct terms. That would be pasted into the script and run, presto, the 
site was available in Spanish.


Database hits ere not a problem, as all of the content on the page came 
from a database, none of the content was static.


That was three years ago, and it was done that way because native language 
support was wobbly in both PHP and Apache.


Joachem's solution is probably better for today.

Cheers - Miles Thompson 



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.371 / Virus Database: 267.14.9/216 - Release Date: 12/29/2005

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



Re: [PHP] Variables and Strings

2005-12-30 Thread John Nichel

Jay Blanchard wrote:

[snip]
ah heck is that the same code that _we_ (Jay and me, etc) played with to
find SQL queries?
or something that was based on it?
I remember Robin Vickery coming up with a token based variant which was
rather nifty -
must look into that agian sometime!
[/snip]

They are all variants of that. All nifty little tools. We should gather
those up someplace...shouldn't we?



Well, I just purchased some domains for that.  Who wants to develop it?  ;)

phpdepository.com
phpdepository.org
phpdepository.net

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] Variables and Strings

2005-12-30 Thread Jay Blanchard
[snip]
 They are all variants of that. All nifty little tools. We should gather
 those up someplace...shouldn't we?
 

Well, I just purchased some domains for that.  Who wants to develop it?  ;)

phpdepository.com
phpdepository.org
phpdepository.net
[/snip]

I'll contribute...

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



[PHP] nifty little tools

2005-12-30 Thread tedd

They are all variants of that. All nifty little tools. We should gather
those up someplace...shouldn't we?


In similar light, what development environments do you people program 
in? How do you run and test your code?


tedd

PS: This is my first posting to this group.
--

http://sperling.com/

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



Re: [PHP] nifty little tools

2005-12-30 Thread Jochem Maas

tedd wrote:

They are all variants of that. All nifty little tools. We should gather
those up someplace...shouldn't we?



In similar light, what development environments do you people program 
in? How do you run and test your code?


of late I have been testing Zend IDE - the integrated debugger is the biggest + 
point
for me.

I also use UltraEdit and TextPad [vi, aee, nano on linux].

test code with:
php -l
echo/var_dump()/print_r()
Zend IDE
xdebug
browser ;-)

your question has been asked before - you might find the list archives
gives you more insight into other peoples work envs.



tedd

PS: This is my first posting to this group.


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



RE: [PHP] nifty little tools

2005-12-30 Thread Jay Blanchard
[snip]
They are all variants of that. All nifty little tools. We should gather
those up someplace...shouldn't we?

In similar light, what development environments do you people program 
in? How do you run and test your code?

tedd

PS: This is my first posting to this group.
[/snip]

Welcome to the insanity.

I use Eclipse. For testing I have a test server where all of the code gets
hammered using a combination of automated and live user units. I am in a
microsoft shop, but have migrated web app servers to Apache (save for one
that I just cannot get rid of yet due to legacy ASP).

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



RE: [PHP] nifty little tools - resposity - evaluations..

2005-12-30 Thread tg-php
Wasn't this just brought up on another thread?  nifty little tools that is 
and a repository for such things.

There are lots of code repositories but none that I go directly to right off.  
Usually I hit Yahoo/Google and do a search for what I'm looking for and find 
whatever looks best for my situation.  That way, in theory, I find some of the 
newest/freshest ideas and techniques.  Not always the best, but it's usually a 
starting place.

tangent
Since you asked.. 

I use Zend Studio (http://www.zend.com) and Crimson Editor 
(http://www.crimsoneditor.com)... if not just 
Notepad/vi/other-generic-text-editor-native-to-OS.  My workmate uses Komodo 
(http://www.activestate.com/Products/Komodo/).
/tangent

I've found that people ask these kinds of questions over and over again..  and 
there are so many great websites out there with great code snippets or 
information in general.  And never a lack of people who give opinions on what 
their favorite is... be it framework, php editor, or favorite brand of shiraz.


So a little while ago I registered userrated.com  (nothing there now but an 
image cropping test script done in PHP...with an awesome pic of a pirate 
llama... you heard me!).

Anyway, my idea for this site is to create a review site for such things like 
PHP editors or even someone's favorite wine, restaurent, flea market, whatever. 
 So when someone on the PHP list asks about flea markets...err... editors..  
You can say Go to userrated.com and hit the PHP section.

The idea would be to enter just about anything and have properties associated 
with the item that can be itemized or just rated.

PHP Editors:
  Version [free entry]
  OS's supported [list]
  Ease of Use [1-5]
  IDE? [Y/N/Partial?]
  Debugger? [Y/N/Partial?]
  Stability [1-5]
  Overall impression [1-5]

Wine:
  Type [free entry or checkbox?]
  Origin [free entry]
  Dry-Sweet [1-5]
  Year
  Vineyard
  Color
  Whatever-else-wine-snobs-judge-by  :)

And the other thing I'd like to do with it is be able to show all 
ratings/reviews/comments or filter by date range because sometimes things 
become outdated or obsolete or were great a year ago and now aren't supported 
anymore.  So if you showed all dates it may say Average rating 7.5 but if 
you showed the 100 ratings giving in the last 2 months, it may drop to 4.0.

Just throwing this out there in case anyone has any thoughts or comments or 
hell.. maybe a site already exists that does all this.

Two things inspired this idea...  (1) the constant weekly What PHP editor do 
you use?  What's the best? questions (hah) and (2) my lack of ability to 
remember all the odd restaurants, wines, beers, camping spots, dog groomers, 
whatever that my girlfriend and I check out.  Was that Indian restaurant in 
Baltimore any good?  Was it the one on Charles Street or down near Lexington 
Market that was the good one with the all-you-can-eat curry at lunch on 
weekends?  (*shiver* scary hah)

So when I get un-lazy and stop playing World of Warcraft long enough to do some 
PHP projects.. is this something anyone would find useful?  I'd like to open it 
up so just about anyone can create a category and add properties to the item 
being rated.  Probably have to approve items so it doesn't get crazy, but still 
might be cool.

Ok... off to stare at the pirate llama for a bit so I don't have to do real 
work.

-TG

= = = Original message = = =

[snip]
They are all variants of that. All nifty little tools. We should gather
those up someplace...shouldn't we?

In similar light, what development environments do you people program 
in? How do you run and test your code?

tedd

PS: This is my first posting to this group.
[/snip]

Welcome to the insanity.

I use Eclipse. For testing I have a test server where all of the code gets
hammered using a combination of automated and live user units. I am in a
microsoft shop, but have migrated web app servers to Apache (save for one
that I just cannot get rid of yet due to legacy ASP).


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



RE: [PHP] nifty little tools - resposity - evaluations..

2005-12-30 Thread Jay Blanchard
[snip]
A buncha' top posted stuff
[/snip]


I like the ideaand the llama.

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



RE: [PHP] nifty little tools

2005-12-30 Thread tedd

Welcome to the insanity.


Thanks -- been there for a while.


your question has been asked before - you might find the list archives
gives you more insight into other peoples work envs.


Yep, you're right.

http://news.php.net/php.general

I probably should have looked there first. Sorry.

Pardon me for being a novice about this, but besides Google, is there 
a way to search the archives? Over 200k of postings is a lot to look 
through.


tedd
--

http://sperling.com/

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



Re: [PHP] nifty little tools

2005-12-30 Thread John Nichel

tedd wrote:

Welcome to the insanity.



Thanks -- been there for a while.


your question has been asked before - you might find the list archives
gives you more insight into other peoples work envs.



Yep, you're right.

http://news.php.net/php.general

I probably should have looked there first. Sorry.

Pardon me for being a novice about this, but besides Google, is there a 
way to search the archives? Over 200k of postings is a lot to look through.


tedd


http://marc.theaimsgroup.com/?l=php-generalr=1w=2

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Re: php / JS / DOM question

2005-12-30 Thread Robert Cummings
On Fri, 2005-12-30 at 07:45, Jochem Maas wrote:
 Al wrote:
  jonathan wrote:
  
  I know that this is more of a Javascript / DOM question but I cannot  
  for the life of me figure this out:
 
  I have this form:
 
  form name=query_form
  input type=text name=q/input
  input type=button onclick=drawImg('A',document.forms 
  ['query_form'].elements['q']); value=Search/input
  /form
 
 get firefox and learn to use the javascript console, the DOM inspector and
 the javascript debugger in that order - in this case the DOM inspector
 would have been your biggest friend as it would have shown you 'correct'
 name for the element (object) whose value you were trying to grab - in general
 the DOM inspector is very handy for learning more about the structure
 and the content of the DOM.

Just a comment on Firefox, I've been doing a lot of Javascript lately
(I'm working on a sub windowing library and I must say firefox/mozilla
are render pigs. I attach more than 3 on move listeners to move with the
dragged pane and firefox becomes choppy crap soup. Opera and even
Internet Exploder can easily handle 50, and show a bit of lag when I
increase to 100 listener objects. Opera owns for speed though.

For debugging I use a custom data browser service that works in the 3
main browsers which has the nice advantage of seeing all the lovely
different field names that each browser uses *lol*.

http://www.interjinn.com/jinnDocJavaScript/interJinnJavaScript.class.JinnDataBrowser.phtml

And similar for debug echos:

http://www.interjinn.com/jinnDocJavaScript/interJinnJavaScript.class.JinnOutputDebugger.phtml

I just wish all these damn browsers would work the same way for DHTML :(

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] connecting to oracle 9i

2005-12-30 Thread Sue Errico
I am running php 5.0
apache 2.0
oracle 9i on a windows platform
 
receiving the following error:
 
Fatal error: Call to undefined function oci_connect() in C:\Program 
Files\Apache Group\Apache2\htdocs\Sue\testoci.php on line 3

I edited the php.ini
I uncommenting the extension=php_oci8.dll (removed ;)
and changed the 
extension_dir = C:/php/ext
 
I stopped and stopped apache and it still get the same error
can you please help or direct me to someone that can?
Thanks!
Happy New Year!



Re: [PHP] Strange Right-Shift Problem

2005-12-30 Thread Richard Lynch
On Thu, December 29, 2005 5:37 pm, Michael Gross wrote:
 Hello
 I have to migrate a PHP-application to a new Linux-Box. Both the old
 and
 the new system are Linux and PHP 5.1.1. (the old one has a Pentium 4,
 the new one two Xeon CPUs). I have a problem using the
 Crypt_Xtea-Extension. I narrowed it down to the following right-shift
 operation:

 (-3281063054  11) produces different results:
 Old System: 495070
 New System: -1048576

 I understand that both results are wrong, but everything worked with
 the old behavior and I need that behavior back very urgent.

 Maybe someone can explain me in which way the bits are shifted so that
 the result is 495070? If I understand it, I implement my own shift
 function.

Assuming the previous hypothesis that it's 32-bit versus 64-bit
machines at work...

If you can determine the number of bits on your system, you could use
a different number from 11 on the two systems to get the answer you
want.

if (is_32_bit_machine()){
  $y = $x  11;
}
else{
  $y = $x  43; //11 + 32 (guess)
}

One hack for detecting 32-bit machine might be this:

function is_32_bit_machine(){
  return mt_getrandmax() == 0x;
}

I suppose if you're going to do this right, what you REALLY should do
is code it to determine the number of bits, no matter how large, and
then bit-shift the correct amount based on that.

So when the 128-bit machines come out in a few years, you aren't
re-coding this same damn problem AGAIN.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] connecting to oracle 9i

2005-12-30 Thread Richard Lynch
First, use ?php phpinfo()? to determine several things:

Where does PHP think your php.ini file should be?
Move your php.ini file there, and then change it.
Changes to other php.ini files in other places is pointless.
There is a new-fangled Apache directive to tell PHP where to find
php.ini, but it's easier to just move the darn thing.

After you re-start Apache (again) does ?php phpinfo();? show that
Oracle is available?  It will either be listed in that page, or it
ain't there.
Until Oracle is listed as installed, oci_connect() will remain undefined.

Check the 'extensions_directory' in php.ini to be sure it's right.


On Fri, December 30, 2005 12:16 pm, Sue Errico wrote:
 I am running php 5.0
 apache 2.0
 oracle 9i on a windows platform

 receiving the following error:

 Fatal error: Call to undefined function oci_connect() in C:\Program
 Files\Apache Group\Apache2\htdocs\Sue\testoci.php on line 3

 I edited the php.ini
 I uncommenting the extension=php_oci8.dll (removed ;)
 and changed the
 extension_dir = C:/php/ext

 I stopped and stopped apache and it still get the same error
 can you please help or direct me to someone that can?
 Thanks!
 Happy New Year!




-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Which is faster, a MySQL access, or a set of PHP variables?

2005-12-30 Thread Richard Lynch
On Fri, December 30, 2005 8:32 am, Dave M G wrote:
   I wondered if there was any downside to storing the list of interface
 texts in a MySQL database, then calling them as an array when the page
 loads?

If you are already connecting to the database, then you are comparing
an extra query or two to loading a file from the hard drive and the
database wins on performance.

Unless you are already loading some file where it would be convenient
to stick the text, and then the variables win.

Actually, this all depends on your hardware and database/drive
performance setup...

There really is NOT a good answer to this question from a
performance stand-point.

But then it's not a good question, really, unless you REALLY expect
your site to get a ton of traffic, because the performance of the
machine will probably not be a big factor in your success, compared to
maintainability of code, feature-set of the site, cool-ness and
prettiness and marketing and...  All of those will matter more to your
success than raw performance.

   This would have one minor advantage, which is that as I expand to new
 languages, I could build a simple web interface where people could
 input
 new languages into a form.

Something to consider:

Can you get data in other character sets into and out of your database
and web application?

If you plan to support 2-byte (or more) character sets, this is not
trivial at all -- or maybe it is, but you have to at least plan ahead
for it from the get-go.

   However, is it a drag on a server to have to reach into the MySQL
 database to retrieve the array of texts each time the page loads? Note
 that the texts will be something like 20 to 30 small one to four word
 phrases like contact and previous page and that sort of thing.

   On the surface, it doesn't seem like this would be much different
 than
 accessing a PHP script with a list of variables. But then, I figured
 there might be a reason why I've never seen it done this way.

Generally, on most projects, the people who are contributing the
translations of internal things like contact and previous page are
developers who are comfy with editing a text file, and putting them in
as text files with, say CVS or subversion, gives the developers
control over versioning etc.

That's not to say you COULDN'T do something similar with the database,
or run hourly dumps of (some) tables into CVS or something.

I don't think it's going to matter much which way you do this, so long
as you can plan ahead for all the character-encodings you will ever
need, and make sure you can handle them all.

Perhaps try it with a test phrase like Hello which you can probably
find in every language fairly easily.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] nifty little tools - resposity - evaluations..

2005-12-30 Thread tg-php
Haha.. well, with any luck, 10 years from now I'll have as much content.  hah 
(or even ANY code written)

= = = Original message = = =

I sort of had the same idea almost a decade ago...

http://l-i-e.com/compare/

You can see how well I've kept it up :-v

On Fri, December 30, 2005 10:33 am, [EMAIL PROTECTED] wrote:
 Wasn't this just brought up on another thread?  nifty little tools
 that is and a repository for such things.

 There are lots of code repositories but none that I go directly to
 right off.  Usually I hit Yahoo/Google and do a search for what I'm
 looking for and find whatever looks best for my situation.  That way,
 in theory, I find some of the newest/freshest ideas and techniques.
 Not always the best, but it's usually a starting place.

 tangent
 Since you asked..

 I use Zend Studio (http://www.zend.com) and Crimson Editor
 (http://www.crimsoneditor.com)... if not just
 Notepad/vi/other-generic-text-editor-native-to-OS.  My workmate uses
 Komodo (http://www.activestate.com/Products/Komodo/).
 /tangent

 I've found that people ask these kinds of questions over and over
 again..  and there are so many great websites out there with great
 code snippets or information in general.  And never a lack of people
 who give opinions on what their favorite is... be it framework, php
 editor, or favorite brand of shiraz.


 So a little while ago I registered userrated.com  (nothing there now
 but an image cropping test script done in PHP...with an awesome pic of
 a pirate llama... you heard me!).

 Anyway, my idea for this site is to create a review site for such
 things like PHP editors or even someone's favorite wine, restaurent,
 flea market, whatever.  So when someone on the PHP list asks about
 flea markets...err... editors..  You can say Go to userrated.com and
 hit the PHP section.

 The idea would be to enter just about anything and have properties
 associated with the item that can be itemized or just rated.

 PHP Editors:
   Version [free entry]
   OS's supported [list]
   Ease of Use [1-5]
   IDE? [Y/N/Partial?]
   Debugger? [Y/N/Partial?]
   Stability [1-5]
   Overall impression [1-5]

 Wine:
   Type [free entry or checkbox?]
   Origin [free entry]
   Dry-Sweet [1-5]
   Year
   Vineyard
   Color
   Whatever-else-wine-snobs-judge-by  :)

 And the other thing I'd like to do with it is be able to show all
 ratings/reviews/comments or filter by date range because sometimes
 things become outdated or obsolete or were great a year ago and now
 aren't supported anymore.  So if you showed all dates it may say
 Average rating 7.5 but if you showed the 100 ratings giving in the
 last 2 months, it may drop to 4.0.

 Just throwing this out there in case anyone has any thoughts or
 comments or hell.. maybe a site already exists that does all this.

 Two things inspired this idea...  (1) the constant weekly What PHP
 editor do you use?  What's the best? questions (hah) and (2) my lack
 of ability to remember all the odd restaurants, wines, beers, camping
 spots, dog groomers, whatever that my girlfriend and I check out.  Was
 that Indian restaurant in Baltimore any good?  Was it the one on
 Charles Street or down near Lexington Market that was the good one
 with the all-you-can-eat curry at lunch on weekends?  (*shiver* scary
 hah)

 So when I get un-lazy and stop playing World of Warcraft long enough
 to do some PHP projects.. is this something anyone would find useful?
 I'd like to open it up so just about anyone can create a category and
 add properties to the item being rated.  Probably have to approve
 items so it doesn't get crazy, but still might be cool.

 Ok... off to stare at the pirate llama for a bit so I don't have to do
 real work.

 -TG

 = = = Original message = = =

 [snip]
They are all variants of that. All nifty little tools. We should
 gather
those up someplace...shouldn't we?

 In similar light, what development environments do you people program
 in? How do you run and test your code?

 tedd

 PS: This is my first posting to this group.
 [/snip]

 Welcome to the insanity.

 I use Eclipse. For testing I have a test server where all of the code
 gets
 hammered using a combination of automated and live user units. I am in
 a
 microsoft shop, but have migrated web app servers to Apache (save for
 one
 that I just cannot get rid of yet due to legacy ASP).


 ___
 Sent by ePrompter, the premier email notification software.
 Free download at http://www.ePrompter.com.

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




___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] interfaces - your opinion

2005-12-30 Thread Richard Lynch
On Thu, December 29, 2005 10:31 am, Jochem Maas wrote:
 anyone here work with Interfaces? I do and I like them alot;

 I recently ran into a situation where it would be nice to be able to
 specify
 that a given interface is only allowed to be implemented by a certain
 class (and all subclasses thereof) - Anyone have an idea as to how
 to implement such a restraint in a clean way? does anyone think that
 this
 is generally useful?

 maybe it's something that should not be done at all.
 maybe the implementation belongs in the engine (with some new syntax)
 e.g:

   class MyClass {}
   class MySubClass extends MyClass {}
   class MyOtherClass {}
   class SomebodyElsesClass {}

   interface MyIface validfor MyClass, MyOtherClass
   {
   abstract function blabla();
   }

   // SomebodyElsesClass would not be able to implement MyIface


 interested to know if anyone has an opinion on this.

I don't use Interfaces and all that stuff, but...

Seems to me that every explanation I've ever heard for using
Interfaces in the first place was to provide an abstract definition of
what a class was supposed to implement, and that any class that
implemented the required functionality should, in some theoretical
la-la land, be a suitable replacement for any other class.

Seems to me that if you restrict the implementation to a specific
branch of classes, you're kinda defeating the whole purpose of an
Interface, based on my rudimentary understanding of what an Interface
is supposed to be.

I'm sure it makes perfect sense in the context you need, but...

Makes me think maybe an Interface isn't what you ought to be using in
the first place...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] unable to load perl extension

2005-12-30 Thread Richard Lynch
On Thu, December 29, 2005 9:17 am, dev lamp wrote:
 I am unable to call perl code from PHP, since the extension does not
 get loaded !

 Scenario 1:
 use dl('perl.so'); in the php code and invoke the script from the
 command line
 The script works fine and the perl code gets executed as well.

 Scenario 2:
 the perl extension does not get loaded and the PHP script crashes.

Define crashes...

Does it literally crash the PHP/Apache process, or does it just print
out Not loaded?

Either way, crank up your error settings to E_ALL and check your
Apache error log to find out *WHY* it's not getting loaded.

Could you live with:
?php
  exec(/usr/local/bin/perl script.pl, $output, $error);
  $output = implode(br /\n, $output);
  if ($error) die(OS Error: $errorbr /\n$output);
  echo $output; //probably do something more interesting here
?

 I have read the article
 http://www.zend.com/php5/articles/php5-perl.php

 If anybody has faced this issue, please share how you solved the
 problem ?

 Thanks in advance.
 
 Here are the environment Details:
 RHEL 4.0
 PHP 5.0.5 (self compiled)
 PECL/PERL package checked out from CVS

 PHP 5.0.5 compilation details
 ---
 ./configure  --with-apxs2=/usr/local/apache2/bin/apxs
 --with-mysql=/usr/bin/mysql_config
 --with-mysqli=/usr/bin/mysql_config --with-openssl-dir=/usr/local/ssl
 --with-libxml-dir=/usr/lib --enable-soap --enable-sockets
 --enable-sqlite-utf8  --enable-wddx --with-gnu-ld  --with-gd
 --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib
 --with-zlib-dir=/usr/local/lib --with-gd=/usr/local
 --enable-gd-native-ttf --enable-maintainer-zts  --with-pear
 make
 make install


 pecl/perl package compilation details
 -
 export PHP_PREFIX=/usr/local
 export PERL_PREFIX=/usr
 echo $PHP_PREFIX
 echo $PERL_PREFIX
 $PHP_PREFIX/bin/phpize
 ./configure --with-perl=$PERL_PREFIX
 --with-php-config=$PHP_PREFIX/bin/php-config
 make
 make install

 entries in php.ini file
 --

 extension_dir = /usr/local/lib/php/extensions/no-debug-zts-20041030/
 extension=perl.so


 sample test code is as follows -
 ?php
 if (!extension_loaded('perl'))
 {
print perl extension not loaded;
exit;
 }
 ?

 --
 Dev.

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




-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] XML-RPC problem with long running times

2005-12-30 Thread Richard Lynch
If you can't get at the PHP internal time-out...

First, file a bug report Feature Request and ask for it to be
exposed.  You won't be the only one who needs it.

Second, for the short term, you may be stuck with rolling your own
XMLRPC interface, or using one of the others out there as raw PHP
that will perhaps give you more control of stream time limits.

You MIGHT be able to dig through PHP source and alter the time-out and
re-compile...  But remembering to do that on an upgrade would be a
PITA.

On Thu, December 29, 2005 8:58 am, Andreas Schlicker wrote:
 Of course, fflusch($log); should be fflush($log);

 I just found out that $xmlResponse really is empty.
 However, connection_status() returns 0, so I assume that the script is
 not interrupted by a timeout.

 Why does xmlrpc_server_call_method($xmlServer, $xmlRequest, NULL)
 return
 nothing if the call takes longer than 5 minutes and there is no
 interrupt? Is there some special XMLRPC timeout?

 Any idea?

 Andreas


 Andreas Schlicker schrieb:
 Hi all,

 I'm using Apache/1.3.33 (Unix), PHP/5.0.3, mod_ssl/2.8.22,
 OpenSSL/0.9.6a.

 I wrote a dummy script that is called by a Java program via XML-RPC,
 waits for some time and replies the start and end times.

 ?php
 set_time_limit(500);
 $xmlServer = xmlrpc_server_create();

 function process() {
 $result = ini_get('max_execution_time') . \n;
 $result = $result . date(H:i:s) . \n;
 sleep(0);
 $result = $result . date(H:i:s) . \n;
 return $result;
 }

 xmlrpc_server_register_method($xmlServer, 'process', 'process');
 $xmlRequest = $HTTP_RAW_POST_DATA;
 $xmlResponse = xmlrpc_server_call_method($xmlServer, $xmlRequest,
 NULL);

 #$log = fopen($filename, 'a');
 #fwrite($log, $xmlResponse);
 #fflusch($log);
 #fclose($log);

 echo $xmlResponse;
 xmlrpc_server_destroy($xmlServer);
 ?

 If the script sleeps for up to 5 minutes, it works perfectly fine.
 However, I my real application will run probably an hour or so. If
 the
 script takes more than 5 minutes to execute, the client receives an
 empty response, even the header is missing. If I try to write the
 $xmlResponse to a file, the client receives a null message.

 I wrote a small script without XMLRPC that acted the same way when
 called by a browser. This worked perfectly (I tested it up to 20
 minutes
 waiting time) even if I used set_time_limit(5) and sleep(500).

 Does anybody have an idea how to solve this problem? Thanks in
 advance.

 Andreas


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




-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] what is the problem with this query?

2005-12-30 Thread Richard Lynch
On Thu, December 29, 2005 7:26 am, sunaram patir wrote:
 could you please tell me what is the problem with this query
 mysql_query(SELECT * FROM mailbox WHERE read='');

Nope.

Because on the face of it, there is NOTHING wrong with the query
written above, per se.

   i always get this warning:
   Warning: mysql_num_rows(): supplied argument is not a valid MySQL
 result resource in index.php on line 24

While *I* can't tell you what is wrong, and nobody on this entire list
could tell you what is wrong, MySQL and PHP are just BEGGING to tell
you what's wrong:

$result = mysql_query($query) or die(mysql_error());
http://php.net/mysql_error

Actually, there *IS* one obvious thing wrong with the query:
You used SELECT *  and that is a horrible horrible habit to get into.
Don't do it.
Name the columns you actually want.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] XML Reader

2005-12-30 Thread Richard Lynch
On Thu, December 29, 2005 12:40 am, [EMAIL PROTECTED] wrote:
 Is there any easy php script to run to view an xml file such as new
 headlines like so:  http://news.google.com/?output=rss or can anyone
 point
 me in the right direction for good online tutorials or books.

If you mean to just READ the XML, do this:
?php
  $xml = file_get_contents(http://news.google.com/?output=rss;) or
die(Unable to read Google RSS at this time. Please try again
later.);
?

If you need to get just the headlines, you could do:
?php
  preg_match_all(/title([^]*)\\/title/sU, $xml, $headlines);
  var_dump($headlines[1]);
?

You could do similar work to get any of the content you wanted from
the XML.

Or you could use Google to search for PHP RSS parser and find
innumerable solutions.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Variables and Strings

2005-12-30 Thread Richard Lynch
On Thu, December 29, 2005 3:31 pm, PHP Superman wrote:
 Thanks for the responses guys, but what i'm saying is i would like to
 return
 all the variable names i have in a string,
 $String=Blah Blah Blah $VarName Blah Blah Blah;

$VarName = 'xyz';
$String now has Blah Blah Blah xyz Blah Blah Blah in it.

There is *NOTHING* left to indicate that xyz came from a variable.

You simply do not have the context available to do what you want.

Now, you *COULD* do like this:

$VarName = 'xyz';
$Template = 'Blah Blah Blah $VarName Blah Blah Blah';

Note the use of single quotes that does NOT interpret variables.

You now have a $Template from which, with luck, you could:
A) compose $String using:
eval('$String = $Template;');

B) use something not unlike this:
preg_match_all('/\\$([a-z0-9_]+/sU', $Template, $variables);
foreach($variables[1] as $varname){
  echo $varname = , $$varname;
}

I'll warn you right now that whatever it is you are doing, there is
PROBABLY a better easier way to do it, but you've put on blinders to
other solutions and only asked us how to do what you think you want to
do, which is probably not what you really want to do...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Location ....

2005-12-30 Thread Richard Lynch
On Wed, December 28, 2005 8:15 am, Christian Ista wrote:
 PHP? I tried this code : header(Location: mypage.php);

 But in some case, I have error message headers already sent. Then I

You know the old saying, You can't step in the same stream twice?

Think about it.

Really think about it.

Now...

The data being sent to the browser from Apache/PHP is a stream.

Its raw output looks something like this:

---
HTTP/1.1 200 OK
Date: Fri, 30 Dec 2005 19:52:44 GMT
Server: Apache/1.3.34 (Unix) DAV/1.0.3 PHP/4.4.1 mod_ssl/2.8.25
OpenSSL/0.9.7d-p1
X-Powered-By: PHP/4.4.1
Connection: close
Content-Type: text/html

HTML
HEAD
TITLELynch Interplanetary Enterprises/TITLE
/HEAD
.
.
.
/HTML
---
Now, pay VERY close attention to that blank line right after the
Content-type: text/html
line.

That BLANK line marks the end of the headers

Everything above the blank line is in the headers
Everything below is the body of the HTTP, which is what the browser
shows you with View Source

Now, imagine all that output, headers and blank line and body,
streaming out from your server, like water from a garden hose.

There's a lot you can do to it before the water gets shot out the end
of the nozzle.

You could add a water heater and treat your lawn to a warm shower
instead of cold.

You could add a filtration system and give your lawn distilled water.

You could add a plant food system to give it yummy chemicals.

Buut

Once that water leaves the host, you don't have a lot of control over it.

It's gone.

Beyond re-calling.

In the same way, once PHP sends the BLANK LINE to denote the end of
headers, you can't send more headers.

This works:

---
HTTP/1.1 200 OK
Date: Fri, 30 Dec 2005 19:52:44 GMT
Server: Apache/1.3.34 (Unix) DAV/1.0.3 PHP/4.4.1 mod_ssl/2.8.25
OpenSSL/0.9.7d-p1
X-Powered-By: PHP/4.4.1
Connection: close
Content-Type: text/html
Location: mypage.php

HTML
HEAD
TITLELynch Interplanetary Enterprises/TITLE
/HEAD
.
.
.
/HTML
---

This can NOT work:

---
HTTP/1.1 200 OK
Date: Fri, 30 Dec 2005 19:52:44 GMT
Server: Apache/1.3.34 (Unix) DAV/1.0.3 PHP/4.4.1 mod_ssl/2.8.25
OpenSSL/0.9.7d-p1
X-Powered-By: PHP/4.4.1
Connection: close
Content-Type: text/html

HTML
Location: mypage.php
HEAD
TITLELynch Interplanetary Enterprises/TITLE
/HEAD
.
.
.
/HTML
---

Look carefully for the position of the line
Location: mypage.php

See the difference?

If you try to call the header() function AFTER some content has been
sent, then you get the error message.

Move the header() line earlier in your PHP code, and it will work fine.

PS
Blank lines and spaces COUNT as output.

So this:
?php $x = 1; ? ?php header(Location: mypage.php);?
will NOT work because that space counts

This will work:
?php $x = 1; ??php header(Location: mypage.php);?

Similarly, watch out for BLANK LINES after the last ? in your files.

They will trip you up for header()

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Location ....

2005-12-30 Thread Robert Cummings
On Fri, 2005-12-30 at 15:04, Richard Lynch wrote:
 On Wed, December 28, 2005 8:15 am, Christian Ista wrote:
  PHP? I tried this code : header(Location: mypage.php);


*LOL* That was one of the best write-ups I've ever read concerning the
headers already sent error message.

 Similarly, watch out for BLANK LINES after the last ? in your files.
 
 They will trip you up for header()

Regarding that last ? in scripts, the PHP engine intentionally supports
it's omission so that you don't have to think about whether there's an
invisible trailing space after it.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] download not working

2005-12-30 Thread Richard Lynch
On Wed, December 28, 2005 6:10 am, Ross wrote:
 $query= SELECT * FROM publications WHERE alphabet='a';

  $result= mysql_query($query);
while  ($row = @mysql_fetch_array($result, MYSQL_ASSOC)){

 $row['pdf_size'] = $row['pdf_size']/ 1024;
  $row['pdf_size']= number_format($row['pdf_size'], 0);
  $size= $row['pdf_size'];
 $name = str_replace(_,  , $row['pdf_name']);
 $name = str_replace(.pdf, , $name);
 $link= $row['content'];

You are echo-ing out these lines whether $_GET['id'] isset or not.

Which means that your PDF isn't starting with:
%PDF3.1
.
.
.

 echo span class=\pdflinks\$name/span;
 echo nbsp;nbsp;;
 echo span class=\sizes\($size kb)/span;

Your PDF now looks like:
span class=pdflinksfoo/span
nbsp;nbsp;
span class=sizes(25 kb)/span
%PDF3.1
.
.
.


And that's a pretty corrupt PDF, eh?

For the future:

#1. Always use 'vi' or some kind of text editor to view your corrupt
files that PHP sends out.  Invariably you'll smack yourself in the
forehead and be back in business in minutes.

 ob_clean();
 header(Content-length: $pdf_size);
 header(Content-type: $pdf_type);

#2. You can also comment this out until you get it looking right,
rather than go through the process of downloading and opening and all
that.  You'll just see a lot of weird stuff in your browser, but
that's okay.

 header(Content-Disposition: attachment; filename=$pdf_name);

CHANGE THIS TO:

header(Content-type: application/octet-stream);

if you want this to work in ALL browsers.

The Content-Disposition stuff is johnny-come-lately made-up junk that
will NOT be reliable.

To force the filename to be what you want, just take on /$pdf_name
to the URL.

I've ranted enough about this before, so you should be able to find
more detail on how to make this really slick with ForceType and
URL-munging.

Search archives for:
Richard Lynch pathinfo.inc ForceType and it should come up.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] list a query

2005-12-30 Thread Richard Lynch
On Wed, December 28, 2005 5:53 am, Ross wrote:
 What does 'list' do in a php query?

'list' is kind of like an array de-constuctor.

?php
$example = array(1, 2, 3);
list($x, $y, $z) = $example;
echo x: $x y: $y z: $z\n\n;
?
x: 1 y: 2 z: 3

 $result = mysql_query($query) or die('Error, query failed');
 list($name, $type, $size, $content) = mysql_fetch_array($result);

$result is an array:

array('Ross', 'Hosting Company', 'Comfy', 'aztechost.com');

'list' is tearing that array apart into individual variables.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] SELECT?

2005-12-30 Thread Richard Lynch
On Wed, December 28, 2005 2:50 am, William Stokes wrote:
 I have one MySQL table with about 500 rows. I need to read the table
 one row
 at a
 time, make some changes to data in one field and then store the
 changed data
 to another table.

 I'm using PHP to change the data but I have no idea how to select one
 row at
 a time from the DB table. There's one auto-increment id field in the
 table
 but the id's doesn't start from 1 and are not sequential.

The suggestions so far are good, but watch out for this:

If you do one record at a time, and are using LIMIT, and then
something gets inserted into the original table...

Boom!

Ordering by the auto_increment will work to make sure the new rows
are at the end, but that's kind of icky to rely on in production code.

Your best bet probably is to just get all 500 records and process them
in one batch.

After that, adding a column to mark records done or not is good.

Relying solely on LIMIT and auto_increment is only okay for a quick
one-time hack you'll never need again...  And still kind of icky.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Storing serialized data to DB

2005-12-30 Thread Richard Lynch
On Tue, December 27, 2005 7:11 pm, Sumit Chachra wrote:
 Not very php specific so please pardon me if I am posting in the wrong
 forum.

 I have a chunk of data which I am trying to cache. I serialize this
 data
 using the serialize() function in php. I am wondering what would be a
 good
 attribute type in my DB to store such (potentially long) strings? Some
 types
 have 4000 character limits and hence I get JDBC exceptions. I am using
 Oracle DB.

My first answer would be:

Don't put it in the database.  Throw it in /tmp or a disk file
somewhere and put the file path into the database.

If you HAVE to put it in the database, then you'd better:
1. Determine the MAXIMUM size of the serialize($chunk) of data.
2. Double that.
3. Find a data type in your database that is BIGGER than that.
4. The only answer is probably a BLOB.

Internally, the database engine is most likely storing the BLOB as a
separate file anyway, and you're getting very very very little gain
out of putting it into the database.  See first answer. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Location ....

2005-12-30 Thread Richard Lynch
On Fri, December 30, 2005 2:16 pm, Robert Cummings wrote:
 Similarly, watch out for BLANK LINES after the last ? in your
 files.

 They will trip you up for header()

 Regarding that last ? in scripts, the PHP engine intentionally
 supports
 it's omission so that you don't have to think about whether there's an
 invisible trailing space after it.

I'm old.

In PHP 3.0, it would mess you up.

Particularly fun was the EMACS setting that automagically added a
newline for any text file you edited that didn't have one at the
end...

*THAT* sure caused a lot of fun on this list back in the day. :-)

Old habits die hard.

Plus, somewhere, I probably have a PHP 3.0 install still running on
some old box...  Not tied directly to the 'net nor in production, but
still... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] SELECT?

2005-12-30 Thread Paul Waring
On 12/30/05, Richard Lynch [EMAIL PROTECTED] wrote:
 The suggestions so far are good, but watch out for this:

 If you do one record at a time, and are using LIMIT, and then
 something gets inserted into the original table...

 Boom!

You could always lock the tables whilst performing the update - not
very useful if the database has to be up all the time but it's
probably the safest way of doing it.

Paul

--
Data Circle
http://datacircle.org

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



Re: [PHP] Varchar date to real date?

2005-12-30 Thread Richard Lynch
On Tue, December 27, 2005 8:01 am, William Stokes wrote:
 I have a DB that has dates stored in a table. The date field type is
 Varchar
 (don't ask why... :( The dates are stored using european date format
 DD.MM.. I need somehow convert the dates to the format MySQL uses
 (-MM-DD) and re-store them to a table which has a real date column
 for
 them.

alter table crappy add whatdate date;
update crappy set date = ws_cat('-', substring(eurodate,
7,4),substring(eurodate,3,2),substring(eurodate,1,2));

Once you have a REAL date column, date_format from
http://dev.mysql.com/ is your friend.

 If I can get this done how can I still display the dates in european
 format
 at my web page? Do I have to break the date to pieces and some how
 re-arrange it to the DD.MM. format or is the some clever function
 for
 this that can automatically do this?

select date_format(whatdate, '%d.%m.%Y') from nice_table;

Personally, it's given the *WORLD* wide web, I'd suggest letting the
visitor choose their date format, rather than forcing them to use the
format that happens to be in vogue in the country hosting the site...
:-)

Not that I've ever had time to do that, mind you, but it's what I'd
recommend :-) :-) :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Strange Right-Shift Problem

2005-12-30 Thread Michael Gross

Hello
Thanks for your answers. I now implemented everything new, with the 
mcrypt-extension. However, I use the crypt_xtea still for a 
compatibility mode. I had to implement the right-shift and other bit 
operations. If someone is interested:


The problem occurred always when a number exceeded the 32bit and is 
negative. The old behavior was to take 32bits and ignore the other bits 
(therefore the sign could change in the rshift-operation). The following 
simulates the old behavior:

  function getbits($i) {
  $bits = array();
  while (abs($i)  1) {
  $f1 = floor($i / 2.0);
  $f2 = ceil($i / 2.0);
  if ($f1!=$f2) {
  array_push($bits, 1);
  } else {
  array_push($bits, 0);
  }
  $i = $f1;
  }
  return $bits;
  }

  function convertto32($i) {
  $bits = getbits($i);
  $i = 0;
  if ($bits[ 0]) $i|=0x0001;
  if ($bits[ 1]) $i|=0x0002;
  
  if ($bits[31]) $i|=0x8000;
  return $i;
  }

  function rshift($i, $n) {
  if ($i  -2147483648) {
  $i = convertto32($i);
  }
  return $i  $n;
  }


thx
  Michael Gross



Richard Lynch wrote:

On Thu, December 29, 2005 5:37 pm, Michael Gross wrote:

Hello
I have to migrate a PHP-application to a new Linux-Box. Both the old
and
the new system are Linux and PHP 5.1.1. (the old one has a Pentium 4,
the new one two Xeon CPUs). I have a problem using the
Crypt_Xtea-Extension. I narrowed it down to the following right-shift
operation:

(-3281063054  11) produces different results:
Old System: 495070
New System: -1048576

I understand that both results are wrong, but everything worked with
the old behavior and I need that behavior back very urgent.

Maybe someone can explain me in which way the bits are shifted so that
the result is 495070? If I understand it, I implement my own shift
function.


Assuming the previous hypothesis that it's 32-bit versus 64-bit
machines at work...

If you can determine the number of bits on your system, you could use
a different number from 11 on the two systems to get the answer you
want.

if (is_32_bit_machine()){
  $y = $x  11;
}
else{
  $y = $x  43; //11 + 32 (guess)
}

One hack for detecting 32-bit machine might be this:

function is_32_bit_machine(){
  return mt_getrandmax() == 0x;
}

I suppose if you're going to do this right, what you REALLY should do
is code it to determine the number of bits, no matter how large, and
then bit-shift the correct amount based on that.

So when the 128-bit machines come out in a few years, you aren't
re-coding this same damn problem AGAIN.



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



Re: [PHP] php / mysql / js search result question

2005-12-30 Thread Richard Lynch
On Tue, December 27, 2005 2:03 am, Dave Carrera wrote:
 I have a very long list of customer names which i know is easy to get
 from a mysql result using php, no prob there.

How long is very long?...

 But what i would like to do is offer input box and when the user
 enters
 a letter, i think this will require client side onchange(), the full
 list, i think might be in an iframe, will move to the first instance
 of
 user input.

 Example:

 1 Alpha Customer
 2 Apple Customer
 3 Beta Customer
 4 Crazy customer
 5 Doppy customer

 User input is a so the list moves to first instance of a.  User
 continues to input ap so the list moves to 2 Apple Customer and so
 on.

*IF* your visitor is using a decent browser and OS, then that's
EXACTLY how this works:

select size=10
  optionAlpha Customer/option
  optionApple Customer/option
  .
  .
  .
/select

On crappy systems, only the FIRST letter they type counts.  So they
can jump to A but not to Ap for Apple.  Ugh.

But you should not be dumping a VERY long list to the browser --
Anything more than a few hundred (and that's pushing it) should
probably not be in a list of choices.

I've got one such list with 2000 in it, but ONLY for an Intranet where
I know it's always high-bandwidth and trusted/trained users.

At any rate, this is all browser side, and so it has NOTHING to do
with PHP.

You'll need to research JavaScript and Flash choices to get on to the
browser side of things.

I've also had good luck with giving an 'a b c d e ... z' and paging
navigation for larger sets.  Up to a point.

At some point, you really do need to have a search input box and go
from there.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] any https / php gotchas ???

2005-12-30 Thread Richard Lynch
On Mon, December 26, 2005 1:42 am, Dave Carrera wrote:
 Are there any https / php gotchas to take into consideration for an
 app
 i am writing that will run within a https environment ???

 Thank you in advance for any advice or links regarding this question.

HTTPS can be considerably slower than HTTP.
Clearly divide your application pages into HTTPS and HTTP pages.

Then you need to be SURE all your links and FORM ACTION= into and out
of HTTPS do the right thing to minimize the time in HTTPS land.

Real Users (tm) get nervous earlier than they should about the little
lock icon in their browser not being locked.

For a shopping cart, put the whole thing into HTTPS, if you can, even
if you really don't need to from a security stand-point.  That goes
against the minimalization advice above, but...
Contact page, no HTTPS.  Shopping Cart, HTTPS.
You'll figure out the rest. :-)

Some (and in trying to sell things, some is too many no matter how
small some may be)...  Some will abandon the cart when they don't
see the locked icon.

Ugly garish logos of how secure your site is (ugh!) must also
impress users, for reasons beyond my ken, because I sure see a lot of
those.

Make a fake certificate and test and re-test on your development box
for all the HTTPS stuff.

You do NOT want to leave that as last-minute, even if it seems to be
working on the dev site, even though you have no actually HTTPS set
up.  It *will* bite you in the butt somehow if you don't actually run
HTTPS and work with it.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] XSLT doesn't work anymore

2005-12-30 Thread Tobi Reif
Hi

Can anyone help me with this issue?

http://marc.theaimsgroup.com/?l=php-generalm=113456345526736w=2

Tobi

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



Re: [PHP] Can the URL be controlled for more user-friendly readability?

2005-12-30 Thread Richard Lynch
On Fri, December 23, 2005 10:43 pm, Dave M G wrote:
   I have a PHP/MySQL web site where there are profiles for performers
 at
 a comedy show.

Cool!

Every entertainment venue should do this.

 The profiles are accessed by passing a variable to the
 PHP script via URL, which can then look up the right performer data in
 the database.
   The resulting URL looks like this:
   http://www.tokyocomedy.com/people.php?person=6
   However, having ?person=6 in the URL is not only ugly, but it makes
 it hard for people to remember URLs and for the performers to use them
 when sending out information about themselves.
   It would be much nicer to have the url look more like this:
   http://www.tokyocomedy.com/firstname-lastname
   Or something like that.

You mean like this?
http://uncommonground.com/artist_profile/Ellen+Rosner
:-)

#1:
Re-name your script from people.php to just people

In your example, if you actually want the HOMEPAGE to be the
people.php script, you can skip this step, so long as your homepage
is a PHP script.
(IE, it's index.php not index.htm, or your server is configured to
pass .htm files through PHP)

#2:
Force the web server to treat people as a PHP script even though it
doesn't end in .php
Open up .htaccess on the server (or create one) and add this:
Files people
  ForceType application/x-httpd-php
Files

Also skip this step if you want your HOMEPAGE to be your people page
-- or use it to force index.htm to be PHP script if it's not
already:
Files index.htm
  ForceType application/x-httpd-php
/Files

#3:
I was going to type a lot of PHP stuff here...
I'll just show my source code and comment on it:
http://uncommonground.com/artist_profile.phps

The 'require' lines connect to the database and define some functions
you can ignore, so forget those.

$search_key = $_SERVER['PATH_INFO'];

This is the crucial Magic Line that gives you the data:
/Dave+Martin

Only sometimes it's:
/artist_id/42
as you'll see if you click through some of the links to other artists
on the site.
See the list of performance dates at the bottom of the page here:
http://uncommonground.com/artist_profile/Ellen+Rosner
[More on this artist_id/42 later.]

I first strip off the / in front to get:
Dave+Martin

Or maybe it's:
artist_id/42

Use urldecode() to change Dave+Martin into Dave Martin

Next, I check to see if I have an artist_id or if I want to look up
the name:
if (stristr($search_key, 'artist_id')){

Then I either use the artist_id I was handed (as your script does
right now) or I look up the name.

If you do this on your HOMEPAGE, you'd want something like:

if (stristr($search_key, 'artist_id')){
  //We KNOW who the artist is, look them up by ID
}
elseif (strlen($search_key)){
  //There was an artist name in PATH_INFO
  //Search the database for that name
}
else{
  //There was NOTHING in PATH_INFO, so dump out the actual HOMEPAGE
  ?
  htmlheadTokyo Comedy/headbodyWelcome to Tokyo
Comedy!/body/html
  ?php
}
only a lot more code in there :-)

Inside the strlen($search_key) branch...
If more than one name matches, dump out all the names for the user to
pick one.  Example:
http://uncommonground.com/artist_profile/Ellen

Then they'll click on the link, and you'll have the exact artist_id
you want.

After that, it's all just a bunch of SQL and PHP to dump out what I
want about the artist.

Which in my case has gotten pretty extensive and built-up over the
past several years, so it's a BUNCH of SQL and PHP, but there it is.

Here are the table names and what they are to help explain what the
queries are doing:

entities: core artist info: name, url, email, bio, etc
samples: headshots and thumbnails
cache_list: MP3s of previous performances here at our venue
cdbaby: CDBaby albumcode for CDs of this artist at http://cdbaby.com
events: performance date calendar

If anything is at all unclear, feel free to ask!

The rest of this post is just wacky ideas of things I do, that you
might want to consider doing, with your system after you get it
working.

Or maybe they'll inspire you to other better ideas -- Or at least more
appropriate for a Comedy Club.  (We're acoustic music with very very
very rare comedy acts.)

You should probably stop reading and start coding the basic simplest
page you can now, and then stop and re-read from here forward to start
dreaming up your own stuff to do...

We allow artists to log in and input their own Bios and upload Photos
(as many as they want) and Thumbnails and...

So I don't put in any of this stuff for the Artist Profile.  With
2000+ artists, and an average of 3 acts per night, every night,
there's NO WAY I'd have time to maintain all this data.

Total self-service on these pages.

If you need to see the artist login/backend in action, I can hook you
up with an artist account and a gig in, oh, 2038 so you'll see it in
action.

Artists also put in their zipcode which gives me the GPS data to list
artists from regions to cross-promote artists with each 

Re: [PHP] any https / php gotchas ???

2005-12-30 Thread Colin Ross
this all depends on the web server (IIS/Apache) being used...

On 12/26/05, Curt Zirzow [EMAIL PROTECTED] wrote:

 On Mon, Dec 26, 2005 at 07:42:48AM +, Dave Carrera wrote:
  Hi List,
 
  Are there any https / php gotchas to take into consideration for an app
  i am writing that will run within a https environment ???

 I'm not sure what kind of 'gotchas' your are worried about, but
 well php doesn't really care wether you are using http or https.

 There is one thing to note: if you are trying to detect in php
 wether or not the request was from https or not, the result of what
 is in $_SERVER['HTTPS'], depends on the webserver, the possible
 values:

   if accessed via https:
 on, On, ON

   if accessed via http:
 !isset(), Off, OFF


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

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




[PHP] Reading body of page being recieved by another php page

2005-12-30 Thread Jamie Kemp
I have data being sent to another php page containing xml styled data. Is it 
possible to read that data into the script? I have looked into the the 
globals set but cannot see anything like waht im looking for.

Does anyone have any ideas?

Thanks

Jamie 

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



Re: [PHP] Reading body of page being recieved by another php page

2005-12-30 Thread Zareef Ahmed
Hi,

How you are sending the data to that script? It must be availble in $_POST,
$_GET, or $_REQUEST, depends how you are sending it.


Zareef Ahmed

- Original Message - 
From: Jamie Kemp [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Friday, December 30, 2005 8:57 PM
Subject: [PHP] Reading body of page being recieved by another php page


 I have data being sent to another php page containing xml styled data. Is
it
 possible to read that data into the script? I have looked into the the
 globals set but cannot see anything like waht im looking for.

 Does anyone have any ideas?

 Thanks

 Jamie



PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]


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




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



[PHP] Managing upload files in multiple servers(pawns)

2005-12-30 Thread Srinadh Sannidhanam
Hi All,

We have a site in php and two web servers(pawns) to balance the load.
There is a page in the site through which user can upload images.

When a user uploads an image, the request goes to only one of the two
servers.
So the image will be uploaded to only one server.

How can we copy that image to other server? Do we need to transfer the image
using scp or is there any easy way?

I am afraid of getting the request to the other server for that image before
I copy it?

What steps do we need to take to avoid inconsistancies (if any) would be
caused by this kind of a system?

Please advice.


--srinadh


Re: [PHP] how to create a php5 extensions on C/C++, reflecting php Class Api's ?

2005-12-30 Thread Edwin Barrios
Hello Gustavo. !

Thanks for  your suggestion, that  book it's  a interesting material to
learn more advanced features of PHP5 and to begin on the C extentions world.

The chapter 15 only take a look to extends PHP5 funtions, but there is none
section on how to create a PHP5 Class on the C extentions.

Do you know how to do that ?






On 12/27/05, Gustavo Narea [EMAIL PROTECTED] wrote:

 Hello, Edwin.



 I think that in chapter #15 of PHP 5 Power Programming you're going to
 find what you are looking for.

 Saludos!

 --
 Gustavo Narea.
 PHP Documentation - Spanish Translation Team.
 Valencia, Venezuela.

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