[PHP] PHP Enabled Web Hosts

2001-04-18 Thread Corin Rathbone

Hi all,
I am a student and with little money, I am  trying to find a low-cost or
preferably free web host with PHP and if possible MySQL. Any suggestions
would be most helpful.

Regards,
Corin Rathbone
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Slash Problems When Using PHP and POST.

2001-07-18 Thread Corin Rathbone

I have created a php page that loads a file into a textarea. You can then
edit the file and click "Save" and it POSTS it to the same page (edit.php)
on the server. It saves it but it adds slashes before any speech marks ("").
Can somebody please help me with this.

It changes:

to:


Below is the code for the page edit.php:





Edit A File - File Explorer For 








Edit A File

" );
print( "$file" );
print( "\n" );
print( "\n" );
print( " \n" );
print( "\n" );
print( "" );
print( "  \n" );
print( "$contents" );
print( "  \n" );
print( "  \n" );
print( " \n" );
print( "" );
}
elseif($save){
print( "\n" );
print( "File: " );
print( "$file" );
if($worked){print( " has been saved!" );}
else {print( " has not been saved!" );}
print( "" );
}
else {
print( "Please Select A File To Be
Save!" );
}
?>



©mailto:[EMAIL PROTECTED]";>Corin
Rathbone 2001




Regards,
Corin Rathbone
www.corin.org.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Script Execution Time

2001-07-19 Thread Corin Rathbone

I have a php script that returns about 1.5Mb of data in text format to the
user. I am wondering if there is a way for php to display the time it took
to execute the script at the end of the file.

Regards,
Corin Rathbone


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Zipping Output Before Sending To Browser

2001-07-20 Thread Corin Rathbone

Hi,
I read a while ago somewhere that is possible in PHP to zip or gzip or just
compress the output of a PHP file before sending it to a browser. Apparently
the browser can then uncompress this and output the finished page. This
would be very useful as one of my scripts outputs about 1.5Mb of data. Does
anybody know how to do this? Any help most appreciated.

Regards,
Corin Rathbone
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP Uploads - Sorry!!!

2001-07-23 Thread Corin Rathbone

Sorry to again bring up the subject, but could somebody please help me with
file uploads. I have written the script below, but it doesn't work properly.
please help. Alternatively, could somebody give me a simple upload script.
My system is Win 98, Apache 1.3.17, php 4.0.5, IE5. The code is below.

Thanks,

Corin Rathbone

\n" );
print( "$current_file\n" );
  print( "$current_file_name\n" );
  print( "$current_file_size\n" );
  print( "$current_file_path\n" );

if(!$current_file=""){
  if(!file_exists($current_file_path)){
//copy("$current_file", "$current_file_path");
//unlink($current_file);
  $fp = fopen("$current_file_path", "wb") or die("Could not write
file!");
fwrite($fp, "$current_file") or die("Could not write file!");
  fclose($fp) or die("Could not close file pointer!");
$worked[] = 1;
  }
  else{
//die("File does not exists!");
  }
}
else{
  $worked[] = 0;
}
  }
}
elseif(!isset($uploads_go)){  
$cfg_upload_max_filesize = get_cfg_var("upload_max_filesize");
print( "\n" );
  print( "  \n" );
  print( "  \n" );
  print( "  Upload these files:\n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  \n" );
  print( "" );
}
elseif(isset($worked)){
  for($x=0; $x<9; $x++){
if($worked[$x]){
  print( "The file upload for file $path_to_file[$x] was successful\n" );
}
else{
  print( "The file upload for file $path_to_file[$x] was not 
successful\n" );
}
  }
}
else{
  print( "Please select files to be uploaded" );
}

?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP Uploads - Please Help!!

2001-07-24 Thread Corin Rathbone

Sorry to again bring up the subject, but could somebody please help me with
multiple
file uploads. I've written the script below, but it doesn't seem to work
properly.
please help. Alternatively, could somebody give me a simple upload script.
My system is Win 98, Apache 1.3.17, php 4.0.5, IE5. The code is below.

Thanks,
Corin Rathbone

\n" );
print( "$current_file\n" );
  print( "$current_file_name\n" );
  print( "$current_file_size\n" );
  print( "$current_file_path\n" );

if(!$current_file=""){
  if(!file_exists($current_file_path)){
//copy("$current_file", "$current_file_path");
//unlink($current_file);
  $fp = fopen("$current_file_path", "wb") or die("Could not write
file!");
fwrite($fp, "$current_file") or die("Could not write file!");
  fclose($fp) or die("Could not close file pointer!");
$worked[] = 1;
  }
  else{
//die("File does not exists!");
  }
}
else{
  $worked[] = 0;
}
  }
}
elseif(!isset($uploads_go)){  
$cfg_upload_max_filesize = get_cfg_var("upload_max_filesize");
print( "\n" );
  print( "  \n" );
  print( "  \n" );
  print( "  Upload these files:\n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  File: Path: \n" );
  print( "  \n" );
  print( "" );
}
elseif(isset($worked)){
  for($x=0; $x<9; $x++){
if($worked[$x]){
  print( "The file upload for file $path_to_file[$x] was successful\n" );
}
else{
  print( "The file upload for file $path_to_file[$x] was not 
successful\n" );
}
  }
}
else{
  print( "Please select files to be uploaded" );
}

?>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] rename a directory

