[PHP] inspirational

2002-05-25 Thread jtjohnston

I want to detect the url my .php lies in.

This is over kill and BS:

$myurlvar = "http://".$SERVER_NAME.parse($SCRIPT_NAME);

How do I get "http://foo.com/dir1/dir2/dir3/";.

There seems to be nothing in phpinfo() that will give me a full url to
play with.

Flame me if you will, but I browsed TFM and found nothing inspirational.

Looked at phpinfo() too and got discouraged.

I need a full url.

John



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




RE: [PHP] bulletin board question...

2002-05-25 Thread SP

You can make up your own tags by just adding more
things to be parsed.

EXAMPLE:

$text = "Look at [b]this[/b] website ...";
echo $text;
custom_tags($text);
echo $text;

function custom_tags($text)
{
/* converts special tags into the html counterpart
 * [b]text[/b] - bold text
 * [i]text[/i] - italicise text
 * [EMAIL PROTECTED] - automatically converts to
mailto: link
 * [link=http://www.yahoo.com]text[/link]
 *
 * [list]
 *  [*] text
 *  [*] text
 * [/list]
 *
 * [color=value]text to colour[/color] - colourize
some text
 * [colour=value]text to colour[/colour] -
colourize some text
 * [font=value]text[/font] - value is a class
defined in css file*/

$text = htmlentities($text);
$text =
eregi_replace("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z](
[-.]?[0-9a-z])*\\.[a-z]{2,3}", "mailto:\\0\";>\\0",$text);
$text =
preg_replace("/\[link=(\S+?)\](.*?)\[\/link\]/is",
"\\2",$text);
$text = preg_replace("/\[i\](.*?)\[\/i\]/is",
"\\1",$text);
$text = preg_replace("/\[b\](.*?)\[\/b\]/is",
"\\1",$text);
$text =
preg_replace("/\[list\](\n)?/i","",$text);
$text =
preg_replace("/\[\/list\](\n)?/i","",$text);
$text = preg_replace("/\[\*\](.*?)$/ism",
"\\1",$text);
$text =
preg_replace("/\[color=(.*?)\](.*?)\[\/color\]/is"
, "\\2",$text);
$text =
preg_replace("/\[colour=(.*?)\](.*?)\[\/colour\]/i
s", "\\2",$text);
$text =
preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/is",
"\\2",$text);
return nl2br($text);
}


-Original Message-
From: Anthony Ritter
[mailto:[EMAIL PROTECTED]]
Sent: May 25, 2002 8:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] bulletin board question...


To all,
On a bulletin board (non-usenet) within a website,
is it possible to change
the color or size of the type - or add a link from
a word that the user has
posted?

For example, John Doe posts:

"Man, it's hot out here today!"

Where John changes the default font color - which
is black - of the word
"hot" - *to red* - and then links "today" with a
URL to another site like
weather.com

If so, how would this be accomplished?
Any thoughts?

Thank you.
Tony Ritter





--
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] bulletin board question...

2002-05-25 Thread John Holmes

Any number of ways you can do it. You can have the user enter in valid
HTML and just display it as such. Or you can use a markup language like
most BB. 

Something like [b] for bold, [color=red] text [/color] to change colors,
etc.

PHP then looks through the post and replaces those tags with the HTML
equivalent. 

---John Holmes...

> -Original Message-
> From: Anthony Ritter [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 8:39 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] bulletin board question...
> 
> To all,
> On a bulletin board (non-usenet) within a website, is it possible to
> change
> the color or size of the type - or add a link from a word that the
user
> has
> posted?
> 
> For example, John Doe posts:
> 
> "Man, it's hot out here today!"
> 
> Where John changes the default font color - which is black - of the
word
> "hot" - *to red* - and then links "today" with a URL to another site
like
> weather.com
> 
> If so, how would this be accomplished?
> Any thoughts?
> 
> Thank you.
> Tony Ritter
> 
> 
> 
> 
> 
> --
> 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 (Newbie question)

2002-05-25 Thread John Holmes

Also note that if you want PHP in your included()'d file, you have to
put  around the PHP. When you include() a file, PHP starts off
reading it in HTML mode. 

Include() just takes the included file and sticks it into the original
file. The variable scope in an included file is the same as the spot
where the include() was called.

You really only want to call  once in your script. So if it's in
an include()'d file, that's fine. If you calling an included()'d file
from the middle of your script, the include()'d file doesn't have to
have , etc...just valid code.

Take this example. You can use an include file to format a row for a
table.

##include.php##
$data

##main.php##




That'll make 100 table rows for you. 

Include files are good for function declarations and separating pieces
of your HTML apart to easily manage it. 

---John Holmes...

> -Original Message-
> From: Kevin Stone [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 8:54 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Include (Newbie question)
> 
> No, not exactly.  The idea behind the include() function in PHP is to
> append
> and execute code to the currently running script.  This is great for
> organizing your code into more easier to manage chunks.  PHP will
attempt
> to
> parse and execute the included file as a PHP file regardless of the
file
> extension.  So you can do this for example...
> 
> -- myhtml.html --
> Hello 
> --
> 
> -- myphp.php --
> $var = "World";
> 
> -
> 
> This will print out "Hello World".  So that answers two questions with
one
> stone (err.. yah).  include() is a function not a method.  And you
don't
> need the  tag to display included html.  The browser will
> automatically assume an html header upon any textual output unless
> otherwise
> specified.
> 
> Check out the manual for more information.
> http://www.php.net/manual/en/function.include.php
> 
> Hope this helps
> -Kevin
> 
> - Original Message -
> From: "r" < >
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, May 26, 2002 5:11 AM
> Subject: [PHP] Include (Newbie question)
> 
> 
> > Hey,
> > I have just being going through the manual (windows version) and am
a
> bit
> > confused about "include",
> > If I want the scope to affect the whole page I do this right:
> >
> > (example page)
> > 
> > 
> >  > include blah.php
> > ?>
> > some html
> >  > use some functions to call blah.php
> > ?>
> > is this correct?
> >
> > and my second question is if I am including a html file will that
file
> need
> > to have a  etc etc
> > or you must have the etc only in one file?
> >
> > Since am confused about this and it comes straight from the RTFM()
> > function.any help appreciated. :-)
> >
> > Cheers,
> > -Ryan.
> >
> >
> >
> >
> > --
> > 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] Include (Newbie question)

2002-05-25 Thread Kevin Stone

No, not exactly.  The idea behind the include() function in PHP is to append
and execute code to the currently running script.  This is great for
organizing your code into more easier to manage chunks.  PHP will attempt to
parse and execute the included file as a PHP file regardless of the file
extension.  So you can do this for example...

-- myhtml.html --
Hello 
--

-- myphp.php --
$var = "World";

-

This will print out "Hello World".  So that answers two questions with one
stone (err.. yah).  include() is a function not a method.  And you don't
need the  tag to display included html.  The browser will
automatically assume an html header upon any textual output unless otherwise
specified.

Check out the manual for more information.
http://www.php.net/manual/en/function.include.php

Hope this helps
-Kevin

- Original Message -
From: "r" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 26, 2002 5:11 AM
Subject: [PHP] Include (Newbie question)


> Hey,
> I have just being going through the manual (windows version) and am a bit
> confused about "include",
> If I want the scope to affect the whole page I do this right:
>
> (example page)
> 
> 
>  include blah.php
> ?>
> some html
>  use some functions to call blah.php
> ?>
> is this correct?
>
> and my second question is if I am including a html file will that file
need
> to have a  etc etc
> or you must have the etc only in one file?
>
> Since am confused about this and it comes straight from the RTFM()
> function.any help appreciated. :-)
>
> Cheers,
> -Ryan.
>
>
>
>
> --
> 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] UPLOADING IMAGE

2002-05-25 Thread Liam MacKenzie

http://www.zend.com/zend/spotlight/uploading.php

Who's server are you trying this on mate?  Yours or mine?



- Original Message -
From: "Dani" <[EMAIL PROTECTED]>
To: "1LT John W. Holmes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, May 26, 2002 10:38 AM
Subject: Re: [PHP] UPLOADING IMAGE


> Thanks for replying
>
> Sorry about not providing the info 
>
> well... when I hit submit button, it goes to the 'uploadfile.php' page,
but it
> doesn't print anything at all. I check in my folder and the file is not
copied
> either.
>
> thanks,
> Dani
>
> "1LT John W. Holmes" wrote:
>
> > HOW IS IT NOT WORKING? Are you getting an error? Is your hard drive
being
> > erased? Do you get little electrical shocks from the wires tied into
your
> > braces when you hit enter and upload a file over 10k that has blue and
> > yellow within it but not part of the border
> >
> > Info, man...provide it.
> >
> > ---John Holmes...
> >
> > - Original Message -
> > From: "Dani" <[EMAIL PROTECTED]>
> > To: "1LT John W. Holmes" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Saturday, May 25, 2002 8:24 PM
> > Subject: Re: [PHP] UPLOADING IMAGE
> >
> > > I have tried to use the filename but it's still not working.
> > >
> > > here is the whole code I've got:
> > >
> > > ** First file called 'upload.php'
> > > 
> > > 
> > > Untitled Document
> > > 
> > > 
> > >
> > > 
> > >  > > action="uploadfile.php">
> > >  
> > >   
> > >File
> > >
> > > 
> > >
> > >   
> > >   
> > >
> > > 
> > >
> > > 
> > >   
> > >  
> > > 
> > > 
> > > 
> > >
> > > **second file called 'uploadfile.php'
> > >  > > if($file)
> > >  {
> > >  echo "file name :",$file_name,"\n";
> > >  copy($file,"D:/graphic_practise/$file_name");
> > >
> > >  print("file uploaded");
> > >  }
> > > ?>
> > >
> > > thanks
> > >
>
>
> --
> 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] Include (Newbie question)

2002-05-25 Thread r

Hey,
I have just being going through the manual (windows version) and am a bit
confused about "include",
If I want the scope to affect the whole page I do this right:

(example page)



some html

is this correct?

and my second question is if I am including a html file will that file need
to have a  etc etc
or you must have the etc only in one file?

Since am confused about this and it comes straight from the RTFM()
function.any help appreciated. :-)

Cheers,
-Ryan.




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




[PHP] Extract ZIP archives

2002-05-25 Thread Kevin Stone

Hello Nurse!  (and php gurus)..

I'm building an online file exchange that will allow users to share custom 3D files 
for a game that I'm involved in.  I'd like to offer my users the oportunity to upload 
multiple files at once by allowing them to ZIP them all together and upload just the 
one file.  Then I'd expand the ZIP archive, extract the files, and store them 
individually on the server based on certain properties (which I already look for to 
validate the files being uploaded individually).

 I did my homework, found plenty of references and example code, a few classes.  Still 
a bit stumped though.  The PHP docs refer to ZZIPLIB as the solution.  Unfortunately 
webhost does not have ZZIPLIB installed.  And of course I don't have access to the PHP 
config files... just my standard web account.  Is ZZIPLIB something that I can use by 
including it into my script?  Or does it need to be compiled into PHP?  If so then is 
there another way that I can expand, extract and create ZIP files on the server?

I found one ZIP class on ZEND.com.  http://www.zend.com/codex.php?id=696&single=1  It 
looks like it should work but since it won't expand ZIP archives it's only half useful 
to me.

