Re: [PHP] hello to making the php pages

2004-01-20 Thread Dagfinn Reiersøl

echo "Welcome to my homepage Mom. See my brand new wife!":


You must echo out what happened to your old wife before you send new 
wife to the brower.
If he kept the old wife, he needs to talk to both wives. If not, 
replacing the colon with a semicolon might help.


I have problem with PHP Codes from above. Where to fix Codes?


Joe's garage and PHP service station.  They have specials on Friday's.

;)

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


[PHP] PHP5: XML to PDF with XSL

2004-01-20 Thread Aidan Lister
Is this possible?

I'm purely interested in PHP5 examples of transforming an XML file into PDF
using an XSL stylesheet.

Thanks.

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



[PHP] Re: Search Script????

2004-01-20 Thread Manuel Lemos
Hello,

On 01/20/2004 11:22 PM, Student wrote:
I have my web site with file extensions .php .php3 .html .htm .shtml  Now i
(am looking for a script or) would like to write a php script so that users
can search my web site for information Can anyone help me get started.
I want to include a search in my web site..
If you can install HTDig to index your site, you can use this class that 
will simplify your site interface to Htdig.

http://freshmeat.net/projects/htdiginterfacefromphp/

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Odd Code Error.

2004-01-20 Thread Jason Wong
On Wednesday 21 January 2004 12:27, Luke wrote:

> but i think mainly the usual rule, that if an apple and a banana are fruit,
> and a pear is the same as a banana, then a pear must be fruit too (AND I
> think im fruit loops)
>
> bah im goin bananas, its time to go to band practise anyways,

All non-GM oranges are orange ==> TRUE
All objects that are orange are oranges ==> FALSE

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Watch all-night Donna Reed reruns until your mind resembles oatmeal.
*/

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



Re: [PHP] Odd Code Error.

2004-01-20 Thread Luke
i think i got it now :)
i wont bother trying to explain my understanding, i think that will confuse
the matter hehe

but i think mainly the usual rule, that if an apple and a banana are fruit,
and a pear is the same as a banana, then a pear must be fruit too (AND I
think im fruit loops)

bah im goin bananas, its time to go to band practise anyways,

-- 
Luke

"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tue, 2004-01-20 at 23:00, Luke wrote:
> > ok, i read the section, but even so
> >
> > if $a == $b
> > and $a == $c
> > then $b should be equal to $c
>
> No this is not true, since types conversions can be different between a
> and b, a and c or between b and c. If you want the above logic to be
> true then you must use === for equality based on type also.
>
> > but php is saying otherwise?
>
> PHPis following the rules of type conversion which are not necessarily
> commutative (hope that's the right term).
>
> > this sounds confusing i want to try n get my head round it
> >
> > a string equals a integer of zero,
>
> A non-numeric string equals 0 by the rules of string to integer type
> conversion (that's not entirely true since I think the first numerical
> portion is the part converted as per atoi()).
>
> > and a string equals true, but the reason
>
> A non empty string equals true according to the rules of string to
> boolean type conversion, unless (I think) the string is '0'.
>
> > the bool doesnt equal the int is because when the string and int are
> > compared, the string is zero (because it has no numerical value)?
>
> You are talking about bool, string and int with respect to a bool-int
> equality check. This is confusing, only two values can be compared. From
> what hat did you pull the string?
>
> > did that make sense? am i right?
>
> You didn't make sense :)
>
> Cheers,
> Rob.
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'

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



Re: [PHP] Odd Code Error.

2004-01-20 Thread Robert Cummings
On Tue, 2004-01-20 at 23:00, Luke wrote:
> ok, i read the section, but even so
> 
> if $a == $b
> and $a == $c
> then $b should be equal to $c

No this is not true, since types conversions can be different between a
and b, a and c or between b and c. If you want the above logic to be
true then you must use === for equality based on type also.

> but php is saying otherwise?

PHPis following the rules of type conversion which are not necessarily
commutative (hope that's the right term).

> this sounds confusing i want to try n get my head round it
> 
> a string equals a integer of zero,

A non-numeric string equals 0 by the rules of string to integer type
conversion (that's not entirely true since I think the first numerical
portion is the part converted as per atoi()).

> and a string equals true, but the reason

A non empty string equals true according to the rules of string to
boolean type conversion, unless (I think) the string is '0'.

> the bool doesnt equal the int is because when the string and int are
> compared, the string is zero (because it has no numerical value)?

You are talking about bool, string and int with respect to a bool-int
equality check. This is confusing, only two values can be compared. From
what hat did you pull the string?

> did that make sense? am i right?

You didn't make sense :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Email results

2004-01-20 Thread Jason Wong
On Wednesday 21 January 2004 11:46, BigMark wrote:
> A: How can i send an email with the contents of a table

Assuming a database table:

1) query database
2) format results into a nice string
3) mail() it

> B: can it be sent automatically when a certain field has data.

Yes.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Blessed is he who expects no gratitude, for he shall not be disappointed.
-- W.C. Bennett
*/

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



Re: [PHP] Odd Code Error.

2004-01-20 Thread Luke
ok, i read the section, but even so

if $a == $b
and $a == $c
then $b should be equal to $c

but php is saying otherwise?

this sounds confusing i want to try n get my head round it

a string equals a integer of zero, and a string equals true, but the reason
the bool doesnt equal the int is because when the string and int are
compared, the string is zero (because it has no numerical value)?

did that make sense? am i right?

-- 
Luke

"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tue, 2004-01-20 at 22:39, Luke wrote:
> > yeah its strange,
> >
> > $test is equal to $test2,
> > $test is equal to $test3
> > but $test2 is not equal to $test3,
> >
> > $test = "string";
> > $test2 = true;
> > $test3 = 0;
> > if($test == $test2){
> >  echo "hi";
> > }
> >
>
> Looks fine to me...
>
> $test == $test2: $test is not an empty string and thus evaluates to
>  true.
>
> $test == $test3: $test is converted to an integer to compare against
>  $test3. Conversion of $test to integer results in 0,
>  which happens to be equal to $test3
>
> You should read the section on type juggling.
>
> http://ca2.php.net/language.types.type-juggling
>
> Cheers,
> Rob.
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'

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



[PHP] Email results

2004-01-20 Thread BigMark
A: How can i send an email with the contents of a table

B: can it be sent automatically when a certain field has data.

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



Re: [PHP] Odd Code Error.

2004-01-20 Thread Robert Cummings
On Tue, 2004-01-20 at 22:39, Luke wrote:
> yeah its strange,
> 
> $test is equal to $test2,
> $test is equal to $test3
> but $test2 is not equal to $test3,
> 
> $test = "string";
> $test2 = true;
> $test3 = 0;
> if($test == $test2){
>  echo "hi";
> }
> 

Looks fine to me...

$test == $test2: $test is not an empty string and thus evaluates to
 true.

$test == $test3: $test is converted to an integer to compare against
 $test3. Conversion of $test to integer results in 0,
 which happens to be equal to $test3

You should read the section on type juggling.

http://ca2.php.net/language.types.type-juggling

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Odd Code Error.

2004-01-20 Thread Luke
yeah its strange,

$test is equal to $test2,
$test is equal to $test3
but $test2 is not equal to $test3,

$test = "string";
$test2 = true;
$test3 = 0;
if($test == $test2){
 echo "hi";
}

somone tell me im wrong please? else thats seriously weird

-- 
Luke
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> i've never had a problem doing if ($var=="test") ??
>
> > I've come across this recently too. I think what's happening is that
> > PHP is converting "NFH" to an integer, which would be zero in this
> > case. Thus zero == zero is true...
> >
> > Try doing type checking too:
> > if ($EA === "NFH")
> >
> > Martin
> >

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



Re: [PHP] authentication problems!

2004-01-20 Thread Luke
Yeah, i think i mentioned the same thing(or was going to :/ )

you should be able to use the local filesystem, and reffer to it relatively!
and then you can stream it and you wont need any authentication, and noone
will be able to directly link to the file

-- 
Luke

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Wednesday 21 January 2004 05:49, Scott Taylor wrote:
>
> Please trim your posts!
>
> > Of course there is not problem if the user is entering the information
> > him or her self.  But just using this code:
> >
> > $file = 'http://miningstocks.com/protected/Dec03PostPress.pdf';
> >
> > //now view the PDF file
> > header("Content-Type: application/pdf");
> > header("Accept-Ranges: bytes");
> > header("Content-Length: ".filesize($file));
> > readfile($file);
> >
> > from a PHP page where no authentication has occured does not work at
all.
>
> Did you not read my reply to your previous thread about this? Use a local
> filesystem path to read the file.
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> "A dirty mind is a joy forever."
> -- Randy Kunkee
> */

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



[PHP] IRCG - php windows extension HELP!

2004-01-20 Thread Marc Greenstock
I'm trying to install IRCG as an extension to my Apache 2 PHP server running
on Windows XP. Trouble is IRCG for windows comes as a standalone package,
that doesn't seem to load in as an extension to php declaired in php.ini.

I've typed in all the extensions but i continue to get an error for each dll
that the module can not be found.

Has anyone installed IRCG as an extension for windows?

Marc

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



Re: [PHP] thumbnail

2004-01-20 Thread Chris Edwards
This works like a charm on JPG, haven't tried it on other files types. This
came from the www.php.net


function image_createThumb($src,$dest,$maxWidth,$maxHeight,$quality=100) {
   if (file_exists($src)  && isset($dest)) {
   // path info
   $destInfo  = pathInfo($dest);

   // image src size
   $srcSize  = getImageSize($src);

   // image dest size $destSize[0] = width, $destSize[1] = height
   $srcRatio  = $srcSize[0]/$srcSize[1]; // width/height ratio
   $destRatio = $maxWidth/$maxHeight;
   if ($destRatio > $srcRatio) {
   $destSize[1] = $maxHeight;
   $destSize[0] = $maxHeight*$srcRatio;
   }
   else {
   $destSize[0] = $maxWidth;
   $destSize[1] = $maxWidth/$srcRatio;
   }

   // path rectification
   if ($destInfo['extension'] == "gif") {
   $dest = substr_replace($dest, 'jpg', -3);
   }

   // true color image, with anti-aliasing
   $destImage = imageCreateTrueColor($destSize[0],$destSize[1]);

//CAE   imageAntiAlias($destImage,true);

   // src image
   switch ($srcSize[2]) {
   case 1: //GIF
   $srcImage = imageCreateFromGif($src);
   break;

   case 2: //JPEG
   $srcImage = imageCreateFromJpeg($src);
   break;

   case 3: //PNG
   $srcImage = imageCreateFromPng($src);
   break;

   default:
   return false;
   break;
   }

   // resampling
   imageCopyResampled($destImage, $srcImage, 0, 0, 0,
0,$destSize[0],$destSize[1],$srcSize[0],$srcSize[1]);

   // generating image
   switch ($srcSize[2]) {
   case 1:
   case 2:
   imageJpeg($destImage,$dest,$quality);
   break;

   case 3:
   imagePng($destImage,$dest);
   break;
   }
   return true;
   }
   else {
   return false;
   }
}
 Calling code

 if ($photosize >= 102400 ) {
$blReduce = true;
 }
 // reduce the size of a file down to 720x720 pixels at 80% quality
 if ($blReduce) {
image_createThumb($src,$src,720,720,80);
 }

//Create a thumbnail were the maximum width or height is 100 pixels at
100% quality
// $src is the full path/filename of the large jpg file
   //$desc is the full path/filename of the thumbnail to be created
image_createThumb($src,$dest,100,100,100);




- Original Message - 
From: "Matt Matijevich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 20, 2004 6:24 PM
Subject: Re: [PHP] thumbnail


> [snip]
> OK, but how? I already use GD, I need to now how to create a thumbnail,
>
> somebody now how to use the GD functions to create a thumbnail???
> [/snip]
>
> http://www.php.net/GD
>
> I think you want to look at:
> imagecopyresampled -- Copy and resize part of an image with resampling
> imagecopyresized -- Copy and resize part of an image
>
> or try this pear class  http://pear.php.net/package/Image_Transform
> like <[EMAIL PROTECTED]> suggested.
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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



