[PHP] Re: recommend any good learning books

2002-06-24 Thread Jesper Brunholm

[EMAIL PROTECTED] wrote:
> I am coming over from Perl life.  Does anyone recommend any good beginners
> books on learning PHP?  I am looking for something similar too learning
> perl from Oreily.

I must confess that I do not know the O'reilly book you're talking 
about, but "PHP & MySQL development" from SAMS is a good book both as a 
reference, basic intro and has a lot of in-depth examples. Furthermore, 
it has a rather fine introduction to OO-programming in php

regards

Jesper Brunholm

-- 
Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk



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




Re: [PHP] Run two separate version of Apache and Php

2002-06-24 Thread Al Baker

I believe you will need to compile two versions, and point two to
different php.ini locations.

Here's a snipet from the manual.
http://www.php.net/manual/en/install.configure.php#install.configure.options.php

Al


--enable-maintainer-mode

Enable make rules and dependencies not useful (and sometimes confusing)
to the casual installer.
--with-config-file-path=PATH

Sets the path in which to look for php.ini, defaults to PREFIX/lib.
--enable-safe-mode

Enable safe mode by default.
--with-exec-dir[=DIR]

Only allow executables in DIR when in safe mode defaults to
/usr/local/php/bin.
--enable-magic-quotes

Enable magic quotes by default.
--disable-short-tags

Disable the short-form  Hello php-general,
> 
> I need to run a separate version of Apache on the same server I also
> what to use a different copy of the php.ini file with that version of
> apache. I am aware that I can override most of the php.ini settings in
> the httpd.conf file. But this is not what I want to do.
> Php will be running as a DSO with apache. So is the only way I can do
> this is to install a different copy of php to run with this version of
> Apache. Or is there a way I can get the httpd.conf file to read a
> different copy of php.ini
> 
> 
> 
> 
> -- 
> Best regards,
>  rdkurth  mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
This email was sent with Ximian Evolution.


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




[PHP] xslt_output_begintransform() - What Happend to it?

2002-06-24 Thread Nigel Liefrink

Couldn't help noticing with the upgrade to version 4.21 that this function
is no longer available,

I've looked around and not found much on the subject but so far I have
worked out that my code basically has to change from this...




   

  
  
Whole Site
  
  
  Product Code
  
  
Categories


UNPCSC


Manufacturer Name


Manufacturer Code

  
 

  


  




To this ...



