[PHP] I am not able to download domxml for PHP5

2006-04-11 Thread Oz
Please help, I am not able to download domxml for PHP5
I have tried this location,
http://us3.php.net/manual/en/ref.domxml.php

I get a message file not found.

is there a mirror site.

Thanks

Please also mail response to
[EMAIL PROTECTED] 

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



Re: [PHP] I am not able to download domxml for PHP5

2006-04-11 Thread Joe Wollard
Oz,

From your command line, try:

pecl install domxml

You'll need to be root to do so, but as long as you have PECL/PEAR
installed this should give you domxml. Remember to restart your web
server after doing so.

- Joe


On 4/11/06, Oz [EMAIL PROTECTED] wrote:
 Please help, I am not able to download domxml for PHP5
 I have tried this location,
 http://us3.php.net/manual/en/ref.domxml.php

 I get a message file not found.

 is there a mirror site.

 Thanks

 Please also mail response to
 [EMAIL PROTECTED]

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



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



Re: [PHP] I am not able to download domxml for PHP5

2006-04-11 Thread Joe Wollard
Of course you said you're running PHP5so that won't work.
According to the site it would be best for you to use the DOM that
comes pre compiled with PHP. http://us3.php.net/manual/en/ref.dom.php

Sorry about the mix up on my part.


On 4/11/06, Joe Wollard [EMAIL PROTECTED] wrote:
 Oz,

 From your command line, try:

 pecl install domxml

 You'll need to be root to do so, but as long as you have PECL/PEAR
 installed this should give you domxml. Remember to restart your web
 server after doing so.

 - Joe


 On 4/11/06, Oz [EMAIL PROTECTED] wrote:
  Please help, I am not able to download domxml for PHP5
  I have tried this location,
  http://us3.php.net/manual/en/ref.domxml.php
 
  I get a message file not found.
 
  is there a mirror site.
 
  Thanks
 
  Please also mail response to
  [EMAIL PROTECTED]
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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



Re: [PHP] I am not able to download domxml for PHP5

2006-04-11 Thread Oz
For some reason my PHP5 does not have DOM. ( I have the version that 
comes with fedora core 5). Is there a way to activate it.


-thanks
Oz

Joe Wollard wrote:

Of course you said you're running PHP5so that won't work.
According to the site it would be best for you to use the DOM that
comes pre compiled with PHP. http://us3.php.net/manual/en/ref.dom.php

Sorry about the mix up on my part.


On 4/11/06, Joe Wollard [EMAIL PROTECTED] wrote:

Oz,

From your command line, try:

pecl install domxml

You'll need to be root to do so, but as long as you have PECL/PEAR
installed this should give you domxml. Remember to restart your web
server after doing so.

- Joe


On 4/11/06, Oz [EMAIL PROTECTED] wrote:

Please help, I am not able to download domxml for PHP5
I have tried this location,
http://us3.php.net/manual/en/ref.domxml.php

I get a message file not found.

is there a mirror site.

Thanks

Please also mail response to
[EMAIL PROTECTED]

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




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



Re: [PHP] I am not able to download domxml for PHP5

2006-04-11 Thread Rob Richards

Oz wrote:
For some reason my PHP5 does not have DOM. ( I have the version that 
comes with fedora core 5). Is there a way to activate it.


-thanks
Oz


You need to install the php-xml rpm to get the xml extensions (dom, xsl, 
xmlwriter and xmlreader).


Rob

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



Re: [PHP] how to assign a value to a variable inside a class

2006-04-11 Thread Merlin

Hi there,

no much simpler. I do not need to assign the value from outside the class. This 
is just inside the class. I have the login data for a database saved in a file 
and would like to use simply the variable $DB_login inside this class.


This does not work:

$this-db_username = $DB_login;  

Any idas on how to do this?

Thanx a million,

Merlin

Brad Bonkoski schrieb:

How about this:

class foo {
   var $name;

   function setName($value) {
  $this-name = $value;
   }
}

-B

Merlin wrote:



Hi there,

I would like to assign a value inside a class like this:

var $db_username = $old_name;

Unfortunatelly this does not work and I do get following error:
Parse error: syntax error, unexpected T_VARIABLE, expecting 
T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'


Thank you for any hint on how to place a correct syntax on this.

Merlin



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



Re: [PHP] how to assign a value to a variable inside a class

2006-04-11 Thread chris smith
On 4/11/06, Merlin [EMAIL PROTECTED] wrote:
 Hi there,

 no much simpler. I do not need to assign the value from outside the class. 
 This
 is just inside the class. I have the login data for a database saved in a file
 and would like to use simply the variable $DB_login inside this class.

 This does not work:

 $this-db_username = $DB_login;

That's the right way to do it.

What are you seeing?

--
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] simpleXML - simplexml_load_file() timeout? [Resolved]

2006-04-11 Thread darren kirby
Just replying to my original post as means of a follow up. I have gone ahead 
and used Rasmus' code, he was correct in surmising I was only worried about 
an overloaded and slow responding site. It would be very atypical for the 
site to be down completely.

While the cache code was very interesting, I think it is a bit overkill 
considering the low amount of traffic my site receives. What I have done 
instead is to write the feed to a local file upon every update. I think it is 
more elegant to have an old feed than to have the terse Feed unavailable in 
the spot where the headlines should be.

I have tested by setting the timeout to '0' rather than yanking my ethernet 
cable and it seems to work well. I just don't have a suitable spare box to 
try the ethernet method, and setting the timeout to 0 seems to have the 
intended effect anyway.

Again, I just want to thank everybody involved for their time and effort, it 
is very much appreciated. 

Here is my function now, if anybody is interested:

function getFeed($url) {
$cache_version = $_SERVER['DOCUMENT_ROOT'] . /cache/ . basename($url);

$rfd = fopen($url, 'r');
stream_set_blocking($rfd,true);
stream_set_timeout($rfd, 5);  // 5-second timeout
$data = stream_get_contents($rfd);
$status = stream_get_meta_data($rfd);
fclose($rfd);
if ($status['timed_out']) {
$xml = simplexml_load_file($cache_version);
}
else {
$lfd = fopen($cache_version, 'w');
fwrite($lfd, $data);
fclose($lfd);
$xml = simplexml_load_string($data);
}

print ul\n;
foreach ($xml-channel-item as $item) {
$cleaned = str_replace(, amp;, $item-link);
print lia href='$cleaned'$item-title/a/li\n;
}
print /ul\n;
}

-d
-- 
darren kirby :: Part of the problem since 1976 :: http://badcomputer.org
...the number of UNIX installations has grown to 10, with more expected...
- Dennis Ritchie and Ken Thompson, June 1972


pgpSQRnWoXs98.pgp
Description: PGP signature


[PHP] XML its elements

2006-04-11 Thread Mohsen Pahlevanzadeh

Dear all,
I need to retrive content of my XML element.my element is translation.
translationMY _CONTENT/translation
Of course i wanna use PHP4 instead 5.
Please help me.
Yours,Mohsen

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



Re: [PHP] how to assign a value to a variable inside a class

2006-04-11 Thread Merlin

chris smith schrieb:

On 4/11/06, Merlin [EMAIL PROTECTED] wrote:

Hi there,

no much simpler. I do not need to assign the value from outside the class. This
is just inside the class. I have the login data for a database saved in a file
and would like to use simply the variable $DB_login inside this class.

This does not work:

$this-db_username = $DB_login;


That's the right way to do it.

What are you seeing?

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


The following code:
class search_helper extends AjaxACApplication
{
var $db_username;
$this-db_username   = $DB_LOGIN;

...does bring following error message:
Parse error: syntax error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or 
T_FUNCTION or T_VAR or '}' in file.inc on line 39


Line 39 is the one with $this

Any suggestions?

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



Re: [PHP] how to assign a value to a variable inside a class

2006-04-11 Thread chris smith
On 4/11/06, Merlin [EMAIL PROTECTED] wrote:
 chris smith schrieb:
  On 4/11/06, Merlin [EMAIL PROTECTED] wrote:
  Hi there,
 
  no much simpler. I do not need to assign the value from outside the class. 
  This
  is just inside the class. I have the login data for a database saved in a 
  file
  and would like to use simply the variable $DB_login inside this class.
 
  This does not work:
 
  $this-db_username = $DB_login;
 
  That's the right way to do it.
 
  What are you seeing?
 
  --
  Postgresql  php tutorials
  http://www.designmagick.com/

 The following code:
  class search_helper extends AjaxACApplication
  {
 var $db_username;
 $this-db_username  = $DB_LOGIN;

Try it like this:

class search_helper extends AjaxACApplication
{
  var $db_username;
...

function SetDBUsername($db_username) {
  $this-db_username = $db_username;
}


If you want to set a default:

var $db_username = '';

--
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 assign a value to a variable inside a class

2006-04-11 Thread Merlin

chris smith schrieb:

On 4/11/06, Merlin [EMAIL PROTECTED] wrote:

chris smith schrieb:

On 4/11/06, Merlin [EMAIL PROTECTED] wrote:

Hi there,

no much simpler. I do not need to assign the value from outside the class. This
is just inside the class. I have the login data for a database saved in a file
and would like to use simply the variable $DB_login inside this class.

This does not work:

$this-db_username = $DB_login;

That's the right way to do it.

What are you seeing?

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

The following code:
 class search_helper extends AjaxACApplication
 {
var $db_username;
$this-db_username  = $DB_LOGIN;


Try it like this:

class search_helper extends AjaxACApplication
{
  var $db_username;
...

function SetDBUsername($db_username) {
  $this-db_username = $db_username;
}


If you want to set a default:

var $db_username = '';

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


That looks like to much for just assigning value to a variable?!
I would need 4 of those functions just to set the value of 4 variables to a 
value saved inside another variable. If I do understand you right, I would

also have to call that function inside the class to get that value set?:

 function SetDBUsername($db_username) {
   $this-db_username = $db_username;
 }
 SetDBUsername();

Is there not something more easy than that. For example $var1 = $var2;

Merlin

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



Re: [PHP] how to assign a value to a variable inside a class

2006-04-11 Thread Brad Bonkoski



Merlin wrote:


chris smith schrieb:


On 4/11/06, Merlin [EMAIL PROTECTED] wrote:


chris smith schrieb:


On 4/11/06, Merlin [EMAIL PROTECTED] wrote:


Hi there,

no much simpler. I do not need to assign the value from outside 
the class. This
is just inside the class. I have the login data for a database 
saved in a file
and would like to use simply the variable $DB_login inside this 
class.


This does not work:

$this-db_username = $DB_login;


That's the right way to do it.

What are you seeing?

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


The following code:
 class search_helper extends AjaxACApplication
 {
var $db_username;
$this-db_username  = $DB_LOGIN;



Try it like this:

class search_helper extends AjaxACApplication
{
  var $db_username;
...

function SetDBUsername($db_username) {
  $this-db_username = $db_username;
}


If you want to set a default:

var $db_username = '';

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



That looks like to much for just assigning value to a variable?!
I would need 4 of those functions just to set the value of 4 variables 
to a value saved inside another variable. If I do understand you 
right, I would

also have to call that function inside the class to get that value set?:

 function SetDBUsername($db_username) {
   $this-db_username = $db_username;
 }
 SetDBUsername();

Is there not something more easy than that. For example $var1 = $var2;

Merlin



You're right...
This is the wonders of OOP.  Some people see this as nice because only 
your class has direct access to set your variables...so inside your 
'set' function you can do validation, formatting, etc... to make sure 
you are setting the variable to a proper value


Some people like the control, others think it is too much work with 
little gain, this is largely a political issue though, so we won't get 
into it too much.


Basically if you want to use classes you have to play by the rules of 
OOP.  To set and get a member variable within a class you need to define 
a function to do so. 


-Brad

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



Re: [PHP] PHP and CakePHP: How to use the $html-selectTag()

2006-04-11 Thread Miles Thompson

At 11:54 PM 4/10/2006, Pham Huu Le Quoc Phuc wrote:


Hi everybody!
I'm a newbie. My question maybe very funny. But please answer to me if you
have any ideas.
I use $html-selectTag(), I don't know how to use OnChange.
When User choose a item on SelectTag, I want Browser to redirect another
page and get current value.

Thank so much!


Cake is written in PHP, but your question concerns Cake, not PHP.

Have you asked in the Cake-PHP Google group?
http://groups.google.com/group/cake-php

or checked the wiki at the main Cake site?

Please understand, there are so many frameworks and  CMS's that those 
questions specific to them would choke the list.


Regards - Miles Thompson 



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.385 / Virus Database: 268.4.1/307 - Release Date: 4/10/2006

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



Re: [PHP] how to assign a value to a variable inside a class

2006-04-11 Thread Jarratt Ingram
If you are using PHP4, you could always

class foo {
  var $var1;
  var $var2;
  var $var3;

 function bar(){
  echo $this-var1.br /;
  echo $this-var2.br /;
  echo $this-var3.br /;
 }
}

then in your code

$foo = new foo();

$foo-var1 = 'blah';
$foo-var2 = 'blah';
$foo-var3 = 'blah';

$foo-bar();

Or you could

class foo {
  var $var1;
  var $var2;
  var $var3;

 function foo($var1='',$var2='',$var3=''){
   $this-var1 = $var1;
   $this-var2 = $var2;
   $this-var3 = $var3;
 }

function bar(){
  echo $var1.br /;
  echo $var2.br /;
  echo $var3.br /;
 }
}

$foo = new foo('blah1','blah2','blah3');
$foo-bar();

Note this will have to be written differently in PHP5 and up using public as
var  has been depreciated and using __construct instead of class name as the
constructor.  The  correct  way to set variables inside a class from user
space code was mentioned before using a set method as it allows the set
function to perform additional checks like type and so on and control is
kept to the class.  This can be tedious as it does add a little more code
but will save you in the long run when incase some developer decides to just
over write one of your variables by accident or not can be difficult to
track down.

HTH
Jarratt










On 4/11/06, Merlin [EMAIL PROTECTED] wrote:

 chris smith schrieb:
  On 4/11/06, Merlin [EMAIL PROTECTED] wrote:
  chris smith schrieb:
  On 4/11/06, Merlin [EMAIL PROTECTED] wrote:
  Hi there,
 
  no much simpler. I do not need to assign the value from outside the
 class. This
  is just inside the class. I have the login data for a database saved
 in a file
  and would like to use simply the variable $DB_login inside this
 class.
 
  This does not work:
 
  $this-db_username = $DB_login;
  That's the right way to do it.
 
  What are you seeing?
 
  --
  Postgresql  php tutorials
  http://www.designmagick.com/
  The following code:
   class search_helper extends AjaxACApplication
   {
  var $db_username;
  $this-db_username  = $DB_LOGIN;
 
  Try it like this:
 
  class search_helper extends AjaxACApplication
  {
var $db_username;
  ...
 
  function SetDBUsername($db_username) {
$this-db_username = $db_username;
  }
 
 
  If you want to set a default:
 
  var $db_username = '';
 
  --
  Postgresql  php tutorials
  http://www.designmagick.com/

 That looks like to much for just assigning value to a variable?!
 I would need 4 of those functions just to set the value of 4 variables to
 a
 value saved inside another variable. If I do understand you right, I would
 also have to call that function inside the class to get that value set?:

   function SetDBUsername($db_username) {
 $this-db_username = $db_username;
   }
   SetDBUsername();

 Is there not something more easy than that. For example $var1 = $var2;

 Merlin

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




RE: [PHP] XML its elements

2006-04-11 Thread Jay Blanchard
[snip]
I need to retrive content of my XML element.my element is translation.
translationMY _CONTENT/translation
Of course i wanna use PHP4 instead 5.
[/snip]

http://www.php.net/xml

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



[PHP] OT - PHP Webhost Dedicated Server

2006-04-11 Thread Suhas
Hello,

Any suggestions for Dedicated PHP Webhost.

The current service provider is ok but Customer service is
unsatisfactory. Very bad experience.

Thanks for your help in advance,

SP

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



RE: [PHP] OT - PHP Webhost Dedicated Server

2006-04-11 Thread Jay Blanchard
[snip]
Any suggestions for Dedicated PHP Webhost.
[/snip]

http://www.phpwebhosting.com 

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



Re: [PHP] OT - PHP Webhost Dedicated Server

2006-04-11 Thread Thomas Munz
www.ixwebhosting.com
www.hostexcellence.com
on Tuesday 11 April 2006 15:18, Suhas wrote:
 Hello,

 Any suggestions for Dedicated PHP Webhost.

 The current service provider is ok but Customer service is
 unsatisfactory. Very bad experience.

 Thanks for your help in advance,

 SP

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



[PHP] Re: how to assign a value to a variable inside a class

2006-04-11 Thread Eduardo Raúl Galván Sánchez

Check the overloading methods (__get and __set) for PHP 5.x:

http://www.php.net/manual/en/language.oop5.overloading.php

Merlin escribió:


Hi there,

I would like to assign a value inside a class like this:

var $db_username = $old_name;

Unfortunatelly this does not work and I do get following error:
Parse error: syntax error, unexpected T_VARIABLE, expecting 
T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'


Thank you for any hint on how to place a correct syntax on this.

Merlin


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



[PHP] a better way to transfer data?

2006-04-11 Thread blackwater dev
Hello all,

I am currently running freetds on a linux box that needs to move data from a
remote mssql db to the local mysql db.  I wanted to use bcp but freetds
couldn't as the data I am moving contains a blob field.  I am currently
using php to select all the rows from the mssql db, and then looping through
the results and putting them into the local mysql db but this is horribly
slow and there has to be a better way.

How can I do this more efficiently?

Thanks!


Re: [PHP] Need MySql Help Please

2006-04-11 Thread John Nichel

marvin hunkin wrote:

Hi.
any mysql gurus out there using a tool called EasyPHP 1-8?


Probably not.

i am using a my sql tutorial, and says needs the command line interface, 
so can run my sql commands from the dos prompt.

have got the PHP MYSQL ADMIM to load into the easy php 1-8, gui interface.
and when i type http://localhost/mysql/ it loads the browser, but would 
like the command line interface for version 5.0 of the my sql databaser 
admin server.
now if any good soul, who uses my sql, or my sql admin, or easy php, can 
show me how to set up the command line interface for Easy Php 1-8, then 
let me know.


How about asking the people at EasyPHP 1-8?

have tried looking on the net, and looking in the documentation, and 
folders, but cannot seem to set it up.

okay if any one can help me out, let me know.
cheers Marvin.
ps: need this info, as doing the tutorial towards the database 
assignment for my course.




Homework???

You did notice that this is a php list, for questions about php, right? 
 Two doors down on your right is the MySQL list.


--
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] PHP Programmer Opportunity

2006-04-11 Thread Zahra Husain
 

Hello,

 

Our client has a PHP Porgrammer position I am taking resumes for. Please
kindly call or email me at your earliest convenience. Thanks!

 

Position: HO # 6150: PHP Programmer
Location:  DOVER, NEW JERSEY
Duration: 6 month to year contract
 
SUMMARY 
Responsible for technical development for online and direct (where
applicable) sales applications by performing the following duties:

ESSENTIAL DUTIES AND RESPONSIBILITIES include the following:
Other duties may be assigned.

- Responsible for developing and maintaining all code of applications
from outside development projects excluding database code.  Review all
outside code to ensure quality and performance.
- Strictly adheres to departmental methodologies and standards.
- Responsible for proper testing and quality assurance of all
development work before managerial review.
- Monitors new development trends and best practices as provided by
outside industry authorities/associations/companies.
- Perform maintenance on existing sites as well as develop new
applications. 
- All other duties as may be assigned by other members of management.

QUALIFICATIONS  To perform this job successfully, an individual must be
able to perform each essential duty satisfactorily. The requirements
listed below are representative of the knowledge, skill, and/or ability
required. Reasonable accommodations may be made to enable individuals
with disabilities to perform the essential functions.

EDUCATION and/or EXPERIENCE 
Bachelor's degree from four-year college or university and seven to ten
years related experience; or advanced degree and five to ten years
related experience; or equivalent combination of education and
experience.

LANGUAGE SKILLS 
Ability to read, analyze, and interpret general business periodicals,
professional journals, technical procedures, or governmental
regulations. Ability to write reports, business correspondence, and
procedure manuals. Ability to effectively present information and
respond to questions from groups of managers, clients, customers, and
the general public.

MATHEMATICAL SKILLS 
High ability to calculate figures and amounts such as discounts,
interest, commissions, proportions, percentages and complex algorithms.
Ability to apply concepts of basic algebra and geometry.  Ability to
work with mathematical concepts such as probability and statistical
inference.  Ability to apply concepts such as fraction, percentages,
ratios, and proportions to practical situations.

REASONING ABILITY 
Ability to define problems, collect data, establish facts, and draw
valid conclusions. Ability to interpret an extensive variety of
technical instructions in mathematical or diagram form and deal with
several abstract and concrete variables.

OTHER SKILLS AND ABILITIES 
High competency to use a desktop computer and in the following
programming languages/technologies: HTML, CFML, PHP,  XML, SQL,
Java/JavaScript code, batch file, apache, UNIX, Lynux.  Ability to use
industry standard computing equipment including, but not limited to,
Microsoft Windows, word processing software package(s) (Microsoft Word
98 or higher) and spreadsheet software package(s) (Microsoft Excel).
Graphics packages, such as Adobe PhotoShop, PowerPoint are useful but
not required.

PHYSICAL DEMANDS  The physical demands described here are representative
of those that must be met by an employee to successfully perform the
essential functions of this job. Reasonable accommodations may be made
to enable individuals with disabilities to perform the essential
functions.

While performing the duties of this job, the employee is regularly
required to stand; walk; sit; use hands to finger, handle, or feel
objects, tools, or controls; and reach with hands and arms.  The
employee is occasionally required to talk or hear.

The employee must occasionally lift and/or move up to 25 pounds.
Specific vision abilities required by this job include close vision,
peripheral vision, depth perception, and the ability to adjust focus.

WORK ENVIRONMENT  The work environment characteristics described here
are representative of those an employee encounters while performing the
essential functions of this job. Reasonable accommodations may be made
to enable individuals with disabilities to perform the essential
functions.

