Re: [PHP] Re: array_slice and for loop problem

2005-10-13 Thread Rodney Green
Thanks Connor. I changed the line to the following. Is it correct now?
The array $output[] is now being populated. However, when I go to
print the values of the $output array using a foreach loop, it prints
out the word Array for each array item.

$output[] = array_slice ($textArray, $int_range[start][$i],
$int_range[end][$i]);



On 10/12/05, Ethilien [EMAIL PROTECTED] wrote:
 Are you trying to put each return from array_slice into $output as an
 array? You need to replace $output = array_slice... with $output[] =
 array_slice...

 Also, you cannot just echo an array (even of characters). It must be a
 string, or else echo will only produce the output 'Array'.

 Hope this helps,
 -Connor McKay

 Rodney Green wrote:
  Hello,
 
  I'm using a for loop to iterate through an array and slice parts of
  the array and add into another array.
 
  When array_slice is called the variable $i is not being substituted
  with the current value of
  $i and the $output array is empty after running the script. Can
  someone look at the code below and give me a clue as to why this
  substitution is not happening? If I uncomment the echo $i; statement
  the value of $i is printed just fine.
 
  Thanks,
  Rod
 
  Here's my code:
 
 
  $number = count ($int_range[start]);
 //echo $number;
 for ($i = 0; $i = $number; $i++) {
 
//echo $i;
 
 $output = array_slice ($textArray, $int_range[start][$i],
  $int_range[end][$i]);
 
 }
 
 
 
 
 foreach ($output as $value) {
 
echo $value;
  }

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




--
There are 10 kinds of people in this world: those who understand
binary data, and those who
don't.

---
Get Firefox Web Browser at the link below! You won't regret it!
http://tinyurl.com/4cqbv

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



Re: [PHP] Re: array_slice and for loop problem

2005-10-13 Thread Rodney Green
$output[] = array_slice ($textArray, $int_range[start][$i],
$int_range[end][$i]); is creating a multi-dimensional array as
$output. In my foreach loop I was treating $output as a
single-dimensional array. That's why it wasn't working. print_r() is 
my friend. :-)


On 10/13/05, Rodney Green [EMAIL PROTECTED] wrote:
 Thanks Connor. I changed the line to the following. Is it correct now?
 The array $output[] is now being populated. However, when I go to
 print the values of the $output array using a foreach loop, it prints
 out the word Array for each array item.

 $output[] = array_slice ($textArray, $int_range[start][$i],
 $int_range[end][$i]);



 On 10/12/05, Ethilien [EMAIL PROTECTED] wrote:
  Are you trying to put each return from array_slice into $output as an
  array? You need to replace $output = array_slice... with $output[] =
  array_slice...
 
  Also, you cannot just echo an array (even of characters). It must be a
  string, or else echo will only produce the output 'Array'.
 
  Hope this helps,
  -Connor McKay
 
  Rodney Green wrote:
   Hello,
  
   I'm using a for loop to iterate through an array and slice parts of
   the array and add into another array.
  
   When array_slice is called the variable $i is not being substituted
   with the current value of
   $i and the $output array is empty after running the script. Can
   someone look at the code below and give me a clue as to why this
   substitution is not happening? If I uncomment the echo $i; statement
   the value of $i is printed just fine.
  
   Thanks,
   Rod
  
   Here's my code:
  
  
   $number = count ($int_range[start]);
  //echo $number;
  for ($i = 0; $i = $number; $i++) {
  
 //echo $i;
  
  $output = array_slice ($textArray, $int_range[start][$i],
   $int_range[end][$i]);
  
  }
  
  
  
  
  foreach ($output as $value) {
  
 echo $value;
   }
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


 --
 There are 10 kinds of people in this world: those who understand
 binary data, and those who
 don't.

 ---
 Get Firefox Web Browser at the link below! You won't regret it!
 http://tinyurl.com/4cqbv



--
There are 10 kinds of people in this world: those who understand
binary data, and those who
don't.

---
Get Firefox Web Browser at the link below! You won't regret it!
http://tinyurl.com/4cqbv

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



