Re: [PHP] Files and permission

2006-04-26 Thread Robert Cummings
On Thu, 2006-04-27 at 00:18, Peter Lauri wrote:
> Best group member,
> 
>  
> 
> I am creating a file system class. I will have a web based document center
> with different access roles. All users in the system will not be able to
> view the files. It will all be run thru the web tool.
> 
>  
> 
> I will have a class that is called file. That file can give an authorized
> user access to a specific file. What I do not want to do is to show them the
> location of the file. And if they some how finds out the location of the
> file, I do not want them to be able to type
> http://www.domain.com/files/important.doc and download the file. 
> 
>  
> 
> Should I put the files outside of the web file system (outside of httpdocs)
> so that they can not get the file thru the web browser?
> 
>  
> 
> Or should I save the docs in a database instead and control the access thru
> that?
> 
>  
> 
> Is there anyone with comments? Is it anyone with experience about this?

Put them outside web folder, if that's not possible place a .htaccess
lock on their directory. When a file is requested, make the request pass
through a script that can validate access and then use readfile() to
output it directly to the user's browser. You should set appropriate
headers for the file to let the user's browser know how to save it. That
information can be kept in the database table, while you keep the file
on the filesystem where it belongs :)

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] Files and permission

2006-04-26 Thread Peter Lauri
Best group member,

 

I am creating a file system class. I will have a web based document center
with different access roles. All users in the system will not be able to
view the files. It will all be run thru the web tool.

 

I will have a class that is called file. That file can give an authorized
user access to a specific file. What I do not want to do is to show them the
location of the file. And if they some how finds out the location of the
file, I do not want them to be able to type
http://www.domain.com/files/important.doc and download the file. 

 

Should I put the files outside of the web file system (outside of httpdocs)
so that they can not get the file thru the web browser?

 

Or should I save the docs in a database instead and control the access thru
that?

 

Is there anyone with comments? Is it anyone with experience about this?

 

Best regards,

Peter Lauri

 

 

 



Re: [PHP] PHP 4.3.11, call_user_func and instances of classes

2006-04-26 Thread Martin Alterisio
The problem is not what it seems. PHP4 assigns object by copy, not by
reference. This is causing the call_user_func() to use a copy of the object
instead of the original object. So, all modifications are lost once the call
is done. One solution to this is to assign objects by reference:

$addition = array (&$this, 'AddOne');
$subtraction = array (&$this, 'SubtractOne');

2006/4/26, David Otton <[EMAIL PROTECTED]>:
>
> A bit of an oddity, this. There's some example code attached which
> illustrates my problem.
>
> I am attempting to call a method of an instance of an class from
> outside that instance, using call_user_func().
>
> What's happening is that my attempt to call
>
> array ($this, 'AddOne')
>
> is silently being rewritten into a call to
>
> array ('Test', 'Addone')
>
> in other words, instead of calling $test->AddOne I'm calling
> Test::Addone. Thus, my expected output:
>
> Add:1,Add:2,Add:3,Subtract:2,Subtract:1,Subtract:0,
>
> becomes
>
> Add:1,Add:1,Add:1,Subtract:-1,Subtract:-1,Subtract:-1,
>
> So, my question is twofold:
>
> a) How can I accomplish this?
>
> b) Why is PHP silently modifying my code to mean something I didn't
> write, rather than throwing up an error?
>
>  $addition = $subtraction = null;
>
> class Test {
> var $x;
> function Test ()
> {
> global $addition, $subtraction;
> $this->x = 0;
> $addition = array ($this, 'AddOne');
> $subtraction = array ($this, 'SubtractOne');
> doMath('+'); doMath('+'); doMath('+');
> doMath('-'); doMath('-'); doMath('-');
> }
> function AddOne ()
> {
> $this->x++;
> echo ("Add:".$this->x.",");
> }
> function SubtractOne ()
> {
> $this->x--;
> echo ("Subtract:".$this->x.",");
> }
> }
>
> function doMath($choice)
> {
> global $addition, $subtraction;
> switch ($choice)
> {
> case '+':
> call_user_func ($addition);
> break;
> case '-':
> call_user_func ($subtraction);
> break;
> }
> }
>
> $test = new Test();
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] PHP 4.3.11, call_user_func and instances of classes

2006-04-26 Thread David Otton
A bit of an oddity, this. There's some example code attached which
illustrates my problem.

I am attempting to call a method of an instance of an class from
outside that instance, using call_user_func().

What's happening is that my attempt to call

array ($this, 'AddOne')

is silently being rewritten into a call to

array ('Test', 'Addone')

in other words, instead of calling $test->AddOne I'm calling
Test::Addone. Thus, my expected output:

Add:1,Add:2,Add:3,Subtract:2,Subtract:1,Subtract:0,

becomes

Add:1,Add:1,Add:1,Subtract:-1,Subtract:-1,Subtract:-1,

So, my question is twofold:

a) How can I accomplish this?

b) Why is PHP silently modifying my code to mean something I didn't
write, rather than throwing up an error?

x = 0;
$addition = array ($this, 'AddOne');
$subtraction = array ($this, 'SubtractOne');
doMath('+'); doMath('+'); doMath('+');
doMath('-'); doMath('-'); doMath('-');
}
function AddOne ()
{
$this->x++;
echo ("Add:".$this->x.",");
}
function SubtractOne ()
{
$this->x--;
echo ("Subtract:".$this->x.",");
}
}

function doMath($choice)
{
global $addition, $subtraction;
switch ($choice)
{
case '+':
call_user_func ($addition);
break;
case '-':
call_user_func ($subtraction);
break;
}
}

$test = new Test();
?>

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



Re: [PHP] error message

2006-04-26 Thread Jason Barnett
Let's not open an error report just yet... there are already too many "bugs"
in the database!  A snippet of the relevant code would be nice though.

Perhaps your odbc_errormsg($conn) is being echo'd to stdout?  Or you are
using those fun Exception beasts?


On 4/26/06, chris smith <[EMAIL PROTECTED]> wrote:
>
> On 4/27/06, cybermalandro cybermalandro <[EMAIL PROTECTED]> wrote:
> > I have set in display_errors = off on my php.ini but I can still see
> ODBC
> > related error messages when I try to duplicate an ODBC error. Am I
> missing
> > something to turn this off?
>
> Can you produce a small test case? Maybe post a bug report:
> http://bugs.php.net
>
> --
> 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] Natural order of things.

2006-04-26 Thread Robert Cummings
On Wed, 2006-04-26 at 21:15, tedd wrote:
> >On Wed, 2006-04-26 at 16:57, Robert Cummings wrote:
> >>  On Wed, 2006-04-26 at 16:51, tedd wrote:
> >>  > Hi gang:
> >>  >
> >>  > I posted the following question to the MySQL list, but the only
> >>  > answer I received thus far was a php solution (it didn't work for
> >>  > what I wanted).
> >>  >
> >>  > As such, maybe if I post a MySQL question to the PHP group, then I'll
> >>  > receive a MySQL answer -- so here goes:
> >>  >
> >>  > I'm using the following query, and it works.
> >>  >
> >>  > SELECT id, title, url_image_small
> >>  > FROM $dbtable
> >>  > WHERE type="type_title"
> >>  > ORDER BY title
> >>  > LIMIT $offset, $rowsPerPage"
> >  > >
> >-snip-
> >  > You need ot perform a type conversion from string to integer.
> >
> >Sorry, just realized... "Basel Square" is part of the entry in the table
> >:/ Do you have entries that aren't prefixed with Basel Square?
> >
> >Cheers,
> >Rob.
> 
> Rob:
> 
> Yes, there are other titles, such as:
> 
> Celtic Deco 1
> Lucerne 1
> Dutch Hearth 1
> 
> and so on...
> 
> You can see the sort in action at:
> 
> http://ancientstones.com/catalog.php

Ok, first off I would strongly suggest punting the version ID to it's
own table column and stripping from the current column. Then you can
build the string and perform proper ordering. If that's not an option,
then you CAN do what you want (provided the first digit always signifies
the version number) using the following functions:

LOCATE()
SUBSTRING()
IF()

It's not pretty though :) I'd write it up, but don't have time atm.

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] error message

2006-04-26 Thread chris smith
On 4/27/06, cybermalandro cybermalandro <[EMAIL PROTECTED]> wrote:
> I have set in display_errors = off on my php.ini but I can still see ODBC
> related error messages when I try to duplicate an ODBC error. Am I missing
> something to turn this off?

Can you produce a small test case? Maybe post a bug report: http://bugs.php.net

--
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] Natural order of things.

2006-04-26 Thread tedd

On Wed, 2006-04-26 at 16:57, Robert Cummings wrote:

 On Wed, 2006-04-26 at 16:51, tedd wrote:
 > Hi gang:
 >
 > I posted the following question to the MySQL list, but the only
 > answer I received thus far was a php solution (it didn't work for
 > what I wanted).
 >
 > As such, maybe if I post a MySQL question to the PHP group, then I'll
 > receive a MySQL answer -- so here goes:
 >
 > I'm using the following query, and it works.
 >
 > SELECT id, title, url_image_small
 > FROM $dbtable
 > WHERE type="type_title"
 > ORDER BY title
 > LIMIT $offset, $rowsPerPage"

 > >
-snip-
 > You need ot perform a type conversion from string to integer.

Sorry, just realized... "Basel Square" is part of the entry in the table
:/ Do you have entries that aren't prefixed with Basel Square?

Cheers,
Rob.


Rob:

Yes, there are other titles, such as:

Celtic Deco 1
Lucerne 1
Dutch Hearth 1

and so on...

You can see the sort in action at:

http://ancientstones.com/catalog.php

Thanks.

tedd
--

http://sperling.com

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



Re: [PHP] Filter out MS Word 'quotes' for RSS

2006-04-26 Thread D. Dante Lorenso

Richard Lynch wrote:

On Wed, April 26, 2006 4:45 am, Kevin Davies wrote:
  

Obviously I need to convert these on entry, or on output into RSS.
Does anyone know of an easy way to do this, or is it a case of identifying
each unusual character individually?



You don't necessarily need to fix your input characters as much as you 
need to fix the output characters (characters you insert into your RSS 
feed).


If you used an extension like XMLWriter or DOM to build your XML 
document, much of the character encoding is handled for you and you can 
feel reasonably confident that the XML you create is UTF-8 encoded and 
escaped properly.  With this approach, you never need to muck with entities.


Dante

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



RE: [PHP] I want to write a Multi-threaded PHP Application

2006-04-26 Thread Richard Lynch
On Wed, April 26, 2006 6:05 pm, Warren Vail wrote:
> "not likely" until at least PHP 8.0.  However, my needs for a thread
> are
> very simple and might be able to avoid the complexities of shared

One thing you could consider...

If you had one "main" script that did a stream_select on multiple URLs
and polled them to get their output as it came about, you'd
essentially be using Apache's multi-process model instead...

Or you could just figure out what was wrong that was causing your
zombies and fix it... :-v

Another nifty hack is:

//An atomic way to claim these tasks as MINE
$process_id = getmypid();
$query = "UPDATE tasks set process_id = $process_id WHERE process_id
is NULL LIMIT 10";

You can then do the 10 tasks needed and die off.

Alter 10 to suit your needs, and have not as many php processes
running in parallel.

-- 
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] session

2006-04-26 Thread Richard Lynch
On Wed, April 26, 2006 2:53 am, Sichta, Daniel wrote:
> I have web app which using frames. After session timeout my session is
> killed.
> The problem is that session is killed even when I doing requests to
> the
> server.
> I know why (session is "chain" to the frameset page) but what's the
> solution for this?
> I have to use frames !! Don't ask why !! :-)

You'll have to pass the session ID from frameset to frame, and then in
the src="xyz.php" files you'll have to use YOUR session ID and
http://php.net/seesion_id before session_start

-- 
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] I want to write a Multi-threaded PHP Application

2006-04-26 Thread Warren Vail
I did one (well sort of) once.  

I created a php script which was started by cron every minute.  It read a
mysql table looking for items to process, and on finding one, would stamp
the entry in the table as being processed and it would then proceed with
what it needed to do, which sometimes took about half an hour.  What it did
was a DB2 "select count(*)" on every table in a DB2 mainframe database, and
the task was identified in my mysql table as a list of DB2 databases.  The
script would only start processing if it found one that was not running and
there were less than 5 being currently processed (limiting my DB2
connections to 5 at a time).  The byproduct of all this was that it
prevented the mainframe disk management system from archiving critical
database files which were guaranteed to cause errors when the main corporate
application went live, improving reliability and giving us some numbers to
manage disk space utilization with.

Probably not what you had in mind, but the whole process handled 5
concurrent processes running against 30 databases, once every evening.

Warren Vail