 The noise level in the work environment is usually moderate.

Thank you,

Zahra Husain


Boden Inc.,One Executive Drive
Suite # 280, Somerset, NJ 08873

Website: www.bodeninc.com http://www.bodeninc.com 

Email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 

Tel: 1-888-247-6070 ext.578

Fax: 1-888-594-9584




 



[PHP] user authentication

2006-04-11 Thread Alain Roger
Hi,

i'm sure that it's a stupid question but i would like to have your feedback
on it.

i have MySQL  with 2 users in the mysql database which are root and
uimmense.
i suppose that what i see in the password field is the sha1 crypted
password.

is it correct or not ?

but lets continue...
in fact, my web application should use a database named immense.
in this database, there is a table named profiles.
in this table, the login uimmense and its MD5 password are stored.

the problem is :
when i use mysql_connect('localhost','uimmense',myMD5password); to connect
to MySQL database system, the connection is refused because the MD5 password
does not correspond to what is saved into users table within mysql
database... :-(

here is my question :
all my users registered into my immense database, should be also
registered as users of MySQL database system ? (which is stored into users
table, into mysql database) ?

is it clear ?

i do not see really realistic if everytime that a new user is registered to
my application, i have to create him a profile for MySQL database.

thanks a lot,
Alain


RE: [PHP] user authentication

2006-04-11 Thread Jim Moseby
 i do not see really realistic if everytime that a new user is 
 registered to
 my application, i have to create him a profile for MySQL database.


Is there a reason you need to have each user login into mysql individually?
Most often a single login is used for the script to log into the database,
and all the user authentication is handled at the PHP level.

JM

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



RE: [PHP] user authentication

2006-04-11 Thread Jay Blanchard
[snip]
i'm sure that it's a stupid question but i would like to have your
feedback
on it.

i have MySQL  with 2 users in the mysql database which are root and
uimmense.
i suppose that what i see in the password field is the sha1 crypted
password.

is it correct or not ?

but lets continue...
in fact, my web application should use a database named immense.
in this database, there is a table named profiles.
in this table, the login uimmense and its MD5 password are stored.

the problem is :
when i use mysql_connect('localhost','uimmense',myMD5password); to
connect
to MySQL database system, the connection is refused because the MD5
password
does not correspond to what is saved into users table within mysql
database... :-(

here is my question :
all my users registered into my immense database, should be also
registered as users of MySQL database system ? (which is stored into
users
table, into mysql database) ?

is it clear ?

i do not see really realistic if everytime that a new user is registered
to
my application, i have to create him a profile for MySQL database.
[/snip]

This is more suitable as a MySQL question. Having said that;

If you wish the user to have permissions on the MySQL database then you
must grant them permissions at which time they are added to the MySQL
user's database. Once they are added you must then flush the privileges
so that their permissions take effect. You can do this during
registration by executing these queries if the PHP user has permissions
to perform grants on the database. In all likelihood the PHP user (the
user which the script runs as) does not have permission to perform
grants.

http://www.mysql.com/grant
http://www.mysql.com/flush

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



[PHP] Strange problem after getting data from the DB

2006-04-11 Thread Ryan A
Hi,
I dont know if this is a bug or something but I am getting some strange
results from what should be a simple program;

I have a bunch of movie titles in my database, this is the structure:

part_url
part_size
part_format
bandwidth_type
flick_name

and the above table contains data like this:
domain.com/part1.mpg,144mb,MPG,LOW,Spiderman
domain.com/part2.mpg,104mb,MPG,LOW,Spiderman
domain.com/part3.mpg,110mb,MPG,LOW,Spiderman
etc




In my script I run this SQL:
select * from table order by flick_name
$num_rows = mysql_num_rows($q);

then a little below:

$flick=array();
for($i=0; $i  $num_rows; $i++)
 {
 $row = mysql_fetch_row($q);
 $flick_name  = $row[5];
 $part_url  = $row[0];
 $part_size  = $row[1];
 $time_length = $row[2];
 $part_format = $row[3];
 $bw_type  = $row[4];

$flick[$row[5]][] = array (part_url = $row['0'], part_size = $row[1],
time_length = $row[2],part_format = $row[3],bw_type = $row[4]);
 }


-
Which basically gets all the records nicely under the flicks name, then I
format the data onto my page like this:


Flick name
---
Part1.mpg - 144mb - MPG - LOW
Part2.mpg - 104mb - MPG - LOW
Part3.mpg - 110mb - MPG - LOW



So far so good, but heres where i am getting some strange results, there is
a movie called Try A Teen and for some reason this movie is split like
this



Try A Teen
---
Part1.mpg - 144mb - MPG - LOW
Part2.mpg - 104mb - MPG - LOW
Part3.mpg - 110mb - MPG - LOW

Try A Teen
---
Part4.mpg - 144mb - MPG - LOW
Part5.mpg - 104mb - MPG - LOW
Part6.mpg - 110mb - MPG - LOW


After a lot of searching through the page source I see that the first Try A
Teen has a line break (after the n in teen whatevers there appears on
the next line), thats why it seems different...but when I went into the
mySql db via phpmyadmin...there is no linebreak to be found anywhereand
all the other titles are working perfectly fine... what do you think is the
problem? Bug? Something with the script? MySql?

If you want the script or the DB email me offlist and i'll send it to you.

Thanks!

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



Re: [PHP] function by reference

2006-04-11 Thread tedd

At 7:31 PM -0700 4/10/06, Ray Hauge wrote:

 

 I believe you're thinking more of the C++ style of returning by reference.
 This article should help explain how references work, and how to return
 references... most specifically check the Returning References section.


  http://www.php.net/manual/en/language.references.php

nevermind... I what I read and what was actually written seem to have been two
entirely different things ;)  Still good info though.

--
Ray Hauge


Ray:

It was an interesting read -- but, I found it, and the comments, confusing.

The difference I was able to get was I know if you display a C 
pointer, would will see a memory address -- if you display a PHP 
reference, you will see the value. As such, one is a memory address 
and the other is a symbol table alias -- but they still seem to work 
the same. I haven't seen a working difference yet.


Additionally, what I don't get is this:

?php
$a = 10;
echo($a br/);
ref1($a);
echo($a br/);

$a = 10;
echo($a br/);
ref2($a);
echo($a br/);

$a = 10;
echo($a br/);
ref3($a);
echo($a br/);

?


?php
function ref1($a)
{
$a--;
}

?

?php
function ref2($a)
{
$a--;
}

?

?php
function ref3($a)
{
$a--;
}

?

The first two functions work as I would expect. The last one is shown 
in the documentation, but doesn't work as I expected. There doesn't 
appear to be any difference between ref1 and ref3 -- so what's with 
the ampersand in ref3? What is an ampersand supposed to mean/do 
when it precedes a function?


Thanks.

tedd
--

http://sperling.com

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



RE: [PHP] Strange problem after getting data from the DB

2006-04-11 Thread Jay Blanchard
[snip]
After a lot of searching through the page source I see that the first
Try A
Teen has a line break (after the n in teen whatevers there appears
on
the next line), thats why it seems different...but when I went into the
mySql db via phpmyadmin...there is no linebreak to be found
anywhereand
all the other titles are working perfectly fine... what do you think is
the
problem? Bug? Something with the script? MySql?
[/snip]

Let's try an experiment, do a string replace to get rid of the newline
and report back what happens.

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



Fwd: [PHP] user authentication

2006-04-11 Thread Alain Roger
 in fact no.

i can i have 1 MySQL database system profile uimmense to connect to
database.
and after via a PHP script to check if my user is registered into MY
database immense (checking profile and password).

if it's ok, so query or stored procedure can be executed, if not, connect to
DB is closed..

i was thinking to do such solution but i'm not so sure about security level
:-(

Alain


 On 4/11/06, Jay Blanchard [EMAIL PROTECTED] wrote:

 [snip]
 i'm sure that it's a stupid question but i would like to have your
 feedback
 on it.

 i have MySQL  with 2 users in the mysql database which are root and
 uimmense.
 i suppose that what i see in the password field is the sha1 crypted
 password.

 is it correct or not ?

 but lets continue...
 in fact, my web application should use a database named immense.
 in this database, there is a table named profiles.
 in this table, the login uimmense and its MD5 password are stored.

 the problem is :
 when i use mysql_connect('localhost','uimmense',myMD5password); to
 connect
 to MySQL database system, the connection is refused because the MD5
 password
 does not correspond to what is saved into users table within mysql
 database... :-(

 here is my question :
 all my users registered into my immense database, should be also
 registered as users of MySQL database system ? (which is stored into
 users
 table, into mysql database) ?

 is it clear ?

 i do not see really realistic if everytime that a new user is registered
 to
 my application, i have to create him a profile for MySQL database.
 [/snip]

 This is more suitable as a MySQL question. Having said that;

 If you wish the user to have permissions on the MySQL database then you
 must grant them permissions at which time they are added to the MySQL
 user's database. Once they are added you must then flush the privileges
 so that their permissions take effect. You can do this during
 registration by executing these queries if the PHP user has permissions
 to perform grants on the database. In all likelihood the PHP user (the
 user which the script runs as) does not have permission to perform
 grants.

 http://www.mysql.com/grant
 http://www.mysql.com/flush




Re: [PHP] php with ajax - uploading pictures

2006-04-11 Thread tedd

At 9:01 PM -0500 4/10/06, Richard Lynch wrote:

On Sun, April 9, 2006 3:21 pm, Merlin wrote:

 I am searching for a good upload framework that works with PHP and
 AJAX
 to provide an upload interface that uploads one picture instantly,
 shows
 the thumbnail and displays another upload formfield to select the next
 picture for upload.

 Is there something like this, or similar around?


I dunno where you plan to put the AJAX part...


-snip- code

Richard:

My understanding and experience (granted limited thus far) -- is that 
it's not like you put ajax into something, but rather the other way 
around. You use ajax to insert/inject code between specific html tags 
(i.e., DOM) to preform certain operations within those tags. Nothing 
else is changed.


As such, he could put the entire snip-it of code you just provided 
under the direction of ajax to be used within portion of the form 
that the loads images. That way only the loaded image would change 
and not the entire form.


While the demo below is not uploading a picture from a desktop, it is 
loading a picture from a file using ajax without reloading the entire 
page.


http://www.xn--ovg.com/ajax_w_picts/

Replace the code that is loading the picture from a file with 
uploading the picture from the desktop, and you have what he's 
asking.


However, using ajax here is not going to speed things up and by 
comparison, a simple refresh will take much less time than uploading 
an image -- so, what's the point other than not seeing a refresh?


HTH's

tedd
--

http://sperling.com

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



[PHP] [EMAIL PROTECTED]

2006-04-11 Thread Ryan A
Hey,


-


[snip]
After a lot of searching through the page source I see that the first
Try A
Teen has a line break (after the n in teen whatevers there appears
on
the next line), thats why it seems different...but when I went into the
mySql db via phpmyadmin...there is no linebreak to be found
anywhereand
all the other titles are working perfectly fine... what do you think is
the
problem? Bug? Something with the script? MySql?
[/snip]

Let's try an experiment, do a string replace to get rid of the newline
and report back what happens.--I did a
this:$flick_name  = rtrim($row[5]);But no joy if I do a string replace
how do I specify the newline in the needle parameter of the str_replace?I'm
pretty sure I have to use chr() but not sure how...am looking at the ascii
table now...Thanks!

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



[PHP] MS SQL extension not loading

2006-04-11 Thread Laszlo Nagy


 Hello All,

I have a problem with a Win2003 server, IIS6 and PHP 5.1.2. I have 
Microsoft SQL Server tools installed. C:\PHP is on the path. Extension 
dirs are configured correctly. The php_mssql.dll is present there. 
Everything looks okay, except that the server does not load the 
extension. If I do


var_dump(get_loaded_extensions())

then I get this:

array(23) { [0]= string(6) bcmath [1]= string(8) calendar [2]= 
string(10) com_dotnet [3]= string(5) ctype [4]= string(4) date 
[5]= string(3) ftp [6]= string(5) iconv [7]= string(4) odbc 
[8]= string(4) pcre [9]= string(10) Reflection [10]= string(7) 
session [11]= string(6) libxml [12]= string(8) standard [13]= 
string(9) tokenizer [14]= string(4) zlib [15]= string(9) 
SimpleXML [16]= string(3) dom [17]= string(3) SPL [18]= 
string(4) wddx [19]= string(3) xml [20]= string(9) xmlreader 
[21]= string(9) xmlwriter [22]= string(5) ISAPI }


What am I doing wrong? Please help me. I was trying for a week and 
nobody could help me on the hungarian PHP list. I'm lost.


  Laszlo

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



Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread tedd

Here is an example Wez wrote years ago:


-snip code -

Years ago?

stream_socket_client() is php5.

How long ago did php5 launch?

tedd
--

http://sperling.com

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



RE: [PHP] [EMAIL PROTECTED]

2006-04-11 Thread Jay Blanchard
[snip]
Let's try an experiment, do a string replace to get rid of the newline
and report back what happens.--I did a
this:$flick_name  = rtrim($row[5]);But no joy if I do a string
replace
how do I specify the newline in the needle parameter of the
str_replace?I'm
pretty sure I have to use chr() but not sure how...am looking at the
ascii
table now...Thanks!
[/snip]

http://www.php.net/str_replace

$new = str_replace(\n,  , $row[5]);

echo $new;

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



RE: [PHP] [EMAIL PROTECTED]

2006-04-11 Thread Ryan A
Hey,
First, sorry about the subject line, my mail program is giving me a bit of a
problem so had to use another..

--
[snip]
Let's try an experiment, do a string replace to get rid of the newline
and report back what happens.--I did a
this:$flick_name  = rtrim($row[5]);But no joy if I do a string
replace
how do I specify the newline in the needle parameter of the
str_replace?I'm
pretty sure I have to use chr() but not sure how...am looking at the
ascii
table now...Thanks!
[/snip]

http://www.php.net/str_replace

$new = str_replace(\n,  , $row[5]);

echo $new;-

Nope, that didnt work either so I manually re-entered each line (record)
and for some reason its working now

Thanks for your time and help.

Cheers!

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



Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread Rasmus Lerdorf

tedd wrote:

Here is an example Wez wrote years ago:


-snip code -

Years ago?

stream_socket_client() is php5.

How long ago did php5 launch?


The first beta was in June 2003.  But the streams code was written well 
before that.


-Rasmus

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



Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread tedd

At 10:31 AM -0700 4/11/06, Rasmus Lerdorf wrote:

tedd wrote:

Here is an example Wez wrote years ago:


-snip code -

Years ago?

stream_socket_client() is php5.

How long ago did php5 launch?


The first beta was in June 2003.  But the streams code was written 
well before that.


-Rasmus


I'm running php 4 and stream_socket_client() isn't there. So, I 
figured that the example written years ago, must have been as recent 
as php5.


tedd
--

http://sperling.com

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



[PHP] Session_id within URL

2006-04-11 Thread Alain Roger
Hi,

I would like to understand the purpose of placing SESSION_ID within the URL.
I suppose it is for security improving... However, how to do it ?

i mean how can it be useful ? how can i use it ?

thanks a lot,

Alain


[PHP] php varible in Javascript alert()

2006-04-11 Thread Mace Eliason

Hi,

I am not sure why this won't work I am pretty sure I have done it before;

if($error)
{
 echo $errorMessage;  // for testing error message is displayed to screen
 echoscript language=\JavaScript\alert('$errorMessage');/script;
}

I am capturing all the errors from a form and then output them all at once

Thanks for any help

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



RE: [PHP] php varible in Javascript alert()

2006-04-11 Thread Jay Blanchard
[snip]
if($error)
{
  echo $errorMessage;  // for testing error message is displayed to
screen
  echoscript
language=\JavaScript\alert('$errorMessage');/script;
}
[/snip]

What does $error contain? Echo it's output to the screen too, for
testing.

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



Re: [PHP] Session_id within URL

2006-04-11 Thread Brad Bonkoski

session_start();
$s = SID; //get Session ID
echo a href=\page.php?$s\Page/a;

Mostly for passing the session as a GET variable to another page, like 
for anything from authentication tokens to form data etc...
Of course for form data it would probably be better to encapsulate the 
session veriables within the form.


-B

Alain Roger wrote:


Hi,

I would like to understand the purpose of placing SESSION_ID within the URL.
I suppose it is for security improving... However, how to do it ?

i mean how can it be useful ? how can i use it ?

thanks a lot,

Alain

 



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



Re: [PHP] OT - PHP Webhost Dedicated Server

2006-04-11 Thread sgsweb

Suhas wrote:

Hello,

Any suggestions for Dedicated PHP Webhost.

The current service provider is ok but Customer service is
unsatisfactory. Very bad experience.

Thanks for your help in advance,

SP

  

http://www.websulting.com/

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



Re: [PHP] php varible in Javascript alert()

2006-04-11 Thread Anthony Ettinger
alert('echo $errorMessage');

On 4/11/06, Mace Eliason [EMAIL PROTECTED] wrote:
 Hi,

 I am not sure why this won't work I am pretty sure I have done it before;

 if($error)
 {
   echo $errorMessage;  // for testing error message is displayed to screen
   echoscript language=\JavaScript\alert('$errorMessage');/script;
 }

 I am capturing all the errors from a form and then output them all at once

 Thanks for any help

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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



Re: [PHP] php varible in Javascript alert()

2006-04-11 Thread Anthony Ettinger
actually...

alert('? echo $errorMessage; ?');


On 4/11/06, Anthony Ettinger [EMAIL PROTECTED] wrote:
 alert('echo $errorMessage');

 On 4/11/06, Mace Eliason [EMAIL PROTECTED] wrote:
  Hi,
 
  I am not sure why this won't work I am pretty sure I have done it before;
 
  if($error)
  {
echo $errorMessage;  // for testing error message is displayed to screen
echoscript language=\JavaScript\alert('$errorMessage');/script;
  }
 
  I am capturing all the errors from a form and then output them all at once
 
  Thanks for any help
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


 --
 Anthony Ettinger
 Signature: http://chovy.dyndns.org/hcard.html



--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



Re: [PHP] php varible in Javascript alert()

2006-04-11 Thread Paul Novitski



 On 4/11/06, Mace Eliason [EMAIL PROTECTED] wrote:
  I am not sure why this won't work I am pretty sure I have done it before;
 
  if($error)
  {
echo $errorMessage;  // for testing error message is 
displayed to screen

echoscript language=\JavaScript\alert('$errorMessage');/script;
  }



At 11:19 AM 4/11/2006, Anthony Ettinger wrote:

alert('? echo $errorMessage; ?');



Or perhaps more effectively:

alert('?php echo $errorMessage; ?');

...or to tweak the OP's own syntax, adding curly braces to make sure 
PHP is parsing the variable properly:


echo script 
type=\text/javascript\alert('${errorMessage}');/script;


Mace, what value of $error are you testing?  Is the first plain echo 
line executing?  If it is, I suspect it's the curly braces you've 
been missing (although I can't say why; the single-quotes should 
provide sufficient delimiters for PHP).


Tangentially, I'd like to mention that if your error message appears 
in an alert but nowhere else, then after the user makes the alert go 
away (which they might do with an errant keystroke before reading it 
properly) the message can't be recalled.  I recommend doing for the 
user almost exactly what you're doing for debugging purposes -- 
output the error message to the page AND to a javascript 
alert().  The alert() gets their attention, and the page-bound error 
message lets them read it again.


if($error)
{
echo  hdErrmsg
div class=error$errorMessage/div
script type=text/javascriptalert('${errorMessage'});/script
hdErrmsg;
}

Paul 


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



[PHP] help with multidimentional arrays

2006-04-11 Thread Bing Du
Hello,

What I intend to do is put the database query results in a
multidimentional array like this.

$sponsor_id['sponsor1'] = ('project1 title', 'project2 title', 'project3
title');
$sponsor_id['sponsor2'] = ('project1 title','project7 title');


Here is the code snippet for doing that:

==
while( ($rec = odbtp_fetch_array($qry)) ) {

   if (empty($sponsor_id[$rec[1]])) {
  $sponsor_id[$rec[1]] = array();
   } else {
   array_push($sponsor_id[$rec[1]], $rec[0]);
  }
 }
==

Now, when the following code is used to print the array $sponsor_id, it
only prints out the keys of the array which are:

sponsor1
sponsor2

Those project titles are not printed out.

==
foreach ($sponsor_id as $sponsor = $arr)
echo $sponsor:;
foreach ($arr[$sponsor] as $project) {
echo $projectbr;
}
==

My expected output should be like:

sponsor1:
  project1 title
  project2 title
  project3 title

sponsor2
  project1 title
  project7 title

What is wrong?  I'd appreciate any help.

Thanks,

Bing

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



[PHP] Passing params to PHP served paged in iFrame...

2006-04-11 Thread Richard Dyce

Dear all,

Not so simple question. Here's what I'm trying to do.

I want to be able to provide a simple script tag pair so that my  
client's can cut and paste it into their site. This is to try and to  
make it as simple as posisble for them ;-) The script is then meant  
to write an iFrame into the document, using the served PHP file for  
the source. So far, so good. Now for the tricky part.


I want the PHP file to include a pop-up menu which calls a script in  
the calendar.js file, which in turn reloads (using replace so that  
the back button doesn't break) the served page, but with an updated  
parameter - essentially the new year and month to display.


Here are the bare bones of my not-quite-functioning solution. (I'm  
using Firefox - once I get it working I realise I'll need to tweak  
how I get the object to do the replace on, and indeed the replace  
function itself for IE 5 etc...)


The alert is working (so the parameter is being passed), but the  
reload isn't. What am I doing wrong?


Hope some passing geniuses out there can help/have cracked this one  
before.


R

 example client.html file as follows:

html
  head
titleClient/title
  /head
  body
h3Calendar/h3
script type=text/javascript src=calendar.js/script
  /body
/html
---

 calendar.js file as follows:

document.write('iframe id=calendarFrame src=server.php');
document.write('/iframe');

function reloadCalendar(yearMonth) {
  alert(yearMonth);
  var URL = 'server.php?yearmonth=' + yearMonth;
  document.getElementById('calendarFrame').location.replace(URL);
  return false;
}
-

server.php file as follows:
-
html
  head
titleServer/title
  /head
  body

  form name=emailForm id=emailForm action=server.php
  select name=yearmonth onchange=top.reloadCalendar(this.value);
option value=2006-05May 2006/option
option value=2006-06Jun 2006/option
option value=2006-07Jul 2006/option
  /select

  ?php $ym = $_REQUEST['yearmonth']; echo show calendar for $ym; ?

  /body
/html
-

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



[PHP] internationalization of web site

2006-04-11 Thread Alain Roger
Hi,

Sorry to send this email on both mailing lists but as i suppose that both
are concerned by it, i did.

i would like to make my web site tune to user language.
for that i was thinking to create some XML files where all words can be
found and based on the icon (country flag) that user clicked, i will load a
specific XML file to tune my PHP pages.

i know from Java exprience that it exists also another possibility via
browser setup for preference in language, but i do not know how it works in
PHP.

please, could you give me some tips, helps, or tutorial for such request ?

thanks a lot,
Alain


Re: [PHP] function by reference

2006-04-11 Thread Martin Alterisio
The ampersand before the function name indicates that the function returns a
reference instead of a copy of the variable, for example:

?php
  function max($var1, $var2) {
if ($var1  $var2) return $var1;
else return $var2;
  }

  $global1 = 10;
  $global2 = 9;
  $maxglobal = max($global1, $global2);
  $maxglobal++;
  echo $global1;
  //this will print 11 since $maxglobal is a reference to $global1
?

2006/4/11, tedd [EMAIL PROTECTED]:


 Additionally, what I don't get is this:

 ?php
 $a = 10;
 echo($a br/);
 ref1($a);
 echo($a br/);

 $a = 10;
 echo($a br/);
 ref2($a);
 echo($a br/);

 $a = 10;
 echo($a br/);
 ref3($a);
 echo($a br/);

 ?


 ?php
 function ref1($a)
 {
 $a--;
 }

 ?

 ?php
 function ref2($a)
 {
 $a--;
 }

 ?

 ?php
 function ref3($a)
 {
 $a--;
 }

 ?

 The first two functions work as I would expect. The last one is shown
 in the documentation, but doesn't work as I expected. There doesn't
 appear to be any difference between ref1 and ref3 -- so what's with
 the ampersand in ref3? What is an ampersand supposed to mean/do
 when it precedes a function?

 Thanks.

 tedd
 --

 
 http://sperling.com

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




RE: [PHP] php varible in Javascript alert()

2006-04-11 Thread Chrome
Does $errorMessage have any single quotes in it? Eg:

Can't connect to DB

Because if it does it will cause a Javascript error:

alert('Can't connect to DB');

Just another thing to look for :)

Dan
 
---
http://chrome.me.uk
 
-Original Message-
From: Mace Eliason [mailto:[EMAIL PROTECTED] 
Sent: 11 April 2006 19:41
To: php-general@lists.php.net
Subject: [PHP] php varible in Javascript alert()

Hi,

I am not sure why this won't work I am pretty sure I have done it before;

if($error)
{
  echo $errorMessage;  // for testing error message is displayed to screen
  echoscript language=\JavaScript\alert('$errorMessage');/script;
}

I am capturing all the errors from a form and then output them all at once

Thanks for any help

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


__ NOD32 1.1482 (20060411) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

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



[PHP] CURLOPT_BINARYTRANSFER

2006-04-11 Thread Richard Lynch
Can anybody expand on the meaning and correct usage of:
CURLOPT_BINARYTRANSFER

Just so you know this is not a question with no effort to find out for
myself behind it... :-)

So far, I've found these:

http://php.net/curl_setopt
TRUE to return the raw output when CURLOPT_RETURNTRANSFER is used.
That's kinda self-referential, to tell you the truth...
I haven't really learned anything new from the docs than I could
deduce from the words binary and transfer

http://blog.unitedheroes.net/archives/p/1630/
Another guy at least as confused as me, if not more so

http://curl.haxx.se/mail/curlphp-2002-06/0029.html
You don't need the BINARYTRANSFER option (I'm not even sure what this
does)
He seems to know what he's talking about...
But I'm not quite getting the context, so maybe *I* need it even if
his OP didn't.

http://www.roadsend.com/p/forum/viewThread.php?mID=6e9a196a14179d25c04382132043e38cpageID=comForumexpandedIds=c83be39d0fbed2393d8cd1c7accaf9f7
That option is not an actual curl option, in fact -- it has something
to do with PHP's own internals.

[nb]
Which would go a long way to explaining why I'm not finding
BINARYTRANSFER documented on the curl site, eh?
It's strictly a PHP internals thing?
[/nb]



Now, just from what I've got so far...

There are two rational explanations for this option, both equally
valid, that *I* personally can think of:

#1.
If you want to get binary data through curl, such as a JPEG/GIF or
whatever, you need this so PHP will not treat the data as a
null-terminated string, but will store it as a binary string
internally.

#2.
You only need this in FTP to switch from ASCII to BINARY mode.

In my own personal experimentation, I have *SOME* evidence that #1 is
correct:  If I use curl to snag some HTML, then parse an IMG tag, then
use curl to snag that JPEG URL, then pass that JPEG to
imagecreatefromstring() I get a lot less errors and segfaults if I use
BINARYTRANSFER.


Unfortunately, *after* I have used:
curl_setopt($curl, CURLOPT_BINARYTRANSFER, 1);
$jpeg = curl_exec($curl);
I need to snag another page of HTML so I do:

curl_setopt($curl, CURLOPT_BINARYTRANSFER, 0);
$html = curl_exec($curl);

Seems reasonable, right?


Unfortunately, at THAT point, all hell breaks loose.

Specifically, the following are all (usually) true:

#1
The HTML I snag has all kinds of junk characters tacked onto the end:
html.../htmlZZZ?98q7w4njkvn438jio

#2
I get messages like:
ht=0x12345678 being cleaned
And the script just sorta ends in the middle...
A Google for this yielded PHP Source:
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_hash.c?view=markup

Seeing as how the function is named _zend_is_inconsistent and it's
taking a HashTable as an arg, and if the check was HT_OK it just
returns, and my error message comes after that, and it is followed by
a call to zend_bailout()...

I'm thinking I've managed to scramble PHP's RAM hash table of
data/variables or something in a very bad way, right?...

I've got a bug report already filed under that assumption, but the
point of all this is that maybe I'm just being stoopid and using
CURLOPT_BINARYTRANSFER when I shouldn't, cuz I got no idea what it's
really for...

Anybody got a clue to lend?

Thanks for listening.

-- 
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_id within URL

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 12:40 pm, Alain Roger wrote:
 I would like to understand the purpose of placing SESSION_ID within
 the URL.
 I suppose it is for security improving... However, how to do it ?

 i mean how can it be useful ? how can i use it ?

Actually, unless you are using SSL (https://example.com) then it
REDUCES security as somebody *could* intercept the session ID.

What it increases is browser-compatibility -- Specifically, it allows
browsers and other user agents that do not accept/return cookies to
use a session.

Some users, such as myself, do not generally allow Cookies unless they
want the content bad enough, and trust the site to not be sharing
personal/trackable information with other sites.

It's a pain in the ass, but it's important to me to not get as much
JUNK mail, email, etc and I *KNOW* sites are doing this kind of thing
when I use unique email addresses and they cross from one site to the
next.

E.G., just yesterday the City of Chicago sent spam to a unique email
address I gave to PIRG.

If your cookies are always on, always accepted, you have to assume
that SOME sites are tracking you, sharing the URLs you visit with
other sites, and sharing whatever personal info they can find out
about you with their partner/affiliate sites, who can then target
their advertising (on-line and off-line) at you.  They've invariably
wrapped this all up in a very long-winded Privacy (sic) Policy which
nobody reads anyway.

Using Sessions in the URL can be as simple as turning on the options
in php.ini, or using .htaccess to turn them on.

You could also roll your own to embed the session ID in the URLs you
care about, ignoring, for example, images and javascript and CSS, and
thus making your site SLIGHTLY less standard and amenable to attack
from a shotgun random-selection of victim.  Of course, that's
off-balanced by your maintainability of the code you have to
write/maintain yourself to handle the session ID. It's not a TON of
code, for some well-structured applications, so in some cases it's
probably worth it

There are also some techniques you can take to validate the user with
session IDs over non-SSL connections:
  Alter the session ID on a regular basis, so that old IDs are void
  Embed a second token in the GET/POST data that also expires
  Challenge users for passwords before particularly sensitive actions

-- 
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] MS SQL extension not loading

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 11:45 am, Laszlo Nagy wrote:
 I have a problem with a Win2003 server, IIS6 and PHP 5.1.2. I have
 Microsoft SQL Server tools installed. C:\PHP is on the path. Extension
 dirs are configured correctly. The php_mssql.dll is present there.
 Everything looks okay, except that the server does not load the
 extension. If I do

 var_dump(get_loaded_extensions())

 then I get this:

 array(23) { [0]= string(6) bcmath [1]= string(8) calendar [2]=
 string(10) com_dotnet [3]= string(5) ctype [4]= string(4) date
 [5]= string(3) ftp [6]= string(5) iconv [7]= string(4) odbc
 [8]= string(4) pcre [9]= string(10) Reflection [10]= string(7)
 session [11]= string(6) libxml [12]= string(8) standard [13]=
 string(9) tokenizer [14]= string(4) zlib [15]= string(9)
 SimpleXML [16]= string(3) dom [17]= string(3) SPL [18]=
 string(4) wddx [19]= string(3) xml [20]= string(9) xmlreader
 [21]= string(9) xmlwriter [22]= string(5) ISAPI }

 What am I doing wrong? Please help me. I was trying for a week and
 nobody could help me on the hungarian PHP list. I'm lost.

Step #1:
Create and surf to a phpinfo() file:
?php phpinfo();?

Check the php.ini setting in the top portion to see where php.ini
MUST BE for it to be read.

This directory was set at compile-time, by whomever happened to
compile the php.exe (and dll) that day.

You can't change it ; You have to live with it.
[Actually, in recent Apache versions, you can use an httpd.conf
setting to alter it, but let's not confuse things that are
version-specific]

Step #2:
Find your php.ini file, and MOVE it to where phpinfo() wants it to be.

If you have no php.ini file, find the php.ini-dist file, copy it, and
rename it.

Step #3
In php.ini look at the extensions_dir setting.
Fix it.


One thing is clear from your output:  You've GOT a lot of extensions
working, so you probably already have all of this correct.

Nevertheless, you follow the first 3 steps because that's just the way
you make SURE you have things set up like you think you have them set
up, even if it all looks good...

Step #4.
Compare version numbers of your mssql_php.dll and the version of PHP
you are running.  You CANNOT mix-n-match old DLLs with new PHP and
vice versa.  It will sometimes work until you happen to use the one
function that CHANGED between versions.

If you just went out and found some random mssql_php.dll to throw in
the directory, it is NOT going to work.

In recent PHP versions, I think it won't even let you screw this up,
as each module is, I think, tagged with an internal version reference
number and  PHP will reject invalid DLLs.  I think...  But in the old
days, it was a common mistake for folks to install mis-matched DLL
versions and have all kinds of trouble.

Step #4a
Check your log files.  I'm assuming ISS actually HAS logfiles...  It
must have, right?  Might be in system events log.  Might be in an
error_log file next to your IIS web traffic logs.  Knowing
Microsoft, it might be *ANYWHERE*...  But, wherever it is, find it,
and read it.  If all else fails, you can surf to PHP, and then use
Explorer to search for files changed in the past five minutes.  Or, at
least, I think it will let you search in the past five minutes. 
Yesterday I went looking to do that and could only find files changed
in the past day.  Ugh.
I'm guessing that you might find an error message about the
mssql_php.dll being the wrong version...

Step #5.
Switch to a superior web server: Apache
:-)

Step #6.
Switch to a superior OS like Linux or FreeBSD
:-) :-) :-)

-- 
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] function by reference

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 10:42 am, tedd wrote:
 ?php
   function ref3($a)
   {
   $a--;
   }

