OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 19 Jun 2004 11:24:38 -0000 Issue 2830

php-general-digest-helplists.php.net
Date: Sat Jun 19 2004 - 06:24:38 CDT


php-general Digest 19 Jun 2004 11:24:38 -0000 Issue 2830

Topics (messages 188615 through 188635):

Re: Programming User-Customized Categories ??
        188615 by: Marek Kilimajer

Re: Computer algebra in PHP
        188616 by: Justin Patrin

Re: wierd sendmail/mail problems
        188617 by: Pam Derks

Re: internal server error
        188618 by: Bob Lockie

Re: Can I make make email accounts in vpopmail using PHP
        188619 by: raditha dissanayake

Re: Can I detect size of files which are too large to upload?
        188620 by: Red Wingate
        188621 by: Marek Kilimajer
        188623 by: raditha dissanayake

Re: OT?? -> calling frames within frames
        188622 by: Red Wingate

[Newbie Guide] For the benefit of new members
        188624 by: Ma Siva Kumar

triggering scripts through apache configuration
        188625 by: Chris Wagner
        188627 by: Curt Zirzow

UPLOAD scripts refuse to function
        188626 by: cory
        188628 by: Curt Zirzow
        188635 by: Marek Kilimajer

Re: where can we downlaod PHP modules??
        188629 by: Curt Zirzow

Re: " in data
        188630 by: Curt Zirzow

Re: php and unidata
        188631 by: Curt Zirzow

Re: php
        188632 by: Curt Zirzow

Re: "borrowing" cookies
        188633 by: Curt Zirzow

building php 4.3.7 with sablot 1.0.1 and gcc 3.3.3
        188634 by: Per Jessen

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Monty wrote --- napísal::
> Hi, I need to add the ability for users to define and set up their own
> categories and sub-categories that can be used to group contacts they enter
> into a database. Here's an example of how the data might be stored...
>
>
> Name Main Category Sub Category
> ------------- ----------------- ----------------
> John Doe Sales New York Office
> Jane Smith Sales Orlando Office
> Mark Jones Creative
> Sarah Williams Creative
> Kevin Brown Manager Office Manager
> Joe Johnson Manager Site Manager
>
>
> I need to allow users to define the types of Main Categories they want, and
> to also define whether or not those Main Categories will have Sub
> Categories, which they can also define.
>
> I know how to do this if the types of categories and sub-categories were
> pre-defined, but, I'm finding it a lot trickier to allow the users to
> customize these with their own category types. So, I'm hoping someone might
> be able to point me to an example of how custom categories and
> sub-categories can be programmed in PHP and set up in MySQL.
>
> Any suggestions or advice would be much appreciated!
>
> Monty
>

Add another column to the table, that will specify what user "owns" the
category

attached mail follows:


Chris Sangwin wrote:

> Does anyone know of any PHP scripts which perform simple computer algebra
> functions in PHP?
>
> For example, (using a Maple-like syntax)
>
> expand( (2*x-2)^4 );
> diff( sin(x^2), x);
> factor( x^2+2*x+1, x);
>
> and so on.
>
> Many thanks
> Chris Sangwin

:-) That would be nice.

--
paperCrane <Justin Patrin>

attached mail follows:


No, nothing fancy all on same machine, running on Apache...

-----Original Message-----
From: Jason Wong [mailto:php-generalgremlins.biz]
Sent: Friday, June 18, 2004 6:30 AM
To: php-generallists.php.net
Subject: Re: [PHP] wierd sendmail/mail problems

On Friday 18 June 2004 04:38, pmdunex.berkeley.edu wrote:

> am baffled...I've got a function to email a message that works
> perfectly as a simple function. I've written it 2 ways, (1) using mail
> and (2) writing the message to a tempfile and then sending the
> tempfile to sendmail both ways work.
>
> Now here's the problem...when I incorporate this function into a page
> that gets input from an html form, creates sessions, checks for
> errors, says thank you and then emails the responses it fails. Here
> are the errors I'm getting for the 2 different approaches:
> Warning: error: mail(): Could not execute mail delivery program
> Warning: system(): Unable to fork [/usr/lib/sendmail -t <
> /var/tmp/FOOVFaqq2]
>
> any clues to what I'm doing wrong?

Is your functioning function functioning on a different machine to the
non-functioning function?

--
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
------------------------------------------
/*
God grant me the senility to accept the things I cannot change, The
frustration to try to change things I cannot affect, and the wisdom to tell
the difference. */

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