$XMLText.="".(date('Y-m-d'))."";
$XMLText.="".unparsedXML($globalBuyerName)."";
  if($MainWindow != "No"){
$XMLText.="Whole SiteProduct CodeCategoriesUNPCSCManufacturer NameManufacturer Code";
$XMLText.="";
$XMLText.="";

$xh = xslt_create();
$result = xslt_process($xh, $XMLText, $xslfile, NULL, $arguments);
print $result;

I've been using 4.06 for a while and the code in the old way is much easier
to read (especially with a Color Coded Editor) and therefore much easier to
maintain and there is a lot of it..,

I've started changing the code to make it work, but the whole time I'm
feeling sorry for the Poor Tortured Soul who has to maintain it. and then it
hits me that the Poor T S will most probably be me.

Why did the xslt_output functions get removed? As far as I could tell they
worked just fine.
Am I approaching this change to the code from the wrong angle?
Is there a way to use XML and XSL in the way similar to the xslt_output
functions?
I was thinking of having files that could call the Old XML files and execute
the PHP inside them and return a string of executed phtml.
I think I could shell out to PHP.exe, but to me that doesn't seem very
efficient? as php is compiled into apache at the moment. Is there another
way to execute a PHP file called from within another PHP file and return the
output results as a String?

Any suggestions would be greatly appreciated.

By the way PHP is fantastic.
Keep up the Good Work.

Nigel
[EMAIL PROTECTED]




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




[PHP] getting the value of a javascript variable

2002-06-24 Thread Otteneder Hermann


hi everybody,

i have a short problem:
i have two drop down menues in a form. the content of the second dropdown is
dependent from the selection in the first dropdown menue. now i want write a
short javascript which runs on the onSelect - event of the first dropdown.
this script gives me the selected entry of the first dropdown menue. now i
have to give this value somehow into the PHP-environment for a DB-Query.
The feched data i want dynamically fill into the second dropdown. But how do
I get the value from the javascript variable into the php environment
without an submit of the form?? has enybody a solution for this?

thanx so far - hermann...




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




[PHP] URGENT!!! File Uplaod

2002-06-24 Thread César Aracena

Hi all.
 
Sorry for this, but a couple of hours ago (imagine… Monday at 3 in the
morning) one of my clients called and asked me to put a Photography
upload for each member of his business and the dead line is in 2 hours.
 
I’ve been messing around for the first time with file uploading, but it
seems I keep doing something wrong. I’m using:
 




Select Photography: 


 
but phpinfo tells me (Under HTTP_POST_FILES["userfile"]):
 
Array
(
[name] => picture.jpg
[type] => image/pjpeg
[tmp_name] => none
[size] => 0
)
 
Why is this??? Also, this is going to be the first time I deal with file
managing… so if you please throw some bones at me…
 
Thanks very3 much… I’m on dial-up but will stay connected though.
 
  Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621
 



[PHP] Re: getting the value of a javascript variable

2002-06-24 Thread BB

http://www.mattkruse.com/javascript/dynamicoptionlist/source.html

hope this helps

"Otteneder Hermann" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

hi everybody,

i have a short problem:
i have two drop down menues in a form. the content of the second dropdown is
dependent from the selection in the first dropdown menue. now i want write a
short javascript which runs on the onSelect - event of the first dropdown.
this script gives me the selected entry of the first dropdown menue. now i
have to give this value somehow into the PHP-environment for a DB-Query.
The feched data i want dynamically fill into the second dropdown. But how do
I get the value from the javascript variable into the php environment
without an submit of the form?? has enybody a solution for this?

thanx so far - hermann...






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




[PHP] Re: URGENT!!! File Uplaod

2002-06-24 Thread BB

http://www.php.net/manual/en/function.is-uploaded-file.php

"César aracena" <[EMAIL PROTECTED]> wrote in message
000901c21b5a$e1aea180$cdc405c8@gateway">news:000901c21b5a$e1aea180$cdc405c8@gateway...
Hi all.

Sorry for this, but a couple of hours ago (imagine. Monday at 3 in the
morning) one of my clients called and asked me to put a Photography
upload for each member of his business and the dead line is in 2 hours.

I've been messing around for the first time with file uploading, but it
seems I keep doing something wrong. I'm using:





Select Photography: 



but phpinfo tells me (Under HTTP_POST_FILES["userfile"]):

Array
(
[name] => picture.jpg
[type] => image/pjpeg
[tmp_name] => none
[size] => 0
)

Why is this??? Also, this is going to be the first time I deal with file
managing. so if you please throw some bones at me.

Thanks very3 much. I'm on dial-up but will stay connected though.

  Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621





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




Re: [PHP] URGENT!!! File Uplaod

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 16:40, César Aracena wrote:
> Hi all.
>
> Sorry for this, but a couple of hours ago (imagine… Monday at 3 in the
> morning) one of my clients called and asked me to put a Photography
> upload for each member of his business and the dead line is in 2 hours.
>
> I’ve been messing around for the first time with file uploading, but it
> seems I keep doing something wrong. I’m using:
>
>  enctype="multipart/form-data">
> 

1000 bytes seems to be a pretty low limit. Even thumbnails takes several KB. 
Try increasing it.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
What this country needs is a good five dollar plasma weapon.
*/


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




Re: [PHP] Remote cgi script function

2002-06-24 Thread Haddad Said

Thanks John,

See when i echo $contents, the page displayed contains backgrounds and other
text from the remote site, how can i crop only the returned query and
display it in a page with my backgrounds etc

thanks

"John Holmes" <[EMAIL PROTECTED]> wrote in message
000a01c21aef$f58fc0a0$b402a8c0@mango">news:000a01c21aef$f58fc0a0$b402a8c0@mango...
> > I am new to php, I would like to create a function that when called
> > sends text from a text box as a query to a remote cgi script ,e.g
> > http://www.anydomain.com/cgi-bin/script.cgi, and return the results as
> a
> >   variable so that i can echo the returned variable to an html page.
>
>  $contents = "";
> $text = "whatever...";
>
> $ftext = urlencode($text);
>
> $fp = fopen("http://www.example.com/cgi-bin/script.cgi?text="; . $ftext,
> "r");
>
> while($data = fread($fp,1000))
> { $contents .= $data; }
>
> fclose ($fd);
>
> ?>
>
> The response is now in $contents. Adapt to your needs.
>
> ---John Holmes...
>



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




RE: [PHP] Re: ARRAY, IF & INSERT

2002-06-24 Thread César Aracena

> the name <> 0 was a sql-query - it will return a ressource which will
> enable you to make something like
> 
> $i=0;
> while($row = mysql_fetch_assoc($nameless_result){
> 
> #psuedo-code#
> # mysql_query=("insert into table set relativenumber = 'jr$i' where
> ID=$row["ID"]");
> }

[César L. Aracena] I think you just showed me the smartest way of doing
it. After I deal with a deadline here, I will change my hard coded
script in order to try it... will let you know.

Thanks a lot.


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




[PHP] Removing Empty Lines from Text??

2002-06-24 Thread Jason Caldwell

Is there an elegant way to remove excess blank lines from my form data?

For example;  if someone enters the following text and then press' the
Submit button:


This is a some text


This is more text, and yet even more


What I want to do is remove the excess white space and make it look like
this?


This is a some text

This is more text, and yet even more


My users may press  too many times and I want to ensure clean text
and formatting.

Thanks.
Jason





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




Re: [PHP] Remote cgi script function

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 16:47, Haddad Said wrote:

> See when i echo $contents, the page displayed contains backgrounds and
> other text from the remote site, how can i crop only the returned query and
> display it in a page with my backgrounds etc

Short answer: with great difficulty.
Longer answer: use some form of regular expression to extract the bits that 
you need displayed.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
If parents would only realize how they bore their children.
-- G.B. Shaw
*/


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




[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread BB

$var = preg_replace("/\n*/","\n",$var);
"Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is there an elegant way to remove excess blank lines from my form data?
>
> For example;  if someone enters the following text and then press' the
> Submit button:
>
> 
> This is a some text
>
>
> This is more text, and yet even more
> 
>
> What I want to do is remove the excess white space and make it look like
> this?
>
> 
> This is a some text
>
> This is more text, and yet even more
> 
>
> My users may press  too many times and I want to ensure clean text
> and formatting.
>
> Thanks.
> Jason
>
>
>
>



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




RE: [PHP] URGENT!!! File Uplaod

2002-06-24 Thread César Aracena

You're completely right - as usual - now for the file handling... what's
better? Storing it to the DB or as file??

Thanks a lot.

> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 5:46 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] URGENT!!! File Uplaod
> 
> On Monday 24 June 2002 16:40, César Aracena wrote:
> > Hi all.
> >
> > Sorry for this, but a couple of hours ago (imagine… Monday at 3 in
the
> > morning) one of my clients called and asked me to put a Photography
> > upload for each member of his business and the dead line is in 2
hours.
> >
> > I’ve been messing around for the first time with file uploading, but
it
> > seems I keep doing something wrong. I’m using:
> >
> >  > enctype="multipart/form-data">
> > 
> 
> 1000 bytes seems to be a pretty low limit. Even thumbnails takes
several
> KB.
> Try increasing it.
> 
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development
*
> 
> /*
> What this country needs is a good five dollar plasma weapon.
> */
> 
> 
> --
> 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] copying the structure of a blank table in mysql

2002-06-24 Thread John Holmes

> Anyone have a link (or the code) to copy the structure of a blank
table
> to a new table using mysql?



Untested, add in some error checking and validate the $old and $new
names, and adapt to your needs...

---John Holmes...




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




[PHP] Re: === and @

2002-06-24 Thread BB

== compares 2 variables regardless of type ("1" == 1)
=== compares 2 variables with type in mind ("1" !== 1)
@ supresses errors in functions

"Phil Schwarzmann" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What exactly happens when you put three equal-signs together instead of
> just one or two?  I've seen this in other people's code, then search
> php.net and found nothing.
>
> Also, what happens when you put a @ thingy in front of a function?  Does
> it surpress the errors?
>
> Thanks!!
>



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




Re: [PHP] Removing Empty Lines from Text??

2002-06-24 Thread Justin French

Well, in short, you want to replace \n\n\n or \n\n\n\n with \n\n.

This can be done cleaverly with a regexp (not my expertise at all, but you
want to replace 3 or more occurences of \n in a row with \n\n.

Otherwise, a simple str_replace() will do it an okay job.

something like:



Untested of course.

Like I said, a regexp would be better here.


Justin French




on 24/06/02 6:51 PM, Jason Caldwell ([EMAIL PROTECTED]) wrote:

> Is there an elegant way to remove excess blank lines from my form data?
> 
> For example;  if someone enters the following text and then press' the
> Submit button:
> 
> 
> This is a some text
> 
> 
> This is more text, and yet even more
> 
> 
> What I want to do is remove the excess white space and make it look like
> this?
> 
> 
> This is a some text
> 
> This is more text, and yet even more
> 
> 
> My users may press  too many times and I want to ensure clean text
> and formatting.
> 
> Thanks.
> Jason
> 
> 
> 
> 


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




Re: [PHP] Using Oracle Data base store procedure (function, procedure, package)

2002-06-24 Thread Stuart Dallas

On Monday, June 24, 2002, 3:46:02 AM, "èdy kurniawan" wrote:
> The manual doesn't show how we can execute kind of oracle store procedure ..

I know nothing about using Oracle from PHP, but a quick search on Google
revealed the following: http://www.phpworld.com/manual/ref.oci8.html - example
2 shows how to call a stored procedure.

-- 
Stuart


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




[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread BB

replace that with
$var = preg_replace("/\n+/","\n",$var);

"Bb" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> $var = preg_replace("/\n*/","\n",$var);
> "Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Is there an elegant way to remove excess blank lines from my form data?
> >
> > For example;  if someone enters the following text and then press' the
> > Submit button:
> >
> > 
> > This is a some text
> >
> >
> > This is more text, and yet even more
> > 
> >
> > What I want to do is remove the excess white space and make it look like
> > this?
> >
> > 
> > This is a some text
> >
> > This is more text, and yet even more
> > 
> >
> > My users may press  too many times and I want to ensure clean
text
> > and formatting.
> >
> > Thanks.
> > Jason
> >
> >
> >
> >
>
>



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




Re: [PHP] rounding a number

2002-06-24 Thread George Whiffen

Jason Wong wrote:

> On Monday 24 June 2002 11:34, Phil Schwarzmann wrote:
> > I want to round a number to the nearest decimal place...
> >
> > if the number is 4.623, I want it to display 4.6
> > if the number is 2.36, I want it to display 2.7
>
> You don't really mean 2.36 --> 2.7 ??
>
> > Is there a function that does this?  round(), ceil(), floor() don't do
> > this and I've checked through all the math functions in my handy-dandy
> > "PHP Functions" reference book.
>
> round() seems to work. What's the problem you're having?
>

It's worth noting that round doesn't always work e.g.

try round(0.35,1)



>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> That's no moon...
> -- Obi-wan Kenobi
> */


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




[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread Jason Caldwell

neither worked.  any other suggestions?


"Bb" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> replace that with
> $var = preg_replace("/\n+/","\n",$var);
>
> "Bb" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > $var = preg_replace("/\n*/","\n",$var);
> > "Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Is there an elegant way to remove excess blank lines from my form
data?
> > >
> > > For example;  if someone enters the following text and then press' the
> > > Submit button:
> > >
> > > 
> > > This is a some text
> > >
> > >
> > > This is more text, and yet even more
> > > 
> > >
> > > What I want to do is remove the excess white space and make it look
like
> > > this?
> > >
> > > 
> > > This is a some text
> > >
> > > This is more text, and yet even more
> > > 
> > >
> > > My users may press  too many times and I want to ensure clean
> text
> > > and formatting.
> > >
> > > Thanks.
> > > Jason
> > >
> > >
> > >
> > >
> >
> >
>
>



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




[PHP] Re: rounding a number

2002-06-24 Thread George Whiffen

Phil Schwarzmann wrote:

> I want to round a number to the nearest decimal place...
>
> if the number is 4.623, I want it to display 4.6
> if the number is 2.36, I want it to display 2.7
>
> Is there a function that does this?  round(), ceil(), floor() don't do
> this and I've checked through all the math functions in my handy-dandy
> "PHP Functions" reference book.
>
> Thanks for your help!!!
>
> Or..if it's too hard to do that, I could just use a function that
> chops off the end of some decimals, like...
>
> if the number is 2.343234, I want just 2.3
> or if the number is 2.545434534534534534, I want just 2.5
>
> Thanks!!

As I understand it, you just want to truncate the number, without
rounding.

I think you are right, there isn't a function to do it for you but the
following code should do it:

intval(4.623 * 10)/10

or more generally:

function truncate_number($mynumber,$places) {

return intval($mynumber * pow(10,$places))/pow(10,$places);
}


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




RE: [PHP] URGENT!!! File Uplaod

2002-06-24 Thread John Holmes

> You're completely right - as usual - now for the file handling...
what's
> better? Storing it to the DB or as file??

File


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




[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread BB

$var = preg_replace("/[\r\n]+/","\n",$var);
"Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> neither worked.  any other suggestions?
>
>
> "Bb" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > replace that with
> > $var = preg_replace("/\n+/","\n",$var);
> >
> > "Bb" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > $var = preg_replace("/\n*/","\n",$var);
> > > "Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > Is there an elegant way to remove excess blank lines from my form
> data?
> > > >
> > > > For example;  if someone enters the following text and then press'
the
> > > > Submit button:
> > > >
> > > > 
> > > > This is a some text
> > > >
> > > >
> > > > This is more text, and yet even more
> > > > 
> > > >
> > > > What I want to do is remove the excess white space and make it look
> like
> > > > this?
> > > >
> > > > 
> > > > This is a some text
> > > >
> > > > This is more text, and yet even more
> > > > 
> > > >
> > > > My users may press  too many times and I want to ensure clean
> > text
> > > > and formatting.
> > > >
> > > > Thanks.
> > > > Jason
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



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




Re: [PHP] URGENT!!! File Uplaod

2002-06-24 Thread BB

It does depend on the usage, but general files are better

"John Holmes" <[EMAIL PROTECTED]> wrote in message
000a01c21b69$74acc170$b402a8c0@mango">news:000a01c21b69$74acc170$b402a8c0@mango...
> > You're completely right - as usual - now for the file handling...
> what's
> > better? Storing it to the DB or as file??
>
> File
>



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




[PHP] imagecopyresized() problems

2002-06-24 Thread Phil Ewington

Hi,

I am trying to copy and resize an image using imagecopyresized() and 
cannot seem to crack it. Below is the code I am using, can anyone tell 
me why I keep getting and invalid image resource warning and is this 
the src or dest parameter that the error is referring to?

$srcImageName = "../properties/$line[propid].jpg";
$destImageName = $rm_branchref . "_" . $line[propid] . ".jpg";
$destImage = imagecreate(275, 183);
imagecopyresized($destImage, $srcImageName, 0, 0, 0, 0, 275, 183, 
imagesx($srcImageName), imagesy($srcImageName));
imageJpeg($destImage, $destImageName, 75);
imagedestroy($destImage);

All that happens is that I get an identical copy of the image, and not 
a resized one.

TIA

Phil Ewington.

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




[PHP] php & JavaScript

2002-06-24 Thread Luis Miguel N. Tavora

Hi there.

I've tried to include a simple javascript in a .php file, 
but couldn't get it to work.

Actually not even the php code worked at all...

Is there any specific configuration flag that needs to be
set up in the Apache server so that the javascripts work
correctly? 

Thanks in advance

Luis

PS- Btw, I use an Apache server on a RH72 machine



--
   Luis Miguel N. Távora
   [EMAIL PROTECTED]   

  Message sent via Sylpheed
sylpheed-claws.sourceforge.net
--

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




[PHP] ftp class problem

2002-06-24 Thread Steve Edwards

i've written a class for connecting to an ftp server in 
passiv mode, sending a text file, sending one or 
more .mpegs and disconnecting.  

on my test box this script works fine (PHP 4.2.1) BUT 
on my live box (PHP 3.0.18) it fails...

On the live box (php 3.1.8) the script fails when i 
call the ftp passiv mode function  
(*  $conn_pasv = ftp_pasv($this->connection, 1);  *) 

If i comment out this line - the script connects ok but 
then fails when trying to do ftp_put().  

here's the connect method :

// open ftp connection 2 box and authenticate
function connect() {
  $this->connection =  ftp_connect($this->boxip);
  if (!$this->connection) { 
 $this->msgHandler('Could not connect to Box.',1); 
  } else {
 $this->login = ftp_login($this->connection, $this-
>boxuname, $this->boxpass);
   if (!$this->login) { $this->msgHandler('login',1); }
   $conn_pasv = ftp_pasv($this->connection, 1);
   $this->msgHandler('Connected to Set Top Box...',0); 
}
}


In the send method the ftp_put call looks like this -

$put = ftp_put($this->connection, $this->remfile,$this-
>localfile, FTP_BINARY);


Any ideas as to why this bunks in PHP 3?  I'm beginning 
to think upgrading PHP on the live server is the best 
thing to do... can anyone shed any light??

Thanks

sAluDoS

.  .  .  .  .  .
[EMAIL PROTECTED]
www.mediadome.net

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




RE: [PHP] Time Delay using phpscript

2002-06-24 Thread SP

Take a look at this page, it uses flush to stagger the results as php
processes it.  pretty cool

http://www.massassi.com/bTemplate/benchmarks/benchmark_var_assign.php?i=50



-Original Message-
From: Uma Shankari T. [mailto:[EMAIL PROTECTED]]
Sent: June 23, 2002 11:14 PM
To: PHP
Subject: [PHP] Time Delay using phpscript




Hello,

 Can anyone please clear my doubt

I need to display some strings one by one after some specific time..In
javascript we can use setTimeout() function.Is there any function like
this in phpscript ???..


Thanks & Regards
Uma


--
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] Sessions problem

2002-06-24 Thread Francesco Chicchiriccò

Hello people out there!

I've experienced a curly problem with Linux 2.4.16, Apache 1.3.9 & PHP
4.0.6 (Slackware 8). 

I use a session variable ($login) to manage the authentication to a web
administration interface: every page begins with a simple test which
checks if $login is stored in session. If not, it prompts an error
message.




Sometimes (I wasn't able to find out any reproducible condition) the
interface kicks off the user: the sessioned variable is lost.

The most amazing thing is that I got no problems with 4.0.3pl1 on Linux
2.4.18 (Debian potato).

Anyone of you can tell me the deeply hidden reasons?

Thanks.

-- 
###
dott. Francesco Chicchiriccò
AX Digital Systems
Via del mare 85/A 00040 Pomezia (RM)

E-mail  [EMAIL PROTECTED]
Phone   +39069180291
FAX +39069123658
Homehttp://chicchiricco.monrif.net
###


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




php-general Digest 24 Jun 2002 12:07:30 -0000 Issue 1424

2002-06-24 Thread php-general-digest-help


php-general Digest 24 Jun 2002 12:07:30 - Issue 1424

Topics (messages 103506 through 103570):

Using Oracle Data base store procedure (function, procedure, package)
103506 by: èdy kurniawan
103507 by: Peter
103512 by: èdy kurniawan
103513 by: Peter
103515 by: èdy kurniawan
103516 by: Peter
103539 by: Laurent Drouet
103557 by: Stuart Dallas

How to remove item from cart
103508 by: Vicki
103533 by: Analysis & Solutions

Limiting text inputs by character count?
103509 by: Andre Dubuc
103510 by: Martin Towell
103511 by: Peter
103514 by: Andre Dubuc
103522 by: John Holmes

=== and @
103517 by: Phil Schwarzmann
103518 by: Rasmus Lerdorf
103519 by: Justin French
103555 by: BB

Time Delay using phpscript
103520 by: Uma Shankari T.
103521 by: Martin Towell
103524 by: John Holmes
103525 by: Justin French
103569 by: SP

Re: about file permissions + cuteftp
103523 by: Police Trainee

copying the structure of a blank table in mysql
103526 by: Phil Schwarzmann
103535 by: Analysis & Solutions
103554 by: John Holmes

rounding a number
103527 by: Phil Schwarzmann
103528 by: Martin Towell
103529 by: Jason Soza
103530 by: Jason Wong
103559 by: George Whiffen
103560 by: George Whiffen
103562 by: George Whiffen

Re: netscape 4.x problem
103531 by: Analysis & Solutions

Re: php or mysql db update
103532 by: Analysis & Solutions

Re: UPDATE mysql
103534 by: David Robley
103537 by: Jason Wong

Run two separate version of Apache and Php
103536 by: rdkurth.starband.net
103541 by: Al Baker

Re: ARRAY, IF & INSERT
103538 by: Jesper Brunholm
103549 by: César Aracena

Re: recommend any good learning books
103540 by: Jesper Brunholm

xslt_output_begintransform() - What Happend to it?
103542 by: Nigel Liefrink

getting the value of a javascript variable
103543 by: Otteneder Hermann
103545 by: BB

URGENT!!! File Uplaod
103544 by: César Aracena
103546 by: BB
103547 by: Jason Wong
103553 by: César Aracena
103563 by: John Holmes
103565 by: BB

Re: Remote cgi script function
103548 by: Haddad Said
103551 by: Jason Wong

Removing Empty Lines from Text??
103550 by: Jason Caldwell
103552 by: BB
103556 by: Justin French
103558 by: BB
103561 by: Jason Caldwell
103564 by: BB

imagecopyresized() problems
103566 by: Phil Ewington

php & JavaScript
103567 by: Luis Miguel N. Tavora

ftp class problem
103568 by: Steve Edwards

Sessions problem
103570 by: Francesco Chicchiriccò

Administrivia:

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

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

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


--

--- Begin Message ---

Dear pals,

how can we execute  Oracle Data base store procedure (function, procedure,
package) and retrieve the result/s via PHP ?

any example ?

TIA,
edyk


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

by looking in the manual :) there is someinfo there..

-Original Message-
From: èdy kurniawan [mailto:[EMAIL PROTECTED]]
Sent: Monday, 24 June 2002 11:24 AM
To: php general
Subject: [PHP] Using Oracle Data base store procedure (function,
procedure, package)


Dear pals,

how can we execute  Oracle Data base store procedure (function, procedure,
package) and retrieve the result/s via PHP ?

any example ?

TIA,
edyk


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


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

very thanksful if you could refering to me what part (kinda) manual that
shows my case ?
i've ever read the PHP manual in english, but i can't find what i need.

please..

sincerely,
edyk


- Original Message -
From: "Peter" <[EMAIL PROTECTED]>
Subject: RE: [PHP] Using Oracle Data base store procedure (function,
procedure, package)


> by looking in the manual :) there is someinfo there..
>
> -Original Message-
> From: èdy kurniawan [mailto:[EMAIL PROTECTED]]
>
> Dear pals,
>
> how can we execute  Oracle Data base store procedure (function, procedure,
> package) and retrieve the result/s via PHP ?
>



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

have a look here ... this would be a good starting point...

http://www.php.net/manual/en/ref.oracle.php

I am sure this would be available in many other languages apart from just english :)


-Original Message-
From: èdy kurniawan [mailto:[EMAIL PROTECTED]]
Sent: Monday, 24 June 2002 12:20 PM
To: Peter; php 

Re: [PHP] Cc / Bcc don't work on win2k but on linux???

2002-06-24 Thread Christoph Grottolo

Sorry. The link below is broken. Try one of the mirrors on
www.phpclasses.org instead.

Christoph

Christoph Grottolo wrote:
> You could use the mail class by Manuel Lemos on php.upperdesign.com
> if you need cc/bcc and attachments. I've been using it for quite some
> time now with good results.
>
> Christoph



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




[PHP] Testing PHP on a local machine

2002-06-24 Thread Craig

I want to set up a site at home to play with php

I have windows xp pro, dreamweaver MX and mysql

Do I need anything to view live application data locally in my browser

eg a dynamic php website that is on my local machine that i can access and
update?

I hope this makes sense

Can anyone point me  into the right direction, relvant websires etc???


Thanks

Craig



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




[PHP] Re: php & JavaScript

2002-06-24 Thread BB

Javascript is client side and is not parsed by the server at all

If you are generating javascript with PHP, and it is in an external file, it
still needs a .php extension

Can you be more specific to the problem, paste some code?

"Luis Miguel N. Tavora" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there.
>
> I've tried to include a simple javascript in a .php file,
> but couldn't get it to work.
>
> Actually not even the php code worked at all...
>
> Is there any specific configuration flag that needs to be
> set up in the Apache server so that the javascripts work
> correctly?
>
> Thanks in advance
>
> Luis
>
> PS- Btw, I use an Apache server on a RH72 machine
>
>
>
> --
>Luis Miguel N. Távora
>[EMAIL PROTECTED]
>
>   Message sent via Sylpheed
> sylpheed-claws.sourceforge.net
> --



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




[PHP] PHP and COM

2002-06-24 Thread MindHunter

I am looking for more examples on PHP and COM.  I've got all the stuff from
the manual and the tutorials, but I want more.  Anyone that can help plz?

Tx
MH



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




Re: [PHP] Testing PHP on a local machine

2002-06-24 Thread Henry

Craig,

goto http://www.php.net/downloads.php and get the php exe installer
read this doc. http://in.geocities.com/samdarshipali/apache-php-mysql.htm

that should get you going.

cya
Henry


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




Re: [PHP] PHP 4.2

2002-06-24 Thread Erik Price


On Sunday, June 23, 2002, at 09:06  AM, Pekka Saarinen wrote:

> Most virtual server users have no means to set PHP.INI to their liking 
> so changes like that should be done in longer time span to let 
> developers update the software _before_ changes in PHP happen.

What about ini_set() ?

http://www.php.net/manual/en/function.ini-set.php






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Whos online at the moment in PHP

2002-06-24 Thread Erik Price


On Sunday, June 23, 2002, at 09:53  AM, Pag wrote:

>   Is it possible to code in PHP a small indicator on a site saying 
> how many people are viewing that page at the moment?
>   Sorry if its a silly question, but i am a newbie at PHP. If it is, 
> could you point me in the good direction? i mean, some function or 
> something.

Sorry, can't be done.  People aren't really "online" when they are using 
a web browser.  They request a page, and it gets sent to them, and the 
web server forgets about them.  Unless the web server logged their 
request, but then the web server has no way of knowing when the user 
"stops" looking at the page, so... you get the picture.

You'd have to write a Java applet or something that can maintain state.  
HTTP can't do this.  Unless you're really creative and you use 
JavaScript and sessions (and even then it won't be very reliable).


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] === and @

2002-06-24 Thread Erik Price


On Sunday, June 23, 2002, at 10:46  PM, Phil Schwarzmann wrote:

> What exactly happens when you put three equal-signs together instead of
> just one or two?  I've seen this in other people's code, then search
> php.net and found nothing.

PHP does dynamic typing.  So the following returns TRUE

if ("1" == 1)

even though the first value is a string and the second value is an 
integer.  You can force PHP to check for the same type by using three 
equal-signs, so that the above would return FALSE but either of the two 
below would return TRUE:

if ("1" === "1")
if (1 === 1)

> Also, what happens when you put a @ thingy in front of a function?  Does
> it surpress the errors?

Yes.



Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] extension problem

2002-06-24 Thread adelphp

hi all
i am working on php and i have problem with extensions. when I try to include a 
library , I am getting this message :
unable to load dynamic library c:\php\extentions\sablotron.dll - one of the library 
files needed to run this application cannot be found.
What should I do.
please help.
thanks



[PHP] extension problem

2002-06-24 Thread adelphp

hi all
i am working on php and i have problem with extensions. when I try to include a 
library , I am getting this message :
unable to load dynamic library c:\php\extentions\sablotron.dll - one of the library 
files needed to run this application cannot be found.
What should I do.
please help.
thanks



[PHP] extension problem

2002-06-24 Thread adelphp

hi all
i am working on php and i have problem with extensions. when I try to include a 
library , I am getting this message :
unable to load dynamic library c:\php\extentions\sablotron.dll - one of the library 
files needed to run this application cannot be found.
What should I do.
please help.
thanks



[PHP] extension problem

2002-06-24 Thread adelphp

hi all
i am working on php and i have problem with extensions. when I try to include a 
library , I am getting this message :
unable to load dynamic library c:\php\extentions\sablotron.dll - one of the library 
files needed to run this application cannot be found.
What should I do.
please help.
thanks



Re: [PHP] How to remove item from cart

2002-06-24 Thread Erik Price


On Sunday, June 23, 2002, at 09:30  PM, Vicki wrote:

> If you can suggest code that works, that would be great, or at least
> point me in the right direction if I'm on the wrong track with
> checkboxes. If you haven't noticed already, I'm very, very new to PHP
> and haven't quite got the hang of it yet. :=)

Someone else mentioned the "empty()" language construct.  Learn this and 
use it everywhere.  I find that it is probably one of my most-often used 
tricks to evaluate user input of any kind, especially checkboxes and 
radio buttons.  The reason why is because if you use "if 
($_POST['varname'])" or "if (isset($_POST['varname']))", you're testing 
to see if the variable was ever set.  With HTML forms, they may in fact 
have been set but have no values.  Using empty() will test to see if 
they evaluate to false (such as if they contain an empty string, which 
is what happens when someone submits a form but doesn't actually put 
some data into a certain input), and that is a reliable way to test for 
changes.

Also, I have a shopping-cart-like feature on my site.  I store my 
"purchased" objects in an array.  One thing that I learned the hard way 
is that if you use unset() to remove items from this array, you will end 
up with empty array elements.  If you need to re-order the array (to put 
the indexes into a sequential order once again), you can do something 
like this:

array_push($array, 'dummy_value');
unset($array[$index_to_unset]);
array_pop($array);

Because using array_pop() will re-index the array.  Much thanks to 
Nathan for that tip.


Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] Whos online at the moment in PHP