[PHP] array_slice and for loop problem

2005-10-12 Thread Rodney Green
Hello,

I'm using a for loop to iterate through an array and slice parts of
the array and add into another array.

When array_slice is called the variable $i is not being substituted
with the current value of
$i and the $output array is empty after running the script. Can
someone look at the code below and give me a clue as to why this
substitution is not happening? If I uncomment the echo $i; statement
the value of $i is printed just fine.

Thanks,
Rod

Here's my code:


$number = count ($int_range[start]);
   //echo $number;
   for ($i = 0; $i = $number; $i++) {

  //echo $i;

   $output = array_slice ($textArray, $int_range[start][$i],
$int_range[end][$i]);

   }




   foreach ($output as $value) {

  echo $value;
}

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



[PHP] document changes

2004-07-28 Thread Rodney Green
Hello,

I'm looking for an application that would allow easy documentation of
changes to a system, device or application. This would be used to
record changes made for future reference. It would simply have
categories that would contain a particular device or system and under
that device or system would be information on changes that have been
made. Kind of like a change log used for new releases of applications.

Is anyone aware of an existing application written in PHP and MySQL?

Thanks,
-- 
Rod Green
[EMAIL PROTECTED]

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



Re: [PHP] CLI question

2003-12-18 Thread Rodney Green
Ford, Mike [LSS] wrote:

Shouldn't that be *don't* use output buffering and...?  The flush() function has nothing to do with output buffering, and if output buffering is on you will need ob_flush() as well.

Another (and probably better) solution is to create a php-cli.ini file, which will be picked up only by your CLI version, and put

output_buffering = Off
implicit_flush = On
in it.  (Implicit flushing is usually expensive and inappropriate when generating Web pages, but usually exactly what you want when running from the command line.)

Cheers!

Mike



 

Thanks Jay and Mike..

Mike.. how does the CLI version of PHP know to use the new ini file?

Rod

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


[PHP] CLI question

2003-12-17 Thread Rodney Green
I'm using the CLI version 4.3.4 on Windows XP Pro. The script I'm 
writing has only a couple of functions, a couple of if conditionals 
and a while loop. At the very top of the script I have an echo 
statement with a message I want printed to the console window. The 
problem is that it's not echoed until all of the functions and other 
stuff is executed. Why is this the case? Anything I can do to get the 
echo statement to run first thing?

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


Re: [PHP] Re: post an array into another site

2003-12-08 Thread Rodney Green