attached mail follows:


On 06/18/04 14:24 Marek Kilimajer spoke:
> What installation instructions did you follow. Did you install cgi or
> module version?

I fixed it, I had the test file in the cgi-bin directory.

attached mail follows:


Mr. Bogomil Shopov wrote:

> Thanks Smarty ;)))
> I would like to know How I can make user email accounts using
> vpopmail, but Not using PECL extension.
>
Jay had answered the question you asked :-)

--
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.

attached mail follows:


Right,

guess i saw some kind of JS that determined the size of the selected
file and wrote it into an hidden field. Maybe you try it that way.

  -- red

Marek Kilimajer wrote:
> Pablo Gosse wrote --- napísal::
>
>> Marek Kilimajer wrote:
>>
>>> Pablo Gosse wrote --- napísal::
>>>
>>>> Hi folks. I'm just tweaking the file manager portion of my CMS, and
>>>> am wondering if there is any way I can identify the size of an
>>>> uploaded file which exceeded the upload_max_filesize? I'd like to be
>>>> able to tell the user the size of the file they tried to upload, in
>>>> addition to telling them the allowable maximum size.
>>>>
>>>> It would seem logical to me that I would not be able to do this,
>>>> since if the file exceeds the limit set by upload_max_filesize then
>>>> the upload should not continue past that point.
>>>>
>>>> Is this an accurate assumption?
>>>>
>>>> Cheers and TIA.
>>>>
>>>> Pablo
>>>>
>>>
>>> Content-Length request header, approximately, it also contains other
>>> post fields.
>>
>>
>>
>> Hmmmm, thanks Marek. That might work, though I'm not entirely sure.
>> The form through which users upload files can upload five at a time,
>> so I'm assuming that the content-length request header would contain
>> the sum total of all uploaded files, and I don't really see how I
>> could get the individual sizes.
>>
>> Thoughts?
>>
>> Cheers and TIA.
>>
>> Pablo
>>
>
> Then you are lost. If you want it really bad, you can turn on
> always_populate_raw_post_data and parse the post stream, but
> post_max_size will still limit you anyway.

attached mail follows:


Red Wingate wrote --- napísal::
> Right,
>
> guess i saw some kind of JS that determined the size of the selected
> file and wrote it into an hidden field. Maybe you try it that way.
>

Maybe ActiveX, JS cannot do that.

attached mail follows:


Red Wingate wrote:

> Right,
>
> guess i saw some kind of JS that determined the size of the selected
> file and wrote it into an hidden field. Maybe you try it that way.
>
>>>>> Hi folks. I'm just tweaking the file manager portion of my CMS, and
>>>>> am wondering if there is any way I can identify the size of an
>>>>> uploaded file which exceeded the upload_max_filesize? I'd like to be
>>>>> able to tell the user the size of the file they tried to upload, in
>>>>> addition to telling them the allowable maximum size.
>>>>
As marek has pointed out JS cannot do that. SHAMELESS PLUG FOLLOWS:
But i know the perfect product that can do exactly what you want. Rad
Upload (http://www.radinks.com/upload/)

--
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.

attached mail follows:


Allright, even if it's OT ....

Many ways to handle it, first would be to add a function within the
frameset which handles redirects to the frames:

<script language="javascript">
    function handleFrameRedirect ( frame , url ) {
        document.frames[ frame ].document.location.href = url ;
    }
</script>

Within the frame you use

<script language="javascript">
    parent.handleFrameRedirect( <framename> , <url> );
</script>

Another way is calling this directly within the frame:

<script language="javascript">
    parent.document.frames[ <framename> ].document.location.href = <url> ;
</script>

   -- red

Robert Sossomon wrote:

> I have two frames (A and main)
> When I pull up one page it reloads main with the full page, however what
> I need the system to do when I click off that page is to jump to
> main.html and load item.html in the top.
>
> Main.html currently loads 2 other pages at the beginning.
>
> I have tried to jump them in this order, but it does not seem to be
> working:
> //Call the main page
> echo '<script language="javascript">parent.main.location.href
> ="main.html";</script>';
> //Open the next two pages I need in them
> echo '<script language="javascript">parent.B.location.href
> ="item.html";</script>';
> echo '<script language="javascript">parent.C.location.href
> ="cart.html";</script>';
>
> TIA!
>
> Robert

attached mail follows:


=======================================
Please feel free to add more points and send
to the list.
=======================================

1. If you have any queries/problems about PHP
try http://www.php.net/manual/en first. You
can download a copy and use it offline also.

Please also try
http://www.php.net/manual/faq.php
for answers to frequently answered questions
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching
for "php YOUR QUERY" may fetch you relevant
information within the first 10 results.

3. There is a searchable archive of the
mailing list discussion at
http://phparch.com/mailinglists. Many of the
common topics are discussed repeatedly, and
you may get answer to your query from the
earlier discussions.

For example: One of the repeatedly discussed
question in the list is "Best PHP editor".
Everyone has his/her favourite editor.
You can get all the opinions by going through
the list archives. If you want a chosen list
try this link :
http://www.thelinuxconsultancy.co.uk/phpeditors/
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want
find out what extensions are available to
you?

Just put the following code into a file with
a .php extension and access it through your
webserver:

<?php
phpinfo();
?>

If PHP is installed you will see a page with
a lot of information on it. If PHP is not
installed (or not working correctly) your
browser will try to download the file.

(contributed by Teren and reworded by Chris W
Parker)

5. If you are stuck with a script and do not
understand what is wrong, instead of posting
the whole script, try doing some research
yourself. One useful trick is to print
the variable/sql query using print or echo
command and check whether you get what you
expected.

After diagnosing the problem, send the
details of your efforts (following steps 1,
2 & 3) and ask for help.

6. PHP is a server side scripting language.
Whatever processing PHP does takes place
BEFORE the output reaches the client.
Therefore, it is not possible to access
users' computer related information (OS,
screen size etc) using PHP. Nor can you
modify any the user side settings. You need
to go for JavaScript and ask the question in
a JavaScript list.