2002-06-24 Thread James E. Hicks III

Why not;

1. Record each visitors IP that connects and the connect time.
2. Delete from this table all records that are 5 mins old.
3. Count the remaining records as people currently viewing page.

James



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




[PHP] Re: getting the value of a javascript variable

2002-06-24 Thread George Whiffen

Otteneder Hermann wrote:

> hi everybody,
>
> i have a short problem:
> i have two drop down menues in a form. the content of the second dropdown is
> dependent from the selection in the first dropdown menue. now i want write a
> short javascript which runs on the onSelect - event of the first dropdown.
> this script gives me the selected entry of the first dropdown menue. now i
> have to give this value somehow into the PHP-environment for a DB-Query.
> The feched data i want dynamically fill into the second dropdown. But how do
> I get the value from the javascript variable into the php environment
> without an submit of the form?? has enybody a solution for this?
>
> thanx so far - hermann...

Ottneder,

You can't easily do what you want i.e. to have an html page in the user's
browser with Javascript which goes back to a php script on the server
after a user select in order to pick up the data for a new select list.

Normally when creating dynamic select lists, I actually get the php to
drop ALL the data in the top of the page as Javascript variables.  You
can see an example in the source of http://tandridge.cpfc.co.uk/tables.

I guess it is at least theoretically possible to do what you want by getting
your Javascript to open up a "hidden" background frame targetted at
a php script which then puts the data back into that frame so you can
then access it in the original frame.  It would be a bit complicated and
clumsy...