Finally a friend of mine briefly eluded to the 'zip' and 'unzip' operations of UNIX.  
Problem is I don't know anything about Unix commands and searching for 
guides/tutorials revealed plenty of generic, but little useful information.  Is this a 
possibility?  If so what would the unix command be to expand and create ZIP archives?  
How would I tie that into my PHP script using the system() function?

Well.. hopefully you get the gist of what I'm trying to do.  Other than my basic 
knowlege in PHP I'm starting from scratch here, so just about anything you can tell me 
will be useful.

Much Thanks,
Kevin Stone
[EMAIL PROTECTED]
or [EMAIL PROTECTED]




Re: [PHP] bulletin board question...

2002-05-25 Thread Richard Baskett

Well with phpBB2 you can use html if the administrator allows it, if not you
can use phpBB tags.  Things like:

Man, it's [color=red]hot[/color] out here
[url=http://www.weather.com]today[/url]!

All boards are different though so you'll need to read your documentation on
that board to figure out how to do it.. If it supports stuff like that :)

Cheers!

Rick

"Some people come into our lives and quickly go, others stay for awhile,
leaving foot-prints on our hearts and we are never quite the same" - Unknown

> From: "Anthony Ritter" <[EMAIL PROTECTED]>
> Date: Sat, 25 May 2002 19:39:10 -0500
> To: [EMAIL PROTECTED]
> Subject: [PHP] bulletin board question...
> 
> To all,
> On a bulletin board (non-usenet) within a website, is it possible to change
> the color or size of the type - or add a link from a word that the user has
> posted?
> 
> For example, John Doe posts:
> 
> "Man, it's hot out here today!"
> 
> Where John changes the default font color - which is black - of the word
> "hot" - *to red* - and then links "today" with a URL to another site like
> weather.com
> 
> If so, how would this be accomplished?
> Any thoughts?
> 
> Thank you.
> Tony Ritter
> 
> 
> 
> 
> 
> -- 
> 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] Function Switch($pid) - NEED HELP

2002-05-25 Thread David Freeman


 > I have a script that switches.
 > switch($pid)
 > {
 > case 1:
 > break;
 > 
 > case 2:
 > break;
 > }
 > 
 > Now I'm doing a check in case 1 and if everything goes well, 
 > i want to switch directly to case 2 while the script is runny.
 > 
 > How would i do that ???

In the specific case above you could do something like this in your case
1 - 

  case 1:
  if (some test)
  {
 test sucessful - on to case 2
  } else {
 break;
  }

That will fall through from case 1 to case 2 depending on the success of
a check.

CYA, Dave



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




[PHP] bulletin board question...

2002-05-25 Thread Anthony Ritter

To all,
On a bulletin board (non-usenet) within a website, is it possible to change
the color or size of the type - or add a link from a word that the user has
posted?

For example, John Doe posts:

"Man, it's hot out here today!"

Where John changes the default font color - which is black - of the word
"hot" - *to red* - and then links "today" with a URL to another site like
weather.com

If so, how would this be accomplished?
Any thoughts?

Thank you.
Tony Ritter





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




[PHP] Incompatibility with file-input items

2002-05-25 Thread Felix Natter

hi,

in a php-script someone else wrote I found
'':

echo "\n";
echo "  \n";
echo "  \n";
echo "\n";
echo "\n";
echo "  \n";
echo "  \n";
echo "\n";
echo "\n";
echo "  \n";
echo "  \n";
echo "\n";
echo "\n";
echo "  \n";
echo "  \n";
echo "\n";

and this is the code which is run by the form's action-attribute
(same script as above):

for( $i = 0; $i < count( $photo ); $i++ )
{
  if( $photo[ $i ] != "" && $photo[ $i ] != "none" )
  {
if( $photo_size[ $i ] > 50 ) error( "Ungültige Fotogröße" );
if($photo_type[ $i ] == "image/pjpeg" || $photo_type[ $i ] == "image/jpeg")
  $newphoto[] = $photo[ $i ];
else
  error( "Ungültiger Dateityp, bitte wählen Sie JPEG " );
  }
}

(you can find the complete file here:
 http://home.t-online.de/~fam.natter/list.php)

Now the problem is that the above code only works with php 4.0.6 and
not with php 4.0.0: php 4.0.0 puts the type and name and
temporary-file information in the $image array while 4.0.6 puts it in
$image_type and $image (both use $image_size). See the example output
below for more information.

Here is a small test-case:
 test_files.html ===

Test









 test_files.php 
Missing Parameter in test_file.php!";
exit;   
}
if (isset ($image_type))
echo "image_type is set !";
if (isset ($image_size))
echo "image_size is set !";
for ($i = 0; $i < count ($image); $i++)
{
echo "image[$i]='" . $image[$i] . "'\n";
}

?>


Here is the output with two different versions of php when I select
two jpeg images (northbeach.jpg and Water01.jpg):

This is the output with php 4.0.6:
image_type is set !
image_size is set !
image[0]='/tmp/phpvRpXFA' image[1]='/tmp/phpfvgzMk'

This is the output with php 4.0.0:
image_size is set !
image[0]='northbeach.jpg' image[1]='image/jpeg' image[2]='/tmp/phpZApBAO' 
image[3]='Water01.jpg' image[4]='image/jpeg' image[5]='/tmp/phpC3YeVs'


So how can I use this input-file array (image[] in the example)
portably ?


BTW: how can I get access to /tmp/phpZApBAO (I need to create
thumbnails from the images) ? On some servers this seems to create
permission-problems (but I cannot change the configuration of the
server).

-- 
Felix Natter

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




Re: [PHP] NewBie-UPLOADING IMAGE

2002-05-25 Thread Neil Highley

MWAHAHAHAHAH!

[EMAIL PROTECTED]
---
"Life must be lived as play."
- Plato (427 - 347 BC)
- Original Message - 
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: "Dani" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 9:20 PM
Subject: Re: [PHP] NewBie-UPLOADING IMAGE


> Try the RTFM() function. It will do exactly what you want.
> 
> http://www.php.net/manual/en/features.file-upload.php
> 
> ---John Homes...
> 
> - Original Message - 
> From: "Dani" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, May 25, 2002 6:57 PM
> Subject: [PHP] NewBie-UPLOADING IMAGE
> 
> 
> > Hi,
> > 
> > I want to upload image file into a folder in webserver using HTML form.
> > What function do I use fo this purpose?
> > 
> > Thank you,
> > 
> > Dani
> > 
> > 
> > -- 
> > 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] UPLOADING IMAGE

2002-05-25 Thread Dani

Thanks for replying

Sorry about not providing the info 

well... when I hit submit button, it goes to the 'uploadfile.php' page, but it
doesn't print anything at all. I check in my folder and the file is not copied
either.

thanks,
Dani

"1LT John W. Holmes" wrote:

> HOW IS IT NOT WORKING? Are you getting an error? Is your hard drive being
> erased? Do you get little electrical shocks from the wires tied into your
> braces when you hit enter and upload a file over 10k that has blue and
> yellow within it but not part of the border
>
> Info, man...provide it.
>
> ---John Holmes...
>
> - Original Message -
> From: "Dani" <[EMAIL PROTECTED]>
> To: "1LT John W. Holmes" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Saturday, May 25, 2002 8:24 PM
> Subject: Re: [PHP] UPLOADING IMAGE
>
> > I have tried to use the filename but it's still not working.
> >
> > here is the whole code I've got:
> >
> > ** First file called 'upload.php'
> > 
> > 
> > Untitled Document
> > 
> > 
> >
> > 
> >  > action="uploadfile.php">
> >  
> >   
> >File
> >
> > 
> >
> >   
> >   
> >
> > 
> >
> > 
> >   
> >  
> > 
> > 
> > 
> >
> > **second file called 'uploadfile.php'
> >  > if($file)
> >  {
> >  echo "file name :",$file_name,"\n";
> >  copy($file,"D:/graphic_practise/$file_name");
> >
> >  print("file uploaded");
> >  }
> > ?>
> >
> > thanks
> >


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




Re: [PHP] UPLOADING IMAGE

2002-05-25 Thread 1LT John W. Holmes

HOW IS IT NOT WORKING? Are you getting an error? Is your hard drive being
erased? Do you get little electrical shocks from the wires tied into your
braces when you hit enter and upload a file over 10k that has blue and
yellow within it but not part of the border

Info, man...provide it.

---John Holmes...

- Original Message -
From: "Dani" <[EMAIL PROTECTED]>
To: "1LT John W. Holmes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 8:24 PM
Subject: Re: [PHP] UPLOADING IMAGE


> I have tried to use the filename but it's still not working.
>
> here is the whole code I've got:
>
> ** First file called 'upload.php'
> 
> 
> Untitled Document
> 
> 
>
> 
>  action="uploadfile.php">
>  
>   
>File
>
> 
>
>   
>   
>
> 
>
> 
>   
>  
> 
> 
> 
>
> **second file called 'uploadfile.php'
>  if($file)
>  {
>  echo "file name :",$file_name,"\n";
>  copy($file,"D:/graphic_practise/$file_name");
>
>  print("file uploaded");
>  }
> ?>
>
> thanks
>


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




Re: [PHP] UPLOADING IMAGE

2002-05-25 Thread Dani

I have tried to use the filename but it's still not working.

here is the whole code I've got:

** First file called 'upload.php'


Untitled Document





 
  
   File
   

   
  
  
   

   
    
  
 




**second file called 'uploadfile.php'
\n";
 copy($file,"D:/graphic_practise/$file_name");

 print("file uploaded");
 }
?>

thanks


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




Re: [PHP] UPLOADING IMAGE

2002-05-25 Thread 1LT John W. Holmes

Give a destination file name, not just the directory. You don't have to
unlink($file), it's done automatically when the script ends.

---John Holmes...

- Original Message -
From: "Dani" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 7:58 PM
Subject: [PHP] UPLOADING IMAGE


> What's wrong with my code?
>
>  if($file)
>  {
>  print("file name :$file_name\n");
>   if (copy($file,"http://sarjito/img/";))
>{
>print("file uploaded");
>}
>  unlink($file);
>  }
> ?>
>
> Any advise is welcome.
>
> Thanks,
> Dani
>
>
> --
> 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] UPLOADING IMAGE

2002-05-25 Thread Dani

What's wrong with my code?

\n");
  if (copy($file,"http://sarjito/img/";))
   {
   print("file uploaded");
   }
 unlink($file);
 }
?>

Any advise is welcome.

Thanks,
Dani


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




Re: [PHP] NewBie-UPLOADING IMAGE

2002-05-25 Thread Kevin Stone

This is a rather broad question you're asking.  I would suggest starting at
the online documentation on www.php.net.  Handeling file uploads:
http://www.php.net/manual/en/features.file-upload.php

Post back here if you have any trouble understanding any of this stuff.

-Kevin

- Original Message -
From: "Dani" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 4:57 PM
Subject: [PHP] NewBie-UPLOADING IMAGE


> Hi,
>
> I want to upload image file into a folder in webserver using HTML form.
> What function do I use fo this purpose?
>
> Thank you,
>
> Dani
>
>
> --
> 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] unexpected T_IF

2002-05-25 Thread Steve Buehler

put a ; at the end of line 31 and see if it still gives you the error.

Steve

