[PHP] SharePoint

2010-05-01 Thread Robbert van Andel
I've been trying to connect to our SharePoint server's webservices
with PHP. I downloaded the nusoap library and have been trying to make
a connection using sample code from various websites. I keep getting
the following error:

h1You are not authorized to view this page/h1
You do not have permission to view this directory or page using the
credentials that you supplied because your Web browser is sending a
WWW-Authenticate header field that the Web server is not configured to
accept.
h2HTTP Error 401.2 - Unauthorized: Access is denied due to server
configuration.brInternet Information Services (IIS)/h2

My code looks like this:

require_once('/usr/share/php/nusoap/nusoap.php');

/*  Your username and password, separated by a colon
    Domain may be optional, depending on your setup */
$auth = username:password;

/*  Location of the Lists.asmx file
    If the list is in a subsite, the subsite must be in the path */
$wsdl = http://domain.com/depts/is/private/_vti_bin/Lists.asmx?WSDL;;

/*  GUID of the list */
$guid = Shared Documents;

/* Setup NuSOAP
   Sharepoint requires NTLM Authorization
   You need a fairly recent version of CURL installed for this  */
try {
    $client = new nusoap_client($wsdl,true);
    $client-setCredentials(,,ntlm);
    $client-setUseCurl(true);
    $client-useHTTPPersistentConnection();
    $client-setCurlOption(CURLOPT_USERPWD, $auth);
    //$client-soap_defencoding = 'UTF-8';


    $xml = '
soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;
  soap:Body
    GetListItems xmlns=http://schemas.microsoft.com/sharepoint/soap/;
  listName' . $guid . '/listName
  viewNameAll Documents/viewName
  query
    xsd:schemaschema/xsd:schemaxml/query
  viewFields
    xsd:schemaschema/xsd:schemaxml/viewFields
  rowLimitstring/rowLimit
  queryOptions
    xsd:schemaschema/xsd:schemaxml/queryOptions
  webIDstring/webID
    /GetListItems
  /soap:Body
/soap:Envelope
    ';

    $result = $client-call(GetListItems,$xml);
    if(isset($fault)) {
    echo pError:  . $fault . /p\n;
    }
    echo pre\$result =  .
htmlspecialchars(print_r($result,true)) . /pre\n;
 }
catch(Exception $e) {

    echo p . $e-getMessage() . /p\n;
}


Our SharePoint server uses integrated authentication. I've tried
several permutations of the username, including just the username,
domain\username and usern...@domain. All are returning the same error.
My guess is that PHP is sending the username/password combination in a
way that SharePoint doesn't like.

Has anyone been able to connect to SharePoint's web services and if so, how?

Thanks

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



[PHP] SharePoint

2010-05-01 Thread Robbert van Andel
I've been trying to connect to our SharePoint server's webservices
with PHP. I downloaded the nusoap library and have been trying to make
a connection using sample code from various websites. I keep getting
the following error:

h1You are not authorized to view this page/h1
You do not have permission to view this directory or page using the
credentials that you supplied because your Web browser is sending a
WWW-Authenticate header field that the Web server is not configured to
accept.
h2HTTP Error 401.2 - Unauthorized: Access is denied due to server
configuration.brInternet Information Services (IIS)/h2

My code looks like this:

require_once('/usr/share/php/nusoap/nusoap.php');

/*  Your username and password, separated by a colon
Domain may be optional, depending on your setup */
$auth = username:password;

/*  Location of the Lists.asmx file
If the list is in a subsite, the subsite must be in the path */
$wsdl = http://domain.com/depts/is/private/_vti_bin/Lists.asmx?WSDL;;

/*  GUID of the list */
$guid = Shared Documents;

/* Setup NuSOAP
   Sharepoint requires NTLM Authorization
   You need a fairly recent version of CURL installed for this  */
try {
$client = new nusoap_client($wsdl,true);
$client-setCredentials(,,ntlm);
$client-setUseCurl(true);
$client-useHTTPPersistentConnection();
$client-setCurlOption(CURLOPT_USERPWD, $auth);
//$client-soap_defencoding = 'UTF-8';


$xml = '
soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;
  soap:Body
GetListItems xmlns=http://schemas.microsoft.com/sharepoint/soap/;
  listName' . $guid . '/listName
  viewNameAll Documents/viewName
  query
xsd:schemaschema/xsd:schemaxml/query
  viewFields
xsd:schemaschema/xsd:schemaxml/viewFields
  rowLimitstring/rowLimit
  queryOptions
xsd:schemaschema/xsd:schemaxml/queryOptions
  webIDstring/webID
/GetListItems
  /soap:Body
/soap:Envelope
';

$result = $client-call(GetListItems,$xml);
if(isset($fault)) {
echo pError:  . $fault . /p\n;
}
echo pre\$result =  .
htmlspecialchars(print_r($result,true)) . /pre\n;
 }
catch(Exception $e) {

echo p . $e-getMessage() . /p\n;
}


Our SharePoint server uses integrated authentication. I've tried
several permutations of the username, including just the username,
domain\username and usern...@domain. All are returning the same error.
My guess is that PHP is sending the username/password combination in a
way that SharePoint doesn't like.

Has anyone been able to connect to SharePoint's web services and if so, how?

Thanks

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



[PHP] Job Opening

2009-11-11 Thread Robbert van Andel
I hope this is not violating any terms of usage rules. I thought I'd let you
know that Salem Hospital in Salem Oregon is hiring a web developer.  the
position is part time and temporary with the potential to become permanent
and full time. They have a huge intranet and a smaller public site using
PHP.  They're interested in someone that knows PHP, JavaScript and a working
knowledge of ASP.net

Details can be found here:
http://salemhospital.hodesiq.com/job_detail.asp?JobID=1713080user_id=


[PHP] cURL Download

2009-04-16 Thread Robbert van Andel
I've been struggling to download a file from a network file share using
cURL, or whatever else will work.   All I want to do is get the contents of
a text file.  But when I run the code below I get this error Error: 37 -
Couldn't open file \\server\share\test.txt.  I'm running my website on a
linux box, but the server is on a Windows file server.  I've verified that
the file share works when I use Windows Explorer and that the server can get
the file via the command line using smbclient.  Any help would be
appreciated.

?PHP
$file = file:server\\share\\test.txt;

echo pGetting $file/p\n;

// create a new cURL resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $file);
curl_setopt($ch, CURLOPT_USERPWD, username:password);
curl_setopt($ch, CURLOPT_HEADER, false);

// grab file and pass it to the browser
echo pFile:  . curl_exec($ch) ./p\n;
echo pError:  . curl_errno($ch) .  -  . curl_error($ch) .
/p\n;
?

Thanks,
Robbert


Re: [PHP] question about using sql server with php

2008-10-27 Thread Robbert van Andel
You also need to make sure that your server has the mysql drivers
installed.  A linux server does not come with this support natively.