 ?

I believe this one will only matter if you are RETURNING a value.

And only really matter if that value is an object...

-- 
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] user authentication

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 10:31 am, Alain Roger wrote:
 i have MySQL  with 2 users in the mysql database which are root and
 uimmense.
 i suppose that what i see in the password field is the sha1 crypted
 password.

 is it correct or not ?

It could be SHA1, or it could be something else...

It *IS* the output from the MySQL password() function which changed
its internals from version to version, and which you should avoid
using for that reason.

 but lets continue...
 in fact, my web application should use a database named immense.
 in this database, there is a table named profiles.
 in this table, the login uimmense and its MD5 password are stored.

Let's be clear, here.

Did you store:
password

Or did you store:
5f4dcc3b5aa765d61d8327deb882cf99
(I.E., md5('password')

You should probably NOT be storing the plain-text version in your
database, unless you are looking at a super-low security needs
application.

 the problem is :
 when i use mysql_connect('localhost','uimmense',myMD5password); to
 connect
 to MySQL database system, the connection is refused because the MD5
 password
 does not correspond to what is saved into users table within mysql
 database... :-(

If you are sending in:
5f4dcc3b5aa765d61d8327deb882cf99
as the password, that is not gonna work...

Here's what MySQL does (more or less):

$query = SELECT pass FROM mysql.user WHERE user = '$user' AND host =
'$host';
$valid_md5 = mysql_query($query) or die(mysql_error());
if (md5($pass) === $valid_md5){
  //valid user
}
else{
  //invalid user
}

The whole POINT of this process is that if somebody breaks into your
MySQL database somehow, and they've got:
5f4dcc3b5aa765d61d8327deb882cf99
they can't USE that because they don't know the original password.

So MySQL isn't looking for you to send: 5f4dcc3b5aa765d61d8327deb882cf99

You have to send the password whose md5() hash is
5f4dcc3b5aa765d61d8327deb882cf99
(Which happens to be 'password' in this case)

This same technique of storing ONLY a one-way encrypted value so that
the data itself is useless for logging in is used all over the place
in the computer industry.

 here is my question :
 all my users registered into my immense database, should be also
 registered as users of MySQL database system ? (which is stored into
 users
 table, into mysql database) ?

Probably not.

You've got TWO levels / meanings of users here:

MySQL 'user' which executes queries on behalf of your PHP scripts.

Your PHP application / website has 'users' which are allows to do
specific things within your PHP application -- based on whatever logic
/ rules YOU want to impose.

Now, sometimes, there will be a correlation between these two sets of
users.

For example, you might set up TWO MySQL users:
'admin'
'uimmense'

And your web appliation might have two different classes of users:
'visitor'
'admin'

And then, in the PHP code, in the '/admin/admin.php' scripts, you'd
use the 'admin' MySQL user, which has insert/update/delete
permissions.

But your homepage and other pages for normal visitors would use the
'visitor' user to connect, and they have only SELECT priveleges.

Of course, there are some wrinkles here:

Maybe the 'visitor' needs INSERT access to a 'guestbook' table so they
can add comments.

Or maybe the 'visitor' needs INSERT/UPDATE/DELETE on a 'session' table
so you can store PHP session data in MySQL.

Still, those would be exceptions to the general rule that 'visitor'
only does SELECT on most tables.

 is it clear ?

 i do not see really realistic if everytime that a new user is
 registered to
 my application, i have to create him a profile for MySQL database.

There might be specific applications where this would be true, like a
webhost Control Panel -- though that also probably would have an even
more complex MySQL-user/Site-user relationship.

But, no, in general, you should not be adding a new user into
mysql.user table for each registered user of a web application.

You DO need to sit down and work out what classes of user you need,
and what level of complexity you want to work with.

*MANY* simple sites just have one user to connect to MySQL with
SELECT/INSERT/UPDATE/DELETE privileges and that's it on the MySQL
side.

On the web application side, you'd have one or two classes of user:
'visitor' and 'admin' and only your PHP logic and authentication keeps
'admin' usage safe from all 'visitors'

This is, admittedly, not quite as good a defense in depth where you
have 'visitor' and 'admin' users in MySQL, but on most shared hosts,
you don't really have any other options.

So you test the PHP authentication very heavily, and make SURE the
passwords for 'admin' users are good passwords, and build in a bit of
extra protection defense in depth into the admin authentication logic.

Security is not binary.  It's a gradient.

You have to really think hard about it, all day, every day, if you
want anything more than token appearances of security

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

-- 
PHP General 

Re: [PHP] a better way to transfer data?

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 9:05 am, blackwater dev wrote:
 I am currently running freetds on a linux box that needs to move data
 from a
 remote mssql db to the local mysql db.  I wanted to use bcp but
 freetds
 couldn't as the data I am moving contains a blob field.  I am
 currently
 using php to select all the rows from the mssql db, and then looping
 through
 the results and putting them into the local mysql db but this is
 horribly
 slow and there has to be a better way.

 How can I do this more efficiently?

Try dumping to CSV or tab-delimited and use LOAD DATA INFILE

-- 
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] internationalization of web site

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 1:59 pm, Alain Roger wrote:
 Sorry to send this email on both mailing lists but as i suppose that
 both
 are concerned by it, i did.

 i would like to make my web site tune to user language.
 for that i was thinking to create some XML files where all words can
 be
 found and based on the icon (country flag) that user clicked, i will
 load a
 specific XML file to tune my PHP pages.

 i know from Java exprience that it exists also another possibility via
 browser setup for preference in language, but i do not know how it
 works in
 PHP.

 please, could you give me some tips, helps, or tutorial for such
 request ?

I'm not an expert, but...

I suspect that many users don't bother to set their browser
preferences for language in the first place.

Even if they do, you have to assume that they might choose to read in
a second language if they suspect the content/translation is better on
some pages.

So you'll probably need the little flags anyway.

And the browser-specficied language preference will probably be not
all that useful.

The PHP site seems to have a multi-lingual solution itself.  And
there's a source code link on every page to let you see how they do
it.

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

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



Re: [PHP] Passing params to PHP served paged in iFrame...

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 1:58 pm, Richard Dyce wrote:
 The alert is working (so the parameter is being passed), but the
 reload isn't. What am I doing wrong?

Here is what I do when JavaScript doesn't do what I expect:

 function reloadCalendar(yearMonth) {
alert(yearMonth);
var URL = 'server.php?yearmonth=' + yearMonth;

alett('URL: ' + URL);
alert(document);
alert(document.getElementById('calendarFrame'));
alert('before: ' + document.getElementById('calendarFrame').location);

document.getElementById('calendarFrame').location.replace(URL);

alert('after: ' +  document.getElementById('calendarFrame').location);

return false;
 }

-- 
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] help with multidimentional arrays

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 1:58 pm, Bing Du wrote:
 What I intend to do is put the database query results in a
 multidimentional array like this.

