RE: [PHP] DHCP web interface. New version.

2003-12-03 Thread Daevid Vincent
Once again, I have a new version of my DHCP web page. The major fix in this
one is that it does an "nmap -v -p 80 192.168.1.0/24" (thanks to Mike Klinke
for the idea) to re-populate the "arp -n". The old version of my program
would not always show ALL devices on the network. Some would also show up as
"incomplete". I have removed all incomplete ones for this version, but you
could simply comment out the line to put them back if you want them. You can
specify the server's IP manually (as in the case of dual NIC cards), or let
the script figure it out for you. 

http://daevid.com/examples/dhcp/

Daevid.


> -Original Message-
> From: Daevid Vincent [mailto:[EMAIL PROTECTED] 
> Sent: Monday, July 28, 2003 9:41 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] DHCP web interface. New version.
> 
> Heya. I've just put up a new version of the DHCP web front 
> end if anyone is
> using it or has a need for this type of thing.
> 
> Major feature of this version:
> 
> * a bug where if the arp table showed an "(incomplete)", I 
> ignored the entry
>   since the MAC is the hash key, many machines wouldn't show 
> up as they kept
>   over writing each other (of course, they were bunk anyways)
> * ping & nmap tests (if ping fails, nmap is used as a backup)
>   this is useful for firewalls that may block ICMP
> * tests can be disabled for radically faster page rendering 
> (off by default)
> * 10 minute refresh by default rather than 10 second.
> * SORTING! by IP now, rather than arp entries
> * many more icons (tivo, zaurus, replay, linux, notebook, 
> servers, DAR, etc)
> * complete/incomplete tally
> * Name in config file is only used if dhcp doesn't show a name already
> 
> This is also IMHO an excellent way for a beginer or advanced 
> coder alike to
> see some very useful OOP/PHP coding as I use arrays of 
> objects, sorting by
> variables IN the object (custom sort algorithm with key 
> integrity), hashing,
> system calls, regex parsing, DHTML, etc. 
> 
> If anyone knows how to force the arp table to be current, 
> that would help.
> Sometimes a machine is on the network, and I *know* for a 
> fact it is, but it
> doesn't show up in "arp -n" *grumble*. 
> 
> Follow the link below. 
> http://daevid.com/examples/dhcp/

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



[PHP] Re: Dealing with large classes over several files

2003-12-03 Thread Kim Steinhaug
umm... It all looks good except this one :

function foo::f ()

This is where you get the T_ error. Dont know what you are
trying to do here, but thats the error anyways, :)

Your first example is all correct,

// myclass.inc.php
class foo
{
// constructor and destructor
function f () {}
}

Dont know if it helps you though.

-- 
Kim Steinhaug
---
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---


"Callum Urquhart" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This may well have come up before as it is an obvious problem/question.
>
> Coming from a C++ background, I define a class in a header file and define
> the functions for that class in a seperate source file. Now the question:
is
> this possible in PHP4?
>
> I have tried the obvious:
>
> // myclass.inc.php
>
> class foo
> {
> // constructor and destructor
> function f () {}
> }
>
>
> // myclass.php
>
> function foo::f ()
> {
> // define here
> }
>
>
> This gives me an error: unexpected T_PAAMAYIM_NEKUDOTAYIM
> Is this possible in PHP4, and if not, why not? It's an obvious problem,
> namely for code management.
>
>
> -Callum Urquhart
> www.pastecode.net

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



[PHP] Re: XML, strings and foreign (swedish/danish) characters

2003-12-03 Thread Victor Spång Arthursson
2003-12-02 kl. 12.23 skrev Manuel Lemos:

You just need to use the proper input/output encodings.
Doesn't work at all…

The code

// Prepare the content of the xml-file to go to the xsl-parser
$xml = str_replace("?", chr(63), $contents);
$xml = str_replace("", $kurt, $xml);
$xml = trim($xml);
$xml = utf8_encode($xml);
echo $xml;

makes the string
""

become

""

And the crap in fron of the string, which seems to come from nowhere, 
makes the parser complain about not well formed markup in the 
xml-source…

Regards,

Victor

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


[PHP] Doubts With Select Queries

2003-12-03 Thread irinchiang


Hi all:

Having some doubts with sql select queries here :

Right now, I have a "student" and a  "withdraw" tables. 
For example, when student "John" has withdrawn, his name will be inserted 
into "withdraw" table but John's record will be kept in "student" table for a 
period of 30 days before it is deleted from "student" table. In the meantime, 
in "student" table, the status for John should be set to "0" (inactive). 
Wonder the solutions I have mentioned is possible? And if so, how shld i go 
about doing it ??Hope to get some help really soon...Thanks in advance!


student table  withdraw table
---   -
|student_name | status |student_name | withdraw_reason
---   -
|   John  |0   |   John  |  migrate
---   -
|   James |1   |
---


Regards, 
Irin Chiang.

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



[PHP] Images On-Fly

2003-12-03 Thread Dejan Dujak
Hallo People,



I have one problem with creating images on-fly.

Therefore I created 2 files:

1. resize_image.php with the following



AND

2. filex.php .In that file i read from database where the image is stored en

then i show small images(thumbnails).

thet part of the code is :







";

?>











This doesn't WORK. Please HELP.

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



Re: [PHP] Virtual Directory Support

2003-12-03 Thread Jason Wong
On Wednesday 03 December 2003 12:51, Ralph Guzman wrote:
> I have a new installation of PHP 4.1.2 and it appears I cannot run php
> scripts outside of apache root directory.

How did you come to this conclusion? Was there an error message? If so, what 
did it say? If there was no error message, then enable FULL error reporting 
and try again.

> I look at phpinfo() and I saw
> Virtual Directory Support is set to disabled. I'm suspecting this could me
> the problem, but I have not been able to find anything on google or the
> lists explaining how to enable this.

I doubt whether that has anything to do with your problem.

-- 
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
--
/*
There is always someone worse off than yourself.
*/

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



Re: [PHP] Images On-Fly

2003-12-03 Thread Jason Wong
On Wednesday 03 December 2003 17:41, Dejan Dujak wrote:

[snip]

> This doesn't WORK. Please HELP.

HOW DOESN'T it work?

-- 
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
--
/*
Your reasoning powers are good, and you are a fairly good planner.
*/

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



Re: [PHP] Re: XML, strings and foreign (swedish/danish) characters

2003-12-03 Thread Victor Spång Arthursson
2003-12-02 kl. 22.08 skrev Manuel Lemos:

The code
// Prepare the content of the xml-file to go to the xsl-parser
$xml = str_replace("", $tempxml, $xml);
$xml = trim($xml);
$xml = utf8_encode($xml);
echo $xml;
makes the string
""
become
""
And the crap in fron of the string, which seems to come from nowhere, 
makes the parser complain about not well formed markup in the 
xml-source…
I think it does not make any sense to do what you are doing. You 
should only encode XML data or attribute values. You should not encode 
the whole XML document.
Well, I have some xml in which I want to place som new xml-data, just 
for the specific output, which I does by replacing an empty dummy-tag.

After this, I want to send the xml to the parser.

Anyway, if you try this class, you can see that it generates correct 
XML code in UTF or even ISO-8859-1.
Well, but I don't want to download and evaluate classes, especially 
since they tend to be big and I just want to be able to do this with 
the few lines of code that should be enought…

Should it really be this troublesome working with XML from PHP?

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


Re: [PHP] Doubts With Select Queries

2003-12-03 Thread Jason Wong
On Wednesday 03 December 2003 17:30, [EMAIL PROTECTED] wrote:

> Having some doubts with sql select queries here :
>
> Right now, I have a "student" and a  "withdraw" tables.
> For example, when student "John" has withdrawn, his name will be inserted
> into "withdraw" table but John's record will be kept in "student" table for
> a period of 30 days before it is deleted from "student" table. In the
> meantime, in "student" table, the status for John should be set to "0"
> (inactive). Wonder the solutions I have mentioned is possible? And if so,
> how shld i go about doing it ??

I'm assuming you don't need help with the obvious, like how to insert John 
into the "withdraw" table and how to set his status to 0.

So to implement your "keep for 30 days" thing, you need another column 
(probably in the "student" table) that is of type DATE and holds the date 
when "status" was set to 0.