Re: [PHP] Re: Flash-PHP Socket Connection

2004-01-20 Thread Miles Thompson
Use xmlReceiver to trigger the back end PHP script. Have that script 
generate XML which you parse in Flash. Plain text will work, but a single 
quotation mark in the text sends you off to never never land. Here's an 
example:

xmlReceiver.load( "http://"; + host + "feed_xml_article.php");

I know it's not a socket, but it's plenty fast.

Regards - Miles Thompson

PS What good would a socket to PHP do, anyway? (I probably just revealed my 
ignorance!) /mt

At 11:03 PM 1/20/2004 +0100, Eric Bolikowski wrote:
Hey Ben

I know it may sound nuts, but I really want to make a socket connection
between a Flash and a PHP file.
Normally I would simply read in a text file/read XML/send data with GET or
POST, but I'm looking for a socket connections of following reasons:
1) I want a fast connection
2) I'm looking at this as a challenge, because it doesn't seem like anyone
else has done this before
Eric

"Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What I mean is: you shouldn't need to use sockets to read in a file from
> Flash unless you're trying to do something more complicated, but from
> the way it sounds, you just want to pull data from MySQL with a PHP
> script and output it to Flash.  The PHP script could just echo plain
> text and Flash can read that in just fine without needing to connect via
> a socket.
> -Ben
>
> Ben Ramsey wrote:
>
> > Flash has the ability to read in text files, so you could use PHP to
> > output data in the correct format and use Flash to read the PHP script
> > like it reads a text file.  We did this in ASP once upon a time.
> >
> > Here's a tutorial about reading text files into Flash:
> > http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
> >
> > Also, from what I understand, Flash now has a great XML parser, so you
> > could use PHP to generate XML and Flash could read in the XML as
> > variables.  You might want to look into that, but I think it's only
> > available in the newest version.
> >
> > -Ben
> >
> >
> > Eric Bolikowski wrote:
> >
> >> Hi everybody
> >>
> >> I'm working on a site that will be based on Flash, PHP and MySQL. PHP
> >> will
> >> work as a middleware for Flash and MySQL.
> >>
> >> My problem is communication between Flash and PHP.
> >> I'm really out looking for using the socket functions in PHP and Flash
to
> >> make fast connection.
> >>
> >> I have googled for almost an hour now, and I can't seem to find any
> >> interesting. The only info I find, is about sending data between Flash
> >> and
> >> PHP with HTTP GET or HTTP POST.
> >>
> >> So if anybody has some general information on this or a link to a
> >> tutorial
> >> on the subject, I would like to get those resources.
> >>
> >> Thanks a lot
> >>
> >> Eric
--
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] Odd Code Error.

2004-01-20 Thread Tom Rogers
Hi,

Wednesday, January 21, 2004, 8:55:01 AM, you wrote:
JP> I am so frustrated at the moment with coding.  I had an odd error with
JP> some PHP coding.  And in the process I came across this error.

JP> Please try this out!! Because for me on my machine it does the first
JP> part of the if statement.  I can make a work around in my code to fix
JP> the error.  BUT I would rather know why this is evaluating incorrectly.

JP>  $EA = 0;

JP> if ($EA == "NFH")
JP> {
JP> echo "EA is Equal To NFH see $EA";
JP> }
JP> else
JP> {
JP> echo "EA is NOT EQUAL to NFH see $EA";
JP> }
?>>

JP> Thanks in advance.


JP> Jonathan Pitcher


Try swapping positions

if("NFH" == $EA)

-- 
regards,
Tom

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



[PHP] Re: Specifying file paths in Windows

2004-01-20 Thread Luke
try removing the dot and /

so

if (is_file("filedir/test.txt")) echo "Found it!";
else echo "Not found";

that should work on windows and unix platforms, i dont think windows likes
the single dot, but you can use relative referencing, by just using the
directory name.

-- 
Luke
"Todd Cary" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The \filedir is under the phpcode directory
>
> c:\webroot
>|
>|--\application
>   |
>   |--\php_code
>  |
>  |--\filedir
>
>
> Eric Bolikowski wrote:
>
> > "Todd Cary" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>I moved an application from Linux to my Client's NT system and is_file
> >>cannot file the file on the NT system.  My directory structure is as
> >>follows:
> >>
> >>c:\webroot
> >>   \application
> >> \php_code
> >>   \filedir
> >>
> >>The code is
> >>
> >
> > //two dots!
> >
> >>if (is_file("../filedir/test.txt")) echo "Found it!";
> >>else echo "Not found";
> >>
> >>This is working with Linux, but it does not work with NT.  Can someone
> >>tell me why it does not work?
> >>
> >>Todd

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



Re: [PHP] Search Script????

2004-01-20 Thread John Nichel
Student wrote:

I have my web site with file extensions .php .php3 .html .htm .shtml  Now i
(am looking for a script or) would like to write a php script so that users
can search my web site for information Can anyone help me get started.
I want to include a search in my web site..
Cross post bad.  Mean people come and bite off your kneecaps.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Search Script????

2004-01-20 Thread Student
I have my web site with file extensions .php .php3 .html .htm .shtml  Now i
(am looking for a script or) would like to write a php script so that users
can search my web site for information Can anyone help me get started.
I want to include a search in my web site..

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



Re: [PHP] hello to making the php pages

2004-01-20 Thread Raditha Dissanayake
Hi,
I think mr chris w parker you have not read the manual or the list 
newbie guide.

I couldn't resist either :-)

Chris W. Parker wrote:

hello you,

i am here to ask of help from the mailing list.

i have PHP Codes like this kind:

echo "Welcome to my homepage Mom. See my brand new wife!":

I have problem with PHP Codes from above. Where to fix Codes?





:P























Sorry I couldn't resist!!!

 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] hello to making the php pages

2004-01-20 Thread John Nichel
Chris W. Parker wrote:

hello you,
Hello me.

i am here to ask of help from the mailing list.
I think the mailing list is gone for the day.  Try back tomorrow.

i have PHP Codes like this kind:
What's PHP?

echo "Welcome to my homepage Mom. See my brand new wife!":
You must echo out what happened to your old wife before you send new 
wife to the brower.

I have problem with PHP Codes from above. Where to fix Codes?
Joe's garage and PHP service station.  They have specials on Friday's.

;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PHPSESSIONID altering each time the page is loaded in IE

2004-01-20 Thread Tarrant Costelloe
Nope, calling it once. For some odd reason as I have detailed here
http://bugs.php.net/bug.php?id=26950 IE is loosing all it's cookie data
on different clicks around the website. A piece at a time, however MOZ
and Opera are fine.

In Fellowship,
Tarrant 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 21 January 2004 00:22
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHPSESSIONID altering each time the page is loaded in
IE


> As the subject says, I posted this bug report on the official php bugs

> page http://bugs.php.net/bug.php?id=26950 and have now changed my 
> storing of user information to use cookies as such:
>
> setcookie("cookie_auth_memberID", $row['id'], time()+604800,'/'); 
> setcookie("cookie_auth_Username", $frmUsername, time()+604800,'/'); 
> setcookie("cookie_auth_Password", $frmPassword, time()+604800,'/'); 
> setcookie("cookie_auth_Group", $row['membergroup'], 
> time()+604800,'/');
>
> However anyway, on displaying my PHPSESSIONID in Internet Explorer 6, 
> I am now noticing that on the refresh of any page (by clicking on any 
> internal site link) the PHPSESSIONID is changing! This doesn't 
> happen in Mozilla or Opera, any ideas folks?
>

The only thing i have experienced is if you are calling session_start
twice ?



-- 
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] PHPSESSIONID altering each time the page is loaded in IE

2004-01-20 Thread daniel
> As the subject says, I posted this bug report on the official php bugs
> page http://bugs.php.net/bug.php?id=26950 and have now changed my
> storing of user information to use cookies as such:
>
> setcookie("cookie_auth_memberID", $row['id'], time()+604800,'/');
> setcookie("cookie_auth_Username", $frmUsername, time()+604800,'/');
> setcookie("cookie_auth_Password", $frmPassword, time()+604800,'/');
> setcookie("cookie_auth_Group", $row['membergroup'], time()+604800,'/');
>
> However anyway, on displaying my PHPSESSIONID in Internet Explorer 6, I
> am now noticing that on the refresh of any page (by clicking on any
> internal site link) the PHPSESSIONID is changing! This doesn't
> happen in Mozilla or Opera, any ideas folks?
>

The only thing i have experienced is if you are calling session_start
twice ?



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



[PHP] PHPSESSIONID altering each time the page is loaded in IE

2004-01-20 Thread Tarrant Costelloe
As the subject says, I posted this bug report on the official php bugs
page http://bugs.php.net/bug.php?id=26950 and have now changed my
storing of user information to use cookies as such:

setcookie("cookie_auth_memberID", $row['id'], time()+604800,'/');
setcookie("cookie_auth_Username", $frmUsername, time()+604800,'/');
setcookie("cookie_auth_Password", $frmPassword, time()+604800,'/');
setcookie("cookie_auth_Group", $row['membergroup'], time()+604800,'/');

However anyway, on displaying my PHPSESSIONID in Internet Explorer 6, I
am now noticing that on the refresh of any page (by clicking on any
internal site link) the PHPSESSIONID is changing! This doesn't
happen in Mozilla or Opera, any ideas folks?

Top of each page looks like such:

session_save_path("/home/tazonlin/webs/www.planet-tolkien.com/sessions")
; 
session_start();

Regards,
 
Tarrant Costelloe

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



Re: [PHP] Re: Flash-PHP Socket Connection

2004-01-20 Thread daniel
check out http://www.php.net/manual/en/ref.ircg.php

and

http://www.schumann.cx/ircg/


> I am doing the same thing at the moment,
>
> I'm building a Flash/PHP/MySQL chat system capable of handling over
> 1000 users online at one time.
>
> GET and POST just doesn't cut it, so I began to explore other avenues,
> and XML Socket's seem like the best and only option. But I expect to
> burn the midnight oil on this one.
>
> Marc
>
> "Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> I guess that's good enough reason for me.  As far as connecting with
>> sockets, though: you should connect from Flash to the PHP file, not
>> from PHP to the Flash file, I think.  And, in order to do that, you
>> would need to ask some people who specialize in Flash and
>> ActionScript, so the boards at Macromedia.com may be the best place to
>> ask.
>>
>> Then again, I could be absolutely wrong. ;-)
>>
>> -Ben
>>
>>
>> Eric Bolikowski wrote:
>>
>> > Hey Ben
>> >
>> > I know it may sound nuts, but I really want to make a socket
>> > connection between a Flash and a PHP file.
>> >
>> > Normally I would simply read in a text file/read XML/send data with
>> > GET
> or
>> > POST, but I'm looking for a socket connections of following reasons:
>> >
>> > 1) I want a fast connection
>> > 2) I'm looking at this as a challenge, because it doesn't seem like
> anyone
>> > else has done this before
>> >
>> > Eric
>> >
>> > "Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
>> > news:[EMAIL PROTECTED]
>> >
>> >>What I mean is: you shouldn't need to use sockets to read in a file
>> >>from Flash unless you're trying to do something more complicated,
>> >>but from the way it sounds, you just want to pull data from MySQL
>> >>with a PHP script and output it to Flash.  The PHP script could just
>> >>echo plain text and Flash can read that in just fine without needing
>> >>to connect via a socket.
>> >>-Ben
>> >>
>> >>Ben Ramsey wrote:
>> >>
>> >>
>> >>>Flash has the ability to read in text files, so you could use PHP
>> >>>to output data in the correct format and use Flash to read the PHP
>> >>>script like it reads a text file.  We did this in ASP once upon a
>> >>>time.
>> >>>
>> >>>Here's a tutorial about reading text files into Flash:
>> >>>http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
>> >>>
>> >>>Also, from what I understand, Flash now has a great XML parser, so
>> >>>you could use PHP to generate XML and Flash could read in the XML
>> >>>as variables.  You might want to look into that, but I think it's
>> >>>only available in the newest version.
>> >>>
>> >>>-Ben
>> >>>
>> >>>
>> >>>Eric Bolikowski wrote:
>> >>>
>> >>>
>> Hi everybody
>> 
>> I'm working on a site that will be based on Flash, PHP and MySQL.
>> PHP will
>> work as a middleware for Flash and MySQL.
>> 
>> My problem is communication between Flash and PHP.
>> I'm really out looking for using the socket functions in PHP and
>> Flash
>> >
>> > to
>> >
>> make fast connection.
>> 
>> I have googled for almost an hour now, and I can't seem to find
>> any interesting. The only info I find, is about sending data
>> between Flash and
>> PHP with HTTP GET or HTTP POST.
>> 
>> So if anybody has some general information on this or a link to a
>> tutorial
>> on the subject, I would like to get those resources.
>> 
>> Thanks a lot
>> 
>> Eric
>
> --
> 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: Flash-PHP Socket Connection