The third option is to have your select as a separate frame and do a submit
of just that part of the page.  This is the easiest to code but probably the most
clumsy from a graphics point of view.

How much data is involved? How many different versions of the select list
and how many options in each version?   If it's not too much, then I'd put it
all in the page as I do, as compactly as you can e.g. short variable names etc.

Hope this helps,

George



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




[PHP] real time php

2002-06-24 Thread adi

I have a program in php, with access at mysql database. 
The problem is, my users have to access Refresh button anytime when they want to see
real time values in database. 
How to make a function for refreshing values in php pages, without pressing Refresh 
button. What must i read?

Any help will be deeply apreciated
adi



Re: [PHP] Limiting text inputs by character count?

2002-06-24 Thread George Whiffen

John Holmes wrote:

> The best way to do this is server side with strlen(). You can use
> javascript or maxlength, but if a user wants to get around it, they can.
>
> ---John Holmes...
>

John,

The best way to do this is with both.  maxlength/Javascript as a courtesy,
 strlen for security.

As you say, you can NEVER rely on any kind of client-side check, all checks
must be done on the server side.  So, it's tempting to skip client-side checks,
but making the user wait for server side execution before any checks are done
is actually very rude.  Every time I see server-only checks for required fields etc.,
I switch off and lose confidence in the site.

George




>
> > -Original Message-
> > From: Martin Towell [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, June 23, 2002 9:47 PM
> > To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
> > Subject: RE: [PHP] Limiting text inputs by character count?
> >
> > a) maxlength="xx"
> > b) use javascript
> > (document.forms["frm_name"].elements["textarea"].value.length)
> >   (I think you need the ".value" bit)
> >
> >
> > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, June 24, 2002 11:53 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Limiting text inputs by character count?
> >
> >
> > Is there a way to limit the number of characters that may be inputed
> into:
> >   a) a  input
> >   b) a  input
> >
> > I would like to control the maximum number of characters for each of
> these
> > inputs.
> >
> > Any suggestions of where to look, or how to do it, if it's possible,
> would
> > be
> > greatly appreciated.
> >
> > Tia,
> > Andre
> >
> > --
> > 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: How to put a "new line" character with fputs($birthday_file, $content);

2002-06-24 Thread Tracker 1

Download unix2dos.exe (there is also a dos2unix.exe)
http://www.bastet.com/software/UDDU.ZIP

If you are running the php on *nix, and wanting to import the file
on excel, you will need it..

Another thing you can do, is create it in an html/table format


data1




this will be read fine by excel regardless of the end of line string.

--
===
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
===
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/


"Alfredo" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I am saving the result of a query on a text file.  Then I want to open it
> with excel.
>
> At the moment, when I open it with excel, all results appear in one very
> long line.  How could I insert a "new line" character at the end of each
> record?
>
> Thanks
>
> Alfredo
>
>



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




[PHP] Re: PHP and COM

2002-06-24 Thread BB

$DBCon = new COM("ADODB.Connection");
$DBCon->Open('PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=your.mdb');

Function CloseSQL() {
  global $DBCon;
  $DBCon->Close();
  $DBCon = "";
}

Function ExecSQL($SQL) {
  global $DBCon;
  $rs = @$DBCon->Execute($SQL);
  if (!$rs) {
Kill("Error in $SQL");
  } else {
return $rs;
  }
}


"Mindhunter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am looking for more examples on PHP and COM.  I've got all the stuff
from
> the manual and the tutorials, but I want more.  Anyone that can help plz?
>
> Tx
> MH
>
>



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




Re: [PHP] is there a function like javascript's window.open in PHP

2002-06-24 Thread Tracker 1

heh, my first thought was to suggest php-gtk   you are right, I
see this question on asp lists all the time.. :)

--
===
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
===
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/


"Mark Charette" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This is a common question, related to the lack of understanding of
> client/server architectures I believe.
>
> PHP is all server side - a browser is all client side.
>
> Servers can send data only to the browser, nothing else. The server can
> inquire and gather data from text files and databases, but it will format
> the data into a particular protocol (HTTP most often) and send it to the
> browser. The data may even include lines of text from a language that the
> browser understands, like JavaScript. Or it might be XML data and the
> corresponding XSLT instructions. But ... it can't affect the browser
> directly. Only the embedded instructions that the browser understands can
> actually affect anything on the browser.
>
> The browser looks at the stream of data provided by the server and decides
> on-the-fly what to do with it. If it sees JavaScript instructions, it may
> decide to interpret them and do some particular action. Or it may decide
> that it doesn't want to play with JavaScript today and just ignore them. It
> may see the XML/XSLT and decide to do something - but it doesn't have to.
> This, of couse, is the bane of Web programmers everywhere. What does the
> browser understand, and what does it do with the data.
>
> PHP allows us to write programs eaisy on the server to make some decisions
> on what to send a browser, but it cannot act directly on the browser. We
> must depend (somehow) on the browser interpreting what we tell it and then
> acting in a particular way.
>
> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, June 23, 2002 12:17 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] is there a function like javascript's window.open in
> PHP
>
>
> On Sunday 23 June 2002 07:21, Burak Delice wrote:
> > hi,
> >
> > I wonder that is there a PHP function like window.open() into Javascript?
>
> No.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> One thought driven home is better than three left on base.
> */
>
>
> --
> 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] real time php

2002-06-24 Thread Erik Price


On Monday, June 24, 2002, at 10:04  AM, adi wrote:

> How to make a function for refreshing values in php pages, without
> pressing Refresh button. What must i read?

There's a meta tag that will auto-refresh the page after a specified 
number of seconds.  That will work.  But you can't re-populate the data 
in the page using PHP.  Remember, PHP has generated an HTML document and 
sent it to the user's browser.  That is all.

If you are creative, you can use JavaScript to solve the problem, but it 
will require some kind of communication with the web server, and won't 
work if the user doesn't have the right implementation of JavaScript.  
That can be a headache.

or you can write a Java applet (actually for this kind of task I 
recommend this).


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] real time php

2002-06-24 Thread 1LT John W. Holmes

>I have a program in php, with access at mysql database.
>The problem is, my users have to access Refresh button anytime when they
want to see
>real time values in database.
>How to make a function for refreshing values in php pages, without pressing
Refresh button. What must i read?

PHP can't control the refreshing. It simply sends the data to the web
server, who sends it to the browser, and forgets about it. It's up to you to
provide some code that the browser can understand that'll make it request
the page again, automatically. Most situations like this are handled with a
META REFRESH tag in the header, to request the same page again after X
seconds...

---John Holmes...


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




[PHP] Re: cookies

2002-06-24 Thread Tracker 1