 $sponsor_id['sponsor1'] = ('project1 title', 'project2 title',
 'project3
 title');
 $sponsor_id['sponsor2'] = ('project1 title','project7 title');
 

 Here is the code snippet for doing that:

 ==
 while( ($rec = odbtp_fetch_array($qry)) ) {

echo rec[1] is: $reg[1]br /\n;

if (empty($sponsor_id[$rec[1]])) {
   $sponsor_id[$rec[1]] = array();
} else {
echo adding $rec[0] to $rec[1] arraybr /\n;
array_push($sponsor_id[$rec[1]], $rec[0]);
   }
  }
 ==

 Now, when the following code is used to print the array $sponsor_id,
 it
 only prints out the keys of the array which are:

 sponsor1
 sponsor2

 Those project titles are not printed out.

 ==
 foreach ($sponsor_id as $sponsor = $arr)
 echo $sponsor:;
 foreach ($arr[$sponsor] as $project) {
 echo $projectbr;
 }
 ==

 My expected output should be like:

 sponsor1:
   project1 title
   project2 title
   project3 title

 sponsor2
   project1 title
   project7 title

 What is wrong?  I'd appreciate any help.

 Thanks,

 Bing

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




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

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



Re: [PHP] XML its elements

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 3:25 am, Mohsen Pahlevanzadeh wrote:
 I need to retrive content of my XML element.my element is translation.
 translationMY _CONTENT/translation
 Of course i wanna use PHP4 instead 5.
 Please help me.
 Yours,Mohsen

There are 3 or 4 different XML parsing engines available for PHP 4.

Pick one.

If all else fails:

$xml = translationMY _CONTENT/translation;
preg_match(/translation([^]*)\\/translation/, $xml, $content);
echo $content[1];

-- 
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 assign a value to a variable inside a class

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 3:14 am, Merlin wrote:
 This does not work:

 $this-db_username = $DB_login;

 Any idas on how to do this?

Since how you do this is how you did it, you're going to have to show
us the exact code you did that does not work because what you typed
above DOES WORK...

-- 
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 assign a value to a variable inside a class

2006-04-11 Thread Richard Lynch
On Tue, April 11, 2006 6:40 am, Merlin wrote:
 The following code:
  class search_helper extends AjaxACApplication
  {
 var $db_username;
 $this-db_username  = $DB_LOGIN;

A 'var' is a 'property' of a Class instance.

It needs to be inside the class, but not inside a function.

$this-db_username = $DB_LOGIN, however, is a statement which must be
inside a function, or used in your script.

 If you want to set a default:

 var $db_username = '';

This is also very nifty.

 That looks like to much for just assigning value to a variable?!

If you don't NEED the functions, you can just assign the values any
time you want willy-nilly:

?php
  class foo(){ };
  $foo = new foo();
  $foo-db_username = $DB_LOGIN;
?

You don't even NEED to declare the member variable db_username.

I'd recommend AT LEAST doing:
?php
  class foo(){
var db_username;
  }

  $foo = new foo();
  $foo-db_username = $DB_LOGIN;
?

Because that at least clarifies up-front what member variables you
will be using.

You might even document them, if they're not 100% obvious.

 I would need 4 of those functions just to set the value of 4 variables
 to a
 value saved inside another variable. If I do understand you right, I
 would
 also have to call that function inside the class to get that value
 set?:

   function SetDBUsername($db_username) {
 $this-db_username = $db_username;
   }


   SetDBUsername();

You cannot just call this function inside a class.

In fact, really, NOTHING gets called directly inside a class
definition.

A class definition is all about defining how the object will behave.

Creating the object, and calling the function[s] to make it actually
*DO* something happen outside the class definition.

Of course, methods in the class definition call other methods and
functions and alter things -- but it's like setting up a giant
dominoes series, and knocking over that first dominoe.

The class {} statement sets up all the dominoes.
$foo = new foo();
$foo-start();
hits the first dominoe.

 Is there not something more easy than that. For example $var1 = $var2;

Easier to start with yes.

Easier to understand later, and document, and know what's going on,
not so much...

Also, having the functions to read/write your variables CAN be crucial
later if you decide to change internals of how that data is stored.

Or if you decide that you want to profile how often that data changes,
or how long it takes to change it.

The function provides a single choke-point to be able to moderate your
data traffic.

Not having the function is easier but can be trouble-some later when
you want to do something different or more complex with the data.

If you *KNOW* that for all time into enternity long after you are dead
and gone nobody will ever ever need to do that kind of complex stuff,
then you can go right ahead and just set the variable in your script
anywhere/anytime you want.

Gotta wonder why you'd use OOP under those circumstances in the first
place, but there it is.

-- 
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] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread Richard Lynch
On Mon, April 10, 2006 10:21 pm, Robert Cummings wrote:
 On Mon, 2006-04-10 at 23:11, Richard Lynch wrote:
 On Mon, April 10, 2006 9:59 pm, Rasmus Lerdorf wrote:
  Richard Lynch wrote:
 I've added a Note to 'fopen' so maybe others won't completely miss
 this feature and look as foolish as I do right now. :-)