2001-07-24 Thread Corin Rathbone

Yes, rename() does work on Windows as well as on *nix.

-Original Message-
From: Tom Carter [mailto:[EMAIL PROTECTED]]
Sent: 24 July 2001 17:54
To: [EMAIL PROTECTED]; Jeff
Subject: Re: [PHP] rename a directory


on unix I think it should work for both.. can't say I know on windows..

also, why not try exec or system and just run the normal system command for
it?
- Original Message -
From: "Jeff" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 24, 2001 6:07 PM
Subject: [PHP] rename a directory


> Does anyone know how to rename a directory? There is rename() for files
> but I couldn't find anything for directories...
>
> Thanks,
>
> Jeff
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Apache/phpinfo

2001-07-24 Thread Corin Rathbone

Run phpinfo() and if it is in CGI mode "Server API", at the top, will say
"CGI" or if in is mod_php "Server API" will say "Apache".

Corin Rathbone

-Original Message-
From: Tom Malone [mailto:[EMAIL PROTECTED]]
Sent: 24 July 2001 20:15
To: PHP Users
Subject: [PHP] Apache/phpinfo


How can you tell if your host has PHP installed as mod_php or in CGI mode on
the webserver (Apache in my case)? Is it in phpinfo.php? If so, where - I
couldn't find it...

Thanks
Tom Malone


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Potential bug?

2001-08-04 Thread Corin Rathbone

I have the same problem running Win98, Apache 1.3.17 and PHP 4.0.6 as an
Apache Module. It doesn't return the source, but it's strange...


-Original Message-
From: Anthony Lieuallen [mailto:[EMAIL PROTECTED]]
Sent: 22 July 2001 16:30
To: [EMAIL PROTECTED]
Subject: [PHP] Potential bug?


I've just discovered a weird quirk in PHP.  I'd first like to check if it is
a known bug/weird feature/something else already known.  I've not yet tested
it much, except I see it doesn't happen on every script, but either of the
two results are quite strange to me.

Suituation: file myscript.php exists, directory myscript/ does not.  If I
browse to http://myhost/myscript.php all is well.  But
http://myhost/myscript/ does return something, where I expect a '404 not
found'.  Sometimes it just returns myscript.php.  BUT sometimes it returns
the PHP source (minus PHP comments).  Aslo,
http://myhost/myscript/anything/anything/bla.bla.bla returns the same.

I was running PHP 4.0.4pl1 on RedHat Linux 6.2, kernel 2.4.6.  I upgraded to
PHP 4.0.6 and still see this behavior.

P.S. For the curious I discovered this because a personal site I have uses
directory/admin.php for site admin, while another site I am developing at
work uses directory/admin/ and I typed the wrong one at home :)





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Seg fault when returning True from shutdown function.

2001-08-06 Thread Corin Rathbone

On Win98, Apache 1.3.17, PHP4.0.6 As Apache Module, running the code below I
get "APACHE caused an invalid page fault in module MSVCRT.DLL at
015f:7800fd73"

-Original Message-
From: William Bailey [mailto:[EMAIL PROTECTED]]
Sent: 06 August 2001 12:15
To: PHP General List
Subject: [PHP] Seg fault when returning True from shutdown function.


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
I am just playing with the the register_shutdown_function()
function and have found a way to cause php to seg fault. Can somebody else
please test the code below this to see if they have the same problem.

Code (8 Lines):

#!/usr/local/bin/php -q


Thanks,
William.


-BEGIN PGP SIGNATURE-
Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv

iQA/AwUBO258MK39EoU2VrU1EQLsuACgwA0egpooR3AeRBbZMwp0rqKyCIkAn00U
CDtlVoWinKYPAJgq+JjbEyh1
=FupR
-END PGP SIGNATURE-



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Image header problems

2001-08-09 Thread Corin Rathbone

Remove the line:

print "jpeg format";

The error is because you have sent output to the browser before you are
trying to send a header.


-Original Message-
From: Hugh Danaher [mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 23:26
To: Php-General
Subject: [PHP] Image header problems


I want to generate an image using the following code, and think it should
have worked.  Unfortunately I get an error message saying the header info
has already been sent, and the browser (IE5) doesn't print a picture just
the
characterset representing the picture.  I think I've got it right, but
obviously, I don't.  Any help will be greatly appreciated.



  1.
  2.
  3.";
  5.header("content-type: image/jpeg",replace);
  6.$image=imagecreate(200,200);
  7.$red=imagecolorallocate($image,255,0,0);
  8.$blue=imagecolorallocate($image,0,0,255);
  9.imagearc($image,99,99,180,180,0,360,$blue);
10.imagefill($image,99,99,$blue);
11.imagejpeg($image);

?>









what I get is the following:

Warning: Cannot add header information - headers already sent by (output
started at /www/ironorchid/stocks/test.php:3) in
/www/ironorchid/stocks/test.php on line 5
ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), ...

A printout of the jpeg file (I think) and a broken link icon.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]