On Mon, Oct 27, 2008 at 6:19 AM, bruce [EMAIL PROTECTED] wrote:

 hey sudhakar..

 when you're changing database apps, you're normally going to have to change
 the connection codem as well as possibly the query structure for your
 different select/insert/etc.. queries.

 there should be plenty of examples/tutorials on the net, as well as in the
 php.net website.

 have fun!


 -Original Message-
 From: Sudhakar [mailto:[EMAIL PROTECTED]
 Sent: Sunday, October 26, 2008 8:49 PM
 To: php-general@lists.php.net
 Subject: [PHP] question about using sql server with php


 i have a question about how to use sql database with php instead of using
 my
 sql database

 when i use my sql database the php code to connect to the my sql database
 is
 =

 $conn = mysql_connect($hostname, $user, $password);

 if(!$conn)
 {
 echo Unable to connect to Database;
 }

 else
 {
 mysql_select_db($database, $conn);

 $query = mysql_query($selectquery);

 mysql_close($conn);
 }


 if i have to connect to a sql databse instead of my sql database as some
 companies use sql database, how can i change the php code to connect, run a
 query and close connection to the sql database.

 apart from changing the code to connect to sql database is there something
 else i need to do.

 please advice.

 thanks


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




Re: [PHP] question about using sql server with php

2008-10-27 Thread Robbert van Andel
We use a linux webserver but have a need to connect to MSSQL databases.
Since I used Fedora, I was lucky enough to find the PHP-MSSQL package but
that has only been available via yum recently.  My first attempt at
connecting to MSSQL was much more difficult when I was using FC3.

On Mon, Oct 27, 2008 at 2:02 PM, Ashley Sheridan
[EMAIL PROTECTED]wrote:

 On Mon, 2008-10-27 at 07:41 -0700, Robbert van Andel wrote:
  You also need to make sure that your server has the mysql drivers
  installed.  A linux server does not come with this support natively.
 
  On Mon, Oct 27, 2008 at 6:19 AM, bruce [EMAIL PROTECTED] wrote:
 
   hey sudhakar..
  
   when you're changing database apps, you're normally going to have to
 change
   the connection codem as well as possibly the query structure for your
   different select/insert/etc.. queries.
  
   there should be plenty of examples/tutorials on the net, as well as in
 the
   php.net website.
  
   have fun!
  
  
   -Original Message-
   From: Sudhakar [mailto:[EMAIL PROTECTED]
   Sent: Sunday, October 26, 2008 8:49 PM
   To: php-general@lists.php.net
   Subject: [PHP] question about using sql server with php
  
  
   i have a question about how to use sql database with php instead of
 using
   my
   sql database
  
   when i use my sql database the php code to connect to the my sql
 database
   is
   =
  
   $conn = mysql_connect($hostname, $user, $password);
  
   if(!$conn)
   {
   echo Unable to connect to Database;
   }
  
   else
   {
   mysql_select_db($database, $conn);
  
   $query = mysql_query($selectquery);
  
   mysql_close($conn);
   }
  
  
   if i have to connect to a sql databse instead of my sql database as
 some
   companies use sql database, how can i change the php code to connect,
 run a
   query and close connection to the sql database.
  
   apart from changing the code to connect to sql database is there
 something
   else i need to do.
  
   please advice.
  
   thanks
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 What distribution are you using for your server, as every distro I've
 ever touched has them. Also, the question was regarding connection to a
 mssql database, not mysql. As he didn't specify the operating system,
 I'm going out on a limb by thinking the PHP was on a Windows web server
 (who would run PHP on a Linux web server to then use the inferior mssql
 database?)


 Ash
 www.ashleysheridan.co.uk




Re: [PHP] question about using sql server with php

2008-10-27 Thread Robbert van Andel
Sorry, that was a typo.  I meant MSSQL.

On Mon, Oct 27, 2008 at 2:12 PM, Chris [EMAIL PROTECTED] wrote:

 Robbert van Andel wrote:

 You also need to make sure that your server has the mysql drivers
 installed.  A linux server does not come with this support natively.


 He's not using mysql, he's using sql server.


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




Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Robbert van Andel
What is the actual code that you use to run the query.  You've shown us how
you set up the query but not more.

Something like
$result = mysql_query($query,$conn);

Robbert

On Thu, Oct 2, 2008 at 10:17 AM, Jason Pruim [EMAIL PROTECTED] wrote:


 On Oct 2, 2008, at 12:46 PM, Jim Lucas wrote:

  Jason Pruim wrote:

 Hi Everyone,

 Could not perform query: Query was empty


 This would tell me that the variable that you are passing to your function
 call is either empty or not set.  Maybe a typo.



 Hi Jim,

 Wouldn't that have shown up in the echo of the statement though?

 I did double check it and couldn't find any typos listed...


 --

 Jason Pruim
 Raoset Inc.
 Technology Manager
 MQC Specialist
 11287 James St
 Holland, MI 49424
 www.raoset.com
 [EMAIL PROTECTED]





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




Re: [PHP] Selecting all records between a date range

2008-10-02 Thread Robbert van Andel
In the original message you were assigning the query to $SQLTEST, but in the
code below you're using $sql.

On Thu, Oct 2, 2008 at 10:40 AM, Jason Pruim [EMAIL PROTECTED] wrote:


 On Oct 2, 2008, at 1:31 PM, Robbert van Andel wrote:

 What is the actual code that you use to run the query.  You've shown us how
 you set up the query but not more.

 Something like
 $result = mysql_query($query,$conn);


 Here is the code I use:

 $row[]= mysql_query($sql) or die(Could not perform query:  .mysql_error());
 $result = $row[0];
 while ($row = mysql_fetch_assoc($result)){
 $timein = date(m/d/y h:i:s, $row['timein']);
 $timeout = date(m/d/y h:i:s, $row['timeout']);
 $totalday = ($row['timeout'] - $row['timein']);
 $totalday = $totalday/60/60;
 $totalday = round($totalday, 2);
 $totalWeek += $totalday;  // Builds the total from the daily total




 echo ADMIN



 tr
 td{$row['Name']}/td
 td{$timein}/td
 td{$timeout}/td
 td{$totalday}/td


 /tr


 ADMIN;
 }
 # Display Weekly total
 echo WEEKTOTAL


 tr
 td colspan='4' align='right'TOTAL FOR WEEK: {$totalWeek}/td
 /tr


 WEEKTOTAL;
 echo /table
 /div
 /body;


 Works out really well. Now I just need to show it to the boss, change every
 possible thing about it, until I hate it and they love it and call it good
 :)


 --

 Jason Pruim
 Raoset Inc.
 Technology Manager
 MQC Specialist
 11287 James St
 Holland, MI 49424
 www.raoset.com
 [EMAIL PROTECTED]







[PHP] New Server Install

2008-09-10 Thread Robbert van Andel
I am working on a new webserver running Fedora 9.  I installed php-mysql and
php-mssql via yum.  When I try to connect to our mysql server using php, I
get the following error: Can't connect to MySQL server on 'mysqlservername'
(13)

 

Here's the weird part, I can connect to the mysql database server just fine
from the web server's command line so I'm pretty confident that it's not a
firewall issue.  While trying to connect using PHP, I see no packets leaving
the webserver. 

 

Any thoughts?

 

Thanks,

Robbert



RE: [PHP] New Server Install

2008-09-10 Thread Robbert van Andel
Our MySql server is an established server that I can successfully connect to
from other web servers.  When I run my php script I see no attempt made to
connect to the mysql server but do see the attempt and subsequent activity
when connecting via the command line.

-Original Message-
From: Mark Bomgardner [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2008 2:46 PM
To: 'Robbert van Andel'
Subject: RE: [PHP] New Server Install

Ok, then a couple of things to check.  Even though you can login through the
command line, when you set up MySQL is your host name the same as the host
you are trying to connect from.  When you log in through the command line,
you may be logging in from the localhost whereas when you login from your
webpage, you are trying to login from your web server host name.  This may
be something you want to check.  


Log in to your mysql server from the command line, switch to the Mysql
datasbase and run SELECT * FROM user\G  this will give you a readable print
of your users.

markb

-Original Message-
From: Robbert van Andel [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2008 4:40 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] New Server Install

That didn't work :(.  Thanks though.

Robbert

-Original Message-
From: Mark Bomgardner [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2008 2:19 PM
To: 'Robbert van Andel'
Subject: RE: [PHP] New Server Install

Robbert:

I have had the same thing happen, but it gets fixed with a computer reboot.
Not sure why, but I have had this happen on a couple of boxes.

markb

-Original Message-
From: Robbert van Andel [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2008 4:13 PM
To: php-general@lists.php.net
Subject: [PHP] New Server Install

I am working on a new webserver running Fedora 9.  I installed php-mysql and
php-mssql via yum.  When I try to connect to our mysql server using php, I
get the following error: Can't connect to MySQL server on 'mysqlservername'
(13)

 

Here's the weird part, I can connect to the mysql database server just fine
from the web server's command line so I'm pretty confident that it's not a
firewall issue.  While trying to connect using PHP, I see no packets leaving
the webserver. 

 

Any thoughts?

 

Thanks,

Robbert




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



RE: [PHP] New Server Install

2008-09-10 Thread Robbert van Andel
The MySQL database is hosted on a different server.  I am building a new
webserver, not mysql server.

-Original Message-
From: Nathan Rixham [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2008 5:14 PM
To: php-general@lists.php.net
Subject: Re: [PHP] New Server Install

Robbert van Andel wrote:
 Our MySql server is an established server that I can successfully connect
to
 from other web servers.  When I run my php script I see no attempt made to
 connect to the mysql server but do see the attempt and subsequent activity
 when connecting via the command line.
 
 -Original Message-
 From: Mark Bomgardner [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 10, 2008 2:46 PM
 To: 'Robbert van Andel'
 Subject: RE: [PHP] New Server Install
 
 Ok, then a couple of things to check.  Even though you can login through
the
 command line, when you set up MySQL is your host name the same as the host
 you are trying to connect from.  When you log in through the command line,
 you may be logging in from the localhost whereas when you login from
your
 webpage, you are trying to login from your web server host name.  This may
 be something you want to check.  
 
 
 Log in to your mysql server from the command line, switch to the Mysql
 datasbase and run SELECT * FROM user\G  this will give you a readable
print
 of your users.
 
 markb
 
 -Original Message-
 From: Robbert van Andel [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 10, 2008 4:40 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] New Server Install
 
 That didn't work :(.  Thanks though.
 
 Robbert
 
 -Original Message-
 From: Mark Bomgardner [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 10, 2008 2:19 PM
 To: 'Robbert van Andel'
 Subject: RE: [PHP] New Server Install
 
 Robbert:
 
 I have had the same thing happen, but it gets fixed with a computer
reboot.
 Not sure why, but I have had this happen on a couple of boxes.
 
 markb
 
 -Original Message-
 From: Robbert van Andel [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 10, 2008 4:13 PM
 To: php-general@lists.php.net
 Subject: [PHP] New Server Install
 
 I am working on a new webserver running Fedora 9.  I installed php-mysql
and
 php-mssql via yum.  When I try to connect to our mysql server using php, I
 get the following error: Can't connect to MySQL server on
'mysqlservername'
 (13)
 
  
 
 Here's the weird part, I can connect to the mysql database server just
fine
 from the web server's command line so I'm pretty confident that it's not a
 firewall issue.  While trying to connect using PHP, I see no packets
leaving
 the webserver. 
 
  
 
 Any thoughts?
 
  
 
 Thanks,
 
 Robbert
 
 
 

i hate to say such basics; but looks like you have the server defined in 
a config.php or the like as something similar to:
$db['server'] = 'mysqlservername';
and it needs changed to local host..

have you tried just doing a very very basic mysql_connect()

also check php.ini ; you may ahve the defaults set up in there incorrectly..

-- 
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] Downloading a file

2008-07-16 Thread Robbert van Andel
Thanks, that did the trick.  I'd done a google search before but didn't come
up with any answers but hadn't added headers to the search phrase.

 

In case anyone is interested in the solution, my script included
session_start and I found that by adding session_cache_limiter(none)
before session_start resolved the problem
(http://bytes.com/forum/thread554529.html) 

 

Robbert

 

From: Tom Chubb [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 16, 2008 1:41 AM
To: Robbert van Andel
Cc: php-general@lists.php.net
Subject: Re: [PHP] Downloading a file

 

On 16/07/2008, Robbert van Andel [EMAIL PROTECTED] wrote: 

I am having trouble getting a file to download to work in Internet Explorer.
The site works fine in FireFox.   The page retrieves the contents of a file
from a database and outputs the following



?PHP



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

header(Content-Disposition: attachment; filename=\{$data['filename']}\);

header(Content-Description: PHP Generated Data);

echo $data['file'];



?



Where $data['filename'] is the name of the file as stored in the database
and $data['file'] is the contents of the file.  The script used to download
the file is called view.php.  As I mentioned, this works great in FireFox
but with Internet Explorer, I get the following error:



Internet Explorer cannot download view.php from www.yourdomain.com.



Internet Explorer was not able to open this Internet site. The requested
site is either unavailable or cannot be found. Please try again later.



Any help would be greatly appreciated.



Robbert


Start here:

http://www.google.co.uk/search?source=ig
http://www.google.co.uk/search?source=ighl=enrlz=q=php+download+file+int
ernet+explorer+headersmeta
hl=enrlz=q=php+download+file+internet+explorer+headersmeta=



[PHP] Downloading a file

2008-07-15 Thread Robbert van Andel
I am having trouble getting a file to download to work in Internet Explorer.
The site works fine in FireFox.   The page retrieves the contents of a file
from a database and outputs the following

 

?PHP

   

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

header(Content-Disposition: attachment; filename=\{$data['filename']}\);

header(Content-Description: PHP Generated Data);

echo $data['file'];

   

?

 

Where $data['filename'] is the name of the file as stored in the database
and $data['file'] is the contents of the file.  The script used to download
the file is called view.php.  As I mentioned, this works great in FireFox
but with Internet Explorer, I get the following error:

 

Internet Explorer cannot download view.php from www.yourdomain.com.

 

Internet Explorer was not able to open this Internet site. The requested
site is either unavailable or cannot be found. Please try again later.

 

Any help would be greatly appreciated.

 

Robbert



Re: [PHP] problem with include directive under XHTML

2008-06-03 Thread Robbert van Andel
What is the error message you are getting?

On Tue, Jun 3, 2008 at 11:37 AM, Robert Huff [EMAIL PROTECTED] wrote:

 Robbert van Andel writes:

   I've had this problem.  It's because of the ? and ? that
   surrounds your XML.  Your php configuration probably has short
   tags enabled.

 Negative,  Prior research found this problem, and the short
 tags setting, which was promptly set to OFF,


Robert Huff





Re: [PHP] problem with include directive under XHTML

2008-06-03 Thread Robbert van Andel
I've had this problem.  It's because of the ? and ? that surrounds your
XML.  Your php configuration probably has short tags enabled. I have had to
use php to output this

?PHP echo ' ?xml version=1.0 encoding=utf-8?' ; ?



On Tue, Jun 3, 2008 at 7:25 AM, Robert Huff [EMAIL PROTECTED] wrote:


I'm working on a project that involves converting HTML to
 XHTML.  Not strictly sure this is a PHP issue, but testing (so far)
 has eliminated other possibilities.

Can someone offer suggestions why, on the same server (Apache
 2.2.8), this works:

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN
 html lang=en-US
  head
link rel=stylesheet type=text/css href=proj_default.css
  title=ss_default
titleTesting html/title
  /head

  body

 script language=php
 include 'letters/Disclaimer';
 /script

 hr
 addressa href=mailto:[EMAIL PROTECTED]Robert Huff/a/address
 !-- Created: Wed Jan 19 10:52:50 EST 2005 --
 !-- hhmts start --
 Last modified: Mon Jun  2 16:56:19 EDT 2008
 !-- hhmts end --
  /body
 /html


but this doesn't:

 ?xml version=1.0 encoding=utf-8?
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
  head
titleTesting xhtml/title
link rel=stylesheet type=text/css href=proj_default.css
  title=ss_default /
link rel=icon type=image/x-icon
href=images/favicon.png /
link rel=shortcut icon type=image/x-icon
href=images/favicon.png /
  /head

 body
 script type=text/php
 include 'letters/Disclaimer';
 /script
 hr /
 addressa href=mailto:[EMAIL PROTECTED]Robert Huff/a/address
 !-- Created: Wed Jan 19 10:52:50 EST 2005 --
 !-- hhmts start --
 Last modified: Mon Jun  2 17:37:52 EDT 2008
 !-- hhmts end --
  /body
 /html



Rspectfully,


Robert Huff


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




RE: [PHP] PHP CLI Problem

2008-02-06 Thread Robbert van Andel
Thank you, that was very helpful.  I created a perl script because the shell
script wouldn't run either.  It too gave an error stating the file or
directory could not be found.  The perl script runs a shell command from
within it to run backup.php.  Manual tests show that that works, I put it in
a cron job and am confident that it will run. 

Robbert

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 05, 2008 11:06 PM
To: Robbert van Andel
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP CLI Problem


 First off, the script runs great from the command line when I type php5
 backup.php but when I type ./backup.php I get an error: bash:
 ./backup.php: No such file or directory.

Maybe backup.php that you think it's running is the wrong one.

Add something like:

echo I am file  . __FILE__ . \n;

in your backup.php file and see if that's printed out when you run php5 
backup.php.

If it's not, then you're editing the wrong file.

  I thought maybe this is a problem
 with the top declaration in the script #!/usr/local/bin/php5.

If you have that as the first line, then you should just need to chmod 
+x the backup.php file.

 The problem
 is that it appears the server has several php5s I can reference
 
 /usr/local/apache/share/cgi-bin/php5
 /usr/local/bin/php5

Ask your host which is the right one (99% sure it'll be 
/usr/local/bin/php5).

 Questions:
 * How do I determine what to put at the top of the script so that I can
just
 call backup.php?

What difference does it make whether the full path is included in the 
cron job or not? You need to use the full path somewhere (whether it's 
in the cron job or in a shell script).

You could create a shell script:

#!/bin/bash
/usr/local/bin/php5 -f /path/to/backup.php

chmod +x the new script.

Call that instead in cron.

 * What, if anything, do I need to do to make the script work from cron?

Use the full path to php, use the full path to your backup.php file.

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

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

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



RE: [PHP] PHP CLI Problem

2008-02-06 Thread Robbert van Andel
I guess I spoke too soon.  Even though the script runs from anywhere (that I
have access too), when I put the perl script in a cronjob, the php script
just refuses to run.  There's no output, just the output from the perl
script.  And yes, I did set up the perl script to print the output of the
php script.  Any ideas?  Is there some special consideration I have to give
to the fact that my PHP installation is setup as a CGI?  I've never had this
much trouble getting a PHP CLI script to run.

Robbert

-Original Message-
From: Robbert van Andel [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 06, 2008 6:14 AM
To: php-general@lists.php.net
Subject: RE: [PHP] PHP CLI Problem

Thank you, that was very helpful.  I created a perl script because the shell
script wouldn't run either.  It too gave an error stating the file or
directory could not be found.  The perl script runs a shell command from
within it to run backup.php.  Manual tests show that that works, I put it in
a cron job and am confident that it will run. 

Robbert

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 05, 2008 11:06 PM
To: Robbert van Andel
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP CLI Problem


 First off, the script runs great from the command line when I type php5
 backup.php but when I type ./backup.php I get an error: bash:
 ./backup.php: No such file or directory.

Maybe backup.php that you think it's running is the wrong one.

Add something like:

echo I am file  . __FILE__ . \n;

in your backup.php file and see if that's printed out when you run php5 
backup.php.

If it's not, then you're editing the wrong file.

  I thought maybe this is a problem
 with the top declaration in the script #!/usr/local/bin/php5.

If you have that as the first line, then you should just need to chmod 
+x the backup.php file.

 The problem
 is that it appears the server has several php5s I can reference
 
 /usr/local/apache/share/cgi-bin/php5
 /usr/local/bin/php5

Ask your host which is the right one (99% sure it'll be 
/usr/local/bin/php5).

 Questions:
 * How do I determine what to put at the top of the script so that I can
just
 call backup.php?

What difference does it make whether the full path is included in the 
cron job or not? You need to use the full path somewhere (whether it's 
in the cron job or in a shell script).

You could create a shell script:

#!/bin/bash
/usr/local/bin/php5 -f /path/to/backup.php

chmod +x the new script.

Call that instead in cron.

 * What, if anything, do I need to do to make the script work from cron?

Use the full path to php, use the full path to your backup.php file.

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

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

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

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



RE: [PHP] PHP CLI Problem

2008-02-06 Thread Robbert van Andel
D'oh.  I wondered why I got that email while I was driving.  Thanks for the
security tip.  I had actually planned on protecting those scripts after I
was done getting them to work.  

I removed the shebang, verified the script still works from the command line
but it still doesn't work with Cron.  I tried adding `which php5` and that
didn't work.  If I run it as php, then I'm stuck using php4, so that's not
really an option.

Cron works on the server because I have several perl scripts running through
cron with no problems.  In fact, I would probably give up on this given the
problems I'm having and write in perl, but the perl modules for Amazon's S3
service are poorly documented and I was not able to figure them out.

There are no cron logs and the output is not sent to me after a job has
completed.

-Original Message-
From: Daniel Brown [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 06, 2008 7:52 AM
To: Robbert van Andel
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP CLI Problem

On Feb 6, 2008 1:55 AM, Robbert van Andel [EMAIL PROTECTED] wrote:
[snip]
 First off, the script runs great from the command line when I type php5
 backup.php but when I type ./backup.php I get an error: bash:
 ./backup.php: No such file or directory.  I thought maybe this is a
problem
 with the top declaration in the script #!/usr/local/bin/php5. The
problem
 is that it appears the server has several php5s I can reference

See my note on this paragraph later in the message.  And more
importantly, see the addendum SECURITY NOTICE at the tail-end of
this email.

 /usr/local/apache/share/cgi-bin/php5
 /usr/local/bin/php5

 But it doesn't matter which one I put at the top of the script, I get the
 same error.

In this case, use /usr/local/bin/php5, which will almost
undoubtedly be compiled as a CLI object, while the
../apache/share/cgi-bin/php5 is most likely a CGI binary or (less
likely) Apache module.  However, keep this part in mind, as with the
first paragraph, for later in the message.

 Okay, so I can live with having to type php5 backup.php.  However, when
I
 try to make a cron job from the script, the script never runs.  The
crontab
 entry looks like this
 1 0 * * 2 php5

/kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
 backup.php  backup.log

In your cronjob, replace the php5 entry with the following
(including the backticks):
`which php5`

If that still doesn't work, replace it simply with php, not php5:
`which php`

This allows BASh/Shell to execute the eval'd command typed within
the backticks.

 I know the backup never runs because I redirect the output to a file and
 have an email sent to me upon conclusion of the script.  The log file
 doesn't show anything nor do I ever receive an email.  My web host will
not
 provide any support for scripting, so I'm hoping someone here can help.

Are you certain that the user under which the script is executed
via cron is yourself?  On rare occasions (some BSD boxes, Cobalt RaQ
RHL variants, et cetera), cron will not always run as the local user.
It may run as 'cron', 'crond', 'daemon', 'nobody', 'unpriv', 'anon',
or as whomever the sysop has it configured.

 Questions:
 * How do I determine what to put at the top of the script so that I can
just
 call backup.php?

Doing that is not such a great idea, and here's where the first
two paragraphs come into play: remove the interpreter designation line
(the first line, containing the #! characters).  Make sure the script
is enclosed in ?php ? tags.  You can find scripts that written to
specifically run as crons that instead have the interpreter
designator, but it's just one more thing you'll have to manually
change when porting from one system to another, or if your host
updates their configuration.

PLUS: Keep in mind that, even when using an interpreter
designator, you *still* have to enclose your code in the ?php ? tags
(or, if short_open_tags is on, which it probably is, just use ? ?
tags).  Why?  Because PHP is set to parse *only* code between those
tags, and even if you run the CLI with the -r flag (which allows you
to run code without the ? ? tags), it will only run /one line/ of
code per call.  (See: `which php` --help  -OR-  `which php5` --help)

So if you absolutely want to run it as ./backup.php from the local
directory, or
/kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
backup.php,
here are the steps to do so:

1.) chmod 755
/kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
backup.php
2.) Line 1 (backup.php): #!/usr/local/bin/php5 (or whatever 'which
php5' or 'which php' says - no backticks here)
3.) Enclose your code in ? ? tags, not including the interpreter
designator (first line).


 * What, if anything, do I need to do to make the script work from cron?

See above answers.


SECURITY NOTICE


Here are some things to consider

RE: [PHP] PHP CLI Problem

2008-02-06 Thread Robbert van Andel
Not an option.  Which php gives me php4 and the script requires php5.

 

From: Nathan Nobbe [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 06, 2008 8:39 AM
To: Robbert van Andel
Cc: Daniel Brown; php-general@lists.php.net
Subject: Re: [PHP] PHP CLI Problem

 

On Feb 6, 2008 11:33 AM, Robbert van Andel [EMAIL PROTECTED] wrote:

I tried adding `which php5` and that didn't work.


did you try running

which php5

on the cli to ensure it even maps to a path ?  you might need

which php

instead.

-nathan

 



[PHP] PHP CLI Problem

2008-02-05 Thread Robbert van Andel
I am having trouble with a PHP CLI script I wrote to help manage my website.
The site is on a shared hosting server where the PHP installation is set up
as a CGI.  The script creates some backups of my databases and sends them to
Amazon's S3 service.  

First off, the script runs great from the command line when I type php5
backup.php but when I type ./backup.php I get an error: bash:
./backup.php: No such file or directory.  I thought maybe this is a problem
with the top declaration in the script #!/usr/local/bin/php5. The problem
is that it appears the server has several php5s I can reference

/usr/local/apache/share/cgi-bin/php5
/usr/local/bin/php5

But it doesn't matter which one I put at the top of the script, I get the
same error.

Okay, so I can live with having to type php5 backup.php.  However, when I
try to make a cron job from the script, the script never runs.  The crontab
entry looks like this
1 0 * * 2 php5
/kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
backup.php  backup.log

I know the backup never runs because I redirect the output to a file and
have an email sent to me upon conclusion of the script.  The log file
doesn't show anything nor do I ever receive an email.  My web host will not
provide any support for scripting, so I'm hoping someone here can help.

Questions:
* How do I determine what to put at the top of the script so that I can just
call backup.php?
* What, if anything, do I need to do to make the script work from cron?

I've seen some comments on the web regarding PHP CLI when PHP is a CGI, but
none of them seem to apply to me.  

Thank you in advance for your help.

Robbert

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



RE: [PHP] Unicode Problem

2006-10-05 Thread Robbert van Andel
I know it's Unicode because the javascript is encoding it as Unicode (and
it's doing so correctly).  I guess the gist of my question is how to do I do
a reverse.  How do I take %u2022 and get make that display as the bullet
character?

-Original Message-
From: Dotan Cohen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 05, 2006 3:44 PM
To: [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Subject: Re: [PHP] Unicode Problem

On 06/10/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I have a webpage that allows users to post news stories for their
department.  The site uses AJAX to send the data to the webserver.  The
problem I'm having is when the user uses some unicode characters like
bullets or MS Word quotes, the page comes out weird.

 Here's the process.
 1. The user enters the story and clicks save.
 2. The javascript uses the escape function to turn the text into something
that can be posted to the server.  This function turns spaces into %20, but
it turns unicode characters into a longer string like %u.
 3. The javascript then sends the data to the processing page.
 4. The PHP processing page receives the data and saves it to the mySQL
database server.

 The problem I see is that any unicode character is saved in it's escaped
unicode sequence.  For example a bullet is saved into the database as a
literal %u2022.  What I need to know is what function can I use so that it's
either saved as the unicode bullet character or displayed back on the page
as the bullet?

 Thank you


I doubt that MS Word quotes are unicode. And as long as the users are
coping/ pasting between MS products (Word-IE) you're going to have a
hard time deciphering those funny characters. Try to encourage them to
use Firefox, and if possible to use a UTF-8 compliant word processor.
Mine is Kword, but I don't think that's available for Windows.

Dotan Cohen
http://what-is-what.com
98

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

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



[PHP] RSS Generation

2006-04-10 Thread Robbert van Andel
I am working on creating some RSS feeds on my website using PHP.  I'm still
learning RSS but it seems easy enough. I managed to create the RSS giving
the file a PHP extension.  When I tried saving it with an xml extension and
adding a .htaccess file to the directory in which the file was saved, I get
prompted to save the file instead of being able to view the file in a
browser.  The only line in the .htaccess file is AddType
application/x-httpd-php xml.  

 

First off, and I'm sorry that this isn't a PHP specific question, but does
RSS require an XML extension?  And if it does, how do I get the server to
serve the PHP file correctly if I rename it with the xml extension?

 

Thanks,

Robbert van Andel

 



RE: [PHP] Re: post and variables

2005-11-10 Thread Robbert van Andel
Essentially, Ross, you can use $_POST variables as a regular associative
array.  $_POST values come from the posted values in a form.  If you have a
form element called table_name, and your form uses the post method (as
opposed to the get method), your script would have $_POST['table_name']
available to it.  As the example below shows, you can then check its value.
The value of $_POST['table_name'] is the value that was entered in the
corresponding form element.  In this case, you're looking to see if it's
equal to 1.  If you want to output the value of a $_POST variable, you could
do something like

echo pThe value of table_name is {$_POST['table_name']}/p\n;

or if you don't have a free flowing input box you would probably want to
output the value with htmlentities or htmlspecialchars.

echo pThe value of table_name is  . htmlentities($_POST['table_name']) .
/p\n;

I hope this helps.  The previous posters are right though, there is lots of
documentation out there

Robbert



Ross wrote:
 Sorry I got confused. I am using variable variables.
 
 Disregard.
 Ross [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
 
Thanks fpr all the feedback on the password but I have another one...

How do I use $_POST with variables. Cant find an example of this anywhere 
on php.net


if ($_POST['$table_name== 1']) {

$tablename = 'yourtable';

if (isset($_POST[ $tablename ])  $_POST[ $tablename ] == 1) {
echo $tablename, ' has been selected';
}


//do something

}

Ta,

ross 
 
 

-- 
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] undefined index and php

2005-11-10 Thread Robbert van Andel
The question mark and colon is the equivalent for the iif function.  It's a
short hand for if/else.  You start with the expression, and if true, do
what's after the question mark and if false, after the column.

Robbert

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 10, 2005 4:58 AM
To: php-general@lists.php.net
Subject: Re: [PHP] undefined index and php

I have never really used this abreviated format before

why the question mark and the colon? What is the long hang eqivalent.

I turned magic quotes off too.

thanks.

R.
- Original Message - 
From: Jasper Bryant-Greene [EMAIL PROTECTED]
To: Ross [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Thursday, November 10, 2005 12:19 PM
Subject: Re: [PHP] undefined index and php


 Ross wrote:
 because the following line give the notice 'undefined index'  BEFORE  the

 submit button has been pressed..

 ? $heading_insert= stripslashes($_POST['heading']);?

 That's because before the submit button has been pressed, $_POST is empty 
 and so 'heading' is indeed an undefined index. Try:

 $heading_insert = isset( $_POST['heading'] ) ? stripslashes( 
 $_POST['heading'] ) : '';

 By the way, while you're switching register_globals off, it might be a 
 good idea to also switch off magic_quotes_gpc (the reason you need 
 stripslashes() above) and short_open_tag (judging by your use of the 
 non-portable ? open tag rather than ?php).

 Jasper


 

-- 
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] php5 / php4 - MySQL/SQLite

2005-11-08 Thread Robbert van Andel
I recently upgraded to PHP5 and had no issues with code incompatibilities.
I believe we ran PHP 4.10 (I don't remember the exact version).  Honestly, I
haven't seen that many benefits but I don't write that many scripts that use
advanced OOP methodology. 

-Original Message-
From: Danny [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 3:53 AM
To: php-general@lists.php.net
Subject: [PHP] php5 / php4 - MySQL/SQLite

Hi,
 Let me open a discussion about php5 / php4
 Why upgrade? It worth? Benefits? Code programming changes?
 Is there and end-of-life for php4, in the near/medium future?
 What about MySQL and SQLite. What is the future of both? I would like to
open a discussion about the future of both related to php no matter the
version of it...
Let´s start
--
dpc

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



[PHP] PHP from the command line

2005-11-03 Thread Robbert van Andel
I run a linux webserver with Apache and PHP5.  Does anyone out there know
why a php script would work from the command line but fail when running it
through a web browser?  In particular, I'm trying to get a connection to an
MSSQL server but PHP fails to connect when I run the script with a web
browser.  My regular scripts (i.e. ones without any mssql functions) work
fine from the browser. When I run the script from the command line, the
connection succeeds.  Any idea if this is a PHP error or an apache error. If
this is an apache error, does anyone know what I need to search for to find
an answer?

 

Thanks,

Robbert van Andel

 



RE: [PHP] PHP from the command line

2005-11-03 Thread Robbert van Andel
From the web, all I get is that the connection failed.  Nothing more useful
than that.  PHP_INFO tells me that it sees the MS SQL ini file and the MS
SQL configuration settings are displayed further down the list.

The username and password work in the script because I am able to connect
using the exact same script from the command line.

-Original Message-
From: bruce [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 03, 2005 7:28 PM
To: 'David Tulloh'; 'Robbert van Andel'
Cc: php-general@lists.php.net
Subject: RE: [PHP] PHP from the command line

what's the error that you're getting from the web php app...

also, what do you get from the php_info() for the web app? this tells you a
great deal of information regarding your php/web setup (if you didn't
already know!)

get us the information and we can help track down your issue...

also, is there a user/passwd setup to access the mssql db?

-bruce


-Original Message-
From: David Tulloh [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 03, 2005 6:22 PM
To: Robbert van Andel
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP from the command line


Many linux distributions use a different php config file for the apache
and cli versions.
Using two different configurations might explain the problems you are
seeing.

David

Robbert van Andel wrote:

I run a linux webserver with Apache and PHP5.  Does anyone out there know
why a php script would work from the command line but fail when running it
through a web browser?  In particular, I'm trying to get a connection to an
MSSQL server but PHP fails to connect when I run the script with a web
browser.  My regular scripts (i.e. ones without any mssql functions) work
fine from the browser. When I run the script from the command line, the
connection succeeds.  Any idea if this is a PHP error or an apache error.
If
this is an apache error, does anyone know what I need to search for to find
an answer?



Thanks,

Robbert van Andel







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

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



[PHP] PHP and MSSQL on Linux

2005-11-01 Thread Robbert van Andel
A few months back I wrote the list asking for help making a connection to a
MS SQL database from our linux webserver.  At that time I was able to make a
successfull connection on Fedora Core 1 after installing php-mssql.rpm and a
freetds rpm.  When I upgradd to FC4, I was unable to continue my project
because the RPMs had not been built for PHP5.0.4, whic is the version we run
now.  

 

Today, I was able to get the version of php-mssql I needed and installed it
successfully.  I am able to make a connection to our ms sql server using
tsql.  There is a mssql.ini file in the php.d directory and the mssql.so
file is in /usr/lib/php/modules/.  Using the get_loaded_extensions fuction,
I see that mssql is a loaded module and the phpinfo() function shows me
mssql configuration files.  All indicators tell me that I should be able to
connect.

 

Obvsiously, since I'm posting to the list, you can guess that it's not
working.  The error message I get back is useless as I'm only told that the
connection failed.  Does anyone know anything else I need to check to get
the connection working?  

 

Upon troubleshooting, I found that there is no traffic going to database
server when I used TCPDUMP.  There is traffic going when I use tsql.

 

Thank you,

Robbert van Andel

 



RE: [PHP] PHP and XML

2005-10-06 Thread Robbert van Andel
Yes, I resolved the problem today by installing this RPM via yum.  I had
assumed it was already installed because I was able to do some XML parsing
without it.  

I was able to get the XML transformed and it looks good, if I do say so
myself :)

Robbert

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 06, 2005 8:05 AM
To: php-general@lists.php.net
Subject: RE: [PHP] PHP and XML

Quoting Robbert van Andel [EMAIL PROTECTED]:

 Thanks, I'm investigating XSL and it looks pretty good.  We use an RPM
based
 installation of PHP version 5.0.4.  I see on PHP.net's website that XSL
 comes standard with PHP 5 and you need to enable it by adding the argument
 --with-xsl to the configure line.  How do I do this when we did not build
 PHP from source?  Is there another way to get XSL activated?

 Thanks for your help
 Robbert

You don't mention which distro you're using, but Fedora Core 4 has a 
php-xml rpm to ...add support to PHP for manipulating XML documents 
using the DOM tree, and performing XSL transformations on XML 
documents.

Hope this helps,
Rick
-- 
Rick Emery

When once you have tasted flight, you will forever walk the Earth
with your eyes turned skyward, for there you have been, and there
you will always long to return
  -- Leonardo Da Vinci

-- 
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] Linux/PHP and Windows/MSSQL

2005-10-06 Thread Robbert van Andel
There are freetds rpms out there as well as mssql rpms.  I got it to work on
a Fedora Core 1 box but since upgrading to Fedora Core 4 I was not able to
find any rpms for either because they are not available for PHP5 (yet).  If
you find any I'd love to know.  Sorry I can't point to where I got them with
the older version of PHP because those notes are at work.

Robbert van Andel

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 06, 2005 6:30 PM
To: php-general@lists.php.net
Subject: [PHP] Linux/PHP and Windows/MSSQL

Knowing that I'm not the only one to want to connect to Microsoft SQL 
Server on Windows from PHP and Apache on Linux, I'm seeking advice.

I set up a proof-of-concept application, using Gentoo Linux (with which 
I'm most familiar) as my base. Being a compile-from-source distribution 
with a lot of packages available, I simply had to set the mssql USE 
flag and emerge freetds and php. Voila; connectivity.

Not surprisingly, now that my organization has decided to go with PHP 
on Linux, management wants to use a commercially supported distribution 
(Red Hat or Novell/SUSE). I was surprised to discover that I couldn't 
find RPMs for freetds, nor could I find php-mssql RPMs, and the php 
RPMs available in the yum repositories weren't compiled with 
--with-mssql.

Is my only recourse to build freetds and php from source? I'm certainly 
capable of doing it, but I won't be the server administrator and I 
think it defeats what management wants to accomplish with a 
commercially supported distro (package management with easy updates).

Is anybody in a similar environment that has an easy solution, or can 
anybody offer advice?

Thanks in advance,
Rick
-- 
Rick Emery

When once you have tasted flight, you will forever walk the Earth
with your eyes turned skyward, for there you have been, and there
you will always long to return
  -- Leonardo Da Vinci

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

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



RE: [PHP] PHP and XML

2005-10-05 Thread Robbert van Andel
Thanks, I'm investigating XSL and it looks pretty good.  We use an RPM based
installation of PHP version 5.0.4.  I see on PHP.net's website that XSL
comes standard with PHP 5 and you need to enable it by adding the argument
--with-xsl to the configure line.  How do I do this when we did not build
PHP from source?  Is there another way to get XSL activated?

Thanks for your help
Robbert 

-Original Message-
From: Stephen Leaf [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 05, 2005 7:39 PM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP and XML

On Wednesday 05 October 2005 06:20 pm, [EMAIL PROTECTED] wrote:
 My company recently installed google's search appliance and I am working
 on some scripts to display the search results on our various websites.
 The problem I'm having is using the XML parsing functions I've used on
 other pages is not working because the returned XML has invalid xml
 characters in it.  For example, the data between the xml tags include
 html tags that are supposed to be displayed.  But when I parse the xml,
 the parse sees these tags as new start tags.  Is there a way to work
 around this or a different way to parse this document?  I've heard a
 little about XSLT really don't know anything about it and am wondering
 if that is the way to deal with it?
XSL can display the contents using a 
xsl:copy-of select=node/
bear in mind tho that it also copies the node name.
example:
nodecopied stuffbr//node

copying only the inner content can be achieved by doing a select=. however

you'll need to have the current node be the one that you want copied.
this can be done by using a
xsl:for-each select=node
xsl:copy-of select=./
/xsl:for-each

If anyone else knows of a better way _please_ let me know :)

When working with XML and going to HTML .. IMO XSL is the best way to 
accomplish it.


 Here is a part of the XML returned by the google appliance:
 GSP VER=3.2
 TM0.008398/TM
 Qinformation services/Q
 PARAM name=q value=information services
 original_value=information+services/
 PARAM name=site value=shpolicy original_value=shpolicy/
 PARAM name=client value=shpolicy original_value=shpolicy/
 PARAM name=output value=xml_no_dtd original_value=xml_no_dtd/
 PARAM name=btnG value=Google_Search
 original_value=Google+Search/
 PARAM name=ip value=10.2.4.44 original_value=10.2.4.44/
 PARAM name=access value=p original_value=p/
 -
   RES SN=1 EN=10
 M86/M
 FI/
 -
   NB
 -
   NU

/search?q=information+servicessite=shpolicyhl=enoutput=xml_no_dtdclient
=shpolicyaccess=psort=date:D:L:d1start=10sa=N /NU
 /NB
 -
   R N=1 MIME=application/pdf
 -
   U

http://shpolicy.shservices.org/administrative/InformationServices/housewide
applicable/Information%20Services%20Software%20Purchasing%20Policy.pdf /U
 -
   UE

http://shpolicy.shservices.org/administrative/InformationServices/housewide
applicable/Information%2520Services%2520Software%2520Purchasing%2520Policy.
p
df /UE
 -
   T
 bInformation/b bServices/b Software Purchasing
 /T
 RK5/RK
 FS NAME=date VALUE=2005-09-07/
 -
   S
  b.../b Administrative Housewide Policy bInformation/b
 bServices/b Software Purchasing Applicablebr Campus: Salem and
 West Valley Hospitals Department Name: bInformation/b b.../b
 /S
 -
   HAS
 L/
 C SZ= CID=4_wracnOVC8:/
 /HAS
 /R

 I can send the parsing code but it's fairly straight forward and I
 didn't want to needlessly fill up the email.

 Any suggestions?

 Thanks,
 Robbert van Andel

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

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



RE: [PHP]Re: Need advice or code

2005-08-27 Thread Robbert van Andel
You don't need to use XML with XmlHTTPRequest.  The returned data can be a
simple text string.

XmlHTTPRequest is the best javascript technology to come out.  It's done
wonders for the interactivity of my websites.  It's well worth the time to
learn.

-Original Message-
From: Death Gauge [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 27, 2005 8:17 PM
To: php-general@lists.php.net
Subject: RE: [PHP]Re: Need advice or code

I would do that but my preferences don't include XML. Right now I code in 
just PHP/MySQL/Javascript/Java/C++/ASM and that is it(of course C++ and ASM 
don't count as web languages heh).
--Death Gauge
How do you gauge your death?!

Maybe try a bit of XmlHTTPRequest and some Javascript. When the first item 
is selected (and maybe a submit button is pressed) it goes to the 
XmlHTTPRequest script, gets the data from a php script and echos the output.

I'm only a beginner on XmlHTTPRequest, so I can't help you code-wise. Sorry.

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

_
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

-- 
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] mkdir, Shared Hosting?

2005-08-06 Thread Robbert van Andel
As far as I know, it's not a shared hosting issue, but a permission issue.
The site admin has not given the user under which your php scripts run
permission to create directories and most likely files and other file system
operations.  It's a security issue.

Robbert

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 06, 2005 8:53 PM
To: php-general@lists.php.net
Subject: [PHP] mkdir, Shared Hosting?

Hi,

I'm using Shared Hosting and I was told - then I learned from  trial and  
error - that you can't use mkdir on Shared Hosting... is  this *100%* true? 
is  
there a way around it?

I  get:

Warning:  mkdir(/home/***/public_html/test/): Permission denied  in  
/home/***/public_html/test.php on line 3 

So, again, is  there any possible way around this? I've Googled,  read the 
manual but  it seems that If I don't get an Error - I get nothing at  all,  
including the directory.

Thanks for any help!

-  Clint

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



RE: [PHP] a basic array question!

2005-06-25 Thread Robbert van Andel
If you want to get the lastname value of the array you supplied you would do
this

$value = $foo['facets'][0]['lastname'];

This would give you the HTML form that you have stored in your array.

Robbert

-Original Message-
From: bruce [mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 25, 2005 2:02 PM
To: php-general@lists.php.net
Subject: [PHP] a basic array question!

feel kind of foolish posting this.. but i can't seem to figure it out for
now..

i have an array, i can do a print_r($foo) and get the following:
Array
(
[bookmark] = 1
[facets] = Array
(
[0] = Array
(
[lastname] = form id=facet-lastname
input type=hidden name=list value= /
input type=hidden name=offset value=0 /
input type=hidden name=orderBy value=username /
input type=hidden name=sort value=asc /
strongName:/strong
input type=text name=_lastname value= style=width: 125px /
input type=submit value=Search /
/form
}

i simply need to know how to get the actual value of an element ('lastname')
to do:
$cat = $foo-facets[0]-['lastname'] (obviously, this doesn't work!!)

i've tried a variety of possible choices, with no luck...

any ideas/thoughts/etc...

thanks

bruce
[EMAIL PROTECTED]

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

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



[PHP] XHTML and dynamic javascripts

2005-03-13 Thread Robbert van Andel
 

I am working to convert my website to XHTML and ran into a compliance
problem with several dynamically created javascripts.  According to the
XHTML specification, embedded javascripts are now supposed to now be
enclosed with ![CDATA[ script goes here ]].  The problem is that it's not
supported by IE or firefox and throughs javascript errors.  So the other
option is to use externally linked javascript files.  

 

Now down to the PHP specific question.  Is there a way to generate an
externally linked javascript file?  The javascript functions in question are
created from data sitting in a MySQL data, so I can't hard code the
javascript.

 

Thanks,

Robbert van Andel

 

 



RE: [PHP] XHTML and dynamic javascripts

2005-03-13 Thread Robbert van Andel
Thanks, that worked.  

-Original Message-
From: Mikey [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 13, 2005 12:18 PM
To: php-general@lists.php.net
Subject: RE: [PHP] XHTML and dynamic javascripts

 Now down to the PHP specific question.  Is there a way to 
 generate an externally linked javascript file?  The 
 javascript functions in question are created from data 
 sitting in a MySQL data, so I can't hard code the javascript.

Yes, just change the .js extension to .php

HTH,

Mikey

-- 
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] passing variables between pages without sessions

2005-03-13 Thread Robbert van Andel
With each subsequent page load, have hidden fields that store the values of
the previous page's form.  There might be another way, but that comes to
mind.


-Original Message-
From: Ross Hulford [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 13, 2005 2:06 PM
To: php-general@lists.php.net
Subject: [PHP] passing variables between pages without sessions

I am creating a form but instead of having a long form I want to break it 
down into a few stages but need to pass the variables bewteen the pages.

I have done this before using sessions but would like to know if there is an

alternative way to do this?

R. 

-- 
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] software catalog

2005-03-13 Thread Robbert van Andel
I've used Zen Cart (http://www.zen-cart.com/modules/frontpage/) in the past.

-Original Message-
From: Judson Vaughn [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 13, 2005 3:05 PM
To: [EMAIL PROTECTED]
Cc: Ryan A; php
Subject: Re: [PHP] software catalog

X-Cart has a very nice feature for delivering intangibles. But it is 
around $285.

Jud.



Judson Vaughn
[EMAIL PROTECTED] | [EMAIL PROTECTED]
Seiter Vaughn  Communications
12455 Plowman Court
Herndon, VA 20170
703.450.9740
svc


Richard Lynch wrote:
Hey!
Anybody know of a software catalog (or cart preferably) that is free?

A site i am working for sells software, now they want to have a cart
feature
so people can put the packages in a cart and get discounts etc if they
purchase more than 1 product...they are using 2checkout for processing.

I checked the usual places and google of php software cart but got back
garbled results, most of that carts are for tangible products :-(
 
 
 This might have sells intangibles as a feature check point:
 
 http://l-i-e.com/compare/index.htm?date=1970-01-01
 
 Or you can add it and check back after some people vote
 
 Disclaimer: I hacked this up after the umpteen flame war about PHP
 Shopping Carts on this list in, oh, call it 2000 or so...  God only knows
 which of those solutions is way out of date or whatever.  Caveat Emptor.
 

-- 
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] newbie php/mysql need help

2005-03-13 Thread Robbert van Andel
Simple but should work.

$query =  SELECT DISTINCT (brand), COUNT( brand )FROM `machines` where
category like 'sold' group by brand;;

$result = mysql_query($query) or die(mysql_error());

While($data = mysql_fetch_array($result)) {
echo p{$data[0]} - {$data[1]}/p\n;
}

-Original Message-
From: p80 [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 13, 2005 4:35 PM
To: php-general@lists.php.net
Subject: [PHP] newbie php/mysql need help


I do a mysql request like this one:

SELECT DISTINCT (brand), COUNT( brand )FROM `machines` where category like 
'sold' group by brand

I get this from mysql:
brand COUNT( brand)
brandx4
brandy12

how can I echo this result in php?

thanx in advance

Pat

-- 
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] include(sendmail.phps);

2005-03-13 Thread Robbert van Andel
Read the contents of the file into a variable and then output the contents
of the variable via print or echo.

-Original Message-
From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 13, 2005 10:09 PM
To: php-general@lists.php.net
Subject: [PHP] include(sendmail.phps);

I want to include a phps file. But would like it to display the coloured
formatting of a phps, instead of executing the code with in. Is this
possible? This does not work:
include(sendmail.phps);
Thanks,
John

--
John Taylor-Johnston

-
If it's not Open Source, it's Murphy's Law.

  ' ' 'Collège de Sherbrooke:
 ô¿ôhttp://www.collegesherbrooke.qc.ca/languesmodernes/
- 819-569-2064

  °v°   Bibliography of Comparative Studies in Canadian, Québec and Foreign
Literatures
 /(_)\  Université de Sherbrooke
  ^ ^   http://compcanlit.ca/ T: 819.569.2064

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

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



[PHP] Includes inside includes

2003-12-21 Thread Robbert van Andel
I've written a class that is calling an include
function to include a setup file.  The problem is that
the setup file is in another directory than the class.
 I'm including the file using:

include (../common/setup.inc);

Is there a way that i can make the relative path
inside the class definition specific to the class
definition, not the page that is including the class
definition.  I have trouble when I include the class
definition.  I get an error that it cannot include
../common/setup.ini whenever the class is called
from a directory above common.

I hope this makes sense. and thanks for your help.

Robbert van Andel
  

__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



[PHP] Graphics question

2002-11-07 Thread Robbert van Andel
I have created a webpage that builds a table and graph using the GD
functions.  When I switch to another page or select a different month to
build the table for, the graph.jpg does not rebuild.  I have to press
reload to make the graph render using the new data.  I have used
imagedistroy($pic) in the hopes that this will work, but it didn't.

To elaborate on the situation, I first call imagecreate, then run the
code to create the bar graph.  I then use

imagejpg($pic,$graphname) (or something ot that affect.  I don't have
access to the code at home).

I then show the picture using 

echo img src=\$graph\;

Finally I call imagedestroy($pic).   Do you have any suggestions?




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




RE: [PHP] Graphics question

2002-11-07 Thread Robbert van Andel
Is there a way I can keep the caching from happening using PHP?

On Thu, 2002-11-07 at 19:32, Martin Towell wrote:
 sounds like a browser caching problem to me
 dunno if that helps though :/
 
 -Original Message-
 From: Robbert van Andel [mailto:robbert;vafam.com]
 Sent: Friday, November 08, 2002 2:30 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Graphics question
 
 
 I have created a webpage that builds a table and graph using the GD
 functions.  When I switch to another page or select a different month to
 build the table for, the graph.jpg does not rebuild.  I have to press
 reload to make the graph render using the new data.  I have used
 imagedistroy($pic) in the hopes that this will work, but it didn't.
 
 To elaborate on the situation, I first call imagecreate, then run the
 code to create the bar graph.  I then use
 
 imagejpg($pic,$graphname) (or something ot that affect.  I don't have
 access to the code at home).
 
 I then show the picture using 
 
 echo img src=\$graph\;
 
 Finally I call imagedestroy($pic).   Do you have any suggestions?
 
 
 
 
 -- 
 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] Graphics question

2002-11-07 Thread Robbert van Andel
That would cause an error like call to undefined function.  But thanks
for the suggestion.

On Thu, 2002-11-07 at 20:04, @ Darwin wrote:
 The reason imagedestroy() may have not worked for you is that maybe
 imagedestroy() is misspelled? If you misspelled it in the code then it won't
 work. Just a suggestion.
 
 - Darwin
 
  -Original Message-
  From: Robbert van Andel [mailto:robbert;vafam.com]
  Sent: Thursday, November 07, 2002 9:30 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Graphics question
 
 
  I have created a webpage that builds a table and graph using the GD
  functions.  When I switch to another page or select a different month to
  build the table for, the graph.jpg does not rebuild.  I have to press
  reload to make the graph render using the new data.  I have used
  imagedistroy($pic) in the hopes that this will work, but it didn't.
 
  To elaborate on the situation, I first call imagecreate, then run the
  code to create the bar graph.  I then use
 
  imagejpg($pic,$graphname) (or something ot that affect.  I don't have
  access to the code at home).
 
  I then show the picture using
 
  echo img src=\$graph\;
 
  Finally I call imagedestroy($pic).   Do you have any suggestions?
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 



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