 If it's anything like the helpful note I added about using copy(
 source,
 dest ) where dest accidentally points to source (due to linking),
 you'll
 get a nice retarded email like the following:

 ---

 You are receiving this email because your note posted
 to the online PHP manual has been removed by one of the editors.

I also have had what I still believe were actually quite useful
comments deleted :-(

And none of the reasoning in the stock form email applied, imho.

It's an awfully long stretch or a very thin line between these:
Feature Request: Documentation
User Contrbuted Note

I mean, the BEST User Contributed Notes probably qualify as Feature
Requests to improve the Docs, no?

Seems like those are the ones getting nuked, sometimes.

Oh well.

[shrug]

Better than the alternative of having a lot of utter [bleep] in the
User Contributed sections, I guess.

Still, maybe an appeal or a reader-voting system would make more
sense than a PHP Dev/Doc Team member copy-editing every note...

Obviously you'd still want a Doc Team member stepping in at some point
and just nuking anything blatantly wrong no matter how popular...

-- 
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] internationalization of web site

2006-04-11 Thread tedd

At 8:59 PM +0200 4/11/06, Alain Roger wrote:

i would like to make my web site tune to user language.
for that i was thinking to create some XML files where all words can be
found and based on the icon (country flag) that user clicked, i will load a
specific XML file to tune my PHP pages.


Why not just:

1. Allow the user to make their own selection of language -- like 
flags to set the language.


2. Then have different text includes to cover that specific language.

tedd
--

http://sperling.com

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



Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread Richard Lynch
On Mon, April 10, 2006 10:24 pm, Rasmus Lerdorf wrote:
 You could volunteer to help maintain the user notes.

I've just spent five/ten minutes with Google and php.net trying to
find the best way to volunteer to do just that...

Admittedly not a LOT of effort, but...

Where do I start?

I do have one reservation, though...

Last time I tried to do something like this, I ended up having a hard
drive with what felt like Gigabytes of PHP Doc source code from CVS
(which was an adventure in itself back then) and then had to attempt
to run software that chewed up so much RAM/CPU and never managed to
actually get useful output before crashing from lack of resources.

Granted, this was a decade ago, and my hardware was pretty crappy at
the time...  Not that I've got much better gear now, mind you. :-)

I'm guessing though that these days, it's just a web form somewhere. 
I can handle that. :-)

Though it might finally be time for me to take another whack at PHP
CVS development and see if I can't contribute even more...

-- 
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] flash file to recognize SESSION or REQUEST variables?

2006-04-11 Thread Richard Lynch
On Mon, April 10, 2006 11:46 pm, Sunnrunner wrote:
 A client asked me this question. Does anyone know what it means or can
 someone explain and give me an answer.

