[PHP] Sub Newbie Question On Error Message

2001-01-17 Thread Dave Stewart

Hi,

We have installed PHP pretty much to do one thing, which is to get
data from our head office website and place it on our club site.

We need to have a message saying something like "The Results are not
available until after the event".

I can supress the error messages by adding @ before the functions but
that's the best this dork can manage at this early stage in his PHP
Programming career :-)

I know this must use if and else or something and I'd appreciate
someone untangling my newbie brain.

This is the code we are using now.

http://www.ourheadoffice.co.nz/results/race01.html",
"r");
$rf = fread($file, 20);
$grab = eregi("(.*)", $rf, $printing);
fclose($file);
echo "";
echo $printing[1];
?>

Thanks in advance.

Dave Stewart


-- 
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] Sub Newbie Question On Error Message

2001-01-17 Thread Dave Stewart

Yep, that worked a treat thanks. All those danged those brackets are
what keep tripping me up.

The fog is lifting :-)

I'll now go back to lurking and see what else I can learn.

Regards,

Dave


- Original Message -
From: Toby Butzon <[EMAIL PROTECTED]>
To: Dave Stewart <[EMAIL PROTECTED]>; PHP (General)
<[EMAIL PROTECTED]>
Sent: Thursday, January 18, 2001 12:36 PM
Subject: Re: [PHP] Sub Newbie Question On Error Message


> Take a look at the changes I made to your original post; this
assumes that
> the file isn't there until results are posted - hope that's the case
;)
>
> --Toby
>
> >  if ($file =
fopen("http://www.ourheadoffice.co.nz/results/race01.html",
> "r")) {
> > $rf = fread($file, 20);
> > $grab = eregi("(.*)", $rf,
$printing);
> > fclose($file);
> > echo "";
> > echo $printing[1];
> } else {
> echo "Results will be available after the event.";
> }
> > ?>
>
>
>


-- 
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] Hyperlink using thumnail

2001-01-23 Thread Dave Stewart

Hi again,

How do I link this image file so that when users click on it they get
the bigger version (which is named 01.jpg).

" : "No Photo Yet\n";

echo "$photo";

?>

Here is the html version of what I am trying to do, as you can see the
'' is a variable.



Thanks again,

Dave



-- 
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] CGI and PHP

2001-01-25 Thread Dave Stewart

Hi,

I have this line in my shtml pages...



How do I write this as a function to include in my .php files.

(I've looked up virtual () in the manual but can't make head nor tail
of it).

Many thanks,

Dave Stewart


-- 
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] Page Cannot Be Displayed

2001-07-01 Thread Dave Stewart

Hi,

I have PHP 4 installed on Win98 with PWS 4.

I am getting 'Page cannot be displayed' on pages with .php extentions. If I
change the extensions to .php3 everything is fine.

I used the installer to set PHP up and I have checked my registry to ensure
that .php .php3 and .phtml pages are set and they are.

I've been trying to sus this out all morning and haven't cracked what I've
missed so I'm going for a walk to get some freash air.

Any help would be appreciated, as usual.

Dave


-- 
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] Page Cannot Be Displayed

2001-07-02 Thread Dave Stewart

Fixed it.

Seems I had to copy a file php4ts.dll to c:\windows\system.

Found the answer here;

http://www.faqts.com/knowledge_base/view.phtml/aid/5495/fid/336

Cheers,

Dave


- Original Message -
From: "Dave Stewart" <[EMAIL PROTECTED]>
To: "PHP (General)" <[EMAIL PROTECTED]>
Sent: Monday, July 02, 2001 1:15 PM
Subject: [PHP] Page Cannot Be Displayed


> Hi,
>
> I have PHP 4 installed on Win98 with PWS 4.
>
> I am getting 'Page cannot be displayed' on pages with .php extentions. If
I
> change the extensions to .php3 everything is fine.
>
> I used the installer to set PHP up and I have checked my registry to
ensure
> that .php .php3 and .phtml pages are set and they are.
>
> I've been trying to sus this out all morning and haven't cracked what I've
> missed so I'm going for a walk to get some freash air.
>
> Any help would be appreciated, as usual.
>
> Dave
>
>
> --
> 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] Apostrophe's

2001-07-10 Thread Dave Stewart

Hi,

I have a script that let's me update news on my site but recently whenever I
use ' apostrphe's or " speechmarks I end up with a slash i.e Jack's becomes
Jack\'s

>From reading here and in the archives it appears I have to edit the script
with the stripslashes function.

I was wondering if anyone could help me out with this as I haven't a clue
where to start editing the script.

Many thanks,

Dave


-- 
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] Slash Problems When Using PHP and POST.

2001-07-18 Thread Dave Stewart

I had this problem last week

You need to add the stripslashes function to the string that contains the
uploaded text.

print stripslashes($file) or print stripslashes($contents) I think should do
it.

Dave


- Original Message -
From: "Corin Rathbone" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 7:45 AM
Subject: [PHP] Slash Problems When Using PHP and POST.


> 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:
>  include "config.php";
>
> if(isset($save)){
> $fp = fopen("$file", "wb") or die("Could not open file!");
> $worked = fwrite($fp, $contents) or die("Could not write file!");
> fclose($fp) or die("Could not close file!");
> $edit=false;
> $save=true;
> }
> elseif(isset($file)){
> $fp = fopen("$file", "rb") or die("Could not open file!");
> $contents = fread($fp, filesize($file)) or die("Could not read
> file!");
> fclose($fp) or die("Could not close file!");
> $edit=true;
> $save=false;
> }
> else{
> $edit=false;
> $save=false;
> }
>
> ?>
> 
>
> 
> 
> Edit A File - File Explorer For 
> 
> 
> 
> 
> 
> 
> 
>
> Edit A File
>
>  if($edit){
> print( "Contents Of file: " );
> print( "$file" );
> print( "\n" );
> print( "\n" );
> print( " \n" );
> print( "   print( "$file" );
> 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 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]