Then you can do something like (exact query depends on what DB you're using)

  DELETE FROM student WHERE (DATE_SUB(NOW(), INTERVAL 30 DAY) > 
name_of_date_column)

Also I hope you're not using the "student_name" column as a unique identifier 
to identify your students. You should have an extra column, say "student_id", 
which is of type sequence or auto increment (again, depending on your DB) as 
your unique student identifier.

And please, in future ask php/db related questions on the php-db list.

-- 
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
--
/*
Die, v.:
To stop sinning suddenly.
-- Elbert Hubbard
*/

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



Re: [PHP] Re: XML, strings and foreign (swedish/danish) characters

2003-12-03 Thread Victor Spång Arthursson
2003-12-03 kl. 10.22 skrev Victor Spång Arthursson:

makes the string

""

become

""
Temporarely solved the problem using substring to trim the crap-chars 
away, but I'ld prefer to solve it in a more beautiful way, but perhaps 
this behaviour is a bug and therefore not possible to solve in any 
other way…

Sincerely

Victor

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


Re: [PHP] Doubts With Select Queries

2003-12-03 Thread irinchiang

 On Wednesday 03 December 2003 17:30, [EMAIL PROTECTED] wrote:

> Having some doubts with sql select queries here : 
> 
> Right now, I have a "student" and a  "withdraw" tables. 
> For example, when student "John" has withdrawn, his name will be inserted 
> into "withdraw" table but John's record will be kept in "student" table for 
> a period of 30 days before it is deleted from "student" table. In the 
> meantime, in "student" table, the status for John should be set to "0" 
> (inactive). Wonder the solutions I have mentioned is possible? And if so, 
> how shld i go about doing it ?? 
On Wednesday 03 December 2003 18:00:07, [EMAIL PROTECTED] wrote:

I'm assuming you don't need help with the obvious, like how to insert John 
into the "withdraw" table and how to set his status to 0. 

So to implement your "keep for 30 days" thing, you need another column 
(probably in the "student" table) that is of type DATE and holds the date 
when "status" was set to 0. 

Then you can do something like (exact query depends on what DB you're using) 

  DELETE FROM student WHERE (DATE_SUB(NOW(), INTERVAL 30 DAY) > 
name_of_date_column) 

Also I hope you're not using the "student_name" column as a unique identifier 
to identify your students. You should have an extra column, say "student_id", 
which is of type sequence or auto increment (again, depending on your DB) as 
your unique student identifier. 

And please, in future ask php/db related questions on the php-db list. 

-- 
---

Not to worry, I already have a unique identifier to identify my "student" 
which wil be the student_id (which I have set as the primary key). Thanks for 
your previous solution, anyway stil having some doubts here:

What if within these 30 days, student John actually decided not to withdraw 
anymore and to continue to study in the school? Is there any way whereby I can 
set the status to "0" again n then John will not be deleted from the DB??
Wonder if this would be possible??>?

Regards, 
Irin Chiang. 

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



[PHP] wrapping PHP around a chinese web page

2003-12-03 Thread See Kok Boon
Hellox experts..

I am making a quiz for a Chinese website. the PHP I going to use is to be
wrapped together with the chinese character outputs all in a single file.
For an example...

In "quiz.php"

If(YOUR_ANSWER_IS_CORRECT)
{
print "in chinese: you scored full marks" //output
}
else
{
print "in chinese: please try again" //ouput
}

the outputs are Chinese characters.


The problem I have now is that either I can't output Chinese, or the code
doesn't work.

- I am developing this quiz on windows XP then uploading to Linux server.
- The "code editor" I use dun support any other formats than ANSI.
- MS WORD generates whole lot of rubbish for html documents and dun handle
PHPs
- Dreamweaver doesn't give me a clue on how to do it...
- so far notepad is the best. I can save the file as .php .html or .txt in
ANSI or UNICODE formats.

In notepad, I can input Chinese characters together with the PHP code
wrapped around. If I save in ANSI, the result online is that the code works,
but the output doesn't. if I save in Unicode, which notepad advices me to,
then the code cannot work and all the output regardless of the IF branches,
are output-ted. What else can I do?

The strange thing is that when in Unicode format, the PHP code doesn't show,
only the outputs are displayed.

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



[PHP] Re: Images On-Fly

2003-12-03 Thread Dejan Dujak
My entire page will then not work. Apperently it contains then error. If i

do delete that part of the php code it works just fine.

"Dejan Dujak" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hallo People,
>
>
>
> I have one problem with creating images on-fly.
>
> Therefore I created 2 files:
>
> 1. resize_image.php with the following
>
> 
> if (!$max_width)
>
> $max_width = 150;
>
> if (!$max_height)
>
> $max_height = 100;
>
> $size = GetImageSize($image);
>
> $width = $size[0];
>
> $height = $size[1];
>
> $x_ratio = $max_width / $width;
>
> $y_ratio = $max_height / $height;
>
> if ( ($width <= $max_width) && ($height <= $max_height) ) {
>
> $tn_width = $width;
>
> $tn_height = $height;
>
> }
>
> else if (($x_ratio * $height) < $max_height) {
>
> $tn_height = ceil($x_ratio * $height);
>
> $tn_width = $max_width;
>
> }
>
> else {
>
> $tn_width = ceil($y_ratio * $width);
>
> $tn_height = $max_height;
>
> }
>
> $src = ImageCreateFromJpeg($image);
>
> $dst = ImageCreate($tn_width,$tn_height);
>
> ImageCopyResized($dst, $src, 0, 0, 0, 0,
>
> $tn_width,$tn_height,$width,$height);
>
> header("Content-type: image/jpeg");
>
> ImageJpeg($dst, null, -1);
>
> ImageDestroy($src);
>
> ImageDestroy($dst);
>
> ?>
>
> AND
>
> 2. filex.php .In that file i read from database where the image is stored
en
>
> then i show small images(thumbnails).
>
> thet part of the code is :
>
> 
>
> 
>
> 
> $row_rsSubGroup['name']; ?>
>
> 
> $fotolink="../dbtest/".$row_rsSubGroup['image_1']);
>
> echo "
> SRC=\"resize_image.php?image=$fotolink\">";
>
> ?>
>
> 
>
> 
>
> 
>
>
>
>
>
> This doesn't WORK. Please HELP.

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



[PHP] wrapping PHP around chinese characters

2003-12-03 Thread See Kok Boon
Hellox experts..

 

I am making a quiz for a Chinese website. the PHP I going to use is to be
wrapped together with the chinese character outputs all in a single file.
For an example...

 

In "quiz.php"

 

If(YOUR_ANSWER_IS_CORRECT)

{

  print "in chinese: you scored full marks" //output

}

else

{

  print "in chinese: please try again" //ouput

}

 

the outputs are Chinese characters.

 

 

The problem I have now is that either I can't output Chinese, or the code
doesn't work.

 

- I am developing this quiz on windows XP then uploading to Linux server.

- The "code editor" I use dun support any other formats than ANSI.

- MS WORD generates whole lot of rubbish for html documents and dun handle
PHPs

- Dreamweaver doesn't give me a clue on how to do it...

- so far notepad is the best. I can save the file as .php .html or .txt in
ANSI or UNICODE formats.

 

In notepad, I can input Chinese characters together with the PHP code
wrapped around. If I save in ANSI, the result online is that the code works,
but the output doesn't. if I save in Unicode, which notepad advices me to,
then the code cannot work and all the output regardless of the IF branches,
are output-ted. What else can I do?

 

The strange thing is that when in Unicode format, the PHP code doesn't show,
only the outputs are displayed.

 

 



Re: [PHP] Re: Images On-Fly

2003-12-03 Thread Jason Wong
On Wednesday 03 December 2003 19:26, Dejan Dujak wrote:
> My entire page will then not work. Apperently it contains then error. If i
>
> do delete that part of the php code it works just fine.

So turn on FULL error reporting and find out what the error is.

-- 
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
--
/*
Whistler's mother is off her rocker.
*/

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



[PHP] Evaluating a page in a different order

2003-12-03 Thread cay
Hey all,
 
I have a php page class that i use as a template for my website. Every page in my 
website creates an instance of the class and passes values like title and meta tag 
keywords. The class includes the layout from different files e.g. title.lay contains 
the title and logo.
 
In the top right hand corner of my page i have a login status, which displays if the 
user is logged in or not. This is included as loginstatus.lay by the class.
 
If the page performs a php scripting function, it is included in the main content 
area. This main content area comes after the loginstatus.lay, so is evaluated 
afterwards.
 
My problem is when creating a logout page. The loginstatus is displayed as logged in, 
but the main content area logouts out the user.
 
The reason i designed the class and page layout like this is because i wanted to 
seperate the design and code as much as possible. As a temporary solution i have added 
some code to loginstatus.lay, but this is edging towards including code in the layout 
files which i dont want.
 
If i havent confused you too much, is there anything else you can suggest?
 
you can look at the page layout at http://www.pickledshark.co.uk/EdgeDB/login.php
 
Thanks for reading
Carey


[PHP] Evaluating a page in a different order

2003-12-03 Thread cay
Hey all,

I have a php page class that i use as a template for my website. Every page in my 
website creates an instance of the class and passes values like title and meta tag 
keywords. The class includes the layout from different files e.g. title.lay contains 
the title and logo.

In the top right hand corner of my page i have a login status, which displays if the 
user is logged in or not. This is included as loginstatus.lay by the class.

If the page performs a php scripting function, it is included in the main content 
area. This main content area comes after the loginstatus.lay, so is evaluated 
afterwards.

My problem is when creating a logout page. The loginstatus is displayed as logged in, 
but the main content area logouts out the user.

The reason i designed the class and page layout like this is because i wanted to 
seperate the design and code as much as possible. As a temporary solution i have added 
some code to loginstatus.lay, but this is edging towards including code in the layout 
files which i dont want.

If i havent confused you too much, is there anything else you can suggest?

you can look at the page layout at http://www.pickledshark.co.uk/EdgeDB/login.php

Thanks for reading

Carey



Re: [PHP] Evaluating a page in a different order

2003-12-03 Thread Eugene Lee
On Wed, Dec 03, 2003 at 11:42:09AM -, [EMAIL PROTECTED] wrote:
:  
: I have a php page class that i use as a template for my website. Every
: page in my website creates an instance of the class and passes values
: like title and meta tag keywords. The class includes the layout from
: different files e.g. title.lay contains the title and logo.
:  
: In the top right hand corner of my page i have a login status, which
: displays if the user is logged in or not. This is included as
: loginstatus.lay by the class.
:  
: If the page performs a php scripting function, it is included in the
: main content area. This main content area comes after the
: loginstatus.lay, so is evaluated afterwards.

While this answer functioned, it was obviously fundamentally flawed...

: My problem is when creating a logout page. The loginstatus is
: displayed as logged in, but the main content area logouts out the
: user.

At last, the fundamental flaw is ultimately expressed.  :-)

: The reason i designed the class and page layout like this is because i
: wanted to seperate the design and code as much as possible. As a
: temporary solution i have added some code to loginstatus.lay, but this
: is edging towards including code in the layout files which i dont
: want.

MVC-ish patterns are good.  The problem you've encountered is that code
in your main content area may do something that changes the output of
entire page (or in your case the top portion of the page).  You need to
modify your app to first evaluate all code, let it reach its next state,
and *then* generate the correct templated output based on the new state.

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



Re: [PHP] Evaluating a page in a different order

2003-12-03 Thread Justin French
On Wednesday, December 3, 2003, at 10:42  PM, <[EMAIL PROTECTED]> 
wrote:

If i havent confused you too much, is there anything else you can 
suggest?
This isn't a direct answer to your problem, but it might help you think 
things through.  I also don't work with classes (only functions), so 
you'll have to adapt what I discuss to suit.  The issue is that you're 
generating page content before you know what you're doing further down 
the page.  A basic summary of your steps:

1. render header html
2. logout user
3. render more content & report successful logout
4. render footer
Whereas you really need to perform all actions which will affect the 
page BEFORE starting to render content.  Shift the logout functionality 
above your output.

1. logout user
2. render header
3. render more content, and report successful logout
4. render footer
If you need to report errors or confirm the logout further down the 
page in the output, set some variables and echo them later.

Justin French

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


[PHP] register_globals problem

2003-12-03 Thread Bogdan Albei
I have a webpage that needs to use some specific php.ini settings 
different from other php applications on my web server. I have created a 
.htaccess file with the following content:

php_flag register_globals 1
php_flag error_reporting  "E_ALL & ~E_NOTICE"
It works fine, but only on Mozilla and Netscape. Internet explorer 
cannot process the content of this web page. The URL is 
http://e-technics.com/dorna/ .

Anyone knows the remedy for this strange behaviour?

Bogdan Albei
eTechnics
www.e-technics.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Doubts With Select Queries