 Thanks. T

 How can we get the link in the URL of the flash file to recognize
 SESSION or
 REQUEST variables? You know like GET or POST? I need to do something
 like.

 url =
 https://secure.store.com/HousewivesUnleashed.306/buy.cfm?p=1000141m=306dc
 wid=$_REQUEST['aid']udfo2=$_REQUEST['sid'];

 as opposed to what we currently have.

 url = https://secure.
 store.com/HousewivesUnleashed.306/buy.cfm?p=1000141m=306;

 Thoughts?

SESSION ID is usually stored in the COOKIES.

The Cookies do not transfer from domain to domain, and, depending on
the settings of the SetCookie/headers, won't transfer from HTTP to
HTTPS.
[Actually, they might NEVER trasfer, but I forget...]

I *think* the Cookie data gets folded into $_REQUEST, but you'd have
to check that to be sure.

However, 'sid' is probably supposed to be 'PHPSESSID' and, for sure,
you should NOT have '' around it when it's embedded inside 

The actual name of the Cookie, default to PHPSESSID, could have easily
been changed in your PHP code, or php.ini, or .htacess or...

So, all told, my best guess at the correct answer is:
$url = https://...dcwid=$_REQUEST[aid]udfo2=$_REQUEST[PHPSESSID];;

You'll need to do a bit of research/work to find out for sure, though.

print_r($_REQUEST);
is your friend.

-- 
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] PHP post data

2006-04-11 Thread Richard Lynch
On Wed, April 5, 2006 10:33 pm, John Taylor-Johnston wrote:
 Scrolling back and forward through my PHP generated search engine,
 my browser (FF) alerts to remind me that I have post data.
 What kind of header can I add to avoid it doing that?
 Else what is the problem?

Use GET?

The basic paradigm involved is that GET should be safe for search
engines and bots to read and POST is used to alter data on the
server, so engines and bots should not, in general, crawl through
POST.

That's a generalization, and probably should be amended to blindly
crawl as there are obviously a zillion cases where an automated
process to do POST operations is the right answer

Anyway, the browser is assuming that POST data *DID* something on the
server, and re-doing that action could be harmful.  So it's giving the
user the option of re-doing it, or not.

If you use GET, the browser knows that you expect them to re-visit
and it's okay to re-load the page.

-- 
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] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread Rasmus Lerdorf

Richard Lynch wrote:

On Mon, April 10, 2006 10:24 pm, Rasmus Lerdorf wrote:

You could volunteer to help maintain the user notes.


I've just spent five/ten minutes with Google and php.net trying to
find the best way to volunteer to do just that...

Admittedly not a LOT of effort, but...

Where do I start?


Start by reading http://php.net/dochowto
Specifically chapter 11 -

  http://doc.php.net/php/dochowto/chapter-user-notes.php

That should everyone here some insight into the user notes process.


I do have one reservation, though...

Last time I tried to do something like this, I ended up having a hard
drive with what felt like Gigabytes of PHP Doc source code from CVS
(which was an adventure in itself back then) and then had to attempt
to run software that chewed up so much RAM/CPU and never managed to
actually get useful output before crashing from lack of resources.

Granted, this was a decade ago, and my hardware was pretty crappy at
the time...  Not that I've got much better gear now, mind you. :-)

I'm guessing though that these days, it's just a web form somewhere. 
I can handle that. :-)


For just auditing notes, you can do it via a web form, yes.  And now 
with livedocs, you can get instant feedback if you want to progress to 
actually work on the main manual pages themselves.  The above howto


-Rasmus

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



Re: [PHP] function by reference

2006-04-11 Thread tedd
The ampersand before the function name indicates that the function 
returns a reference instead of a copy of the variable, for example:


?php
  function max($var1, $var2) {
if ($var1  $var2) return $var1;
else return $var2;
  }

  $global1 = 10;
  $global2 = 9;
  $maxglobal = max($global1, $global2);
  $maxglobal++;
  echo $global1;
  //this will print 11 since $maxglobal is a reference to $global1
?


It's going to hurt thinking about that.  :-)

But that produces the same results as:

?php
  function max($var1, $var2) {
if ($var1  $var2) return $var1;
else return $var2;
  }

  $global1 = 10;
  $global2 = 9;
  $maxglobal = max($global1, $global2);
  $maxglobal++;
  echo $global1;
  //this will print 11 since $maxglobal is a reference to $global1
?

Note the absence ampersands in the function, but an ampersand remains 
in the assignment:


Thanks.

tedd
--

http://sperling.com

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



Re: [PHP] Session_id within URL

2006-04-11 Thread Louie Miranda
I also use those sessions when checking on the apache logs. For a specific
user, so i can trace what he did.