2004-01-20 Thread Marc Greenstock
I am doing the same thing at the moment,

I'm building a Flash/PHP/MySQL chat system capable of handling over 1000
users online at one time.

GET and POST just doesn't cut it, so I began to explore other avenues, and
XML Socket's seem like the best and only option. But I expect to burn the
midnight oil on this one.

Marc

"Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I guess that's good enough reason for me.  As far as connecting with
> sockets, though: you should connect from Flash to the PHP file, not from
> PHP to the Flash file, I think.  And, in order to do that, you would
> need to ask some people who specialize in Flash and ActionScript, so the
> boards at Macromedia.com may be the best place to ask.
>
> Then again, I could be absolutely wrong. ;-)
>
> -Ben
>
>
> Eric Bolikowski wrote:
>
> > Hey Ben
> >
> > I know it may sound nuts, but I really want to make a socket connection
> > between a Flash and a PHP file.
> >
> > Normally I would simply read in a text file/read XML/send data with GET
or
> > POST, but I'm looking for a socket connections of following reasons:
> >
> > 1) I want a fast connection
> > 2) I'm looking at this as a challenge, because it doesn't seem like
anyone
> > else has done this before
> >
> > Eric
> >
> > "Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>What I mean is: you shouldn't need to use sockets to read in a file from
> >>Flash unless you're trying to do something more complicated, but from
> >>the way it sounds, you just want to pull data from MySQL with a PHP
> >>script and output it to Flash.  The PHP script could just echo plain
> >>text and Flash can read that in just fine without needing to connect via
> >>a socket.
> >>-Ben
> >>
> >>Ben Ramsey wrote:
> >>
> >>
> >>>Flash has the ability to read in text files, so you could use PHP to
> >>>output data in the correct format and use Flash to read the PHP script
> >>>like it reads a text file.  We did this in ASP once upon a time.
> >>>
> >>>Here's a tutorial about reading text files into Flash:
> >>>http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
> >>>
> >>>Also, from what I understand, Flash now has a great XML parser, so you
> >>>could use PHP to generate XML and Flash could read in the XML as
> >>>variables.  You might want to look into that, but I think it's only
> >>>available in the newest version.
> >>>
> >>>-Ben
> >>>
> >>>
> >>>Eric Bolikowski wrote:
> >>>
> >>>
> Hi everybody
> 
> I'm working on a site that will be based on Flash, PHP and MySQL. PHP
> will
> work as a middleware for Flash and MySQL.
> 
> My problem is communication between Flash and PHP.
> I'm really out looking for using the socket functions in PHP and Flash
> >
> > to
> >
> make fast connection.
> 
> I have googled for almost an hour now, and I can't seem to find any
> interesting. The only info I find, is about sending data between Flash
> and
> PHP with HTTP GET or HTTP POST.
> 
> So if anybody has some general information on this or a link to a
> tutorial
> on the subject, I would like to get those resources.
> 
> Thanks a lot
> 
> Eric

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



Re: [PHP] "include" working....but confusion

2004-01-20 Thread Robert Cummings
On Tue, 2004-01-20 at 18:07, Justin French wrote:
> On Wednesday, January 21, 2004, at 05:11  AM, Ryan A wrote:
> 
> > Do I have to start and end the included files with?
> 
> Did you try it?  Then you'd have your answer :)
> 
> Did you read http://www.php.net/include/ ?  Because all the examples 
> show what you need to know too.
> 
> Read the manual, and TRY THINGS before posting :)

Just an FYI that doesn't appear to be covered in the docs, but for which
I received confirmation on the internals list a couple of months ago,
you don't need to have the closing tag ?> if your included file doesn't
need to exit PHP mode. This is an undocumented (I think it's still
undocumented) feature and can prevent the accidental inclusion of
whitespace that can bugger headers :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Re: Create PDF FIle

2004-01-20 Thread Todd Cary
I use the pdf class from

http://www.potentialtech.com

Todd

Mike Mapsnac wrote:
Hello

I want to create PDF file from PHP output. So instead of sending output 
to the browser, I need to insert PHP output  into PDF FILE. How that's 
can be done? Looking for some short example or some documentation.

Thanks

_
Let the new MSN Premium Internet Software make the most of your 
high-speed experience. 
http://join.msn.com/?pgmarket=en-us&page=byoa/prem&ST=1
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Odd Code Error.

2004-01-20 Thread daniel

>> Hmm after all this time, are you saying its best to use === instead of
>> == in any application ?
>
> I would recommend using it whenever you can. It may require a few extra
> lines of code here and there, but you know for sure what 'type' you are
> dealing with. This is especially good when dealing with user input.
>

Ok i might start, i learn something new even after 4 years. I use this for
comparisons too strcmp($this->password, $this->password2)

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



Re: [PHP] thumbnail

2004-01-20 Thread Matt Matijevich
[snip]
OK, but how? I already use GD, I need to now how to create a thumbnail,

somebody now how to use the GD functions to create a thumbnail???
[/snip]

http://www.php.net/GD 

I think you want to look at:
imagecopyresampled -- Copy and resize part of an image with resampling
imagecopyresized -- Copy and resize part of an image

or try this pear class  http://pear.php.net/package/Image_Transform 
like <[EMAIL PROTECTED]> suggested.

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



[PHP] Create PDF FIle

2004-01-20 Thread Mike Mapsnac
Hello

I want to create PDF file from PHP output. So instead of sending output to 
the browser, I need to insert PHP output  into PDF FILE. How that's can be 
done? Looking for some short example or some documentation.

Thanks

_
Let the new MSN Premium Internet Software make the most of your high-speed 
experience. http://join.msn.com/?pgmarket=en-us&page=byoa/prem&ST=1

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


[PHP] thumbnail???

2004-01-20 Thread Rafael Alex Cremer
OK, but how? I already use GD, I need to now how to create a thumbnail, 
somebody now how to use the GD functions to create a thumbnail???

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


Re: [PHP] Odd Code Error.

2004-01-20 Thread Brad Pauly
On Tue, 2004-01-20 at 16:13, [EMAIL PROTECTED] wrote:
> > Interesting. I wouldn't have expected that. However, that is how it
> > should work. Check out table K-2 on this page:
> >
> > http://us4.php.net/manual/en/types.comparisons.php
> >
> > '==' is a loose comparison. You can use '===' instead which will give
> > you the results you are looking for.
> >
> > if ($EA === "NFH")
> >
> 
> Hmm after all this time, are you saying its best to use === instead of ==
> in any application ?

I would recommend using it whenever you can. It may require a few extra
lines of code here and there, but you know for sure what 'type' you are
dealing with. This is especially good when dealing with user input.

- Brad

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



[PHP] Re: Now try this...

2004-01-20 Thread Todd Cary
Whooops...mis-sent!!

Todd Cary wrote:

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


[PHP] Re: Specifying file paths in Windows

2004-01-20 Thread Todd Cary
The \filedir is under the phpcode directory

c:\webroot
  |
  |--\application
 |
 |--\php_code
|
|--\filedir
Eric Bolikowski wrote:

"Todd Cary" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I moved an application from Linux to my Client's NT system and is_file
cannot file the file on the NT system.  My directory structure is as
follows:
c:\webroot
  \application
\php_code
  \filedir
The code is

//two dots!

if (is_file("../filedir/test.txt")) echo "Found it!";
else echo "Not found";
This is working with Linux, but it does not work with NT.  Can someone
tell me why it does not work?
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Now try this...

2004-01-20 Thread Todd Cary
../tiff/demo.tif

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


Re: [PHP] thumbnail

2004-01-20 Thread daniel
> [snip]
> How I can create thumbnail with php? using the GD libray?
> [/snip]
>
> yes.
>
> Also I hear imagemagick works well.
>

I included a imagemagick rotate feature into my photo gallery application
as gd just cant seem to do it well ??

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



Re: [PHP] thumbnail

2004-01-20 Thread daniel
> How I can create thumbnail with php? using the GD libray?

Of course u answered your own question,

http://us4.php.net/manual/en/function.imagecopyresampled.php

Make sure you have GD2 though you dont want crappy pixelated images.

If you want a class already made up check out
 http://pear.php.net/package/Image_Transform

i have done a custom class, which had to include a nconvert driver as there
is no farhn gd on a php3 server at work.

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



Re: [PHP] drop down list of years puzzles me

2004-01-20 Thread Justin French
On Wednesday, January 21, 2004, at 10:10  AM, Bill Green wrote:


This doesn't to create a drop down box of years:

$curr_year = intval(date('Y'));
$range = 10;
for ($y=$curr_year; $y < $range; $y++) {
 echo "".$y."\n";
}
Stop and read the for loop.  You're saying "starting with the current 
year, increment, as long as the range is less than *10*."

Unless you have a time machine, the year will always be greater than 
"10" :P

$y = intval(date('Y'));
$range = $y + 10;
for ($y < $range)
{
echo "{$y}\n";
$y++;
}
Justin French

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


Re: [PHP] Unsubscribe (mailign lsits in general) question...

2004-01-20 Thread Chris Shiflett
--- Justin French <[EMAIL PROTECTED]> wrote:
> as long as the laws themselves are based on common sense.

Maybe that works out in Australia, but we can't make such assumptions in
the US. :-)

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



Re: [PHP] thumbnail

2004-01-20 Thread Matt Matijevich
[snip]
How I can create thumbnail with php? using the GD libray?
[/snip]

yes. 

Also I hear imagemagick works well.

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



[PHP] thumbnail

2004-01-20 Thread Rafael Alex Cremer
How I can create thumbnail with php? using the GD libray?

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


Re: [PHP] Odd Code Error.

2004-01-20 Thread daniel

> Interesting. I wouldn't have expected that. However, that is how it
> should work. Check out table K-2 on this page:
>
> http://us4.php.net/manual/en/types.comparisons.php
>
> '==' is a loose comparison. You can use '===' instead which will give
> you the results you are looking for.
>
> if ($EA === "NFH")
>

Hmm after all this time, are you saying its best to use === instead of ==
in any application ?

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



[PHP] Re: drop down list of years puzzles me

2004-01-20 Thread Eric Bolikowski
This should help:

".$y."\n";
}

?>

What you forgot is that $range must be the current year plus how many loops
you want.

Eric

"Bill Green" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This works to create a drop down select box of numbers 1-12:
>
> for($i=1; $i < 13; $i++) {
> echo "".$i."\n";
> }
>
> This doesn't to create a drop down box of years:
>
> $curr_year = intval(date('Y'));
> $range = 10;
> for ($y=$curr_year; $y < $range; $y++) {
>  echo "".$y."\n";
> }
>
> When I check for errors:
> $curr_year = 2004
> $curr_year is an integer
> $range = 10
> $curr_year + $range = 2014
> $y = 2004
>
> But my select box is empty... as in:
> 
> 
>
> What is it that I don't understand?
>
> -- 
> Bill
> --

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



Re: [PHP] "include" working....but confusion

2004-01-20 Thread Justin French
On Wednesday, January 21, 2004, at 05:11  AM, Ryan A wrote:

Do I have to start and end the included files with?
Did you try it?  Then you'd have your answer :)

Did you read http://www.php.net/include/ ?  Because all the examples 
show what you need to know too.