2003-12-03 Thread Jay Blanchard
[snip]
What if within these 30 days, student John actually decided not to
withdraw 
anymore and to continue to study in the school? Is there any way whereby
I can 
set the status to "0" again n then John will not be deleted from the
DB??
Wonder if this would be possible??>?
[/snip]

Yes, it is possible.

http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-n
o-answers.html

Use an UPDATE query...

UPDATE tblStudent SET status = 'n' WHERE uniqueID = 'John'

Database questions should be referred to a database or SQL list.

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



Re: [PHP] Re: refresh data

2003-12-03 Thread Richard Davey
Hello BigMark,

Wednesday, December 3, 2003, 6:29:41 AM, you wrote:

B> Nope that didnt work!

You need to remove the fact the list is inside the check for the
$submit value too. Same sentiment as before.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



RE: [PHP] register_globals problem

2003-12-03 Thread Jay Blanchard
[snip]
I have a webpage that needs to use some specific php.ini settings 
different from other php applications on my web server. I have created a

.htaccess file with the following content:

php_flag register_globals 1
php_flag error_reporting  "E_ALL & ~E_NOTICE"

It works fine, but only on Mozilla and Netscape. Internet explorer 
cannot process the content of this web page. The URL is 
http://e-technics.com/dorna/ .

Anyone knows the remedy for this strange behaviour?
[/snip]

Since PHP is server-side and IE is client-side it is probably not a
problem with PHP. (I was able to replicate the problem you described) It
could be a problem with Apache though, try adding

AddType application/x-httpd-php .php

to the .htaccess file. I don't think that will solve the problem though.
Put a page in that directory called test.php with only



and see if that will load properly. I have also seen this problem caused
by JavaScript (you'll have to ask on a JavaScript list)

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



[PHP] Need help

2003-12-03 Thread MBA
> How could I use this php code, 
> 
>  
> 
> 
> in order to show the ip in a web page?
> 
> thanks 
> 



-
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

Re: [PHP] register_globals problem

2003-12-03 Thread Bogdan Albei
Jay Blanchard wrote:

[snip]
I have a webpage that needs to use some specific php.ini settings 
different from other php applications on my web server. I have created a

.htaccess file with the following content:

php_flag register_globals 1
php_flag error_reporting  "E_ALL & ~E_NOTICE"
It works fine, but only on Mozilla and Netscape. Internet explorer 
cannot process the content of this web page. The URL is 
http://e-technics.com/dorna/ .

Anyone knows the remedy for this strange behaviour?
[/snip]
Since PHP is server-side and IE is client-side it is probably not a
problem with PHP. (I was able to replicate the problem you described) It
could be a problem with Apache though, try adding
AddType application/x-httpd-php .php

to the .htaccess file. I don't think that will solve the problem though.
Put a page in that directory called test.php with only


phpinfo();

?>

and see if that will load properly. I have also seen this problem caused
by JavaScript (you'll have to ask on a JavaScript list)
 

It doesn't work at all if I put  AddType application/x-httpd-php .php

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


Re: [PHP] Need help

2003-12-03 Thread Thorsten Körner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi
Am Mittwoch, 3. Dezember 2003 14:24 schrieb MBA:
> > How could I use this php code,
> >
> >
> > 
> >
> > in order to show the ip in a web page?
You should use:

for PHP 4.1 and higher.

Please use a more descriptive subject for your questions

CU
Thorsten

- -- 
Thorsten Körner |   http://www.123tkShop.org
openSource e-Commerce   |   http://www.123tk.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/zeY/s5R35vLkl/cRAk5+AKCp0qwutyAemO1ePf0DyrahKwEAXgCgoM4u
4q909NO3uG1fgPTopDYHySI=
=WWdT
-END PGP SIGNATURE-

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



RE: [PHP] register_globals problem

2003-12-03 Thread Jay Blanchard
[snip]
>Put a page in that directory called test.php with only
>
>
>phpinfo();
>
>?>
It doesn't work at all if I put  AddType application/x-httpd-php .php
[/snip]

Did you try the test.php above?

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



Re: [PHP] Evaluating a page in a different order

2003-12-03 Thread Andrei Reinus
[EMAIL PROTECTED] wrote:
Hey all,
 
I have a php page class that i use as a template for my website. Every page in my website creates an instance of the class and passes values like title and meta tag keywords. The class includes the layout from different files e.g. title.lay contains the title and logo.
 
In the top right hand corner of my page i have a login status, which displays if the user is logged in or not. This is included as loginstatus.lay by the class.
 
If the page performs a php scripting function, it is included in the main content area. This main content area comes after the loginstatus.lay, so is evaluated afterwards.
 
My problem is when creating a logout page. The loginstatus is displayed as logged in, but the main content area logouts out the user.
 
The reason i designed the class and page layout like this is because i wanted to seperate the design and code as much as possible. As a temporary solution i have added some code to loginstatus.lay, but this is edging towards including code in the layout files which i dont want.
 
If i havent confused you too much, is there anything else you can suggest?
 
you can look at the page layout at http://www.pickledshark.co.uk/EdgeDB/login.php
 
Thanks for reading
Carey
Off topic:
Please, Please and 100 times again Please.
Secure your web page

Please.

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


[PHP] Completely Daft Question

2003-12-03 Thread pete M
I have written and applicaiton in VB (yuck but that's what the client 
wants) and part of the application involves importing and processing 
text files.

For that I turned to php;-) for all its processing power as a shell script.

Now here is the daft question.

How would I go about embedding the php_dll in my vb application and use 
it to process a script ??? if its even possible 

pete

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


[PHP] wrapping PHP around Chinese characters

2003-12-03 Thread See Kok Boon
Hellox experts..

 

I am making a quiz for a Chinese website. the PHP I going to use is to be
wrapped together with the chinese character outputs all in a single file.
For an example...

 

In "quiz.php"

 

If(YOUR_ANSWER_IS_CORRECT)

{

  print "in chinese: you scored full marks" //output

}

else

{

  print "in chinese: please try again" //ouput

}

 

the outputs are Chinese characters.

 

 

The problem I have now is that either I can't output Chinese, or the code
doesn't work.

 

- I am developing this quiz on windows XP then uploading to Linux server.

- The "code editor" I use dun support any other formats than ANSI.

- MS WORD generates whole lot of rubbish for html documents and dun handle
PHPs

- Dreamweaver doesn't give me a clue on how to do it...

- so far notepad is the best. I can save the file as .php .html or .txt in
ANSI or UNICODE formats.

 

In notepad, I can input Chinese characters together with the PHP code
wrapped around. If I save in ANSI, the result online is that the code works,
but the output doesn't. if I save in Unicode, which notepad advices me to,
then the code cannot work and all the output regardless of the IF branches,
are output-ted. What else can I do?

 

The strange thing is that when in Unicode format, the PHP code doesn't show,
only the outputs are displayed.

 



Re: [PHP] wrapping PHP around Chinese characters

2003-12-03 Thread Sophie Mattoug
Would it be possible you have a problem with line-feeds while uploading 
from win ti linux ?

--
Cordialement,
---
Sophie Mattoug
Développement web dynamique
[EMAIL PROTECTED]
---
See Kok Boon wrote:

Hellox experts..



I am making a quiz for a Chinese website. the PHP I going to use is to be
wrapped together with the chinese character outputs all in a single file.
For an example...


In "quiz.php"



If(YOUR_ANSWER_IS_CORRECT)

{

 print "in chinese: you scored full marks" //output

}

else

{

 print "in chinese: please try again" //ouput

}



the outputs are Chinese characters.





The problem I have now is that either I can't output Chinese, or the code
doesn't work.


- I am developing this quiz on windows XP then uploading to Linux server.

- The "code editor" I use dun support any other formats than ANSI.

- MS WORD generates whole lot of rubbish for html documents and dun handle
PHPs
- Dreamweaver doesn't give me a clue on how to do it...

- so far notepad is the best. I can save the file as .php .html or .txt in
ANSI or UNICODE formats.


In notepad, I can input Chinese characters together with the PHP code
wrapped around. If I save in ANSI, the result online is that the code works,
but the output doesn't. if I save in Unicode, which notepad advices me to,
then the code cannot work and all the output regardless of the IF branches,
are output-ted. What else can I do?


The strange thing is that when in Unicode format, the PHP code doesn't show,
only the outputs are displayed.


 

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


RE: [PHP] Evaluating a page in a different order

2003-12-03 Thread cay


 

[EMAIL PROTECTED] wrote:
> Hey all,
> 
> I have a php page class that i use as a template for my website. Every page 
in my website creates an instance of the class and passes values like title and meta 
tag keywords. The class includes the layout from different files e.g. title.lay 
contains the title and logo.
> 
> In the top right hand corner of my page i have a login status, which 
displays if the user is logged in or not. This is included as loginstatus.lay by the 
class.
> 
> If the page performs a php scripting function, it is included in the main 
content area. This main content area comes after the loginstatus.lay, so is evaluated 
afterwards.
> 
> My problem is when creating a logout page. The loginstatus is displayed as 
logged in, but the main content area logouts out the user.
> 
> The reason i designed the class and page layout like this is because i 
wanted to seperate the design and code as much as possible. As a temporary solution i 
have added some code to loginstatus.lay, but this is edging towards including code in 
the layout files which i dont want.
> 
> If i havent confused you too much, is there anything else you can suggest?
> 
> you can look at the page layout at 
http://www.pickledshark.co.uk/EdgeDB/login.php
> 
> Thanks for reading
> Carey
Off topic:
Please, Please and 100 times again Please.

Secure your web page

Please.
---



My apologies, but this is my first delve into php. Can you let me know whats 
not secure? 

Thanks
Carey




[PHP] Re: Need help

2003-12-03 Thread pete M


Mba wrote:

How could I use this php code, 



in order to show the ip in a web page?

thanks 





-
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Completely Daft Question

2003-12-03 Thread Chris Hayes
At 15:27 3-12-03, you wrote:
I have written and applicaiton in VB (yuck but that's what the client 
wants) and part of the application involves importing and processing text 
files.

For that I turned to php;-) for all its processing power as a shell script.

Now here is the daft question.

How would I go about embedding the php_dll in my vb application and use it 
to process a script ??? if its even possible 
ooh VBA. I hope it has better documentation than 3 years ago.
PHP has two versions, the exe and the dll. I think for the DLL part you 
have better chances in a VBA group. For the exe part, check this list or 
the internet for [PHP commandline].

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


RE: [PHP] wrapping PHP around Chinese characters

2003-12-03 Thread See Kok Boon
I dun understand what you mean by line feeds.