On the other hand, you can access the
information that is SENT by the user's
browser when a client requests a page from
your server. You can find details about
browser, OS etc as reported by
this request. - contributed by Wouter van
Vliet and reworded by Chris W Parker.

7. Provide a clear descriptive subject line.
Avoid general subjects like "Help!!", "A
Question" etc. Especially avoid blank
subjects.

8. When you want to start a new topic, open a
new mail composer and enter the mailing list
address php-generallists.php.net instead of
replying to an existing thread and replacing
the subject and body with your message.

9. It's always a good idea to post back to
the list once you've solved your problem.
People usually add [SOLVED] to the subject
line of their email when posting solutions.
By posting your solution you're helping the
next person with the same question.
[contribued by Chris W Parker]

10. Ask smart questions
http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

11. Do not send your email to the list with
attachments. If you don't have a place to
upload your code, try the many pastebin
websites (such as www.pastebin.com).
[contributed by Burhan Khalid]
--
Integrated Management Tools for leather
industry
----------------------------------
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

attached mail follows:


hello,

wondering how you might go about triggering PHP scripts from an apache
configuration file, for certain events...

for instance, how might i trigger a script whenever a file was accessed
within a given directory. and, would it be possible to know which file
was accessed?

if the above is possible, could you also trigger different scripts for
when a "file download begins" and when a "file download finishes"?

thanks.

attached mail follows:


* Thus wrote Chris Wagner:
> hello,
>
> wondering how you might go about triggering PHP scripts from an apache
> configuration file, for certain events...

This would be more of an apache question. As far as I know you
can't do such a thing.

>
> for instance, how might i trigger a script whenever a file was accessed
> within a given directory. and, would it be possible to know which file
> was accessed?

via the log files.

 
> if the above is possible, could you also trigger different scripts for
> when a "file download begins" and when a "file download finishes"?

Downloading is a relative term. If you mean server -> client then
a php script can easily handle such a thing.

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


ok, someone please lend me some advice here. I am trying create a upload
form for my site.

Sure that sounds easy right? well I have tried at least 10 different php
scripts as well as a handful of cgi. Same resuls with everyone of
them...nothing in my specified tmp folder. After contactig my host so many
times, they know my name by voice, I have made no progress and here I sit
without a very neccessary aspect of our website. Anyone have any idea on
this...is there something server side that would prohibit me from executing
my upload scripts? (yes chmod the folder...done)

I have no problem with ANY other cgi or php script that I have used.

Thanks in advance for any insight...

-Cory

attached mail follows:


* Thus wrote cory:
> ok, someone please lend me some advice here. I am trying create a upload
> form for my site.

hmm.. another upload question... they all seem to pop up all at
once for some reason.