- Original Message - 
From: Manuel Lemos [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 08, 2003 8:30 PM
Subject: Re: [PHP] Re: post an array into another site


 Hello,
 
 On 12/08/2003 11:04 PM, Chris Shiflett wrote:
 http://www.phpclasses.org/httpclient
 
 Or even better, use PEAR's HTTP_Client. 
 http://pear.php.net/package/HTTP_Client
 
 Why better? Have you tried both packages?
  
  
  I can make a guess as to why he would say this, aside from the obvious
  fact that one is part of the PHP project and one is not.
 
 And? Does that meant that all the 130.000+ subscribers of the PHP 
 Classes site are all wrong and you are one that is right?


phpclasses.org is a great site! 

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



Re: [PHP] Windows Environment Variables

2003-11-26 Thread Rodney Green
Jason Wong wrote:

On Wednesday 26 November 2003 00:24, Rodney Green wrote:

 

Is PHP able to access and use Windows Environment Variables? If so, is
there a function or a reference you can point me to?
   

If any are available they would most likely be in:

 print_r($_SERVER)

 

Thanks Jason. That gave me what I needed. Another way I found to do it, 
though not as good, is to use shell_exec to call echo in Windows.

?php

$blah = shell_exec (echo %ComputerName%);
print $blah;
?

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


[PHP] line breaks

2003-11-25 Thread Rodney Green
Greetings!

I'm writing a script that will take the contents of a text file that has 
several lines of user accounts and creates a shell script with chown 
commands for each user in that text file. My problem is that when it 
writes the shell script file it puts a line break after the colon in 
between $buffer and html. How do I prevent this from doing that?

Thanks,
Rod
Code:
---
$fhandle = fopen (/scripts/thescript.sh , a);
$handle = fopen (/scripts/mail_list.txt, r);
while (!feof ($handle)) {
   $buffer = fgets($handle, 1000);
  
   fwrite ($fhandle, chown $buffer:html 
/scripts/var/spool/mail/$buffer\n, 4096);
}
fclose ($handle);
fclose ($fhandle);

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


Re: [PHP] line breaks

2003-11-25 Thread Rodney Green
John Nichel wrote:



Chances are, $buffer has the line break on it when you read it in from 
the text file.  Try striping off whitespace before you write...

while (!feof ($handle)) {
$buffer = rtrim ( fgets($handle, 1000) );
fwrite ($fhandle, chown $buffer:html
http://www.php.net/manual/en/function.rtrim.php

Thanks John! That was the problem.

Rod

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


Re: [PHP] line breaks

2003-11-25 Thread Rodney Green
John Nichel wrote:

Rodney Green wrote:

John Nichel wrote:



Chances are, $buffer has the line break on it when you read it in 
from the text file.  Try striping off whitespace before you write...

while (!feof ($handle)) {
$buffer = rtrim ( fgets($handle, 1000) );
fwrite ($fhandle, chown $buffer:html
http://www.php.net/manual/en/function.rtrim.php

Thanks John! That was the problem.

Rod


Now that I stop and think about it a bit, rtrim() may hurt you here. 
Since you're using a fread to read the text file, it will read the 
bytes you tell it (1000), then move on to the next line of code.  So 
if you have a line as such in your text file...

./command --this=that

and the fread() reaches the byte limit on the whitespace after 
command, it's going to remove that, and you'll end up with

./command--this=that

You can tell rtim() what characters to strip by doing...

rtrim ( $foo, \n );

but I've seen rtrim() strip blank spaces even when this is done.  A 
better way may be to change the way you're reading in the source file; 
instead of using a fread, you can use file(), which will put each line 
in an array element...This way, it won't stop reading in the middle of 
a line

$fhandle = fopen (/scripts/thescript.sh , a);
$handle = file ( /scripts/mail_list.txt );
for ( $i = 0; $i  sizeof ($handle); $i++ ) {
$buffer = rtrim ( $handle[$i] );
fwrite ($fhandle, chown $buffer:html 
/scripts/var/spool/mail/$buffer\n, 4096);
}
fclose ($fhandle);

Actually, I'm not having problems with that. The whitespace is still 
there in between the commands and arguments, etc. I'm using fgets , not 
fread. Not sure what the difference between the two is but I'll check it 
out. The problem I am having however is that at the end of the shell 
script that is created it puts an additional line. It writes the chown 
command line for all of the users then puts the following line with no 
user specified.

chown :html /var/spool/mail/

The other lines show up as:
chown rgreen:html /var/spool/mail/rgreen
chown rgreen01:html /var/spool/mail/rgreen01
chown rod:html /var/spool/mail/rod
Any ideas where that extra line is coming from?

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


Re: [PHP] line breaks

2003-11-25 Thread Rodney Green
John Nichel wrote:

Rodney Green wrote:
snip
Actually, I'm not having problems with that. The whitespace is still 
there in between the commands and arguments, etc. I'm using fgets , 
not fread. Not sure what the difference between the two is but I'll 
check it out. The problem I am having however is that at the end of 
the shell script that is created it puts an additional line. It 
writes the chown command line for all of the users then puts the 
following line with no user specified.

chown :html /var/spool/mail/

The other lines show up as:
chown rgreen:html /var/spool/mail/rgreen
chown rgreen01:html /var/spool/mail/rgreen01
chown rod:html /var/spool/mail/rod
Any ideas where that extra line is coming from?

thanks again,
Rod


Is there a carriage return (new line) after the last entry in your 
text file?

You can add an if test in there to stop this...

$buffer = rtrim ( $handle[$i] );
if ( $buffer !=  ) {
fwrite ($fhandle, chown $buffer:html 
/scripts/var/spool/mail/$buffer\n, 4096);
}

Thanks again, John. That was the problem and the if test fixed it.

Rod

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


[PHP] Windows Environment Variables

2003-11-25 Thread Rodney Green
Hello,

Is PHP able to access and use Windows Environment Variables? If so, is 
there a function or a reference you can point me to?

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


[PHP] tar and ownership

2003-11-21 Thread Rodney Green
Greetings!

I'm writing a script that downloads a tarball from an FTP server and 
unpacks it into a directory. Here's the line of code that does this.

exec(tar -C /scripts/ -zxv --preserve-permissions -f  . 
/scripts/mailfiles.tar.gz) or die('Tar failed!');

My problem is that the files' ownership is changed when the tarball is 
unpacked. I'm executing the script from a web browser and Apache is 
running as the user apache so the files are unpacked and ownership 
given to the user apache. How can I make it so the files will keep the 
original ownerships? This is important because the files are mail files 
and the script is used to restore the mail files from backup so the 
users can access them.

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


Re: [PHP] tar and ownership

2003-11-21 Thread Rodney Green
Marek Kilimajer wrote:

Rodney Green wrote:

Greetings!

I'm writing a script that downloads a tarball from an FTP server and 
unpacks it into a directory. Here's the line of code that does this.

exec(tar -C /scripts/ -zxv --preserve-permissions -f  . 
/scripts/mailfiles.tar.gz) or die('Tar failed!');

My problem is that the files' ownership is changed when the tarball 
is unpacked. I'm executing the script from a web browser and Apache 
is running as the user apache so the files are unpacked and 
ownership given to the user apache. How can I make it so the files 
will keep the original ownerships? This is important because the 
files are mail files and the script is used to restore the mail files 
from backup so the users can access them.


Only root can change file ownership.

   Thanks for replying. Any suggestions on how to do this then?

   Rod

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


Re: [PHP] Remove HTML TAGS

2003-11-13 Thread Rodney Green
D. Jame wrote:

HI,

Is ther any way to remove HTML tags from Source File with PHP

jame

 

Maybe this will do what you want it to do:

http://www.php.net/strip-tags

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


[PHP] Verisign DNS Abuse Petition

2003-09-18 Thread Rodney Green
PHP Users - While this is not really on topic it is relevant for all PHP 
users. Sign the petition at the link below which will be presented to 
ICANN regarding the Verisign abuse of DNS.

http://www.PetitionOnline.com/icanndns/

Rod

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


Re: [PHP] Single Quotes vs Double Quotes

2003-09-08 Thread Rodney Green
Try this: http://www.faqts.com/knowledge_base/view.phtml/aid/208


- Original Message - 
From: micro brew [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 12:03 AM
Subject: [PHP] Single Quotes vs Double Quotes


 Hi everyone,
 
 Could somebody please explain to me the difference
 between single quotes and double quotes in PHP.  It
 seems like they can be used interchangeably a lot in
 PHP but not always. For example:
 
 This works:
 header('Location: http://somedomain.com')
 
 This does not work:
 header('Location: $url')
 
 This works:
 header(Location: $url)
 
 
 Why???  Sorry if this has been asked before, but I
 didn't find a suitable answer in the archives.  TIA.
 
 Mike
 
 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design software
 http://sitebuilder.yahoo.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] execute command line script from browser

2003-08-30 Thread Rodney Green
Is there a way to execute a command line php script from a browser by, say
clicking a button and then having the browser let go and let the script run
independet of the browser? Hope I explained that correctly.

Thanks,
Rod


  CinchHost.com - Web Hosting Made Easier
 ASP, PHP, CGI, WEBMAIL, And More
 Packages as Low as $9.99 - No Set Up fees
http://www.cinchhost.com/


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



[PHP] BerkeleyDB and PHP

2003-08-14 Thread Rodney Green
Greetings!

I'm looking at using BerkeleyDB along with PHP. This is a bit off topic but
is there a WIN32 binary distribution of BerkeleyDB somewhere out there? I've
looked but haven't had any luck in finding it. I don't have Visual C++ to
compile the source. If someone knows of a precompiled source please send me
a link.

Thanks!
Rod


  CinchHost.com - Web Hosting Made Easier
 ASP, PHP, CGI, WEBMAIL, And More
 Packages as Low as $9.99 - No Set Up fees
http://www.cinchhost.com/



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



[PHP] shell_exec

2003-08-14 Thread Rodney Green
Hello. I've been attempting to write a script that will run a shell script
using the shell_exec function and haven't had any success with getting it to
run in the browser. My web server runs as the user 'apache.' I'm able to run
the script successfully from the command line as root but when I run it in
the browser the shell script executes but fails. Is there a way to trace
what is happening when it is being run from the browser to figure out what
the problem is? Any suggestiosn? I've set the permissions of the script to
be executable for anyone.

Thanks,
Rod


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



[PHP] before function name

2003-08-14 Thread Rodney Green
In the code below what does the  (ampersand) at the beginning of the
function name do?

Code from ADODB library--

function ADONewConnection($db='')
 {
 GLOBAL $ADODB_Database;

  $rez = true;
  if ($db) {
   if ($ADODB_Database != $db) ADOLoadCode($db);
  } else {
   if (!empty($ADODB_Database)) {
ADOLoadCode($ADODB_Database);
   } else {
 $rez = false;
   }
  }


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



[PHP] delete line

2003-08-14 Thread Rodney Green
I've been looking and haven't found anything on this. How do you open a file
then select a line and delete that line?

Thanks,
Rod


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



[PHP] php.net is broke

2003-08-14 Thread Rodney Green
php.net is broke. There's an undefined function error. 




  CinchHost.com - Web Hosting Made Easier
 ASP, PHP, CGI, WEBMAIL, And More
 Packages as Low as $9.99 - No Set Up fees
http://www.cinchhost.com/


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



Re: [PHP] shell_exec

2003-08-08 Thread Rodney Green



 Shell side:
 - must be readable and executable by user (apache or perhaps everyone)
 - suid bit work only for programs, not scripts I think
 - shell can only execute cmds for which it's effective user has
 sufficient permissions

 Try this (as root on webserver), if you can login as apache.
 If you can't login as apache, log as a normal user (not root)
 # su - apache
 $ cd /path/to/script
 $ ./myscript.sh
 You will probably see errors here.


As Juan suggested I checked /var/log/messages. The shell script I'm trying
to run is a script that restarts our web content filter. In the script it
removes the pid file so it will be recreated when the application is started
again. The error I'm getting in the message log is dansguardian: Error
creating/opening pid file. Any ideas on what to do?

Thanks for your help,
Rod


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



Re: [PHP] Installer Software

2003-08-06 Thread Rodney Green

 I am making an application in PHP, but I want it to run on a user's
 local computer... but I need to find someway to bundle this so that when
 it is distributed, the installer installs PHP for windows... then copys
 the PHP files to the correct directory, then puts a short cut on the
 desktop... can anyone recommend anything out there.. preferably that is
 free

Check out the Nullsoft Install System. It's free..

http://www.nullsoft.com/free/nsis/



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



Re: [PHP] file upload script

2003-06-08 Thread Rodney Green
Thanks Philip. I'm now using the code below to upload. What I'm seeing is
that the file is uploaded and placed into the /tmp directory but is not
being moved to the /PIVOT directory. It just disappears after a few seconds
and can't be found in either directory. Any ideas why?

Thanks again,
Rod


- Original Message - 
From: Philip Olson [EMAIL PROTECTED]
To: Rodney Green [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, June 08, 2003 1:21 AM
Subject: Re: [PHP] file upload script



 By no errors, do you mean you have a PHP version greater
 than PHP 4.2.0 and checked the ['error'] code, and it
 has a value of 0?  Are you sure you want the filename
 to be $file_name?  I doubt you do.

 Regards,
 Philip

 ref: http://www.php.net/features.file-upload

 On Sat, 7 Jun 2003, Rodney Green wrote:

  Hello. I'm attempting to upload a file using the script below and I'm
not
  having any success. The temp directory I'm using does exist and is
  writeable. When I browse for the file then hit the send button it
appears to
  be working then displays the form again with no errors. I look for the
file
  on the server and it isn't there. Any advice on how to get this working?
 
  Thanks!
  Rod
 
 
  ---
 
  html
  head
  titleListing 9.14 A file upload script/title
  /head
  ?php
  $file_dir = /home/corrdev/htdocs/php24/scrap/uploads;
  $file_url = http://corros.colo.hosteurope.com/dev/php24/scrap/uploads;;
 
  foreach( $HTTP_POST_FILES as $file_name = $file_array ) {
   print path: .$file_array['tmp_name'].br\n;
   print name: .$file_array['name'].br\n;
   print type: .$file_array['type'].br\n;
   print size: .$file_array['size'].br\n;
 
   if ( is_uploaded_file( $file_array['tmp_name'] )
 $file_array['type'] == image/gif ) {
move_uploaded_file( $file_array['tmp_name'], $file_dir/$file_name)
 or die (Couldn't copy);
print img src=\$file_url/$file_name\p\n\n;
   }
  }
 
  ?
  body
  form enctype=multipart/form-data method=POST
  input type=hidden name=MAX_FILE_SIZE value=51200
  input type=file name=fuploadbr
  input type=submit value=Send file!
  /form
  /body
  /html
 
 
 
  -- 
  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] file upload script

2003-06-08 Thread Rodney Green
Sorry, here's the code:

form name=form1 method=post action= enctype=multipart/form-data
input type=file name=imagefile
br
input type=submit name=Submit value=Submit

?php
$filesdir = /PIVOT;

echo $_FILES['imagefile']['name'];
echo $_FILES['imagefile']['tmp_name'];

if(isset( $Submit )) {



if ($_FILES['imagefile']['type'] == image/gif) {

copy ($_FILES['imagefile']['tmp_name'],
$filesdir/.$_FILES['imagefile']['name'])
or die (Could not copy);


echo brbr;
echo Name: .$_FILES['imagefile']['name'].br;
echo Size: .$_FILES['imagefile']['size'].br;
echo Type: .$_FILES['imagefile']['type'].br;
echo Copy Done;
}


else
{
echo brbr;
echo Could Not Copy, Wrong Filetype
(.$_FILES['imagefile']['name'].)br;
}
}


?

/form


- Original Message - 
From: Philip Olson [EMAIL PROTECTED]
To: Rodney Green [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, June 08, 2003 1:21 AM
Subject: Re: [PHP] file upload script



 By no errors, do you mean you have a PHP version greater
 than PHP 4.2.0 and checked the ['error'] code, and it
 has a value of 0?  Are you sure you want the filename
 to be $file_name?  I doubt you do.

 Regards,
 Philip

 ref: http://www.php.net/features.file-upload

 On Sat, 7 Jun 2003, Rodney Green wrote:

  Hello. I'm attempting to upload a file using the script below and I'm
not
  having any success. The temp directory I'm using does exist and is
  writeable. When I browse for the file then hit the send button it
appears to
  be working then displays the form again with no errors. I look for the
file
  on the server and it isn't there. Any advice on how to get this working?
 
  Thanks!
  Rod
 
 
  ---
 
  html
  head
  titleListing 9.14 A file upload script/title
  /head
  ?php
  $file_dir = /home/corrdev/htdocs/php24/scrap/uploads;
  $file_url = http://corros.colo.hosteurope.com/dev/php24/scrap/uploads;;
 
  foreach( $HTTP_POST_FILES as $file_name = $file_array ) {
   print path: .$file_array['tmp_name'].br\n;
   print name: .$file_array['name'].br\n;
   print type: .$file_array['type'].br\n;
   print size: .$file_array['size'].br\n;
 
   if ( is_uploaded_file( $file_array['tmp_name'] )
 $file_array['type'] == image/gif ) {
move_uploaded_file( $file_array['tmp_name'], $file_dir/$file_name)
 or die (Couldn't copy);
print img src=\$file_url/$file_name\p\n\n;
   }
  }
 
  ?
  body
  form enctype=multipart/form-data method=POST
  input type=hidden name=MAX_FILE_SIZE value=51200
  input type=file name=fuploadbr
  input type=submit value=Send file!
  /form
  /body
  /html
 
 
 
  -- 
  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] file upload script

2003-06-07 Thread Rodney Green
Hello. I'm attempting to upload a file using the script below and I'm not
having any success. The temp directory I'm using does exist and is
writeable. When I browse for the file then hit the send button it appears to
be working then displays the form again with no errors. I look for the file
on the server and it isn't there. Any advice on how to get this working?

Thanks!
Rod


---

html
head
titleListing 9.14 A file upload script/title
/head
?php
$file_dir = /home/corrdev/htdocs/php24/scrap/uploads;
$file_url = http://corros.colo.hosteurope.com/dev/php24/scrap/uploads;;

foreach( $HTTP_POST_FILES as $file_name = $file_array ) {
 print path: .$file_array['tmp_name'].br\n;
 print name: .$file_array['name'].br\n;
 print type: .$file_array['type'].br\n;
 print size: .$file_array['size'].br\n;

 if ( is_uploaded_file( $file_array['tmp_name'] )
   $file_array['type'] == image/gif ) {
  move_uploaded_file( $file_array['tmp_name'], $file_dir/$file_name)
   or die (Couldn't copy);
  print img src=\$file_url/$file_name\p\n\n;
 }
}

?
body
form enctype=multipart/form-data method=POST
input type=hidden name=MAX_FILE_SIZE value=51200
input type=file name=fuploadbr
input type=submit value=Send file!
/form
/body
/html



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



[PHP] SSL

2003-03-22 Thread Rodney Green
Greetings!

Is there a PHP function that will allow a script to connect to a web server
using SSL?
I would need to post data from a script to a remote server securely. The
remote server has SSL enabled.

Thanks,
Rod


  CinchHost.com - Web Hosting Made Easier
 ASP, PHP, CGI, WEBMAIL, And More
 Packages as Low as $9.99 - No Set Up fees
http://www.cinchhost.com/



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



[PHP] Re: [php] Re: [PHP] SSL

2003-03-22 Thread Rodney Green

 You can use Curl to send post requests, take a look at
 http://www.php.net/curl

 If you have compiled PHP --with-openssl you can also access https
 locations with functions such as file_get_contents.

 If Curl is not an option and you have PHP compiled with streams and
 --with-openssl you can use streams to post data over SSL, take a look at
 Example 2 at http://us2.php.net/manual/en/ref.stream.php.


Hi Jason. Thanks for the reply and information. It'll give me a good start
to figuring out the best way to do this. I've put in a support request with
my hosting provider to ask if they have cURL installed. I'm hoping they do
as it will probably make it easier for me.

Thanks,
Rod


  CinchHost.com - Web Hosting Made Easier
 ASP, PHP, CGI, WEBMAIL, And More
 Packages as Low as $9.99 - No Set Up fees
http://www.cinchhost.com/



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



Re: [PHP] x12 837

2003-01-16 Thread Rodney Green
: Ok, I know this is a longshot but does anyone on this list work in
the
: healthcare industry and have created an 837 with php?  I am thinking
of
: attempting to create one in php and didn't want to reinvent the
wheel.

Just curious. What is an 837?




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




Re: [PHP] Pls Help: Moving script from Win to Linux

2002-12-10 Thread Rodney Green
Register_Globals is off by default in version 4.2.3. See the following
manual page for more information.

http://www.php.net/manual/en/language.variables.predefined.php




- Original Message -
From: Shane [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 10, 2002 11:08 AM
Subject: [PHP] Pls Help: Moving script from Win to Linux


Greetings gang.

You know me, I never ask for help if I haven't checked all my other
options, but this is day two, and I'm getting spanked on this one.

Some recently moved scripts from a WIN2K server running PHP 4.2.1 to
an Apache PHP 4.2.3 setup have stop accepting HTML Form Variables.

I can pass variables till I am blue in the face, even see them in the
URL but they are still showing up as (!isset)

My ISP (Whom is using Virtual Directories) has no solution, and I have
tried every code variation I could think of to troubleshoot it. This
code has been working fine for Months on the WIN2K box, but just
doesn't pass a var on the Linux solution.

Can any Server pros out there possibly throw me a bone? My deadline is
looming. :^)

As always, a million thanks in advance.
Yours truly.
-NorthBayShane

--
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] Pls Help: Moving script from Win to Linux

2002-12-10 Thread Rodney Green
Needs to be changed to the following if your forms are using the GET
HTTP method:

if(!isset($_GET[var])){
// do nothing
}else{
// VAR IS SET.. DO SOMETHING
}

If your forms use the POST HTTP method then it needs to be changed to:


if(!isset($_POST[var])){
// do nothing
}else{
// VAR IS SET.. DO SOMETHING
}



 I can pass variables till I am blue in the face, even
 see them in the URL but they are still showing up as (!isset)

Are you accessing these variables through $var or $_GET[var]?

I am accessing them as $var.

Example (from memory)

if(!isset($var)){
// do nothing
}else{
// VAR IS SET.. DO SOMETHING
}

Real basic stuff, but if I echo out the value so I see if it matches
what I see in the above URL I get...

(SAMPLE URL) blah/my_url.php?submit=submit

(SAMPLE CODE) ? echo Submit = .$submit ?

(SAMPLE RESULTS) Submit =

Thanks gang!

I have never needed to use $_GET[var]
What is the main difference?
Would this be a setting difference between a WIN setup of PHP and a
Linux setu of PHP?

- over

--
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] Re: Help please: Unable to get $_POST[variable]; to work in a form.

2002-12-10 Thread Rodney Green



the word METHOD is incorrectly spelled.







This is the exact code in the HTML file:

html
 head
  titlePHP Form Example/title
 /head
body
form action=action.php mehtod=POST
 Your name: input type=text name=name /
 Your age: input type=text name=age /
 input type=submit
/form
/body
/html

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




[PHP] Class Function Problem

2002-12-10 Thread Rodney Green
What is on line 251?

Warning: Variable passed to each() is not an array or object in
/home/www/website/admin/include/adminclass.php on line 251


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




Re: [PHP] Class Function Problem

2002-12-10 Thread Rodney Green
Where is the array $tools defined? The count() function returns the
number of elements in a variable (in this case an array).
It is seeing that there are 0 elements in the $tools array and
therefore your script is trying to divide 100 by 0 which
will spit out a warning every time. Should $tools be $toolsneeded
instead?





- Original Message -
From: Sean Mayhew [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 10, 2002 3:59 PM
Subject: Re: [PHP] Class Function Problem


: while(list($name,$url) = each($tools))
:
:
: From: Rodney Green [EMAIL PROTECTED]
: To: [EMAIL PROTECTED]
: CC: [EMAIL PROTECTED]
: Subject: [PHP] Class Function Problem
: Date: Tue, 10 Dec 2002 15:58:09 -0500
: 
: What is on line 251?
: 
:  Warning: Variable passed to each() is not an array or object in
:  /home/www/website/admin/include/adminclass.php on line 251
: 
: 
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, visit: http://www.php.net/unsub.php
:
:
: _
: MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
: http://join.msn.com/?page=features/virus
:
:


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




Re: [PHP] Need email solution

2002-11-26 Thread Rodney Green
You could try Mercury, which is free.

Mercury Information: http://www.pmail.com/overviews/ovw_mercwin.htm
Mercury Download: http://www.pmail.com/downloads_maine_t.htm
You'll want the Mercury Mail Transport System for Win32 and Netware
Systems v.3.32. Don't
worry, Netware is not required.

-Rod



- Original Message -
From: Manuel Ochoa [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Tuesday, November 26, 2002 3:38 PM
Subject: [PHP] Need email solution


:
: I'm setting up a Windows 2000 server with Apache, PHP and MySQL. I
also need to setup email service for 1 domain name.
:
: I'm looking for any suggestions on SMTP software.
:


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