When the file is in Unicode format, the web displays the Chinese characters
and when I view source, I can see all the PHP code. If quiz.php is treated
like a PHP file, then the PHP parser would not have allowed the PHP code to
show in source.

If quiz.php is treated like a txt file, the PHP code should show on screen.
Same goes if quiz.php is treated like HTML file (I suppose).

So.. what could be wrong? And how to fix it? Please help urgent... thanks in
advance! =`(

When file is in ANSI format, everything is fine except that the chinese
doesn’t show... bad.

-Original Message-
From: Sophie Mattoug [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 03, 2003 10:35 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] wrapping PHP around Chinese characters

Would it be possible you have a problem with line-feeds while uploading 
from win ti linux ?

-- 
Cordialement,
---
Sophie Mattoug
Développement web dynamique
[EMAIL PROTECTED]
---

See Kok Boon wrote:

>Hellox experts..
>
> 
>
>I am making a quiz for a Chinese website. the PHP I going to use is to be
>wrapped together with the chinese character outputs all in a single file.
>For an example...
>
> 
>
>In "quiz.php"
>
> 
>
>If(YOUR_ANSWER_IS_CORRECT)
>
>{
>
>  print "in chinese: you scored full marks" //output
>
>}
>
>else
>
>{
>
>  print "in chinese: please try again" //ouput
>
>}
>
> 
>
>the outputs are Chinese characters.
>
> 
>
> 
>
>The problem I have now is that either I can't output Chinese, or the code
>doesn't work.
>
> 
>
>- I am developing this quiz on windows XP then uploading to Linux server.
>
>- The "code editor" I use dun support any other formats than ANSI.
>
>- MS WORD generates whole lot of rubbish for html documents and dun handle
>PHPs
>
>- Dreamweaver doesn't give me a clue on how to do it...
>
>- so far notepad is the best. I can save the file as .php .html or .txt in
>ANSI or UNICODE formats.
>
> 
>
>In notepad, I can input Chinese characters together with the PHP code
>wrapped around. If I save in ANSI, the result online is that the code
works,
>but the output doesn't. if I save in Unicode, which notepad advices me to,
>then the code cannot work and all the output regardless of the IF branches,
>are output-ted. What else can I do?
>
> 
>
>The strange thing is that when in Unicode format, the PHP code doesn't
show,
>only the outputs are displayed.
>
> 
>
>
>  
>

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

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



[PHP] Sessions, ending and starting new with just a click

2003-12-03 Thread Robert Sossomon
Hey guys and gals,

I am working on a shopping cart and using some code to write it from 2
temp databases to a full end databases (which will then be used via PERL
to send to an archaic order system) but right now I need to come up with
a way to clear their current session ID after finalizing the order and
then dropping them into the new session variable so they can start a new
order.  

I currently have:



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



Re: [PHP] wrapping PHP around Chinese characters

2003-12-03 Thread Jason Wong
On Thursday 04 December 2003 00:09, See Kok Boon wrote:
> I dun understand what you mean by line feeds.

That should not have anything to do with your problem.

[snip]

> When file is in ANSI format, everything is fine except that the chinese
> doesn’t show... bad.

Have you specified the correct encoding? -- either by using the HTTP header 
"Content-Type: text/html; charset=BIG5" or an equivalent HTML meta-tag.

-- 
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
--
/*
Appendix:
A portion of a book, for which nobody yet has discovered any use.
*/

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



Re: [PHP] Completely Daft Question

2003-12-03 Thread pete M
For the exe part, check this list or
> the internet for [PHP commandline].
Didn't think  calling that from VB -
ta - problem solved
Pete
Chris Hayes wrote:

At 15:27 3-12-03, you wrote:

I have written and applicaiton in VB (yuck but that's what the client 
wants) and part of the application involves importing and processing 
text files.

For that I turned to php;-) for all its processing power as a shell 
script.

Now here is the daft question.

How would I go about embedding the php_dll in my vb application and 
use it to process a script ??? if its even possible 
ooh VBA. I hope it has better documentation than 3 years ago.
PHP has two versions, the exe and the dll. I think for the DLL part you 
have better chances in a VBA group. For the exe part, check this list or 
the internet for [PHP commandline].
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Building a query string

2003-12-03 Thread Ed Curtis

 This list has helped me out alot and I hope it can do it one more time.

I need to build a MySQL query based on 11 different options from a form.
Some options will have values others will be checkboxes to say include in
the query.

How I thought about going at it was using a default query string and add
additional strings to the default string based on results of the form.

$query_str = "SELECT * FROM listings WHERE id > 0 ";

if ($garage != "") {

$garage_str = "AND garage = '$garage' ";

//add $garage_str to $query_str//

}

This would continue through all eleven options then produce a query string
with all included query options needed. Can this be done this way? If so,
how do I add a string to a string?

Thanks,

Ed

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



[PHP] Re: Building a query string

2003-12-03 Thread Bogdan Stancescu
Ed Curtis wrote:
 This list has helped me out alot and I hope it can do it one more time.

I need to build a MySQL query based on 11 different options from a form.
Some options will have values others will be checkboxes to say include in
the query.
How I thought about going at it was using a default query string and add
additional strings to the default string based on results of the form.
$query_str = "SELECT * FROM listings WHERE id > 0 ";

if ($garage != "") {

	$garage_str = "AND garage = '$garage' ";

	//add $garage_str to $query_str//

	}

This would continue through all eleven options then produce a query string
with all included query options needed. Can this be done this way? If so,
how do I add a string to a string?
Thanks,

Ed
To answer the question, $query_str.=" AND garage = '$garage' ";

BUT. If $garage is an id (numeric), then you should use 
$garage=abs($garage) first in order to defeat SQL injection. If it's a 
string, well, say so and we'll tell you what to do (a lot to explain, 
and not useful if it's an ID).

Bogdan

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


RE: [PHP] wrapping PHP around Chinese characters

2003-12-03 Thread See Kok Boon
Thanks jason. Problems solved. Thanks. =)

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 04, 2003 12:19 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] wrapping PHP around Chinese characters

On Thursday 04 December 2003 00:09, See Kok Boon wrote:
> I dun understand what you mean by line feeds.

That should not have anything to do with your problem.

[snip]

> When file is in ANSI format, everything is fine except that the chinese
> doesn't show... bad.

Have you specified the correct encoding? -- either by using the HTTP header 
"Content-Type: text/html; charset=BIG5" or an equivalent HTML meta-tag.

-- 
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
--
/*
Appendix:
A portion of a book, for which nobody yet has discovered any use.
*/

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

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



[PHP] can mail() function send emails to any email account?

2003-12-03 Thread See Kok Boon
Hello.. it's me again.

Trying to use mail() function to send emails to hotmail accounts. It seems
that it's not working.

Tried the same function on my own email account, it worked.

Tried on some other, it doesn't.

What determines if the mail() function works?

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



RE: [PHP] can mail() function send emails to any email account?

2003-12-03 Thread Jay Blanchard
[snip]
Hello.. it's me again.

Trying to use mail() function to send emails to hotmail accounts. It
seems
that it's not working.

Tried the same function on my own email account, it worked.

Tried on some other, it doesn't.

What determines if the mail() function works?
[/snip]

Whether or not it is installed properly. If it is it will send e-mails
to any given e-mail address.

Perhaps the hotmail account is set up to deflect unknown users as spam?

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



Re: [PHP] Sessions, ending and starting new with just a click

2003-12-03 Thread Lowell Allen
> Hey guys and gals,
> 
> I am working on a shopping cart and using some code to write it from 2
> temp databases to a full end databases (which will then be used via PERL
> to send to an archaic order system) but right now I need to come up with
> a way to clear their current session ID after finalizing the order and
> then dropping them into the new session variable so they can start a new
> order.  

Why do you need to start a new session? Why not record the order to the
database with a unique identifier, and then just empty the shopping cart? If
they do a new order, you can give it a different id when saving to the db.

--
Lowell Allen

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



Re: [PHP] Re: Building a query string

2003-12-03 Thread Ed Curtis

> To answer the question, $query_str.=" AND garage = '$garage' ";
>
> BUT. If $garage is an id (numeric), then you should use
> $garage=abs($garage) first in order to defeat SQL injection. If it's a
> string, well, say so and we'll tell you what to do (a lot to explain,
> and not useful if it's an ID).
>
> Bogdan

 All values pulled from $_POST are strings such as $garage = "Attached 2
Car" or "Detached 1 Car", etc. There are a few options that will be based
on a checkbox. If the box is checked it means you want that option
included in the query as well, i.e. (fireplace == "yes".) If the box is
not checked it means no, i.e (fireplace == "no".)

Thanks,

Ed

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



RE: [PHP] can mail() function send emails to any email account?

2003-12-03 Thread Sam Masiello

Did you get a bounce?  Perhaps to the root account on your local
machine?  Some domains do reverse DNS lookup and if sendmail is not
configured properly the receiving domain might kick the email back if it
doesn't recognize where the email claims to be coming from.

--Sam


-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 03, 2003 9:46 AM
To: See Kok Boon; php-general
Subject: RE: [PHP] can mail() function send emails to any email account?


[snip]
Hello.. it's me again.

Trying to use mail() function to send emails to hotmail accounts. It
seems that it's not working.

Tried the same function on my own email account, it worked.

Tried on some other, it doesn't.

What determines if the mail() function works?
[/snip]

Whether or not it is installed properly. If it is it will send e-mails
to any given e-mail address.

Perhaps the hotmail account is set up to deflect unknown users as spam?

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

2003-12-03 Thread Chris
The only problem I see with that is that you're using the constants E_ALL
and E_NOTICE in the .htaccess file. You can't use constants there, you need
to use the actual number. (2047 & ~8) == 2039:

php_flag register_globals 1
php_flag error_reporting  "2039"

Chris

-Original Message-
From: Bogdan Albei [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 4:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] register_globals problem


I have a webpage that needs to use some specific php.ini settings
different from other php applications on my web server. I have created a
.htaccess file with the following content:

php_flag register_globals 1
php_flag error_reporting  "E_ALL & ~E_NOTICE"

It works fine, but only on Mozilla and Netscape. Internet explorer
cannot process the content of this web page. The URL is
http://e-technics.com/dorna/ .

Anyone knows the remedy for this strange behaviour?

Bogdan Albei
eTechnics
www.e-technics.com

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

2003-12-03 Thread Chris
Heh, sorry about that.. one more thing, php_flag is only for bollean values,
this should work:

php_flag register_globals on
php_value error_reporting  "2039"

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 9:10 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] register_globals problem


The only problem I see with that is that you're using the constants E_ALL
and E_NOTICE in the .htaccess file. You can't use constants there, you need
to use the actual number. (2047 & ~8) == 2039:

php_flag register_globals 1
php_flag error_reporting  "2039"

Chris

-Original Message-
From: Bogdan Albei [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 4:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] register_globals problem


I have a webpage that needs to use some specific php.ini settings
different from other php applications on my web server. I have created a
.htaccess file with the following content:

php_flag register_globals 1
php_flag error_reporting  "E_ALL & ~E_NOTICE"

It works fine, but only on Mozilla and Netscape. Internet explorer
cannot process the content of this web page. The URL is
http://e-technics.com/dorna/ .

Anyone knows the remedy for this strange behaviour?

Bogdan Albei
eTechnics
www.e-technics.com

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

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

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



RE: [PHP] Simple table sorting

2003-12-03 Thread Luis Lebron
You may want to also try a javascript solution

See http://www.kryogenix.org/code/browser/sorttable/ for an example.

Luis


-Original Message-
From: Tommi Virtanen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 8:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Simple table sorting


Hi!

I have simple table like:

namedepartment
[data: first name]  [data: dep. no]
[data: second name] [data: dep. no]

Now I have only sorting which sorts using ORDER BY name. How I
make header name / department active link, which I can change sorting
order Department and then back to Name?

regards,

gustavus

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


[PHP] function problems...

2003-12-03 Thread Jas
I call this function it checks a session variable then displays 1 of 3 
menus... for some reason it will only display the first menu regardless 
of the results of my decoded session var.  Any help or just a new pair 
of eyes would help.  Thanks in advance.
jas

function menu() {
	$lvl = base64_decode($_SESSION['lvl']);
	echo $lvl;
	if (($lvl != "admin") || ($lvl != "user") || ($lvl == "view")) {
			$_SESSION['menu'] = "";
	} elseif (($lvl != "admin") || ($lvl == "user") || ($lvl != "view")) {
			$_SESSION['menu'] = "Manage hosts
 Update DHCP
 ";
	} elseif (($lvl == "admin") || ($lvl != "user") || ($lvl != "view")) {
			$_SESSION['menu'] = "Global DHCP config.
 Manage VLANS
 Manage hosts
 Update DHCP
 
 Users
		 			 Logs";
	} else {
			$_SESSION['menu'] = ""; }
}

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


[PHP] validating email address

2003-12-03 Thread Blake Schroeder
Whats the best way to validate email address (check for white space, 
check for .com, .net.edu etc)

-Blake

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


Re: [PHP] function problems...

2003-12-03 Thread Richard Davey
Hello Jas,

Wednesday, December 3, 2003, 6:15:20 PM, you wrote:

J> I call this function it checks a session variable then displays 1 of 3
J> menus... for some reason it will only display the first menu regardless
J> of the results of my decoded session var.  Any help or just a new pair
J> of eyes would help.  Thanks in advance.

J>  if (($lvl != "admin") || ($lvl != "user") || ($lvl == "view")) {

I'm pretty sure this need to be:

$lvl !== "admin"

(Note: double equals sign)

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] validating email address

2003-12-03 Thread Jason Wong
On Thursday 04 December 2003 02:31, Blake Schroeder wrote:
> Whats the best way to validate email address (check for white space,
> check for .com, .net.edu etc)

google > php validate email address

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The way I understand it, the Russians are sort of a combination of evil and
incompetence... sort of like the Post Office with tanks.
-- Emo Philips
*/

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



[PHP] Re: function problems...

2003-12-03 Thread Jas
Nevermind, I got it to work...
cheers
Jas wrote:

I call this function it checks a session variable then displays 1 of 3 
menus... for some reason it will only display the first menu regardless 
of the results of my decoded session var.  Any help or just a new pair 
of eyes would help.  Thanks in advance.
jas

function menu() {
$lvl = base64_decode($_SESSION['lvl']);
echo $lvl;
if (($lvl != "admin") || ($lvl != "user") || ($lvl == "view")) {
$_SESSION['menu'] = "";
} elseif (($lvl != "admin") || ($lvl == "user") || ($lvl != "view")) {
$_SESSION['menu'] = "Manage hosts
 Update DHCP
 ";
} elseif (($lvl == "admin") || ($lvl != "user") || ($lvl != "view")) {
$_SESSION['menu'] = "Global DHCP config.
 Manage VLANS
 Manage hosts
 Update DHCP
 
 Users
  Logs";
} else {
$_SESSION['menu'] = ""; }
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Session Expiration Problem....

2003-12-03 Thread CF High
Hey all.

Our hosting company sets session vars to expire every 15 minutes.

I've setup an Admin Center for users to enter various types of information,
some of which, for example entering a basketball team roster, can take
slower users upwards of 25 minutes or more.

The result?  Admin user spends 25 minutes entering data; clicks the submit
button; then is redirected to the login page because their session
expired! -- all form data is lost -- not good

Is there a way to extend the php session timeout for particular pages?
Alternatively, is there a way, other than using cookies, to store user data
from page-to-page?

Thanks for any leads,

--Noah



--

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



[PHP] preserving blank space padding when using fgetcsv

2003-12-03 Thread Roger Spears
Hello,

I've been researching this for most of the day and am unable to find an 
answer.

I'm using fgetcsv to read a comma delimited file (Microsoft Excel CSV).  
I'm trying to create a PHP application which will read a csv file line 
by line, remove the commas and preserve the padding that is in each 
column.  That means if a column is a fixed length of 15 characters and 
the actual text in that column is only 5 characters long, the 
application will preserve the extra 10 blank spaces.

I'm able to open and read the csv using fgetcsv:
$handle = fopen ($filename, "r");
while ($mpt_line = fgetcsv ($handle, filesize ($filename), ","))
{
Then I check each member of that array to make sure it is the proper 
length for that column:
if (strlen($mpt_line[0])<4)
{
str_pad($mpt_line[0], 4, " ", STR_PAD_RIGHT);
}
When all of the length checks are finished I remove the commas and then 
print out the finished product:
}
$no_commas = str_replace(",", "", $mpt_line);
print "aa/".$no_commas[0]."/aa";

For output all I get is the actual text and no blank space padding.  
Meaning that if the field contains two characters of data it should 
still appear 4 characters in length.  I was hoping to achieve aa/hi  /aa 
instead all I get is aa/hi/aa. 

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


[PHP] Propagating SID when cookies disabled

2003-12-03 Thread rogue
Hi all,

I am testing some templates that are using a session. I have PHP 
compiled with --enable-trans-sid.

It is my understanding that if I have cookies disabled in my browser 
and this:



echo 'go';

?>

is in the template, the SID should automatically get stuck on the end 
of the URL, but this is not happening. In order to pass it, I have to 
do something like:

go';
?>
Am I missing something?

thanks

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


Re: [PHP] register_globals problem

2003-12-03 Thread Bogdan Albei
Jay Blanchard wrote:

[snip]
 

Put a page in that directory called test.php with only



phpinfo();

?>
   

It doesn't work at all if I put  AddType application/x-httpd-php .php
[/snip]
Did you try the test.php above?

 

Yes, I have. Doesn't work.

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


[PHP] Odd problem with ereg_replace and addslahes

2003-12-03 Thread Ian Truelsen
Here is what I am doing:

I am reading in the contents of a text file that contains variables
whose properties I want to output. So, as was suggested on the list I
used the following:

eval("\$rest = \"".addslashes($pre_rest)."\";");

This works quite well, with one problem: if I use a contraction, like
won't, it will output as won\'t. So, I tried changing it to a backtic
(`) in the text file and after the eval statement, the output was won`t.
So, I thought I had it. I added:
ereg_replace("'", "`", $pre_rest);
before the eval statement. However, the output then became won\`t.

I don't understand why it is that changing quote to backtic in the text
file will give me the proper output, but the ereg_replace, which should
provide the same input to the eval statement, gets the slash added.

Does anyone have any ideas on why this is happening, and what I can do
to avoid the quote being slashed?

-- 
Ian Truelsen
Email: [EMAIL PROTECTED]
AIM: ihtruelsen
Homepage: http://www.ihtruelsen.dyndns.org
Signature key (742B740D) available at pgp.mit.edu



pgp0.pgp
Description: PGP signature


RE: [PHP] register_globals problem

2003-12-03 Thread Jay Blanchard
[snip]
>
>Did you try the test.php above?
>
>  
>
Yes, I have. Doesn't work.
[/snip]

Then your httpd.conf in not configured properly. It would appear to me
that PHP is not working at all. I went to the URL inquestion and did not
find this test page, so it will be hard for me to help you. Does PHP
work anywhere on your server?

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



Re: [PHP] register_globals problem

2003-12-03 Thread Bogdan Albei
Chris wrote:
Heh, sorry about that.. one more thing, php_flag is only for bollean values,
this should work:
php_flag register_globals on
php_value error_reporting  "2039"
-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 9:10 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] register_globals problem
The only problem I see with that is that you're using the constants E_ALL
and E_NOTICE in the .htaccess file. You can't use constants there, you need
to use the actual number. (2047 & ~8) == 2039:
php_flag register_globals 1
php_flag error_reporting  "2039"
Chris

-Original Message-
From: Bogdan Albei [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 4:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] register_globals problem
I have a webpage that needs to use some specific php.ini settings
different from other php applications on my web server. I have created a
.htaccess file with the following content:
php_flag register_globals 1
php_flag error_reporting  "E_ALL & ~E_NOTICE"
It works fine, but only on Mozilla and Netscape. Internet explorer
cannot process the content of this web page. The URL is
http://e-technics.com/dorna/ .
Anyone knows the remedy for this strange behaviour?

Bogdan Albei
eTechnics
www.e-technics.com
--
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
It doesn't work. After all a script that contains only phpinfo() 
(e-technics.com/dorna/info.php) works OK, but the webpage, which is a 
PhpNuke doesn't work.

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


RE: [PHP] Virtual Directory Support

2003-12-03 Thread Ralph Guzman
Jason, thank you for responding. I never did figure out what the problem
was. This installation was done by somebody else using readhat 9' out of the
box rpm based installation. So rather than wasting time I went ahead and
recompiled apache/php from source code. Everything is working now and html
pages appear to be loading faster. I guess compiling from source provides
better performance than installing using rpm. 

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 03, 2003 1:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Virtual Directory Support

On Wednesday 03 December 2003 12:51, Ralph Guzman wrote:
> I have a new installation of PHP 4.1.2 and it appears I cannot run php
> scripts outside of apache root directory.

How did you come to this conclusion? Was there an error message? If so, what

did it say? If there was no error message, then enable FULL error reporting 
and try again.

> I look at phpinfo() and I saw
> Virtual Directory Support is set to disabled. I'm suspecting this could me
> the problem, but I have not been able to find anything on google or the
> lists explaining how to enable this.

I doubt whether that has anything to do with your problem.

-- 
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
--
/*
There is always someone worse off than yourself.
*/

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

2003-12-03 Thread Jay Blanchard
[snip]
It doesn't work. After all a script that contains only phpinfo() 
(e-technics.com/dorna/info.php) works OK, but the webpage, which is a 
PhpNuke doesn't work.
[/snip]

Actually info.php works in IE and reports  register_global is ON locally
(within that directory). Therefore, as I stated earlier, it is not a PHP
problem. It is either an Apache configuration problem or a problem
within the HTML/CSS/JavaScript code that is hanging IE. I have seen both
CSS and JavaScript do this behavior.

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



Re: [PHP] Session Expiration Problem....

2003-12-03 Thread Matt Matijevich

Is there a way to extend the php session timeout for particular pages?
Alternatively, is there a way, other than using cookies, to store user
data
from page-to-page?


I think you can use ini_set() to change session.gc_maxlifetime, that
will change your session timeout.

You could pass data around in hidden fields but that would be a pain. 

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



Re: [PHP] register_globals problem

2003-12-03 Thread Bogdan Albei
Jay Blanchard wrote:
[snip]
It doesn't work. After all a script that contains only phpinfo() 
(e-technics.com/dorna/info.php) works OK, but the webpage, which is a 
PhpNuke doesn't work.
[/snip]

Actually info.php works in IE and reports  register_global is ON locally
(within that directory). Therefore, as I stated earlier, it is not a PHP
problem. It is either an Apache configuration problem or a problem
within the HTML/CSS/JavaScript code that is hanging IE. I have seen both
CSS and JavaScript do this behavior.
If I create an PHP environment such that I don't need to override 
register_globals and error_reporting with a .htaccess file it works just 
fine, so I guess the problem is in the .htaccess file. I posted my 
httpd.conf file at http://e-technics.com/dorna/httpd.conf.
If I comment the lines


AllowOverride All

that makes the override possible, the page works fine, but I don't have 
register_globals and error_reporting as I want them.

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


RE: [PHP] register_globals problem

2003-12-03 Thread Jay Blanchard
[snip]
If I create an PHP environment such that I don't need to override 
register_globals and error_reporting with a .htaccess file it works just

fine, so I guess the problem is in the .htaccess file. I posted my 
httpd.conf file at http://e-technics.com/dorna/httpd.conf.
If I comment the lines


AllowOverride All


that makes the override possible, the page works fine, but I don't have 
register_globals and error_reporting as I want them.
[/snip]

Actually, according to the info.php page for that directory
register_globals is ON as you desire...correct?

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



Re: [PHP] register_globals problem

2003-12-03 Thread Bogdan Albei
Jay Blanchard wrote:
[snip]
If I create an PHP environment such that I don't need to override 
register_globals and error_reporting with a .htaccess file it works just

fine, so I guess the problem is in the .htaccess file. I posted my 
httpd.conf file at http://e-technics.com/dorna/httpd.conf.
If I comment the lines


AllowOverride All

that makes the override possible, the page works fine, but I don't have 
register_globals and error_reporting as I want them.
[/snip]

Actually, according to the info.php page for that directory
register_globals is ON as you desire...correct?
Correct, the .htaccess file overides just fine register_globals and 
error_reporting but somehow Internet Explorer and Konqueror does not 
load the page.

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


RE: [PHP] register_globals problem

2003-12-03 Thread Jay Blanchard
[snip]
> Actually, according to the info.php page for that directory
> register_globals is ON as you desire...correct?

Correct, the .htaccess file overides just fine register_globals and 
error_reporting but somehow Internet Explorer and Konqueror does not 
load the page.
[/snip]

But IE and Konqueror both load the info.php correctly from my end. It is
the index.php for Nukemods.com that gets hosed in those browsers.

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



Re: [PHP] register_globals problem

2003-12-03 Thread Bogdan Albei
Jay Blanchard wrote:
[snip]

Actually, according to the info.php page for that directory
register_globals is ON as you desire...correct?


Correct, the .htaccess file overides just fine register_globals and 
error_reporting but somehow Internet Explorer and Konqueror does not 
load the page.
[/snip]

But IE and Konqueror both load the info.php correctly from my end. It is
the index.php for Nukemods.com that gets hosed in those browsers.
So you're saying that index.php is broken? Then why it gets loaded fine 
if I delete the .htaccess file?

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


Re: [PHP] validating email address

2003-12-03 Thread David T-G
Blake --

...and then Blake Schroeder said...
% 
% Whats the best way to validate email address (check for white space, 
% check for .com, .net.edu etc)

1) Read this list's archives

2) STFW

3) Hand the job off to something else if at all possible


% 
% -Blake


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] register_globals problem

2003-12-03 Thread Jay Blanchard
[snip]
> But IE and Konqueror both load the info.php correctly from my end. It
is
> the index.php for Nukemods.com that gets hosed in those browsers.

So you're saying that index.php is broken? Then why it gets loaded fine 
if I delete the .htaccess file?
[/snip]

That is exactly what I am saying. Is the .htacesss file deleted now?
I'll go and see if it works. Leave both the index.php and the info.php
in the directory.

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



Re: [PHP] Session Expiration Problem....

2003-12-03 Thread Lowell Allen
> Our hosting company sets session vars to expire every 15 minutes.
> 
> I've setup an Admin Center for users to enter various types of information,
> some of which, for example entering a basketball team roster, can take
> slower users upwards of 25 minutes or more.
> 
> The result?  Admin user spends 25 minutes entering data; clicks the submit
> button; then is redirected to the login page because their session
> expired! -- all form data is lost -- not good
> 
> Is there a way to extend the php session timeout for particular pages?
> Alternatively, is there a way, other than using cookies, to store user data
> from page-to-page?
> 
> Thanks for any leads,

Yeah, I get occasional complaints about this problem -- although I don't
have to contend with sessions expiring every 15 minutes! I've found that
it's usually possible to use the browser back button to return to the form
with all values still in place (Windows 98-IE6 being an exception), then
open a new window to log in again, then return to the form window to submit.
Those instructions can accompany your "not logged in" message. Admittedly an
inelegant solution, but it's better than losing the form data.

In my situation, I've considered rewriting the PHP script that's receiving
the form post so that if the session has expired it will re-display a
simplified version of the form (without showing protected content) with the
posted data, and provide a link to open a login form in a new (small)
window.

HTH

--
Lowell Allen

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



[PHP] problem redirecting to protected directory

2003-12-03 Thread Bart
Hello,

Can you people help me with the following authentication-problem?

I have a directory names 'secure' that contains only html-files. Access is
only allowed for
registered website-visitors. Within the directory it isn't possible to place
php-files for
access-control so I have passwd-protected this directory with one 'username'
and 'password'.

Above this 'secure'-dir I've placed a login-form that checks a MySQL-db for
the entered login.
When a correct login is entered the visitor has to be able to access the
'secure'-dir without
knowing/seeing the 'username' and 'password' that protects the dir.

How can I redirect the visitor to this 'secure'-dir without showing the
login-popup?

I've tried to use the header-function several ways, but the popup keeps
popping!!

> header('http://username:[EMAIL PROTECTED]/securedir/');
>
header('http://www.domain.com/securedir/?PHP_AUTH_USER=username&PHP_AUTH_PW=
password');
> header('http://[EMAIL PROTECTED]/securedir/:password');

Strange thing is that when I use the JavaScript below the redirect works and
no popup is shown.
The only problem with JavaScript is that when it is disabled in the visitors
browser the script
isn't executed and the full url is visible when viewing the source of the
page!

>> start..JavaScript <<

  window.location="http://username:[EMAIL PROTECTED]/securedir/";

>> endJavaScript <<


How can I redirect a logged in user to the 'secure'-dir and also pass the
'username' and
'password' that give access to this dir?

I hope you can help me out with this...

Thanks in advance.
Best regards,

Bart


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



[PHP] Odd problem with ereg_replace and addslashes

2003-12-03 Thread Ian Truelsen
Here is what I am doing:

I am reading in the contents of a text file that contains variables
whose properties I want to output. So, as was suggested on the list I
used the following:

eval("\$rest = \"".addslashes($pre_rest)."\";");

This works quite well, with one problem: if I use a contraction, like
won't, it will output as won\'t. So, I tried changing it to a backtic
(`) in the text file and after the eval statement, the output was won`t.
So, I thought I had it. I added:
ereg_replace("'", "`", $pre_rest);
before the eval statement. However, the output then became won\`t.

I don't understand why it is that changing quote to backtic in the text
file will give me the proper output, but the ereg_replace, which should
provide the same input to the eval statement, gets the slash added.

Does anyone have any ideas on why this is happening, and what I can do
to avoid the quote being slashed?

-- 
Ian Truelsen
Email: [EMAIL PROTECTED]
AIM: ihtruelsen
Homepage: http://www.ihtruelsen.dyndns.org
Signature key (742B740D) available at pgp.mit.edu



pgp0.pgp
Description: PGP signature


Re: [PHP] Session Expiration Problem....

2003-12-03 Thread Matt Matijevich
** Low Priority **


Is there a way to extend the php session timeout for particular pages?
Alternatively, is there a way, other than using cookies, to store user
data
from page-to-page?


I think you can use ini_set() to change session.gc_maxlifetime, that
will change your session timeout.

You could pass data around in hidden fields but that would be a pain. 

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



Re: [PHP] Propagating SID when cookies disabled

2003-12-03 Thread rogue
Okay. I figured out my problem. For some reason, I have two copies of 
php.ini on my server (an old install?) and was editing the wrong one to 
have:

session.use_trans_sid = 1

*hits self on head*

:)

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


[PHP] copy_file() files

2003-12-03 Thread Ajai Khattri
I recently upgraded PHP and now have two sites that use copy_file() that no
longer work. I have safe_mode=Off in my php.ini. Also, the files and directories
Furthermore, the file and directories Im trying to copy files to are owned by
user nobody and group nobody (My Apache server runs as user nobody in group
nobody).

Im assuming its some permissions problem. If I continuously list files in /tmp,
I see the uploaded file appear but then the copy_file() fails and the temp file
disappears.

Any ideas?

-- 
Aj.
Sys. Admin / Developer

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



[PHP] preserving blank space padding when using fgetcsv

2003-12-03 Thread Roger Spears
The first time I sent this message to the list, this is what bounced back...

"Hi. This is the qmail-send program at pb1.pair.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
<[EMAIL PROTECTED]>:
This message is looping: it already has my Delivered-To line. (#5.4.6)"
So I am resending it.  I apologize if anyone is getting this message twice..



Hello,

I've been researching this for most of the day and am unable to find an 
answer.

I'm using fgetcsv to read a comma delimited file (Microsoft Excel CSV).  
I'm trying to create a PHP application which will read a csv file line 
by line, remove the commas and preserve the padding that is in each 
column.  That means if a column is a fixed length of 15 characters and 
the actual text in that column is only 5 characters long, the 
application will preserve the extra 10 blank spaces.

I'm able to open and read the csv using fgetcsv:

$handle = fopen ($filename, "r");

while ($mpt_line = fgetcsv ($handle, filesize ($filename), ","))

{

Then I check each member of that array to make sure it is the proper 
length for that column:

if (strlen($mpt_line[0])<4)

   {

   str_pad($mpt_line[0], 4, " ", STR_PAD_RIGHT);

   }

When all of the length checks are finished I remove the commas and then 
print out the finished product:

}

$no_commas = str_replace(",", "", $mpt_line);

print "aa/".$no_commas[0]."/aa";



For output all I get is the actual text and no blank space padding.  
Meaning that if the field contains two characters of data it should 
still appear 4 characters in length.  I was hoping to achieve aa/hi  /aa 
instead all I get is aa/hi/aa. 

Thanks,

Roger

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


RE: [PHP] copy_file() files

2003-12-03 Thread Jay Blanchard
[snip]
I recently upgraded PHP and now have two sites that use copy_file() that
no
longer work. I have safe_mode=Off in my php.ini. Also, the files and
directories
Furthermore, the file and directories Im trying to copy files to are
owned by
user nobody and group nobody (My Apache server runs as user nobody in
group
nobody).

Im assuming its some permissions problem. If I continuously list files
in /tmp,
I see the uploaded file appear but then the copy_file() fails and the
temp file
disappears.
[/snip]

What is the chmod of those files/directories. Also, there is no
copy_file() function listed at php.net...could this be a user built
function? Or are you talking about http://www.php.net/copy ?

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



[PHP] talking to a web page

2003-12-03 Thread David T-G
Hi, all --

My host has written a control panel to handle all site management needs,
and it's great except that there's no back-end hook that I can use to
create a new site or user once I have collected my input and verified my
payment in my own pages.  I obviously don't want to have to do all of the
site creations by hand; that's why we have computers :-)

At this point I could either figure out all of the steps for creating a
site -- there are, to my knowledge so far, DB tables to update, dirs to
make, other files to update, and apache to restart -- or figure out how
to talk to the control panel from a script.  With nearly fifteen years of
SysAdmin background but only a few years of PHP background, I know which
I think is probably easier or at least quicker :-) but I don't want to
miss any little things that their interface does that will bite me in the
tail later.

The control panel requires authentication and a cookie and then a few
clicks to get to the fill-ins, so I imagine that I could just construct
that form and hand it off -- except for the login authentication part.

Which route would y'all take, and (more importantly) which would you
recommend to someone at my capable-but-not-expert level?  Remember that
I'll come back to the list when I get stumped ;-)


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] register_globals problem

2003-12-03 Thread Bogdan Albei
Jay Blanchard wrote:
[snip]

But IE and Konqueror both load the info.php correctly from my end. It
is

the index.php for Nukemods.com that gets hosed in those browsers.


So you're saying that index.php is broken? Then why it gets loaded fine 
if I delete the .htaccess file?
[/snip]

That is exactly what I am saying. Is the .htacesss file deleted now?
I'll go and see if it works. Leave both the index.php and the info.php
in the directory.
I've deleted the .htaccess file. Both index.php and info.php are in the 
directory.

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


Re: [PHP] copy_file() files

2003-12-03 Thread Ajai Khattri
On Wed, Dec 03, 2003 at 03:06:50PM -0600, Jay Blanchard wrote:

> What is the chmod of those files/directories. Also, there is no

Well, the destination folder (as I stated) is owned by user nobody and group
nobody. Apache is running as user nobody and group nobody. And Im assuming that
any files written in /tmp by Apache are owned by user nobody and group nobody.

> copy_file() function listed at php.net...could this be a user built
> function? Or are you talking about http://www.php.net/copy ?

You're right - I changed the function to move_uploaded_file() which still
doesn't work either.

Here's a snippet of code (I have commented out passwords and database stuff
with X's:


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



[PHP] Re: validating email address

2003-12-03 Thread Manuel Lemos
Hello,

On 12/03/2003 04:31 PM, Blake Schroeder wrote:
Whats the best way to validate email address (check for white space, 
check for .com, .net.edu etc)
Try this class: http://www.phpclasses.org/emailvalidation

--

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


[PHP] Re: talking to a web page

2003-12-03 Thread Justin Patrin
You can use PEAR's HTTP_Client package 
(http://pear.php.net/package/HTTP_Client) to connect to a website, do 
authentication, post forms, handle redirects, etc. It also keeps track 
of cookies.

Here's a sample (note that the URLs in this will probably not work):

require_once('HTTP/Client.php');
$client = &new HTTP_Client(array('user' => 'username', 'password' => 
'password'));
$code = $client->post('http://www.example.com/script.asp',
  array('var1' = 'val1',
'VAR2' => 'val2'));
$code = $client->get('http://www.example.com/loginRequired.php');

David T-G wrote:

Hi, all --

My host has written a control panel to handle all site management needs,
and it's great except that there's no back-end hook that I can use to
create a new site or user once I have collected my input and verified my
payment in my own pages.  I obviously don't want to have to do all of the
site creations by hand; that's why we have computers :-)
At this point I could either figure out all of the steps for creating a
site -- there are, to my knowledge so far, DB tables to update, dirs to
make, other files to update, and apache to restart -- or figure out how
to talk to the control panel from a script.  With nearly fifteen years of
SysAdmin background but only a few years of PHP background, I know which
I think is probably easier or at least quicker :-) but I don't want to
miss any little things that their interface does that will bite me in the
tail later.
The control panel requires authentication and a cookie and then a few
clicks to get to the fill-ins, so I imagine that I could just construct
that form and hand it off -- except for the login authentication part.
Which route would y'all take, and (more importantly) which would you
recommend to someone at my capable-but-not-expert level?  Remember that
I'll come back to the list when I get stumped ;-)
TIA & HAND

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


[PHP] Re: validating email address

2003-12-03 Thread Justin Patrin
Or you could always use the PEAR package:
http://pear.php.net/package/Validate
Manuel Lemos wrote:

Hello,

On 12/03/2003 04:31 PM, Blake Schroeder wrote:

Whats the best way to validate email address (check for white space, 
check for .com, .net.edu etc)


Try this class: http://www.phpclasses.org/emailvalidation

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


[PHP] Re: validating email address

2003-12-03 Thread Manuel Lemos
Hello,

On 12/03/2003 07:53 PM, Justin Patrin wrote:
Or you could always use the PEAR package:
http://pear.php.net/package/Validate
That package only does textual validation of the e-mail address. It does 
not check against the DNS nor tries to ask the end SMTP server if it 
would accept e-mail to the specified address, like this does:

http://www.phpclasses.org/emailvalidation

--

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


RE: [PHP] PHP form to fax?

2003-12-03 Thread J J
Does anyone use this service with PHP and would it be
possible to see some sample code on how you format the
email/message to their server?

I couldn't find any information on PHP and utilizing
their service, or how the message needs to be
formatted.

Thanks!


--- Jeff McKeon <[EMAIL PROTECTED]> wrote:
> There are plenty of commercial email to fax
> providers out here like
> jfax.  If an email is formatted correctly and sent
> to the your jfax
> address, jfax will parse out the fax number and then
> send the email
> contents as a fax.  It works in reverse as well. 
> Any fax to your jfax
> number (you can get them worldwide) is turned into
> an image and emailed
> to you as an attachment.
> > > 
> > -Original Message-
> > From: J J [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, September 25, 2003 2:49 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] PHP form to fax?
> > 
> > 
> > I know in the past it wasn't possible to do
> something
> > like have a user fill out a web form and that
> > information would then be sent to a fax machine. 
> This
> > would require some sort of dialing abilities on
> the
> > server.
> > 
> > Is there anything available today that could
> perform
> > such a function possibly within PHP?  With all the
> IP
> > telephony abilities, I figured maybe something is
> > available now.
> > 
> > I'd like to have the option to send web form
> > information to email or fax.  Email isn't a
> problem
> > but fax I'm kind of stuck.
> > 
> > Any ideas?
> > 

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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



Re: [PHP] Re: talking to a web page

2003-12-03 Thread David T-G
Justin, et al --

...and then Justin Patrin said...
% 
% You can use PEAR's HTTP_Client package 
% (http://pear.php.net/package/HTTP_Client) to connect to a website, do 
% authentication, post forms, handle redirects, etc. It also keeps track 
% of cookies.

Oh, goodie; that sounds great.


% 
% Here's a sample (note that the URLs in this will probably not work):
% 
% require_once('HTTP/Client.php');
% $client = &new HTTP_Client(array('user' => 'username', 'password' => 
% 'password'));

That certainly seems easy enough.


% $code = $client->post('http://www.example.com/script.asp',
%   array('var1' = 'val1',
% 'VAR2' => 'val2'));

OK, so I don't actually need to navigate the page but instead just fill
in the fields and then send it.  Very cool.


% $code = $client->get('http://www.example.com/loginRequired.php');

Now to figure out how to try it out :-)


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] copy_file() files

2003-12-03 Thread Ajai Khattri
On Wed, Dec 03, 2003 at 11:19:46PM +0100, Bronislav Klucka wrote:

> are you working with uploaded files?? because move_uploaded _files() woks
> only with them,

I switched to this function and had the same problem.

> and what is $image variable??? is that file on disk or uploaded file?? do u

It is a variable in the form (register globals is off).

> know that they are stored i $_FILES global variable?

Yes I know - I didn't write this code and dont really want to mess with it.

However, I managed to get this working now - I realized that open_base_dir needs
to have /tmp added to the list of permissable directories. Now image uploads
appear to be working.

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



[PHP] Re: validating email address

2003-12-03 Thread Justin Patrin
Actually it does do DNS checking. It doens't yet check to make sure that 
the mail will work, but it could easily be added.

Manuel Lemos wrote:

Hello,

On 12/03/2003 07:53 PM, Justin Patrin wrote:

Or you could always use the PEAR package:
http://pear.php.net/package/Validate


That package only does textual validation of the e-mail address. It does 
not check against the DNS nor tries to ask the end SMTP server if it 
would accept e-mail to the specified address, like this does:

http://www.phpclasses.org/emailvalidation

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


[PHP] Remote Server Info

2003-12-03 Thread Jason Williard
Is there a function that can get remote server information such as what
server software the remote host is running?

 - Jason

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



Re: [PHP] Re: talking to a web page

2003-12-03 Thread Justin Patrin
One last thing. If all you need to do is go to a page and not navigate 
it, you could just use HTTP_Request, upon which HTTP_Client is built. 
Then again, if you have multiple request to do and have to keep sending 
the auth data, the Client would be best.

David T-G wrote:

Justin, et al --

...and then Justin Patrin said...
% 
% You can use PEAR's HTTP_Client package 
% (http://pear.php.net/package/HTTP_Client) to connect to a website, do 
% authentication, post forms, handle redirects, etc. It also keeps track 
% of cookies.

Oh, goodie; that sounds great.

% 
% Here's a sample (note that the URLs in this will probably not work):
% 
% require_once('HTTP/Client.php');
% $client = &new HTTP_Client(array('user' => 'username', 'password' => 
% 'password'));

That certainly seems easy enough.

% $code = $client->post('http://www.example.com/script.asp',
%   array('var1' = 'val1',
% 'VAR2' => 'val2'));
OK, so I don't actually need to navigate the page but instead just fill
in the fields and then send it.  Very cool.
% $code = $client->get('http://www.example.com/loginRequired.php');

Now to figure out how to try it out :-)

Thanks & HAND

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


[PHP] PHP - Oracle - BLOBs - Display BLOB data in a table

2003-12-03 Thread Ahbaid Gaffoor
I have written the first half of my application which stores images in 
BLOB fields of an oracle database.

This part of my app. works fine.

I am now trying to download the database stored blob and display it in 
my web page.

I am able to get the blob data into a variable called $blobdata.

If I just throw up a fresh page and issue the following code, the image 
displays fine:


Assume that I have a function which when given an image id it returns 
the blob data as follows:

$blobdata = get_image_data(2); // Get the blob data for image as stored 
in the database with id = 2

However, I would like to be able to place the blobdata say in a  table 
cell as follows:




only problem is that I am getting gobbledygook charcaters in the cell as 
the raw data is being printed, what sort of HTML or PHP functions
should I use to do this?

many thanks,

Ahbaid.

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


Re: [PHP] Remote Server Info

2003-12-03 Thread Ajai Khattri
On Wed, Dec 03, 2003 at 02:35:16PM -0800, Jason Williard wrote:

> Is there a function that can get remote server information such as what
> server software the remote host is running?

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

-- 
Aj.
Sys. Admin / Developer

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



RE: [PHP] PHP - Oracle - BLOBs - Display BLOB data in a table

2003-12-03 Thread Chris W. Parker
Ahbaid Gaffoor 
on Wednesday, December 03, 2003 2:46 PM said:

> I have written the first half of my application which stores images in
> BLOB fields of an oracle database.
> 
> This part of my app. works fine.
> 
> I am now trying to download the database stored blob and display it in
> my web page.

You might have to write that data to a temporary file and then load that
file in your page. Reason being, in the code sample you gave you are
specifying a header which can't be done halfway down the page unless you
want to get an error. And I think especially you can't change the
Content-type of a page halfway through it and then change it back.

Those are just my thoughts on the subject.


HTH,
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



[PHP] search/replace functions

2003-12-03 Thread Scott Ware
I'm new to the list, and I don't want this to sound like a stupid ?, but
I am having an issue with a function that I created.

I have some code stored in a database, similar to XML-style tags, but I
just created them myself to be more "user-friendly" to people.
Like for instance , and  (would make the text
red).

I created a function, to search on the tags that I made, and replace
them with the appropriate HTML ones, here is my function:

function mytags($content)
{
$search[0] = "";
$search[1] = "";
$search[2] = "";
$search[3] = "";
$search[4] = "";
$search[5] = "";
$search[6] = "";
$search[7] = "";
$search[8] = "";
$search[9] = "";
$search[10] = "";
$search[11] = "";
$search[12] = "";
$search[13] = "";
$search[14] = "";
$search[15] = "";
$search[16] = "";
$search[17] = "";
$search[18] = "";
$search[19] = "";
$search[20] = "";
$search[21] = "";
$search[22] = "";
$search[23] = "";
$search[24] = "";
$search[25] = "";
$search[26] = "";
$search[27] = "";
$search[28] = "";
$search[29] = "";
$search[30] = "";
$search[31] = "";

$replace[0] = "";
$replace[1] = "";
$replace[2] = "";
$replace[3] = "";
$replace[4] = "";
$replace[5] = "";
$replace[6] = "";
$replace[7] = "";
$replace[8] = "";
$replace[9] = "";
$replace[10] = "";
$replace[11] = "";
$replace[12] = "";
$replace[13] = "";
$replace[14] = "";
$replace[15] = "";
$replace[16] = "";
$replace[17] = "";
$replace[18] = "";
$replace[19] = "";
$replace[20] = "";
$replace[21] = "";
$replace[22] = "";
$replace[23] = "";
$replace[24] = "";
$replace[25] = "";
$replace[26] = "";
$replace[27] = "";
$replace[28] = "";
$replace[29] = "";
$replace[30] = "";
$replace[31] = "";

for($i = 0; $i <= 31; $i++)
{
eregi_replace($search[$i], $replace[$i], $content);
}

return $content;
}

my problem is, I want to be able to replace all of the "search[]" tags
with the "replace[]" ones. With the code that I have so-far I am not
able to, where the "$content" variable is the
"$row_mysql_table['content']" output. Am I on the right track? And if
not, can anyone tell me how to accomplish this?

Thanks!

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



RE: [PHP] PHP - Oracle - BLOBs - Display BLOB data in a table

2003-12-03 Thread Chris
You would need to have two separate pages, theimage.php and
displayimage.php.

theimage.php will just return the image data in a readable format the
browser knows is an image.:



displayimage.php will be a normal php page with an image tag like this:



Chris
-Original Message-
From: Ahbaid Gaffoor [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 2:46 PM
To: PHP General Mailing List
Subject: [PHP] PHP - Oracle - BLOBs - Display BLOB data in a table


I have written the first half of my application which stores images in
BLOB fields of an oracle database.

This part of my app. works fine.

I am now trying to download the database stored blob and display it in
my web page.


I am able to get the blob data into a variable called $blobdata.

If I just throw up a fresh page and issue the following code, the image
displays fine:



Assume that I have a function which when given an image id it returns
the blob data as follows:

$blobdata = get_image_data(2); // Get the blob data for image as stored
in the database with id = 2

However, I would like to be able to place the blobdata say in a  table
cell as follows:


 


only problem is that I am getting gobbledygook charcaters in the cell as
the raw data is being printed, what sort of HTML or PHP functions
should I use to do this?

many thanks,

Ahbaid.

--
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: talking to a web page

2003-12-03 Thread David T-G
Justin, et al --

...and then Justin Patrin said...
% 
% One last thing. If all you need to do is go to a page and not navigate 
% it, you could just use HTTP_Request, upon which HTTP_Client is built. 

That sounds even better; I'm only going to be dealing with a couple of
pages.


% Then again, if you have multiple request to do and have to keep sending 
% the auth data, the Client would be best.

I'll try either both.  I'm having some trouble getting started, though...

I surfed over to pear.php.net, found and downloaded both (yikes, Client
is only a 0.2 release :-) and opened them up.  I made

  /usr/local/lib/php/HTTP

and then copied each's contents in there (well, the docs/ over to the lib
docs file), so I now have

  /usrlocal/lib/php/HTTP/Client.php
  /usrlocal/lib/php/HTTP/Client/CookieManager.php
  /usrlocal/lib/php/HTTP/Client/Listener.php

and similar for HTTP_Request but when I run a simple

  echo "" |php -q 

I get back "Failed opening required 'HTTP/Client.php'" :-(

Is there a different install procedure?


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] PHP - Oracle - BLOBs - Display BLOB data in a table

2003-12-03 Thread Justin Patrin
Actually, I would suggest using two scripts. The first takes the id of 
the row as a GET parameter (say $id) and grabs the image data, sends the 
header, and echoes the data. The second script outputs a web page with 
an img tag. As such:

image.php

page.php


Image.jpg



Chris W. Parker wrote:

Ahbaid Gaffoor 
on Wednesday, December 03, 2003 2:46 PM said:

I have written the first half of my application which stores images in
BLOB fields of an oracle database.
This part of my app. works fine.

I am now trying to download the database stored blob and display it in
my web page.


You might have to write that data to a temporary file and then load that
file in your page. Reason being, in the code sample you gave you are
specifying a header which can't be done halfway down the page unless you
want to get an error. And I think especially you can't change the
Content-type of a page halfway through it and then change it back.
Those are just my thoughts on the subject.

HTH,
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: talking to a web page

2003-12-03 Thread Justin Patrin
Well, technically, you should be using the PEAR installer script to 
install PEAR packages. http://pear.php.net/manual/en/installation.php

Barring that, you can make yourself a PEAR directory somewhere and add 
it to your include_path in your php.ini.

Also note that you have to have all of the dependencies for those 
packages. Easiest way to go is to use the PEAR installer if you're just 
getting started.

David T-G wrote:

Justin, et al --

...and then Justin Patrin said...
% 
% One last thing. If all you need to do is go to a page and not navigate 
% it, you could just use HTTP_Request, upon which HTTP_Client is built. 

That sounds even better; I'm only going to be dealing with a couple of
pages.
% Then again, if you have multiple request to do and have to keep sending 
% the auth data, the Client would be best.

I'll try either both.  I'm having some trouble getting started, though...

I surfed over to pear.php.net, found and downloaded both (yikes, Client
is only a 0.2 release :-) and opened them up.  I made
  /usr/local/lib/php/HTTP

and then copied each's contents in there (well, the docs/ over to the lib
docs file), so I now have
  /usrlocal/lib/php/HTTP/Client.php
  /usrlocal/lib/php/HTTP/Client/CookieManager.php
  /usrlocal/lib/php/HTTP/Client/Listener.php
and similar for HTTP_Request but when I run a simple

  echo "" |php -q 

I get back "Failed opening required 'HTTP/Client.php'" :-(

Is there a different install procedure?

TIA & HAND

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


  1   2   >