At 10:33 AM 5/25/2002 +0100, you wrote:
>Hmm, can anyone explain why I'm getting this error?
>
>Parse error: parse error, unexpected T_IF in 
>/usr/local/htdocs/san.loc/upload-img.php on line 34
>
>Code reads:
>
>11:#--if form submitted then process file upload
>12:if($HTTP_POST_VARS['ttl']) {
>13:
>14: #--check if there is already a picture called this
>15: include $DOCUMENT_ROOT . 'incs/db.php';
>16: @mysql_select_db("infoNav") or die("unable to connect to table");
>17: $qry = "SELECT ttl FROM imgLst WHERE site = 
>$HTTP_SESSION_VARS[site_no] AND ttl = '$HTTP_POST_VARS[ttl]';";
>18: $imgTst = MYSQL_QUERY($qry);
>19:
>20: if(mysql_numrows($imgTst) < 1) {
>21:
>22:  #-- check file type
>23:  $ulf = $HTTP_POST_FILES['uplfile']['type'];
>24:  if($ulf == 'image/pjpeg' || $ulf == 'image/gif') {
>25:
>26:   #-- get ext
>27:   ($ulf == 'image/pjpeg') ? $ext = '.jpg' : $ext = '.gif';
>28:
>29:   #-- create unique filename
>30:   $flNme = '\/imgs\/user-imgs\/' . time() . $REMOTE_HOST . $ext;
>31:   $FulflNme = $DOCUMENT_ROOT . $flNme
>32:
>33:   #-- check file is realy uploaded for security then copy to store folder
>34:   if (is_uploaded_file($HTTP_POST_FILES['uplfile'])) {
>
>Thanks
>
>Zac
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.



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




Re: [PHP] NewBie-UPLOADING IMAGE

2002-05-25 Thread 1LT John W. Holmes

Try the RTFM() function. It will do exactly what you want.

http://www.php.net/manual/en/features.file-upload.php

---John Homes...

- Original Message - 
From: "Dani" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 6:57 PM
Subject: [PHP] NewBie-UPLOADING IMAGE


> Hi,
> 
> I want to upload image file into a folder in webserver using HTML form.
> What function do I use fo this purpose?
> 
> Thank you,
> 
> Dani
> 
> 
> -- 
> 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] 4.2.1 Vars

2002-05-25 Thread 1LT John W. Holmes

Sure. The idea you have to understand is that nothing from the user can be
trusted. When you are expecting a number and they enter a letter, it may
mess things up and you have to be prepared for that.

With register_globals OFF in  your php.ini file, all of the user input is
present in the _GET, _POST, _REQUEST, or _COOKIE array. With
register_globals ON, then the variables are registered as regular variables.
If you have a URL like page.php?id=1, then with them OFF, you have to use
$_GET["id"] to get the value of one, with them ON, you can just use $id.
Neither one is better than the other b/c the user can still just alter the
URL and send a different value. The same is true for cookie and post data,
the user can easily alter that and send whatever kind of data they want. You
have to make sure it's what you think it will be.

One example is say you do a database call to check a username and password.
If they are good, you set an $Authorized variable to 'YES'. Further in the
page,  you do if($Authorized == 'YES') { show_good_stuff(); }. Now, with
register_globals ON, the user can easily type in a url like
page.php?Authorized=YES and they are in whether the query passes or not.
With register_globals OFF, the user cannot create a $Authorized variable. If
they try to pass it in the URL, it'll become $_GET["Authorized"], not
$Authorized. Now, this doesn't mean that ON or OFF is better than the other,
it's how you program. You can easily leave register_globals ON and just make
sure you set a value for $Authorized in your script (don't assume it's
value), like before you ever check the username and password, say
$Authorized = FALSE; That way even if the user tries to alter the URL, you
just set it to false regardless, and you're script will be fine.

Hopefully that is clear. If you have any questions let me know. There are
plenty of articles written about this, do a search on google for some or
search the archives. The thing to remember is not to trust any user input
and make sure you know where your variables are coming from.

---John Holmes...

- Original Message -
From: "Kurth Bemis (List Monkey)" <[EMAIL PROTECTED]>
To: "1LT John W. Holmes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 4:07 PM
Subject: Re: [PHP] 4.2.1 Vars


> At 04:00 PM 5/25/2002 -0400, 1LT John W. Holmes wrote:
>
> Actually - i don't understand what the docs at PHP are talking about.
care
> to enlighten me?
>
> ~kurth
>
> >Do you know what the security problems are? Do you realise that having
> >register_globals on or off isn't the security problem, it's how you write
> >your code? If you're not going to change any of your code, just turn on
> >register_globals. Changing your code to _POST or _GET and doing nothing
else
> >isn't making it any more secure that using it the way it is with
> >register_globals on.
> >
> >---John Holmes...
> >
> >- Original Message -
> >From: "Kurth Bemis (List Monkey)" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Saturday, May 25, 2002 3:23 PM
> >Subject: [PHP] 4.2.1 Vars
> >
> >
> > >
> > > After moving to php 4.2.1 my scripts that use xxx.php?blah=4 fail to
work.
> > >
> > > I know that i need to turn register_globals on in my config, however I
> >know
> > > that there are security problems with this.  So bascially I need to
know
> > > how to make 500+ scripts work without editing a bunch of files to make
it
> > > so that all my get and post vars start with $_POST and $_GET
> > >
> > > any ideas?
> > >
> > > ~kurth
> > >
> > > Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone
Computer
> > >
> > > Security is like an arms race; the best attackers will continue to
search
> > > for more complicated exploits, so we will too.
> > > Quoted from http://www.openbsd.org/security.html
> > >
> > > [EMAIL PROTECTED] | http://kurth.hardcrypto.com
> > > PGP key available - http://kurth.hardcrypto.com/pgp
> > >
> > > Fight Weak Encryption!  Donate your wasted CPU cycles to
Distributed.net
> > > (http://www.distributed.net)
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
>
>
> Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer
>
> "Jedi Business, Go back to your drinks" - Anakin Skywalker, AOTC
>
> [EMAIL PROTECTED] | http://kurth.hardcrypto.com
> PGP key available - http://kurth.hardcrypto.com/pgp
>
>
>
> --
> 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] NewBie-UPLOADING IMAGE

2002-05-25 Thread Dani

Hi,

I want to upload image file into a folder in webserver using HTML form.
What function do I use fo this purpose?

Thank you,

Dani


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




Re: [PHP] 4.2.1 Vars

2002-05-25 Thread Kurth Bemis (List Monkey)

At 04:00 PM 5/25/2002 -0400, 1LT John W. Holmes wrote:

Actually - i don't understand what the docs at PHP are talking about.  care 
to enlighten me?

~kurth

>Do you know what the security problems are? Do you realise that having
>register_globals on or off isn't the security problem, it's how you write
>your code? If you're not going to change any of your code, just turn on
>register_globals. Changing your code to _POST or _GET and doing nothing else
>isn't making it any more secure that using it the way it is with
>register_globals on.
>
>---John Holmes...
>
>- Original Message -
>From: "Kurth Bemis (List Monkey)" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Saturday, May 25, 2002 3:23 PM
>Subject: [PHP] 4.2.1 Vars
>
>
> >
> > After moving to php 4.2.1 my scripts that use xxx.php?blah=4 fail to work.
> >
> > I know that i need to turn register_globals on in my config, however I
>know
> > that there are security problems with this.  So bascially I need to know
> > how to make 500+ scripts work without editing a bunch of files to make it
> > so that all my get and post vars start with $_POST and $_GET
> >
> > any ideas?
> >
> > ~kurth
> >
> > Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer
> >
> > Security is like an arms race; the best attackers will continue to search
> > for more complicated exploits, so we will too.
> > Quoted from http://www.openbsd.org/security.html
> >
> > [EMAIL PROTECTED] | http://kurth.hardcrypto.com
> > PGP key available - http://kurth.hardcrypto.com/pgp
> >
> > Fight Weak Encryption!  Donate your wasted CPU cycles to Distributed.net
> > (http://www.distributed.net)
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >


Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer

"Jedi Business, Go back to your drinks" - Anakin Skywalker, AOTC

[EMAIL PROTECTED] | http://kurth.hardcrypto.com
PGP key available - http://kurth.hardcrypto.com/pgp



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




Re: [PHP] 4.2.1 Vars

2002-05-25 Thread 1LT John W. Holmes

Do you know what the security problems are? Do you realise that having
register_globals on or off isn't the security problem, it's how you write
your code? If you're not going to change any of your code, just turn on
register_globals. Changing your code to _POST or _GET and doing nothing else
isn't making it any more secure that using it the way it is with
register_globals on.

---John Holmes...

- Original Message -
From: "Kurth Bemis (List Monkey)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 3:23 PM
Subject: [PHP] 4.2.1 Vars


>
> After moving to php 4.2.1 my scripts that use xxx.php?blah=4 fail to work.
>
> I know that i need to turn register_globals on in my config, however I
know
> that there are security problems with this.  So bascially I need to know
> how to make 500+ scripts work without editing a bunch of files to make it
> so that all my get and post vars start with $_POST and $_GET
>
> any ideas?
>
> ~kurth
>
> Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer
>
> Security is like an arms race; the best attackers will continue to search
> for more complicated exploits, so we will too.
> Quoted from http://www.openbsd.org/security.html
>
> [EMAIL PROTECTED] | http://kurth.hardcrypto.com
> PGP key available - http://kurth.hardcrypto.com/pgp
>
> Fight Weak Encryption!  Donate your wasted CPU cycles to Distributed.net
> (http://www.distributed.net)
>
>
>
> --
> 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 script

2002-05-25 Thread Paul Roberts

how about using the FTP functions that php has, look it up in the man, i haven't used 
it.
Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Chris Hewitt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 3:33 PM
Subject: Re: [PHP] PHP script


> Ryan,
> 
> I may be missing something as I have not been monitoring this thread, 
> but why not use ftp? It allows the file transfer and chmod. Perhaps its 
> not available on the server that you need it to be, but its the normal 
> way of putting web pages onto a server.
> 
> HTH
> Chris
> 
> SP wrote:
> 
> >I'm not an expert but that doesn't sound like it's
> >possible.  I mean if you could upload files and
> >chmod them on a remote server you would have some
> >serious security issues.  The only thing I can
> >think of is you could upload files to your remote
> >datebase.
> >
> >
> >
> >-Original Message-
> >From: r [mailto:[EMAIL PROTECTED]]
> >Sent: May 25, 2002 7:00 AM
> >To: [EMAIL PROTECTED]
> >Subject: [PHP] PHP script
> >
> >
> > Hi Guys,
> >
> > I need a PHP script that will allow me to
> >upload/download chmod files etc
> >on
> > a remote server...
> > I know there are loads of these scripts out there
> >but being a newbie to PHP
> > I really dont know which one is good...
> > can you recomend any? coming from Java I love PHP
> >so would appreciate if
> >you
> > would recomend only a php script and not
> >perl,servlet,asp etc.
> > Another problem is my webserver is something like
> > /wtn/cgi-bin/www/
> >
> > all cgi scripts will have to be put in the
> >cgi-bin directory of course but
> > must be called like this
> >mysite.com/cgibin/script.pl
> >
> > the php script should allow me access to this
> >directory too!
> >
> > ANY ideas or recomendations will be deeply
> >appreciated esp from John
> >Holmes,
> > Jason Wong, Miguel Cruz coz you guys are really
> >brainy and have helped me
> >in
> > the past so I know your advise is supurb.
> > I would tip my hat to you, but dont wear
> >one...;-)
> >
> > Cheers,
> > -Ryan A.
> >
> >
> >
> >
> >--
> >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] 4.2.1 Vars

2002-05-25 Thread Jeff Lewis

For now you can add this to the top of your scripts:

$types_to_register = array('GET','POST','COOKIE','SESSION','SERVER');
  foreach ($types_to_register as $type) {
$arr = @${'HTTP_' . $type . '_VARS'};
if (@count($arr) > 0) {
  extract($arr, EXTR_OVERWRITE);
}
  }

Somebody else posted this a few weeks back and it has worked for me until I
can convert everything over...

Jeff
- Original Message -
From: "Kurth Bemis (List Monkey)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 3:23 PM
Subject: [PHP] 4.2.1 Vars


>
> After moving to php 4.2.1 my scripts that use xxx.php?blah=4 fail to work.
>
> I know that i need to turn register_globals on in my config, however I
know
> that there are security problems with this.  So bascially I need to know
> how to make 500+ scripts work without editing a bunch of files to make it
> so that all my get and post vars start with $_POST and $_GET
>
> any ideas?
>
> ~kurth
>
> Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer
>
> Security is like an arms race; the best attackers will continue to search
> for more complicated exploits, so we will too.
> Quoted from http://www.openbsd.org/security.html
>
> [EMAIL PROTECTED] | http://kurth.hardcrypto.com
> PGP key available - http://kurth.hardcrypto.com/pgp
>
> Fight Weak Encryption!  Donate your wasted CPU cycles to Distributed.net
> (http://www.distributed.net)
>
>
>
> --
> 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] pconnect

2002-05-25 Thread Boaz Yahav

Hi

When working with pconnect. Can it be that each http process of apache will have more 
than
one sql connection open at a time?

I'm working with pconnect and seeing about double the number of established sql 
connections 
than the established http processes.

any ideas?

Sincerely

  berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.



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




[PHP] Re: Newbie Questionabout variables

2002-05-25 Thread Al

I got it now, thanks a lot. For some reason Mozilla won't let me post to the
newsgroup.

I've used your answer, and another one, and have already made a simple php
script to test the variable and echo "passed" or "failed"

 I'm modifying a php application and the admin file is named "index.php"
[yes that's right] and access to it is not protected.

The application is not very critical and there is no particularly sensitive
material in the DB.  So, I set the .htaccess file to default to the user's
file and thought I'd make access to the "index.php" a little secure with a
password. I've seen other applications with this technique.

Thanks again,

Al..

"Al" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I hope this posting is not a duplicate.  I originally posted it yesterday,
> but it doesn't show on the newsgroup for me.
>
> Apparently you can set a variable as part of a URL statement.  For
example:
> www.company.com/index.php?admin=password.
>
> Where "password" might be a simple variable to test as a rudimentary
> authorization password.
>
> I can't find anything like this on the php website or manual.
>
> Can someone point me in the right direction?
>
> Thanks
>
>



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




[PHP] 4.2.1 Vars

2002-05-25 Thread Kurth Bemis (List Monkey)


After moving to php 4.2.1 my scripts that use xxx.php?blah=4 fail to work.

I know that i need to turn register_globals on in my config, however I know 
that there are security problems with this.  So bascially I need to know 
how to make 500+ scripts work without editing a bunch of files to make it 
so that all my get and post vars start with $_POST and $_GET

any ideas?

~kurth

Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer

Security is like an arms race; the best attackers will continue to search 
for more complicated exploits, so we will too.
Quoted from http://www.openbsd.org/security.html

[EMAIL PROTECTED] | http://kurth.hardcrypto.com
PGP key available - http://kurth.hardcrypto.com/pgp

Fight Weak Encryption!  Donate your wasted CPU cycles to Distributed.net 
(http://www.distributed.net)



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




php-general Digest 25 May 2002 19:08:02 -0000 Issue 1366

2002-05-25 Thread php-general-digest-help


php-general Digest 25 May 2002 19:08:02 - Issue 1366

Topics (messages 99205 through 99254):

Re: Is this doable?
99205 by: Sandman
99216 by: John Holmes

Re: How is SESSION_ID passed?
99206 by: Miguel Cruz

Re: Popup window from form on php page
99207 by: Miguel Cruz

Session question
99208 by: Christian Ista
99218 by: John Holmes
99219 by: Christian Ista
99221 by: Jens Lehmann

PHP script
99209 by: r
99211 by: r
99225 by: SP
99231 by: r
99232 by: SP
99247 by: Chris Hewitt
99249 by: Alex Shi
99250 by: r

Re: IMPORTANT, wanna know about MY PROJECT SALE !!!
99210 by: r
99212 by: Liam MacKenzie

unexpected T_IF
99213 by: Zac Hillier
99214 by: Michael Virnstein

please help!!
99215 by: Jolly Ng
99233 by: Olexandr Vynnychenko
99234 by: John Holmes

displaying an image with header(... does not work
99217 by: andy
99220 by: Jens Lehmann
99222 by: andy

Switch() ?
99223 by: Vincent Kruger
99227 by: Jens Lehmann

Server push?
99224 by: Leif K-Brooks

Function Switch($pid) - NEED HELP
99226 by: Vincent Kruger
99228 by: Jens Lehmann
99229 by: Jonathan Rosenberg
99238 by: Rasmus Lerdorf

Storing img into db does not work with imagecreatefromjpeg?
99230 by: andy

hosting
99235 by: hassan
99236 by: John Holmes
99239 by: hassan

Can't get Apache and PHP to run together -each seems to work OK WinME
99237 by: Adrian Greeman
99242 by: Jens Lehmann

Re: SegFaults with PHP4.2.1 and Apache 2.0.36
99240 by: Rasmus Lerdorf

Re: gmtime?
99241 by: Jens Lehmann

Newbie Questionabout variables
99243 by: Al
99248 by: Alex Shi

Posting problem with Mozilla
99244 by: Al

Need some advice concerning forms (multi select pulldown) and arrays
99245 by: Victor Spång Arthursson
99252 by: Miguel Cruz
99254 by: Miguel Cruz

Socks Scripting
99246 by: chris reeper

Adding Sessions Secretly
99251 by: Vincent Kruger
99253 by: Miguel Cruz

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

--- Begin Message ---

In article <002e01c20370$4ebee8f0$b402a8c0@mango>,
 [EMAIL PROTECTED] (John Holmes) wrote:

> Can PHP do that? Of course. Can it do it that easily right out of the
> box. No. Just like the RXML backend is already written that parses
>  into the appropriate number, the backend would
> have to be written for PHP to do the same thing. You'd have to write a
> template engine, basically, that'll look for special tags and do the
> appropriate PHP functions when it encounters them.
> 
> I think you'd be far better off learning PHP and just adapting an
> existing template engine to suit your needs. There are plenty of them
> out there. 

I have no problem with learning PHP, I like it alot. But in some instances, 
I like the RXML approcah better.

You talk about template engines, what are they and can you name some 
examples?

-- 
Sandman[.net]

--- End Message ---
--- Begin Message ---

Smarty is the only one that I really remember, as far as template
engines. 

http://www.phpinsider.com/php/code/Smarty/

There are others, like FastTemplate. Do a search on Google or
SourceForge and you'll come up with a couple dozen. 

What they do is separate the code from presentation. Instead of having
code in your HTML file to display how many hits the page has gotten,
you'd have a tag like {accessed_per_day}. The template engine will do
the function to get the number and replace {accessed_per_day} with the
appropriate number. 

---John Holmes...

> -Original Message-
> From: Sandman [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 3:34 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Is this doable?
> 
> In article <002e01c20370$4ebee8f0$b402a8c0@mango>,
>  [EMAIL PROTECTED] (John Holmes) wrote:
> 
> > Can PHP do that? Of course. Can it do it that easily right out of
the
> > box. No. Just like the RXML backend is already written that parses
> >  into the appropriate number, the backend
would
> > have to be written for PHP to do the same thing. You'd have to write
a
> > template engine, basically, that'll look for special tags and do the
> > appropriate PHP functions when it encounters them.
> >
> > I think you'd be far better off learning PHP and just adapting an
> > existing template engine to suit your needs. There are plenty of
them
> > out there.
> 
> I have no problem with learning PHP, I like it alot. But in some
> instances,
> I like the RXML approcah better.
> 
> You talk about template engines, what are they 

Re: [PHP] Need some advice concerning forms (multi select pulldown)and arrays

2002-05-25 Thread Miguel Cruz

Oops. I actually tried running it (cleverly waiting until after I posted 
it to the list) and I see that there are some warnings in the event that 
nothing has been selected (due to in_array operating on an undefined 
variable). Don't worry about them. Or change that last foreach clause to 
look like this:

  foreach ($choices as $id => $name)
print '$name";

(I added an is_array to make sure we don't send a null value as the second 
argument to in_array).

miguel

On Sat, 25 May 2002, Miguel Cruz wrote:
> Have a play with this little program - it should demonstrate all of the
> things you'd want to do with getting data in and out of mult selects. If
> it doesn't work, you may have an older version of PHP - in that case,
> change "$_REQUEST" to "$HTTP_POST_VARS" and "$_SERVER['PHP_SELF']" to
> "$PHP_SELF".
> 
> ---
>
>   $choices = array(1 => 'dog', 2 => 'cat', 3 => 'mouse', 4 => 'frog');
> 
>   if (is_array($_REQUEST['animals']))
>   {   
> print 'You chose:';
> foreach ($_REQUEST['animals'] as $animal_id)  
>   print "{$choices[$animal_id]}";
> print '';
>   }
> 
>   ?>
>
>   foreach ($choices as $id => $name)
> print '   . (in_array($id, $_REQUEST['animals']) ? 'selected ' : '') 
>   . "value='$id'>$name";
> 
>   ?>
> 
> ---
> miguel
> 
> 
> 


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




Re: [PHP] Adding Sessions Secretly....

2002-05-25 Thread Miguel Cruz

On Sat, 25 May 2002, Vincent Kruger wrote:
> Adding data to session is the easy part!
> Now i want to be clever and sneeky by adding data to the session with out
> actually leaving the page that i am currently on.
> 
> Sort of like www.audiogalaxy.com when you click the satelite icon to
> download an mp3.

I'm pretty sure they just have a JavaScript that sends a request to the 
server. The page that it requests can of course do anything it wants with 
session data.

miguel


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




Re: [PHP] Need some advice concerning forms (multi select pulldown)and arrays

2002-05-25 Thread Miguel Cruz

On Sat, 25 May 2002, Victor Spång Arthursson wrote:
> I know it's possible to use arrays in combination with forms, but I need
> some advice about where to find some information/tutorial concerning how
> to use arrays together with "multi-select-tags"...

Have a play with this little program - it should demonstrate all of the
things you'd want to do with getting data in and out of mult selects. If
it doesn't work, you may have an older version of PHP - in that case,
change "$_REQUEST" to "$HTTP_POST_VARS" and "$_SERVER['PHP_SELF']" to
"$PHP_SELF".

---
   'dog', 2 => 'cat', 3 => 'mouse', 4 => 'frog');

  if (is_array($_REQUEST['animals']))
  {   
print 'You chose:';
foreach ($_REQUEST['animals'] as $animal_id)  
  print "{$choices[$animal_id]}";
print '';
  }

  ?>
   $name)
print '$name";

  ?>

---
miguel


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




[PHP] Adding Sessions Secretly....

2002-05-25 Thread Vincent Kruger

Adding data to session is the easy part!
Now i want to be clever and sneeky by adding data to the session with out
actually leaving the page that i am currently on.

Sort of like www.audiogalaxy.com when you click the satelite icon to
download an mp3.



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




Re: [PHP] PHP script

2002-05-25 Thread r

Hey,
thanks for writing,
The script will be on the remote server, but how do i access the cgi-bin
directory when it is below the host root...
eg:

/home/cgi-bin/mysite.com/upload.php

how will upload.php add/modify /cgi-bin/?


-Ryan A.

- Original Message -
From: "SP" <[EMAIL PROTECTED]>
To: "r" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 6:38 AM
Subject: RE: [PHP] PHP script


> Okay how about in your upload form, try putting in
> the whole url instead of upload.php.  I don't know
> if that would work.  You would have to have the
> upload.php script on the remote server.
>
>  action="http://www.remoteserver.com/upload.php";>
>
>
>
>
>
>
>
> -Original Message-
> From: r [mailto:[EMAIL PROTECTED]]
> Sent: May 25, 2002 10:03 PM
> To: SP
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP script
>
>
> Hey there,
> Guess you too are a newbie,
> anyway, have been doing what you think is
> impossible for years using perl
> and servlets without any problems,
> And I know its possible with PHP too, since its
> possible i'm pretty sure
> someone has used it in some app already or is
> going too, the php community
> is FAT...
> The problem is I have been using it on servers
> with paths to cgi something
> like this
>
> /home/somedotcom/cgi-bin/
>
> but now the new path i have is
>
> /home/cgi-bin/mydotTLD/ which of course resolves
> to http://mydotTLD/cgi-bin/
> and I will need to administrator the files in the
> cgi-bin too.
>
> Any ideas?
>
>  -Ryan.
>
> - Original Message -
> From: "SP" <[EMAIL PROTECTED]>
> To: "r" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Saturday, May 25, 2002 5:30 AM
> Subject: RE: [PHP] PHP script
>
>
> > I'm not an expert but that doesn't sound like
> it's
> > possible.  I mean if you could upload files and
> > chmod them on a remote server you would have
> some
> > serious security issues.  The only thing I can
> > think of is you could upload files to your
> remote
> > datebase.
> >
> >
> >
> > -Original Message-
> > From: r [mailto:[EMAIL PROTECTED]]
> > Sent: May 25, 2002 7:00 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] PHP script
> >
> >
> >  Hi Guys,
> >
> >  I need a PHP script that will allow me to
> > upload/download chmod files etc
> > on
> >  a remote server...
> >  I know there are loads of these scripts out
> there
> > but being a newbie to PHP
> >  I really dont know which one is good...
> >  can you recomend any? coming from Java I love
> PHP
> > so would appreciate if
> > you
> >  would recomend only a php script and not
> > perl,servlet,asp etc.
> >  Another problem is my webserver is something
> like
> >  /wtn/cgi-bin/www/
> >
> >  all cgi scripts will have to be put in the
> > cgi-bin directory of course but
> >  must be called like this
> > mysite.com/cgibin/script.pl
> >
> >  the php script should allow me access to this
> > directory too!
> >
> >  ANY ideas or recomendations will be deeply
> > appreciated esp from John
> > Holmes,
> >  Jason Wong, Miguel Cruz coz you guys are really
> > brainy and have helped me
> > in
> >  the past so I know your advise is supurb.
> >  I would tip my hat to you, but dont wear
> > one...;-)
> >
> >  Cheers,
> >  -Ryan A.
> >
> >
> >
> >
> > --
> > 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: PHP script

2002-05-25 Thread Alex Shi

For file uploading:
http://www.php.net/manual/en/features.file-upload.php

For chmod:
http://www.php.net/manual/en/function.chmod.php

For the third question:
php has no restriction where php scripts have to be
put in. so just put the script where you want to upload file.

Hope these can help.

Alex


"R" <[EMAIL PROTECTED]> wrote in message
000801c203db$5ba81b20$0a6da8c0@lgwezec83s94bn">news:000801c203db$5ba81b20$0a6da8c0@lgwezec83s94bn...
> Hi Guys,
>
>  I need a PHP script that will allow me to upload/download chmod files etc
> on
>  a remote server...
>  I know there are loads of these scripts out there but being a newbie to
PHP
>  I really dont know which one is good...
>  can you recomend any? coming from Java I love PHP so would appreciate if
> you
>  would recomend only a php script and not perl,servlet,asp etc.
>  Another problem is my webserver is something like
>  /wtn/cgi-bin/www/
>
>  all cgi scripts will have to be put in the cgi-bin directory of course
but
>  must be called like this mysite.com/cgibin/script.pl
>
>  the php script should allow me access to this directory too!
>
>  ANY ideas or recomendations will be deeply appreciated esp from John
> Holmes,
>  Jason Wong, Miguel Cruz coz you guys are really brainy and have helped me
> in
>  the past so I know your advise is supurb.
>  I would tip my hat to you, but dont wear one...;-)
>
>  Cheers,
>  -Ryan A.
>
>
>


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




[PHP] Re: Newbie Questionabout variables

2002-05-25 Thread Alex Shi

Not sure what your question is

In the case "password" is not a variable but the value of
the variable, while "admin" is the name of the variable.

Variables passed by url is obtained by GET method, and
in your script all vairables passed by GET method can be
accessed directly. So, in following script,



the result of print will be "password".

If this is not the answer to your quesiton, pls clarify.

Alex


"Al" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I hope this posting is not a duplicate.  I originally posted it yesterday,
> but it doesn't show on the newsgroup for me.
>
> Apparently you can set a variable as part of a URL statement.  For
example:
> www.company.com/index.php?admin=password.
>
> Where "password" might be a simple variable to test as a rudimentary
> authorization password.
>
> I can't find anything like this on the php website or manual.
>
> Can someone point me in the right direction?
>
> Thanks
>
>


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




[PHP] Need some advice concerning forms (multi select pulldown) and arrays

2002-05-25 Thread Victor Spång Arthursson

Hello!

I know it's possible to use arrays in combination with forms, but I need 
some advice about where to find some information/tutorial concerning how 
to use arrays together with "multi-select-tags"...

Sincerely

Victor


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




Re: [PHP] PHP script

2002-05-25 Thread Chris Hewitt

Ryan,

I may be missing something as I have not been monitoring this thread, 
but why not use ftp? It allows the file transfer and chmod. Perhaps its 
not available on the server that you need it to be, but its the normal 
way of putting web pages onto a server.

HTH
Chris

SP wrote:

>I'm not an expert but that doesn't sound like it's
>possible.  I mean if you could upload files and
>chmod them on a remote server you would have some
>serious security issues.  The only thing I can
>think of is you could upload files to your remote
>datebase.
>
>
>
>-Original Message-
>From: r [mailto:[EMAIL PROTECTED]]
>Sent: May 25, 2002 7:00 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] PHP script
>
>
> Hi Guys,
>
> I need a PHP script that will allow me to
>upload/download chmod files etc
>on
> a remote server...
> I know there are loads of these scripts out there
>but being a newbie to PHP
> I really dont know which one is good...
> can you recomend any? coming from Java I love PHP
>so would appreciate if
>you
> would recomend only a php script and not
>perl,servlet,asp etc.
> Another problem is my webserver is something like
> /wtn/cgi-bin/www/
>
> all cgi scripts will have to be put in the
>cgi-bin directory of course but
> must be called like this
>mysite.com/cgibin/script.pl
>
> the php script should allow me access to this
>directory too!
>
> ANY ideas or recomendations will be deeply
>appreciated esp from John
>Holmes,
> Jason Wong, Miguel Cruz coz you guys are really
>brainy and have helped me
>in
> the past so I know your advise is supurb.
> I would tip my hat to you, but dont wear
>one...;-)
>
> Cheers,
> -Ryan A.
>
>
>
>
>--
>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] Socks Scripting