Read the manual, and TRY THINGS before posting :)

Justin French

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


Re: [PHP] Odd Code Error.

2004-01-20 Thread Brad Pauly
On Tue, 2004-01-20 at 15:55, Jonathan Pitcher wrote:
> I am so frustrated at the moment with coding.  I had an odd error with 
> some PHP coding.  And in the process I came across this error.
> 
> Please try this out!! Because for me on my machine it does the first 
> part of the if statement.  I can make a work around in my code to fix 
> the error.  BUT I would rather know why this is evaluating incorrectly.
> 
>  
>   $EA = 0;
> 
>   if ($EA == "NFH")
>   {
>   echo "EA is Equal To NFH see $EA";
>   }
>   else
>   {
>   echo "EA is NOT EQUAL to NFH see $EA";
>   }
> ?>

Interesting. I wouldn't have expected that. However, that is how it
should work. Check out table K-2 on this page:

http://us4.php.net/manual/en/types.comparisons.php

'==' is a loose comparison. You can use '===' instead which will give
you the results you are looking for.

if ($EA === "NFH")

- Brad

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



Re: [PHP] drop down list of years puzzles me

2004-01-20 Thread Jason Wong
On Wednesday 21 January 2004 07:10, Bill Green wrote:
> for ($y=$curr_year; $y < $range; $y++) {
>  echo "".$y."\n";
> }
>
> When I check for errors:
> $curr_year = 2004
> $curr_year is an integer
> $range = 10
> $curr_year + $range = 2014
> $y = 2004

  $y < $range

Do the substitution and what do you get?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
"Nine years of ballet, asshole."
-- Shelly Long, to the bad guy after making a jump over a gorge that he
   couldn't quite, in "Outrageous Fortune"
*/

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



RE: [PHP] Odd Code Error.

2004-01-20 Thread daniel
i've never had a problem doing if ($var=="test") ??

> I've come across this recently too. I think what's happening is that
> PHP is converting "NFH" to an integer, which would be zero in this
> case. Thus zero == zero is true...
>
> Try doing type checking too:
>   if ($EA === "NFH")
>
> Martin
>

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



[PHP] Re: Specifying file paths in Windows

2004-01-20 Thread Eric Bolikowski

"Todd Cary" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I moved an application from Linux to my Client's NT system and is_file
> cannot file the file on the NT system.  My directory structure is as
> follows:
>
> c:\webroot
>\application
>  \php_code
>\filedir
>
> The code is
>
//two dots!
> if (is_file("../filedir/test.txt")) echo "Found it!";
> else echo "Not found";
>
> This is working with Linux, but it does not work with NT.  Can someone
> tell me why it does not work?
>
> Todd

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



[PHP] Re: Odd Code Error.

2004-01-20 Thread Eric Bolikowski
Extremely odd what's happening here :s

I just doesn't make sense why the if condition should do this...

Maybe you could search in the PHP Manual for more info on this.

However, i did one thing that made that not work.

EA is Equal To NFH see $EA";
}else{
echo "EA is NOT EQUAL to NFH see $EA";
}
?>

Here I use the strict comparison operator, and it writes out the last
sentence.

Very odd this code

Eric

"Jonathan Pitcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am so frustrated at the moment with coding.  I had an odd error with
> some PHP coding.  And in the process I came across this error.
>
> Please try this out!! Because for me on my machine it does the first
> part of the if statement.  I can make a work around in my code to fix
> the error.  BUT I would rather know why this is evaluating incorrectly.
>
> 
> $EA = 0;
>
> if ($EA == "NFH")
> {
> echo "EA is Equal To NFH see $EA";
> }
> else
> {
> echo "EA is NOT EQUAL to NFH see $EA";
> }
> ?>
>
> Thanks in advance.
>
>
> Jonathan Pitcher

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



[PHP] Specifying file paths in Windows

2004-01-20 Thread Todd Cary
I moved an application from Linux to my Client's NT system and is_file 
cannot file the file on the NT system.  My directory structure is as 
follows:

c:\webroot
  \application
\php_code
  \filedir
The code is

if (is_file("./filedir/test.txt")) echo "Found it!";
else echo "Not found";
This is working with Linux, but it does not work with NT.  Can someone 
tell me why it does not work?

Todd

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


RE: [PHP] Odd Code Error.

2004-01-20 Thread Martin Towell
I've come across this recently too. I think what's happening is that PHP is
converting "NFH" to an integer, which would be zero in this case. Thus zero
== zero is true...

Try doing type checking too:
if ($EA === "NFH")

Martin


> I am so frustrated at the moment with coding.  I had an odd 
> error with 
> some PHP coding.  And in the process I came across this error.
> 
> Please try this out!! Because for me on my machine it does the first 
> part of the if statement.  I can make a work around in my code to fix 
> the error.  BUT I would rather know why this is evaluating 
> incorrectly.
> 
>  
>   $EA = 0;
> 
>   if ($EA == "NFH")
>   {
>   echo "EA is Equal To NFH see $EA";
>   }
>   else
>   {
>   echo "EA is NOT EQUAL to NFH see $EA";
>   }
> ?>
> 
> Thanks in advance.
> 
> 
> Jonathan Pitcher

> 

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



Re: [PHP] Odd Code Error.

2004-01-20 Thread Jason Wong
On Wednesday 21 January 2004 06:55, Jonathan Pitcher wrote:

>   if ($EA == "NFH")

When comparing strings either use '===' or one of the string comparison 
functions.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The most difficult thing in the world is to know how to do a thing and to
watch someone else doing it wrong, without commenting.
-- T.H. White
*/

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



[PHP] drop down list of years puzzles me

2004-01-20 Thread Bill Green
This works to create a drop down select box of numbers 1-12:

for($i=1; $i < 13; $i++) {
echo "".$i."\n";
}

This doesn't to create a drop down box of years:

$curr_year = intval(date('Y'));
$range = 10;
for ($y=$curr_year; $y < $range; $y++) {
 echo "".$y."\n";
}

When I check for errors:
$curr_year = 2004
$curr_year is an integer
$range = 10
$curr_year + $range = 2014
$y = 2004

But my select box is empty... as in:



What is it that I don't understand?

-- 
Bill
--

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



Re: [PHP] Unsubscribe (mailign lsits in general) question...

2004-01-20 Thread Justin French
On Wednesday, January 21, 2004, at 01:11  AM, 
[EMAIL PROTECTED] wrote:

I've been told by my boss, that the law has changed in relation to 'Opt
out' options on mailing lists etc...
she tells me that I have to now change all my forms to conform.
She claims that now, each time the user must click the 'remain 
subscribed'
link, or we have to remove them from our mailing lists.
Thus changing opt out, to opt in, EACH TIME?
Is this true?
When do they have to click "stay subscribed" -- each time they log-in, 
or read an email, or what?

She seems quite sure.

We deal with both European and US clients (world wide to be honest, but
most other countries don'e care about this.. do they?)
Other countries don't care?  I most certainly do, and I'm from 
Australia.  I think you meant to ask "other countries don't have 
specific laws... do they?"

What you need is legal advice, not PHP advise.  As such, this is really 
off topic, and frankly, if you're willing to trust the legal advice you 
receive on a mailing list such as this, that's pretty scary :)

I will offer this piece of advice -- which is reasonably on-topic to 
application developers:  Use common sense and common courtesy when it 
comes to this sort of stuff.  Don't make it hard to unsubscribe, 
provide clear, simple instructions on how to unsubscribe on every 
email, remind them they signed up, remind them they can leave any time, 
and don't waste their time with worthless emails.  If you do all that, 
you're going to be in good shape for most incoming laws, as long as the 
laws themselves are based on common sense.

But don't take my advice as legal advice :)

Justin

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


Re: [PHP] php running as user apache

2004-01-20 Thread Nirnimesh

Yeah, I tried turning safe mode on, but I'm not able to accomplish
what I set forth to.
Suppose I want to upload files to a directory called "repository".
Now what should be the ownership and access permission of this directory
be such that:
1. php (running as user apache) is able to upload files, and store in
"repository"
2. no one, but this uploading script ( with uid == myuid ), is able to
write to this directory.

I'm able to get the php script to write to this directory only if
"repository" is world writable and it has ownership myuid:myuid.
But what good does this make anyway, for the directory is still
world-writable.

By the way, if this thing is really possible by turning safe-mode on,
why on earth is it turned off by default?

Nirnimesh.
IIIT-Hyd.


-
On Tue, 20 Jan 2004 11:45:52 -0500, Cpt John W. Holmes wrote:

> From: "Nirnimesh" <[EMAIL PROTECTED]>
> 
>> My question relates to using php for handling file uploads. Since php runs
>> as user apache, using it to manage file uploads means that I need to give
>> write permissions to the user apache, which is a near-to-nobody user, i.e.
>> 0+w permissions. Now does that not mean that anyone who can run a php
>> script on the server can write to my account?
> 
> Yep.
> 
>> Is there any configuration setting that I need to fix, for this seems to
>> me to be too trivial to be a bug, but still I know it can be used with
>> fatal effects.
> 
> Turn safe_mode on or put open_basedir (?) restrictions in effect. The manual
> will have more info.
> 
> ---John Holmes...

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



[PHP] Odd Code Error.

2004-01-20 Thread Jonathan Pitcher
I am so frustrated at the moment with coding.  I had an odd error with 
some PHP coding.  And in the process I came across this error.

Please try this out!! Because for me on my machine it does the first 
part of the if statement.  I can make a work around in my code to fix 
the error.  BUT I would rather know why this is evaluating incorrectly.



	$EA = 0;

if ($EA == "NFH")
{
echo "EA is Equal To NFH see $EA";
}
else
{
echo "EA is NOT EQUAL to NFH see $EA";
}
?>
Thanks in advance.

Jonathan Pitcher

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


RE: [PHP] Extended characters passed in URL

2004-01-20 Thread Jay Blanchard
[snip]
Hi people,
I've installed Apache2, php 3.0.17 on Windows 2000 machine.

Everything works fine except when I call my script with some extended
characters (from Central European charset - ones with diacritics which
should be encoded) in variable values in URL, I get "Internal Server
Error"
message. If there are no extended characters in URL, there's no problem.

Can't encode them, can't avoid them.

Any ideas?
[/snip]

Change to the POST method?

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



[PHP] Extended characters passed in URL

2004-01-20 Thread Alex
Hi people,
I've installed Apache2, php 3.0.17 on Windows 2000 machine.

Everything works fine except when I call my script with some extended
characters (from Central European charset - ones with diacritics which
should be encoded) in variable values in URL, I get "Internal Server Error"
message. If there are no extended characters in URL, there's no problem.

Can't encode them, can't avoid them.

Any ideas?

Thank you.

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



Re: [PHP] generate drop down list from DB and display info on new page base d on selection

2004-01-20 Thread Jason Wong
On Wednesday 21 January 2004 05:43, Montagna, Dan wrote:

> I'm new to php/mysql and have been looking for help on this for a little
> while.  I've searched around a bit but can't find anything close enough to
> what I'm talking about here.  I want to create a drop down list from a
> mysql db table (I know how to create and populate the table) that displays
> one field [community] .  Then I'd like to select the community, submit my
> selection and bring up a listing of projects for that community on a new
> page.  The concept to me doesn't seem that difficult and something like
> this must be posted somewhere...If anyone can either get me started or
> point me at an example it would be really helpful.  Thanks

   manual > Variables > Variables from outside PHP
&  manual > PHP and HTML

As for examples have you asked Google?

google > mysql php drop down list example

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Three minutes' thought would suffice to find this out; but thought is
irksome and three minutes is a long time.
-- A.E. Houseman
*/

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



Re: [PHP] info.php something missing (REMOTE_USER)

2004-01-20 Thread Jason Wong
On Wednesday 21 January 2004 05:51, Ian C roberts wrote:
> I have a problem with login fields.  Whenever I get to my horde/imp
> login screen php dumps into the username field,
>
>   

Have you tried asking on the horde/imp list? I'm sure they would be in a 
better position to help.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Some don't prefer the pursuit of happiness to the happiness of pursuit.
*/

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



Re: [PHP] authentication problems!

2004-01-20 Thread Jason Wong
On Wednesday 21 January 2004 05:49, Scott Taylor wrote:

Please trim your posts!

> Of course there is not problem if the user is entering the information
> him or her self.  But just using this code:
>
> $file = 'http://miningstocks.com/protected/Dec03PostPress.pdf';
>
> //now view the PDF file
> header("Content-Type: application/pdf");
> header("Accept-Ranges: bytes");
> header("Content-Length: ".filesize($file));
> readfile($file);
>
> from a PHP page where no authentication has occured does not work at all.

Did you not read my reply to your previous thread about this? Use a local 
filesystem path to read the file.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
"A dirty mind is a joy forever."
-- Randy Kunkee
*/

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



Re: [PHP] inserting info from a query string into sql

2004-01-20 Thread Jason Wong
On Wednesday 21 January 2004 05:29, mayo wrote:

[snip]

> However I can't seem to insert the query string variables into the sql.

[snip]

> What am I missing here?

1) Assign your query to a string (eg $query), and echo() it so you know what 
your query is.