-Original Message-
From: D. Dante Lorenso [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 3:43 PM
To: php-general@lists.php.net
Subject: [PHP] I want to write a Multi-threaded PHP Application

All,

For years I have wanted to have the ability to create a new Thread in PHP
similar to how it is done in the Java language.  I understand the
complexities this would involve and have mentioned the idea to the PHP
internals list once and subsequently had the idea shot down and declared
"not likely" until at least PHP 8.0.  However, my needs for a thread are
very simple and might be able to avoid the complexities of shared memory and
synchronization if I could somehow implement even a smaller extension which
does what I want.  Can you entertain this concept and let me know if you
think it is plausible?

I want to write PHP code which looks as follows:

interface Runner {
public static function run() {}
}
class A_Runner implements Runner {
...
public static function run() {
echo ("a runner\n");
sleep(10);
}
}
class B_Runner implements Runner {
...
public static function run() {
echo ("b runner\n");
sleep(10);
}
}

$A = thread_create(new A_Runner());
$B = thread_create(new B_Runner());

thread_start($A);
thread_start($B);

while (true) {
...
echo ("main\n");
sleep(10);
}

And the output of this process should display echo statements from all 3
running process simultaneously.  For example:

...
a runner
main
b runner
a runner
b runner
main
...

It would be nice if the main script could invoke methods on the $A and $B
runner objects in this format:

$A->my_function(...);
$B->my_function(...);

But if that wasn't possible because of shared memory issues or
synchronization problems, maybe the thread extension could handle marshaling
the data on the objects behalf with a function call like:

thread_call($A,  'my_function',  [param 1, param 2, ... param N]);
thread_call($B,  'my_function',  [param 1, param 2, ... param N]);

I would want this functionality in order to build stand-alone PHP server
applications which continually loop in order to execute system processes
like: email notifications, billing, data transfer, transcoding, cron
replacements, or even game servers, etc.  I currently have a solution in
place which does something similar, but it involves IPC and PCNTL and
litters my server's 'ps' listing with many child processes.  Also, some of
the PCNTL child process can become zombies and the whole multi-process model
is not as attractive to me as a developer as the multi-threaded one.

Can anyone tell me whether my idea is possible, whether there exists an
attempt at a PHP thread-like extension (failed or succeeded), and where I
might go to pursue this idea further?

I have already seen the Net_Server PEAR package and am familiar with the
'forking' model used in there.  It's not quite what I want.  I think Threads
are the way to go and am exploring how I can accomplish that.

Dante

--
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] Filter out MS Word 'quotes' for RSS

2006-04-26 Thread Richard Lynch
On Wed, April 26, 2006 4:45 am, Kevin Davies wrote:
> I've got a forum/blog system which is displaying correctly in the
> browser.
> However, I've also got an RSS feed that is created from the data
> entered.
>
> It seems that some of the users are copying and pasting from MS Word
> or
> other packages, and this means that strange quote marks (among others)
> are
> appearing, and breaking the RSS feed.
>
> Obviously I need to convert these on entry, or on output into RSS.
> Does
> anyone know of an easy way to do this, or is it a case of identifying
> each
> unusual character individually?
>
> I've been searching on Google for some advice on this, but not found
> anything so far...

There is a huge thread on php.net in str_replace and/or preg_replace
about this, only for HTML Entities.

You're on your own to figure out what is the "best" RSS entitiy to use
for those oddball characters.

-- 
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] error message

2006-04-26 Thread Richard Lynch

Re-boot.


On Wed, April 26, 2006 4:27 pm, cybermalandro cybermalandro wrote:
> Yes,
> Yes and
> Yes although I am not running apache I am running IIS.
>
> On 4/26/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
>>
>> On Wed, April 26, 2006 4:08 pm, cybermalandro cybermalandro wrote:
>> > I have set in display_errors = off on my php.ini but I can still
>> see
>> > ODBC
>> > related error messages when I try to duplicate an ODBC error. Am I
>> > missing
>> > something to turn this off?
>>
>> Does  reflect your changes to php.ini?
>> Does that output indicate you are changing the correct php.ini?
>> Did you restart Apache?
>>
>> --
>> Like Music?
>> http://l-i-e.com/artists.htm
>>
>>
>>
>


-- 
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] Re: How does PECL and PEAR handle versioning of PHP core?

2006-04-26 Thread Greg Beaver
D. Dante Lorenso wrote:
> All,
> 
> If I install PHP 5 and want to use a PECL extension, does that work the
> same as if I install PHP 4 and try to use the same extension?
> 
> One extension that I use a lot is 'memcache' from PECL:
> 
>http://pecl.php.net/package/memcache
> 
> When I view this site, I do not see any reference to the version of PHP
> which is required.  Does it matter about PHP 5.0.5 vs PHP 5.1.2 etc? 
> Can someone explain how PECL or PEAR works in order to distribute only
> compatible versions of code?

The extension uses dependencies - most extensions compile without
modification for multiple PHP versions.  Those that require some
finagling actually do so through package.xml or configure tricks
(usually configure tricks).

You do need to compile and install a separate extension for each php version


Greg

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



[PHP] I want to write a Multi-threaded PHP Application

2006-04-26 Thread D. Dante Lorenso

All,

For years I have wanted to have the ability to create a new Thread in 
PHP similar to how it is done in the Java language.  I understand the 
complexities this would involve and have mentioned the idea to the PHP 
internals list once and subsequently had the idea shot down and declared 
"not likely" until at least PHP 8.0.  However, my needs for a thread are 
very simple and might be able to avoid the complexities of shared memory 
and synchronization if I could somehow implement even a smaller 
extension which does what I want.  Can you entertain this concept and 
let me know if you think it is plausible?


I want to write PHP code which looks as follows:

interface Runner {
   public static function run() {}
}
class A_Runner implements Runner {
   ...
   public static function run() {
   echo ("a runner\n");
   sleep(10);
   }
}
class B_Runner implements Runner {
   ...
   public static function run() {
   echo ("b runner\n");
   sleep(10);
   }
}

$A = thread_create(new A_Runner());
$B = thread_create(new B_Runner());

thread_start($A);
thread_start($B);

while (true) {
   ...
   echo ("main\n");
   sleep(10);
}

And the output of this process should display echo statements from all 3 
running process simultaneously.  For example:


...
a runner
main
b runner
a runner
b runner
main
...

It would be nice if the main script could invoke methods on the $A and 
$B runner objects in this format:


   $A->my_function(...);
   $B->my_function(...);

But if that wasn't possible because of shared memory issues or 
synchronization problems, maybe the thread extension could handle 
marshaling the data on the objects behalf with a function call like:


   thread_call($A,  'my_function',  [param 1, param 2, ... param N]);
   thread_call($B,  'my_function',  [param 1, param 2, ... param N]);

I would want this functionality in order to build stand-alone PHP server 
applications which continually loop in order to execute system processes 
like: email notifications, billing, data transfer, transcoding, cron 
replacements, or even game servers, etc.  I currently have a solution in 
place which does something similar, but it involves IPC and PCNTL and 
litters my server's 'ps' listing with many child processes.  Also, some 
of the PCNTL child process can become zombies and the whole 
multi-process model is not as attractive to me as a developer as the 
multi-threaded one.


Can anyone tell me whether my idea is possible, whether there exists an 
attempt at a PHP thread-like extension (failed or succeeded), and where 
I might go to pursue this idea further?


I have already seen the Net_Server PEAR package and am familiar with the 
'forking' model used in there.  It's not quite what I want.  I think 
Threads are the way to go and am exploring how I can accomplish that.


Dante

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



Re: [PHP] Book/Site for internernal PHP5 Core Developing

2006-04-26 Thread Richard Lynch
On Wed, April 26, 2006 4:54 am, Thomas Munz wrote:
> Does someone know a good Book/website for Develop own C-Extensions for
> PHP5?
>
> http://us2.php.net/manual/en/zend.php
> This site are just basic things, but i wanna do more things. Someone
> may help
> me?

There's a nice article Zend.com by Sara[h]? Coleman (|Goldman?|Coreman?)

Also a BUNCH of them on http://talks.php.net and http://conf.php.net

Those all seem pretty basic and similar, however...

I think you're at the bleeding edge commonly known as "Use the source,
Luke" :-^

I guess maybe start reading the source code to the smallest/simplest
extension you most understand.

-- 
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] New Help with Javascript Navigation

2006-04-26 Thread Warren Vail
Sounds like you may be a young dude ;-)  You know what they say about us old
dogs and new tricks.  

PHP was a wonderful new trick for me, but javascript still stretches me a
bit much, and if it weren't for the similarities you mention, I'd be
completely lost.  I think the reason we keep getting questions about
Javascript on this list, is because others are struggling with it as I am.
It would be nice if it were covered by PHP.

Just think how it would be if you could write PHP that could access the
browser object model and alter settings on the clients screen dynamically,
of course, at some stage it would be necessary to implement a means of
communicating back to the server, but just to be able to provide interaction
on the client machine would be a great start.

Warren Vail

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 2:37 PM
To: php-general@lists.php.net
Subject: Re: [PHP] New Help with Javascript Navigation

At 01:36 PM 4/26/2006, Warren Vail wrote:
"PHP appears to me to be incomplete unless it can provide a way to provide
client (browser) side executables in a consistent language, namely PHP.
Developers get all excited about the elegence of the PHP language, and
somewhere along the way they discover they have been sandbagged (they have
to learn Javascipt too, if they want responsive GUI's).

"One solution would be to develop a PHP Plugin and support that for all the
browsers out there, but another just occurred to me.  What if there was a
function that accepted PHP code as input and tranlated it to Javascript,
returning the resulting text ready for imbedding in html?"


Nice idea, although "sandbagged" sounds like an exageration: becoming fluent
in both PHP & JavaScript is hardly a major life challenge.  When I finally
learned PHP I was delighted at how syntactically similar it was to
JavaScript, compared say to the difference between JavaScript & VBscript. 
Perhaps my most common mistake in writing in both PH & JS is that I tend to
use . as a concatenation operator in JavaScript these days...


At 02:16 PM 4/26/2006, Evan Priestley wrote:
"No, I'm saying that Javascript can't read or write files on the client's
machine, and that this is only one of a large number of basic limitations in
the language's capabilities. It would be possible to write a script which
took "$a = 3" and converted it into "var a = 3", but a huge number of PHP
functions either can't be implemented in Javascript (file_get_contents) or
are fundamentally unsafe to implement in Javascript (mysql_query), so you'd
end up with a language you couldn't do anything with."

To the contrary, client-side PHP would simply be a different environment
from server-side PHP -- of course certain functions wouldn't apply and
others would that aren't relevant to server-side PHP, but that's not rocket
science.  The point would be to use the same syntax in both contexts.


Relevant to this discussion, there is a set of PHP DOM functions (native to
the core) that look like they match with the corresponding JavaScript
functions pretty closely:
http://php.net/dom
I haven't used them yet, but the function names look familiar.

The way I might implement such a PHP->JavaScript translation might look like
this:



where phpToJavaScript.php is the translation program and myscript.php is the
"client-side PHP" script to be translated to JavaScript.

Paul

--
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] How does PECL and PEAR handle versioning of PHP core?

2006-04-26 Thread D. Dante Lorenso

All,

If I install PHP 5 and want to use a PECL extension, does that work the 
same as if I install PHP 4 and try to use the same extension?


One extension that I use a lot is 'memcache' from PECL:

   http://pecl.php.net/package/memcache

When I view this site, I do not see any reference to the version of PHP 
which is required.  Does it matter about PHP 5.0.5 vs PHP 5.1.2 etc?  
Can someone explain how PECL or PEAR works in order to distribute only 
compatible versions of code?


Dante

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



Re: [PHP] bookmarking with a trademark sign in title

2006-04-26 Thread Satyam


- Original Message - 
From: "Richard Lynch" <[EMAIL PROTECTED]>

To: "Satyam" <[EMAIL PROTECTED]>
Cc: "chris smith" <[EMAIL PROTECTED]>; "Angelo Zanetti" 
<[EMAIL PROTECTED]>; "PHP List" 

Sent: Wednesday, April 26, 2006 11:33 PM
Subject: Re: [PHP] bookmarking with a trademark sign in title



On Wed, April 26, 2006 10:13 am, Satyam wrote:

The problem usually is that many of the 'things' surrounding the main
window
of the browser do not understand HTML and its special characters.
The
favorites or history lists are often one of them.  Most have solved
the
rendering of the  but not all.

If your target is mainly Windows clients, the best option is using
iso-8859-1 as the character set and use the native windows trademark
symbol.
In that way, your browser main window will understand it as per the
character encoding, and windows itself will also understand it for the
rest
of the controls where the internal windows character set is used.


I personally think this is the WORST possible advice to give...

YMMV



I didn't say I like it either but I can't do anything about browsers, I do 
what I can.


Satyam

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



RE: [PHP] New Help with Javascript Navigation

2006-04-26 Thread Warren Vail
You are absolutely correct, that anything that ran on the client machine
would have to be safe and not venture outside the "sandbox", but that is not
what I had in mind, and I don't think that was the goal of "PUB"? Who began
this thread. I believe he wanted to manage some responses to mouseover, and
was sent to another list to find his answer.

You are right on again with the understanding that much of the power and
elegance of PHP would not be available for this type of coding, but there
still is a need and a reason people are forced to turn to Javascript (which
is also limited to the "sandbox"), starting with simple interactive data
validation, and moving right on up to managing images, or changing control
behaviors and such.

I just think it would be nice to be able to do it all in PHP, it's such a
graceful language to work with.  Meanwhile, I think I'll check out
PHPScript, that Richard Lynch found, as soon as I can.

Warren Vail