On 4/12/06, Richard Lynch [EMAIL PROTECTED] wrote:

 On Tue, April 11, 2006 12:40 pm, Alain Roger wrote:
  I would like to understand the purpose of placing SESSION_ID within
  the URL.
  I suppose it is for security improving... However, how to do it ?
 
  i mean how can it be useful ? how can i use it ?

 Actually, unless you are using SSL (https://example.com) then it
 REDUCES security as somebody *could* intercept the session ID.

 What it increases is browser-compatibility -- Specifically, it allows
 browsers and other user agents that do not accept/return cookies to
 use a session.

 Some users, such as myself, do not generally allow Cookies unless they
 want the content bad enough, and trust the site to not be sharing
 personal/trackable information with other sites.

 It's a pain in the ass, but it's important to me to not get as much
 JUNK mail, email, etc and I *KNOW* sites are doing this kind of thing
 when I use unique email addresses and they cross from one site to the
 next.

 E.G., just yesterday the City of Chicago sent spam to a unique email
 address I gave to PIRG.

 If your cookies are always on, always accepted, you have to assume
 that SOME sites are tracking you, sharing the URLs you visit with
 other sites, and sharing whatever personal info they can find out
 about you with their partner/affiliate sites, who can then target
 their advertising (on-line and off-line) at you.  They've invariably
 wrapped this all up in a very long-winded Privacy (sic) Policy which
 nobody reads anyway.

 Using Sessions in the URL can be as simple as turning on the options
 in php.ini, or using .htaccess to turn them on.

 You could also roll your own to embed the session ID in the URLs you
 care about, ignoring, for example, images and javascript and CSS, and
 thus making your site SLIGHTLY less standard and amenable to attack
 from a shotgun random-selection of victim.  Of course, that's
 off-balanced by your maintainability of the code you have to
 write/maintain yourself to handle the session ID. It's not a TON of
 code, for some well-structured applications, so in some cases it's
 probably worth it

 There are also some techniques you can take to validate the user with
 session IDs over non-SSL connections:
   Alter the session ID on a regular basis, so that old IDs are void
   Embed a second token in the GET/POST data that also expires
   Challenge users for passwords before particularly sensitive actions

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




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

//JSM-W


Re: [PHP] php varible in Javascript alert()

2006-04-11 Thread Anthony Ettinger
?php alert('echo addslashes($errorMsg);'); ?

On 4/11/06, Chrome [EMAIL PROTECTED] wrote:
 Does $errorMessage have any single quotes in it? Eg:

 Can't connect to DB

 Because if it does it will cause a Javascript error:

 alert('Can't connect to DB');

 Just another thing to look for :)

 Dan

 ---
 http://chrome.me.uk

 -Original Message-
 From: Mace Eliason [mailto:[EMAIL PROTECTED]
 Sent: 11 April 2006 19:41
 To: php-general@lists.php.net
 Subject: [PHP] php varible in Javascript alert()

 Hi,

 I am not sure why this won't work I am pretty sure I have done it before;

 if($error)
 {
   echo $errorMessage;  // for testing error message is displayed to screen
   echoscript language=\JavaScript\alert('$errorMessage');/script;
 }

 I am capturing all the errors from a form and then output them all at once

 Thanks for any help

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


 __ NOD32 1.1482 (20060411) Information __

 This message was checked by NOD32 antivirus system.
 http://www.eset.com

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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



[PHP] Open Source applition for Job management.

2006-04-11 Thread J Rangi

Hello,

I am looking for some open source job management application written in 
php and mysql. Where employers can post, edit and delete jobs, and job 
seekers can search jobs, save resume, apply on line, bookmark jobs etc. 
Having some kind of administration features will be nice, where 
Administrator can remove and block abusive jobs/employers.


PS: If some is willing to sell the code or application please contact 
directly at [EMAIL PROTECTED]



Thanks
-Jai

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



RE: [PHP] php varible in Javascript alert()

2006-04-11 Thread Chrome
Alert isn't a native PHP command so:

?php alert('echo addslashes($errorMsg);'); ?

wouldn't work... This might though:

?php
$string = Can't connect to DB; // or 'Can\'t connect to DB';
echo 'script type=text/javascript language=javascriptalert(\'' .
addslashes($string) . '\'); /script '; ?
?

I think the line breaks may go a bit wonky :|

HTH

Dan

---
http://chrome.me.uk
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony
Ettinger
Sent: 12 April 2006 00:58
To: Chrome
Cc: Mace Eliason; php-general@lists.php.net
Subject: Re: [PHP] php varible in Javascript alert()

?php alert('echo addslashes($errorMsg);'); ?

On 4/11/06, Chrome [EMAIL PROTECTED] wrote:
 Does $errorMessage have any single quotes in it? Eg:

 Can't connect to DB

 Because if it does it will cause a Javascript error:

 alert('Can't connect to DB');

 Just another thing to look for :)

 Dan

 ---
 http://chrome.me.uk

 -Original Message-
 From: Mace Eliason [mailto:[EMAIL PROTECTED]
 Sent: 11 April 2006 19:41
 To: php-general@lists.php.net
 Subject: [PHP] php varible in Javascript alert()

 Hi,

 I am not sure why this won't work I am pretty sure I have done it before;

 if($error)
 {
   echo $errorMessage;  // for testing error message is displayed to screen
   echoscript language=\JavaScript\alert('$errorMessage');/script;
 }

 I am capturing all the errors from a form and then output them all at once

 Thanks for any help

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


 __ NOD32 1.1482 (20060411) Information __

 This message was checked by NOD32 antivirus system.
 http://www.eset.com

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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



[PHP] How to create a photo gallery

2006-04-11 Thread Pham Huu Le Quoc Phuc
Please help me!
I want to create a photo gallery, user can upload pictures.
Thanks.

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



Re: [PHP] php varible in Javascript alert()

2006-04-11 Thread Anthony Ettinger
Yes, alert() as in the javascript:

script language=javascript

var $errorMsg = ?php echo addslashes($phpError) ?;
alert('error found: ' + $errorMsg);

/script



On 4/11/06, Chrome [EMAIL PROTECTED] wrote:
 Alert isn't a native PHP command so:

 ?php alert('echo addslashes($errorMsg);'); ?

 wouldn't work... This might though:

 ?php
 $string = Can't connect to DB; // or 'Can\'t connect to DB';
 echo 'script type=text/javascript language=javascriptalert(\'' .
 addslashes($string) . '\'); /script '; ?
 ?

 I think the line breaks may go a bit wonky :|

 HTH

 Dan

 ---
 http://chrome.me.uk


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony
 Ettinger
 Sent: 12 April 2006 00:58
 To: Chrome
 Cc: Mace Eliason; php-general@lists.php.net
 Subject: Re: [PHP] php varible in Javascript alert()

 ?php alert('echo addslashes($errorMsg);'); ?

 On 4/11/06, Chrome [EMAIL PROTECTED] wrote:
  Does $errorMessage have any single quotes in it? Eg:
 
  Can't connect to DB
 
  Because if it does it will cause a Javascript error:
 
  alert('Can't connect to DB');
 
  Just another thing to look for :)
 
  Dan
 
  ---
  http://chrome.me.uk
 
  -Original Message-
  From: Mace Eliason [mailto:[EMAIL PROTECTED]
  Sent: 11 April 2006 19:41
  To: php-general@lists.php.net
  Subject: [PHP] php varible in Javascript alert()
 
  Hi,
 
  I am not sure why this won't work I am pretty sure I have done it before;
 
  if($error)
  {
echo $errorMessage;  // for testing error message is displayed to screen
echoscript language=\JavaScript\alert('$errorMessage');/script;
  }
 
  I am capturing all the errors from a form and then output them all at once
 
  Thanks for any help
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  __ NOD32 1.1482 (20060411) Information __
 
  This message was checked by NOD32 antivirus system.
  http://www.eset.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


 --
 Anthony Ettinger
 Signature: http://chovy.dyndns.org/hcard.html





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



RE: [PHP] php varible in Javascript alert()

2006-04-11 Thread Chrome
Your example will earn you a { missing ; before statement } error from the
JS interpreter... Though it will work if you add quotes:

?php $phpError = This is a test; ?

script language=javascript

var errorMsg = '?php echo addslashes($phpError) ?';
alert('error found: ' + errorMsg);

/script

Also I removed the $ prefixing the JS vars... It's not necessary :)

HTH

Dan

PS Thinking on it why not just:

script language=javascript

alert('error found: ?php echo addslashes($phpError) ?');

/script


---
http://chrome.me.uk
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony
Ettinger
Sent: 12 April 2006 01:32
To: Chrome
Cc: Mace Eliason; php-general@lists.php.net
Subject: Re: [PHP] php varible in Javascript alert()

Yes, alert() as in the javascript:

script language=javascript

var $errorMsg = ?php echo addslashes($phpError) ?;
alert('error found: ' + $errorMsg);

/script



On 4/11/06, Chrome [EMAIL PROTECTED] wrote:
 Alert isn't a native PHP command so:

 ?php alert('echo addslashes($errorMsg);'); ?

 wouldn't work... This might though:

 ?php
 $string = Can't connect to DB; // or 'Can\'t connect to DB';
 echo 'script type=text/javascript language=javascriptalert(\'' .
 addslashes($string) . '\'); /script '; ?
 ?

 I think the line breaks may go a bit wonky :|

 HTH

 Dan

 ---
 http://chrome.me.uk


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony
 Ettinger
 Sent: 12 April 2006 00:58
 To: Chrome
 Cc: Mace Eliason; php-general@lists.php.net
 Subject: Re: [PHP] php varible in Javascript alert()

 ?php alert('echo addslashes($errorMsg);'); ?

 On 4/11/06, Chrome [EMAIL PROTECTED] wrote:
  Does $errorMessage have any single quotes in it? Eg:
 
  Can't connect to DB
 
  Because if it does it will cause a Javascript error:
 
  alert('Can't connect to DB');
 
  Just another thing to look for :)
 
  Dan
 
  ---
  http://chrome.me.uk
 
  -Original Message-
  From: Mace Eliason [mailto:[EMAIL PROTECTED]
  Sent: 11 April 2006 19:41
  To: php-general@lists.php.net
  Subject: [PHP] php varible in Javascript alert()
 
  Hi,
 
  I am not sure why this won't work I am pretty sure I have done it
before;
 
  if($error)
  {
echo $errorMessage;  // for testing error message is displayed to
screen
echoscript
language=\JavaScript\alert('$errorMessage');/script;
  }
 
  I am capturing all the errors from a form and then output them all at
once
 
  Thanks for any help
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  __ NOD32 1.1482 (20060411) Information __
 
  This message was checked by NOD32 antivirus system.
  http://www.eset.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


 --
 Anthony Ettinger
 Signature: http://chovy.dyndns.org/hcard.html





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



Re: [PHP] How to create a photo gallery

2006-04-11 Thread Chris

Pham Huu Le Quoc Phuc wrote:

Please help me!
I want to create a photo gallery, user can upload pictures.


There was a recent thread which might help you:

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


--
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 create a photo gallery

2006-04-11 Thread Rory Browne
In fairness. www.google.com

a search for php photo gallery, and php image gallery both brought up
everything you need.

read this: http://www.catb.org/~esr/faqs/smart-questions.html

On 4/12/06, Chris [EMAIL PROTECTED] wrote:

 Pham Huu Le Quoc Phuc wrote:
  Please help me!
  I want to create a photo gallery, user can upload pictures.

 There was a recent thread which might help you:

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


 --
 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 create a photo gallery

2006-04-11 Thread Jai Rangi

Pham Huu Le Quoc Phuc wrote:


Please help me!
I want to create a photo gallery, user can upload pictures.
Thanks.

 


This link will give your access to lots of opensource code for photo gallery

http://freshmeat.net/search/?q=%2Bphp+%2Bphoto+%2Band+%2Bmysql+posting+commentssection=projectsGo.x=16Go.y=6

-Jai

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



Re: [PHP] function by reference

2006-04-11 Thread Chris

tedd wrote:
The ampersand before the function name indicates that the function 
returns a reference instead of a copy of the variable, for example:


?php
  function max($var1, $var2) {
if ($var1  $var2) return $var1;
else return $var2;
  }

  $global1 = 10;
  $global2 = 9;
  $maxglobal = max($global1, $global2);
  $maxglobal++;
  echo $global1;
  //this will print 11 since $maxglobal is a reference to $global1
?



It's going to hurt thinking about that.  :-)


References (and pointers in lower level languages) can be painful :(

It's quite useful with objects.

function getdb() {
  if (!isset($GLOBALS['DBClass'])) {
$dbclass = new DBClass();
.
$GLOBALS['DBClass'] = $dbclass;
  }
   return $GLOBALS['DBClass'];
}

So in this case, every time you call 'getdb', you don't want it to start 
a new object and return that (memory usage because it has to set up the 
object again, you have to reconnect to the db and so on).


You want it to use the same object over and over again.

So you return by reference.


You also have to call by reference:

$my_db = getdb();

rather than:

$my_db = getdb();

otherwise it returns a copy rather than a reference.

--
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] function by reference

2006-04-11 Thread Martin Alterisio \El Hombre Gris\
Well, it was a bad example to begin with, first of all max() is already 
defined in php, I should at least checked that before posting. Second, I 
forgot PHP (the Zend engine) has an interesting way of handling 
variables, when you copy assign a var or pass it as an argument of a 
function, a real copy is not made but a reference. When you modify the 
reference, an actual copy is made before the modification. What's 
happening with the function you posted is that the variables are not 
passed by copy but by reference, that's why it works. Anyway, this is 
due to conditions on the way PHP (the Zend engine) handles its internal, 
you shouldn't rely on this in your code.


http://www.zend.com/zend/art/ref-count.php

tedd wrote:

The ampersand before the function name indicates that the function 
returns a reference instead of a copy of the variable, for example:


?php
  function max($var1, $var2) {
if ($var1  $var2) return $var1;
else return $var2;
  }

  $global1 = 10;
  $global2 = 9;
  $maxglobal = max($global1, $global2);
  $maxglobal++;
  echo $global1;
  //this will print 11 since $maxglobal is a reference to $global1
?



It's going to hurt thinking about that.  :-)

But that produces the same results as:

?php
  function max($var1, $var2) {
if ($var1  $var2) return $var1;
else return $var2;
  }

  $global1 = 10;
  $global2 = 9;
  $maxglobal = max($global1, $global2);
  $maxglobal++;
  echo $global1;
  //this will print 11 since $maxglobal is a reference to $global1
?

Note the absence ampersands in the function, but an ampersand remains 
in the assignment:


Thanks.

tedd


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



[PHP] regular expressions or something else?

2006-04-11 Thread Chris Westbrook
I have a problem.  I'm trying to get a Google search results page via snoopy 
and then display the links of the results it returns in an application.  I 
know about the fetchlinks function in snoopy, but I'm having trouble getting 
the text between the a and /a tags.  Yeah, I know, I should use the 
Google API, but my client doesn't want me doing that, probably because they 
might have to pay for that.  any suggestions? 


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



Re: [PHP] function by reference

2006-04-11 Thread Robert Cummings
On Tue, 2006-04-11 at 23:15, Martin Alterisio El Hombre Gris wrote:
 Well, it was a bad example to begin with, first of all max() is already 
 defined in php, I should at least checked that before posting. Second, I 
 forgot PHP (the Zend engine) has an interesting way of handling 
 variables, when you copy assign a var or pass it as an argument of a 
 function, a real copy is not made but a reference. When you modify the 
 reference, an actual copy is made before the modification. What's 
 happening with the function you posted is that the variables are not 
 passed by copy but by reference, that's why it works. Anyway, this is 
 due to conditions on the way PHP (the Zend engine) handles its internal, 
 you shouldn't rely on this in your code.
 
 http://www.zend.com/zend/art/ref-count.php

More popularly known as copy-on-write. Wikipedia does a good job of
explaining the virtues:

http://en.wikipedia.org/wiki/Copy-on-write

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] Instalation Nightmares For Word Press Please Help

2006-04-11 Thread marvin hunkin

Hi.
need to install word press version 2.0.
and now using easy php 1-8, and set up my my sql settings in the 
wpConfig.php file, and my username is localhost and the password is root.
when i try to load it in the browser, using http://localhost/install.php 
which i put in the www. folder of easy php 1-8, i get this error in the 
browser:



There doesn't seem to be a wp-config.php file. I need this before we can get 
started. Need more help?

We got it.
You can
create a wp-config.php file through a web interface,
but this doesn't work for all server setups. The safest way is to manually 
create the file.


and will paste the code for the wpConfig.php file.

?php
// ** MySQL settings ** //
define('DB_NAME', 'wordpress');// The name of the database
define('DB_USER', 'localhost'); // Your MySQL username
define('DB_PASSWORD', 'root'); // ...and password
define('DB_HOST', 'localhost');// 99% chance you won't need to change 
this value


// You can have multiple installations in one database if you give each a 
unique prefix

$table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!

// Change this to localize WordPress.  A corresponding MO file for the
// chosen language must be installed to wp-includes/languages.
// For example, install de.mo to wp-includes/languages and set WPLANG to 
'de'

// to enable German language support.
define ('WPLANG', '');

/* That's all, stop editing! Happy blogging. */

define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH.'wp-settings.php');
?
if any one has had nightmares trying to install this, and have tried several 
times, downloading, unzipping, into a folder called WordPress, copying and 
pasting in to easy php, can any one help me how to get it to the first 
install screen?

this one is driving me insane!
if any one has had the same problem, how did they get round this one?
let me know asap.
cheers Marvin.

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



Re: [PHP] Instalation Nightmares For Word Press Please Help

2006-04-11 Thread Chris

marvin hunkin wrote:

Hi.
need to install word press version 2.0.


http://wordpress.org/support/


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

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