"Paul O'Neil" <[EMAIL PROTECTED]> wrote in message...
> If a browser has cookies blocked , anyone have code if unable to
> set cookie then goto another page.

at the top of a page.. psuedo code

if cookie['test'] exists...
if true //cool
else
if get['cookietest'] exists
cookietest failed, redirect
else
set test cookie, and redirect to self
with ?cookietest=true

this should work for you... :D

--
===
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
===
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/




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




Re: [PHP] Time Delay using phpscript

2002-06-24 Thread 1LT John W. Holmes

> Take a look at this page, it uses flush to stagger the results as php
> processes it.  pretty cool
>
> http://www.massassi.com/bTemplate/benchmarks/benchmark_var_assign.php?i=50

I'd be interested to hear from other people if that works in other browsers.
It had a nice effect when I looked at it in IE6.

Notice that the page is plain text, though. If you start adding in tables
and what not, then it's up to the web browser to decide when to render the
page. You'll notice that the one table that's on the page renders all at
once (in IE6 at least). Depends on the application whether this is useful or
not...

---John Holmes...


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




[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread Tracker 1

$strMine = preg.replace("/(\r\n|\r|\n)+/",$strMine,"\r\n\r\n");

or "\n\n" as the replace.. :)

I use the (\r\n|\r|\n) to match against windows, unix, & mac line
terminations...  I usually replace with the windows \r\n

--
===
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
===
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/


"Jason Caldwell" <[EMAIL PROTECTED]> wrote in message...
> Is there an elegant way to remove excess blank lines from my form data?
>
> For example;  if someone enters the following text and then press' the
> Submit button:
>
> 
> This is a some text
>
>
> This is more text, and yet even more
> 
>
> What I want to do is remove the excess white space and make it look like
> this?
>
> 
> This is a some text
>
> This is more text, and yet even more
> 
>
> My users may press  too many times and I want to ensure clean text
> and formatting.
>
> Thanks.
> Jason
>
>
>
>



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




[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread Tracker 1

would suggest "/(\r\n|\r|\n)+/" especially if the input is from a
browser that could be mac, or windows.. :)

--
===
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
===
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/


"Bb" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> $var = preg_replace("/\n*/","\n",$var);
> "Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Is there an elegant way to remove excess blank lines from my form data?
> >
> > For example;  if someone enters the following text and then press' the
> > Submit button:
> >
> > 
> > This is a some text
> >
> >
> > This is more text, and yet even more
> > 
> >
> > What I want to do is remove the excess white space and make it look like
> > this?
> >
> > 
> > This is a some text
> >
> > This is more text, and yet even more
> > 
> >
> > My users may press  too many times and I want to ensure clean text
> > and formatting.
> >
> > Thanks.
> > Jason
> >
> >
> >
> >
>
>



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




Re: [PHP] php & JavaScript

2002-06-24 Thread 1LT John W. Holmes

Can you please explain what you're doing more?

PHP and Javascript are completely different. PHP happens first, on the web
server, to create code to send to the browser. The browser then interprets
this code, executes any javascript, etc, and displays the page. You can't
have both at the same time. Each one can send information back to the other,
but it needs to happen with a page refresh...

Are you sure your server is even set up for PHP?

---John Holmes...

- Original Message -
From: "Luis Miguel N. Tavora" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 7:28 AM
Subject: [PHP] php & JavaScript


> Hi there.
>
> I've tried to include a simple javascript in a .php file,
> but couldn't get it to work.
>
> Actually not even the php code worked at all...
>
> Is there any specific configuration flag that needs to be
> set up in the Apache server so that the javascripts work
> correctly?
>
> Thanks in advance
>
> Luis
>
> PS- Btw, I use an Apache server on a RH72 machine
>
>
>
> --
>Luis Miguel N. Távora
>[EMAIL PROTECTED]
>
>   Message sent via Sylpheed
> sylpheed-claws.sourceforge.net
> --
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] gss_nt_service_name ?

2002-06-24 Thread General

I'm running this PHP 4.2.1 DSO compile on a Mandrake 8.2 PPC and have Apache 
1.3.23 Advanced Extranet server

When starting httpd I get this error ->
Executing: /etc/rc.d/init.d/httpd
starting httpd-perl:[ok]
starting httpd: Syntax error on line 74 of /etc/httpd/conf/httpd.conf
Cannot load /etc/httpd/apache/libphp4.so into 
server: /etc/httpd/apache/libphp4.so undefined symbol:gss_nt_service_name
[FAILED]
Does any one who might know I did wrong? or left out...

The configure, make, and make install went perfect.

I used these with my configure:
--with-imap-ssl=/usr/lib/
--with-imap=/usr/lib/
--with-mcal=/usr/libmcal
--with-apxs=/usr/sbin/apxs
--enable-xml
--enable-ftp
--with-pear=/usr/lib/php-4.2.1/pear/
--with-gettext=/bin/gettext
--with-config-file-path=/etc/php.ini

Thank You Very Much,
-Eric

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




[PHP] problem with PHP_SELF

2002-06-24 Thread DoL

Hi All

I would like to submit a form to call itself, and according to some
references I could use the $PHP_SELF variable in action attribute of the
form element in a HTML document
But it is not working for me, please help.

I have this line of code


in the html source page, I get


Can anyone advice what did I missed here?
Would this have anything to do with php or/and apache configuration?

Thanks

/dl





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




Re: [PHP] problem with PHP_SELF

2002-06-24 Thread Erik Price


On Monday, June 24, 2002, at 10:42  AM, DoL wrote:

> Can anyone advice what did I missed here?
> Would this have anything to do with php or/and apache configuration?

Is it possible that your php.ini file is configured for 
register_globals = off ?

If so, you should use:

$_SERVER['PHP_SELF'] instead of $PHP_SELF.






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] problem with PHP_SELF

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 22:42, DoL wrote:
> Hi All
>
> I would like to submit a form to call itself, and according to some
> references I could use the $PHP_SELF variable in action attribute of the
> form element in a HTML document
> But it is not working for me, please help.
>
> I have this line of code
> 
>
> in the html source page, I get
> 
>
> Can anyone advice what did I missed here?
> Would this have anything to do with php or/and apache configuration?

You're probably using a newer version of php (4.1.x+). If so, then you need to 
refer to $PHP_SELF as $_SERVER['PHP_SELF']. Read the release notes for your 
version of PHP or read the php.ini or RTFM for more details.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
There but for the grace of God, goes God.
-- Winston Churchill, speaking of Sir Stafford Cripps.
*/


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




Re: [PHP] PHP 4.2

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 21:29, Erik Price wrote:
> On Sunday, June 23, 2002, at 09:06  AM, Pekka Saarinen wrote:
> > Most virtual server users have no means to set PHP.INI to their liking
> > so changes like that should be done in longer time span to let
> > developers update the software _before_ changes in PHP happen.
>
> What about ini_set() ?

There are quite a few config settings which cannot be altered using ini_set(), 
register_globals being one of them, although that can be set using .htaccess 
files.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Real Users find the one combination of bizarre input values that shuts
down the system for days.
*/


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




[PHP] Command Line Execution

2002-06-24 Thread Bob Ahola

Within an executing script, what is the proper technique to determine the environment 
of execution... i.e., browser or command line?

Bob Ahola,
Atlanta



Re: [PHP] imagecopyresized() problems

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 18:57, Phil Ewington wrote:
> Hi,
>
> I am trying to copy and resize an image using imagecopyresized() and
> cannot seem to crack it. Below is the code I am using, can anyone tell
> me why I keep getting and invalid image resource warning and is this
> the src or dest parameter that the error is referring to?

Both.

> $srcImageName = "../properties/$line[propid].jpg";
> $destImageName = $rm_branchref . "_" . $line[propid] . ".jpg";
> $destImage = imagecreate(275, 183);
> imagecopyresized($destImage, $srcImageName, 0, 0, 0, 0, 275, 183,

int imagecopyresized (resource dst_im, resource src_im, ...)

You're giving it a filename and not an image resource.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Arguments are extremely vulgar, for everyone in good society holds exactly
the same opinion.
-- Oscar Wilde
*/


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




Re: [PHP] PHP 4.2

2002-06-24 Thread Erik Price


On Monday, June 24, 2002, at 10:55  AM, Jason Wong wrote:

> There are quite a few config settings which cannot be altered using 
> ini_set(),
> register_globals being one of them, although that can be set using 
> .htaccess
> files.

I see.  I must have misread this page:
http://www.php.net/manual/en/function.ini-set.php

The terms PHP_INI_SYSTEM and PHP_INI_ALL aren't totally clear in the 
right-hand column titled "changeable".



Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Auto logout?

2002-06-24 Thread Hawk

I have a login, and when users are logged on, it should show in some way on
the page, that's not the problem, it is to show that they are logged off
when they are, often people forget to press the logout button, and the mysql
database is unchanged, saying they are still logged on, how can I do so it
logs out when a user leaves the page, if the page is closed or something
like that, need suggestions, sorry for my currently bad english, but I'll
blame the heat ;)

Håkan



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




Re: [PHP] Removing Empty Lines from Text??

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 16:56, Justin French wrote:
> Well, in short, you want to replace \n\n\n or \n\n\n\n with \n\n.
>
> This can be done cleaverly with a regexp (not my expertise at all, but you
> want to replace 3 or more occurences of \n in a row with \n\n.

To add my tuppence's worth, I would search for and remove any white spaces 
between \n's as well. Something like replace "\n\s*\n" with "\n".

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
It's a .88 magnum -- it goes through schools.
-- Danny Vermin
*/


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




Re: [PHP] Auto logout?

2002-06-24 Thread Erik Price


On Monday, June 24, 2002, at 11:14  AM, Hawk wrote:

> I have a login, and when users are logged on, it should show in some 
> way on
> the page, that's not the problem, it is to show that they are logged off
> when they are, often people forget to press the logout button, and the 
> mysql
> database is unchanged, saying they are still logged on, how can I do so 
> it
> logs out when a user leaves the page, if the page is closed or something
> like that, need suggestions, sorry for my currently bad english, but 
> I'll
> blame the heat ;)

Hawk,

Have a read of the following thread from this weekend:

http://marc.theaimsgroup.com/?l=php-
general&r=1&w=2&q=b&s=Whos+online+at+the+moment+in+PHP

It discusses some of the issues involved in this.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Can't start Apache

2002-06-24 Thread General

Help!
I'm running this PHP 4.2.1 DSO compile on a Mandrake 8.2 PPC and have Apache 
1.3.23 Advanced Extranet server