2) Make good use of mysql_error().

Bonus tip: look up "variable scope" in the manual.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
DISCLAIMER:
Use of this advanced computing technology does not imply an endorsement
of Western industrial civilization.
*/

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



[PHP] Downloading Question

2004-01-20 Thread Rogelio J. Samour
OK, I'm at my wits' ends with this problem. I have a download page that 
sends the correct
headers to the browser and downloads a blob file from a MySQL table. 
Everything works
great on Mozilla, Netscape, and IE until I try to download a Zip file. 
What's puzzling is that
the SAME EXACT file works in Mozilla/Netscape but DOES NOT work on IE. 
Tha is, IE
somehow manages to corrupt the file when it moves it from the temp 
directory,
rendering the downloaded file obsolete and useless. Here is the code for 
the headers
I send:

[php]
 Header ("Pragma: public");
 Header ('Expires: '.gmdate("D, d M Y H:i:s \G\M\T", time() + 3600));
 Header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
 Header ("Cache-Control: no-store, max-age=0, no-cache, 
must-revalidate"); # HTTP/1.1
 Header ("Cache-Control: post-check=0, pre-check=0", false);
 Header ("Cache-control: private");
 Header ("Content-Type: $datatype" );
 Header ("Content-Length: " . $FileObj->size );
 Header ("Content-Disposition: attachment; filename=\"$filename\"");
?>[/php]

So any suggestions would be GREATLY appreciated!

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


[PHP] Re: Flash-PHP Socket Connection

2004-01-20 Thread Ben Ramsey
I guess that's good enough reason for me.  As far as connecting with 
sockets, though: you should connect from Flash to the PHP file, not from 
PHP to the Flash file, I think.  And, in order to do that, you would 
need to ask some people who specialize in Flash and ActionScript, so the 
boards at Macromedia.com may be the best place to ask.

Then again, I could be absolutely wrong. ;-)

-Ben

Eric Bolikowski wrote:

Hey Ben

I know it may sound nuts, but I really want to make a socket connection
between a Flash and a PHP file.
Normally I would simply read in a text file/read XML/send data with GET or
POST, but I'm looking for a socket connections of following reasons:
1) I want a fast connection
2) I'm looking at this as a challenge, because it doesn't seem like anyone
else has done this before
Eric

"Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
What I mean is: you shouldn't need to use sockets to read in a file from
Flash unless you're trying to do something more complicated, but from
the way it sounds, you just want to pull data from MySQL with a PHP
script and output it to Flash.  The PHP script could just echo plain
text and Flash can read that in just fine without needing to connect via
a socket.
-Ben
Ben Ramsey wrote:


Flash has the ability to read in text files, so you could use PHP to
output data in the correct format and use Flash to read the PHP script
like it reads a text file.  We did this in ASP once upon a time.
Here's a tutorial about reading text files into Flash:
http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
Also, from what I understand, Flash now has a great XML parser, so you
could use PHP to generate XML and Flash could read in the XML as
variables.  You might want to look into that, but I think it's only
available in the newest version.
-Ben

Eric Bolikowski wrote:


Hi everybody

I'm working on a site that will be based on Flash, PHP and MySQL. PHP
will
work as a middleware for Flash and MySQL.
My problem is communication between Flash and PHP.
I'm really out looking for using the socket functions in PHP and Flash
to

make fast connection.

I have googled for almost an hour now, and I can't seem to find any
interesting. The only info I find, is about sending data between Flash
and
PHP with HTTP GET or HTTP POST.
So if anybody has some general information on this or a link to a
tutorial
on the subject, I would like to get those resources.
Thanks a lot

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


[PHP] Re: Flash-PHP Socket Connection

2004-01-20 Thread Eric Bolikowski
Hey Ben

I know it may sound nuts, but I really want to make a socket connection
between a Flash and a PHP file.

Normally I would simply read in a text file/read XML/send data with GET or
POST, but I'm looking for a socket connections of following reasons:

1) I want a fast connection
2) I'm looking at this as a challenge, because it doesn't seem like anyone
else has done this before

Eric

"Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What I mean is: you shouldn't need to use sockets to read in a file from
> Flash unless you're trying to do something more complicated, but from
> the way it sounds, you just want to pull data from MySQL with a PHP
> script and output it to Flash.  The PHP script could just echo plain
> text and Flash can read that in just fine without needing to connect via
> a socket.
> -Ben
>
> Ben Ramsey wrote:
>
> > Flash has the ability to read in text files, so you could use PHP to
> > output data in the correct format and use Flash to read the PHP script
> > like it reads a text file.  We did this in ASP once upon a time.
> >
> > Here's a tutorial about reading text files into Flash:
> > http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
> >
> > Also, from what I understand, Flash now has a great XML parser, so you
> > could use PHP to generate XML and Flash could read in the XML as
> > variables.  You might want to look into that, but I think it's only
> > available in the newest version.
> >
> > -Ben
> >
> >
> > Eric Bolikowski wrote:
> >
> >> Hi everybody
> >>
> >> I'm working on a site that will be based on Flash, PHP and MySQL. PHP
> >> will
> >> work as a middleware for Flash and MySQL.
> >>
> >> My problem is communication between Flash and PHP.
> >> I'm really out looking for using the socket functions in PHP and Flash
to
> >> make fast connection.
> >>
> >> I have googled for almost an hour now, and I can't seem to find any
> >> interesting. The only info I find, is about sending data between Flash
> >> and
> >> PHP with HTTP GET or HTTP POST.
> >>
> >> So if anybody has some general information on this or a link to a
> >> tutorial
> >> on the subject, I would like to get those resources.
> >>
> >> Thanks a lot
> >>
> >> Eric

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



[PHP] info.php something missing (REMOTE_USER)

2004-01-20 Thread Ian C roberts
I have a problem with login fields.  Whenever I get to my horde/imp 
login screen php dumps into the username field,

	

I cannot seem to find an answer as how to prevent this.
I am using,
OS X 10.3
Apache 1.3.28
Horde 2.2.4
IMP 3.2.2
PHP 4.3.3 (with imap2002e)
Here is the config line I have to configure php,
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var 
--mandir=/usr/share/man --with-apxs=/usr/sbin/apxs --with-zlib=/usr 
--enable-ftp --with-mcrypt=/sw --with-xml --with-gettext=/sw 
--with-imap=/usr/lib --with-imap-ssl=/sw/lib --with-mysql 
--with-mysql-sock=/tmp/mysql.sock

I have to adjust the dns.c file for bind 8 compat.

It compiled ok, everything works except for this problem that Im having.

I noticed that the REMOTE_USER is set to this value .  
This is located in my Environment bit of the info.php.  But on my home 
machine which is set up the same, I don't have a large Environment 
part.

I still have no idea how to solve this.  It has made it's mind up that 
I am called  ''.  I have tried to recompile php but to 
no avail.  is there a configuration in php.ini that I can set?

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


[PHP] Re: Flash-PHP Socket Connection

2004-01-20 Thread Ben Ramsey
What I mean is: you shouldn't need to use sockets to read in a file from 
Flash unless you're trying to do something more complicated, but from 
the way it sounds, you just want to pull data from MySQL with a PHP 
script and output it to Flash.  The PHP script could just echo plain 
text and Flash can read that in just fine without needing to connect via 
a socket.
-Ben

Ben Ramsey wrote:

Flash has the ability to read in text files, so you could use PHP to 
output data in the correct format and use Flash to read the PHP script 
like it reads a text file.  We did this in ASP once upon a time.

Here's a tutorial about reading text files into Flash:
http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
Also, from what I understand, Flash now has a great XML parser, so you 
could use PHP to generate XML and Flash could read in the XML as 
variables.  You might want to look into that, but I think it's only 
available in the newest version.

-Ben

Eric Bolikowski wrote:

Hi everybody

I'm working on a site that will be based on Flash, PHP and MySQL. PHP 
will
work as a middleware for Flash and MySQL.

My problem is communication between Flash and PHP.
I'm really out looking for using the socket functions in PHP and Flash to
make fast connection.
I have googled for almost an hour now, and I can't seem to find any
interesting. The only info I find, is about sending data between Flash 
and
PHP with HTTP GET or HTTP POST.

So if anybody has some general information on this or a link to a 
tutorial
on the subject, I would like to get those resources.

Thanks a lot

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


Re: [PHP] authentication problems!

2004-01-20 Thread Scott Taylor