-Original Message-
From: Evan Priestley [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 2:16 PM
To: Warren Vail
Cc: 'PHP General List'
Subject: Re: [PHP] New Help with Javascript Navigation

No, I'm saying that Javascript can't read or write files on the client's
machine, and that this is only one of a large number of basic limitations in
the language's capabilities. It would be possible to write a script which
took "$a = 3" and converted it into "var a = 3", but a huge number of PHP
functions either can't be implemented in Javascript (file_get_contents) or
are fundamentally unsafe to implement in Javascript (mysql_query), so you'd
end up with a language you couldn't do anything with.

Evan

On Apr 26, 2006, at 5:07 PM, Warren Vail wrote:

> Evan,
>
> Are you proposing something like AJAX does? My understanding is 
> limited here, so bear with me.  A control like a hidden imbedded frame
> (IFRAME) is
> acted upon by Javascript to cause it to dynamically request loading a 
> page into the frame, and when loaded, the javascript processes the 
> contents of the frame without necessarily displaying it directly?
>
> And then do the translation on the client?
>
> Could work, but I was thinking more of doing the tranlation in a 
> function in PHP, but that may be because PHP is my perspective.  
> Something like;
>
> --- snip -- Html stuff 
>  Php code follows here Careful with quotes"); ?> More html stuff
> --- snip --
>
> Or
>
> --- snip -- Echo "html 
> stuff here"
> .scripttranslate("php stuff here..."
> ." again carefull with quotes")
> ."more html stuff here"); // end of echo statement
> --- snip --
>
> Warren
>
> -Original Message-
> From: Evan Priestley [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 26, 2006 1:47 PM
> To: Warren Vail
> Cc: PHP General List
> Subject: Re: [PHP] New Help with Javascript Navigation
>
> Tell you what: write file_get_contents() in Javascript, and I'll write 
> the rest of it.
>
> Evan
>
> On Apr 26, 2006, at 4:36 PM, Warren Vail wrote:
>
>> This brings up a reoccurring issue for me and I'd be interested if 
>> anyone else has given it any thought.
>>
>> PHP appears to me to be incomplete unless it can provide a way to 
>> provide client (browser) side executables in a consistent language, 
>> namely PHP.
>> Developers get all excited about the elegence of the PHP language, 
>> and somewhere along the way they discover they have been sandbagged 
>> (they have to learn Javascipt too, if they want responsive GUI's).
>>
>> One solution would be to develop a PHP Plugin and support that for 
>> all the browsers out there, but another just occurred to me.  What if 
>> there was a function that accepted PHP code as input and tranlated it 
>> to Javascript, returning the resulting text ready for imbedding in 
>> html?
>>
>> Any creative masochists out there?  Has it already been attempted?
>>
>> Warren Vail
>>
>> -Original Message-
>> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, April 26, 2006 1:07 PM
>> To: Pub; php-general@lists.php.net
>> Subject: RE: [PHP] New Help with Javascript Navigation
>>
>> Pub,
>>
>> Thank you for subscribing to and participating in the PHP users list, 
>> a place where your PHP questions can be answered. Unfortunately your 
>> last post contained several problems;
>>
>> a. It was to long.
>> 2. it was a JavaScript question.
>>
>> Thank you,
>>
>> Jay
>>
>> --
>> 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 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

RE: [PHP] php_gd2.dll not found

2006-04-26 Thread Ari Davidow
No. No mix-n-match: This was a clean install. The old php folder
was renamed, then the new one put into place. I downloaded the
files again, from a different mirror, and tried again. Most files
are dated 1/11/2006, as was previously the case.

I have noted from the archives that a few other people report
similar conditions, but I'm not finding any additional
trouble-shooting ideas.

ari

> From: Richard Lynch [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 26, 2006 5:06 PM
> 
> Are you sure you didn't mix-n-match your old DLLs from previous
> php
> versions?
> 
> On Wed, April 26, 2006 3:52 pm, Ari Davidow wrote:
> > I am thoroughly confused.
> >
> >
> >
> > I am working on a Windows XP box.
> >
> > I have just upgraded my dev environment to Apache 2 (2.0.55,
> where
> > it was), php 5.1.2 (PHP 5.1.2 zip
> > 
> > package), MySQL 5.0.20a.
> >
> >
> >
> > Anomaly 1:
> >
> > I carefully navigated the MySQL mess, got the required DLLs
> into
> > my /ext folder, noted where extensions are found in php.ini,
> > uncommented the lines to load mysql and php_gd2. MySQL drivers
> > load fine, so I am uncommented correctly and have correctly
> > designated the folder where extensions are to be found. I
> continue
> > to get a message that php_gd2 is not found. The message lists
> the
> > correct path and directory, so I have to suspect that this
> > particular php_gd2 does not work, does not work with php5, or
> has
> > otherwise gotten munged:
> >
> >
> >
> >  PHP Startup: Unable to load dynamic library
> > 'c:\php\ext\php_gd2.dll' - The specified procedure could not
> be
> > found.
> >
> >
> >
> > I have tried also adding the php_gd2.dll file to the
> > WINDOWS\system32 folder, as well. Makes no difference, so I
> have
> > removed those files.
> >
> >
> >
> > Anomaly 2:
> >
> > When I do a "phpinfo();" to see what is actually loaded (and
> to
> > ensure that the correct php.ini is being loaded, etc.), among
> the
> > info is the notice that I am using php 5.0.3-dev. I get the
> same
> > info when I telnet to localhost.
> >
> >
> >
> > What might I be doing wrong? Is there a patch for php_gd2.dll
> that
> > I have missed? Have I somehow downloaded the wrong php
> version, or
> > could something simply have gotten corrupted?
> >
> >
> >
> > Thanks,
> >
> > Ari
> >
> >
> >
> >
> 
> 
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Pear Package HTTP_Request

2006-04-26 Thread Richard Lynch
Try to get Net_Sockeet 1.0.2 installed -- maybe something appeared in
1.0.2 and went away again :-(

Or, more likely, the dependencies logic/test is just plain flawed.

On Wed, April 26, 2006 5:59 am, Markus Braun wrote:
> Hello,
>
> i try to install the HTTP_Request package.
>
> I installed also the Net_Socket with
>
> pear install Net_Socket-1.0.6
>
> But it exists.
>
> Than i try to install the HTTP_Request:
>
> downloading HTTP_Request-1.3.0.tgz ...
> Starting to download HTTP_Request-1.3.0.tgz (13,808 bytes)
> .done: 13,808 bytes
> requires package `Net_Socket' >= 1.0.2
> HTTP_Request: Dependencies failed
>
>
> Then it comes this.
>
> So i dont understand what the problem is.
> I installed the new version of net socket already.
>
> Thanks
> marcus
>
> _
> Haben Spinnen Ohren? Finden Sie es heraus – mit dem MSN Suche
> Superquiz via
> http://www.msn-superquiz.de  Jetzt mitmachen und gewinnen!
>
> --
> 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] How to execute multiples querys

2006-04-26 Thread Richard Lynch
On Wed, April 26, 2006 11:07 am, Martin Alterisio wrote:
> You should be able to do this in two calls to the mysql_query()
> function.
> mysql_query("SET @var1=3");
> mysql_query("SELECT * from table1 Where [EMAIL PROTECTED]");

-bash-2.05b$ php -a
Interactive mode enabled


X-Powered-By: PHP/4.4.1
Content-type: text/html

Array
(
[0] => 3
)
-bash-2.05b$

Yup.

Definitely works.

-- 
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] New Help with Javascript Navigation

2006-04-26 Thread paul
At 01:36 PM 4/26/2006, Warren Vail wrote:
"PHP appears to me to be incomplete unless it can provide a way to provide
client (browser) side executables in a consistent language, namely PHP.
Developers get all excited about the elegence of the PHP language, and
somewhere along the way they discover they have been sandbagged (they have
to learn Javascipt too, if they want responsive GUI's).

"One solution would be to develop a PHP Plugin and support that for all the
browsers out there, but another just occurred to me.  What if there was a
function that accepted PHP code as input and tranlated it to Javascript,
returning the resulting text ready for imbedding in html?"


Nice idea, although "sandbagged" sounds like an exageration: becoming
fluent in both PHP & JavaScript is hardly a major life challenge.  When I
finally learned PHP I was delighted at how syntactically similar it was to
JavaScript, compared say to the difference between JavaScript & VBscript. 
Perhaps my most common mistake in writing in both PH & JS is that I tend
to use . as a concatenation operator in JavaScript these days...


At 02:16 PM 4/26/2006, Evan Priestley wrote:
"No, I'm saying that Javascript can't read or write files on the
client's machine, and that this is only one of a large number of
basic limitations in the language's capabilities. It would be
possible to write a script which took "$a = 3" and converted it into
"var a = 3", but a huge number of PHP functions either can't be
implemented in Javascript (file_get_contents) or are fundamentally
unsafe to implement in Javascript (mysql_query), so you'd end up with
a language you couldn't do anything with."

To the contrary, client-side PHP would simply be a different environment
from server-side PHP -- of course certain functions wouldn't apply and
others would that aren't relevant to server-side PHP, but that's not
rocket science.  The point would be to use the same syntax in both
contexts.


Relevant to this discussion, there is a set of PHP DOM functions (native
to the core) that look like they match with the corresponding JavaScript
functions pretty closely:
http://php.net/dom
I haven't used them yet, but the function names look familiar.

The way I might implement such a PHP->JavaScript translation might look
like this:



where phpToJavaScript.php is the translation program and myscript.php is
the "client-side PHP" script to be translated to JavaScript.

Paul

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



Re: [PHP] bookmarking with a trademark sign in title

2006-04-26 Thread Richard Lynch
On Wed, April 26, 2006 10:13 am, Satyam wrote:
> The problem usually is that many of the 'things' surrounding the main
> window
> of the browser do not understand HTML and its special characters.
> The
> favorites or history lists are often one of them.  Most have solved
> the
> rendering of the  but not all.
>
> If your target is mainly Windows clients, the best option is using
> iso-8859-1 as the character set and use the native windows trademark
> symbol.
> In that way, your browser main window will understand it as per the
> character encoding, and windows itself will also understand it for the
> rest
> of the controls where the internal windows character set is used.

I personally think this is the WORST possible advice to give...

YMMV

-- 
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] bookmarking with a trademark sign in title

2006-04-26 Thread Richard Lynch
On Wed, April 26, 2006 9:04 am, Jay Blanchard wrote:
> [snip]
> This might be slightly OT but it is related to a PHP project.
> I have a link on the site Im developing to bookmark the site. The
> title
> is XYZ company(tm) but when the add bookmark window comes up for
> saving
> the bookmark, I cannot see the (tm) sign. Does anyone have any
> idea of how to get this site to be saved with the name of the company?
> [/snip]
>
> Use the html special character for the TM...I think it is ®

™ should work as well -- I think that's one of the ones that's
been around since Day Two.  (Day One only had ©)

That said -- it may not be allowed in the Bookmarks by the browser. 
Only the browser maker could change that.

-- 
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] Debuggin PHP

2006-04-26 Thread Richard Lynch
On Wed, April 26, 2006 11:30 am, hicham wrote:
>  I'm a newbie in php world , and I'm trying to get a php 4 script work
> on an php5 version
> how do i debug php ? I get a blank page and nothing tells me what 's
> wrong ?

Check "View Source" in your browser to see if it's really blank.

Make sure PHP is installed and functioning with 

Check your php.ini settings and see if errors are displayed, logged,
or discarded, and what your error_reporting is set to.

Also check the script itself to see if it resets error_reporting --
which,  if it does, is a clear indicator that the author of the script
didn't know what they were doing and you shouldn't use their script
anyway.

You can also use Firefox and its extension to see HTTP Headers to see
what headers, if any, come out of the server.

You can also run PHP from the command line to see what the script
outputs in that environment, which is sometimes useful, and sometimes
too different from web environment to be useful.  Just depends.

-- 
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] New Help with Javascript Navigation

2006-04-26 Thread Robert Cummings
On Wed, 2006-04-26 at 17:18, Jochem Maas wrote:
> 
> Wez Furlong has written an ActiveScript compatible plugin that
> allows running php clientside in the browser - YMWV.
> 
> 
> Robert Cummings wrote:
> > On Wed, 2006-04-26 at 16:47, Evan Priestley wrote:
> > 
> 
> ...
> 
> nice func Rob. :-) now onward to HELL ...
> 
> > ?>
> > 
> > Unfortunately, you're going to have a HELL of a time with dynamically
> > include()'ing source :)
> 
> function includeJS(jsPath)
> {
>  // bogus URL/path to script?
>  if (!isString(jsPath) || !jsPath) {
>  return;
>  }
> 
>  // remove extraneous spaces - just in case
>  jsPath = jsPath.trim();
> 
>  // has the given script already been 'included'?
>  var scripts = document.getElementsByTagName("SCRIPT");
>  var scriptsLen = scripts.length;
>  for (var i = 0; i < scriptsLen; i++) {
>  if (scripts.src == jsPath) {
>  // the requested file has already been added (or was 
> defined/linked from the start.
>  return;
>  }
>  }
> 
>  // everything is ok, lets include the script.
>  var script = document.createElement("SCRIPT");
> 
>  script.setAttribute("type", "text/javascript");
>  script.setAttribute("src", jsPath);
> 
>  document.getElementsByTagName("HEAD")[0].appendChild( script );
> }
> 
> probably far from perfect but it's helped me out of a jam now and again.

Been there, done that technique... unfortunately it can't be used to
dynamically load script that will be "seen" by the currently executing
scope... this isn't quite true... I think one browser saw it right off,
another saw it if I used eval on the retrieved source, but other
browsers don't see it until after the scope (function scope) exits. The
exact semantics are quite varying which provides for completely
unreliable loading of dyanamic script -- and to be frank I try to make
my stuff work with IE/FF/Opera. I could care less about NN4 in this day
and age :)

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] error message

2006-04-26 Thread cybermalandro cybermalandro
Yes,
Yes and
Yes although I am not running apache I am running IIS.

On 4/26/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> On Wed, April 26, 2006 4:08 pm, cybermalandro cybermalandro wrote:
> > I have set in display_errors = off on my php.ini but I can still see
> > ODBC
> > related error messages when I try to duplicate an ODBC error. Am I
> > missing
> > something to turn this off?
>
> Does  reflect your changes to php.ini?
> Does that output indicate you are changing the correct php.ini?
> Did you restart Apache?
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
>
>


Re: [PHP] error message

2006-04-26 Thread Richard Lynch
On Wed, April 26, 2006 4:08 pm, cybermalandro cybermalandro wrote:
> I have set in display_errors = off on my php.ini but I can still see
> ODBC
> related error messages when I try to duplicate an ODBC error. Am I
> missing
> something to turn this off?

Does  reflect your changes to php.ini?
Does that output indicate you are changing the correct php.ini?
Did you restart Apache?

-- 
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] error message

2006-04-26 Thread Jochem Maas

cybermalandro cybermalandro wrote:

I have set in display_errors = off on my php.ini but I can still see ODBC
related error messages when I try to duplicate an ODBC error. Am I missing
something to turn this off?


restart the server?
also check that ini_set('display_errors', 0); doesn't have the desired effect.



Thanks!



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



Re: [PHP] New Help with Javascript Navigation

2006-04-26 Thread Jochem Maas


Wez Furlong has written an ActiveScript compatible plugin that
allows running php clientside in the browser - YMWV.


Robert Cummings wrote:

On Wed, 2006-04-26 at 16:47, Evan Priestley wrote:



...

nice func Rob. :-) now onward to HELL ...


?>

Unfortunately, you're going to have a HELL of a time with dynamically
include()'ing source :)


function includeJS(jsPath)
{
// bogus URL/path to script?
if (!isString(jsPath) || !jsPath) {
return;
}

// remove extraneous spaces - just in case
jsPath = jsPath.trim();

// has the given script already been 'included'?
var scripts = document.getElementsByTagName("SCRIPT");
var scriptsLen = scripts.length;
for (var i = 0; i < scriptsLen; i++) {
if (scripts.src == jsPath) {
// the requested file has already been added (or was defined/linked 
from the start.
return;
}
}

// everything is ok, lets include the script.
var script = document.createElement("SCRIPT");

script.setAttribute("type", "text/javascript");
script.setAttribute("src", jsPath);

document.getElementsByTagName("HEAD")[0].appendChild( script );
}

probably far from perfect but it's helped me out of a jam now and again.

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



Re: [PHP] New Help with Javascript Navigation

2006-04-26 Thread Evan Priestley
No, I'm saying that Javascript can't read or write files on the  
client's machine, and that this is only one of a large number of  
basic limitations in the language's capabilities. It would be  
possible to write a script which took "$a = 3" and converted it into  
"var a = 3", but a huge number of PHP functions either can't be  
implemented in Javascript (file_get_contents) or are fundamentally  
unsafe to implement in Javascript (mysql_query), so you'd end up with  
a language you couldn't do anything with.


Evan

On Apr 26, 2006, at 5:07 PM, Warren Vail wrote:


Evan,

Are you proposing something like AJAX does? My understanding is  
limited
here, so bear with me.  A control like a hidden imbedded frame  
(IFRAME) is
acted upon by Javascript to cause it to dynamically request loading  
a page
into the frame, and when loaded, the javascript processes the  
contents of

the frame without necessarily displaying it directly?

And then do the translation on the client?

Could work, but I was thinking more of doing the tranlation in a  
function in

PHP, but that may be because PHP is my perspective.  Something like;

--- snip --
Html stuff

More html stuff
--- snip --

Or

--- snip --
Echo "html stuff here"
.scripttranslate("php stuff here..."
." again carefull with quotes")
."more html stuff here"); // end of echo statement
--- snip --

Warren

-Original Message-
From: Evan Priestley [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 26, 2006 1:47 PM
To: Warren Vail
Cc: PHP General List
Subject: Re: [PHP] New Help with Javascript Navigation

Tell you what: write file_get_contents() in Javascript, and I'll  
write the

rest of it.

Evan

On Apr 26, 2006, at 4:36 PM, Warren Vail wrote:


This brings up a reoccurring issue for me and I'd be interested if
anyone else has given it any thought.

PHP appears to me to be incomplete unless it can provide a way to
provide client (browser) side executables in a consistent language,
namely PHP.
Developers get all excited about the elegence of the PHP language,  
and

somewhere along the way they discover they have been sandbagged (they
have to learn Javascipt too, if they want responsive GUI's).

One solution would be to develop a PHP Plugin and support that for  
all

the browsers out there, but another just occurred to me.  What if
there was a function that accepted PHP code as input and tranlated it
to Javascript, returning the resulting text ready for imbedding in
html?

Any creative masochists out there?  Has it already been attempted?

Warren Vail

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 26, 2006 1:07 PM
To: Pub; php-general@lists.php.net
Subject: RE: [PHP] New Help with Javascript Navigation

Pub,

Thank you for subscribing to and participating in the PHP users list,
a place where your PHP questions can be answered. Unfortunately your
last post contained several problems;

a. It was to long.
2. it was a JavaScript question.

Thank you,

Jay

--
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 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] New Help with Javascript Navigation

2006-04-26 Thread Richard Lynch
On Wed, April 26, 2006 3:36 pm, Warren Vail wrote:
> One solution would be to develop a PHP Plugin and support that for all
> the

http://pecl.php.net/package/PHPScript

Just stumbled across it the other day, and it's on my "check it out"
list...

Reviews from those more knowlegable most welcome.

-- 
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] Hosting php help

2006-04-26 Thread Nicolas Verhaeghe
http://www.google.com/search?hl=en&q=free+php+hosting

-Original Message-
From: Jesús Alain Rodríguez Santos [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 2:26 PM
To: php-general@lists.php.net
Subject: [PHP] Hosting php help


Please I need a free hosting with php and mysql, and sendmail active. If you
know any site, please send to me the address.

-- 
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.

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



Re: [PHP] Natural order of things.

2006-04-26 Thread tg-php
Going to amend this by saying that whereever the number you need to sort by is 
located, you should be able to extract it and do the padding trick even if it's 
in the middle of a string..  as long as the format is regular enough.

-TG

= = = Original message = = =

You could try separating out the number an formatting it with SQL and doing an 
ORDER BY on the post-processed number.  It doesn't have to appear in the SELECT 
 portion to be able to use it in the ORDER BY section.


SELECT BookName, PageNum, Citation FROM BookQuotes ORDER BY LPAD(PageNum,4,'0');

You could also probably convert the number from a string to an actual number so 
it sorted numerically.

I think you get the idea.  Give it a try and let us know!  Then go back to the 
MySQL list and tell them how great PHP is.

-TG

= = = Original message = = =

Hi gang:

I posted the following question to the MySQL list, but the only 
answer I received thus far was a php solution (it didn't work for 
what I wanted).

As such, maybe if I post a MySQL question to the PHP group, then I'll 
receive a MySQL answer -- so here goes:

I'm using the following query, and it works.

SELECT id, title, url_image_small
FROM $dbtable
WHERE type="type_title"
ORDER BY title
LIMIT $offset, $rowsPerPage"

But, it sorts stuff like this:

Basel Square 1
Basel Square 10
Basel Square 11
Basel Square 2
Basel Square 3
Basel Square 4
Basel Square 5
Basel Square 6
Basel Square 7
Basel Square 8
Basel Square 9

What do I have to change to get it (the query) to sort like this:

Basel Square 1
Basel Square 2
Basel Square 3
Basel Square 4
Basel Square 5
Basel Square 6
Basel Square 7
Basel Square 8
Basel Square 9
Basel Square 10
Basel Square 11

Thanks in advance for any answers/suggestions

tedd
-- 

http://sperling.com



___
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



[PHP] error message

2006-04-26 Thread cybermalandro cybermalandro
I have set in display_errors = off on my php.ini but I can still see ODBC
related error messages when I try to duplicate an ODBC error. Am I missing
something to turn this off?

Thanks!


Re: [PHP] Natural order of things.

2006-04-26 Thread Richard Lynch
Crude, but effective.

ORDER BY length(title) DESC, title

You may also need to make it be:

ORDER BY substring(title, 1, 10), length(title) DESC, title

so you can get them alphabetical to start off with (the first 10
chars) then by the length to hack the "longer" ones with multiple
digits at the end, then by title to get it in order within decimal
positions.

On Wed, April 26, 2006 3:51 pm, tedd wrote:
> Hi gang:
>
> I posted the following question to the MySQL list, but the only
> answer I received thus far was a php solution (it didn't work for
> what I wanted).
>
> As such, maybe if I post a MySQL question to the PHP group, then I'll
> receive a MySQL answer -- so here goes:
>
> I'm using the following query, and it works.
>
> SELECT id, title, url_image_small
> FROM $dbtable
> WHERE type="type_title"
> ORDER BY title
> LIMIT $offset, $rowsPerPage"
>
> But, it sorts stuff like this:
>
> Basel Square 1
> Basel Square 10
> Basel Square 11
> Basel Square 2
> Basel Square 3
> Basel Square 4
> Basel Square 5
> Basel Square 6
> Basel Square 7
> Basel Square 8
> Basel Square 9
>
> What do I have to change to get it (the query) to sort like this:
>
> Basel Square 1
> Basel Square 2
> Basel Square 3
> Basel Square 4
> Basel Square 5
> Basel Square 6
> Basel Square 7
> Basel Square 8
> Basel Square 9
> Basel Square 10
> Basel Square 11
>
> Thanks in advance for any answers/suggestions
>
> tedd
> --
> 
> http://sperling.com
>
> --
> 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] New Help with Javascript Navigation

2006-04-26 Thread Warren Vail
Evan,

Are you proposing something like AJAX does? My understanding is limited
here, so bear with me.  A control like a hidden imbedded frame (IFRAME) is
acted upon by Javascript to cause it to dynamically request loading a page
into the frame, and when loaded, the javascript processes the contents of
the frame without necessarily displaying it directly?
 
And then do the translation on the client?

Could work, but I was thinking more of doing the tranlation in a function in
PHP, but that may be because PHP is my perspective.  Something like;

--- snip --
Html stuff

More html stuff
--- snip --

Or

--- snip --
Echo "html stuff here"
.scripttranslate("php stuff here..."
." again carefull with quotes")
."more html stuff here");   // end of echo statement
--- snip --

Warren

-Original Message-
From: Evan Priestley [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 1:47 PM
To: Warren Vail
Cc: PHP General List
Subject: Re: [PHP] New Help with Javascript Navigation

Tell you what: write file_get_contents() in Javascript, and I'll write the
rest of it.

Evan

On Apr 26, 2006, at 4:36 PM, Warren Vail wrote:

> This brings up a reoccurring issue for me and I'd be interested if 
> anyone else has given it any thought.
>
> PHP appears to me to be incomplete unless it can provide a way to 
> provide client (browser) side executables in a consistent language, 
> namely PHP.
> Developers get all excited about the elegence of the PHP language, and 
> somewhere along the way they discover they have been sandbagged (they 
> have to learn Javascipt too, if they want responsive GUI's).
>
> One solution would be to develop a PHP Plugin and support that for all 
> the browsers out there, but another just occurred to me.  What if 
> there was a function that accepted PHP code as input and tranlated it 
> to Javascript, returning the resulting text ready for imbedding in 
> html?
>
> Any creative masochists out there?  Has it already been attempted?
>
> Warren Vail
>
> -Original Message-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 26, 2006 1:07 PM
> To: Pub; php-general@lists.php.net
> Subject: RE: [PHP] New Help with Javascript Navigation
>
> Pub,
>
> Thank you for subscribing to and participating in the PHP users list, 
> a place where your PHP questions can be answered. Unfortunately your 
> last post contained several problems;
>
> a. It was to long.
> 2. it was a JavaScript question.
>
> Thank you,
>
> Jay
>
> --
> 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 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] php_gd2.dll not found

2006-04-26 Thread tedd

At 4:52 PM -0400 4/26/06, Ari Davidow wrote:


I am thoroughly confused.

I am working on a Windows XP box.



A correlation, perhaps?  :-)

tedd

--

http://sperling.com

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



Re: [PHP] php_gd2.dll not found

2006-04-26 Thread Richard Lynch
Are you sure you didn't mix-n-match your old DLLs from previous php
versions?

You can't do that...

On Wed, April 26, 2006 3:52 pm, Ari Davidow wrote:
> I am thoroughly confused.
>
>
>
> I am working on a Windows XP box.
>
> I have just upgraded my dev environment to Apache 2 (2.0.55, where
> it was), php 5.1.2 (PHP 5.1.2 zip
> 
> package), MySQL 5.0.20a.
>
>
>
> Anomaly 1:
>
> I carefully navigated the MySQL mess, got the required DLLs into
> my /ext folder, noted where extensions are found in php.ini,
> uncommented the lines to load mysql and php_gd2. MySQL drivers
> load fine, so I am uncommented correctly and have correctly
> designated the folder where extensions are to be found. I continue
> to get a message that php_gd2 is not found. The message lists the
> correct path and directory, so I have to suspect that this
> particular php_gd2 does not work, does not work with php5, or has
> otherwise gotten munged:
>
>
>
>  PHP Startup: Unable to load dynamic library
> 'c:\php\ext\php_gd2.dll' - The specified procedure could not be
> found.
>
>
>
> I have tried also adding the php_gd2.dll file to the
> WINDOWS\system32 folder, as well. Makes no difference, so I have
> removed those files.
>
>
>
> Anomaly 2:
>
> When I do a "phpinfo();" to see what is actually loaded (and to
> ensure that the correct php.ini is being loaded, etc.), among the
> info is the notice that I am using php 5.0.3-dev. I get the same
> info when I telnet to localhost.
>
>
>
> What might I be doing wrong? Is there a patch for php_gd2.dll that
> I have missed? Have I somehow downloaded the wrong php version, or
> could something simply have gotten corrupted?
>
>
>
> Thanks,
>
> Ari
>
>
>
>


-- 
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] Natural order of things.

2006-04-26 Thread tg-php
You could try separating out the number an formatting it with SQL and doing an 
ORDER BY on the post-processed number.  It doesn't have to appear in the SELECT 
 portion to be able to use it in the ORDER BY section.


SELECT BookName, PageNum, Citation FROM BookQuotes ORDER BY LPAD(PageNum,4,'0');

You could also probably convert the number from a string to an actual number so 
it sorted numerically.

I think you get the idea.  Give it a try and let us know!  Then go back to the 
MySQL list and tell them how great PHP is.

-TG

= = = Original message = = =

Hi gang:

I posted the following question to the MySQL list, but the only 
answer I received thus far was a php solution (it didn't work for 
what I wanted).

As such, maybe if I post a MySQL question to the PHP group, then I'll 
receive a MySQL answer -- so here goes:

I'm using the following query, and it works.

SELECT id, title, url_image_small
FROM $dbtable
WHERE type="type_title"
ORDER BY title
LIMIT $offset, $rowsPerPage"

But, it sorts stuff like this:

Basel Square 1
Basel Square 10
Basel Square 11
Basel Square 2
Basel Square 3
Basel Square 4
Basel Square 5
Basel Square 6
Basel Square 7
Basel Square 8
Basel Square 9

What do I have to change to get it (the query) to sort like this:

Basel Square 1
Basel Square 2
Basel Square 3
Basel Square 4
Basel Square 5
Basel Square 6
Basel Square 7
Basel Square 8
Basel Square 9
Basel Square 10
Basel Square 11

Thanks in advance for any answers/suggestions

tedd
-- 

http://sperling.com



___
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] Natural order of things.

2006-04-26 Thread Stut

tedd wrote:

SELECT id, title, url_image_small
FROM $dbtable
WHERE type="type_title"
ORDER BY title
LIMIT $offset, $rowsPerPage"

But, it sorts stuff like this:

Basel Square 1
Basel Square 10
Basel Square 11
Basel Square 2
Basel Square 3
Basel Square 4
Basel Square 5
Basel Square 6
Basel Square 7
Basel Square 8
Basel Square 9

What do I have to change to get it (the query) to sort like this:

Basel Square 1
Basel Square 2
Basel Square 3
Basel Square 4
Basel Square 5
Basel Square 6
Basel Square 7
Basel Square 8
Basel Square 9
Basel Square 10
Basel Square 11


Never tried it mysql, but I am led to believe that sorting based on the 
result of the mysql SOUNDEX function may produce the results you want. 
Other than that, as far as I am aware there is no way to do this in 
MySQL without writing a stored procedure to do it.


-Stut

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



Re: [PHP] Natural order of things.

2006-04-26 Thread Robert Cummings
On Wed, 2006-04-26 at 16:57, Robert Cummings wrote:
> On Wed, 2006-04-26 at 16:51, tedd wrote:
> > Hi gang:
> > 
> > I posted the following question to the MySQL list, but the only 
> > answer I received thus far was a php solution (it didn't work for 
> > what I wanted).
> > 
> > As such, maybe if I post a MySQL question to the PHP group, then I'll 
> > receive a MySQL answer -- so here goes:
> > 
> > I'm using the following query, and it works.
> > 
> > SELECT id, title, url_image_small
> > FROM $dbtable
> > WHERE type="type_title"
> > ORDER BY title
> > LIMIT $offset, $rowsPerPage"
> > 
> > But, it sorts stuff like this:
> > 
> > Basel Square 1
> > Basel Square 10
> > Basel Square 11
> > Basel Square 2
> > Basel Square 3
> > Basel Square 4
> > Basel Square 5
> > Basel Square 6
> > Basel Square 7
> > Basel Square 8
> > Basel Square 9
> > 
> > What do I have to change to get it (the query) to sort like this:
> > 
> > Basel Square 1
> > Basel Square 2
> > Basel Square 3
> > Basel Square 4
> > Basel Square 5
> > Basel Square 6
> > Basel Square 7
> > Basel Square 8
> > Basel Square 9
> > Basel Square 10
> > Basel Square 11
> > 
> > Thanks in advance for any answers/suggestions
> 
> You need ot perform a type conversion from string to integer.

Sorry, just realized... "Basel Square" is part of the entry in the table
:/ Do you have entries that aren't prefixed with Basel Square?

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] Natural order of things.

2006-04-26 Thread Robert Cummings
On Wed, 2006-04-26 at 16:51, tedd wrote:
> Hi gang:
> 
> I posted the following question to the MySQL list, but the only 
> answer I received thus far was a php solution (it didn't work for 
> what I wanted).
> 
> As such, maybe if I post a MySQL question to the PHP group, then I'll 
> receive a MySQL answer -- so here goes:
> 
> I'm using the following query, and it works.
> 
> SELECT id, title, url_image_small
> FROM $dbtable
> WHERE type="type_title"
> ORDER BY title
> LIMIT $offset, $rowsPerPage"
> 
> But, it sorts stuff like this:
> 
> Basel Square 1
> Basel Square 10
> Basel Square 11
> Basel Square 2
> Basel Square 3
> Basel Square 4
> Basel Square 5
> Basel Square 6
> Basel Square 7
> Basel Square 8
> Basel Square 9
> 
> What do I have to change to get it (the query) to sort like this:
> 
> Basel Square 1
> Basel Square 2
> Basel Square 3
> Basel Square 4
> Basel Square 5
> Basel Square 6
> Basel Square 7
> Basel Square 8
> Basel Square 9
> Basel Square 10
> Basel Square 11
> 
> Thanks in advance for any answers/suggestions

You need ot perform a type conversion from string to integer.

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] New Help with Javascript Navigation

2006-04-26 Thread Robert Cummings
On Wed, 2006-04-26 at 16:47, Evan Priestley wrote:
> Tell you what: write file_get_contents() in Javascript, and I'll  
> write the rest of it.

I hope you're not going to welch!!



Unfortunately, you're going to have a HELL of a time with dynamically
include()'ing source :)

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] php_gd2.dll not found

2006-04-26 Thread Ari Davidow
I am thoroughly confused.

 

I am working on a Windows XP box.

I have just upgraded my dev environment to Apache 2 (2.0.55, where
it was), php 5.1.2 (PHP 5.1.2 zip

package), MySQL 5.0.20a.

 

Anomaly 1:

I carefully navigated the MySQL mess, got the required DLLs into
my /ext folder, noted where extensions are found in php.ini,
uncommented the lines to load mysql and php_gd2. MySQL drivers
load fine, so I am uncommented correctly and have correctly
designated the folder where extensions are to be found. I continue
to get a message that php_gd2 is not found. The message lists the
correct path and directory, so I have to suspect that this
particular php_gd2 does not work, does not work with php5, or has
otherwise gotten munged:

 

 PHP Startup: Unable to load dynamic library
'c:\php\ext\php_gd2.dll' - The specified procedure could not be
found.

 

I have tried also adding the php_gd2.dll file to the
WINDOWS\system32 folder, as well. Makes no difference, so I have
removed those files.

 

Anomaly 2:

When I do a "phpinfo();" to see what is actually loaded (and to
ensure that the correct php.ini is being loaded, etc.), among the
info is the notice that I am using php 5.0.3-dev. I get the same
info when I telnet to localhost.

 

What might I be doing wrong? Is there a patch for php_gd2.dll that
I have missed? Have I somehow downloaded the wrong php version, or
could something simply have gotten corrupted?

 

Thanks,

Ari

 



[PHP] Natural order of things.

2006-04-26 Thread tedd

Hi gang:

I posted the following question to the MySQL list, but the only 
answer I received thus far was a php solution (it didn't work for 
what I wanted).


As such, maybe if I post a MySQL question to the PHP group, then I'll 
receive a MySQL answer -- so here goes:


I'm using the following query, and it works.

SELECT id, title, url_image_small
FROM $dbtable
WHERE type="type_title"
ORDER BY title
LIMIT $offset, $rowsPerPage"

But, it sorts stuff like this:

Basel Square 1
Basel Square 10
Basel Square 11
Basel Square 2
Basel Square 3
Basel Square 4
Basel Square 5
Basel Square 6
Basel Square 7
Basel Square 8
Basel Square 9

What do I have to change to get it (the query) to sort like this:

Basel Square 1
Basel Square 2
Basel Square 3
Basel Square 4
Basel Square 5
Basel Square 6
Basel Square 7
Basel Square 8
Basel Square 9
Basel Square 10
Basel Square 11

Thanks in advance for any answers/suggestions

tedd
--

http://sperling.com

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



Re: [PHP] New Help with Javascript Navigation

2006-04-26 Thread Evan Priestley
Tell you what: write file_get_contents() in Javascript, and I'll  
write the rest of it.


Evan

On Apr 26, 2006, at 4:36 PM, Warren Vail wrote:

This brings up a reoccurring issue for me and I'd be interested if  
anyone

else has given it any thought.

PHP appears to me to be incomplete unless it can provide a way to  
provide
client (browser) side executables in a consistent language, namely  
PHP.

Developers get all excited about the elegence of the PHP language, and
somewhere along the way they discover they have been sandbagged  
(they have

to learn Javascipt too, if they want responsive GUI's).

One solution would be to develop a PHP Plugin and support that for  
all the
browsers out there, but another just occurred to me.  What if there  
was a
function that accepted PHP code as input and tranlated it to  
Javascript,

returning the resulting text ready for imbedding in html?

Any creative masochists out there?  Has it already been attempted?

Warren Vail

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 26, 2006 1:07 PM
To: Pub; php-general@lists.php.net
Subject: RE: [PHP] New Help with Javascript Navigation

Pub,

Thank you for subscribing to and participating in the PHP users  
list, a
place where your PHP questions can be answered. Unfortunately your  
last post

contained several problems;

a. It was to long.
2. it was a JavaScript question.

Thank you,

Jay

--
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] New Help with Javascript Navigation

2006-04-26 Thread Warren Vail
This brings up a reoccurring issue for me and I'd be interested if anyone
else has given it any thought.  

PHP appears to me to be incomplete unless it can provide a way to provide
client (browser) side executables in a consistent language, namely PHP.
Developers get all excited about the elegence of the PHP language, and
somewhere along the way they discover they have been sandbagged (they have
to learn Javascipt too, if they want responsive GUI's).

One solution would be to develop a PHP Plugin and support that for all the
browsers out there, but another just occurred to me.  What if there was a
function that accepted PHP code as input and tranlated it to Javascript,
returning the resulting text ready for imbedding in html?

Any creative masochists out there?  Has it already been attempted?

Warren Vail

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 1:07 PM
To: Pub; php-general@lists.php.net
Subject: RE: [PHP] New Help with Javascript Navigation

Pub,

Thank you for subscribing to and participating in the PHP users list, a
place where your PHP questions can be answered. Unfortunately your last post
contained several problems;

a. It was to long.
2. it was a JavaScript question.

Thank you,

Jay

--
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] Hosting php help

2006-04-26 Thread Jesús Alain Rodríguez Santos
Please I need a free hosting with php and mysql, and sendmail active.
If you know any site, please send to me the address.

-- 
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.



Re: [PHP] New Help with Javascript Navigation

2006-04-26 Thread Stut

Jay Blanchard wrote:

[snip]
lol - that was almost perfect... you missed an 'o' ;-)
[/snip]

I am allowed a missed 'o' as I am on the bus (and have been for almost
24 hours) chaperoning a high school band trip to Florida. :) 


This one time, at band camp, I wrote an email to the PHP-General mailing 
list.


Doesn't quite work :(

-Stut

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-26 Thread Robert Cummings
On Wed, 2006-04-26 at 16:07, Jochem Maas wrote:
> Richard Lynch wrote:
> 
> ...
> 
> > A general Google for search terms likely to contain what you need. 
> > This often requires several tries and some finesse on input for terms
> > as common as "phpBB" and "forum" but an attempt must be made, even if
> > you're sure it will be fruitless...  Cuz Google is goddamned smart
> > sometimes. :-)
> 
> in the immortal words of the guy that got the whole php ball rolling:
>   "of course you should be using Yahoo!"

Words only last as long as the medium upon which they are encoded... and
that includes brains -- unless of course there is an afterlife, but
arguing unprovable ideas is as futile as me saying that I can fly, but
only when nothing is looking *haha*. Undoubtedly "immortal" is an
exaggeration. Additionally, one's ability to create and advance software
does not necessarily lend to ones advertising credibility -- especially
when one is affiliated with said product/service/company. You are
however quite welcome to grovel before anyone you please, whether they
want you to or not.

> > If we tried to answer all the questions for all the monstrosities of
> > software written in PHP (e.g. phpBB), we'd be in real trouble...
> > 
> > This list gets enough traffic as it is -- and some of that is
> > admittedly my fault :-)
> 
> only some heh? ;-)

Ahh but it's good traffic :)

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] New Help with Javascript Navigation

2006-04-26 Thread John Nichel

Pub wrote:

Hello,

I would really appreciate some help.



Then ask a php question.

--
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] New Help with Javascript Navigation

2006-04-26 Thread Jay Blanchard
[snip]
lol - that was almost perfect... you missed an 'o' ;-)
[/snip]

I am allowed a missed 'o' as I am on the bus (and have been for almost
24 hours) chaperoning a high school band trip to Florida. :) 

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



Re: [PHP] (Apache|php) Bug using modproxy

2006-04-26 Thread Jochem Maas

Lmwangi wrote:

Ok thanx. Let me try squid I have posted the mail on the apache
list.. Oh and btw i downgrade my rank. Its no longer voodoo.. So don't
go looking for new name ;-)


ah good - have fun with Squid - but beware it has more arms than you to fight 
with ;-)

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



Re: [PHP] New Help with Javascript Navigation

2006-04-26 Thread Jochem Maas

Jay Blanchard wrote:

Pub,

Thank you for subscribing to and participating in the PHP users list, a
place where your PHP questions can be answered. Unfortunately your last
post contained several problems;

a. It was to long.
2. it was a JavaScript question.

Thank you,

Jay


lol - that was almost perfect... you missed an 'o' ;-)





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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-26 Thread Jochem Maas

Richard Lynch wrote:

...

A general Google for search terms likely to contain what you need. 
This often requires several tries and some finesse on input for terms

as common as "phpBB" and "forum" but an attempt must be made, even if
you're sure it will be fruitless...  Cuz Google is goddamned smart
sometimes. :-)


in the immortal words of the guy that got the whole php ball rolling:
"of course you should be using Yahoo!"



If we tried to answer all the questions for all the monstrosities of
software written in PHP (e.g. phpBB), we'd be in real trouble...

This list gets enough traffic as it is -- and some of that is
admittedly my fault :-)


only some heh? ;-)





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



RE: [PHP] New Help with Javascript Navigation

2006-04-26 Thread Jay Blanchard
Pub,

Thank you for subscribing to and participating in the PHP users list, a
place where your PHP questions can be answered. Unfortunately your last
post contained several problems;

a. It was to long.
2. it was a JavaScript question.

Thank you,

Jay

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



Re: [PHP] Debuggin PHP

2006-04-26 Thread Robert Cummings
On Wed, 2006-04-26 at 14:51, Sameer N Ingole wrote:
> Robert Cummings wrote:
> > On Wed, 2006-04-26 at 12:44, Jochem Maas wrote:
> >   
> >> hicham wrote:
> >> 
> >> easy way 2:
> >>use lots of echo()/var_dump()/print_r() in your code to figure out
> >>where it's breaking.
> >> 
> >
> > If you're trying to track down an error using this technique (by far one
> > of the most popular techniques and time tested), be sure and use your
> > knowledge of binary search algorithms to speed up your search. Applying
> > the heuristic of guessing approximately where it's occurring will help
> > you greatly also :) This kind of technique though is mostly only
> > necessary when PHP does something stupid like segfault *grin*.
> Most of the times it is true, however, sometimes everything just fails. 
> Apache continues to give segfaults on running a specific PHP script, 
> which do don't find until you look into error logs of apache. Then you 
> try to generate backtrace using gdb. All this while, on every try 
> Apache+PHP keeps crashing on you.
> 
> gdb backtrace too does not help much. So finally you compile bare bones 
> apache+php and Voila! Everything works just fine.. From there, you go on 
> adding one module per compilation to find the defaulter module and run 
> /that/ PHP script after every compile to see if it crashes. And after a 
> few compiles you find an Apache module to be a real culprit.

I use binary search for module seg faults also when the module is
unknown :) Also for segfaults, the error log (or just plain run from
CGI) can be handy to see your output before the crash.

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] Debuggin PHP

2006-04-26 Thread Sameer N Ingole

Robert Cummings wrote:

On Wed, 2006-04-26 at 12:44, Jochem Maas wrote:
  

hicham wrote:

easy way 2:

use lots of echo()/var_dump()/print_r() in your code to figure out
where it's breaking.



If you're trying to track down an error using this technique (by far one
of the most popular techniques and time tested), be sure and use your
knowledge of binary search algorithms to speed up your search. Applying
the heuristic of guessing approximately where it's occurring will help
you greatly also :) This kind of technique though is mostly only
necessary when PHP does something stupid like segfault *grin*.
Most of the times it is true, however, sometimes everything just fails. 
Apache continues to give segfaults on running a specific PHP script, 
which do don't find until you look into error logs of apache. Then you 
try to generate backtrace using gdb. All this while, on every try 
Apache+PHP keeps crashing on you.


gdb backtrace too does not help much. So finally you compile bare bones 
apache+php and Voila! Everything works just fine.. From there, you go on 
adding one module per compilation to find the defaulter module and run 
/that/ PHP script after every compile to see if it crashes. And after a 
few compiles you find an Apache module to be a real culprit.


--
Sameer N. Ingole
Blog: http://weblogic.noroot.org/
---
Better to light one candle than to curse the darkness.

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



Re: [PHP] (Apache|php) Bug using modproxy

2006-04-26 Thread Oscar Gosdinski
I have the configuration you described:

browser --> https-> mod_proxy -> http -> php

and i don't have any problem with it. Maybe it's an Apache
misconfiguration. Can you send a snap of your httpd.conf?

On 4/26/06, Lmwangi <[EMAIL PROTECTED]> wrote:
> Hi all,
>  First time on the list... sorry for any errs.
>  I am using mod_proxy to pass requests to an internal server in our
> lan. The setup looks like
>
> Enduser---INet_link-Mod_proxy_serverLan---PHP_script
>
> Now,
>
> this  does not work:
>
> Enduser---https--->Apache_mod_proxy-http--->Destination_server.
>
> * When a user submits a form (php) with a file upload and  $_POST
> vars, the $_POST array is mangled (missing) elements and the $_FILES
> array is empty
>

--
Saludos
Oscar

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



Re: [PHP] Debuggin PHP

2006-04-26 Thread Eric Butera
On 4/26/06, hicham <[EMAIL PROTECTED]> wrote:
>
> Hello
> I'm a newbie in php world , and I'm trying to get a php 4 script work
> on an php5 version
> how do i debug php ? I get a blank page and nothing tells me what 's wrong
> ?
>
> Thanks
> hicham
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
(Assuming you're on *nix)

One thing I always do when I'm developing is to locate the error log that
PHP writes to.  You can find it by looking at error_log in php.ini or find
where Apache writes errors to.  Then I just tail -f that so that I can see
any errors including parse errors that just give you that no-ouput white
screen.  As others have mentioned always keep error_reporting to E_ALL.


Re: [PHP] (Apache|php) Bug using modproxy

2006-04-26 Thread Jochem Maas



Lmwangi wrote:

Hi all,
 First time on the list... sorry for any errs.
 I am using mod_proxy to pass requests to an internal server in our
lan. The setup looks like

Enduser---INet_link-Mod_proxy_serverLan---PHP_script

Now,

this  does not work:

Enduser---https--->Apache_mod_proxy-http--->Destination_server.

* When a user submits a form (php) with a file upload and  $_POST
vars, the $_POST array is mangled (missing) elements and the $_FILES
array is empty

while this works:

 Enduser---http--->Apache_mod_proxy-http--->Destination_server.


almost definitely not a php problem - maybe using ProxyPass instead of
mod_proxy would work (probably requires https connection on the destination
server) - personally I have used Squid as a reverse proxy for this kind of
setup and let it deal with the https<-->http conversion - it works but if you
think the Apache stuff is voodoo then I need a new name for the Squid 
configuration
stuff ;-)

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



Re: [PHP] Debuggin PHP

2006-04-26 Thread Jochem Maas

Robert Cummings wrote:

On Wed, 2006-04-26 at 12:44, Jochem Maas wrote:


hicham wrote:




easy way 2:
use lots of echo()/var_dump()/print_r() in your code to figure out
where it's breaking.



If you're trying to track down an error using this technique (by far one
of the most popular techniques and time tested), be sure and use your
knowledge of binary search algorithms to speed up your search. Applying
the heuristic of guessing approximately where it's occurring will help


that'll be the old 'put the first debug "echo" in the "middle" of the
script" technique :-)


you greatly also :) This kind of technique though is mostly only
necessary when PHP does something stupid like segfault *grin*. Another
fantastic technique is if you know the error occurs at a specific
location, but don't know how the heck the script got there... you can
use debug_backtrace().


very good tips!



Cheers,
Rob.


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



Re: [PHP] How to execute multiples querys

2006-04-26 Thread Mauricio Pellegrini
On Wed, 2006-04-26 at 13:48, Robert Cummings wrote:
> On Wed, 2006-04-26 at 10:36, Mauricio Pellegrini wrote:
> > On Wed, 2006-04-26 at 11:09, nicolas figaro wrote:
> > > Mauricio Pellegrini a écrit :
> > > >>> $quer1 = "SET @var1=3 ;
> > > >>>   SELECt * from table1 Where [EMAIL PROTECTED] " ;
> > > >>>
> > > >>>
> > > >>> This gave a syntax error from MySQL inmmediately before the ";"
> > > >>> (semicolon),
> > > >>>
> > 
> > 
> > > >>>   
> > > did you try to run the query above
> > > 
> > > ( SET @var1=3 ; SELECt * from table1 Where [EMAIL PROTECTED] )
> > > 
> > > directly from a mysql client ?
> > 
> > Yes, I did and it Works perfectly.
> > 
> > 
> > > perhaps the @ is interpreted and you have to put a \ before it.
> > > try a print $quer1 once $quer1 is set.
> > 
> > I've tried this too. The output is sintactically correct.
> > I even copied the output of the query and pasted it to Mysqlcc an
> > executed it perfectly.
> > 
> > 
> > 
> > A few minutes ago I found that mysql_query() cannot execute more than
> > one query at a time 
> > so the form mysql_query("SET @var1=3 ; SELECT * from ") is invalid 
> > 
> > 
> > But the other way should work
> 
> Try explicitly retrieving a resource ID from mysql_connect, and
> explictly use that resource when making the query. Probably not the
> problem, but sounds like something is being lost from one query to
> another.
Thank you that's true.
Theres another module in the middle and that is getting only the last
query

Thanks to all
Mauricio

> 
> Cheers,
> Rob.

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



Re: [PHP] How to execute multiples querys,IT is SOLVED!!

2006-04-26 Thread Mauricio Pellegrini
On Wed, 2006-04-26 at 13:07, Martin Alterisio wrote:
> You should be able to do this in two calls to the mysql_query()
> function.
> mysql_query("SET @var1=3");
> mysql_query("SELECT * from table1 Where [EMAIL PROTECTED]");
It worked this way!

It seems I musta had some other problem somewhere else thank you

Thank you all
MAuricio

> 
> 2006/4/26, Mauricio Pellegrini <[EMAIL PROTECTED]>:
> Hi all
> 
> I'm trying to execute two querys and they execute perfectly in
> fact,
> but after the execution of the first query there suposed to be
> some
> variable setted to a certain value.
> 
> The problem is this variable is not available at the time the
> second 
> query runs.
> 
> I`ll try to explain a little bit further
> 
> //This is my first query
> 
> $quer1=" SET @var1=3 ";//Here I`m suposed to set the value for
> var1 to 3
> mysql_query($quer1);
> 
> // This is query #2 
> 
> $query2="SELECT * from table1 where [EMAIL PROTECTED] "//Here @var1
> doesn`t
> exist
> 
> 
> That wasn't really my first attempt. Originally
> I've tryied the whole thing in just one single query but mysql
> gave me 
> an error message complinning about the semicolon
> 
> Please look at this
> 
> $quer1 = "SET @var1=3 ;
> SELECt * from table1 Where [EMAIL PROTECTED] " ;
> 
> 
> This gave a syntax error from MySQL inmmediately before the
> ";" 
> (semicolon),
> 
> 
> Please any help greatefully appreciated
> 
> Thanks
> Mauricio
> 
> --
> 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] Debuggin PHP

2006-04-26 Thread Robert Cummings
On Wed, 2006-04-26 at 12:44, Jochem Maas wrote:
> hicham wrote:

> easy way 2:
>   use lots of echo()/var_dump()/print_r() in your code to figure out
>   where it's breaking.

If you're trying to track down an error using this technique (by far one
of the most popular techniques and time tested), be sure and use your
knowledge of binary search algorithms to speed up your search. Applying
the heuristic of guessing approximately where it's occurring will help
you greatly also :) This kind of technique though is mostly only
necessary when PHP does something stupid like segfault *grin*. Another
fantastic technique is if you know the error occurs at a specific
location, but don't know how the heck the script got there... you can
use debug_backtrace().

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] How to execute multiples querys

2006-04-26 Thread Robert Cummings
On Wed, 2006-04-26 at 10:36, Mauricio Pellegrini wrote:
> On Wed, 2006-04-26 at 11:09, nicolas figaro wrote:
> > Mauricio Pellegrini a écrit :
> > >>> $quer1 = "SET @var1=3 ;
> > >>> SELECt * from table1 Where [EMAIL PROTECTED] " ;
> > >>>
> > >>>
> > >>> This gave a syntax error from MySQL inmmediately before the ";"
> > >>> (semicolon),
> > >>>
> 
> 
> > >>>   
> > did you try to run the query above
> > 
> > ( SET @var1=3 ; SELECt * from table1 Where [EMAIL PROTECTED] )
> > 
> > directly from a mysql client ?
> 
> Yes, I did and it Works perfectly.
> 
> 
> > perhaps the @ is interpreted and you have to put a \ before it.
> > try a print $quer1 once $quer1 is set.
> 
> I've tried this too. The output is sintactically correct.
> I even copied the output of the query and pasted it to Mysqlcc an
> executed it perfectly.
> 
> 
> 
> A few minutes ago I found that mysql_query() cannot execute more than
> one query at a time 
> so the form mysql_query("SET @var1=3 ; SELECT * from ") is invalid 
> 
> 
> But the other way should work

Try explicitly retrieving a resource ID from mysql_connect, and
explictly use that resource when making the query. Probably not the
problem, but sounds like something is being lost from one query to
another.

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] Debuggin PHP

2006-04-26 Thread Martin Alterisio
2006/4/26, John Nichel <[EMAIL PROTECTED]>:
>
> hicham wrote:
> > Hello
> >  I'm a newbie in php world , and I'm trying to get a php 4 script work
> > on an php5 version
> > how do i debug php ? I get a blank page and nothing tells me what 's
> wrong ?
> >
> > Thanks
> > hicham
> >
>
> Turn on error reporting.
>
> --
> John C. Nichel IV
> Programmer/System Admin (ÜberGeek)
> Dot Com Holdings of Buffalo
> 716.856.9675
> [EMAIL PROTECTED]


error_reporting(E_ALL);
at the beggining of your script

or

modify your php.ini


Re: [PHP] Debuggin PHP

2006-04-26 Thread Jochem Maas

hicham wrote:

Hello
 I'm a newbie in php world , and I'm trying to get a php 4 script work
on an php5 version
how do i debug php ? I get a blank page and nothing tells me what 's wrong ?


the hard way:
install and use Xdebug.

easy way 1:
buy a copy of Zend Studio, again install on the server part on your
server (which is automated if your development machine is your local 
machine)
- much simpler to setup than Xdebug and very easy to use.

easy way 2:
use lots of echo()/var_dump()/print_r() in your code to figure out
where it's breaking.

NB: turn on error_reporting to full:

ini_set('error_reporting', E_ALL | E_STRICT);

NB: turn on diplay_errors (or find your php or apache log, it depends,
and learn how to 'tail' it to what what if any errors are occuring)

ini_set('diplay_errors', 1);



Thanks
hicham



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



Re: [PHP] Debuggin PHP

2006-04-26 Thread John Nichel

hicham wrote:

Hello
 I'm a newbie in php world , and I'm trying to get a php 4 script work
on an php5 version
how do i debug php ? I get a blank page and nothing tells me what 's wrong ?

Thanks
hicham



Turn on error reporting.

--
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



[PHP] Debuggin PHP

2006-04-26 Thread hicham
Hello
 I'm a newbie in php world , and I'm trying to get a php 4 script work
on an php5 version
how do i debug php ? I get a blank page and nothing tells me what 's wrong ?

Thanks
hicham

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



Re: [PHP] How to execute multiples querys

2006-04-26 Thread Martin Alterisio
You should be able to do this in two calls to the mysql_query() function.
mysql_query("SET @var1=3");
mysql_query("SELECT * from table1 Where [EMAIL PROTECTED]");

2006/4/26, Mauricio Pellegrini <[EMAIL PROTECTED]>:
>
> Hi all
>
> I'm trying to execute two querys and they execute perfectly in fact,
> but after the execution of the first query there suposed to be some
> variable setted to a certain value.
>
> The problem is this variable is not available at the time the second
> query runs.
>
> I`ll try to explain a little bit further
>
> //This is my first query
>
> $quer1=" SET @var1=3 ";//Here I`m suposed to set the value for var1 to 3
> mysql_query($quer1);
>
> // This is query #2
>
> $query2="SELECT * from table1 where [EMAIL PROTECTED] "//Here @var1 doesn`t
> exist
>
>
> That wasn't really my first attempt. Originally
> I've tryied the whole thing in just one single query but mysql gave me
> an error message complinning about the semicolon
>
> Please look at this
>
> $quer1 = "SET @var1=3 ;
> SELECt * from table1 Where [EMAIL PROTECTED] " ;
>
>
> This gave a syntax error from MySQL inmmediately before the ";"
> (semicolon),
>
>
> Please any help greatefully appreciated
>
> Thanks
> Mauricio
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Using linkDisplayFields of FormBuilder

2006-04-26 Thread Joe Henry
On Tuesday 25 April 2006 4:36 pm, Tom wrote:
>  instead we recommend emailing
> [EMAIL PROTECTED] where you are more likely to get answer.

You found the PHP-general list instead of the Pear-general list. Here's a link 
to the Pear mailing list page:

http://pear.php.net/support/lists.php

HTH
-- 
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]

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



Re: [PHP] How to execute multiples querys

2006-04-26 Thread Mauricio Pellegrini
On Wed, 2006-04-26 at 11:04, chris smith wrote:
> On 4/26/06, Mauricio Pellegrini <[EMAIL PROTECTED]> wrote:
> > On Wed, 2006-04-26 at 10:32, nicolas figaro wrote:
> > > Mauricio Pellegrini a écrit :
> > > > Hi all
> > > >
> > > > I'm trying to execute two querys and they execute perfectly in fact,
> > > > but after the execution of the first query there suposed to be some
> > > > variable setted to a certain value.
> > > >
> > > > The problem is this variable is not available at the time the second
> > > > query runs.
> > > >
> > > > I`ll try to explain a little bit further
> > > >
> > > > //This is my first query
> > > >
> > > > $quer1=" SET @var1=3 ";//Here I`m suposed to set the value for var1 to 3
> > > > mysql_query($quer1);
> > > >
> > > > // This is query #2
> > > >
> > > > $query2="SELECT * from table1 where [EMAIL PROTECTED] "//Here @var1 
> > > > doesn`t
> > > > exist
> 
> If you try this through a mysql console or through something like
> phpmyadmin does it work?
> 

Yes, it works.

> --
> 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] PHP 5 + Apache 2 on Windows: ms sql extension problem

2006-04-26 Thread Ing. Edwin Cruz
Try changing your direcive extension_dir:
extension_dir="C:/PHP/ext"  instead of extension_dir="C:\PHP\ext"




-Mensaje original-
De: Laszlo Nagy [mailto:[EMAIL PROTECTED] 
Enviado el: Miércoles, 26 de Abril de 2006 04:01 a.m.
Para: php-general@lists.php.net
Asunto: [PHP] PHP 5 + Apache 2 on Windows: ms sql extension problem



 Hello All,

I had a problem with a Win2003 server, IIS6 and PHP 5.1.2. The MS SQL 
extension was not working. I did not get an answer, but some people 
suggested me to use Apache. Now I installed Win 2000 server, Apache 
2.0.55 and PHP 5.1.2. The same computer has Microsoft SQL Server 
installed. I have only these lines in my php.ini file:

extension_dir="C:\PHP\ext"
extension=php_mssql.dll

I checked phpinfo() and it tells that my php.ini file is at the correct 
location (C:\winnt\php.ini.) I can load other extensions. Another 
example: if I add "php_curl.dll" then I get a "libsleay32.dll not found" 
error message when I try to restart apache. But I do not get any error 
message about the php_mssql.dll. It is just not loaded. I'm sure that 
all the ms sql client libs are installed, because this is the same 
machine where the ms sql server is running. What can be the problem? 
Please help me. My bosses are killing me because I could not solve this 
problem for weeks. :-(

Thanks,

  Laszlo

-- 
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] Re: Php function to Set focus On A form Field

2006-04-26 Thread Ing. Edwin Cruz
Or if you have header.inc.php and the body tag is global then in your
form.inc.php(for example) or in your template, you can do this:


Window.onLoad=function(){
document.nameform.inputField.focus();
}




Regards!



-Mensaje original-
De: Philipp Kopf [mailto:[EMAIL PROTECTED] 
Enviado el: Miércoles, 26 de Abril de 2006 01:42 a.m.
Para: php-general@lists.php.net
Asunto: [PHP] Re: Php function to Set focus On A form Field


marvin hunkin schrieb:
> Hi.
> is there any php or java script function, where i can embed into my 
> php
> or html file, to set focus on to the first form field, like a text box, 
> to go to that field first, and not to go to the link or button first.
> if there are any tips, tricks, or links or code examples, how to fix 
> this problem.
> let me know.
> cheers Marvin.

Hi.

It is not possible to do that using PHP but you can use JavaScript 
instead. I recommend the function focus(). For example:


Check this tiny tutorial: 
http://javascript.internet.com/page-details/focus-onload.html

Did you already remarked that http://www.google.com is using this 
function to automatically set the focus on the search field.

regards

Philipp

-- 
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] bookmarking with a trademark sign in title

2006-04-26 Thread Satyam
The problem usually is that many of the 'things' surrounding the main window 
of the browser do not understand HTML and its special characters.   The 
favorites or history lists are often one of them.  Most have solved the 
rendering of the  but not all.


If your target is mainly Windows clients, the best option is using 
iso-8859-1 as the character set and use the native windows trademark symbol. 
In that way, your browser main window will understand it as per the 
character encoding, and windows itself will also understand it for the rest 
of the controls where the internal windows character set is used.


Satyam



- Original Message - 
From: "chris smith" <[EMAIL PROTECTED]>

To: "Angelo Zanetti" <[EMAIL PROTECTED]>
Cc: "PHP List" 
Sent: Wednesday, April 26, 2006 4:09 PM
Subject: Re: [PHP] bookmarking with a trademark sign in title


On 4/26/06, Angelo Zanetti <[EMAIL PROTECTED]> wrote:

Hi all,

This might be slightly OT but it is related to a PHP project.
I have a link on the site Im developing to bookmark the site. The title is 
XYZ company™ but when the add bookmark window comes up for saving the 
bookmark, I cannot see the ™ sign. Does anyone have any

idea of how to get this site to be saved with the name of the company?


There are a couple of different ways to print the TM..

http://www.w3schools.com/tags/ref_entities.asp

If that doesn't work, I guess you're stuck..

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

--
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] How to execute multiples querys

2006-04-26 Thread Mauricio Pellegrini
On Wed, 2006-04-26 at 11:09, nicolas figaro wrote:
> Mauricio Pellegrini a écrit :
> >>> $quer1 = "SET @var1=3 ;
> >>>   SELECt * from table1 Where [EMAIL PROTECTED] " ;
> >>>
> >>>
> >>> This gave a syntax error from MySQL inmmediately before the ";"
> >>> (semicolon),
> >>>


> >>>   
> did you try to run the query above
> 
> ( SET @var1=3 ; SELECt * from table1 Where [EMAIL PROTECTED] )
> 
> directly from a mysql client ?

Yes, I did and it Works perfectly.


> perhaps the @ is interpreted and you have to put a \ before it.
> try a print $quer1 once $quer1 is set.

I've tried this too. The output is sintactically correct.
I even copied the output of the query and pasted it to Mysqlcc an
executed it perfectly.



A few minutes ago I found that mysql_query() cannot execute more than
one query at a time 
so the form mysql_query("SET @var1=3 ; SELECT * from ") is invalid 


But the other way should work

Thanks 
Mauricio


> >>> Please any help greatefully appreciated
> >>>
> >>> Thanks 
> >>> Mauricio 
> >>>
> >>>   
> >>>   
> >
> >
> > Yes, I need to do it exactly this way.
> > I mean , SET the value for the variable @var1 first.
> > Then execute an undefined number of querys that reference this variable
> > and its value.
> >
> > Thanks 
> > Mauricio
> >
> >   

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



Re: [PHP] How to execute multiples querys

2006-04-26 Thread Mauricio Pellegrini
On Wed, 2006-04-26 at 11:04, chris smith wrote:
> On 4/26/06, Mauricio Pellegrini <[EMAIL PROTECTED]> wrote:
> > On Wed, 2006-04-26 at 10:32, nicolas figaro wrote:
> > > Mauricio Pellegrini a écrit :
> > > > Hi all
> > > >
> > > > I'm trying to execute two querys and they execute perfectly in fact,
> > > > but after the execution of the first query there suposed to be some
> > > > variable setted to a certain value.
> > > >
> > > > The problem is this variable is not available at the time the second
> > > > query runs.
> > > >
> > > > I`ll try to explain a little bit further
> > > >
> > > > //This is my first query
> > > >
> > > > $quer1=" SET @var1=3 ";//Here I`m suposed to set the value for var1 to 3
> > > > mysql_query($quer1);
> > > >
> > > > // This is query #2
> > > >
> > > > $query2="SELECT * from table1 where [EMAIL PROTECTED] "//Here @var1 
> > > > doesn`t
> > > > exist
> 
> If you try this through a mysql console or through something like
> phpmyadmin does it work?

Yes, It works perfectly!.

>From Mysql console or MysqlCC or EMS MySQLmanager


> --
> 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] session

2006-04-26 Thread chris smith
On 4/27/06, Sichta, Daniel <[EMAIL PROTECTED]> wrote:
> Login.php
>  // starting session here
> require_once("include/init.inc");

and what's in that file - only the session related stuff.

If you pass the sessionid across does it work:


http://www.designmagick.com/

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



RE: [PHP] session

2006-04-26 Thread Sichta, Daniel
Login.php



User



Passwrod




">


Login.php


window.location.href = "admin.php";











No Frames!
No frames in your browser!




And for example in menu.php I'm using
require_once("include/init.inc");

DS
-Original Message-
From: chris smith [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 4:10 PM
To: Sichta, Daniel
Cc: php-general@lists.php.net
Subject: Re: [PHP] session

On 4/27/06, Sichta, Daniel <[EMAIL PROTECTED]> wrote:
> Here is application flow
> Index.php = login page, I need to start session here. From here
> (successful login) I'm going to admin.php which is
> Frameset page with source pages.

That's nice.. but doesn't help us. We need to see code.

--
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] session

2006-04-26 Thread chris smith
On 4/27/06, Sichta, Daniel <[EMAIL PROTECTED]> wrote:
> Here is application flow
> Index.php = login page, I need to start session here. From here
> (successful login) I'm going to admin.php which is
> Frameset page with source pages.

That's nice.. but doesn't help us. We need to see code.

--
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] How to execute multiples querys

2006-04-26 Thread nicolas figaro

Mauricio Pellegrini a écrit :

$quer1 = "SET @var1=3 ;
SELECt * from table1 Where [EMAIL PROTECTED] " ;


This gave a syntax error from MySQL inmmediately before the ";"
(semicolon),

  

did you try to run the query above

( SET @var1=3 ; SELECt * from table1 Where [EMAIL PROTECTED] )

directly from a mysql client ?
perhaps the @ is interpreted and you have to put a \ before it.
try a print $quer1 once $quer1 is set.

Please any help greatefully appreciated

Thanks 
Mauricio 

  
  



Yes, I need to do it exactly this way.
I mean , SET the value for the variable @var1 first.
Then execute an undefined number of querys that reference this variable
and its value.

Thanks 
Mauricio


  


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



Re: [PHP] bookmarking with a trademark sign in title

2006-04-26 Thread chris smith
On 4/26/06, Angelo Zanetti <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> This might be slightly OT but it is related to a PHP project.
> I have a link on the site Im developing to bookmark the site. The title is 
> XYZ company™ but when the add bookmark window comes up for saving the 
> bookmark, I cannot see the ™ sign. Does anyone have any
> idea of how to get this site to be saved with the name of the company?

There are a couple of different ways to print the TM..

http://www.w3schools.com/tags/ref_entities.asp

If that doesn't work, I guess you're stuck..

--
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] session

2006-04-26 Thread Sichta, Daniel
Here is application flow
Index.php = login page, I need to start session here. From here
(successful login) I'm going to admin.php which is 
Frameset page with source pages.

DS

-Original Message-
From: chris smith [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 4:02 PM
To: Sichta, Daniel
Cc: php-general@lists.php.net
Subject: Re: [PHP] session

On 4/26/06, Sichta, Daniel <[EMAIL PROTECTED]> wrote:
>
> -Original Message-
> From: chris smith [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 26, 2006 2:18 PM
> To: Sichta, Daniel
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] session
>
> On 4/26/06, Sichta, Daniel <[EMAIL PROTECTED]> wrote:
> > Hi there !!
> >
> > I have web app which using frames. After session timeout my session
is
> > killed.
> > The problem is that session is killed even when I doing requests to
> the
> > server.
> > I know why (session is "chain" to the frameset page) but what's the
> > solution for this?
>
> Do you have session_start at the top of every page?
> A:Yes I do !
>
> Does it happen on certain pages?
> A:On every page !!
>
> Does it happen when you perform a particular action?
> A:No !! On any action
>
> We need a lot more info about what's going on.
> A: I have declared framesets in index.php and after that I'm sending
> request from frameset source pages.
> This is (IMHO)

Where's the rest of the sentence?

Always CC the list. You will get more people looking at your
questions/answers and you will most likely get a quicker response.

Can you explicitly pass the sessionid across:

  
  
  
  

?

Sounds like you're missing something really basic if you're having
issues with every page. Post some code in pastebin.com and send us the
url so we can see what you're doing..

--
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] bookmarking with a trademark sign in title

2006-04-26 Thread Jay Blanchard
[snip]
This might be slightly OT but it is related to a PHP project.
I have a link on the site Im developing to bookmark the site. The title
is XYZ company(tm) but when the add bookmark window comes up for saving
the bookmark, I cannot see the (tm) sign. Does anyone have any 
idea of how to get this site to be saved with the name of the company?
[/snip]

Use the html special character for the TM...I think it is ®

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



Re: [PHP] How to execute multiples querys

2006-04-26 Thread chris smith
On 4/26/06, Mauricio Pellegrini <[EMAIL PROTECTED]> wrote:
> On Wed, 2006-04-26 at 10:32, nicolas figaro wrote:
> > Mauricio Pellegrini a écrit :
> > > Hi all
> > >
> > > I'm trying to execute two querys and they execute perfectly in fact,
> > > but after the execution of the first query there suposed to be some
> > > variable setted to a certain value.
> > >
> > > The problem is this variable is not available at the time the second
> > > query runs.
> > >
> > > I`ll try to explain a little bit further
> > >
> > > //This is my first query
> > >
> > > $quer1=" SET @var1=3 ";//Here I`m suposed to set the value for var1 to 3
> > > mysql_query($quer1);
> > >
> > > // This is query #2
> > >
> > > $query2="SELECT * from table1 where [EMAIL PROTECTED] "//Here @var1 
> > > doesn`t
> > > exist

If you try this through a mysql console or through something like
phpmyadmin does it work?

--
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] session

2006-04-26 Thread chris smith
On 4/26/06, Sichta, Daniel <[EMAIL PROTECTED]> wrote:
>
> -Original Message-
> From: chris smith [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 26, 2006 2:18 PM
> To: Sichta, Daniel
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] session
>
> On 4/26/06, Sichta, Daniel <[EMAIL PROTECTED]> wrote:
> > Hi there !!
> >
> > I have web app which using frames. After session timeout my session is
> > killed.
> > The problem is that session is killed even when I doing requests to
> the
> > server.
> > I know why (session is "chain" to the frameset page) but what's the
> > solution for this?
>
> Do you have session_start at the top of every page?
> A:Yes I do !
>
> Does it happen on certain pages?
> A:On every page !!
>
> Does it happen when you perform a particular action?
> A:No !! On any action
>
> We need a lot more info about what's going on.
> A: I have declared framesets in index.php and after that I'm sending
> request from frameset source pages.
> This is (IMHO)

Where's the rest of the sentence?

Always CC the list. You will get more people looking at your
questions/answers and you will most likely get a quicker response.

Can you explicitly pass the sessionid across:

  
  
  
  

?

Sounds like you're missing something really basic if you're having
issues with every page. Post some code in pastebin.com and send us the
url so we can see what you're doing..

--
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] How to execute multiples querys

2006-04-26 Thread Mauricio Pellegrini
On Wed, 2006-04-26 at 10:32, nicolas figaro wrote:
> Mauricio Pellegrini a écrit :
> > Hi all
> >
> > I'm trying to execute two querys and they execute perfectly in fact,
> > but after the execution of the first query there suposed to be some
> > variable setted to a certain value. 
> >
> > The problem is this variable is not available at the time the second
> > query runs. 
> >
> > I`ll try to explain a little bit further
> >
> > //This is my first query 
> >
> > $quer1=" SET @var1=3 ";//Here I`m suposed to set the value for var1 to 3
> > mysql_query($quer1);
> >
> > // This is query #2
> >
> > $query2="SELECT * from table1 where [EMAIL PROTECTED] "//Here @var1 doesn`t
> > exist 
> >
> >   
> why don't you build the second query directly with the value ?
> $query2 = "SELECT * from table where col1=".$value;
> 
> why do you need a query to set @VAR1=3 ?
> (do you plan to use @VAR in another query ?).
> 
> N F
> 
> > That wasn't really my first attempt. Originally
> > I've tryied the whole thing in just one single query but mysql gave me
> > an error message complinning about the semicolon
> >
> > Please look at this
> >
> > $quer1 = "SET @var1=3 ;
> > SELECt * from table1 Where [EMAIL PROTECTED] " ;
> >
> >
> > This gave a syntax error from MySQL inmmediately before the ";"
> > (semicolon),
> >
> >
> > Please any help greatefully appreciated
> >
> > Thanks 
> > Mauricio 
> >
> >   


Yes, I need to do it exactly this way.
I mean , SET the value for the variable @var1 first.
Then execute an undefined number of querys that reference this variable
and its value.

Thanks 
Mauricio

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



[PHP] bookmarking with a trademark sign in title

2006-04-26 Thread Angelo Zanetti

Hi all,

This might be slightly OT but it is related to a PHP project.
I have a link on the site Im developing to bookmark the site. The title is XYZ company™ but when the add bookmark window comes up for saving the bookmark, I cannot see the ™ sign. Does anyone have any 
idea of how to get this site to be saved with the name of the company?


TIA.

Angelo

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



Re: [PHP] Filter out MS Word 'quotes' for RSS

2006-04-26 Thread Evan Priestley


On Apr 26, 2006, at 5:45 AM, Kevin Davies wrote:

Obviously I need to convert these on entry, or on output into RSS.  
Does
anyone know of an easy way to do this, or is it a case of  
identifying each

unusual character individually?


These high-ascii characters have ord() values greater than 126. If  
you're rendering to HTML, you can go through your string converting  
them into '&#ord_value;', where `ord_value' is the return from ord()  
(so your result looks like "Ò"), which will fix the primary  
problem (things breaking) and should at least limit the damage on the  
secondary problem (loss of information). In my experience, however,  
this will clobber some entities pretty badly. Alternatively, you can  
just zap them (into "*" or "~" or some other printable character),  
which will work better for text rendering.


You can also mix the two, by identifying individually those  
characters that you are concerned with preserving and zapping the  
others, e.g.


* Validate a string as being gremlin-free text. Characters with  
ordinal value

* greater than 126 will be converted into the best equivalent.
*
* @param any Something which might be a string.
*
* @returns array|bool True (valid), false (not valid), or an array of
*  unconverted exception ordinal values (valid but dirty).
*/
function validate_text( &$text ) {

static $conversions = array(
 // Windows & Word
 133=> '…'
,145=> '‘'
,146=> '’'
,147=> '“'
,148=> '”'
,149=> '•'
,150=> '–'
,151=> '—'

 // Mac
,165=> '•'
,208=> '–'
,209=> '—'
,210=> '“'
,211=> '”'
,212=> '‘'
,213=> '’'
);

if( is_scalar( $text ) || is_null( $text ) ) {

$corpus = str_replace(
 array_map( 'chr', array_keys( $conversions ) )
,$conversions
,$text
);

$gremlins = array( );

for( $ii = 0; $ii < strlen( $corpus ); $ii++ ) {
if( ($ordv = ord( $corpus[ $ii ]) ) > 126 ) {
$gremlins[ $ii ] = $ordv;
$corpus[ $ii ] = '*';
}
}

$text = $corpus;

if( count( $gremlins ) ) {
return $gremlins;
}

return true;
}

return false;
}

?>

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



Re: [PHP] How to execute multiples querys

2006-04-26 Thread nicolas figaro

Mauricio Pellegrini a écrit :

Hi all

I'm trying to execute two querys and they execute perfectly in fact,
but after the execution of the first query there suposed to be some
variable setted to a certain value. 


The problem is this variable is not available at the time the second
query runs. 


I`ll try to explain a little bit further

//This is my first query 


$quer1=" SET @var1=3 ";//Here I`m suposed to set the value for var1 to 3
mysql_query($quer1);

// This is query #2

$query2="SELECT * from table1 where [EMAIL PROTECTED] "//Here @var1 doesn`t
exist 

  

why don't you build the second query directly with the value ?
$query2 = "SELECT * from table where col1=".$value;

why do you need a query to set @VAR1=3 ?
(do you plan to use @VAR in another query ?).

N F


That wasn't really my first attempt. Originally
I've tryied the whole thing in just one single query but mysql gave me
an error message complinning about the semicolon

Please look at this

$quer1 = "SET @var1=3 ;
SELECt * from table1 Where [EMAIL PROTECTED] " ;


This gave a syntax error from MySQL inmmediately before the ";"
(semicolon),


Please any help greatefully appreciated

Thanks 
Mauricio 

  


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



[PHP] How to execute multiples querys

2006-04-26 Thread Mauricio Pellegrini
Hi all

I'm trying to execute two querys and they execute perfectly in fact,
but after the execution of the first query there suposed to be some
variable setted to a certain value. 

The problem is this variable is not available at the time the second
query runs. 

I`ll try to explain a little bit further

//This is my first query 

$quer1=" SET @var1=3 ";//Here I`m suposed to set the value for var1 to 3
mysql_query($quer1);

// This is query #2

$query2="SELECT * from table1 where [EMAIL PROTECTED] "//Here @var1 doesn`t
exist 


That wasn't really my first attempt. Originally
I've tryied the whole thing in just one single query but mysql gave me
an error message complinning about the semicolon

Please look at this

$quer1 = "SET @var1=3 ;
SELECt * from table1 Where [EMAIL PROTECTED] " ;


This gave a syntax error from MySQL inmmediately before the ";"
(semicolon),


Please any help greatefully appreciated

Thanks 
Mauricio 

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



Re: [PHP] cURL & cookies

2006-04-26 Thread Eric Butera
On 4/25/06, Richard Lynch <[EMAIL PROTECTED]> wrote:Sounds to me like we have
different versions of cURL and yours is

> better. :-)
>
> Mine phpinfo() curl section has:
> libcurl/7.15.3 OpenSSL/0.9.7d zlib/1.2.1
>
> which would seem to be the most current version...
>
> Or, perhaps, the order in which you set the options matters?  Ick.
>
> For me, at least, the Cookie jar did not work until I took out the
> CURLOPT_HEADER, and it DID work after I changed that, and only that.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
>
> Our production server uses this:
Php 4.4.0
CURL Information libcurl/7.15.1 OpenSSL/0.9.8a zlib/1.1.4

My local machine:
Php 4.3.11
CURL Information libcurl/7.10.5 OpenSSL/0.9.7i ipv6 zlib/1.2.3
(not by choice ;))


Re: [PHP] Pear Package HTTP_Request

2006-04-26 Thread Markus Braun

sorry



From: "chris smith" <[EMAIL PROTECTED]>
To: "Markus Braun" <[EMAIL PROTECTED]>
CC: php-general@lists.php.net
Subject: Re: [PHP] Pear Package HTTP_Request
Date: Wed, 26 Apr 2006 21:21:24 +1000

> i try to install the HTTP_Request package.
>
> I installed also the Net_Socket with
>
> pear install Net_Socket-1.0.6
>
> But it exists.
>
> Than i try to install the HTTP_Request:
>
> downloading HTTP_Request-1.3.0.tgz ...
> Starting to download HTTP_Request-1.3.0.tgz (13,808 bytes)
> .done: 13,808 bytes
> requires package `Net_Socket' >= 1.0.2
> HTTP_Request: Dependencies failed
>
>
> Then it comes this.
>
> So i dont understand what the problem is.
> I installed the new version of net socket already.

You're better off asking the pear list: 
http://pear.php.net/support/lists.php


They will be able to help you a lot quicker than we can..

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


_
Haben Spinnen Ohren? Finden Sie es heraus – mit dem MSN Suche Superquiz via  
http://www.msn-superquiz.de  Jetzt mitmachen und gewinnen!


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



Re: [PHP] Serveral forms in a page.

2006-04-26 Thread chris smith
On 4/25/06, William Stokes <[EMAIL PROTECTED]> wrote:
> Hello,
>
> This "might be" more HTML stuff but anyway...
>
> I have several forms in a page which is ok otherwise but the reset buttons
> doesn't clear anything that is queried from DB and printed to the text
> fields. Any idea how to create Reset buttons that clear the fields even when
> the data is not from user input? Or do I have to create reset buttons that
> are actually submit buttons and play with variables after that or something
> like that? Javascript is the way I don't want to go...

The reset button restores the form back to it's original state - if
you preload values or preselect options when you display the form,
then that's what it will reset it back to.


Blah: 



Change 'blah', hit 'reset' and it will change it back to 12345.

If you want to completely reset the form, then you'll have to either
use javascript or refresh the page with a flag and check..




Blah: 



--
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] session

2006-04-26 Thread chris smith
On 4/26/06, Sichta, Daniel <[EMAIL PROTECTED]> wrote:
> Hi there !!
>
> I have web app which using frames. After session timeout my session is
> killed.
> The problem is that session is killed even when I doing requests to the
> server.
> I know why (session is "chain" to the frameset page) but what's the
> solution for this?

Do you have session_start at the top of every page?

Does it happen on certain pages? Does it happen when you perform a
particular action? We need a lot more info about what's going on.

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

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



  1   2   >