>
> Sure that sounds easy right? well I have tried at least 10 different php
> scripts as well as a handful of cgi. Same resuls with everyone of
> them...nothing in my specified tmp folder. After contactig my host so many
> times, they know my name by voice, I have made no progress and here I sit
> without a very neccessary aspect of our website. Anyone have any idea on
> this...is there something server side that would prohibit me from executing
> my upload scripts? (yes chmod the folder...done)

This usually explains everything:

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

>
> I have no problem with ANY other cgi or php script that I have used.

What kind of specific problems are you having with the uploads?

Make sure that error_reporting is on E_ALL and check the web server
logs for any hints. Both error and access logs.

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


cory wrote --- napísal::
> Sure that sounds easy right? well I have tried at least 10 different php
> scripts as well as a handful of cgi. Same resuls with everyone of
> them...nothing in my specified tmp folder.

Every uploaded file is removed from the temporary directory right after
the script is over. You have to move the file to another location.

attached mail follows:


* Thus wrote Nguyen, Long P (Mission Systems):
> Anyone know where can I download the following PHP modules?

What your looking for arn't the modules, but the libraries that the
modules depend on.

>
> Sablotron XSLT processor (command-line utility and PHP plugin)

See Installation:
http://www.php.net/xslt

> PHP DOMXML support compiled-in (libxml version)

See Installation:
http://www.php.net/domxml
(this one is still experimental)

> PHP XML support compiled-in (expat version)

See Installation:
http://www.php.net/xml

> PHP XMLRPC support compiled-in

See Installation:
http://www.php.net/xmlrpc

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


* Thus wrote Chris W. Parker:
>
> $data = htmlentities($data);
>
> // should work
> echo "<input type="text" value="$data" />";

s/should/will

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


* Thus wrote Matt Giddings:
> Hello,
>
> Anybody out there in php land succesfully use php with the unidata
> database running on unix? We're going to be starting a project that
> requires php to unidata communication and I'm looking for pointers or
> any other useful information that will help this project get off to a
> smooth start.

I'm not familiar with unidata, so I dont know if they have a native
library that php can use. But if all else fails, they should
provide an ODBC interface at minimum.

So you can use unixODBC and php's odbc library to access the
database. In theory of course.

See http://php.net/uodbc for some details on how to configure php
with odbc.

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


* Thus wrote cksglite.com:
> Hi,
>
> can i ask what is the difference between writing and getting data from files and from SQL.
>

files: lots of coding
sql: easy

> will retrieving data from files have a problem like if 2 person access the same file at the same time and causing the data to crush? or will the situation be the same to SQL?
>

You will always have race conditions. who is writing what and
reading when. SQL servers handle these races.

> because i will wish to use file instead of sql, hope that there won't be a difference. i would wish to the what is/are the difference between them in every details.
>

An alternative to using files is to use SQLite. It is a file base sql datatase
that can be use easily be used and avoid the above mentioned
issues.

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


* Thus wrote Sejmitar:
>
> Then I had tried to even more simplify life and get some of information
> published on Site to show it directly in Portal - and there starts the
> problem. Apprioritate script loads Site to variable, shaves and process this
> variable and post results on Portal. I theory, unfortunaltely ...

With or without permissions to do such a thing? If the later then
hit delete now, otherwise continue on..

>
> I'll be very thankful for any ideas ...

http://php.net/curl

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


I'm trying to build php 4.3.7 with sablot 1.0.1 and expat 1.95.7 - I'm using
gcc3.3.3.

sablot and expat built fine, but when I build/link php:

/usr/lib/libsablot.so: undefined reference to `operator new[](unsigned)'
/usr/lib/libsablot.so: undefined reference to `vtable for
__cxxabiv1::__si_class_type_info'
/usr/lib/libsablot.so: undefined reference to `operator delete(void*)'
/usr/lib/libsablot.so: undefined reference to `__gxx_personality_v0'
/usr/lib/libsablot.so: undefined reference to `__cxa_pure_virtual'
/usr/lib/libsablot.so: undefined reference to `vtable for
__cxxabiv1::__class_type_info'
/usr/lib/libsablot.so: undefined reference to `operator delete[](void*)'
/usr/lib/libsablot.so: undefined reference to `vtable for
__cxxabiv1::__vmi_class_type_info'
/usr/lib/libsablot.so: undefined reference to `operator new(unsigned)'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

It does seem to have much to do with php as such, but just in case it rings a
bell with anyone?

thanks,
Per Jessen, Zurich