When starting httpd I get this error ->
Executing: /etc/rc.d/init.d/httpd
starting httpd-perl:[ok]
starting httpd: Syntax error on line 74 of /etc/httpd/conf/httpd.conf
Cannot load /etc/httpd/apache/libphp4.so into 
server: /etc/httpd/apache/libphp4.so undefined symbol:gss_nt_service_name
[FAILED]
Does any one who might know I did wrong? or left out...

The configure, make, and make install went perfect.

I used these with my configure:
--with-imap-ssl=/usr/lib/
--with-imap=/usr/lib/
--with-mcal=/usr/libmcal
--with-apxs=/usr/sbin/apxs
--enable-xml
--enable-ftp
--with-pear=/usr/lib/php-4.2.1/pear/
--with-gettext=/bin/gettext
--with-config-file-path=/etc/php.ini

Thank You Very Much,
-Eric


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




[PHP] PHP as a proxy to an htaccess protected site. (STILL UNRESOLVED)

2002-06-24 Thread php

Hi people,

Iam trying to make a script that you give it the login and password for 
a determined password protected site, and it logs you in. It will be 
like a proxy.

So, what I have is something like this:



So now.. here I have two problems:
1.) If the user enters a login/pass that is not the correct this 
appears on the screen hundreds of times:

"Warning: Supplied argument is not a valid File-Handle resource .."

2.) /protected_area/index.html is a frame site, which means that if the 
pass/login are ok it will show you only the index.html, but this is 
made of frames, so then I have another login prompt for the frames.

My question is, is there anyway I can fix problem 1, and in problem 2 
is there anyway to proxy this in a better way, where you input the 
login once and it stay there so i dont get any more login prompts?

Thank You.

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




[PHP] Convert a grayscale value to a #RRGGBB hex value

2002-06-24 Thread René Fournier

Anyone know how I might convert a grayscale value, from between 0 to 
100, to hex, such that 0 (black) would be returned as #00, and 100 
(white) as #FF? For example...

function grayscaletohex ($val) {
$hex = $val ... [ a simple operation ]
return $hex;
}

Thanks.

...Rene

---
René Fournier,
[EMAIL PROTECTED]

Toll-free +1.888.886.2754
Tel +1.403.291.3601
Fax +1.403.250.5228
www.smartslitters.com

SmartSlitters International
#33, 1339 - 40th Ave NE
Calgary AB  T2E 8N6
Canada


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




[PHP] Convert a grayscale value to a #RRGGBB hex value

2002-06-24 Thread René Fournier

Anyone know how I might convert a grayscale value, from between 0 to 
100, to hex, such that 0 (black) would be returned as #00, and 100 
(white) as #FF? For example...

function grayscaletohex ($val) {
$hex = $val ... [ a simple operation ]
return $hex;
}

Thanks.

...Rene

---
René Fournier,
[EMAIL PROTECTED]

Toll-free +1.888.886.2754
Tel +1.403.291.3601
Fax +1.403.250.5228
www.smartslitters.com

SmartSlitters International
#33, 1339 - 40th Ave NE
Calgary AB  T2E 8N6
Canada


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




Re: [PHP] Can't start Apache

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 23:33, General wrote:
> Help!
> I'm running this PHP 4.2.1 DSO compile on a Mandrake 8.2 PPC and have
> Apache 1.3.23 Advanced Extranet server
>
> When starting httpd I get this error ->
> Executing: /etc/rc.d/init.d/httpd
> starting httpd-perl:[ok]
> starting httpd: Syntax error on line 74 of /etc/httpd/conf/httpd.conf
> Cannot load /etc/httpd/apache/libphp4.so into
> server: /etc/httpd/apache/libphp4.so undefined symbol:gss_nt_service_name
> [FAILED]
> Does any one who might know I did wrong? or left out...
>
> The configure, make, and make install went perfect.
>
> I used these with my configure:
> --with-imap-ssl=/usr/lib/
> --with-imap=/usr/lib/

If you're using imap you need to install the kerberos libraries as well.

google for: "libphp4.so undefined symbol:gss_nt_service_name" should yield 
some solutions.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Bad cafeteria food landed all the sysadmins in the hospital.
*/


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




[PHP] function definition causing problems?

2002-06-24 Thread Bill Hudspeth

I am using PHP 4.2.1, Windows 2000P, IIS4 connected to an Access 2000
database with an ISAPI module. I have created a very simple form and have
written a function to display radio buttons. While a hard-coded, HTML
version of the form works perfectly (correctly returning data), the php file
brings up an error message when I simply add the function definition at the
top of the page (whether or not the function call is present in the code
further down).



i.e.,



Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in
C:\inetpub\wwwroot\PHP\cat_proto3.php on line 46





Line 46 corresponds to the form tag, as follows:









The entire code is below:







  Prototype IOM Meteorite Catalog Access Site





"
: ">";

$String .= "\n";

} #end of for loop

return chop($String);

} #end of function MakeRadioButtons()




#

?>



















INSTITUTE OF METEORITICS

Prototype Meteorite Catalog Access Page







PLEASE SELECT A METEORITE CLASS:













  Chondrite

  Achondrite

  Stony Iron

  Iron

  

  















 

Meteorite Catalog Output
Results





OUTPUT_HEADER;



echo <<



Sample Name

Type



TABLEHEADER;



//connect to database

$connectionstring = odbc_connect("meteoritecatalog", "wbhk", "poitiers");



$class_query = "SELECT sample.Sample, type.type_name

FROM sample,type

WHERE sample.type = type.type

AND sample.type=$_POST[meteorite_class]

ORDER BY type.type_name";



//execute query

$queryexe = odbc_do($connectionstring, $class_query);



//query database

while(odbc_fetch_row($queryexe))

{

$msample = odbc_result($queryexe, 1);

$mtype = odbc_result($queryexe, 2);



//format results

print ("");

print ("$msample");

print ("$mtype");

print ("");

}



//disconnect from the database

odbc_close($connectionstring);



print ("");



}

?>











Many thanks for the help, Bill




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




[PHP] session_is_registered = secure?

2002-06-24 Thread Duncan

Hi there,

i created a session based login and in order to enter the selected part of the script, 
i check for the passed variable and if the session is registered, which only happens, 
if the user password is right.

So, currently i am checking for:

else if (($login)&&(session_is_registered('login_user')))
{
...SCRIPT_PART...
}

However, can this be exploited?
I mean, would it be possible for a user to forge the 
"session_is_registered('login_user')" and so gain access to that part of the script?

Would you recommend adding a sepparate "check for right user&pass" within the 
SCRIPT_PART again?

Regards,

Duncan



Re: [PHP] Can't start Apache

2002-06-24 Thread General

Thanks I did all that ...do I have to have a working kerberos to do the 
configure ...because then I get a meesage stating that php couldn't find a 
simple progam ...however the confiure goes fine then when I make it dies with 
recursive error 1 cannot find libgss_krb5.so ...and I am pointing to the 
correct directory for kerberos. any help?

Quoting Jason Wong <[EMAIL PROTECTED]>:

> On Monday 24 June 2002 23:33, General wrote:
> > Help!
> > I'm running this PHP 4.2.1 DSO compile on a Mandrake 8.2 PPC and
> have
> > Apache 1.3.23 Advanced Extranet server
> >
> > When starting httpd I get this error ->
> > Executing: /etc/rc.d/init.d/httpd
> > starting httpd-perl:[ok]
> > starting httpd: Syntax error on line 74 of
> /etc/httpd/conf/httpd.conf
> > Cannot load /etc/httpd/apache/libphp4.so into
> > server: /etc/httpd/apache/libphp4.so undefined
> symbol:gss_nt_service_name
> > [FAILED]
> > Does any one who might know I did wrong? or left out...
> >
> > The configure, make, and make install went perfect.
> >
> > I used these with my configure:
> > --with-imap-ssl=/usr/lib/
> > --with-imap=/usr/lib/
> 
> If you're using imap you need to install the kerberos libraries as
> well.
> 
> google for: "libphp4.so undefined symbol:gss_nt_service_name" should
> yield 
> some solutions.
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development
> *
> 
> /*
> Bad cafeteria food landed all the sysadmins in the hospital.
> */
> 
> 
> -- 
> 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] Using $PHP_SELF in a form

2002-06-24 Thread Frank Miller








Hello All,

    I’m working on a project here
at our university and need a little.  We installed a wireless network and
bought 5 ipaq’s to use and experiment with.  I wrote a work order system
that we are still using. Basically the tech guys want to be able to check WO
from the ipaq’s and if they finish them fill in a check box and have it
be updated in the WO database and not be displayed on the open or uncompleted
work order page. I can do everything except when the completed box is filled I
can’t get it to fill in the database. Below is the code I’m using.
Keep in mind it is being displayed on a ipaq so the headings are brief. Also I’m
working on my local computer before it is put in production. Any help would be
appreciated. 

 

TIA – Frank

 



if(!$HTTP_POST_VARS['submit']) {

 

 

// initialize database connection

$connection = mysql_connect("localhost") or

die("Couldn't connect to the database!");

 // select database

mysql_select_db("techsupport", $connection);

//formulate and run query

$query = "SELECT * FROM techsupport where (Completed =
'N' or Completed = 'n') and TCompleted='N' ORDER by WONumber DESC";