2002-05-25 Thread chris reeper

Hi, Is there any good info out there on how to connect to socks servers via
php.
Trying to redo the backend of my site to access a mysql database thats on
the other side of socks5 server. ?

-Chris



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




[PHP] Posting problem with Mozilla

2002-05-25 Thread Al

Anyone have a clue why I can't post messages with Mozilla [RC2]?

Goes through all the motions as if the message is sent.  Shows in my sent
folder and the terminal icon indicates the message is sent.

Works fine for all other newsgroup servers.

I'm posting this with IE6.



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




[PHP] Newbie Questionabout variables

2002-05-25 Thread Al


I hope this posting is not a duplicate.  I originally posted it yesterday,
but it doesn't show on the newsgroup for me.

Apparently you can set a variable as part of a URL statement.  For example:
www.company.com/index.php?admin=password.

Where "password" might be a simple variable to test as a rudimentary
authorization password.

I can't find anything like this on the php website or manual.

Can someone point me in the right direction?

Thanks



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




[PHP] Re: Can't get Apache and PHP to run together -each seems to work OK WinME

2002-05-25 Thread Jens Lehmann

Maybe Apache and PHP have problems with the 2MHz-CPU. :-)

I can only guess what may be the problem:

1. You didn't write phpinfo.php correctly.
2. phpinfo.php is in the wrong directory.

