[PHP] Re: HTTP_REFERER

2003-09-12 Thread Catalin Trifu
Hi,

It does support any HTTP information, and since
HTTP_REFERER is part of the HTTP spec. it is supported.
You can find it in the $_SERVER variable.
FYI: The referer is not a reliable information.

Cheers,
Catalin


"Louie Miranda" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does php support this? HTTP_REFERER
> or simply cgi and ssi only?
>
> -
> Louie

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



[PHP] Re: AIX + PHP Extension Module Does Not Work (giving core dump at zend_parse_parameters)

2003-09-12 Thread Catalin Trifu
Hi,

This should go to the php.devel list

Cheers,
Catalin

"Ashish Borkar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi ,
> I am writing a php extension module on AIX 4.3.3  RS6000 machine.I
> have compiled php as CGI.When I test my php extension module function
> from a test php script I get a CORE dump.The gdb php core is as below
> Core was generated by `php'.
> Program terminated with signal 11, Segmentation fault.
> #0  0xd0990180 in zend_parse_parameters ()
> (gdb)  bt
> #0  0xd0990180 in zend_parse_parameters ()
> #1  0xd0990930 in zif_myfunction ()
> #2  0x1002c5a4 in execute (op_array=0x200e6c70, tsrm_ls=0x20027738)
> at /usr/local/php-4.3.2/Zend/zend_execute.c:1606
> #3  0x1000e0d4 in zend_execute_scripts (type=8, tsrm_ls=0x20027738,
> retval=0x0, file_count=3)
> at /usr/local/php-4.3.2/Zend/zend.c:869
> #4  0x10007410 in php_execute_script (primary_file=0x5,
> tsrm_ls=0x3027738)
> at /usr/local/php-4.3.2/main/main.c:1671
> #5  0x10001ec8 in main (argc=2, argv=0x2ff228c0) at
> /usr/local/php-4.3.2/sapi/cgi/cgi_main.c:1501
> #6  0x11dc in __start ()
> I have tried all combinations of ZTS=0 ZEND_DEBUG =0
>  ZTS=0 ZEND_DEBUG =1
>  ZTS=1 ZEND_DEBUG =0
>  ZTS=1 ZEND_DEBUG =1
> for compiling php as well as my extension module. All give the same
> result :-(
> Has anyone encountered this on a AIX machine.
> If not atleast has anyone successfully tested a PHP extension module on
> a AIX machine.I urgently need some Help.No matter what I tried till now
> All has failed.
> Thanks & Regards
> Ashish Borkar
>
>
>
> -
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software

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



Re: [PHP] Re: HTTP_REFERER

2003-09-12 Thread Eugene Lee
On Fri, Sep 12, 2003 at 09:11:09AM +0200, Catalin Trifu wrote:
: 
: "Louie Miranda" <[EMAIL PROTECTED]> wrote:
: >
: > Does php support this? HTTP_REFERER
: > or simply cgi and ssi only?
: 
: It does support any HTTP information, and since
: HTTP_REFERER is part of the HTTP spec. it is supported.
: You can find it in the $_SERVER variable.
: FYI: The referer is not a reliable information.

Several Windoze firewalls also filter out HTTP_REFERER.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



[PHP] ereg

2003-09-12 Thread alexander sundli
I use this expression to remove oneline comments:
iereg_replace("//([^\n]*)\n",'',$code);

I need to make a check if this expression is inside a string. If it is, its
not a comment.

I think it has something to do with context..

Anyone who could help me?

thanx

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



Re: [PHP] Refresh Error

2003-09-12 Thread Marek Kilimajer
Does your explorer ask you if you want to resend the information? It 
does. You post your form once again. If you don't want this to happen, 
use header("Location: http://yourserver/your_form_page.php";); redirect.

Rex Brooks wrote:

Okay, I'm displaying an entire table of numbers from my database.  Using a
form on the same page, you can enter an amount to add to the table and then
click submit.  I pass all of the information in $_POST back to the same
page.  Here is my code:
if ($_POST["number"] != NULL) {

if (is_numeric($_POST["number"]) || $_POST["number"] <= 0.0){
...
display stuff telling them they need to try again
...
}
else {
...
do stuff that adds the number to the table
...
$_POST["number"] = NULL;
}
}
 ...body of HTML document...




Add Amount







Everything seems to work fine, up until you click the refresh button, then
it will add whatever you just added to the table again, even if you have
nothing typed into the form and dont hit the submit button.  So basically I
can add 500 by typing it in and clicking the submit button, then continue to
add an addition 500 every time I click the submit button.  I want to be able
to refresh the page, but I cant figure out what is going wrong.  Any ideas?
Rex

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


[PHP] Fatal error: Call to undefined function: mysql_connect()

2003-09-12 Thread Naintara Jain
I get this error "Fatal error: Call to undefined function: mysql_connect() " in one 
script. whereas
phpMyAdmin is installed in another directory and it works fine.

Any ideas why?
-Naintara

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



Re: [PHP] Searching with Date Ranges

2003-09-12 Thread Marek Kilimajer


John W. Holmes wrote:

Seth Willits wrote:

If I want to show events (records in a MySQL table) for the next 10  
days (and I do), what would be the best approach to searching with 
this  range?  (The dates in my table are stored as a string in the 
format  /MM/DD.)
And change the column type to DATE!!!



SELECT * FROM Table WHERE event_date BETWEEN NOW() AND NOW() + INTERVAL 
10 DAY;

"Read the book! Be patient! All success comes from acquiring 
knowledge  and experience."
-- Seth Willits


You quote yourself in your own signature? Isn't that... illegal or 
something... ;)

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


Re: [PHP] Re: HTTP_REFERER

2003-09-12 Thread Louie Miranda
what can you suggest, im trying to do a referer email program on a website
and i think HTTP_REFERER will be my first approach, but limited on some
browsers and firewall.

What can you suggest for a dynamic page?

- Original Message -
From: "Eugene Lee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 12, 2003 3:30 PM
Subject: Re: [PHP] Re: HTTP_REFERER


> On Fri, Sep 12, 2003 at 09:11:09AM +0200, Catalin Trifu wrote:
> :
> : "Louie Miranda" <[EMAIL PROTECTED]> wrote:
> : >
> : > Does php support this? HTTP_REFERER
> : > or simply cgi and ssi only?
> :
> : It does support any HTTP information, and since
> : HTTP_REFERER is part of the HTTP spec. it is supported.
> : You can find it in the $_SERVER variable.
> : FYI: The referer is not a reliable information.
>
> Several Windoze firewalls also filter out HTTP_REFERER.
>
>
> --
> Eugene Lee
> http://www.coxar.pwp.blueyonder.co.uk/
>
> --
> 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] Sending SMS messages ?

2003-09-12 Thread Dave Carrera
Hi All

Is there a way to send sms messages via php.

I really don’t know anything about this so any info,pointers or resources
will be very much appreciated.

Thank you in advance for any help.

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 01/09/2003
 

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



Re: [PHP] Re: HTTP_REFERER

2003-09-12 Thread Eugene Lee
On Fri, Sep 12, 2003 at 03:53:22PM +0800, Louie Miranda wrote:
: "Eugene Lee" mentioned:
: >
: > Several Windoze firewalls also filter out HTTP_REFERER.
: 
: what can you suggest, im trying to do a referer email program on a website
: and i think HTTP_REFERER will be my first approach, but limited on some
: browsers and firewall.
: 
: What can you suggest for a dynamic page?

It depends on what exactly you are trying to accomplish.  Are you trying
to restrict access to your email program based on the HTTP_REFERER which
may be real or may be forged?

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



Re: [PHP] Re: HTTP_REFERER

2003-09-12 Thread Louie Miranda
no, im making a "send this page to a friend program"
when the users click the button a small pop-up window will come out and the
http_referer will work and catch the previous page.

-
Louie

- Original Message -
From: "Eugene Lee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 12, 2003 4:15 PM
Subject: Re: [PHP] Re: HTTP_REFERER


> On Fri, Sep 12, 2003 at 03:53:22PM +0800, Louie Miranda wrote:
> : "Eugene Lee" mentioned:
> : >
> : > Several Windoze firewalls also filter out HTTP_REFERER.
> :
> : what can you suggest, im trying to do a referer email program on a
website
> : and i think HTTP_REFERER will be my first approach, but limited on some
> : browsers and firewall.
> :
> : What can you suggest for a dynamic page?
>
> It depends on what exactly you are trying to accomplish.  Are you trying
> to restrict access to your email program based on the HTTP_REFERER which
> may be real or may be forged?
>
> --
> 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] Sending SMS messages ?

2003-09-12 Thread Louie Miranda
Hi Dave,

Yes php can, but what application will you connect to?
On my old work we develop php and c programs to do it. Although the main
client that connects is on C/Unix but when the people wanted to send
messages we do it on php then web to c then c program to smsc server.

-
Louie

- Original Message -
From: "Dave Carrera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 12, 2003 4:06 PM
Subject: [PHP] Sending SMS messages ?


Hi All

Is there a way to send sms messages via php.

I really don’t know anything about this so any info,pointers or resources
will be very much appreciated.

Thank you in advance for any help.

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 01/09/2003


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

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



Re: [PHP] Re: HTTP_REFERER

2003-09-12 Thread Eugene Lee
On Fri, Sep 12, 2003 at 04:21:16PM +0800, Louie Miranda wrote:
: Eugene Lee mentioned:
: > On Fri, Sep 12, 2003 at 03:53:22PM +0800, Louie Miranda wrote:
: > : "Eugene Lee" mentioned:
: > : >
: > : > Several Windoze firewalls also filter out HTTP_REFERER.
: > :
: > : what can you suggest, im trying to do a referer email program on a
: > : website and i think HTTP_REFERER will be my first approach, but
: > : limited on some browsers and firewall.
: >
: > It depends on what exactly you are trying to accomplish.
: 
: no, im making a "send this page to a friend program"
: when the users click the button a small pop-up window will come out
: and the http_referer will work and catch the previous page.

Since it's a button, you could always send the SCRIPT_FILENAME to the
pop-up window via a GET or POST method.

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



[PHP] input field masks

2003-09-12 Thread Bobpilly
Hello all

I am trying to enforce input masks for dates that are viewable in a single 
html text box. For example i would like a single tect box that the user will 
see ##/##/ in and when they click on the field they will only be able to 
enter digits in the ## areas the / will remain. Is php cable of doing this?

Thanks for any help in advance!

Cheers

Bob

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



Re: [PHP] input field masks

2003-09-12 Thread Ryan A
Javascript is your answer.
Cheers,
-Ryan


We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com


- Original Message - 
From: "Bobpilly" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 12, 2003 11:20 AM
Subject: [PHP] input field masks


> Hello all
>
> I am trying to enforce input masks for dates that are viewable in a single
> html text box. For example i would like a single tect box that the user
will
> see ##/##/ in and when they click on the field they will only be able
to
> enter digits in the ## areas the / will remain. Is php cable of doing
this?
>
> Thanks for any help in advance!
>
> Cheers
>
> Bob
>
> -- 
> 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] Whois request record in database

2003-09-12 Thread IS
I want to record the whios requests people do, not the whois output, in
a MySQL database. Somebody helped me with the code here below, but I get
a parse error when I test it.

Parse error: parse error, unexpected $ in
/home/moo/public_html/whois/index.php on line 32 

What can help me out?

 
 
"); 

$db_name='databasename'; 
$db_user='user'; 
$db_password='password'; 
$table='whoistracker'; 

// Connect to the database 
$db_conn = mysql_connect("localhost",$db_user,$db_password); 
if (!$db_conn) 
{ 
die ("ERROR: Cannot connect to the database."); 
//exit(); 
} 

$ip = $REMOTE_ADDR; 
$insert="INSERT INTO $table (name,ipaddress) VALUES ('$name','$ip')"; 
$db_query=mysql_db_query($db_name,$insert); 

if($name) { 
if($dbquery) { print("Done."); } ELSE { print("Didn't work."); }
?> 

--IS

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



[PHP] Re: Dynamic Drill down menus

2003-09-12 Thread Kae Verens
Dan J. Rychlik wrote:
Hello,

I have created a db that holds specific information ie a business name.  I am running into a problem on a form when you choose the business name another list is suppossed to populate the address or addresses, if multiple occur, and you can select the address.  

I am not able to sucessfully pull off this dynamic drill down list in my form because I do not know how to check data from a form field that hasnt been posted through $POST VARS array.  

My question is, is their a way to do this in PHP?  Do I have to learn javascript in order to accomplish this task or will I have to have a submit button for each form element?

Thanks in advance,
Daniel
I'm not sure if this will help, you, but I have a simple JavaScript 
application which may help. You would simply put your options in nested 
s, then put this in the  of your page:
http://kverens.contactjuggling.org/j/cm.js";>

Kae

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


Re: [PHP] Whois request record in database

2003-09-12 Thread murugesan
You have missed the braces. Close it properly.  The following code works
well


  
  
  ");
  $db_name='dbname';
  $db_user='username';
  $db_password='password';
  $table='tablename';
  // Connect to the database
  $db_conn = mysql_connect("localhost",$db_user,$db_password);
  if (!$db_conn)
  {
   die ("ERROR: Cannot connect to the database.");
   //exit();
  }
  $ip = $REMOTE_ADDR;
  $insert="select * from $table";
  $db_query=mysql_db_query($db_name,$insert);
  if($name)
  {
   if($dbquery)
   { print("Done.");
   }
   else
   { print("Didn't work.");
   }
  }
 }
?>

-Murugesan


- Original Message -
From: "IS" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 12, 2003 3:03 PM
Subject: [PHP] Whois request record in database


> I want to record the whios requests people do, not the whois output, in
> a MySQL database. Somebody helped me with the code here below, but I get
> a parse error when I test it.
>
> Parse error: parse error, unexpected $ in
> /home/moo/public_html/whois/index.php on line 32
>
> What can help me out?
>
> 
> if(!$name) {
> print("
> 
> 
> ");
>
> $db_name='databasename';
> $db_user='user';
> $db_password='password';
> $table='whoistracker';
>
> // Connect to the database
> $db_conn = mysql_connect("localhost",$db_user,$db_password);
> if (!$db_conn)
> {
> die ("ERROR: Cannot connect to the database.");
> //exit();
> }
>
> $ip = $REMOTE_ADDR;
> $insert="INSERT INTO $table (name,ipaddress) VALUES ('$name','$ip')";
> $db_query=mysql_db_query($db_name,$insert);
>
> if($name) {
> if($dbquery) { print("Done."); } ELSE { print("Didn't work."); }
> ?>
>
> --IS
>
> --
> 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] caching program...

2003-09-12 Thread Andrea Tricco
Hi,



I'm using the function "file_get_contents()" to replicate the content of a
remote html page on my server.

But, the function file_get_contents() works even when the name of the file
is not specified. For example:

"http://www.php.net"; rather that "http://php.net/index.php";



Does a method exist to know the name of the file received form web server?



I would like to write a program that automatically downloads the images
inserted into a html page.

For this reason, I need to determine the paths of the images in order to get
them from the web server.



In other words, my program should work as the "Save as" function (File menu)
of any Web browser.



Can anybody help me?



Best regards.



Andrea

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



Re: [PHP] caching program...

2003-09-12 Thread Marek Kilimajer
No way, it might be anything from apache's DirectoryIndex directive. 
Browsers don't know that either.

Andrea Tricco wrote:

Hi,



I'm using the function "file_get_contents()" to replicate the content of a
remote html page on my server.
But, the function file_get_contents() works even when the name of the file
is not specified. For example:
"http://www.php.net"; rather that "http://php.net/index.php";



Does a method exist to know the name of the file received form web server?



I would like to write a program that automatically downloads the images
inserted into a html page.
For this reason, I need to determine the paths of the images in order to get
them from the web server.


In other words, my program should work as the "Save as" function (File menu)
of any Web browser.


Can anybody help me?



Best regards.



Andrea

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


[PHP] caching program

2003-09-12 Thread Andrea Tricco
Hi,
I'm using the function "file_get_contents()" to replicate the content of a
remote html page on my server.
But, the function file_get_contents() works even when the name of the file
is not specified. For example:

"http://www.php.net"; rather that "http://php.net/index.php";

Does a method exist to know the name of the file received form web server?

I would like to write a program that automatically downloads the images
inserted into a html page.
For this reason, I need to determine the paths of the images in order to get
them from the web server.
In other words, my program should work as the "Save as" function (File menu)
of any Web browser.

Can anybody help me?

Best regards.
Andrea

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



Re: [PHP] caching program

2003-09-12 Thread Ryan Gibson
You could pull out all the img src attributes and if they don't contain
"http://"; then prepeand the address of te page then download otherwise just
downlocad the url, but to get the page to work in the new location you may
have to replace the img src attributes

Ryan Gibson
---
[EMAIL PROTECTED]

On 17/9/03 11:16 am, "Andrea Tricco" <[EMAIL PROTECTED]> wrote:

> Hi,
> I'm using the function "file_get_contents()" to replicate the content of a
> remote html page on my server.
> But, the function file_get_contents() works even when the name of the file
> is not specified. For example:
> 
> "http://www.php.net"; rather that "http://php.net/index.php";
> 
> Does a method exist to know the name of the file received form web server?
> 
> I would like to write a program that automatically downloads the images
> inserted into a html page.
> For this reason, I need to determine the paths of the images in order to get
> them from the web server.
> In other words, my program should work as the "Save as" function (File menu)
> of any Web browser.
> 
> Can anybody help me?
> 
> Best regards.
> Andrea

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



RE: [PHP] Problem with HTML Text box and PHP variable.

2003-09-12 Thread Ford, Mike [LSS]
On 11 September 2003 19:56, CPT John W. Holmes wrote:

> From: "murugesan" <[EMAIL PROTECTED]>
> 
> 
> > This will help you
> > 
> >  >  $dins="Dinesh";
> >  echo "";
> > > 
> 
> Use double quotes for HTML attributes.

Why?  Both the HTML 4.01 and XHTML 1.0 (via XML 1.0) specifications explicitly allow 
both single and double quotes for attribute values.

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



Re: [PHP] caching program

2003-09-12 Thread Andrea Tricco
For the images that don't contain "http://"; my program is already able to
get them from the web server.
In other cases, I have to determine the name of the directory where the html
page is located.
Thus, the equivocal paths are the problem, for example:

www.php.net/manual/it/index.php

www.php.net/manual/it/

www.php.net/manual/it

The reply of the server web is the same in the three cases.
The input of the my program could be any paths between the mentioned ones. I
need to poll out the path www.php.net/manual/it/

Best regards.
Andrea


- Original Message - 
From: "Ryan Gibson" <[EMAIL PROTECTED]>
To: "Andrea Tricco" <[EMAIL PROTECTED]>; "php-general"
<[EMAIL PROTECTED]>
Sent: Friday, September 12, 2003 12:26 PM
Subject: Re: [PHP] caching program


> You could pull out all the img src attributes and if they don't contain
> "http://"; then prepeand the address of te page then download otherwise
just
> downlocad the url, but to get the page to work in the new location you may
> have to replace the img src attributes
>
> Ryan Gibson
> ---
> [EMAIL PROTECTED]
>
> On 17/9/03 11:16 am, "Andrea Tricco" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > I'm using the function "file_get_contents()" to replicate the content of
a
> > remote html page on my server.
> > But, the function file_get_contents() works even when the name of the
file
> > is not specified. For example:
> >
> > "http://www.php.net"; rather that "http://php.net/index.php";
> >
> > Does a method exist to know the name of the file received form web
server?
> >
> > I would like to write a program that automatically downloads the images
> > inserted into a html page.
> > For this reason, I need to determine the paths of the images in order to
get
> > them from the web server.
> > In other words, my program should work as the "Save as" function (File
menu)
> > of any Web browser.
> >
> > Can anybody help me?
> >
> > Best regards.
> > Andrea
>
>
>
>

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



RE: [PHP] Problem with HTML Text box and PHP variable.

2003-09-12 Thread Ford, Mike [LSS]
On 12 September 2003 11:50, Ford, Mike [LSS] wrote:

> On 11 September 2003 19:56, CPT John W. Holmes wrote:
> 
> > From: "murugesan" <[EMAIL PROTECTED]>
> > 
> > 
> > > This will help you
> > > 
> > >  > >  $dins="Dinesh";
> > >  echo " > > >"; 
> > > > 
> > 
> > Use double quotes for HTML attributes.
> 
> Why?  Both the HTML 4.01 and XHTML 1.0 (via XML 1.0)
> specifications explicitly allow both single and double quotes for
> attribute values. 

OK, I've now seen the other followups requesting backup for this, so:

HTML 4.01: At http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2, the
spec says:

"By default, SGML requires that all attribute values be
 delimited using either double quotation marks (ASCII
 decimal 34) or single quotation marks (ASCII decimal 39)."

XHTML 1.0 relies on the XML 1.0 spec for this, and the XML 1.0 spec, at
http://www.w3.org/TR/2000/REC-xml-20001006#NT-AttValue, defines an attribute
value thusly:

 AttValue::='"' ([^<&"] | Reference)* '"'  
 |  "'" ([^<&'] | Reference)* "'" 

Hope this helps!

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



Re: [PHP] caching program

2003-09-12 Thread Andrea Tricco
I'm sorry, but in the previuos email there has been an error.
I'm sending correct one.
-
For the images that contain "http://"; my program is already able to
get them from the web server.
In other cases, I have to determine the name of the directory where the html
page is located.
Thus, the equivocal paths are the problem, for example:

www.php.net/manual/it/index.php

www.php.net/manual/it/

www.php.net/manual/it

The reply of the server web is the same in the three cases.
The input of the my program could be any paths between the mentioned ones. I
need to poll out the path www.php.net/manual/it/

Best regards.
Andrea

- Original Message - 
From: "Andrea Tricco" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Wednesday, September 17, 2003 1:11 PM
Subject: Re: [PHP] caching program


> For the images that don't contain "http://"; my program is already able to
> get them from the web server.
> In other cases, I have to determine the name of the directory where the
html
> page is located.
> Thus, the equivocal paths are the problem, for example:
>
> www.php.net/manual/it/index.php
>
> www.php.net/manual/it/
>
> www.php.net/manual/it
>
> The reply of the server web is the same in the three cases.
> The input of the my program could be any paths between the mentioned ones.
I
> need to poll out the path www.php.net/manual/it/
>
> Best regards.
> Andrea
>
>
> - Original Message - 
> From: "Ryan Gibson" <[EMAIL PROTECTED]>
> To: "Andrea Tricco" <[EMAIL PROTECTED]>; "php-general"
> <[EMAIL PROTECTED]>
> Sent: Friday, September 12, 2003 12:26 PM
> Subject: Re: [PHP] caching program
>
>
> > You could pull out all the img src attributes and if they don't contain
> > "http://"; then prepeand the address of te page then download otherwise
> just
> > downlocad the url, but to get the page to work in the new location you
may
> > have to replace the img src attributes
> >
> > Ryan Gibson
> > ---
> > [EMAIL PROTECTED]
> >
> > On 17/9/03 11:16 am, "Andrea Tricco" <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> > > I'm using the function "file_get_contents()" to replicate the content
of
> a
> > > remote html page on my server.
> > > But, the function file_get_contents() works even when the name of the
> file
> > > is not specified. For example:
> > >
> > > "http://www.php.net"; rather that "http://php.net/index.php";
> > >
> > > Does a method exist to know the name of the file received form web
> server?
> > >
> > > I would like to write a program that automatically downloads the
images
> > > inserted into a html page.
> > > For this reason, I need to determine the paths of the images in order
to
> get
> > > them from the web server.
> > > In other words, my program should work as the "Save as" function (File
> menu)
> > > of any Web browser.
> > >
> > > Can anybody help me?
> > >
> > > Best regards.
> > > Andrea
> >
> >
> >
> >
>
> -- 
> 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] Training Help

2003-09-12 Thread Ryan Stagg
I recently aquired a copy of the book PHP and Mysql web development by SAMS.

I have begun reading through it and it seems to be a very usefull book
however I started doing the first exersise which is a simple HTML Processor,
the HTML page is as follows:



Bob's Auto Parts - Order Results


Bob's Auto Parts



Item
Quantity


Tires



Oil



Spark Plugs










And the processor PHP page is:



Bob's Auto Parts - Order Results


Bob's Auto Parts
Order Results
Order Processed at ";
 echo date("H:i, ");
 echo "on ";
 echo date ("jS F");
 echo "";
 echo "Your order is as follows:";
 echo "";
 echo $tireqty." tires";
 echo $oilqty." bottles of oil";
 echo $sparkqty." spark plugs";
?>



I get an error this code is taken directly from the book.

Bob's Auto Parts
Order Results
Order Processed at 21:08, on 12th September


Your order is as follows:

Notice: Undefined variable: tireqty in
c:\inetpub\wwwroot\php\processorder.php on line 16
tires

Notice: Undefined variable: oilqty in
c:\inetpub\wwwroot\php\processorder.php on line 17
bottles of oil

Notice: Undefined variable: sparkqty in
c:\inetpub\wwwroot\php\processorder.php on line 18
spark plugs


Help



Ryan

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



Re: [PHP] Training Help

2003-09-12 Thread Jon Haworth
Hi Ryan,

Sounds like register_globals is turned off on your server (this is generally
a Good Thing). Rather than having all your form fields converted directly
into variables - which your book is assuming, as it's how PHP used to do
it - you'll need to access them via the $_POST array.

Try changing this line:

>  echo $tireqty." tires";

To this:

echo $_POST["tireqty"]. " tires";

Search the manual or the list archives for "register_globals" and you'll get
loads of info about this.

Cheers
Jon

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



Re: [PHP] Training Help

2003-09-12 Thread Ryan Stagg
Thanks mate, problem kinda fixed, looks like this now...



Bob's Auto Parts - Order Results


Bob's Auto Parts
Order Results
Order Processed at ";
 echo date("H:i, ");
 echo "on ";
 echo date ("jS F");
 echo "";
 echo "Your order is as follows:";
 echo "";
 echo $tireqty." tires";
 echo $oilqty." bottles of oil";
 echo $sparkqty." spark plugs";
?>



Ryan


"Jon Haworth" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi Ryan,
>
> Sounds like register_globals is turned off on your server (this is
generally
> a Good Thing). Rather than having all your form fields converted directly
> into variables - which your book is assuming, as it's how PHP used to do
> it - you'll need to access them via the $_POST array.
>
> Try changing this line:
>
> >  echo $tireqty." tires";
>
> To this:
>
> echo $_POST["tireqty"]. " tires";
>
> Search the manual or the list archives for "register_globals" and you'll
get
> loads of info about this.
>
> Cheers
> Jon

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



Re: [PHP] Training Help

2003-09-12 Thread Jon Haworth
Hi Ryan,

> $tireqty = $_POST['tireqty'];
> $oilqty = $_POST['oilqty'];
> $sparkqty = $_POST['sparkqty'];

That'll certainly fix the problem, but it kind of defeats the point of using
$_POST :-)

Ideally you'd clean the data at this point to make sure no-one's trying to
submit anything nasty (Google on "SQL injection" for an idea of what can be
done).

Seeing as these are quantities, checking them via PHP's is_numeric()
function would probably be a good idea, and making sure they're inside
sensible ranges (between 0 and 50, say) might be worthwhile as well.

Cheers
Jon

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



Re: [PHP] Sending SMS messages ?

2003-09-12 Thread Raditha Dissanayake
Hi,
Goto http://kannel.org and download their sources. They have some sample 
PHP scripts to send sms. Obviously you will need a GSM modem or access 
to an SMSC to make full use of it.

all the best.

Dave Carrera wrote:

Hi All

Is there a way to send sms messages via php.

I really don’t know anything about this so any info,pointers or resources
will be very much appreciated.
Thank you in advance for any help.

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 01/09/2003
 



--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] caching program

2003-09-12 Thread Raditha Dissanayake
once upon a long ago someone (i belive his name is Hrvoje Niksic) wrote 
a program called wget so that people do not have to do all this :-)

Andrea Tricco wrote:

Hi,
I'm using the function "file_get_contents()" to replicate the content of a
remote html page on my server.
But, the function file_get_contents() works even when the name of the file
is not specified. For example:
"http://www.php.net"; rather that "http://php.net/index.php";

Does a method exist to know the name of the file received form web server?

I would like to write a program that automatically downloads the images
inserted into a html page.
For this reason, I need to determine the paths of the images in order to get
them from the web server.
In other words, my program should work as the "Save as" function (File menu)
of any Web browser.
Can anybody help me?

Best regards.
Andrea
 



--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Problem with HTML Text box and PHP variable.

2003-09-12 Thread Jay Blanchard
[snip]
 >>Use double quotes for HTML attributes.
 >
> Why do you say that?

Yeah, I figured someone would ask that. :) I couldn't find anything 
definitive on w3c.org; can someone back me up?

AFAIK, they are required in XML and XHTML. It's a good habit to get into

with regular HTML, also (although, yes, both will work in HTML).
[/snip]

The best form HTML attributes is within double quotes. This stems from
the parent language of all of the mark-up languages, SGML (standard
generalized mark-up language). XML and XHTML both more closely follow
the rules/recommendations of the parent language. HTML validation
engines genrally throw exceptions if attributes are not quoted. It has
always been considered good form.

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



Re: [PHP] input field masks

2003-09-12 Thread Brent Baisley
PHP is server side, it has nothing to do with client side, aside from 
server up some information. You can, and should, validate the input 
using PHP after it is submitted.
For client side validation you would need to use javascript. You can do 
what you are trying to do in javascript, but it will get very 
complicated since you need to use the onkeypress to capture and process 
each key stroke to make sure the / remain.
I think using PHP to validate after submission would be a lot easier 
and much more flexible. If you do it right, the user could put in 
something like +3 to enter a date three days from todays date.

On Friday, September 12, 2003, at 05:20 AM, Bobpilly wrote:

Hello all

I am trying to enforce input masks for dates that are viewable in a 
single
html text box. For example i would like a single tect box that the 
user will
see ##/##/ in and when they click on the field they will only be 
able to
enter digits in the ## areas the / will remain. Is php cable of doing 
this?

Thanks for any help in advance!

Cheers

Bob

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Fatal error: Call to undefined function: mysql_connect()

2003-09-12 Thread Jason Sheets
Are you using the bundled MySQL libraries under Unix/Linux?  What 
version of PHP are you running with what operating system?  If MySQL 
compiled as a module that must be loaded?

Jason

Naintara Jain wrote:

I get this error "Fatal error: Call to undefined function: mysql_connect() " in one 
script. whereas
phpMyAdmin is installed in another directory and it works fine.
Any ideas why?
-Naintara
 

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


Re: [PHP] Re: HTTP_REFERER

2003-09-12 Thread Miroslaw Milewski
Louie Miranda wrote:

 > no, im making a "send this page to a friend program"
 > when the users click the button a small pop-up window
 > will come out and the http_referer will work and catch
 > the previous page.
 I suppose you can achieve this using javascript's
window.opener.location.href reference.
--
miro.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] ESP survey builder

2003-09-12 Thread Yves Arsenault

Hello,

Has anyone ever used ESP survey builder?

I've just installed it and am starting to play with it

I'm wondering if there are any other survey building apps around...

TIA,

Yves Arsenault
Carrefour Infotech
5,promenade Acadian
Charlottetown, IPE
C1C 1M2
[EMAIL PROTECTED]
(902)368-1895 ext.242
ICQ #117650823
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Using PHP to do something with Acrobat PDF....

2003-09-12 Thread Scott Fletcher
Hi Fellas!!

Know of any good websites that would provide tutorials, step-by-step,
and/or a PHP scripts of creating a PDF, putting datas into PDF, along with
Printing PDF, Saving PDF files, etc...  I have no experience with using PHP
and PDF so I need both a tutorial and quick, plain to the point of PHP
script of PDF stuffs.  From there I can start reviewing on how it work, what
function is being used, etc.  Then look at all of the available PHP
functions for PDF, add what I need or take out what I don't need, etc.
(Customize), etc...

Another question, does using PDF require the use of some configuration
in php.ini??  How does PHP do the PDF stuffs if there is no PDF on the
server?  Etc...


Thanks!
  Scott F.

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



[PHP] Header and dfile download bug???

2003-09-12 Thread Tristan . Pretty
Hi all,
I have a download for that collects data from a user (name, e-mail etc) 
then I pass that info to a database and give them the file.
In the form, I pass two hidden variables, header and details_captured.
So when I post the form to $PHP_SELF, it detects this and then activates 
the header code, and hopefully gives the file to the user.
The $bu variable and others are from the previous form too.

So, it works great on my desktop here at work, but I just got a few mails 
from random users, who complained that they saw an error screen after 
trying to download pdf's.
Dunno if this is a PDF problem, or if my script is bad?

So, here is my code... (that site at the very top of my page.)
The headers after the else statement are simply to avoid page caching, so 
we can ignore them in this example.
So, why does this work for me and many others, but not all?



if (($header == 'collect') && ($details_captured == "yes")) {
session_start();
$path = "/home/site/download/$bu/$file";
header("Content-Disposition: attachment; filename=$file");
header("Content-Length: " . filesize($path));
header("Content-Type: " . filetype($path));
readfile("$path");
} else {
session_start();
Header("Cache-control: private, no-cache"); 
Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Past date
Header("Pragma: no-cache");
}


=

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Todd Cary




Warren -

Well, your ideas are working like a champ *AND* I am getting a little
better idea of how Applets work - "little" mind you!  However, another
challenge has emerged: why does it work in IE and not in Netscape 7.1?

The original test script contained this long assignment to the DATA
parameter in some sort of "crazy text".  At that time, I did not
understand the meaning of "param" nor did I think about BASE64
encoding.  And that is why in IE, the Editor had text in the initial
screen - it was assigned encoded text.

So, now the script works with IE but in the Netscape browser the
encoded text is not recognized.  Do you have any ideas as to why that
may be?  My need for a Java based HTML Editor is so folks at my
client's business who have Macs, PCs and Linux based computers can edit
HTML based text in a PHP app.

http://209.204.172.137/editor/ekit2.php

Todd

Vail, Warren wrote:

  
  
  
  
  Again, this is a guess, but it looks like two
parameters to the applet are used;
   
  One called Document and another to indicate
that BASE64 encoding was used to encode the html so that the browser
doesn't try to render the html into a page.
   
      when you output your form (FROM PHP, of course),
somehow include the following among the parameters for the applet;
   
  echo "base64_encode($htmlsource)."\"\n"
  ."\n";
   
  odds are against this working(I'm a
pessimist), but it is what I would try before moving on.
   
  Warren
  
  
-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 11, 2003 4:39 PM
To: Vail, Warren; [EMAIL PROTECTED]
Subject: Re: [PHP] Integrating an Applet with PHP


Warren -

That works...

http://209.204.172.137/editor/ekit.php

Now the next challenge is to put the value in $text into the HTML editor with some _javascript_...any suggestions?

Todd



Vail, Warren wrote:

  There may be other methods, but one that seems to be available from your form will require some _javascript_ code.  Clicking the button located below the applet (onclick event), performs an assignment to the textarea.value (located below the button) the result returned from the applet.gettext() method (actual statement below).

document.EkitDemoForm.TextViewer.value = document.EkitDemoForm.Ekit.getDocumentText();

I would suspect you could to this assignment to a hidden html field and then do a form submit to pass the "hidden" value to your php program on your server.  Don't forget to have your form action field invoke your php program and with method=post you could retrieve the value as below; 

$htmltext = $_POST["hiddenfld"];

hope this helps,

Warren Vail


-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 11, 2003 3:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Integrating an Applet with PHP


I have located an HTML editor written in Java that works with my clients 
various computers (e.g. Linux, PC and Macs).  What I need to do is learn 
how to take the output from an Applet and put it into a PHP variable.  
Since I have no experience with Java, I am at a disadvantage, so if 
someone could point me toward some literature that explains this or if 
someone already has the experience and can look at the source and tell 
me how, it would be greatly appreciated.

http://209.204.172.137/editor/ekit.php

Todd
  


-- 

  


-- 



<>

Re: [PHP] Re: URGENT BUSINESS RELATIONSHIP

2003-09-12 Thread Mark

--- [EMAIL PROTECTED] wrote:
> lol The Lodge
> 
> hey check this out
> 
> http://www.potifos.com/fraud/
> and this
> 
> http://www.nigerian419fraud.freeserve.co.uk/
> 
> i did find a link from this list about a site where the guy
> actually sent
> false details and the guy believed him, i think he sent a passport
> of
> himself as captian kirk LOL

http://www.haxial.com/spls-soapbox/nigerian-fraud/
http://www.scamorama.com/threebucks.html


> 
> > No!  That $15 million is mine!  I feel so honoured that you have
> picked
> > me!
> >
> > Send me the details!  Address them to
> >
> > The Lodge
> > Canberra ACT
> > Australia
> >
> > Perhaps I can fly over to meet you and your money.  I have no
> > suspicions that you will kill me or anything!
> >
> >
> > Regards,
> > Bob Irwin
> > Server Admin & Web Apps
> > - Original Message -
> > From: "Cody Phanekham" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, September 12, 2003 10:36 AM
> > Subject: RE: [PHP] Re: URGENT BUSINESS RELATIONSHIP
> >
> >
> > What are you talking about? This is a once in a life time
> opportunity!
> > who hasnt dreamt of receiving 15 million for doing absolutely
> nothing
> >
> > contact me benny boy !! my number is 0055 all night long O_o
> >
> >> -Original Message-
> >> From: Shadow [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, 12 September 2003 04:14
> >> To: [EMAIL PROTECTED]
> >> Subject: [PHP] Re: URGENT BUSINESS RELATIONSHIP
> >>
> >>
> >> God!!! This crap is even following me to the newsgroups!
> >> Shadow
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
> >
>

> > *
> > This e-mail, including any attachments to it, may contain
> confidential
> > and/or personal information.
> > If you have received this e-mail in error, you must not copy,
> > distribute, or disclose it, use or take any action
> > based on the information contained within it.
> >
> > Please notify the sender immediately by return e-mail of the
> error and
> > then delete the original e-mail.
> >
> > The information contained within this e-mail may be solely the
> opinion
> > of the sender and may not necessarily
> > reflect the position, beliefs or opinions of Salmat on any issue.
> >
> > This email has been swept for the presence of computer viruses
> known to
> > Salmat's anti-virus systems.
> >
> > For more information, visit our website at  www.salmat.com.au.
> >
>

> > *
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > Scanned by PeNiCillin http://safe-t-net.pnc.com.au/
> >
> > --
> > 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
> 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: [PHP] caching program

2003-09-12 Thread Ryan Gibson
On 17/9/03 12:18 pm, "Andrea Tricco" <[EMAIL PROTECTED]> wrote:

> Thus, the equivocal paths are the problem, for example:
> 
> www.php.net/manual/it/index.php
> 
> www.php.net/manual/it/
>

For the above examples the url is the string up to the last '/' char (as
long as the string after the '/' char has an extension ie a dot and three or
chars)

> www.php.net/manual/it
> 

This is a bit more tricky, you could just grab the url with and without the
'/' char and compare the two strings (messy I know) and probably won't work
every time, but what does!


Ryan Gibson
---
[EMAIL PROTECTED]

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



RE: RE: [PHP] getting download resume to work

2003-09-12 Thread Scott Dotson
All answers are below your questions...
Thank you for taking the time to parse through my code and try to understand
what I am doing, I really appreciate it, this is the first time I have tried
something like this and have been hung up on it for a couple days now...
Scott

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 8:21 PM
To: Raditha Dissanayake; Scott Dotson; [EMAIL PROTECTED]
Subject: Re: [PHP] getting download resume to work


Can you help explain this code? It looks like you're on the right track but
have a few flaws (at first glance).

>  session_cache_limiter('public');
> session_start();

Is there a reason to be using sessions here?
>>>ANS: not really as of yet, but, there will be as I will be
restricting downloads to authenticated users...

> set_time_limit(0);
> $file=$_REQUEST['file'];
> $extstart=strpos($file, ".");

What does $extstart contain now?
>>>ANS: just the first part of the name, before the extension, (for no
reason)

> $ext=substr($file, $extstart+1);

So $ext is now a piece of the file. Why?
>>>ANS: this is done so that I can set the
==header("Content-Type: application/".$ext);==

> $dir="d:\\downloadable_courses";
> $size=filesize($dir."\\".$file);
> header("Accept-Ranges: bytes");

So $size is now the size of the entire file (not the piece).
>>>ANS: correct

> if(isset($_ENV['HTTP_RANGE'])) {
>  list($a, $range)=explode("=",$_ENV['HTTP_RANGE']);

So $a is now bytes, and $range is something like 123-456
>>>ANS: partly correct, what I receive is
=="Range: bytes=14232-"==
it has no last number.

>  str_replace($range, "-", $range);

This makes no sense. The range requested is bytes 123 through 456, and
you're
converting this to 123456. Why?
>>>ANS: when I left it on what it would send to the browser would be
=="header("Content-Range: 123--456/457");"==
(it would tack on an extra dash symbol (-) and the browser did not
understand it)

>  $size2=$size-1;
>  header("Content-Range: $range$size2/$size");
>  $new_length=$size2-$range;

This will definitely not work, based on my comments above.
>>>ANS: it appears to work enough that FlashGet will try to
recover/resume and it completes, but, the byte count is always off by around
1 or so bytes and I cannot figure out why...

If someone sends this header:

Range: bytes=0-1023

and your resource is 2048 bytes in size, your response should include this
header:

Content-Range: bytes 0-1023/2048

Work on generating the correct string before you bother actually using them
as
headers and trying for the full solution.
>>>ANS: I have set it to log to a text file previously and it is always
1 byte different.  I am at a total loss as to where it is happening, I will
attach the the log files that I have been pouring over as well the actual
script to you...

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
/
\\\LOGGED FROM PHP AS HEADERS SENT\\\
/

DOWNLOAD FILE -RESUME ONCE- FILE CORRUPT

FROM INITIAL
CONTENT-RANGE = 0-2510096/2510097
CONTENT-LENGTH = 2510097

FROM RESUME=
HTTP_RANGE = 1179140-
CONTENT-RANGE = 1179140-2510096/2510097
CONTENT-LENGTH = 1330956

/
FROM FLASHGET LOGS\\\
/

===WHILE PAUSED===

Fri Sep 12 07:46:30 2003 Connecting dotson.mine.nu:80
Fri Sep 12 07:46:30 2003 Connecting dotson.mine.nu [IP=65.243.148.6:80]
Fri Sep 12 07:46:30 2003 Connected.
Fri Sep 12 07:46:30 2003 GET /americas-best/download_test.php?file=getrt502.exe 
HTTP/1.1
Fri Sep 12 07:46:30 2003 Host: dotson.mine.nu
Fri Sep 12 07:46:30 2003 Accept: */*
Fri Sep 12 07:46:30 2003 Referer: 
http://dotson.mine.nu/americas-best/download_test_form.php
Fri Sep 12 07:46:30 2003 User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)
Fri Sep 12 07:46:30 2003 Pragma: no-cache
Fri Sep 12 07:46:30 2003 Cache-Control: no-cache
Fri Sep 12 07:46:30 2003 Connection: close
Fri Sep 12 07:46:31 2003 HTTP/1.1 200 OK
Fri Sep 12 07:46:31 2003 Server: Microsoft-IIS/5.0
Fri Sep 12 07:46:31 2003 Date: Fri, 12 Sep 2003 14:46:20 GMT
Fri Sep 12 07:46:31 2003 X-Powered-By: ASP.NET
Fri Sep 12 07:46:31 2003 Connection: close
Fri Sep 12 07:46:31 2003 X-Powered-By: PHP/4.3.2
Fri Sep 12 07:46:31 2003 Set-Cookie: PHPSESSID=ca1ae38082e9cde9b945f5facc9e4d0e; path=/
Fri Sep 12 07:46:31 2003 Expires: Fri, 12 Sep 2003 17:46:20 GMT
Fri Sep 12 07:46:31 2003 Cache-Control: pub

[PHP] Simple (?) var_dump question

2003-09-12 Thread Thomas Panzarella
Hi.  I'm new to the list so sorry if this has already been asked before ...

I want to find a way to capture the var_dump output as a string so I can write it to a 
log file ... (for example):

$logger->debug(var_dump($foo));

So, the above line would get a "var_dump stringified" version of $foo and pass it to 
my logger's debug method.

Thanks in advance for any help.

Tom.

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



Re: [PHP] Simple (?) var_dump question

2003-09-12 Thread CPT John W. Holmes
From: "Thomas Panzarella" <[EMAIL PROTECTED]>

> Hi.  I'm new to the list so sorry if this has already
> been asked before ...
>
> I want to find a way to capture the var_dump
> output as a string so I can write it to a log file ...
> (for example):
>
> $logger->debug(var_dump($foo));
>
> So, the above line would get a "var_dump
> stringified" version of $foo and pass it to my
> logger's debug method.

You need to use output buffering to capture the output with var_dump.

Or you can use print_r(), which will give you a similar output and can be
returned to a varible.

---John Holmes...

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



[PHP] information

2003-09-12 Thread hatem gouda

Dear Miss/Mrs./Mr.
I intend to move to Australia and work there as an auditor or an accountant.So I'd 
like to be familiar with Australian accounting environment before I move to there.
So I'd like you to give me some information about "MYOB Accountants Office" and 
"MYOB Tax"like:
* Where can I have courses about them in Egypt ,or How I could have courses by distant 
 education if there is no courses available in Egypt?
* Where can I find self-study books or CDs about them and what is the title of these 
books or CDs(Can I get them free or there are a fee for having them how mush it could 
be).
   I'll be waiting for your reply, 
Wish you all the best,
 
  
Yours faithfully,
   Hatem 
A. Gouda   












-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Re: [PHP] getting download resume to work

2003-09-12 Thread Scott Dotson
All answers are below your questions...
Thank you for taking the time to parse through my code and try to understand
what I am doing, I really appreciate it, this is the first time I have tried
something like this and have been hung up on it for a couple days now...
Scott

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 8:21 PM
To: Raditha Dissanayake; Scott Dotson; [EMAIL PROTECTED]
Subject: Re: [PHP] getting download resume to work


Can you help explain this code? It looks like you're on the right track but
have a few flaws (at first glance).

>  session_cache_limiter('public');
> session_start();

Is there a reason to be using sessions here?
>>>ANS: not really as of yet, but, there will be as I will be
restricting downloads to authenticated users...

> set_time_limit(0);
> $file=$_REQUEST['file'];
> $extstart=strpos($file, ".");

What does $extstart contain now?
>>>ANS: just the first part of the name, before the extension, (for no
reason)

> $ext=substr($file, $extstart+1);

So $ext is now a piece of the file. Why?
>>>ANS: this is done so that I can set the
==header("Content-Type: application/".$ext);==

> $dir="d:\\downloadable_courses";
> $size=filesize($dir."\\".$file);
> header("Accept-Ranges: bytes");

So $size is now the size of the entire file (not the piece).
>>>ANS: correct

> if(isset($_ENV['HTTP_RANGE'])) {
>  list($a, $range)=explode("=",$_ENV['HTTP_RANGE']);

So $a is now bytes, and $range is something like 123-456
>>>ANS: partly correct, what I receive is
=="Range: bytes=14232-"==
it has no last number.

>  str_replace($range, "-", $range);

This makes no sense. The range requested is bytes 123 through 456, and
you're
converting this to 123456. Why?
>>>ANS: when I left it on what it would send to the browser would be
=="header("Content-Range: 123--456/457");"==
(it would tack on an extra dash symbol (-) and the browser did not
understand it)

>  $size2=$size-1;
>  header("Content-Range: $range$size2/$size");
>  $new_length=$size2-$range;

This will definitely not work, based on my comments above.
>>>ANS: it appears to work enough that FlashGet will try to
recover/resume and it completes, but, the byte count is always off by around
1 or so bytes and I cannot figure out why...

If someone sends this header:

Range: bytes=0-1023

and your resource is 2048 bytes in size, your response should include this
header:

Content-Range: bytes 0-1023/2048

Work on generating the correct string before you bother actually using them
as
headers and trying for the full solution.
>>>ANS: I have set it to log to a text file previously and it is always
1 byte different.  I am at a total loss as to where it is happening, I will
attach the the log files that I have been pouring over as well the actual
script to you...

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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


begin 666 script.txt
M/#]P:' -"G-EPT*"6AE861E<[EMAIL PROTECTED]&]C871I;VXZ("XO:[EMAIL PROTECTED]<&AP(BD[#0H)
M97AI=#L-"GT-"B1F:6QE/21?4D5154535%LG9FEL92==.PT*)&5X='-T87)T
M/7-T'0]F4]9FEL97-I>F4H)&1I71EPT*"6QIF4R/21S:7IE+3$[#0H):&5A9&5R*")#;VYT96YT+5)A
M;F=E.B DF4B*3L-"@DD;F5W7VQE;F=T:#TDF4R+R1S:7IE7')<
M;B(I.PT*"69P=71S*"1F:6QE7W=R+" B0T].5$5.5"U,14Y'5$@@/2 D;F5W
M7VQE;F=T:%QR7&YF4R*3L-
M"GT-"FAE861E<[EMAIL PROTECTED]&5N="U4>7!E.B!A<'!L:6-A=&EO;B\B+B1E>'0I
M.PT*:&5A9&5R*")#;VYT96YT+41IF4@/2!S:7IE*"1F:6QE;F%M92D[( T*)&9P([EMAIL PROTECTED]
M96XH)R1F:6QE;F%M92R -"B @("!P"UT87(-"D-O;G1E;G0M1&ES<&]S:71I;VXZ
M(&EN;&[EMAIL PROTECTED];64];6%E71E"UA9V4],3 X,# -"D9R:2!397 @,3(@,#&4-"D9R:2!397 @,3(@,#&4-"D-O;6UE;[EMAIL PROTECTED]http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Dan Anderson
> why does it work in IE and not in Netscape 7.1?

I'm pretty sure ActiveX controls don't run on anything besides MS
Windows Lockinware (TM).  There are a number of other things that
netscape does not fully support (try loading a page with an iframe tag
in Netscape).  You probably ran into another such problem.

-Dan

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



Re: [PHP] Simple (?) var_dump question

2003-09-12 Thread Chris Boget
> > So, the above line would get a "var_dump
> > stringified" version of $foo and pass it to my
> > logger's debug method.
> You need to use output buffering to capture the output with var_dump.
> Or you can use print_r(), which will give you a similar output and can be
> returned to a varible.

Not true.  You have to use output buffering for print_r() as well.  print_r()
just returns a boolean value.  
It'd be nice if you could have it so that either (or both) print_r() or var_dump()
could return a value w/o using buffering...

Chris

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



[PHP] help with message from tech support

2003-09-12 Thread Sam Folk-Williams
Hi,

I posted about the below issue yesterday, following is the follow-up from
tech support. Are they saying the server was hacked? Is there anything I can
do on my end, or does this sound like their problem?

> When I try to visit the site I get this strage error message: php-engine:
file /home/k/h/user191796/html/myAdmin/index.php has incorrect uid/gid for
effective uid 51 (2116/2116)
>
> Or, the browser (IE 6 with latest update) displays a file download
dialogue instead of displayng the page.
>
> This site has worked completely fine for the past 6 months, so I'm sure
it's not the code. This just suddenly started happening late last night.
This seems like a server problem to me.
>
> Sam
>
>
>
> Solution history on ticket:
> 9/11/2003 6:49:55 PM - Yemi A.:
> Sam Folk-Williams,
> Thanks for contacting technical support.
>
> Our engineers have determined that these issues are being caused by
malicious activity. This is being done by a footer being inserted into the
pages by IIS.  It is not actually modifying any of your code or compromising
any of your passwords. Due to the severity of this issue, we are directing
all available external and internal resources to minimize the impact to our
customers and to prevent future re-occurrences.
>
> We are committed to continue working around the clock to resolve these
issues. We apologize for the inconvenience and thank you for your patience.
>


-- 
Sam Folk-Williams
Service Team Leader/Webmaster
Rise, Inc -- Creative Partnerships South
(952) 884 8330 (V);  (952) 884 8371 (F)
www.rise.org

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



RE: [PHP] Simple (?) var_dump question

2003-09-12 Thread Wouter van Vliet
aiaiaia ... you are all pretty right, for another function was forged.
var_export has a "return" flag as second argument where print_r and var_dump
both have other variables as second (and third, and fourth, and sixth) ..

So you can do: $logger->debug(var_export($Var), true)); which will log the
var to your log.

 -> -Oorspronkelijk bericht-
 -> Van: Chris Boget [mailto:[EMAIL PROTECTED]
 -> Verzonden: vrijdag 12 september 2003 18:34
 -> Aan: CPT John W. Holmes; Thomas Panzarella; [EMAIL PROTECTED]
 -> Onderwerp: Re: [PHP] Simple (?) var_dump question
 ->
 ->
 -> > > So, the above line would get a "var_dump
 -> > > stringified" version of $foo and pass it to my
 -> > > logger's debug method.
 -> > You need to use output buffering to capture the output with var_dump.
 -> > Or you can use print_r(), which will give you a similar
 -> output and can be
 -> > returned to a varible.
 ->
 -> Not true.  You have to use output buffering for print_r() as
 -> well.  print_r()
 -> just returns a boolean value.
 -> It'd be nice if you could have it so that either (or both)
 -> print_r() or var_dump()
 -> could return a value w/o using buffering...
 ->
 -> Chris
 ->
 -> --
 -> 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] help with message from tech support

2003-09-12 Thread Raditha Dissanayake
Hi Sam,
Surely it couldn't have been hacked? IIS is the most secure web server  
you have seen their advertisements :-)

Sam Folk-Williams wrote:

Hi,

I posted about the below issue yesterday, following is the follow-up from
tech support. Are they saying the server was hacked? Is there anything I can
do on my end, or does this sound like their problem?
 

When I try to visit the site I get this strage error message: php-engine:
   

file /home/k/h/user191796/html/myAdmin/index.php has incorrect uid/gid for
effective uid 51 (2116/2116)
 

Or, the browser (IE 6 with latest update) displays a file download
   

dialogue instead of displayng the page.
 

This site has worked completely fine for the past 6 months, so I'm sure
   

it's not the code. This just suddenly started happening late last night.
This seems like a server problem to me.
 

Sam



Solution history on ticket:
9/11/2003 6:49:55 PM - Yemi A.:
Sam Folk-Williams,
Thanks for contacting technical support.
Our engineers have determined that these issues are being caused by
   

malicious activity. This is being done by a footer being inserted into the
pages by IIS.  It is not actually modifying any of your code or compromising
any of your passwords. Due to the severity of this issue, we are directing
all available external and internal resources to minimize the impact to our
customers and to prevent future re-occurrences.
 

We are committed to continue working around the clock to resolve these
   

issues. We apologize for the inconvenience and thank you for your patience.
 



 

--
Raditha Dissanayake
--
http://www.radinks.com/sftp/?sg
Lean and mean secure FTP applet in pure java.
Complete with Graphical User Inteface Just 150 kb in size. 

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


[PHP] Cookie advice

2003-09-12 Thread James Johnson
Hi,

I have a "Remember me on this computer" check box, which sets a cookie for
future logins. What's the consensus on when a cookie of this type should
expire? I currently have it set for 30 days.

Thanks,
James

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



Re: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Raditha Dissanayake
mozzilla 1.4. and netscape 7.1 support iframe. Hey the applet looks 
pretty neat is it open source?

Dan Anderson wrote:

why does it work in IE and not in Netscape 7.1?
   

I'm pretty sure ActiveX controls don't run on anything besides MS
Windows Lockinware (TM).  There are a number of other things that
netscape does not fully support (try loading a page with an iframe tag
in Netscape).  You probably ran into another such problem.
-Dan

 

--
Raditha Dissanayake
--
http://www.radinks.com/sftp/?sg
Lean and mean secure FTP applet in pure java.
Complete with Graphical User Inteface Just 150 kb in size. 

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


Re: [PHP] help with message from tech support

2003-09-12 Thread R'twick Niceorgaw
Sam Folk-Williams said the following on 9/12/2003 12:32 PM>>

Hi,

I posted about the below issue yesterday, following is the follow-up from
tech support. Are they saying the server was hacked? Is there anything I can
do on my end, or does this sound like their problem?
 

When I try to visit the site I get this strage error message: php-engine:
   

file /home/k/h/user191796/html/myAdmin/index.php has incorrect uid/gid for
effective uid 51 (2116/2116)
 

Or, the browser (IE 6 with latest update) displays a file download
   

dialogue instead of displayng the page.
 

This site has worked completely fine for the past 6 months, so I'm sure
   

it's not the code. This just suddenly started happening late last night.
This seems like a server problem to me.
 

Sam



Solution history on ticket:
9/11/2003 6:49:55 PM - Yemi A.:
Sam Folk-Williams,
Thanks for contacting technical support.
Our engineers have determined that these issues are being caused by
   

malicious activity. This is being done by a footer being inserted into the
pages by IIS.  It is not actually modifying any of your code or compromising
any of your passwords. Due to the severity of this issue, we are directing
all available external and internal resources to minimize the impact to our
customers and to prevent future re-occurrences.
 

We are committed to continue working around the clock to resolve these
   

issues. We apologize for the inconvenience and thank you for your patience.
 



 

Are you sure they have IIS running? the erro message you mentioned on 
top gives me a feeling its a *nix system?

could it be possible that they upgraded their system recently and 
screwed up something?

R'twick

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


Re: [PHP] Simple (?) var_dump question

2003-09-12 Thread CPT John W. Holmes
From: "Wouter van Vliet" <[EMAIL PROTECTED]>


> aiaiaia ... you are all pretty right, for another function was forged.
> var_export has a "return" flag as second argument where print_r and
var_dump
> both have other variables as second (and third, and fourth, and sixth) ..
>
> So you can do: $logger->debug(var_export($Var), true)); which will log the
> var to your log.

print_r() is also a BOOL for the second argument that controls whether a
value is returned or displayed.

The only difference between print_r() and var_export() produces valid PHP
code.

The output from var_export() can only be captured with output buffering.

---John Holmes...

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



Re: [PHP] getting download resume to work

2003-09-12 Thread Scott Dotson
got it to work using fseek,
feel like a bozo posting this when it was my lack of thinking in the first
place as to why it didn't work.
thanks all for the help...
Scott

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Can you help explain this code? It looks like you're on the right track
but
> have a few flaws (at first glance).
>
> >  > session_cache_limiter('public');
> > session_start();
>
> Is there a reason to be using sessions here?
>
> > set_time_limit(0);
> > $file=$_REQUEST['file'];
> > $extstart=strpos($file, ".");
>
> What does $extstart contain now?
>
> > $ext=substr($file, $extstart+1);
>
> So $ext is now a piece of the file. Why?
>
> > $dir="d:\\downloadable_courses";
> > $size=filesize($dir."\\".$file);
> > header("Accept-Ranges: bytes");
>
> So $size is now the size of the entire file (not the piece).
>
> > if(isset($_ENV['HTTP_RANGE'])) {
> >  list($a, $range)=explode("=",$_ENV['HTTP_RANGE']);
>
> So $a is now bytes, and $range is something like 123-456
>
> >  str_replace($range, "-", $range);
>
> This makes no sense. The range requested is bytes 123 through 456, and
you're
> converting this to 123456. Why?
>
> >  $size2=$size-1;
> >  header("Content-Range: $range$size2/$size");
> >  $new_length=$size2-$range;
>
> This will definitely not work, based on my comments above.
>
> If someone sends this header:
>
> Range: bytes=0-1023
>
> and your resource is 2048 bytes in size, your response should include this
> header:
>
> Content-Range: bytes 0-1023/2048
>
> Work on generating the correct string before you bother actually using
them as
> headers and trying for the full solution.
>
> Hope that helps.
>
> Chris
>
> =
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/

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



[PHP] Using PHP to generate Acrobat PDF...

2003-09-12 Thread Scott Fletcher
Anyone have experience with it?  Anyone of good information where I can do
some research on?

Thanks...

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



Re: [PHP] Simple (?) var_dump question

2003-09-12 Thread CPT John W. Holmes
From: "CPT John W. Holmes" <[EMAIL PROTECTED]>

> The only difference between print_r() and var_export() produces valid PHP
> code.

That should say var_export() produces valid PHP code, while print_r() does
not.

---John Holmes...

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



RE: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Vail, Warren
I'm not sure about the relationship between an applet and an ActiveX control, and most 
of my development is for IE browsers (they have 90% of the market I hear), so I'm not 
sure I can help much here.  If you can break down what works and what doesn't, it 
might help.

If the applet doesn't run correctly, I'd look for some Java release compatibility 
(maybe where activex comes into play).  I think you can update the java release for 
the NS browser, but you'll have to get each user to do that.

If, on the other hand, the problem is with the JavaScript, you should be able to 
conditionally generate working JavaScript for each browser (see PHP get_browser().  
You might also enquire about the specs for the editing tool, to see if it supports 
other methods of encoding the document.

Wish I could be of more help here, but I've about reached the end of my chain 
(knowledge) on this one.  I guess it would be too much to ask, but if you have the 
Java source, most people can sort of read Java, even though they are not proficient 
with it, and that could tell you a lot.

I am implementing a site with an Iframe, and having no problems with recent releases 
of Netscape, older releases are a problem, even with IE.

I have another site that does WYSIWYG editing in IE and provides a TEXTAREA for those 
NS users who insist on using stone axes, and it presents one or the other by detecting 
the browser in php.

good luck,

Warren Vail

-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED]
Sent: Friday, September 12, 2003 9:10 AM
To: Todd Cary
Cc: Vail, Warren; PHP List
Subject: Re: [PHP] Integrating an Applet with PHP


> why does it work in IE and not in Netscape 7.1?

I'm pretty sure ActiveX controls don't run on anything besides MS
Windows Lockinware (TM).  There are a number of other things that
netscape does not fully support (try loading a page with an iframe tag
in Netscape).  You probably ran into another such problem.

-Dan

-- 
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] Calling a function.

2003-09-12 Thread Vincent M.
Hello,

Is there any way to call a function with a variable inside the call. ie:

 if($preferences != "") {
   dis_display$$preferences() ;
 }
If $preferences = "menus" this will call the function dis_displaymenus()

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


RE: [PHP] Simple (?) var_dump question [summarization]

2003-09-12 Thread Wouter van Vliet
WHOW .. that bool parameter never found it's way to me .. untill now ..
appears to be a new one in PHP4.3.

So, now let's summarize the var dumping and export functions:

print_r($mixed, [bool return])
- Produces quite readable output

var_export($mixed, [bool return])
- Produces valid php code

var_dump($mixed, $mixed1, ..)
- Produces quite unreadable and invalid php code
- tells you exactly what the type of your variable is

Think I got it quite right and complete, didn't I?

Wouter

 -> -Oorspronkelijk bericht-
 -> Van: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
 -> Verzonden: vrijdag 12 september 2003 19:06
 -> Aan: Wouter van Vliet; Chris Boget; Thomas Panzarella;
 -> [EMAIL PROTECTED]
 -> Onderwerp: Re: [PHP] Simple (?) var_dump question
 ->
 ->
 -> From: "Wouter van Vliet" <[EMAIL PROTECTED]>
 ->
 ->
 -> > aiaiaia ... you are all pretty right, for another function was forged.
 -> > var_export has a "return" flag as second argument where print_r and
 -> var_dump
 -> > both have other variables as second (and third, and fourth,
 -> and sixth) ..
 -> >
 -> > So you can do: $logger->debug(var_export($Var), true)); which
 -> will log the
 -> > var to your log.
 ->
 -> print_r() is also a BOOL for the second argument that controls whether a
 -> value is returned or displayed.
 ->
 -> The only difference between print_r() and var_export() produces
 -> valid PHP
 -> code.
 ->
 -> The output from var_export() can only be captured with output buffering.
 ->
 -> ---John Holmes...
 ->
 -> --
 -> PHP General Mailing List (http://www.php.net/)
 -> To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] Calling a function.

2003-09-12 Thread CPT John W. Holmes
From: "Vincent M." <[EMAIL PROTECTED]>
> Is there any way to call a function with a variable inside the call. ie:
> 
>   if($preferences != "") {
> dis_display$$preferences() ;

$functon = "dis_play$preferences";
$function();

---John Holmes...

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



Re: [PHP] help with message from tech support

2003-09-12 Thread Sam Folk-Williams
It's definitely possible they upgraded recently and screwed up somethng.
They are interland (www.interland.com) -- a pretty big host. The company I
work for has had tons of problems with them, though -- the site goes down a
lot. I'm wondering if this is really "malicious" or if they just screwed up.

Sam


"R'Twick Niceorgaw" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Sam Folk-Williams said the following on 9/12/2003 12:32 PM>>
>
> >Hi,
> >
> >I posted about the below issue yesterday, following is the follow-up from
> >tech support. Are they saying the server was hacked? Is there anything I
can
> >do on my end, or does this sound like their problem?
> >
> >
> >
> >>When I try to visit the site I get this strage error message:
php-engine:
> >>
> >>
> >file /home/k/h/user191796/html/myAdmin/index.php has incorrect uid/gid
for
> >effective uid 51 (2116/2116)
> >
> >
> >>Or, the browser (IE 6 with latest update) displays a file download
> >>
> >>
> >dialogue instead of displayng the page.
> >
> >
> >>This site has worked completely fine for the past 6 months, so I'm sure
> >>
> >>
> >it's not the code. This just suddenly started happening late last night.
> >This seems like a server problem to me.
> >
> >
> >>Sam
> >>
> >>
> >>
> >>Solution history on ticket:
> >>9/11/2003 6:49:55 PM - Yemi A.:
> >>Sam Folk-Williams,
> >>Thanks for contacting technical support.
> >>
> >>Our engineers have determined that these issues are being caused by
> >>
> >>
> >malicious activity. This is being done by a footer being inserted into
the
> >pages by IIS.  It is not actually modifying any of your code or
compromising
> >any of your passwords. Due to the severity of this issue, we are
directing
> >all available external and internal resources to minimize the impact to
our
> >customers and to prevent future re-occurrences.
> >
> >
> >>We are committed to continue working around the clock to resolve these
> >>
> >>
> >issues. We apologize for the inconvenience and thank you for your
patience.
> >
> >
> >
> >
> >
> >
> Are you sure they have IIS running? the erro message you mentioned on
> top gives me a feeling its a *nix system?
>
> could it be possible that they upgraded their system recently and
> screwed up something?
>
> R'twick

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



Re: [PHP] Using PHP to generate Acrobat PDF...

2003-09-12 Thread Simon Stiefel
On 12 Sep 2003 at 13:17, Scott Fletcher wrote:

> Anyone have experience with it?  Anyone of good information where I can do
> some research on?

Have a look at www.pdflib.com.
They also have a great documentation for it.
We use it to put our company logo at the top af some PDF documents.
Works perfectly!

> Thanks...

HTH,

Simon

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



Re: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Todd Cary




Dan -

I am surprised that an Open Source applet would rely on ActiveX.  It
appears that there is something I am not doing correctly in setting the
DATA param for Netscape.

Please overlook my ignorance about browsers and applets as I try to get
a better understanding, but is BASE64 encoding/decoding a feature of IE
and not , possibly, of  Netscape?

Todd

Dan Anderson wrote:

  
why does it work in IE and not in Netscape 7.1?

  
  
I'm pretty sure ActiveX controls don't run on anything besides MS
Windows Lockinware (TM).  There are a number of other things that
netscape does not fully support (try loading a page with an iframe tag
in Netscape).  You probably ran into another such problem.

-Dan


  


-- 



<>

[PHP] email attachment cannot be opened

2003-09-12 Thread Chris Hayes
hi,
I've made a form to send out emails with attachments, and the attachments 
look ok when they arrive but the content is somehow bad. I cannot open gifs 
nor can word open the documents. Looking at the content something may be 
wrong with the encoding: if i open the GIF file the normal one as well as 
the attachment I sent start with GIF89a, but then they start to be different.
I think this is the relevant part of my code:

	$atta_type=$_FILES['AttachedFile']['type'];
			if 
(strpos($atta_type,';')){$atta_type=substr($atta_type,0,strpos($atta_type,';'));} 
//for  Opera
	$atta_tmp_name=$_FILES['AttachedFile']['tmp_name'];
		
	$fp = fopen($atta_tmp_name,"rb");
	 	while (!feof($fp)){$filedata .= addslashes(fread($fp,1200));}

	   $filedata = chunk_split(base64_encode($filedata));

   $attachment = $atta_type."\n\n"
."--$boundary\n"
."Content-Type: $atta_type"."; name = \"$atta_name\"\n"
."Content-Transfer-Encoding: $encoding"
."\n\n$filedata\n\n"
."--$boundary--\n";
Just for fun the headers as well:

			'From: "SENSE mailinglist" <[EMAIL PROTECTED]>'
			'Subject: '.$subject
			'Reply-To: [EMAIL PROTECTED]'
			'Return-Receipt-To: [EMAIL PROTECTED]'
			'Return-Path: [EMAIL PROTECTED]'
			'MIME-Version: 1.0'
 			'Content-Type: multipart/mixed; 
boundary="'.$boundary."\"\n\n");'To: SENSE_List'
 			
			"This is a MIME encoded message. \n\n"
			."--$boundary\n"
			."Content-Type: ".(($IsHTML)?'text/html':'text/plain')."\n"
			."Content-Transfer-Encoding: 8bit\n\n"
			.$mailbody .$message

	

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


Re: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Todd Cary




Warren -

The Java code is available at http://www.hexidec.com/ekitdemo.php.

One of the reasons I need this applet working in non-IE browsers is
that my client has staff that use Macs and need to access the site from
the field...

Todd

Vail, Warren wrote:

  I'm not sure about the relationship between an applet and an ActiveX control, and most of my development is for IE browsers (they have 90% of the market I hear), so I'm not sure I can help much here.  If you can break down what works and what doesn't, it might help.

If the applet doesn't run correctly, I'd look for some Java release compatibility (maybe where activex comes into play).  I think you can update the java release for the NS browser, but you'll have to get each user to do that.

If, on the other hand, the problem is with the _javascript_, you should be able to conditionally generate working _javascript_ for each browser (see PHP get_browser().  You might also enquire about the specs for the editing tool, to see if it supports other methods of encoding the document.

Wish I could be of more help here, but I've about reached the end of my chain (knowledge) on this one.  I guess it would be too much to ask, but if you have the Java source, most people can sort of read Java, even though they are not proficient with it, and that could tell you a lot.

I am implementing a site with an Iframe, and having no problems with recent releases of Netscape, older releases are a problem, even with IE.

I have another site that does WYSIWYG editing in IE and provides a TEXTAREA for those NS users who insist on using stone axes, and it presents one or the other by detecting the browser in php.

good luck,

Warren Vail

-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 12, 2003 9:10 AM
To: Todd Cary
Cc: Vail, Warren; PHP List
Subject: Re: [PHP] Integrating an Applet with PHP


  
  
why does it work in IE and not in Netscape 7.1?

  
  
I'm pretty sure ActiveX controls don't run on anything besides MS
Windows Lockinware (TM).  There are a number of other things that
netscape does not fully support (try loading a page with an iframe tag
in Netscape).  You probably ran into another such problem.

-Dan

  


-- 



<>

RE: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Dan Anderson
> I am implementing a site with an Iframe, and having no problems with recent releases 
> of Netscape, older releases are a problem, even with IE.

Try running Netscape 7.1 on Linux and the iframe may be broken under
certain conditions.  

As always, your mileage may vary, and they may have patched Netscape by
now.

-Dan

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



Re: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Dan Anderson
Microsoft (being a monopoly) decided it did not want to follow Sun's
java standard and effectively froze their version of Java available in
IE @ Java 2 1.2 .  (or something like that -- they're currently
finishing up Java 2 1.5).  So if you wanted to use certain things with
microsoft you either needed to use ActiveX controls (Microsoft's answer
to Java) or Java 1.2 functionality (and there is some talk that
Microsoft will drop all support for Java in its next version of IE).

So, either (1 of the 3):

a.  You must install Sun's Java Plug In for all computers running your
program.  (If it relies on java > 1.2).
b.  You must use ActiveX controls and forget about non MS Machines --
or code 2 versions for MS and non MS machines.
c.  The problem is that Base 64 refers to 64 bit machines and no 32 bit
architecture will support it.  (Shouldn't be the case -- Java guarantees
that different types will be the same number of bytes).

-Dan

n Fri, 2003-09-12 at 14:02, Todd Cary wrote:
> Warren -
> 
> The Java code is available at http://www.hexidec.com/ekitdemo.php.
> 
> One of the reasons I need this applet working in non-IE browsers is
> that my client has staff that use Macs and need to access the site
> from the field...
> 
> Todd
> 
> Vail, Warren wrote:
> > I'm not sure about the relationship between an applet and an ActiveX control, and 
> > most of my development is for IE browsers (they have 90% of the market I hear), so 
> > I'm not sure I can help much here.  If you can break down what works and what 
> > doesn't, it might help.
> > 
> > If the applet doesn't run correctly, I'd look for some Java release compatibility 
> > (maybe where activex comes into play).  I think you can update the java release 
> > for the NS browser, but you'll have to get each user to do that.
> > 
> > If, on the other hand, the problem is with the JavaScript, you should be able to 
> > conditionally generate working JavaScript for each browser (see PHP get_browser(). 
> >  You might also enquire about the specs for the editing tool, to see if it 
> > supports other methods of encoding the document.
> > 
> > Wish I could be of more help here, but I've about reached the end of my chain 
> > (knowledge) on this one.  I guess it would be too much to ask, but if you have the 
> > Java source, most people can sort of read Java, even though they are not 
> > proficient with it, and that could tell you a lot.
> > 
> > I am implementing a site with an Iframe, and having no problems with recent 
> > releases of Netscape, older releases are a problem, even with IE.
> > 
> > I have another site that does WYSIWYG editing in IE and provides a TEXTAREA for 
> > those NS users who insist on using stone axes, and it presents one or the other by 
> > detecting the browser in php.
> > 
> > good luck,
> > 
> > Warren Vail
> > 
> > -Original Message-
> > From: Dan Anderson [mailto:[EMAIL PROTECTED]
> > Sent: Friday, September 12, 2003 9:10 AM
> > To: Todd Cary
> > Cc: Vail, Warren; PHP List
> > Subject: Re: [PHP] Integrating an Applet with PHP
> > 
> > 
> >   
> > > why does it work in IE and not in Netscape 7.1?
> > > 
> > I'm pretty sure ActiveX controls don't run on anything besides MS
> > Windows Lockinware (TM).  There are a number of other things that
> > netscape does not fully support (try loading a page with an iframe tag
> > in Netscape).  You probably ran into another such problem.
> > 
> > -Dan
> > 
> >   
> 
> -- 
> 

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



Re: [PHP] Using PHP to do something with Acrobat PDF....

2003-09-12 Thread Jason Wong
On Friday 12 September 2003 22:11, Scott Fletcher wrote:

> Know of any good websites that would provide tutorials, step-by-step,
> and/or a PHP scripts of creating a PDF, putting datas into PDF, along with
> Printing PDF, Saving PDF files, etc...  I have no experience with using PHP
> and PDF so I need both a tutorial and quick, plain to the point of PHP
> script of PDF stuffs.  From there I can start reviewing on how it work,
> what function is being used, etc.  Then look at all of the available PHP
> functions for PDF, add what I need or take out what I don't need, etc.
> (Customize), etc...

  google > php pdf

for some classes which provide wrapper functions around the raw pdflib 
functions -- they'll make your life much easier

> Another question, does using PDF require the use of some configuration
> in php.ini??  How does PHP do the PDF stuffs if there is no PDF on the
> server?  Etc...

There are at least two projects which implements some pdf functions using only 
PHP code (thus negating the need to install pdflib).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Minnie Mouse is a slow maze learner.
*/

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



Re: [PHP] Calling a function.

2003-09-12 Thread Jason Wong
On Saturday 13 September 2003 01:40, CPT John W. Holmes wrote:
> From: "Vincent M." <[EMAIL PROTECTED]>
>
> > Is there any way to call a function with a variable inside the call. ie:
> >
> >   if($preferences != "") {
> > dis_display$$preferences() ;
>
> $functon = "dis_play$preferences";
> $function();

Better still:

  $functon(); // [sic]

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Software production is assumed to be a line function, but it is run
like a staff function.
-- Paul Licker
*/

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



RE: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Vail, Warren
Turns out I needed to install NS to do some testing in the next few days, so I did that
went to the URL with your editor and got the following alert out of the brand new NS 
install;

Information on this page requires a plug-in for:

   application/x-java-applet; version=1.4

Communicator can retrieve the plug-in for you from:

http://java.sun.com/products/plugin/1.4/plugin-install.html




The SmartUpdate feature makes it easy to install new plug-ins.  To
take advantage of SmartUpdate, you must enable Java, Javascript
and Autoinstall in the Advanced panel of the Preferences, then
click the plug-in icon on the page.


What would you like to do?

 [ Get the Plug-in ]  [ Cancel ]


Clicked the Get the Plug-in button,
product not found (of course).

Found the following page that may have what you need;

http://java.sun.com/products/plugin/

Todd, I'd follow Dan's suggestion (a) and make the plug-in readily 
available to your users, by adding a link to the download site
on your editor page.

Bet you didn't know that this routine was written by Pandora ;-)
(the owner of the box [or does Bill Gates own that too?])

Warren


-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED]
Sent: Friday, September 12, 2003 11:15 AM
To: Todd Cary
Cc: Vail, Warren; PHP List
Subject: Re: [PHP] Integrating an Applet with PHP


Microsoft (being a monopoly) decided it did not want to follow Sun's
java standard and effectively froze their version of Java available in
IE @ Java 2 1.2 .  (or something like that -- they're currently
finishing up Java 2 1.5).  So if you wanted to use certain things with
microsoft you either needed to use ActiveX controls (Microsoft's answer
to Java) or Java 1.2 functionality (and there is some talk that
Microsoft will drop all support for Java in its next version of IE).

So, either (1 of the 3):

a.  You must install Sun's Java Plug In for all computers running your
program.  (If it relies on java > 1.2).
b.  You must use ActiveX controls and forget about non MS Machines --
or code 2 versions for MS and non MS machines.
c.  The problem is that Base 64 refers to 64 bit machines and no 32 bit
architecture will support it.  (Shouldn't be the case -- Java guarantees
that different types will be the same number of bytes).

-Dan

n Fri, 2003-09-12 at 14:02, Todd Cary wrote:
> Warren -
> 
> The Java code is available at http://www.hexidec.com/ekitdemo.php.
> 
> One of the reasons I need this applet working in non-IE browsers is
> that my client has staff that use Macs and need to access the site
> from the field...
> 
> Todd
> 
> Vail, Warren wrote:
> > I'm not sure about the relationship between an applet and an ActiveX control, and 
> > most of my development is for IE browsers (they have 90% of the market I hear), so 
> > I'm not sure I can help much here.  If you can break down what works and what 
> > doesn't, it might help.
> > 
> > If the applet doesn't run correctly, I'd look for some Java release compatibility 
> > (maybe where activex comes into play).  I think you can update the java release 
> > for the NS browser, but you'll have to get each user to do that.
> > 
> > If, on the other hand, the problem is with the JavaScript, you should be able to 
> > conditionally generate working JavaScript for each browser (see PHP get_browser(). 
> >  You might also enquire about the specs for the editing tool, to see if it 
> > supports other methods of encoding the document.
> > 
> > Wish I could be of more help here, but I've about reached the end of my chain 
> > (knowledge) on this one.  I guess it would be too much to ask, but if you have the 
> > Java source, most people can sort of read Java, even though they are not 
> > proficient with it, and that could tell you a lot.
> > 
> > I am implementing a site with an Iframe, and having no problems with recent 
> > releases of Netscape, older releases are a problem, even with IE.
> > 
> > I have another site that does WYSIWYG editing in IE and provides a TEXTAREA for 
> > those NS users who insist on using stone axes, and it presents one or the other by 
> > detecting the browser in php.
> > 
> > good luck,
> > 
> > Warren Vail
> > 
> > -Original Message-
> > From: Dan Anderson [mailto:[EMAIL PROTECTED]
> > Sent: Friday, September 12, 2003 9:10 AM
> > To: Todd Cary
> > Cc: Vail, Warren; PHP List
> > Subject: Re: [PHP] Integrating an Applet with PHP
> > 
> > 
> >   
> > > why does it work in IE and not in Netscape 7.1?
> > > 
> > I'm pretty sure ActiveX controls don't run on anything besides MS
> > Windows Lockinware (TM).  There are a number of other things that
> > netscape does not fully support (try loading a page with an iframe tag
> > in Netscape).  You probably ran into another such problem.
> > 
> > -Dan
> > 
> >   
> 
> -- 
> 

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



[PHP] Displaying Blobs by a newbie

2003-09-12 Thread Phil King
Hi All,

I have some images in a mysql database. I wish to display all these images
on a PHP Page.

I have created a query to retrieve all the images from the database but all
that is displayed is characters.
I have the Content-Type as image/jpeg in the header of the page to display
the images.

Can anyone advise me or point me in the right direction to rectify this.

Thanks very much.

Phil.

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



Re: [PHP] Using PHP to generate Acrobat PDF...

2003-09-12 Thread Scott Fletcher
Ooohhh!  Neat website!  Here's the other info send to me by someone from
email.  Thanks for all of the feedback.  Now i have something to get
start

--snip--
http://ca3.php.net/manual/en/ref.pdf.php

--snip--

"Simon Stiefel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 12 Sep 2003 at 13:17, Scott Fletcher wrote:
>
> > Anyone have experience with it?  Anyone of good information where I can
do
> > some research on?
>
> Have a look at www.pdflib.com.
> They also have a great documentation for it.
> We use it to put our company logo at the top af some PDF documents.
> Works perfectly!
>
> > Thanks...
>
> HTH,
>
> Simon

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



[PHP] Japanese on a page

2003-09-12 Thread Mark McCulligh
This is not really a PHP question but I know this list knows their stuff.

I am trying to create both an English and Japanese version of a site. The
English done and I have the Japanese translation in a word doc.  Can someone
point me in the right direction on how I do this. I know it has something to
do with the META setting.

Thanks,
Mark.

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



RE: [PHP] Displaying Blobs by a newbie

2003-09-12 Thread Vail, Warren
You didn't say how the images were placed in the db but you did indicate they were 
jpeg format.

I'd try;

fetching the db column in to a string variable;

then;

$im = imagecreatefromstring($imagestring);
header ("Content-type: image/jpeg");
imagejpeg($im);
imagedestroy($im); 

good luck,

Warren Vail

-Original Message-
From: Phil King [mailto:[EMAIL PROTECTED]
Sent: Friday, September 12, 2003 11:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Displaying Blobs by a newbie


Hi All,

I have some images in a mysql database. I wish to display all these images
on a PHP Page.

I have created a query to retrieve all the images from the database but all
that is displayed is characters.
I have the Content-Type as image/jpeg in the header of the page to display
the images.

Can anyone advise me or point me in the right direction to rectify this.

Thanks very much.

Phil.

-- 
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] email attachment cannot be opened (solved)

2003-09-12 Thread Chris Hayes
I found the culprit!
I copied the filereading part without checking too good, and it had an 
"addslashes" call which ruined the file content very professionaly.

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


RE: [PHP] Japanese on a page

2003-09-12 Thread Chris W. Parker
(now to the entire list)

Mark McCulligh 
on Friday, September 12, 2003 11:48 AM said:

> I am trying to create both an English and Japanese version of a site.
> The English done and I have the Japanese translation in a word doc. 
> Can someone point me in the right direction on how I do this. I know
> it has something to do with the META setting.

I have only dabbled in this so I don't know the proper terms and
technologies used, but I'll try to pass on what I've learned.

It requires a few things.

1. PHP needs to send the proper header. (At the top of each page.)



2. You also need to send the correct language info from within the page
itself. I suggest going to a japanese page and looking at the source.

3. You need an editor that can handle the japanese language. I stopped
trying to make japanese pages because I could not find a suitable editor
(granted I didn't try very hard and I wasn't about to buy something).



Hope this helps!
Chris.

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



[PHP] error cannot instantiate non-existent class

2003-09-12 Thread Golawala, Moiz M (IndSys, GE Interlogix)
I am newbie with php and I am trying to instantiate a class. I am using the command 
line to test my stuff out before I try it with a browser. The following is my class 
code: (name of file is AddConfigs.inc)
$config = $config;
echo " in constructor $config ";
echo " in constructor statement 2 ".$config;
}


}
?>

The following is the code of the file I am trying to instantiate the class with: (name 
of file is test.php)



I type in "php test1" and I get the following errors:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in C:\Program Files\Apache 
Group\Apache2\htdocs\Alarms\AddConfigs.inc on line 7

Fatal error: Cannot instantiate non-existent class: addconfigs in C:\Program 
Files\Apache Group\Apache2\htdocs\Alarms\test1.php on line 4
Please can someone help me...?

Many Thanks
Moiz

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



Re: [PHP] Looking for a real good editor with some specificfeatrues ...

2003-09-12 Thread Dave Dash

"Dan Anderson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 60% of what makes an editor good is familiarity.  Take emacs for
> instance (http://www.gnu.org/software/emacs/emacs.html).  Running PHP
> Mode (http://sourceforge.net/projects/php-mode/) I fly through code.
> But I've also spent quite a lot of time memorizing the zillion or so
> commands to do things automatically.

This tends to be my favorite too, because of the auto-indenting when you hit
TAB, except I've come to rely on it too much, and it doesn't always work.

For example:

if ($var = 1) {
$p = <

Re: [PHP] error cannot instantiate non-existent class

2003-09-12 Thread CPT John W. Holmes
From: "Golawala, Moiz M (IndSys, GE Interlogix)" <[EMAIL PROTECTED]>

> I am newbie with php and I am trying to instantiate a
> class.

Welcome to PHP.

> this->$config = $config;

$this->config = $config;

> Parse error: parse error, unexpected T_OBJECT_OPERATOR
> in C:\Program Files\Apache Group\Apache2\htdocs
> \Alarms\AddConfigs.inc on line 7
>
> Fatal error: Cannot instantiate non-existent class: addconfigs in
C:\Program Files\Apache Group\Apache2\htdocs\Alarms\test1.php on line 4

That first error is being caused by your syntax error above. Since there is
parse error in the class file, the second file cannot create an instance of
the class, hence the second error. Fix that line above and both will go
away.

---John Holmes...

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



Re: [PHP] Calling a function.

2003-09-12 Thread CPT John W. Holmes
From: "Jason Wong" <[EMAIL PROTECTED]>

> On Saturday 13 September 2003 01:40, CPT John W. Holmes wrote:
> > From: "Vincent M." <[EMAIL PROTECTED]>
> >
> > > Is there any way to call a function with a variable inside the call.
ie:
> > >
> > >   if($preferences != "") {
> > > dis_display$$preferences() ;
> >
> > $functon = "dis_play$preferences";
> > $function();
>
> Better still:
>
>   $functon(); // [sic]

LOL... No, you don't have to worry about that. Isn't PHP smart enough to
know what I mean??

---John Holmes...

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



[PHP] Re: ereg

2003-09-12 Thread Dave Dash
I think this is a lot more complicated than somethign a simple regular
expression can handle.

You would need to do soemthign that reads the entire file, up until the
first occurrence of your '//'

and in the meantime do a count that checks to make sure all the quotes are
closed.

I'd be interested to see what you come up with... although I'm sure just
borrowing some syntax highlighting code.

-dd

"Alexander Sundli" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I use this expression to remove oneline comments:
> iereg_replace("//([^\n]*)\n",'',$code);
>
> I need to make a check if this expression is inside a string. If it is,
its
> not a comment.
>
> I think it has something to do with context..
>
> Anyone who could help me?
>
> thanx

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



Re: [PHP] Japanese on a page

2003-09-12 Thread Evan Nemerson
things like , , and should help you.

If i were you i'd try saving the word as html, then copy and paste what you 
need. Don't copy too much though- just the encoding info and text... word 
html is so horrible.

Evan Nemerson


On Friday 12 September 2003 11:47 am, Mark McCulligh wrote:
> This is not really a PHP question but I know this list knows their stuff.
>
> I am trying to create both an English and Japanese version of a site. The
> English done and I have the Japanese translation in a word doc.  Can
> someone point me in the right direction on how I do this. I know it has
> something to do with the META setting.
>
> Thanks,
> Mark.

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



Re: [PHP] Using PHP to generate Acrobat PDF...

2003-09-12 Thread Evan Nemerson
Well there's clibpdf and pdflib, which you can get info from the PHP manual 
for. Unfortunately, both are non-free. php.net/pdf and php.net/cpdf

If you would like a pure PHP (no extensions or recompiling required), I used 
fpdf (fdpf.org) in a project a while back, and had positive results.


I've been talking to Michael Still, and he has agreed to release the next 
version of Panda under the LGPL. I'd already written a PHP extension for 
v0.53, but couldn't distribute due to licensing conflicts. According to 
stillhq.com (Michael's web site), the next release of Panda is imminent. As 
soon as he releases the new version, I'll update my extension and release it. 
So if you can wait a while (couple weeks, maybe? depends on Michael), you'll 
have a free (speech & beer) solution.

If you want, take a look at http://www.coeusgroup.com/panda All the licensing 
probelms discussed there are resolved by Panda being LGPL'd, and the 
extension will be released under the PHP license.




On Friday 12 September 2003 10:17 am, Scott Fletcher wrote:
> Anyone have experience with it?  Anyone of good information where I can do
> some research on?
>
> Thanks...

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



Re: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Todd Cary




Waren -

I have the 1.4.2 Java Plugin installed.  Using Netwcape 7.1, when you
go to

http://www.hexidec.com/ekitdemo.php

do you see HTML displayed in the editor window as you do with IE?

Todd

Vail, Warren wrote:

  Turns out I needed to install NS to do some testing in the next few days, so I did that
went to the URL with your editor and got the following alert out of the brand new NS install;

Information on this page requires a plug-in for:

   application/x-java-applet; version=1.4

Communicator can retrieve the plug-in for you from:

http://java.sun.com/products/plugin/1.4/plugin-install.html




The SmartUpdate feature makes it easy to install new plug-ins.  To
take advantage of SmartUpdate, you must enable Java, _javascript_
and Autoinstall in the Advanced panel of the Preferences, then
click the plug-in icon on the page.


		What would you like to do?

 [ Get the Plug-in ]  [ Cancel ]


Clicked the Get the Plug-in button,
product not found (of course).

Found the following page that may have what you need;

http://java.sun.com/products/plugin/

Todd, I'd follow Dan's suggestion (a) and make the plug-in readily 
available to your users, by adding a link to the download site
on your editor page.

Bet you didn't know that this routine was written by Pandora ;-)
(the owner of the box [or does Bill Gates own that too?])

Warren


-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 12, 2003 11:15 AM
To: Todd Cary
Cc: Vail, Warren; PHP List
Subject: Re: [PHP] Integrating an Applet with PHP


Microsoft (being a monopoly) decided it did not want to follow Sun's
java standard and effectively froze their version of Java available in
IE @ Java 2 1.2 .  (or something like that -- they're currently
finishing up Java 2 1.5).  So if you wanted to use certain things with
microsoft you either needed to use ActiveX controls (Microsoft's answer
to Java) or Java 1.2 functionality (and there is some talk that
Microsoft will drop all support for Java in its next version of IE).

So, either (1 of the 3):

	a.  You must install Sun's Java Plug In for all computers running your
program.  (If it relies on java > 1.2).
	b.  You must use ActiveX controls and forget about non MS Machines --
or code 2 versions for MS and non MS machines.
	c.  The problem is that Base 64 refers to 64 bit machines and no 32 bit
architecture will support it.  (Shouldn't be the case -- Java guarantees
that different types will be the same number of bytes).

-Dan

n Fri, 2003-09-12 at 14:02, Todd Cary wrote:
  
  
Warren -

The Java code is available at http://www.hexidec.com/ekitdemo.php.

One of the reasons I need this applet working in non-IE browsers is
that my client has staff that use Macs and need to access the site
from the field...

Todd

Vail, Warren wrote:


  I'm not sure about the relationship between an applet and an ActiveX control, and most of my development is for IE browsers (they have 90% of the market I hear), so I'm not sure I can help much here.  If you can break down what works and what doesn't, it might help.

If the applet doesn't run correctly, I'd look for some Java release compatibility (maybe where activex comes into play).  I think you can update the java release for the NS browser, but you'll have to get each user to do that.

If, on the other hand, the problem is with the _javascript_, you should be able to conditionally generate working _javascript_ for each browser (see PHP get_browser().  You might also enquire about the specs for the editing tool, to see if it supports other methods of encoding the document.

Wish I could be of more help here, but I've about reached the end of my chain (knowledge) on this one.  I guess it would be too much to ask, but if you have the Java source, most people can sort of read Java, even though they are not proficient with it, and that could tell you a lot.

I am implementing a site with an Iframe, and having no problems with recent releases of Netscape, older releases are a problem, even with IE.

I have another site that does WYSIWYG editing in IE and provides a TEXTAREA for those NS users who insist on using stone axes, and it presents one or the other by detecting the browser in php.

good luck,

Warren Vail

-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 12, 2003 9:10 AM
To: Todd Cary
Cc: Vail, Warren; PHP List
Subject: Re: [PHP] Integrating an Applet with PHP


  
  
  
why does it work in IE and not in Netscape 7.1?


  
  I'm pretty sure ActiveX controls don't run on anything besides MS
Windows Lockinware (TM).  There are a number of other things that
netscape does not fully support (try loading a page with an iframe tag
in Netscape).  You probably ran into another such problem.

-Dan

  
  

-- 


  
  
  


-- 



<>

Re: [PHP] Cookie advice

2003-09-12 Thread Robert Cummings
I don't think there's any kind of consensus :) But to perhaps lead you
in the right direction... how long do you think should pass before
someone who logged in once before will log in again? if you expect a
longer than 30 day time period, then 30 days is too short. If you expect
within a week or 2 then 30 days is probably perfect. In my opinion, if
they log in once a month, the benefit of "remember me" is almost nill
given the frequency of usage.

HTH,
Rob.

On Fri, 2003-09-12 at 12:53, James Johnson wrote:
> Hi,
> 
> I have a "Remember me on this computer" check box, which sets a cookie for
> future logins. What's the consensus on when a cookie of this type should
> expire? I currently have it set for 30 days.
> 
> Thanks,
> James
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] Integrating an Applet with PHP

2003-09-12 Thread Todd Cary




Warren -

<<<
you must enable Java, _javascript_ and Autoinstall in the Advanced panel
of the Preferences 
>>>
In Netwcape 7.1, I only see a check box for "Run Java".

Todd

Vail, Warren wrote:

  Turns out I needed to install NS to do some testing in the next few days, so I did that
went to the URL with your editor and got the following alert out of the brand new NS install;

Information on this page requires a plug-in for:

   application/x-java-applet; version=1.4

Communicator can retrieve the plug-in for you from:

http://java.sun.com/products/plugin/1.4/plugin-install.html




The SmartUpdate feature makes it easy to install new plug-ins.  To
take advantage of SmartUpdate, you must enable Java, _javascript_
and Autoinstall in the Advanced panel of the Preferences, then
click the plug-in icon on the page.


		What would you like to do?

 [ Get the Plug-in ]  [ Cancel ]


Clicked the Get the Plug-in button,
product not found (of course).

Found the following page that may have what you need;

http://java.sun.com/products/plugin/

Todd, I'd follow Dan's suggestion (a) and make the plug-in readily 
available to your users, by adding a link to the download site
on your editor page.

Bet you didn't know that this routine was written by Pandora ;-)
(the owner of the box [or does Bill Gates own that too?])

Warren


-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 12, 2003 11:15 AM
To: Todd Cary
Cc: Vail, Warren; PHP List
Subject: Re: [PHP] Integrating an Applet with PHP


Microsoft (being a monopoly) decided it did not want to follow Sun's
java standard and effectively froze their version of Java available in
IE @ Java 2 1.2 .  (or something like that -- they're currently
finishing up Java 2 1.5).  So if you wanted to use certain things with
microsoft you either needed to use ActiveX controls (Microsoft's answer
to Java) or Java 1.2 functionality (and there is some talk that
Microsoft will drop all support for Java in its next version of IE).

So, either (1 of the 3):

	a.  You must install Sun's Java Plug In for all computers running your
program.  (If it relies on java > 1.2).
	b.  You must use ActiveX controls and forget about non MS Machines --
or code 2 versions for MS and non MS machines.
	c.  The problem is that Base 64 refers to 64 bit machines and no 32 bit
architecture will support it.  (Shouldn't be the case -- Java guarantees
that different types will be the same number of bytes).

-Dan

n Fri, 2003-09-12 at 14:02, Todd Cary wrote:
  
  
Warren -

The Java code is available at http://www.hexidec.com/ekitdemo.php.

One of the reasons I need this applet working in non-IE browsers is
that my client has staff that use Macs and need to access the site
from the field...

Todd

Vail, Warren wrote:


  I'm not sure about the relationship between an applet and an ActiveX control, and most of my development is for IE browsers (they have 90% of the market I hear), so I'm not sure I can help much here.  If you can break down what works and what doesn't, it might help.

If the applet doesn't run correctly, I'd look for some Java release compatibility (maybe where activex comes into play).  I think you can update the java release for the NS browser, but you'll have to get each user to do that.

If, on the other hand, the problem is with the _javascript_, you should be able to conditionally generate working _javascript_ for each browser (see PHP get_browser().  You might also enquire about the specs for the editing tool, to see if it supports other methods of encoding the document.

Wish I could be of more help here, but I've about reached the end of my chain (knowledge) on this one.  I guess it would be too much to ask, but if you have the Java source, most people can sort of read Java, even though they are not proficient with it, and that could tell you a lot.

I am implementing a site with an Iframe, and having no problems with recent releases of Netscape, older releases are a problem, even with IE.

I have another site that does WYSIWYG editing in IE and provides a TEXTAREA for those NS users who insist on using stone axes, and it presents one or the other by detecting the browser in php.

good luck,

Warren Vail

-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 12, 2003 9:10 AM
To: Todd Cary
Cc: Vail, Warren; PHP List
Subject: Re: [PHP] Integrating an Applet with PHP


  
  
  
why does it work in IE and not in Netscape 7.1?


  
  I'm pretty sure ActiveX controls don't run on anything besides MS
Windows Lockinware (TM).  There are a number of other things that
netscape does not fully support (try loading a page with an iframe tag
in Netscape).  You probably ran into another such problem.

-Dan

  
  

-- 


  
  
  


-- 



<>

[PHP] SNMP mib resoultion

2003-09-12 Thread Guy Fraser
Does any know how to get additional mibs to be resolved on FreeBSD or 
Linux ?

This is my third attempt to send this message and I havn't seen one show 
up yet. :{

I hope this gets through.

--
Guy Fraser
Network Administrator
The Internet Centre
780-450-6787 , 1-888-450-6787
There is a fine line between genius and lunacy, fear not, walk the
line with pride. Not all things will end up as you wanted, but you
will certainly discover things the meek and timid will miss out on.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] SNMP mib resoultion

2003-09-12 Thread Chris W. Parker
Guy Fraser 
on Friday, September 12, 2003 1:53 PM said:

> This is my third attempt to send this message and I havn't seen one
> show up yet. :{
> 
> I hope this gets through.

I got it!!

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



[PHP] posix pcntl_fork() and zombie/defunct issues

2003-09-12 Thread Daniel Souza
well... playing with fork() in a phpcli script, i got some troubles with
childs... anybody knows how to dont get zombies/defuncts with SIGCHLD and
SIGCLD ignoring ? dont worked for me =/

the script is large, so the main pieces of it..
i dont want to know how many childs are running, or if they terminated or
not... i want only to make childs :D
ignoring SIGCHLD in perl works finely... is there anything about the
"phped-layer" to syscalls access ? duh..

=]


http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Session stealing, ..

2003-09-12 Thread Wouter van Vliet
Hi All,

There's always been a lot of discussion about how safe sessions are. I'd
like to store a complete user object (instance of a class) in a session with
the best security measures possible. Who doesn't.

Now, to prevent that the session file from the server gets stolen by some
other user of the virtual host I did this to my object:

 87 # Called upon serialization of the object. It stored the IP
address and serialization time.
 88 function __sleep() {
 89 $this->Night = Array('Time' => time(), 'IP' =>
$_SERVER['REMOTE_ADDR']);
 90 return Array('Data', 'Night');
 91 }
 92
 93 # When deserialized we are called and need to check if the
stored IP address equals the client's
 94 function __wakeup() {
 95 global $Log;
 96 if ($_SERVER['REMOTE_ADDR'] != $this->Night['IP']) {
 97 $Log->Warning('IP Address changed during
sleep and wakeup, will clear userdata');
 98 $this->Data = Array();
 99 };
100 }

Upon sleep it stores the IP and time in the session data, and when it smells
coffee my object wakes up, checks if he's still being used on the same host
and if not the userdata is plainly cleared.

This all probably takes care about the problem with session id's in the
query string, which is known as referrer to the next website our visitor
visits. What I'm worrying and wondering about now are other users of the
server my site's at. They can most likely go into the /tmp folder and just
read my session files. Not Nice. I know it has been discussed for quite some
times now .. but never really found anything else than warnings for stuff,
no real solutions.

So, get your idea's rolling and let the good things flow...

Wouter

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



[PHP] Calling functions from Button actions

2003-09-12 Thread Dan J. Rychlik
Is their an easy way to call a function based upon a button action?

-Dan

Re: [PHP] Calling functions from Button actions

2003-09-12 Thread Robert Cummings
Any form system (I'm guessing, but I only use my own so I could be
mistaken) that allows custom validation should enable trivial function
calling based on a button click.

Cheers,
Rob.


On Fri, 2003-09-12 at 18:29, Dan J. Rychlik wrote:
> Is their an easy way to call a function based upon a button action?
> 
> -Dan
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



RE: [PHP] Session stealing, ..

2003-09-12 Thread Jennifer Goodie
>  93 # When deserialized we are called and need to check if the
> stored IP address equals the client's
>  94 function __wakeup() {
>  95 global $Log;
>  96 if ($_SERVER['REMOTE_ADDR'] !=
> $this->Night['IP']) {
>  97 $Log->Warning('IP Address changed during
> sleep and wakeup, will clear userdata');
>  98 $this->Data = Array();
>  99 };
> 100 }
>
> Upon sleep it stores the IP and time in the session data, and
> when it smells
> coffee my object wakes up, checks if he's still being used on the
> same host
> and if not the userdata is plainly cleared.
>

I hope none of your site visitors are on AOL as the IP can change between
page requests for AOL users.

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



Re: [PHP] Session stealing, ..

2003-09-12 Thread Jason Sheets
I wrote a custom session handler that encrypts the session before it is 
stored in /tmp that way even if someone has access to the session files 
they are useless.

It stores the randomly generated encryption key on the user's client 
base64_encoded, which can be intercepted as well all know but it still 
increases the difficulty of reading the /session files now they must 
have access AND sniff the encryption key.  Additionally for the more 
secure sites I require the user access the site through SSL so the 
cookie is not passed in plain text.

If you are interested I'll see if I can send it to you, it uses my Crypt 
Class (PHP class simplifying Mcrypt usage).

Jason

Wouter van Vliet wrote:

Hi All,

There's always been a lot of discussion about how safe sessions are. I'd
like to store a complete user object (instance of a class) in a session with
the best security measures possible. Who doesn't.
Now, to prevent that the session file from the server gets stolen by some
other user of the virtual host I did this to my object:
87 # Called upon serialization of the object. It stored the IP
address and serialization time.
88 function __sleep() {
89 $this->Night = Array('Time' => time(), 'IP' =>
$_SERVER['REMOTE_ADDR']);
90 return Array('Data', 'Night');
91 }
92
93 # When deserialized we are called and need to check if the
stored IP address equals the client's
94 function __wakeup() {
95 global $Log;
96 if ($_SERVER['REMOTE_ADDR'] != $this->Night['IP']) {
97 $Log->Warning('IP Address changed during
sleep and wakeup, will clear userdata');
98 $this->Data = Array();
99 };
   100 }
Upon sleep it stores the IP and time in the session data, and when it smells
coffee my object wakes up, checks if he's still being used on the same host
and if not the userdata is plainly cleared.
This all probably takes care about the problem with session id's in the
query string, which is known as referrer to the next website our visitor
visits. What I'm worrying and wondering about now are other users of the
server my site's at. They can most likely go into the /tmp folder and just
read my session files. Not Nice. I know it has been discussed for quite some
times now .. but never really found anything else than warnings for stuff,
no real solutions.
So, get your idea's rolling and let the good things flow...

Wouter

 

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


[PHP] array encapsulate

2003-09-12 Thread Bill
I'd like to do this, but it produces an error:

if ($_POST{["detail"][11][116]} && !$_POST{["detailtext"][19][114]}) {

so I'm left doing this

if ($_POST["detail"][11][116] && !$_POST["detailtext"][19][114]) {

How can I encapsulate the array so it is a multi-dimensional array and not just
a string length?

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



Re: [PHP] Session stealing, ..

2003-09-12 Thread Mike Migurski
>This all probably takes care about the problem with session id's in the
>query string, which is known as referrer to the next website our visitor
>visits. What I'm worrying and wondering about now are other users of the
>server my site's at. They can most likely go into the /tmp folder and
>just read my session files. Not Nice. I know it has been discussed for
>quite some times now .. but never really found anything else than
>warnings for stuff, no real solutions.

You don't have to store session data in /tmp -- it can be in any directory
you choose. Of course, that directory will still need to be world readable
and writeable in order to work, so this is more a case of security through
obscurity though it may help.

I don't think there really is a bulletproof solution to your problem,
though, for a number of reasons: if you choose to store the sensitive
information in a database rather than a session file, you are still left
with the fact that at some point, an unprivileged Apache user needs to be
able to get to it. That means world-readable database credentials, access
scripts, configuration files, and so on.

One option is to use Apache's suexec feature* and offload some of your
sensitive data access onto scripts and files that are maintained only by
you.

Jason's suggestion for encrypting session data is a good one, though it
also suffers from the drawback above: ultimately most of the code required
to access your session information will need to be open in some way,
including the encryption key.

I think if you're really storing sensitive information, you shouldn't be
on a host shared with people you don't know/trust to begin with.

* SuExec: http://httpd.apache.org/docs/suexec.html)

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] array encapsulate

2003-09-12 Thread Larry E . Ullman
if ($_POST["detail"][11][116] && !$_POST["detailtext"][19][114]) {

How can I encapsulate the array so it is a multi-dimensional array and 
not just
a string length?
I'm not exactly sure what you're array structure is but that syntax is 
correct.
$_POST['key1']['key2']...

Larry

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


  1   2   >