$result = mysql_query($query,$connection) or die("Error
in Query");

 

$per_page = 10;

if(!$page) {

    $page = 1; 

}

$prev_page = $page - 1;

$next_page = $page + 1;

 

$page_start = ($per_page * $page ) - $per_page;

$num_rows = mysql_num_rows($result);

 

if ($num_rows <= $per_page) {

 $num_pages = 1;

}

else if (($num_rows % $per_page) == 0) {

 $num_pages = ($num_rows / $per_page);

}

else {

    $num_pages = ($num_rows / $per_page) +1;

}

$num_pages = (int)$num_pages;

 

if (($page > $num_pages) || ($page < 0)) {

  error("You have specified an invalid page
number");

}

$query = $query . " LIMIT $page_start, $per_page";

$result = mysql_query($query,$connection) or die("Error
in Query2");

 

echo "



TECH-DE Check Work Orders







 





T = Finished by Technician





#

T

Req.

Situation

";

while ($row = mysql_fetch_array($result)) {

  $WONumber = $row["WONumber"];

  $Completed = $row["Completed"];

  $Requestedby = $row["Requestedby"];

  $Situation = $row["Situation"];

  $Shortsit = substr($Situation, 0, 25);

  if ($color=="#CC") {

 $color="#00";

 } else {

 $color = "#CC";

  }

  echo "

  $WONumber

  

  

  

  $Requestedby

  

  $Shortsit";

  }

echo "";

if ($prev_page) {

echo "Prev"
";

}

else {

 echo "  ";

}

 

echo "";

for ($i = 1; $i <= $num_pages; $i++) {

 if ($i != $page ) {

    echo " $i"
";

} else {

  echo " $i ";

   }

}

echo "";

 

if ($page != $num_pages) {

   echo "Next";  "


}

else {

 echo "";

}

echo "";

mysql_free_result($result);

mysql_close($connection);

echo "



";

}

else {

// initialize database connection

print $WONumber;

$connection = mysql_connect("localhost") or

die("Couldn't connect to the database!");

 // select database

mysql_select_db("techsupport", $connection);

//formulate and run query

$query = "update techsupport set TCompleted='Y'where $WONumber=$Checkbox[0]";

$result = mysql_query($query,$connection) or die("Error
in Query2");

}

 

 

?>

 

Frank Miller

Computer Specialist and Webmaster

Texas A&M University-Texarkana

2600 N. Robison Rd

Texarkana, Texas 75501

 

Office  165

Phone (903)223-3156

Fax (903)223-3139

 








smime.p7s
Description: application/pkcs7-signature


RE: [PHP] function definition causing problems?

2002-06-24 Thread Johnson, Kirk

> Parse error: parse error, unexpected  T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in
C:\inetpub\wwwroot\PHP\cat_proto3.php on line 46

> Line 46 corresponds to the form tag, as follows:
> 
> 


When you echo out an array element, the name needs to be enclosed in
curlies, e.g.,

echo {$_SERVER['PHP_SELF']}

Sorry, can't give you the manual reference.

Kirk

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




[PHP] wordwrap doesn't work for customer's Outlook

2002-06-24 Thread m u i n a r

Hello

What would *you* do if you wordwrap a text and send it via the
mail() command, and your costumer gets the whole text on 1 single
line?

I'm using $newtext = wordwrap( $text,76,"\r\n" );

He has Outlook. When I'm testing it in my Eudora, in Bat and in
Outlook Express, it's wrapped nicely.

(So far the headers end with \n and not with \r\n - may this
have an influence on the resulting email body? I cannot run 33
tests, because the only one who can test it for me is the
customer...)

TIA

Mike


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




RE: [PHP] Error(Newbie)

2002-06-24 Thread Ford, Mike [LSS]

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 22 June 2002 15:19
 
> when I try and view stat.php I get this error:
> 
> Parse error: parse error, expecting `T_STRING' or 
> `T_VARIABLE' or `T_NUM_STRING' in C:\TecEco(Converting To 
> PHP)\includes\stat.php on line 7
> 
> What does the error mean and how can I correct my code?

> setcookie ("tececo_stats", 1);

The 2nd argument to setcookie needs to be a string.

Make it so.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




[PHP] Re: Using $PHP_SELF in a form

2002-06-24 Thread George Whiffen

Frank Miller wrote:

>  I'm working on a project here at our university and need a little.  We 
>installed a wireless network and bought 5 ipaq's to use and experiment with.  I wrote 
>a work order system that we are still using. Basically the tech guys want to be able 
>to check WO from the ipaq's and if they finish them fill in a check box and have it 
>be updated in the WO database and not be displayed on the open or uncompleted work 
>order page. I can do everything except when the completed box is filled I can't get 
>it to fill in the database. Below is the code I'm using. Keep in mind it is being 
>displayed on a ipaq so the headings are brief. Also I'm working on my local computer 
>before it is put in production. Any help would be appreciated.
>
>

Frank,

I can't see anything obviously wrong with your code, but it's a bit hard to follow.

In general I tend to do all processing in a script first before writing any output so 
you get something like:

if (isset($submit))
{
   ... sql updates 
}
... sql selects  e.g. $cursor=mysql_query("");



 header

...form start

while ($row = mysql_fetch_array($cursor))
{
   print ' per row html '.$row[value1] etc.
}

...form end...
... footer stuff


A big advantage of this is that if you do hit an error during your SQL stuff, then
you can redirect straight to an error page without having to worry about
"headers already sent" messages.  A secondary advantage is that if you do
your updates first, you can just let the normal select code run so after every
update the form just returns with the new values of data without another stage
of selection.

Anyway, back to the problem, it looks as if you'll need some traces to find out
what is actually happening.  First of all I'd suggest you just print your query
string before executing it, then you can have a look and see what it's actually
trying to do.  Most likely it either is never getting to the query or no value set
in $checkbox[0].

I guess (!$HTTP_POST_VARS['submit']) works, but I always
go for a named submit e.g. type=submit name=update, and an explicit isset check
if isset($update) etc.  I also wonder why you look for submit in HTTP_POST_VARS
but pick up $checkbox[0] directly.

As your code stands I guess they can only check one box at once.  Have you
considered a foreach($checkbox as $orderno) loop for the updates?  Personally,
after very unpleasant experiences with early Internet Explorers I still name each
form field individually instead of trusing arrays e.g. checkbox0, checkbox1 etc. Of
course if you do that you need to have a hidden field with the number of records
displayed to know how many checkboxes to check which is a bit of a pain.

Sorry I couldn't help more.


Good Luck,

George




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




[PHP] Ensim with PHP and MySQL

2002-06-24 Thread Mark McCulligh

Has anyone ever used Ensim on their server with PHP and MySQL.

I am looking at purchase Ensim to management my web sites.  It looks like a
great product, but because it is embedded into RedHat, I am worried about
its flexible.

If I want to upgrade my PHP, MySQL or Apache on it. It doesn't look like it
is that easy.

In short I just want to know if anyone out there is using Ensim and if so,
do you like it.

Thanks, Mark.

--
_
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
(888)225-6824 ex. 3262
[EMAIL PROTECTED]



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




[PHP] Re: Convert a grayscale value to a #RRGGBB hex value

2002-06-24 Thread Matthew Gray

If you know its grayscale...

function GrayScaleToHex( $val ) {

$norm = $val * 2.55 + $val/100;
$hex = sprintf("%02X", $norm);
return '#' . $hex . $hex . $hex;
}

Should get you close enough.

Matt


René fournier wrote:

> Anyone know how I might convert a grayscale value, from between 0 to 
> 100, to hex, such that 0 (black) would be returned as #00, and 100 
> (white) as #FF? For example...
>
> function grayscaletohex ($val) {
> $hex = $val ... [ a simple operation ]
> return $hex;
> }
>
> Thanks.
>
> ...Rene
>
> ---
> René Fournier,
> [EMAIL PROTECTED]
>
> Toll-free +1.888.886.2754
> Tel +1.403.291.3601
> Fax +1.403.250.5228
> www.smartslitters.com
>
> SmartSlitters International
> #33, 1339 - 40th Ave NE
> Calgary AB  T2E 8N6
> Canada
>
>



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




Re: [PHP] function definition causing problems?

2002-06-24 Thread Erik Price


On Monday, June 24, 2002, at 12:15  PM, Johnson, Kirk wrote:

> When you echo out an array element, the name needs to be enclosed in
> curlies, e.g.,
>
> echo {$_SERVER['PHP_SELF']}

I think that this is only important when using an associative array 
element reference within certain kinds of quotes.  Like this:

// this won't work b/c of quoting issues
echo "This script is called $_SERVER["PHP_SELF"]";

// this should work fine IIRC
echo "This script is called $_SERVER['PHP_SELF']";

// this should also work if for some reason you needed
// to use double quotes within the array element reference
// (to interpolate a variable, for instance)
echo "This script is called {$_SERVER["PHP_SELF"]}";

// and this is the same thing really
echo "This script is called ${_SERVER["PHP_SELF"]}";





Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] function definition causing problems?

2002-06-24 Thread Rasmus Lerdorf

> // this won't work b/c of quoting issues
> echo "This script is called $_SERVER["PHP_SELF"]";
>
> // this should work fine IIRC
> echo "This script is called $_SERVER['PHP_SELF']";

Nope, use:

echo "This script is called $_SERVER[PHP_SELF]";

-Rasmus


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




Re: [PHP] Can't start Apache

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 23:54, General wrote:
> Thanks I did all that ...do I have to have a working kerberos to do the
> configure ...because then I get a meesage stating that php couldn't find a
> simple progam ...however the confiure goes fine then when I make it dies
> with recursive error 1 cannot find libgss_krb5.so ...and I am pointing to
> the correct directory for kerberos. any help?

But in your original post, in your ./configure command you haven't specified 
kerberos. I used "--with-kerberos=/usr/kerberos".

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Your aims are high, and you are capable of much.
*/


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




RE: [PHP] Convert a grayscale value to a #RRGGBB hex value

2002-06-24 Thread Lazor, Ed

I have an idea on how to do this.  Could someone confirm whether this is a
good approach?

function grayscaletohex ($val)
{
$n = ($val * 255) / 100;// convert from range of 100 to
range of 255
$h = dechex($n);// convert decimal to hex
$results = $h.$h.$h;// create 6 digit browser color
string
return $results;
}



> -Original Message-
> From: René Fournier [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, June 23, 2002 12:52 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Convert a grayscale value to a #RRGGBB hex value
> 
> 
> Anyone know how I might convert a grayscale value, from between 0 to 
> 100, to hex, such that 0 (black) would be returned as 
> #00, and 100 
> (white) as #FF? For example...
> 
> function grayscaletohex ($val) {
>   $hex = $val ... [ a simple operation ]
>   return $hex;
>   }
> 
> Thanks.
> 
> ...Rene
> 
> ---
> René Fournier,
> [EMAIL PROTECTED]
> 
> Toll-free +1.888.886.2754
> Tel +1.403.291.3601
> Fax +1.403.250.5228
> www.smartslitters.com
> 
> SmartSlitters International
> #33, 1339 - 40th Ave NE
> Calgary AB  T2E 8N6
> Canada
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




Re: [PHP] Can't start Apache

2002-06-24 Thread General

I know because it was causing the problem I was talking about down a couple of 
lines.

Quoting Jason Wong <[EMAIL PROTECTED]>:

> On Monday 24 June 2002 23:54, General wrote:
> > Thanks I did all that ...do I have to have a working kerberos to do
> the
> > configure ...because then I get a meesage stating that php couldn't
> find a
> > simple progam ...however the confiure goes fine then when I make it
> dies
> > with recursive error 1 cannot find libgss_krb5.so ...and I am pointing
> to
> > the correct directory for kerberos. any help?
> 
> But in your original post, in your ./configure command you haven't
> specified 
> kerberos. I used "--with-kerberos=/usr/kerberos".
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development
> *
> 
> /*
> Your aims are high, and you are capable of much.
> */
> 
> 
> -- 
> 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] header("Location with & in URL

2002-06-24 Thread Lazor, Ed

Have you tried this?

header("Location: $retURL");

?

> -Original Message-
> 
> $retUrl = htmlspecialchars ($retUrl);
> 
> if ($retUrl != "") {
> header("Location: " . $retUrl);
> 
> Any ideas?
 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




RE: [PHP] function definition causing problems?

2002-06-24 Thread Ford, Mike [LSS]

> -Original Message-
> From: Erik Price [mailto:[EMAIL PROTECTED]]
> Sent: 24 June 2002 18:12
> 
> On Monday, June 24, 2002, at 12:15  PM, Johnson, Kirk wrote:
> 
> > When you echo out an array element, the name needs to be enclosed in
> > curlies, e.g.,
> >
> > echo {$_SERVER['PHP_SELF']}
> 
> I think that this is only important when using an associative array 
> element reference within certain kinds of quotes.  Like this:
> 
> // this won't work b/c of quoting issues
> echo "This script is called $_SERVER["PHP_SELF"]";
> 
> // this should work fine IIRC
> echo "This script is called $_SERVER['PHP_SELF']";

Nope.  Quoted array indexes don't work inside strings.

> // this should also work if for some reason you needed
> // to use double quotes within the array element reference
> // (to interpolate a variable, for instance)
> echo "This script is called {$_SERVER["PHP_SELF"]}";

Nope.  The {} don't change the quoting issues you mentioned in your first 
(non-working) example.

> // and this is the same thing really
> echo "This script is called ${_SERVER["PHP_SELF"]}";

... and fails for the same reason!

You can use:

   echo "This script is called {$_SERVER['PHP_SELF']}";
   echo "This script is called ${_SERVER['PHP_SELF']}";
   echo "This script is called $_SERVER[PHP_SELF]";

or even 

   echo "This script is called " . $_SERVER['PHP_SELF'];

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




[PHP] PHP with IIS

2002-06-24 Thread Dave Leather

Hello all,

I am attempting to open and/or create a DBASE file on a NOVELL network.

When I attemp a command such as
  if (!dbase_open("C:\\orders.dbf",2)){
   print "COULD NOT OPEN DB";
  }else{
   print "DB WAS OPENED";
  }

I receive a message that says "DB WAS OPENED - no problem...

On my IIS server, I have Novell drive map to P: - I can browse this using
explorer or in CMD I can go to P: and do DIR etc etc.

When I try :
  if (!dbase_open("P:\\orders.dbf",2)){
   print "COULD NOT OPEN DB";
  }else{
   print "DB WAS OPENED";
  }

I receive a message that says :
Warning: unable to open database P:\orders.dbf in
C:\InetPub\wwwroot\pappreport.php on line 81
COULD NOT OPEN DB

Yes, the database exists, as I copied it FROM here to C:\ to do my test.

Any ideas??? I have checked the PHP.INI file, and all the regular settings
in IIS - and could not find anything misconfigured.. but I am by no means an
IIS expert, so I am not sure.

Thanks in advance
Dave




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




RE: [PHP] function definition causing problems?

2002-06-24 Thread Johnson, Kirk

I thought this syntax, an unquoted key name, was deprecated ;)

>From the manual at http://www.php.net/manual/en/language.types.array.php:

"You should always use quotes around an associative array index."

Kirk

> Nope, use:
> 
> echo "This script is called $_SERVER[PHP_SELF]";

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




RE: [PHP] function definition causing problems?

2002-06-24 Thread Rasmus Lerdorf

Not inside a quoted string.

On Mon, 24 Jun 2002, Johnson, Kirk wrote:

> I thought this syntax, an unquoted key name, was deprecated ;)
>
> >From the manual at http://www.php.net/manual/en/language.types.array.php:
>
> "You should always use quotes around an associative array index."
>
> Kirk
>
> > Nope, use:
> >
> > echo "This script is called $_SERVER[PHP_SELF]";
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] function definition causing problems?

2002-06-24 Thread Erik Price


On Monday, June 24, 2002, at 01:30  PM, Ford, Mike [LSS] wrote:

> You can use:
>
>echo "This script is called {$_SERVER['PHP_SELF']}";
>echo "This script is called ${_SERVER['PHP_SELF']}";
>echo "This script is called $_SERVER[PHP_SELF]";
>
> or even
>
>echo "This script is called " . $_SERVER['PHP_SELF'];

Oh.  Well, thanks for clarifying -- I always use the concat (last) 
method myself, but this settles an incorrect assumption I'd been 
carrying around for months.  You're batting two for two today. ;)


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] session_is_registered = secure?