I suggest this because if the apache-site comes up correctly and
phpinfo.php does not it _might_ be a directory problem. Please try to
put a test.html-file in your webserver-root and call it in your browser.

Jens


>  I am not an advanced user but not incapable.  Please bear with me for
> any amateurishness.
>
> I am trying to get PHP to work with Apache.
> I have a Windows ME PC, 2Mhz and 512 of RAM.
>
> I want it only to learn PHP and then test out a few things, using
> MySQL too.
>
> I downloaded Apache version 1.3.24 and installed it plain and
> simple.It starts up.
>
> I have also installed PHP version 4.2.1.  I have also a version of
> MySQL loaded (4.0.1) and that sits happily running under a
> WinMySQLAdmin logo in the corner of the screen.
>
> I carefully followed the help files and looked up articles and books
> for instructions for setting up the config file and have made changes
> to "Apache" so the relevant sections now read like this.
> (There seem only to be a few necessary changes)./
>
>
> QUOTE
>ScriptAlias /cgi-bin/ "C:/Program Files/Apache
> Group/Apache/cgi-bin/"
>
> #
> # "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed
> to whatever your ScriptAliased
> # CGI directory exists, if you have that configured.
> #
> 
> AllowOverride None
> Options None
> Order allow,deny
> Allow from all
> 
>
> 
>
> ScriptAlias /php/ "C:/PHP/"
>
>
>
> # End of aliases.
>
> END QUOTE
>
>
> and ..
>
>
> QUOTE
>
>  #
> # AddType allows you to tweak mime.types without actually editing
> it, or to
> # make certain files to be certain types.
> #
> AddType application/x-tar .tgz
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php .php3
> AddType application/x-httpd-php .php4
> AddType application/x-httpd-php .phtml
>
> Action application/x-httpd-php "/php/php.exe"
>
> END QUOTE
>
> With this done the Apache config tester says the syntax is OK and when
> I access "localhost"  (using IE6) up comes the Apache information page
> saying it is running.
>
> But when I ask for  "localhost/phpinfo.php"
> (I have a phpinfo function written into a file with that extension)
> I get an error 500 "internal configuration is wrong" message.
>
>
>
> Maybe it is PHP that is wrong?So I have checked all the changes
> needed for installing PHP --- again after reading the php site and
> looking a FAQs etc.
>
> I mean putting the php4tl file into Windows/System etc and PHP.ini
> into Windows.  (I used the Windows installer anyway and have again
> carefully followed the changes needed to the INI file.)
>
>
>
> Still the problem.
>
> A PHP FAQ says that if you get a 500 error (internatl config problem)
> it is worth testing with the command line:
>
> php.exe -i
>
>
> so I did this in DOS. Reams of HTML stuff whizzed by.
> According to the FAQ answer this means PHP  is OK.
>
> So back to Apache.  But that is as above.
>
> I tried Netscape version 2 and IE6   -   both give the same answer. So
> it is not the browser because I have tried different ones.
>
> It is not PHP because on the command line that works OK and shows
> PHPINFO stuff.
>
> It is not Apache because it says it is running in the browser windows
> when you call localhost.
>
> So - I am being driven slowly nuts with frustration.
>
> May I ask for any ideas?
>
> (I should add that I am a rank amateur trying to do all this so please
> take it slowly).
>
> Regards from
> Adrian Greeman
>
>
>
> Regards from
> Adrian Greeman
>
> 52 Salterford Road, Tooting, London, SW17 9TF
>
> Phone  +44 (0)20 8672 9661
> Mobile  +44 (0)780 329 7447
>
> Fax:  I can receive these
> on the computer
> but only when present
> - please phone first
>



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