by "using HTML" I meant, typing the address in to the broswer as 
http://username:[EMAIL PROTECTED]/protected/file.pdf or as using the 
HTML: http://username:[EMAIL PROTECTED]/protected/file.pdf">Link... 
or using the header:  header("Location: 
http://username:[EMAIL PROTECTED]/protected/file.pdf");

>also, there is no problem retrieving a pdf after passing http basic 
authentication (I just double checked this on a client's site and was 
appropriately prompted with a pdf handling dialog box after I 
authenticated).

Of course there is not problem if the user is entering the information 
him or her self.  But just using this code:

   $file = 'http://miningstocks.com/protected/Dec03PostPress.pdf';
  
   //now view the PDF file
   header("Content-Type: application/pdf");
   header("Accept-Ranges: bytes");
   header("Content-Length: ".filesize($file));
   readfile($file);   

from a PHP page where no authentication has occured does not work at all.

Let me say, if this is not clear, that I do not want unique usernames 
and passwords for users.  I want one username and password that WILL 
NEVER BE SEEN by the user. 

The way that I had planned was to keep ONE username and password which 
would allow access to all the files in a MySql database.  After the user 
entered his name and email address, the username and password would be 
fetched off the database, and then authentication would occur with this 
username and password and the user would be served the file.  The 
authentication would be completely transparent to the user.  But the 
different ways to authenticate transparent to the user either do not 
work or reveal the username and password (making it pointless to even 
protect the files in the first place).

Best Regards,

Scott Taylor



[EMAIL PROTECTED] wrote:

there are a couple of different ways to do this.

the "http basic" approach will work just fine.  with http basic the 
id/pw are passed in the headers in an encoded string, so i'm not 
certain about your:

 if using HTML, the username & password is easily seen

statement.

also, there is no problem retrieving a pdf after passing http basic 
authentication (I just double checked this on a client's site and was 
appropriately prompted with a pdf handling dialog box after I 
authenticated).

now, http basic assumes that the id/pw are in a file/database/etc. the 
password is generally encrypted (des or md5) but can be in clear text. 
so, for this to work, you'd probably need some type of registration 
page that will store the id/pw info that the apache server will query 
against. [i strongly recommend using a database, not a file, due to 
file locking issues.]

other approaches to this general issue include a URL mapping scheme. 
e.g., the public URL would drive the user through a one-time 
email/name collection process. when the user passes that they are 
served the document from the actual storage location. they can be done 
in a way that the true document URL is never shown.  obviously you'd 
have to do this in a way that would give the fake URL as a .pdf so 
that the client will handle things correctly.



-- Original Message --

From: Scott Taylor <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: Tuesday, January 20, 2004 03:17:21 PM -0500
Subject: [PHP] authentication problems!
I am about at my wits end trying to find a good solution to this
problem.  I've asked various portions of this question to this mail list
and still have not found exactly what it is I am looking for, but here
it goes.
I'm looking for a way to protect my files (this would be pdf files,
image files, etc...other things then text/php files) so that for someone
to see a current file they will have to enter in their email address and
name.  Seems fairly simple, and yet I can not figure out how to do it.
I've been told of the following alternatives:
Protect the files with HTTP auth (basic, or use SSL if very paranoid),
then, after entering the info into a database:
1. just link to http://username:[EMAIL PROTECTED]/protect/file.pdf
(either directly using html, or use headers).  The problem:  if using
HTML, the username & password is easily seen.  If using headers, this
does not work (it is not seen as a PDF file) - my best guess is that the
auth headers get passed along and so it does not work.  Of course, I can
load a PDF using headers if the file is not in a protected directory
without any problems at all.  But then again it wouldn't be protected to
begin with.
1.b. It was later suggested that I could link to
http://username:[EMAIL PROTECTED]/protect/file.pdf and use an apache
rewrite statement to change every protected file to exclude the username
& password. But I've posted to an apache group and they have said that
this CAN NOT be done.
2.  link to something outside of my httpdocs directory.  Unfortunately,
I am on a shared server and do not have a private folder (or at least my
_private directory which is 

[PHP] Re: Flash-PHP Socket Connection

2004-01-20 Thread Ben Ramsey
Flash has the ability to read in text files, so you could use PHP to 
output data in the correct format and use Flash to read the PHP script 
like it reads a text file.  We did this in ASP once upon a time.

Here's a tutorial about reading text files into Flash:
http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
Also, from what I understand, Flash now has a great XML parser, so you 
could use PHP to generate XML and Flash could read in the XML as 
variables.  You might want to look into that, but I think it's only 
available in the newest version.

-Ben

Eric Bolikowski wrote:
Hi everybody

I'm working on a site that will be based on Flash, PHP and MySQL. PHP will
work as a middleware for Flash and MySQL.
My problem is communication between Flash and PHP.
I'm really out looking for using the socket functions in PHP and Flash to
make fast connection.
I have googled for almost an hour now, and I can't seem to find any
interesting. The only info I find, is about sending data between Flash and
PHP with HTTP GET or HTTP POST.
So if anybody has some general information on this or a link to a tutorial
on the subject, I would like to get those resources.
Thanks a lot

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


Re: [PHP] What a difference a / makes!

2004-01-20 Thread Freedomware
Robert wrote:

I personally use print  " href=\"/css/continentcode/$myregion.css\" rel=\"stylesheet\" 
type=\"text/css\">" for things like that, no having to join the 
information together, the server does the work for me.
Thanks for the tip. (My errands were cancelled, so I'm still here!)

Isn't "print" a function used to make printable web pages? I'm not sure 
how to plug it in. Below is a snippet from my head section include:

if($includea1 == TRUE){
echo '';
}
echo '';

Would I change it to something like this?:

if($includea1 == TRUE){
echo '';
}
""

Someone else suggested that MySQL would be a big help with a project 
like this. I haven't touched that yet, but I'll have to get it connected 
to Dreamweaver and jump in.

Thanks!

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


[PHP] generate drop down list from DB and display info on new page base d on selection

2004-01-20 Thread Montagna, Dan
Hello,
 
I'm new to php/mysql and have been looking for help on this for a little
while.  I've searched around a bit but can't find anything close enough to
what I'm talking about here.  I want to create a drop down list from a mysql
db table (I know how to create and populate the table) that displays one
field [community] .  Then I'd like to select the community, submit my
selection and bring up a listing of projects for that community on a new
page.  The concept to me doesn't seem that difficult and something like this
must be posted somewhere...If anyone can either get me started or point me
at an example it would be really helpful.  Thanks
 
Dan


[PHP] Re: inserting info from a query string into sql

2004-01-20 Thread Eric Bolikowski
It doesn't seem that you have declared the vars $reorder and $order, so that
will make a bad query.

"Mayo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> PROBLEM
>
> I'm trying to insert information from a query string into sql.
>
> I have a table with content. The column headers have up and down arrows
> allowing the user to sort and order by that column.
>
> PHP
>
> I have default settings set for the variables.
> If I change the default values the SQL results changes. (good)
> I can get the query string variables outside the sql.
>
> 
>
> However I can't seem to insert the query string variables into the sql.
>
> 
> function whatever(){
>
> $username = "";
> ...
>
> // setting the default variables
>
> if(!isset($category)){$category="Something";}
> if(!isset($section)){$section="SomethingElse";}
>
> [EMAIL PROTECTED]($hostname,$username,$password);
> mysql_select_db($database);
> $selection = mysql_query("
> SELECT *
> FROM classes
> WHERE
> classCategory = '$category'
> ORDER BY $reorder $order
> ")
>
> ...
>
> ?>
>
> What am I missing here?
>
> thx,
>
> Gil

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



Re: [PHP] [Article] Writing Efficient PHP...

2004-01-20 Thread Luke
Well if you do want to read it, i logged in and uploaded the PDF versions of
the tutorial to my webserver, so take a look

PDF (A4) http://www.zeyus.com/phptutorial/wa-effphp-a4.pdf
PDF (Letter) http://www.zeyus.com/phptutorial/wa-effphp-ltr.pdf

Hope you find it useful!

Luke

"Chris W. Parker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Chris Shiflett 
on Tuesday, January 20, 2004 12:54 PM said:

> That was great. My favorite quotes from the article:
>
> "Register for this tutorial"

Bummer. I was looking forward to reading it.



Chris.

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



Re: [PHP] Flash-PHP Socket Connection

2004-01-20 Thread Eric Bolikowski
Hi Donald

Can i get a link to that site?

I'm just a little bit confused about this thing about socket communication.

Why is there not any resources on using Flash XMLSocket() and PHP
fsockopen() ?

There should be some kind of resource on this.
I have recently searched all over Macromedia, not finding anything there...

Eric

"Donald Tyler" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> We use XMLRPC to communicate between flash & PHP. I presume it can be
> coupled with sockets if you should need a permanent connection as well.
>
> It has worked perfectly for pretty much anything we throw at it (It allows
> you to send any PHP or Action script native data type, e.g. arrays,
> Booleans, integers etc. back and forth across the web)
>
> Obvious security implications about, so be very very careful with what you
> do with the data received. Trust no one! Not even your own Flash Client.
>
> -Original Message-
> From: Eric Bolikowski [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 20, 2004 3:26 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Flash-PHP Socket Connection
>
> Hi everybody
>
> I'm working on a site that will be based on Flash, PHP and MySQL. PHP will
> work as a middleware for Flash and MySQL.
>
> My problem is communication between Flash and PHP.
> I'm really out looking for using the socket functions in PHP and Flash to
> make fast connection.
>
> I have googled for almost an hour now, and I can't seem to find any
> interesting. The only info I find, is about sending data between Flash and
> PHP with HTTP GET or HTTP POST.
>
> So if anybody has some general information on this or a link to a tutorial
> on the subject, I would like to get those resources.
>
> Thanks a lot
>
> Eric
>
> -- 
> 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] inserting info from a query string into sql

2004-01-20 Thread mayo
PROBLEM

I'm trying to insert information from a query string into sql.

I have a table with content. The column headers have up and down arrows
allowing the user to sort and order by that column.

PHP

I have default settings set for the variables.
If I change the default values the SQL results changes. (good)
I can get the query string variables outside the sql.



However I can't seem to insert the query string variables into the sql.



What am I missing here?

thx,

Gil

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



FW: [PHP] Flash-PHP Socket Connection

2004-01-20 Thread Donald Tyler
We use XMLRPC to communicate between flash & PHP. I presume it can be
coupled with sockets if you should need a permanent connection as well.

It has worked perfectly for pretty much anything we throw at it (It allows
you to send any PHP or Action script native data type, e.g. arrays,
Booleans, integers etc. back and forth across the web)

Obvious security implications about, so be very very careful with what you
do with the data received. Trust no one! Not even your own Flash Client.

-Original Message-
From: Eric Bolikowski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 20, 2004 3:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Flash-PHP Socket Connection

Hi everybody

I'm working on a site that will be based on Flash, PHP and MySQL. PHP will
work as a middleware for Flash and MySQL.

My problem is communication between Flash and PHP.
I'm really out looking for using the socket functions in PHP and Flash to
make fast connection.

I have googled for almost an hour now, and I can't seem to find any
interesting. The only info I find, is about sending data between Flash and
PHP with HTTP GET or HTTP POST.

So if anybody has some general information on this or a link to a tutorial
on the subject, I would like to get those resources.

Thanks a lot

Eric

-- 
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] hello to making the php pages

2004-01-20 Thread Chris W. Parker
hello you,

i am here to ask of help from the mailing list.

i have PHP Codes like this kind:

echo "Welcome to my homepage Mom. See my brand new wife!":

I have problem with PHP Codes from above. Where to fix Codes?





:P
























Sorry I couldn't resist!!!

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



[PHP] Flash-PHP Socket Connection

2004-01-20 Thread Eric Bolikowski
Hi everybody

I'm working on a site that will be based on Flash, PHP and MySQL. PHP will
work as a middleware for Flash and MySQL.

My problem is communication between Flash and PHP.
I'm really out looking for using the socket functions in PHP and Flash to
make fast connection.

I have googled for almost an hour now, and I can't seem to find any
interesting. The only info I find, is about sending data between Flash and
PHP with HTTP GET or HTTP POST.

So if anybody has some general information on this or a link to a tutorial
on the subject, I would like to get those resources.

Thanks a lot

Eric

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



RE: [PHP] [Article] Writing Efficient PHP...

2004-01-20 Thread Chris W. Parker
Chris Shiflett 
on Tuesday, January 20, 2004 12:54 PM said:

> That was great. My favorite quotes from the article:
> 
> "Register for this tutorial"

Bummer. I was looking forward to reading it.



Chris.

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



Re: [PHP] What a difference a / makes!

2004-01-20 Thread robert
Look at the one for yt and one for Alaska.  If there is a difference in 
the code in 1 place that is probably why it IS working on the yt page.  
That's where I would start.  Then I would put in an alias in my web 
configuration to point css /home/web/css or whatever so that you can go :

echo '';

The thing you do need to check is your $continentcode especially, as 
that is the one that links between pages and the style sheet (unless I 
missed where it was assigned based on something else).  Also check to 
make sure you have ' appropriately.  I find an odd number of ' in your 
example and if you are not careful then you have cut off a piece of the 
echoed code.

That will cut down some on code as well as help with the figuring out of 
where the issue is.  I personally use print  " " for things like that, no having to join the 
information together, the server does the work for me.

Robert

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


Re: [PHP] [Article] Writing Efficient PHP...

2004-01-20 Thread Chris Shiflett
--- Ralph Guzman <[EMAIL PROTECTED]> wrote:
> http://www-106.ibm.com/developerworks/edu/wa-dw-waeffphp-i.html

That was great. My favorite quotes from the article:

"Register for this tutorial"

"You will need JavaScript enabled on your browser."

Actually, I'm sure it's a fine article, but I couldn't resist poking fun
at their lameness. :-)

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



[PHP] Online Testing package using PHP and MySQL

2004-01-20 Thread Pushpinder Singh
hello all,

   I am trying to develop an online testing module using PHp and MySQl 
on a Mac Platform. The module will need to have users authenticated 
before they can take the test. After that the system should take care 
of storing the scores of the users intp MySQL..Since I currently use 
Dreamweaver MX as the IDE, I decided to try out CourseBuilder, which is 
a built-in extension to Dreamweaver, Has anyone out there used other 
packages. I have used CourseBuilder, but it seems to me that 
CourseBuilder is linked to Pathware, which is a DB module (now owned by 
LOTUS i.e. IBM)

Thanks for your comments.

regards
Pushpinder
 
  

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


[PHP] authentication problems!

2004-01-20 Thread Scott Taylor
I am about at my wits end trying to find a good solution to this 
problem.  I've asked various portions of this question to this mail list 
and still have not found exactly what it is I am looking for, but here 
it goes.

I'm looking for a way to protect my files (this would be pdf files, 
image files, etc...other things then text/php files) so that for someone 
to see a current file they will have to enter in their email address and 
name.  Seems fairly simple, and yet I can not figure out how to do it.  
I've been told of the following alternatives:

Protect the files with HTTP auth (basic, or use SSL if very paranoid), 
then, after entering the info into a database:

1. just link to http://username:[EMAIL PROTECTED]/protect/file.pdf 
(either directly using html, or use headers).  The problem:  if using 
HTML, the username & password is easily seen.  If using headers, this 
does not work (it is not seen as a PDF file) - my best guess is that the 
auth headers get passed along and so it does not work.  Of course, I can 
load a PDF using headers if the file is not in a protected directory 
without any problems at all.  But then again it wouldn't be protected to 
begin with.

1.b. It was later suggested that I could link to 
http://username:[EMAIL PROTECTED]/protect/file.pdf and use an apache 
rewrite statement to change every protected file to exclude the username 
& password. But I've posted to an apache group and they have said that 
this CAN NOT be done.

2.  link to something outside of my httpdocs directory.  Unfortunately, 
I am on a shared server and do not have a private folder (or at least my 
_private directory which is contained with httpdocs will not work - I 
get the same problem that I do with authentication - it does not 
recognize the file as a PDF at all).

3.  use a prebuilt class (such as snoopy or Emanuel Lemos).  This looks 
as though it is the only option available to me at this time, but It 
doesn't look as though it as a good one as it will add a lot of code to 
something that seems as though it should be VERY simple, and it means 
that I will have to go through the documentation to use this.

If anyone has any ideas it will be much appreciated.

Scott Taylor

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


[PHP] [Article] Writing Efficient PHP...

2004-01-20 Thread Ralph Guzman
In the past I've read emails of people looking for php programming tips and
better practice advice. Here is a good article I came across on writing
efficient php code:

http://www-106.ibm.com/developerworks/edu/wa-dw-waeffphp-i.html

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



Re: [PHP] $_SESSION

2004-01-20 Thread John Nichel
Alex Hogan wrote:

I've got a question that I'm sure has a simple answer.

Why aren't my session objects transferring across more than one page?

I'm calling a session object that was set in the page prior;

$_SESSION['mysessionvar'] = $_REQUEST['mytxtobj'];

I then assign a variable that value;

$myvar = $_SESSION['mysessionvar'];

echo $myvar;

This displays like I expected.  However when I go to the next page and want
to display this var again I get either an Undefined index or variable.
According to the docs $_SESSION[] is now global and this is the way of
setting and retrieving session objects, right?
I have tried calling that session object again but it's empty and so is the
variable.  I thought that the session would stay open until I close the
browser and I could return those values any time I wanted.  Am I missing
something?
Are you starting the session on each page?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] "include" working....but confusion

