[PHP] PHP.INI Lockdown

2002-06-04 Thread David Redmond

Hi All,

Is there anyway to lockdown PHP so that only the INI file from C:\WinNT\ is
used?  Currently, you can place an INI file into the same directory as the
php script your viewing through a browser and instead of loading the INI
file located in the C:\WinNT\ directory, it will load the INI file that is
in the current working directory.  Same thing applies to putting the INI
file in the directory where the PHP executable is stored.

Using the -c  command line switch forces PHP to check the directory
that you've specified for the INI file, however setting up the following in
IIS Application Mappings fails to work, although running it from the command
line works fine.

e:\php\php.exe -c C:\WinNT\ %s %s

I've also tried a multitude of variants using "'s, forward-slashes, etc.
without any luck.

Cheers

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




[PHP] Design Tips

2002-06-26 Thread David Redmond

Hi All,

I'm about to put myself in the deep end by attempting to create an PHP app
that will perform the role of a proxy server.  The application has to
perform the following based on the URL that the web client will be
requesting.

URL Requested: https://servername/id0001/

'id0001' is a unique for each of my clients and they have a matching record
which points to their content.  Each client will have a different server
that their content is hosted on.  I want the PHP app to read in that id
number , perform a SQL query to obtain where their real server is, retrieve
the content then display it back to the client.

The app would have to deal with GET & POST as it would be working with
dynamic content at the remote end.

Is this even possible using PHP?  If anyone has had any experience
developing this type of App before, please let me know how you went and/or
provide any tips that you can :)

Cheers

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




RE: [PHP] Problem on file_exists()

2002-07-15 Thread David Redmond

Jack, try using forward slashes instead of backslashes;eg

$fp = fopen("//nedcoraa/pdf_reports/dealing/filename.ext", "r+");

Cheers

-Original Message-
From: Jack [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 16 July 2002 5:02 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Problem on file_exists()


Dear all
I had a folder which the path is : (\\nedcoraa\pdf_reports\dealing
room\report) it stores a lot of PDF reports in there.
I'm trying to use the file_exists() function to detect if a specific file
exist in this folder, but i got a problem is :
It seems that php can go through (\\nedcoraa\pdf_reports) but it can't go
through (dealing room) folder. i had made test on it, i moved a file into
(\\nedcoraa\pdf_reports), then php can detect it, but if i move it to
(\\nedcoraa\pdf_reports\dealing room), then it can't detect the file! why?

I'm using php in windows NT IIS environment!

Please help me!

--
Thx a lot!
Jack
[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] RE: [PHP-DB] I cant get the logic for this...

2002-02-18 Thread David Redmond

If you use the following code it should work well.  I used 2 counters, one
for the columns and one for the row.  It's a bit messy but it works.

Cheers

NB: Code is untested but copied from a working example with unnecessary bits
removed.

\n";
$counterRow = 0;
$counterCol = 0;
$counterResults = mysql_num_rows($result);

for ($i = 0; $i < $counterResults; $i++) {
   if (($colCounter < 3) && ($counterRow == 0)) {
  echo "   \n";
  $counterRow = 1;
   }
   echo "  Column Data\n";
   $counterCol++;
   if ($counterCol == 3) {
  echo "   \n";
  $counterCol = 0;
  $counterRow = 0;
   }
}

echo "\n";
?>

-Original Message-
From: SpamSucks86 [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 19 February 2002 12:35 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] RE: [PHP-DB] I cant get the logic for this...


I had this same problem. It's very aggravating. Jason G's solution won't
work, because $oRow will always be true as long as there is more
results, NOT if there are less than 3 results left.

Why don't you true something like this

 0) {
//echo your row with 3 cells
$numevenrows = $numevenrows - 1;
}

if ($numrows == 2) {
//Write the last row with only two cells. You might want to just
close the old table and make a new one and center it so that those two
cells are centered, or you could use colspan="2" in the HTML so that one
of the cells spans more.
}

elseif ($numrows == 1) {
//same thing
}
?>

This code is definitely untested, but I think you should understand the
logic behind it, I did more commenting than I did coding.


-Original Message-
From: Jason G. [mailto:[EMAIL PROTECTED]] 
Sent: Monday, February 18, 2002 9:11 AM
To: Dave Carrera; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] I cant get the logic for this...

$nWidth = 3;
$oRow = TRUE;

while($oRow)
{
 //Write tr here
 for($i=0; $i<$nWidth; $i++)
 {
 $oRow = mysql_fetch_object($dbResult);
 //Write  here
 }
 //write /tr here
}