2002-06-24 Thread Kevin Stone

I don't know of any exploit that can start a session remotely.  Only thing I
can recommend is that you modify the default session id to prevent local
hackers from hijacking your sessions (assuming you're on an ISP and not
running your own server).  Also you should consider testing those variables
more strictly.  If you're expecting a specific value or range of values then
you should test for that instead.  For example if $login is true or false
then you should test it directly with if($login=true) since any value other
than 0 will automatically evaluate to true.

"Would you recommend adding a sepparate "check for right user&pass" within
the SCRIPT_PART again?"

When you've cleared the user once why would you need to do it again on the
same page?  :)

-Kevin

- Original Message -
From: "Duncan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 9:53 AM
Subject: [PHP] session_is_registered = secure?


Hi there,

i created a session based login and in order to enter the selected part of
the script, i check for the passed variable and if the session is
registered, which only happens, if the user password is right.

So, currently i am checking for:

else if (($login)&&(session_is_registered('login_user')))
{
...SCRIPT_PART...
}

However, can this be exploited?
I mean, would it be possible for a user to forge the
"session_is_registered('login_user')" and so gain access to that part of the
script?

Would you recommend adding a sepparate "check for right user&pass" within
the SCRIPT_PART again?

Regards,

Duncan




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




Re: [PHP] PHP with IIS

2002-06-24 Thread Andrew Brampton

Does the user to which ISS runs under have network permissions to access p:\
?
IIRC you need to set up ISUR_machine_name to have permission to the remote
share.

Andrew
- Original Message -
From: "Dave Leather" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 6:29 PM
Subject: [PHP] PHP with IIS


> Hello all,
>
> I am attempting to open and/or create a DBASE file on a NOVELL network.
>
> When I attemp a command such as
>   if (!dbase_open("C:\\orders.dbf",2)){
>print "COULD NOT OPEN DB";
>   }else{
>print "DB WAS OPENED";
>   }
>
> I receive a message that says "DB WAS OPENED - no problem...
>
> On my IIS server, I have Novell drive map to P: - I can browse this using
> explorer or in CMD I can go to P: and do DIR etc etc.
>
> When I try :
>   if (!dbase_open("P:\\orders.dbf",2)){
>print "COULD NOT OPEN DB";
>   }else{
>print "DB WAS OPENED";
>   }
>
> I receive a message that says :
> Warning: unable to open database P:\orders.dbf in
> C:\InetPub\wwwroot\pappreport.php on line 81
> COULD NOT OPEN DB
>
> Yes, the database exists, as I copied it FROM here to C:\ to do my test.
>
> Any ideas??? I have checked the PHP.INI file, and all the regular settings
> in IIS - and could not find anything misconfigured.. but I am by no means
an
> IIS expert, so I am not sure.
>
> Thanks in advance
> Dave
>
>
>
>
> --
> 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] Run two separate version of Apache and Php

2002-06-24 Thread rdkurth

Hello php-general,

I need to run a separate version of Apache on the same server I also
what to use a different copy of the php.ini file with that version of
apache. I am aware that I can override most of the php.ini settings in
the httpd.conf file. But this is not what I want to do.
Php will be running as a DSO with apache. So is the only way I can do
this is to install a different copy of php to run with this version of
Apache. Or is there a way I can get the httpd.conf file to read a
different copy of php.ini




  

-- 
Best regards,
 rdkurth  mailto:[EMAIL PROTECTED]


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




Re: [PHP] php & JavaScript

2002-06-24 Thread Jim lucas

nope, theres nothing in apache that needs to be setup for js to be used.
does your js file have any php in it?
when you say that you couldn't get it to work, do you mean that the include
doesn't work or that the js doesn't work on the page that you are including
it to?

Jim Lucas
- Original Message -
From: "Luis Miguel N. Tavora" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 4:28 AM
Subject: [PHP] php & JavaScript


> Hi there.
>
> I've tried to include a simple javascript in a .php file,
> but couldn't get it to work.
>
> Actually not even the php code worked at all...
>
> Is there any specific configuration flag that needs to be
> set up in the Apache server so that the javascripts work
> correctly?
>
> Thanks in advance
>
> Luis
>
> PS- Btw, I use an Apache server on a RH72 machine
>
>
>
> --
>Luis Miguel N. Távora
>[EMAIL PROTECTED]
>
>   Message sent via Sylpheed
> sylpheed-claws.sourceforge.net
> --
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] PHP with IIS

2002-06-24 Thread Dave Leather

Yes, and Yes...

Access is granted throughout.. Read, Write, Create, Erase, Modify and File
Scan access is granted for this login ID.

Any other suggestions?

Thanks again
Dave

"Andrew Brampton" <[EMAIL PROTECTED]> wrote in message
00ca01c21ba6$b2b36ea0$7432260a@student5830">news:00ca01c21ba6$b2b36ea0$7432260a@student5830...
> Does the user to which ISS runs under have network permissions to access
p:\
> ?
> IIRC you need to set up ISUR_machine_name to have permission to the remote
> share.
>
> Andrew
> - Original Message -
> From: "Dave Leather" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 24, 2002 6:29 PM
> Subject: [PHP] PHP with IIS
>
>
> > Hello all,
> >
> > I am attempting to open and/or create a DBASE file on a NOVELL network.
> >
> > When I attemp a command such as
> >   if (!dbase_open("C:\\orders.dbf",2)){
> >print "COULD NOT OPEN DB";
> >   }else{
> >print "DB WAS OPENED";
> >   }
> >
> > I receive a message that says "DB WAS OPENED - no problem...
> >
> > On my IIS server, I have Novell drive map to P: - I can browse this
using
> > explorer or in CMD I can go to P: and do DIR etc etc.
> >
> > When I try :
> >   if (!dbase_open("P:\\orders.dbf",2)){
> >print "COULD NOT OPEN DB";
> >   }else{
> >print "DB WAS OPENED";
> >   }
> >
> > I receive a message that says :
> > Warning: unable to open database P:\orders.dbf in
> > C:\InetPub\wwwroot\pappreport.php on line 81
> > COULD NOT OPEN DB
> >
> > Yes, the database exists, as I copied it FROM here to C:\ to do my test.
> >
> > Any ideas??? I have checked the PHP.INI file, and all the regular
settings
> > in IIS - and could not find anything misconfigured.. but I am by no
means
> an
> > IIS expert, so I am not sure.
> >
> > Thanks in advance
> > Dave
> >
> >
> >
> >
> > --
> > 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   >