Re: [PHP] gmtime?

2002-05-25 Thread Jens Lehmann


> I don't know what gmtime() is supposed to do.  But is gmmktime() similar?
> http://www.php.net/manual/en/function.gmmktime.php
> -Kevin

Sorry, my first answer was incorrect. gmmktime() does not do what I want.
Do you have any other suggestion why we need/don't need gmtime()?

Jens



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




Re: [PHP] SegFaults with PHP4.2.1 and Apache 2.0.36

2002-05-25 Thread Rasmus Lerdorf

The fact that some applications crash with Apache2+PHP is not strange at
all. There are likely a number of 3rd-party libraries which can currently
be linked into PHP that are not threadsafe and/or re-entrant.  It will
take a while before we identify these libraries and try to come up with
some workaround.  For now you can try going single-threaded and see if
that helps (although then you might as well just use Apache 1.3.x)

-Rasmus

On Fri, 24 May 2002, Rodolfo Segleau wrote:

>
> Not sure if you guys have already responded to this, but here we go (I'm
> checking the archives of PHP as I am writing this).
>
> I have Apache 2.0.36 running with PHP 4.2.1. Apache seg faults with a certain
> application (which has redirected me back here). Child processes quit with a
> signal 11. I know that PHP 4.2.1 doesn't have full support for Apache2, but it
> seems strange that only a few of all the applications written in PHP are
> causing this segfault. Below is the output of an strace done on the parent
> process:
>
> 
> select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
> gettimeofday({1022291150, 787056}, NULL) = 0
> fork()  = 15100
> wait4(-1, 0x11818, WNOHANG|WUNTRACED, NULL) = 0
> select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
> 
> ...
> 
> wait4(-1, 0x11818, WNOHANG|WUNTRACED, NULL) = 0
> select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
> wait4(-1, 0x11818, WNOHANG|WUNTRACED, NULL) = 0
> select(0, NULL, NULL, NULL, {1, 0}) = ? ERESTARTNOHAND (To be restarted)
> --- SIGCHLD (Child exited) ---
> select(0, NULL, NULL, NULL, {0, 496784}) = 0 (Timeout)
> wait4(-1, [WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV], WNOHANG|WUNTRACED, NULL) =
>  15034
> gettimeofday({1022291166, 797450}, NULL) = 0
> write(11, "[Fri May 24 20:46:06 2002] [noti"..., 88) = 88
> gettimeofday({1022291166, 797869}, NULL) = 0
> wait4(-1, 0x11818, WNOHANG|WUNTRACED, NULL) = 0
> select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
> 
>
>
>
> Any ideas?
>
> Cheers,
>
>
> Rodolfo
>
>
>
>
> --
> 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] hosting

2002-05-25 Thread hassan

OK
let me explain, this is an emergency situation

i need php 4.XXX with --enable-wddx plus allow remote fopen (the app reads 
remote xml files)
perl binary installed
access to one directory outside the web root (to store includes and classes 
library)
mysql database

disk space something like 50 megs is ok
i will be hosting a domain on the server
pop accounts (at least 2)
ftp
possibly ssh access (not necessary)




At 17:28 25/05/02, 1LT John W. Holmes wrote:
> > anybody know of a hosting service that can be setup in a few minutes and i
> > mean a few minutes that's all i got
>
>I know of a great one...umm, just give me a few minutes to remember the
>name.
>
>---John Holmes...

___
Hassan El Forkani
Founder And Mantainer of :
http://WarmAfrica.com EveryOne's Africa
Freelance Internet Consultant / Web Applications Developper.
Email: [EMAIL PROTECTED]
Tel : 0021671880014
___


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




Re: [PHP] Function Switch($pid) - NEED HELP

2002-05-25 Thread Rasmus Lerdorf

Just don't do the break in case 1 if you want to fall through to case 2.

On Sat, 25 May 2002, Vincent Kruger wrote:

> I have a script that switches.
> switch($pid)
> {
> case 1:
> break;
>
> case 2:
> break;
> }
>
> Now I'm doing a check in case 1 and if everything goes well, i want to
> switch directly to case 2 while the script is runny.
>
> How would i do that ???
>
>
>
>
>
> --
> 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] Can't get Apache and PHP to run together -each seems to work OK WinME

2002-05-25 Thread Adrian Greeman

I am not an advanced user but not incapable.  Please bear with me for
any amateurishness.

I am trying to get PHP to work with Apache.
I have a Windows ME PC, 2Mhz and 512 of RAM.

I want it only to learn PHP and then test out a few things, using
MySQL too.

I downloaded Apache version 1.3.24 and installed it plain and
simple.It starts up.

I have also installed PHP version 4.2.1.  I have also a version of
MySQL loaded (4.0.1) and that sits happily running under a
WinMySQLAdmin logo in the corner of the screen.

I carefully followed the help files and looked up articles and books
for instructions for setting up the config file and have made changes
to "Apache" so the relevant sections now read like this.
(There seem only to be a few necessary changes)./


QUOTE
   ScriptAlias /cgi-bin/ "C:/Program Files/Apache
Group/Apache/cgi-bin/"

#
# "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed
to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#

AllowOverride None
Options None
Order allow,deny
Allow from all




ScriptAlias /php/ "C:/PHP/"



# End of aliases.

END QUOTE


and ..


QUOTE

 #
# AddType allows you to tweak mime.types without actually editing
it, or to
# make certain files to be certain types.
#
AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .phtml

Action application/x-httpd-php "/php/php.exe"

END QUOTE

With this done the Apache config tester says the syntax is OK and when
I access "localhost"  (using IE6) up comes the Apache information page
saying it is running.

But when I ask for  "localhost/phpinfo.php"
(I have a phpinfo function written into a file with that extension)
I get an error 500 "internal configuration is wrong" message.



Maybe it is PHP that is wrong?So I have checked all the changes
needed for installing PHP --- again after reading the php site and
looking a FAQs etc.

I mean putting the php4tl file into Windows/System etc and PHP.ini
into Windows.  (I used the Windows installer anyway and have again
carefully followed the changes needed to the INI file.)



Still the problem.

A PHP FAQ says that if you get a 500 error (internatl config problem)
it is worth testing with the command line:

php.exe -i


so I did this in DOS. Reams of HTML stuff whizzed by.
According to the FAQ answer this means PHP  is OK.

So back to Apache.  But that is as above.

I tried Netscape version 2 and IE6   -   both give the same answer. So
it is not the browser because I have tried different ones.

It is not PHP because on the command line that works OK and shows
PHPINFO stuff.

It is not Apache because it says it is running in the browser windows
when you call localhost.

So - I am being driven slowly nuts with frustration.

May I ask for any ideas?

(I should add that I am a rank amateur trying to do all this so please
take it slowly).

Regards from
Adrian Greeman



Regards from
Adrian Greeman

52 Salterford Road, Tooting, London, SW17 9TF

Phone  +44 (0)20 8672 9661
Mobile  +44 (0)780 329 7447

Fax:  I can receive these
on the computer
but only when present
- please phone first


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




Re: [PHP] hosting

2002-05-25 Thread 1LT John W. Holmes

> anybody know of a hosting service that can be setup in a few minutes and i
> mean a few minutes that's all i got

I know of a great one...umm, just give me a few minutes to remember the
name.

---John Holmes...


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




[PHP] hosting

2002-05-25 Thread hassan

hi

anybody know of a hosting service that can be setup in a few minutes and i 
mean a few minutes that's all i got

Thank

___
Hassan El Forkani
Founder And Mantainer of :
http://WarmAfrica.com EveryOne's Africa
Freelance Internet Consultant / Web Applications Developper.
Email: [EMAIL PROTECTED]
Tel : 0021671880014
___


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




Re: [PHP] please help!!

2002-05-25 Thread 1LT John W. Holmes

> Saturday, May 25, 2002, 9:13:02 AM, you wrote:
>
> JN> Hi Hi,
>
> JN> php + apache + win2000
> JN> or
> JN> php + IIS + win2000
> JN> I don't know why my setting do not allow me to POST or GET variable
which submit in html 
> JN> Please help!!!
>
> JN> Jolly

Turn on register_globals or use the $_GET[], $_POST[], etc arrays.

If you don't know what I'm talking about, read the release notes on the
program you just installed (php).

---John Holmes...


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




Re: [PHP] please help!!

2002-05-25 Thread Olexandr Vynnychenko

Hello Jolly,

Saturday, May 25, 2002, 9:13:02 AM, you wrote:

JN> Hi Hi,

JN> php + apache + win2000
JN> or 
JN> php + IIS + win2000
JN> I don't know why my setting do not allow me to POST or GET variable which submit 
in html 
JN> Please help!!!

JN> Jolly

Let us read your html and php code. I've never had such problems.

-- 
Best regards,
 Olexandrmailto:[EMAIL PROTECTED]


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




RE: [PHP] PHP script

2002-05-25 Thread SP

Okay how about in your upload form, try putting in
the whole url instead of upload.php.  I don't know
if that would work.  You would have to have the
upload.php script on the remote server.

http://www.remoteserver.com/upload.php";>







-Original Message-
From: r [mailto:[EMAIL PROTECTED]]
Sent: May 25, 2002 10:03 PM
To: SP
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP script


Hey there,
Guess you too are a newbie,
anyway, have been doing what you think is
impossible for years using perl
and servlets without any problems,
And I know its possible with PHP too, since its
possible i'm pretty sure
someone has used it in some app already or is
going too, the php community
is FAT...
The problem is I have been using it on servers
with paths to cgi something
like this

/home/somedotcom/cgi-bin/

but now the new path i have is

/home/cgi-bin/mydotTLD/ which of course resolves
to http://mydotTLD/cgi-bin/
and I will need to administrator the files in the
cgi-bin too.

Any ideas?

 -Ryan.

- Original Message -
From: "SP" <[EMAIL PROTECTED]>
To: "r" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 5:30 AM
Subject: RE: [PHP] PHP script