At 12:06 PM 2/18/2002 +, you wrote:
>Hi all,
>
>I want to display return results from my query (which works fine)
>In I tidy way on screen.
>
>So my result returns say seven results, I have a table, and I want to
>show
>3 results per row of the table... I.e.:
>
>Table
>TR
>TD = result1 /TD  TD result2 /TD TD = result3 /TD
>/TD
>/TR
>TR
>TD = result4 /TD  TD result5 /TD TD = result6 /TD
>/TD
>/TR
>TR
>TD = result7 /TD  TD resultempty /TD TD = resultempty /TD
>/TD
>/TR
>/table
>
>The last two td in row 3 are empty because result found 7 results.
>
>This cant be fixed so echo statements wont work as the result could
>Be 3 or 10 or 56 or whatever.
>
>As Always your help and or guidance in this matter is appreciated.
>
>Dave Carrera
>Php / MySql Development
>Web Design
>Site Marketing
>http://www.davecarrera.com
>
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php



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

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




[PHP] mail() not sending -- Little bit OT

2002-04-25 Thread David Redmond

Hi All,

When attempting to send an email through a PHP script via Apache, no emails
are sent.  However if I use the standalone binary and run the same script
but on the console then it works fine.

Because of that I have a feeling that there is something in Sendmail which
is preventing the "nobody" user to send emails since "nobody" is what Apache
runs as.

Any ideas appreciated :)

Cheers

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




[PHP] PHP.INI Lockdown

2002-05-30 Thread David Redmond

Hi All,

Is there anyway to lockdown PHP so that only the INI file from C:\WinNT\ is
used?  Currently, you can place an INI file into the same directory as the
php script your viewing through a browser and instead of loading the INI
file located in the C:\WinNT\ directory, it will load the INI file that is
in the current working directory.  Same thing applies to putting the INI
file in the directory where the PHP executable is stored.

Using the -c  command line switch forces PHP to check the directory
that you've specified for the INI file, however setting up the following in
IIS Application Mappings fails to work, although running it from the command
line works fine.

e:\php\php.exe -c C:\WinNT\ %s %s

I've also tried a multitude of variants using "'s, forward-slashes, etc.
without any luck.

Cheers

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




RE: [PHP] wordwrap not working

2002-02-20 Thread David Redmond

If your viewing the output through a browser, try this;

");
echo "$newtext\n";
?>

-Original Message-
From: Michael P. Carel [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, 21 February 2002 1:25 PM
To: php
Subject: [PHP] wordwrap not working



Hi,

Im testing the example in the
http://www.php.net/manual/en/function.wordwrap.php and it seems not working
it still printing the whole word and not wrapping. Im using php4.05 in my
redhat 6.2 using an apache.
Here's the sample:


it should print like this:

The quick brown fox
jumped over the lazy dog.

but it still printing like this:

The quick brown fox jumped over the lazy dog.



Please help



Regards,
Mike



-- 
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] Storing Script information in MySQL

2002-03-03 Thread David Redmond

Is it possible to store the contents of a PHP file within a field in a MySQL
table?
When the contents are retrieved, can they be executed by the PHP parser as
if it were part of the actual PHP file?

ie: have the following stored in the DB;

-- snip --
\n";
?>
-- snip --

Then run a PHP script to retrieve that from the DB and have below outputted
to the browser?

-- snip --
This is a test.
-- snip --

Cheers

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




RE: [PHP] Storing Script information in MySQL

2002-03-03 Thread David Redmond

I couldn't seem to get this working.  Contents of the "Text" field in the DB
are;

-- snip --
\n";
}
?>
-- snip --

contents of the field are being stored in a variable, $strTest, running
below produces nothing;

-- snip --

-- snip --

I've removed the PHP delimetrs within the field and changed the code to
something more basic (echo "Test";) and nothing is being produced.

Any further ideas?

Cheers

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]] 
Sent: Monday, 4 March 2002 2:59 PM
To: David Redmond; [EMAIL PROTECTED]
Subject: RE: [PHP] Storing Script information in MySQL


store it as text
when you get it back, do an exec() on it

-Original Message-
From: David Redmond [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 04, 2002 3:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Storing Script information in MySQL


Is it possible to store the contents of a PHP file within a field in a MySQL
table?
When the contents are retrieved, can they be executed by the PHP parser as
if it were part of the actual PHP file?

ie: have the following stored in the DB;

-- snip --
\n";
?>
-- snip --

Then run a PHP script to retrieve that from the DB and have below outputted
to the browser?

-- snip --
This is a test.
-- snip --

Cheers

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