2004-01-20 Thread John Nichel
Ryan A wrote:

Do I have to start and end the included files with?
Yes.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: connecting PHP to MS Access

2004-01-20 Thread Ben Ramsey
Sounds to me like you have everything pretty much figured out now, but 
no one has yet mentioned the ODBC functions built into PHP, so I thought 
 I'd throw that out as a way to actually connect to and retrieve data 
from a MS Access database.  Just set up a DSN and connect to it.

The ODBC function reference is at: http://us3.php.net/manual/en/ref.odbc.php

-Ben

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


[PHP] What a difference a / makes!

2004-01-20 Thread Freedomware
I have a relatively trivial problem that's driving me up a wall. I've 
tracked it down to a specific character - / - , and I still can't solve 
it! I think it's a relatively simple problem, though my explanation is a 
bit lengthy.

I'm working on a site with pages for each of the 50 states that uses PHP 
includes and echo statements. The problem seems to derive from one of 
four types off pages:

1. The head section on each main page
2. A single included page that's inserted in each head section
3. another included page (state/top) inserted in each page
4. A series of style sheets specific to state regions (north, south, etc.).
Below is a snippet of code from the page that's included in the head:

echo '';

In the main page, three echo values are used to form links to style sheets:

' . $periods . ' is replaced with ../../../../,
' . $continentcode . ' is replaced by na (for North America)
' . $mycode . ' is replaced by each state's postal code (ak, wa, etc.)
This is an example of a style sheet URL they form:



Below is a copy of a main page's head section, which ends with the include:




Below are the URLs of the head include, the top include I'll mention 
next, an example of a state page (Alaska) and an example of a regional 
style sheet (the North):

http://www.freedomware.us/includes/state/head.php
http://www.freedomware.us/includes/state/top.php
http://www.freedomware.us/world/na/us/ak/
http://www.freedomware.us/css/na/north.css
This is all the code from a top include. Just skim to the the lat few 
lines, where it says "banner":


$todayDate = date("m-d-Y");
echo 'Freedomware > World > ' . 
$mycontinent . '
   > ' . $mycountry . ' > 
' . $myname . '';
echo '
' . $myname . '

  ' . $mynickname . 
'
  
“There are two 
lasting bequests we can give our
  children: One is roots. The other is wings.”
Hodding Carter, 
Jr.
  
  ';
echo '';
echo ''
?>

"banner" is a layer (div) with an invisible spacer image. It is replaced 
by various background images defined by the regional style sheets.

Below is all the text from one regional style sheet, North:

/* CSS: Freedomware > CSS > NA > NORTH (The Far North) */

div#title { color: #009; }
#subak { background: #009; color: #ff0; }
td#tdcenter { background: #fff; }
h1 { background: #009; color: #fff; }
div#banak { background: url(../../../images/banners/na/ak.gif) no-repeat 
50% 0; }
div#bannt { background: url(../../../images/banners/na/nt.gif) no-repeat 
50% 0; }
div#bannu { background: url(../../../images/banners/na/nu.gif) no-repeat 
50% 0; }
div#banyt { background: url(../../images/banners/na/yt.gif) no-repeat 
50% 0; }
.subtitle { color: #009; border-top: 1px solid #009; border-bottom: 1px 
solid #009; }

Notice that this code from the top include:

echo '

id converted from id="ban" + $mycode to id="banak" (Alaska), id="banyt" 
(Yukon Territory), etc.

So here's the problem. The top banners don't show up on some pages 
unless I add the character / to the head section. An example is Alaska, 
which requires a / before "north":

$mycode = 'ak';
$mywebring = '/world/na/us/ak/';
$myregion = '/north';
But the head section for Yukon Territory works the way it's supposed to, 
with no / before north:

$mycode = 'yt';
$mywebring = '/world/na/us/ak/';
$myregion = 'north';
All three states linked to the Pacific Northwest top include won't work 
without the extra / - Washington, Oregon and the province of British 
Columbia, illustrated below:

$mycode = 'bc';
$mywebring = '/world/na/can/bc/';
$myregion = '/pnw';
Another weird example is Idaho, which appears to work as it should 
online, but I can't see the top banner on my local site unless I add the /.

Also, I don't necessarily have to add a / before the continent code; 
I've also fixed it by adding a / to the state postal code ("mycode").

I thought the problem could be traced to this snippet from my head 
include, specifically to the code between continent code and my region - 
'/'.

echo '';

That particular / should be included in every style sheet URL. By adding 
an extra url before "north" in Alaska's head section, my URL should wind 
up with two forward slashes - css/na//ak.css Yet I only see one when I 
view the source code.

Thanks in advance to any tips, as I may be gone for most of the day.

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


Re: [PHP] connecting PHP to MS Access

2004-01-20 Thread Tim Thorburn
Actually I found an even better program on mysql.com called MyDbConverter - 
converted the Access database into MySQL in a whole wopping second - now 
just needs a little cleanup and I can put it into the new table I've 
already created.

Thanks for all the help
-Tim
At 09:34 AM 1/20/2004, Brian V Bonini wrote:
On Mon, 2004-01-19 at 22:24, Tim Thorburn wrote:

> Now, the question is - how to connect PHP to MS Access?  I've done some
> searching on Google - most pages say "wow, good luck with that" or
> something similar - any thoughts?  I'm sure someone has had to do this
> before - am I on the right track or should I be looking elsewhere?
You can use MyODBC available at the MySQL site

--
BrianGnuPG -> KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys
  Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
GnuPG: http://gnupg.org
http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC
Linux Registered User #339825 at http://counter.li.org
--
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] URL translation like mod_rewrite

2004-01-20 Thread Chris Shiflett
--- Denzil Kruse <[EMAIL PROTECTED]> wrote:
> My hosting company won't let me use rewrite rules in my Apache
> configuration files, and told me to use "the php header() functions
> and a .htaccess file" instead of the rewrite rules.

[snip]

> What I want to do is have a visitor to my web site enter a userid
> after the domain name, and have apache or php grab the userid and
> send it to a script. Something like this:
>  
> http://domain.name/denny  => 
> http://domain.name/cgi-bin/script.cgi?userid=denny

I don't think you can do this without mod_rewrite, but you can do this:

http://example.org/name/denny =>
http://example.org/cgi-bin/script.cgi?userid=denny

Just make name a PHP script, and use the ForceType directive in your
.htaccess file:


 ForceType application/x-httpd-php


In this script (name), you can reference $_SERVER['PATH_INFO'] to get the
rest of the URL. Parse it, redirect the user, or do whatever you want from
there, although it's probably better to just serve the user's request
instead of forwarding to another URL.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



[PHP] URL translation like mod_rewrite

2004-01-20 Thread Denzil Kruse
Hi all,
 
My hosting company won't let me use rewrite rules in my Apache configuration files, 
and told me to use "the php header() functions and a .htaccess file" instead of the 
rewrite rules.  I don't know php and I'm looking over some php help files right now, 
but I found this list and was hoping someone can point me in the right direction.  Or 
tell me that this won't work.
 
What I want to do is have a visitor to my web site enter a userid after the domain 
name, and have apache or php grab the userid and send it to a script.  Something like 
this:
 
http://domain.name/denny  =>  http://domain.name/cgi-bin/script.cgi?userid=denny

Can this be done with php?  I already have another page with a login form that will 
send someone to the script.  For marketing reasons, I don't want login forms or other 
ways of getting them there.  I'm assuming the use of the .htaccess will involve the 
normal popup box asking for a userid/password.  Can that be avoided?

Thanks

Denzil


-
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes

RE: [PHP] $_SESSION