> I'm not an expert but that doesn't sound like
it's
> possible.  I mean if you could upload files and
> chmod them on a remote server you would have
some
> serious security issues.  The only thing I can
> think of is you could upload files to your
remote
> datebase.
>
>
>
> -Original Message-
> From: r [mailto:[EMAIL PROTECTED]]
> Sent: May 25, 2002 7:00 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP script
>
>
>  Hi Guys,
>
>  I need a PHP script that will allow me to
> upload/download chmod files etc
> on
>  a remote server...
>  I know there are loads of these scripts out
there
> but being a newbie to PHP
>  I really dont know which one is good...
>  can you recomend any? coming from Java I love
PHP
> so would appreciate if
> you
>  would recomend only a php script and not
> perl,servlet,asp etc.
>  Another problem is my webserver is something
like
>  /wtn/cgi-bin/www/
>
>  all cgi scripts will have to be put in the
> cgi-bin directory of course but
>  must be called like this
> mysite.com/cgibin/script.pl
>
>  the php script should allow me access to this
> directory too!
>
>  ANY ideas or recomendations will be deeply
> appreciated esp from John
> Holmes,
>  Jason Wong, Miguel Cruz coz you guys are really
> brainy and have helped me
> in
>  the past so I know your advise is supurb.
>  I would tip my hat to you, but dont wear
> one...;-)
>
>  Cheers,
>  -Ryan A.
>
>
>
>
> --
> 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 script

2002-05-25 Thread r

Hey there,
Guess you too are a newbie,
anyway, have been doing what you think is impossible for years using perl
and servlets without any problems,
And I know its possible with PHP too, since its possible i'm pretty sure
someone has used it in some app already or is going too, the php community
is FAT...
The problem is I have been using it on servers with paths to cgi something
like this

/home/somedotcom/cgi-bin/

but now the new path i have is

/home/cgi-bin/mydotTLD/ which of course resolves to http://mydotTLD/cgi-bin/
and I will need to administrator the files in the cgi-bin too.

Any ideas?

 -Ryan.

- Original Message -
From: "SP" <[EMAIL PROTECTED]>
To: "r" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 5:30 AM
Subject: RE: [PHP] PHP script


> I'm not an expert but that doesn't sound like it's
> possible.  I mean if you could upload files and
> chmod them on a remote server you would have some
> serious security issues.  The only thing I can
> think of is you could upload files to your remote
> datebase.
>
>
>
> -Original Message-
> From: r [mailto:[EMAIL PROTECTED]]
> Sent: May 25, 2002 7:00 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP script
>
>
>  Hi Guys,
>
>  I need a PHP script that will allow me to
> upload/download chmod files etc
> on
>  a remote server...
>  I know there are loads of these scripts out there
> but being a newbie to PHP
>  I really dont know which one is good...
>  can you recomend any? coming from Java I love PHP
> so would appreciate if
> you
>  would recomend only a php script and not
> perl,servlet,asp etc.
>  Another problem is my webserver is something like
>  /wtn/cgi-bin/www/
>
>  all cgi scripts will have to be put in the
> cgi-bin directory of course but
>  must be called like this
> mysite.com/cgibin/script.pl
>
>  the php script should allow me access to this
> directory too!
>
>  ANY ideas or recomendations will be deeply
> appreciated esp from John
> Holmes,
>  Jason Wong, Miguel Cruz coz you guys are really
> brainy and have helped me
> in
>  the past so I know your advise is supurb.
>  I would tip my hat to you, but dont wear
> one...;-)
>
>  Cheers,
>  -Ryan A.
>
>
>
>
> --
> 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 img into db does not work with imagecreatefromjpeg?

2002-05-25 Thread andy

Hi there,

I would like to save images into a blob column. Works good if I use the tmp
file php has created after submitting the form.

But if I do some gd stuff like changing some colors with inside the image
and then save this immage, it does not work.

I used to save the image to a file with:   imagejpeg($picture, $name); //
this works
and now I try to save it to the db with:

   $picture = ImageCreateTrueColor($maxX, $dstY);
//... some funky stuff like using the uuploaded file and mixing it with
a water mark
  $data = addslashes($picture);

  $stmt ="
   INSERT INTO test.picture_test
(file_name, file_type, picture)
VALUES
('$name', '$picture_location_type', '$data')
  ";

Like I said if I replace the $picture with the variable of the tmp field it
works fine.

I tryed also to do an imagejpeg before saving to the db, but it did not
change anything.

Thank you so much for any hint,

Andy



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




RE: [PHP] Function Switch($pid) - NEED HELP

2002-05-25 Thread Jonathan Rosenberg

-Original Message-
> From: Vincent Kruger [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 8:41 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Function Switch($pid) - NEED HELP

> I have a script that switches.
> switch($pid)
> {
> case 1:
> break;
>
> case 2:
> break;
> }

> Now I'm doing a check in case 1 and if everything goes
> well, I want to
> switch directly to case 2 while the script is runny.

> How would I do that ???

I'm not sure I'm understanding your question properly.  But does
this do what you want?

switch ($pid) {
case 1:
if (!test you want) then break;
// If test is true, execution "falls
// through" to next case
case 2:
...
break;
}


--
JR


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




[PHP] Re: Function Switch($pid) - NEED HELP

2002-05-25 Thread Jens Lehmann

> I have a script that switches.
> switch($pid)
> {
> case 1:
> break;
>
> case 2:
> break;
> }
>
> Now I'm doing a check in case 1 and if everything goes well, i want to
> switch directly to case 2 while the script is runny.
>
> How would i do that ???
>

Please don't post the same question several times.

Jens



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




[PHP] Re: Switch() ?????

2002-05-25 Thread Jens Lehmann


> I have a script that switches.
> switch($pid)
> {
> case 1:
> break;
>
> case 2:
> break;
> }
>
> Now I'm doing a check in case 1 and if everything goes well, i want to
> switch directly to case 2 while the script is runny.
>
> How would i do that ???
>

Don't write "break;" in case 1.

Jens



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




[PHP] Function Switch($pid) - NEED HELP

2002-05-25 Thread Vincent Kruger

I have a script that switches.
switch($pid)
{
case 1:
break;

case 2:
break;
}

Now I'm doing a check in case 1 and if everything goes well, i want to
switch directly to case 2 while the script is runny.

How would i do that ???





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




RE: [PHP] PHP script

2002-05-25 Thread SP

I'm not an expert but that doesn't sound like it's
possible.  I mean if you could upload files and
chmod them on a remote server you would have some
serious security issues.  The only thing I can
think of is you could upload files to your remote
datebase.



-Original Message-
From: r [mailto:[EMAIL PROTECTED]]
Sent: May 25, 2002 7:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP script


 Hi Guys,

 I need a PHP script that will allow me to
upload/download chmod files etc
on
 a remote server...
 I know there are loads of these scripts out there
but being a newbie to PHP
 I really dont know which one is good...
 can you recomend any? coming from Java I love PHP
so would appreciate if
you
 would recomend only a php script and not
perl,servlet,asp etc.
 Another problem is my webserver is something like
 /wtn/cgi-bin/www/

 all cgi scripts will have to be put in the
cgi-bin directory of course but
 must be called like this
mysite.com/cgibin/script.pl

 the php script should allow me access to this
directory too!

 ANY ideas or recomendations will be deeply
appreciated esp from John
Holmes,
 Jason Wong, Miguel Cruz coz you guys are really
brainy and have helped me
in
 the past so I know your advise is supurb.
 I would tip my hat to you, but dont wear
one...;-)

 Cheers,
 -Ryan A.




--
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] Server push?

2002-05-25 Thread Leif K-Brooks

Does php support server push?  I am trying to make a real-time chat. 
 Would server push be the best way, and if so, how would I do it? 
 Thanks for any help!


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




[PHP] Switch() ?????

2002-05-25 Thread Vincent Kruger

I have a script that switches.
switch($pid)
{
case 1:
break;

case 2:
break;
}

Now I'm doing a check in case 1 and if everything goes well, i want to
switch directly to case 2 while the script is runny.

How would i do that ???



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




[PHP] Re: displaying an image with header(... does not work

2002-05-25 Thread andy

sound pretty funny... but I opened the browser to test it again, and it
worked without problems :-) No clue why.

Anyway.. thank you

Andy


"Jens Lehmann" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Hi there,
> >
> > I am pulling out an image out of a mysql blob field. The image is there,
I
> > can see it in mysqlfront. So I pull it out of the db store it into a
> > variable and then do a:
> >
> >  header("Content-type: image/pjpeg");
> >  echo $picture;
> >
> > I do get a white screen and the browser is loading forever. I can not
see
> > any error in that. Outputting text works, but not the image.
> >
> > Thanx for any help,
> >
> > Andy
> >
>
> Don't know if it's a typo, but it must be "image/jpeg" of course. Check
your
> loops (if any) and your strings (esp. " and '). Maybe it's better to post
> the whole
> source in this case.
>
> Jens
>
>



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




Re: [PHP] Session question

2002-05-25 Thread Jens Lehmann

> > Just be sure you call session_start() on any page you want to access
> > session variables.
> >
>
> I have to call this function on each page I use session variable or juste
> once ?

The statement is pretty clear. You've to call it once on each page you want
to access session variables.

>
> > This assumes the latest version of PHP. The procedure is similar on
> > older versions, you just have to use session_register().
>
> From wich version session_start() is include ?

Don't know what you want, but session_start() is part of PHP since version
4.0

Jens




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




[PHP] Re: displaying an image with header(... does not work

2002-05-25 Thread Jens Lehmann


> Hi there,
>
> I am pulling out an image out of a mysql blob field. The image is there, I
> can see it in mysqlfront. So I pull it out of the db store it into a
> variable and then do a:
>
>  header("Content-type: image/pjpeg");
>  echo $picture;
>
> I do get a white screen and the browser is loading forever. I can not see
> any error in that. Outputting text works, but not the image.
>
> Thanx for any help,
>
> Andy
>

Don't know if it's a typo, but it must be "image/jpeg" of course. Check your
loops (if any) and your strings (esp. " and '). Maybe it's better to post
the whole
source in this case.

Jens



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




Re: [PHP] Session question

2002-05-25 Thread Christian Ista


> Just be sure you call session_start() on any page you want to access
> session variables.
>

I have to call this function on each page I use session variable or juste
once ?

> This assumes the latest version of PHP. The procedure is similar on
> older versions, you just have to use session_register().

>From wich version session_start() is include ?

Bye



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




RE: [PHP] Session question

2002-05-25 Thread John Holmes

Just be sure you call session_start() on any page you want to access
session variables. 

Then you can set a variable by doing

$_SESSION["myvariable"] = "hello";

and then you can use $_SESSION["myvariable"] anywhere you want. 

This assumes the latest version of PHP. The procedure is similar on
older versions, you just have to use session_register().

---John Holmes...

> -Original Message-
> From: Christian Ista [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 4:45 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Session question
> 
> Hello,
> 
> I'm a newbie in PHP, I use a lot ColdFusion (at work).
> 
> With ColdFusion, it's very easy to create and use session variable. I
do
> something like that :
>  and this variable can be use
> everywhere.
> 
> Could you tell me how that's work in PHP. I saw in help file
> session.start.
> But it's not very clear for me.
> 
> Thanks for your help,
> 
> Bye
> 
> 
> 
> 
> 
> --
> 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] displaying an image with header(... does not work

2002-05-25 Thread andy

Hi there,

I am pulling out an image out of a mysql blob field. The image is there, I
can see it in mysqlfront. So I pull it out of the db store it into a
variable and then do a:

 header("Content-type: image/pjpeg");
 echo $picture;

I do get a white screen and the browser is loading forever. I can not see
any error in that. Outputting text works, but not the image.

Thanx for any help,

Andy



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




RE: [PHP] Is this doable?

2002-05-25 Thread John Holmes

Smarty is the only one that I really remember, as far as template
engines. 

http://www.phpinsider.com/php/code/Smarty/

There are others, like FastTemplate. Do a search on Google or
SourceForge and you'll come up with a couple dozen. 

What they do is separate the code from presentation. Instead of having
code in your HTML file to display how many hits the page has gotten,
you'd have a tag like {accessed_per_day}. The template engine will do
the function to get the number and replace {accessed_per_day} with the
appropriate number. 

---John Holmes...

> -Original Message-
> From: Sandman [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 3:34 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Is this doable?
> 
> In article <002e01c20370$4ebee8f0$b402a8c0@mango>,
>  [EMAIL PROTECTED] (John Holmes) wrote:
> 
> > Can PHP do that? Of course. Can it do it that easily right out of
the
> > box. No. Just like the RXML backend is already written that parses
> >  into the appropriate number, the backend
would
> > have to be written for PHP to do the same thing. You'd have to write
a
> > template engine, basically, that'll look for special tags and do the
> > appropriate PHP functions when it encounters them.
> >
> > I think you'd be far better off learning PHP and just adapting an
> > existing template engine to suit your needs. There are plenty of
them
> > out there.
> 
> I have no problem with learning PHP, I like it alot. But in some
> instances,
> I like the RXML approcah better.
> 
> You talk about template engines, what are they and can you name some
> examples?
> 
> --
> Sandman[.net]
> 
> --
> 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] please help!!

2002-05-25 Thread Jolly Ng

Hi Hi,

php + apache + win2000
or 
php + IIS + win2000
I don't know why my setting do not allow me to POST or GET variable which submit in 
html 
Please help!!!

Jolly



[PHP] Re: unexpected T_IF

2002-05-25 Thread Michael Virnstein

you can look here:
http://www.php.net/manual/en/tokens.php
to see what T_IF means.

31:   $FulflNme = $DOCUMENT_ROOT . $flNme

you forgot the ; at the end of the line.

Michael


"Zac Hillier" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
002a01c203cf$4f1d7780$667ba8c0@ws">news:002a01c203cf$4f1d7780$667ba8c0@ws...
Hmm, can anyone explain why I'm getting this error?

Parse error: parse error, unexpected T_IF in
/usr/local/htdocs/san.loc/upload-img.php on line 34

Code reads:

11:#--if form submitted then process file upload
12:if($HTTP_POST_VARS['ttl']) {
13:
14: #--check if there is already a picture called this
15: include $DOCUMENT_ROOT . 'incs/db.php';
16: @mysql_select_db("infoNav") or die("unable to connect to table");
17: $qry = "SELECT ttl FROM imgLst WHERE site = $HTTP_SESSION_VARS[site_no]
AND ttl = '$HTTP_POST_VARS[ttl]';";
18: $imgTst = MYSQL_QUERY($qry);
19:
20: if(mysql_numrows($imgTst) < 1) {
21:
22:  #-- check file type
23:  $ulf = $HTTP_POST_FILES['uplfile']['type'];
24:  if($ulf == 'image/pjpeg' || $ulf == 'image/gif') {
25:
26:   #-- get ext
27:   ($ulf == 'image/pjpeg') ? $ext = '.jpg' : $ext = '.gif';
28:
29:   #-- create unique filename
30:   $flNme = '\/imgs\/user-imgs\/' . time() . $REMOTE_HOST . $ext;
31:   $FulflNme = $DOCUMENT_ROOT . $flNme
32:
33:   #-- check file is realy uploaded for security then copy to store
folder
34:   if (is_uploaded_file($HTTP_POST_FILES['uplfile'])) {

Thanks

Zac



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




[PHP] unexpected T_IF

2002-05-25 Thread Zac Hillier

Hmm, can anyone explain why I'm getting this error?

Parse error: parse error, unexpected T_IF in /usr/local/htdocs/san.loc/upload-img.php 
on line 34

Code reads:

11:#--if form submitted then process file upload
12:if($HTTP_POST_VARS['ttl']) {
13:
14: #--check if there is already a picture called this
15: include $DOCUMENT_ROOT . 'incs/db.php';
16: @mysql_select_db("infoNav") or die("unable to connect to table");
17: $qry = "SELECT ttl FROM imgLst WHERE site = $HTTP_SESSION_VARS[site_no] AND ttl = 
'$HTTP_POST_VARS[ttl]';";
18: $imgTst = MYSQL_QUERY($qry);
19: 
20: if(mysql_numrows($imgTst) < 1) {
21:
22:  #-- check file type 
23:  $ulf = $HTTP_POST_FILES['uplfile']['type'];
24:  if($ulf == 'image/pjpeg' || $ulf == 'image/gif') {
25: 
26:   #-- get ext
27:   ($ulf == 'image/pjpeg') ? $ext = '.jpg' : $ext = '.gif';
28: 
29:   #-- create unique filename
30:   $flNme = '\/imgs\/user-imgs\/' . time() . $REMOTE_HOST . $ext;
31:   $FulflNme = $DOCUMENT_ROOT . $flNme
32:  
33:   #-- check file is realy uploaded for security then copy to store folder
34:   if (is_uploaded_file($HTTP_POST_FILES['uplfile'])) {

Thanks

Zac


Re: [PHP] IMPORTANT, wanna know about MY PROJECT SALE !!!

2002-05-25 Thread Liam MacKenzie

Amen


- Original Message -
From: "r" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 8:36 PM
Subject: Re: [PHP] IMPORTANT, wanna know about MY PROJECT SALE !!!


> I would really like to call you scum but I think  the scumy people of this
> world would object.
> This aint a auction or any type of selling market, try greatdomains.com or
> some such service,
> I'll bet your little ding a ling that what ever you have on your site can
be
> made in a few days by over 80% of the people who recieve this listor
got
> off the open source market,  so basically pal...shove it.
>
> Have a bad day,
> -Ryan
>
> > On Fri, 24 May 2002, Kamran Shakil wrote:
> > > I personally have got 10 big and small demanding , complete solution
> > > websites, in php , made with access database with odbc connection
> > > string..wanna sell them for adequate and handsome price ? wanna
know
> > > sites regarding sales and exchange of projects
> >
>
>
>
> --
> 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 script

2002-05-25 Thread r

 Hi Guys,

 I need a PHP script that will allow me to upload/download chmod files etc
on
 a remote server...
 I know there are loads of these scripts out there but being a newbie to PHP
 I really dont know which one is good...
 can you recomend any? coming from Java I love PHP so would appreciate if
you
 would recomend only a php script and not perl,servlet,asp etc.
 Another problem is my webserver is something like
 /wtn/cgi-bin/www/

 all cgi scripts will have to be put in the cgi-bin directory of course but
 must be called like this mysite.com/cgibin/script.pl

 the php script should allow me access to this directory too!

 ANY ideas or recomendations will be deeply appreciated esp from John
Holmes,
 Jason Wong, Miguel Cruz coz you guys are really brainy and have helped me
in
 the past so I know your advise is supurb.
 I would tip my hat to you, but dont wear one...;-)

 Cheers,
 -Ryan A.




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




Re: [PHP] IMPORTANT, wanna know about MY PROJECT SALE !!!

2002-05-25 Thread r

I would really like to call you scum but I think  the scumy people of this
world would object.
This aint a auction or any type of selling market, try greatdomains.com or
some such service,
I'll bet your little ding a ling that what ever you have on your site can be
made in a few days by over 80% of the people who recieve this listor got
off the open source market,  so basically pal...shove it.

Have a bad day,
-Ryan

> On Fri, 24 May 2002, Kamran Shakil wrote:
> > I personally have got 10 big and small demanding , complete solution
> > websites, in php , made with access database with odbc connection
> > string..wanna sell them for adequate and handsome price ? wanna know
> > sites regarding sales and exchange of projects
>



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




[PHP] PHP script

2002-05-25 Thread r

Hi Guys,

I need a PHP script that will allow me to upload/download chmod files etc on
a remote server...
I know there are loads of these scripts out there but being a newbie to PHP
I really dont know which one is good...
can you recomend any? coming from Java I love PHP so would appreciate if you
would recomend only a php script and not perl,servlet,asp etc.
Another problem is my webserver is something like
/wtn/cgi-bin/www/

all cgi scripts will have to be put in the cgi-bin directory of course but
must be called like this mysite.com/cgibin/script.pl

the php script should allow me access to this directory too!

ANY ideas or recomendations will be deeply appreciated esp from John Holmes,
Jason Wong, Miguel Cruz coz you guys are really brainy and have helped me in
the past so I know your advise is supurb.
I would tip my hat to you, but dont wear one...;-)

Cheers,
-Ryan A.



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




[PHP] Session question

2002-05-25 Thread Christian Ista

Hello,

I'm a newbie in PHP, I use a lot ColdFusion (at work).

With ColdFusion, it's very easy to create and use session variable. I do
something like that :
 and this variable can be use
everywhere.

Could you tell me how that's work in PHP. I saw in help file session.start.
But it's not very clear for me.

Thanks for your help,

Bye





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




Re: [PHP] Fwd: Popup window from form on php page

2002-05-25 Thread Miguel Cruz

On Fri, 24 May 2002, David Bourne wrote:
> The code (in Page1.php):
> 
> 
> 
> 
> 
> 
> seems to work with the OpenWindow function in a JS header.
> 
> Any obvious problems with this?

Seems pretty sensible.

miguel


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




Re: [PHP] How is SESSION_ID passed?

2002-05-25 Thread Miguel Cruz

On Fri, 24 May 2002, Alex Shi wrote:
> I have created several web sites using php. In all these sites
> session id is passed via cookie. However I noticed that some
> times it was passed by url. I am thinking that to pass session
> id by url will be safer than by cookie.

You are thinking incorrectly; there's no particular difference. It's 
prettier by cookie, but doesn't work for everyone, so it's easiest to just 
use the built-in transparent session ID functionality as described in the 
manual. Most people get cookies, and those for whom that doesn't work get 
GET args.

miguel


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




Re: [PHP] Is this doable?

2002-05-25 Thread Sandman

In article <002e01c20370$4ebee8f0$b402a8c0@mango>,
 [EMAIL PROTECTED] (John Holmes) wrote:

> Can PHP do that? Of course. Can it do it that easily right out of the
> box. No. Just like the RXML backend is already written that parses
>  into the appropriate number, the backend would
> have to be written for PHP to do the same thing. You'd have to write a
> template engine, basically, that'll look for special tags and do the
> appropriate PHP functions when it encounters them.
> 
> I think you'd be far better off learning PHP and just adapting an
> existing template engine to suit your needs. There are plenty of them
> out there. 

I have no problem with learning PHP, I like it alot. But in some instances, 
I like the RXML approcah better.

You talk about template engines, what are they and can you name some 
examples?

-- 
Sandman[.net]

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