2004-01-20 Thread Ryan A
Hey,
Make sure its right on top of the pagejust at the start of your  Yeah..., I tried that.
> 
> I got back an error that read;
> Warning: session_start(): Cannot send session cookie - headers already
> sent
> by
> Warning: session_start(): Cannot send session cache limiter - headers
> already sent.
> 
> 
> 
> 
> > -Original Message-
> > From: Aaron Wolski [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, January 20, 2004 12:31 PM
> > To: 'Alex Hogan'; 'PHP General list'
> > Subject: RE: [PHP] $_SESSION
> >
> > You need to call session_start() on each page.
> >
> > > -Original Message-
> > > From: Alex Hogan [mailto:[EMAIL PROTECTED]
> > > Sent: January 20, 2004 1:29 PM
> > > To: PHP General list
> > > Subject: [PHP] $_SESSION
> > >
> > > I've got a question that I'm sure has a simple answer.
> > >
> > >
> > >
> > > Why
> aren't my session objects transferring across more than one page?
> > >
> > >
> > >
> > > I'm
> calling a session object that was set in the page prior;
> > >
> > > $_SESSION['mysessionvar'] = $_REQUEST['mytxtobj'];
> > >
> > >
> > >
> > > I then assign a variable that value;
> >

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



Re: [PHP] "include" working....but confusion

2004-01-20 Thread Ryan A
Hey,

> Now, that being said, there was a discussion on here a while ago that you
> don't _really_ have to close PHP mode at the end of your file and there
were
> certain pros and cons to doing so. Adapt to your needs.

Sounds like I missed a good discussion because I was awayany idea of
what
the thread name (or a part of it) was so I can catch up on it?

Cheers,
-Ryan

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



RE: [PHP] $_SESSION

2004-01-20 Thread Alex Hogan
Oopps, my bad. sorry.

That worked like a champ...

Thanks...,

I'll sulk off now...

> -Original Message-
> From: Aaron Wolski [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 20, 2004 12:46 PM
> To: 'Alex Hogan'; 'PHP General list'
> Subject: RE: [PHP] $_SESSION
> 
> You have to put it at the top of the page prior to anything else.
> 
>  
>   session_start();
> 
>   //proceed with other code
> 
> ?>
> 
> > -Original Message-
> > From: Alex Hogan [mailto:[EMAIL PROTECTED]
> > Sent: January 20, 2004 1:45 PM
> > To: 'PHP General list'
> > Subject: RE: [PHP] $_SESSION
> >
> >
> > Yeah..., I tried that.
> >
> > I got back an error that read;
> > Warning: session_start(): Cannot send session cookie - headers already
> > sent
> > by
> > Warning: session_start(): Cannot send session cache limiter - headers
> > already sent.
> >
> >
> >
> >
> > > -Original Message-
> > > From: Aaron Wolski [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, January 20, 2004 12:31 PM
> > > To: 'Alex Hogan'; 'PHP General list'
> > > Subject: RE: [PHP] $_SESSION
> > >
> > > You need to call session_start() on each page.
> > >
> > > > -Original Message-
> > > > From: Alex Hogan [mailto:[EMAIL PROTECTED]
> > > > Sent: January 20, 2004 1:29 PM
> > > > To: PHP General list
> > > > Subject: [PHP] $_SESSION
> > > >
> > > > I've got a question that I'm sure has a simple answer.
> > > >
> > > >
> > > >
> > > > Why aren't my session objects transferring across more than one
> page?
> > > >
> > > >
> > > >
> > > > I'm calling a session object that was set in the page prior;
> > > >
> > > > $_SESSION['mysessionvar'] = $_REQUEST['mytxtobj'];
> > > >
> > > >
> > > >
> > > > I then assign a variable that value;
> > > >
> > > > $myvar = $_SESSION['mysessionvar'];
> > > >
> > > >
> > > >
> > > > echo $myvar;
> > > >
> > > >
> > > >
> > > > This displays like I expected.  However when I go to the next page
> and
> > > > want
> > > > to display this var again I get either an Undefined index or
> variable.
> > > > According to the docs $_SESSION[] is now global and this is the
> way of
> > > > setting and retrieving session objects, right?
> > > >
> > > >
> > > >
> > > > I have tried calling that session object again but it's empty and
> so
> > > is
> > > > the
> > > > variable.  I thought that the session would stay open until I
> close
> > > the
> > > > browser and I could return those values any time I wanted.  Am I
> > > missing
> > > > something?
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > alex hogan
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > **
> > > > The contents of this e-mail and any files transmitted with it are
> > > > confidential and intended solely for the use of the individual or
> > > > entity to whom it is addressed.  The views stated herein do not
> > > > necessarily represent the view of the company.  If you are not the
> > > > intended recipient of this e-mail you may not copy, forward,
> > > > disclose, or otherwise use it or any part of it in any form
> > > > whatsoever.  If you have received this e-mail in error please
> > > > e-mail the sender.
> > > > **
> > > >
> >
> >
> >
> > **
> > The contents of this e-mail and any files transmitted with it are
> > confidential and intended solely for the use of the individual or
> > entity to whom it is addressed.  The views stated herein do not
> > necessarily represent the view of the company.  If you are not the
> > intended recipient of this e-mail you may not copy, forward,
> > disclose, or otherwise use it or any part of it in any form
> > whatsoever.  If you have received this e-mail in error please
> > e-mail the sender.
> > **
> >



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] $_SESSION

2004-01-20 Thread Ben Ramsey
Alex Hogan wrote:
I got back an error that read;
Warning: session_start(): Cannot send session cookie - headers already sent
by
Warning: session_start(): Cannot send session cache limiter - headers
already sent.
You need to use session_start() before any headers are written.
-Ben
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] $_SESSION

2004-01-20 Thread Aaron Wolski
You have to put it at the top of the page prior to anything else.



> -Original Message-
> From: Alex Hogan [mailto:[EMAIL PROTECTED]
> Sent: January 20, 2004 1:45 PM
> To: 'PHP General list'
> Subject: RE: [PHP] $_SESSION
> 
> 
> Yeah..., I tried that.
> 
> I got back an error that read;
> Warning: session_start(): Cannot send session cookie - headers already
> sent
> by
> Warning: session_start(): Cannot send session cache limiter - headers
> already sent.
> 
> 
> 
> 
> > -Original Message-
> > From: Aaron Wolski [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, January 20, 2004 12:31 PM
> > To: 'Alex Hogan'; 'PHP General list'
> > Subject: RE: [PHP] $_SESSION
> >
> > You need to call session_start() on each page.
> >
> > > -Original Message-
> > > From: Alex Hogan [mailto:[EMAIL PROTECTED]
> > > Sent: January 20, 2004 1:29 PM
> > > To: PHP General list
> > > Subject: [PHP] $_SESSION
> > >
> > > I've got a question that I'm sure has a simple answer.
> > >
> > >
> > >
> > > Why aren't my session objects transferring across more than one
page?
> > >
> > >
> > >
> > > I'm calling a session object that was set in the page prior;
> > >
> > > $_SESSION['mysessionvar'] = $_REQUEST['mytxtobj'];
> > >
> > >
> > >
> > > I then assign a variable that value;
> > >
> > > $myvar = $_SESSION['mysessionvar'];
> > >
> > >
> > >
> > > echo $myvar;
> > >
> > >
> > >
> > > This displays like I expected.  However when I go to the next page
and
> > > want
> > > to display this var again I get either an Undefined index or
variable.
> > > According to the docs $_SESSION[] is now global and this is the
way of
> > > setting and retrieving session objects, right?
> > >
> > >
> > >
> > > I have tried calling that session object again but it's empty and
so
> > is
> > > the
> > > variable.  I thought that the session would stay open until I
close
> > the
> > > browser and I could return those values any time I wanted.  Am I
> > missing
> > > something?
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > alex hogan
> > >
> > >
> > >
> > >
> > >
> > > **
> > > The contents of this e-mail and any files transmitted with it are
> > > confidential and intended solely for the use of the individual or
> > > entity to whom it is addressed.  The views stated herein do not
> > > necessarily represent the view of the company.  If you are not the
> > > intended recipient of this e-mail you may not copy, forward,
> > > disclose, or otherwise use it or any part of it in any form
> > > whatsoever.  If you have received this e-mail in error please
> > > e-mail the sender.
> > > **
> > >
> 
> 
> 
> **
> The contents of this e-mail and any files transmitted with it are
> confidential and intended solely for the use of the individual or
> entity to whom it is addressed.  The views stated herein do not
> necessarily represent the view of the company.  If you are not the
> intended recipient of this e-mail you may not copy, forward,
> disclose, or otherwise use it or any part of it in any form
> whatsoever.  If you have received this e-mail in error please
> e-mail the sender.
> **
> 

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



RE: [PHP] $_SESSION

2004-01-20 Thread Alex Hogan

Yeah..., I tried that.

I got back an error that read;
Warning: session_start(): Cannot send session cookie - headers already sent
by
Warning: session_start(): Cannot send session cache limiter - headers
already sent.




> -Original Message-
> From: Aaron Wolski [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 20, 2004 12:31 PM
> To: 'Alex Hogan'; 'PHP General list'
> Subject: RE: [PHP] $_SESSION
> 
> You need to call session_start() on each page.
> 
> > -Original Message-
> > From: Alex Hogan [mailto:[EMAIL PROTECTED]
> > Sent: January 20, 2004 1:29 PM
> > To: PHP General list
> > Subject: [PHP] $_SESSION
> >
> > I've got a question that I'm sure has a simple answer.
> >
> >
> >
> > Why aren't my session objects transferring across more than one page?
> >
> >
> >
> > I'm calling a session object that was set in the page prior;
> >
> > $_SESSION['mysessionvar'] = $_REQUEST['mytxtobj'];
> >
> >
> >
> > I then assign a variable that value;
> >
> > $myvar = $_SESSION['mysessionvar'];
> >
> >
> >
> > echo $myvar;
> >
> >
> >
> > This displays like I expected.  However when I go to the next page and
> > want
> > to display this var again I get either an Undefined index or variable.
> > According to the docs $_SESSION[] is now global and this is the way of
> > setting and retrieving session objects, right?
> >
> >
> >
> > I have tried calling that session object again but it's empty and so
> is
> > the
> > variable.  I thought that the session would stay open until I close
> the
> > browser and I could return those values any time I wanted.  Am I
> missing
> > something?
> >
> >
> >
> >
> >
> >
> >
> > alex hogan
> >
> >
> >
> >
> >
> > **
> > The contents of this e-mail and any files transmitted with it are
> > confidential and intended solely for the use of the individual or
> > entity to whom it is addressed.  The views stated herein do not
> > necessarily represent the view of the company.  If you are not the
> > intended recipient of this e-mail you may not copy, forward,
> > disclose, or otherwise use it or any part of it in any form
> > whatsoever.  If you have received this e-mail in error please
> > e-mail the sender.
> > **
> >



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] "include" working....but confusion

2004-01-20 Thread CPT John W. Holmes
From: "Ryan A" <[EMAIL PROTECTED]>

> Thanks for the very informative reply but I did try itproblem is, it
> seems to work with and without...thats why the confusion.
>
> I have one program like the one i outlined and the second one, like this:
>
> some html code goes here
> some output stuff goes here
> something 
> something something
> etc
>
> Which was working fine...
> thats why i got confused.

Okay... I guess I could see that. The include is going to start in HTML
mode. That's why the above works because you're starting with HTML. If the
include file is all PHP code, then the file is still going to start in HTML
mode, though. So you have to open PHP mode with http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Flash .swf outside webroot: width and height problems

2004-01-20 Thread craig
Thx for the fast response.
>
> Yes, I am doing that with the images... works fine. I also
> thought about
> using either an iframe or a div to control the size of the
> movie. It would
> have been nicer to be able to use a regular object tag, as it
> gives you more
> control over how the movie displayed.
>
> But I guess you can't write the tag and just do a  VALUE="show.php?id=xy" etc. and have the show.php output the header...
>
> May have to go for the div/iframe solution. If anyone can
> think of another
> way, I'd be happy to try it.

I have a couple of pages that are sprinkled with flash, this is how I
got it to
work (from the macromedia site)
-sorry for the bad word wrapping

http://download.macromedia.com/pub/shockwave/cabs/flash/swflas
h.cab#version=6,0,29,0" width="200" height="640">
   
   
   http://www.macromedia.com/go/getflashplayer";
type="application/x-shockwave-flash" width="200" height="640">


hope that helps,
Craig

> Thank you, John.
>
> toby
>
> - Original Message -
> From: "CPT John W. Holmes" <[EMAIL PROTECTED]>
> To: "Toby Irmer" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, January 20, 2004 7:12 PM
> Subject: Re: [PHP] Flash .swf outside webroot: width and
> height problems
>
>
> > From: "Toby Irmer" <[EMAIL PROTECTED]>
> >
> > > I am trying to display an .swf-file that is stored
> outside the webroot.
> > >
> > > Just sending the header and doing a readfile on the swf
> results in the
> swf
> > > being displayed with the maximum available width and height.
> > >
> > > Does anyone know a way of displaying Flash with its
> correct dimensions
> if
> > it
> > > is stored outside the webroot?
> >
> > Do you just have a "flash.php" file that sends the flash
> headers and data?
> > If so, then there's probably not a way just using that method.
> >
> > You can embed it within a HTML page, though, maybe inside a
> div to control
> > the size?
> >
> > 
> > 
> > 
> >
> > Obviously not the correct syntax b/c I don't know it, but
> you get the
> idea,
> > I hope... This is the same method you'd control the height
> and width of a
> > PHP generated image
> >
> > 
> >
> > ---John Holmes...
> >
> > --
> > 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



  1   2   >