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 26 May 2003 11:22:32 -0000 Issue 2079

php-general-digest-helplists.php.net
Date: Mon May 26 2003 - 06:22:32 CDT


php-general Digest 26 May 2003 11:22:32 -0000 Issue 2079

Topics (messages 148932 through 148974):

Re: caching variables and preloading functions
        148932 by: Greg Beaver

Filename problem with file downloading
        148933 by: Alex Shi
        148938 by: Justin French
        148947 by: Alex Shi
        148953 by: Jason Wong
        148955 by: Alex Shi
        148964 by: Ernest E Vogelsinger

RegEx
        148934 by: Brian V Bonini
        148954 by: Jason Wong
        148958 by: Ernest E Vogelsinger

Re: simple "while" loop terminated for no reason
        148935 by: David Otton

Please, help me with this, I don't know what is going wrong!
        148936 by: Dani Matielo

why doesn't this add
        148937 by: David McGlone
        148941 by: Justin French
        148952 by: Jason Wong

PHP Binary Problem
        148939 by: Chris Kay
        148970 by: James
        148974 by: Marek Kilimajer

Unable to configure php 4.3.1 with GD support on Solaris 9
        148940 by: Eric Wagar
        148942 by: daniel.electroteque.org
        148945 by: Eric Wagar

Re: Commands out of sync
        148943 by: Petras Virzintas
        148969 by: James

Re: Problem with readfile, fsockopen, intermittent with apache
        148944 by: Steven
        148960 by: Ernest E Vogelsinger

sorting files
        148946 by: zavaboy
        148949 by: Justin French

Re: Using PHP to connect to mysql 4
        148948 by: JJ Harrison

Re: Search Engine Friendly Url using mod_rewrite
        148950 by: Joseph Blythe

header problems with content disposition inline
        148951 by: daniel.electroteque.org

Re: The || Operator (alternatives to the)
        148956 by: Joel Rees

fopen() vs. fsockopen()
        148957 by: Thomas Hochstetter
        148968 by: James

browser
        148959 by: nabil
        148962 by: Leif K-Brooks

Re: PHP and javacript (reset) HELP
        148961 by: Catalin Trifu

insert problem
        148963 by: Aris Santillan
        148967 by: James

Anyone Know .. WYSIWYG editor
        148965 by: Don Mc Nair
        148971 by: Justin French
        148973 by: Marek Kilimajer

'ob_gzhandler' conflicts with 'zlib output compression'
        148966 by: Ronald Wiplinger

preg_match not working to full satisfaction
        148972 by: Wim Paulussen

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:


Hello,

in php.ini, make a new line

auto_prepend_file = /path/to/init.php

Problem 2 is slightly more complex. You would have to write a save
handler in init.php. Safest would be to save the global variables
serialized (see http://www.php.net/serialize) in a database, you can
also save them in a file, and load them in init.php. Let me know if you
need code examples, or if this is enough to get you started.

Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org

Ssamuel wrote:
> Hi,
>
> I am looking for a way to do the following with PHP on Apache.
>
> 1) I have a list of functions that I would like loaded into memory when
> the Apache server starts so that other .PHPs can call these functions at
> any time. Somewhat of a way to expand the API set for PHP.
>
> i.e., Say I have a file named "init.php" which has many functions
> defined. When the Apache server loads, I want this file to be sourced
> so that these functions are visible to all other phps.
>
> 2) I have several variables, that I want to be cached at server init
> time. These variables are global variables and live until the server is
> restarted and can be accessed by any .phps.
>
> Are there any ways to do these?
>
> thanks,
> sunil.
>

attached mail follows:


Hello,

Several days ago I posted question asking about how to handle file
downloading file in php. Thanks for those who answered me with their
help I learned a lot about it. But still I have problem with filename. The
file downloading code is like following:

<?php

// ......
header ("Content-type: application/octet-stream");
header ("Content-Disposition: attachment; filename=" . $filename);
header ("Pragma: no-cache");

readfile ($filename);

// .....
?>

Everything is ok except the $filename. I want the name to be created
in this format: FileName.[record#].[seqence#]. Say, FileName.64.023.

The problem is, no matter how I create the value for $filename, the
filename generated at the local end on downloading will always like
this: FileName[1].64.023. The "[1]" is automatically added and I don't
understand why it was added there.

Maybe this is not a php problem but I have no clue where can find the
answer and solution to fix it. This looks a tiny issue but a big headaque
to me. Please give me a hand if any one out there happen to know this.
Many thanks in advance!

Alex Shi

--
==================================================
Cell Phone Batteries at 30-50%+ off retail prices!
http://www.pocellular.com
==================================================
TrafficBuilder Network:
http://www.bestadv.net/index.cfm?ref=7029
==================================================

attached mail follows:


You'd have to show us the code which establishes the value of $filename,
rather than the header() code.

Justin

on 26/05/03 10:24 AM, Alex Shi (chpshieol.ca) wrote:

> Hello,
>
> Several days ago I posted question asking about how to handle file
> downloading file in php. Thanks for those who answered me with their
> help I learned a lot about it. But still I have problem with filename. The
> file downloading code is like following:
>
> <?php
>
> // ......
> header ("Content-type: application/octet-stream");
> header ("Content-Disposition: attachment; filename=" . $filename);
> header ("Pragma: no-cache");
>
> readfile ($filename);
>
> // .....
> ?>
>
> Everything is ok except the $filename. I want the name to be created
> in this format: FileName.[record#].[seqence#]. Say, FileName.64.023.
>
> The problem is, no matter how I create the value for $filename, the
> filename generated at the local end on downloading will always like
> this: FileName[1].64.023. The "[1]" is automatically added and I don't
> understand why it was added there.
>
> Maybe this is not a php problem but I have no clue where can find the
> answer and solution to fix it. This looks a tiny issue but a big headaque
> to me. Please give me a hand if any one out there happen to know this.
> Many thanks in advance!
>
> Alex Shi
>
>
>
>

attached mail follows:


Here is the code:
<?
// .....

$wll_count = 64;
$wll_seqn = 9;

$wll_name = 'TheName.'.$wll_count.'.'.str_pad ($wlseqn, 2, '0',
STR_PAD_LEFT);
$mime_type = 'text/x-txt';

header ('Content-Type: ' . $mime_type);

if ($HTTP_USER_AGENT == 'IE') {
 header ('Content-Disposition: inline; filename=' . $wll_name);
 header ('Expires: 0');
 header ('Cache-Control: must-revalidate, post-check=0, pre-check=0');
 header ('Pragma: public');
} else {
 header ('Content-Disposition: attachment; filename=' . $wll_name);
 header ('Expires: 0');
 header ('Pragma: no-cache');
}

print $wll_buffer;
// .....
?>

It's strange that if remove the middle part or the end part of the file
name,
say, "TheName.64" or "TheName.09", there will be no "[1]" added.
thanks!

Alex Shi

"Justin French" <justinindent.com.au>
:BAF7A306.27C20%justinindent.com.au...
> You'd have to show us the code which establishes the value of $filename,
> rather than the header() code.
>
> Justin
>
>
> on 26/05/03 10:24 AM, Alex Shi (chpshieol.ca) wrote:
>
> > Hello,
> >
> > Several days ago I posted question asking about how to handle file
> > downloading file in php. Thanks for those who answered me with their
> > help I learned a lot about it. But still I have problem with filename.
The
> > file downloading code is like following:
> >
> > <?php
> >
> > // ......
> > header ("Content-type: application/octet-stream");
> > header ("Content-Disposition: attachment; filename=" . $filename);
> > header ("Pragma: no-cache");
> >
> > readfile ($filename);
> >
> > // .....
> > ?>
> >
> > Everything is ok except the $filename. I want the name to be created
> > in this format: FileName.[record#].[seqence#]. Say, FileName.64.023.
> >
> > The problem is, no matter how I create the value for $filename, the
> > filename generated at the local end on downloading will always like
> > this: FileName[1].64.023. The "[1]" is automatically added and I don't
> > understand why it was added there.
> >
> > Maybe this is not a php problem but I have no clue where can find the
> > answer and solution to fix it. This looks a tiny issue but a big
headaque
> > to me. Please give me a hand if any one out there happen to know this.
> > Many thanks in advance!
> >
> > Alex Shi
> >
> >
> >
> >
>

attached mail follows:


On Monday 26 May 2003 07:24, Alex Shi wrote:

> The problem is, no matter how I create the value for $filename, the
> filename generated at the local end on downloading will always like
> this: FileName[1].64.023. The "[1]" is automatically added and I don't
> understand why it was added there.

Which browsers did you try? Internet Explorer has an annoying habit of
mutilating filenames like this.

--
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
------------------------------------------
/*
When the weight of the paperwork equals the weight of the plane, the
plane will fly.
                -- Donald Douglas
*/

attached mail follows:


Yes I used IE to test the script. However If tested from NS it would added
a .php as ext. Both IE and NS will change filename if there're three
segments
in the filename (two-segment like filename.ext will be OK). Headaque!

"Jason Wong" <php-generalgremlins.biz>
:200305261338.24490.php-generalgremlins.biz...
> On Monday 26 May 2003 07:24, Alex Shi wrote:
>
> > The problem is, no matter how I create the value for $filename, the
> > filename generated at the local end on downloading will always like
> > this: FileName[1].64.023. The "[1]" is automatically added and I don't
> > understand why it was added there.
>
> Which browsers did you try? Internet Explorer has an annoying habit of
> mutilating filenames like this.
>
> --
> 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
> ------------------------------------------
> /*
> When the weight of the paperwork equals the weight of the plane, the
> plane will fly.
> -- Donald Douglas
> */
>

attached mail follows:


At 08:15 26.05.2003, Alex Shi said:
--------------------[snip]--------------------
>Yes I used IE to test the script. However If tested from NS it would added
>a .php as ext. Both IE and NS will change filename if there're three
>segments
>in the filename (two-segment like filename.ext will be OK). Headaque!
--------------------[snip]--------------------

What are the exact headers you are sending for the downloaded file?

For downloadable files I always use this construct, and AFAIK it works with
IE as well as Netscape:

    header('Content-Type: application/octet-stream');
    header('Content-Length: ' . strlen($filecontents));
    header('Content-Disposition: attachment' .
           (empty($fname) ? '' : ';filename="'.$fname.'"'));
    echo $filecontents;
    exit();

This results in these headers being sent:
    Content-Type: application/octet-stream
    Content-Length: ###
    Content-Disposition: attachment;filename="myfile.txt"

Note that the "filename" part in the last line must be enclosed in double
quotation marks to be recognized by all browsers (AFAIK the RFC doesn't
dictate this but some browsers may require it...)

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


Trying to pull data from a remote location and extract a certain section
(and yes I have permission). Can not seem to get this to work:

$siteurl = "http://domain.com";
$string = file($siteurl);
$matches = array();
preg_match_all('|\<\!--***** BEGIN HOME PAGE CONTENT *****
--\>(.*?)\<\!--***** END HOME PAGE CONTENT ***** --\>|is',$string,
$matches);
//see what we have
echo '<pre>';
print_r($matches);
echo '</pre>';

I get:

Array
(
    [0] => Array
        (
        )

    [1] => Array
        (
        )

)

attached mail follows:


On Monday 26 May 2003 08:05, Brian V Bonini wrote:
> Trying to pull data from a remote location and extract a certain section
> (and yes I have permission). Can not seem to get this to work:
>
> $siteurl = "http://domain.com";
> $string = file($siteurl);
> $matches = array();
> preg_match_all('|\<\!--***** BEGIN HOME PAGE CONTENT *****
> --\>(.*?)\<\!--***** END HOME PAGE CONTENT ***** --\>|is',$string,
> $matches);

You seem to be escaping the things that doesn't need it and not escaping the
things that do need it.

<, > and ! doesn't need escaping
* needs escaping

--
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
------------------------------------------
/*
If your aim in life is nothing, you can't miss.
*/

attached mail follows:


At 02:05 26.05.2003, Brian V Bonini said:
--------------------[snip]--------------------
>Trying to pull data from a remote location and extract a certain section
>(and yes I have permission). Can not seem to get this to work:
>
>$siteurl = "http://domain.com";
>$string = file($siteurl);
>$matches = array();
>preg_match_all('|\<\!--***** BEGIN HOME PAGE CONTENT *****
>--\>(.*?)\<\!--***** END HOME PAGE CONTENT ***** --\>|is',$string,
>$matches);
>//see what we have
>echo '<pre>';
>print_r($matches);
>echo '</pre>';
--------------------[snip]--------------------

2 problems with your code:

1) file() returns an array, not a single string. Use
   $string = join('', file($siteurl));

2) asterisks are special characters within a regular expression, you need
to escape them. Try this regex:
   $re = '|<!--\*{5,5} BEGIN HOME PAGE CONTENT \*{5,5} -->' .
      '(.*?)' .
         '<!--\*{5,5} END HOME PAGE CONTENT \*{5,5} -->|is';

You don't need to escape the other characters.

(Tested and worked).

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


On Mon, 26 May 2003 05:12:14 +0800, you wrote:

>hi, i'm using php ver 4.3.1 in winXP o/s.
>
>my html output always halted halfway from execution. i find out
>that it has got to do with the while loop.
>
>for simplicity, i created a test php file that will execute a loop for
>1000 times and print out some strings. however, even before it
>reach 1000, it stops. there is no error given.

Odd... works ok here. Hmm... does it always halt on the same iteration? If
you have it pause inside the loop, does it halt on a smaller number? What if
you remove the string constant from the print line? Only go to 500 instead
of 1000? I'm just thinking out loud, but maybe you're running into the
maximum execution time for your script?

Odd that it wouldn't report an error in that case... try turning the error
reporting up to waaaaay paranoid (error_reporting (E_ALL);) and see what it
offers you.

attached mail follows:


I have the following tables in my database:

permissoes, that contains the id and name of all permissions possible, like

id//permission
1//create user
2//delete user
3//edit user

and so on. I have another table called grupos with the group names and ids:

id//group
1//superuser
2//editor
3//user

and so on. And then I have a 3 table that relate this 2 tables,
grupos_permissoes, containing id from the other groups.

id_grupos//id_permissoes
1//1
1//2
1//3

and so on. Very well. Then I am trying to validate every permission. If the
group has the permission, the function shoul return a value. If the group
doesnt have the permission, it returns another value. Here is what I did:

//this function lists all the permissions possible
function lista_permissoes() {
    $result = mysql_query("select * from permissoes ORDER BY ordem");
    while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
 $permissoes[] = $row;
    }
   return $permissoes;
};

//this one is supposed to check if the group has the permission
function validar($grupo,$perm) {
//here it selects all the permissions from a group
$permissao = mysql_query("select id_permissoes from grupos_permissoes where
id_grupos = $grupo");
$row = mysql_fetch_array($permissao,MYSQL_ASSOC);
//then I am checking if the array contains the permission I am checking
$acesso = 0;
if (in_array($perm,$row)) {
//then changing the value if it contains
    $acesso = 1;
 }
return $acesso;
}

//And then finally printing it down
?>
<html>
 <?
$permis = lista_permissoes();
for($i=0; $i<=sizeof($permis); $i++) {
    $permiss = $permis[$i];
 $aux = validar(3,$permiss['id']);
 if ($aux == 1) echo "Yes";
 else echo "No";
 }
?>

And here is my problem: he does everything right for the first permission
but for the rest it returns no... I dont know what is going wrong! Can you
help me out?

Thank you very much,

Dani

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.481 / Virus Database: 277 - Release Date: 13/5/2003

attached mail follows:


Hi all,

Why is this code not adding the text in the textbox into the database:
I've tried everything like $_POST['mylink'], '$_POST['mylink'] ',
"$_POST['mylink']"

I can say that '$_POST['mylink'] ' adds a record into the database, but it's a
blank record.

echo("<form action=\"addtodb.php\" method=\"POST\">"
 ."<input type=\"text\" name=\"mylink\" maxlength=\"50\"><br>"
 ."<input type=\"submit\" value=\"add link\"><br>"
 ."</form>");

        $host = "localhost";
        $user = "xxxxxx";
        $pass = "xxxxxxxxxxxxxxxx";

 //make our connection details
 $connection = mysql_connect("$host" , "$user" , "$pass")
 or die ("Cannot make the connection");
 //connect to sampledb with our connection details
 $db = mysql_select_db("addtodb" , $connection)
 or die ("Cannot connect to the database");

 //insert the text box data into the sample table
 $sql_query = "INSERT INTO tshirts VALUES ('' , '$_POST['mylink']')";
 $result = mysql_query($sql_query);

Thanks,
--
David M.
Edification Web Solutions
http://www.edificationweb.com

attached mail follows:


This is what I use:

$sql_query = "INSERT INTO tshirts VALUES ('' , '{$_POST['mylink']}')";

Justin French

on 26/05/03 11:50 AM, David McGlone (davidedificationweb.com) wrote:

> Hi all,
>
> Why is this code not adding the text in the textbox into the database:
> I've tried everything like $_POST['mylink'], '$_POST['mylink'] ',
> "$_POST['mylink']"
>
> I can say that '$_POST['mylink'] ' adds a record into the database, but it's a
> blank record.
>
>
> echo("<form action=\"addtodb.php\" method=\"POST\">"
> ."<input type=\"text\" name=\"mylink\" maxlength=\"50\"><br>"
> ."<input type=\"submit\" value=\"add link\"><br>"
> ."</form>");
>
> $host = "localhost";
> $user = "xxxxxx";
> $pass = "xxxxxxxxxxxxxxxx";
>
>
>
> //make our connection details
> $connection = mysql_connect("$host" , "$user" , "$pass")
> or die ("Cannot make the connection");
> //connect to sampledb with our connection details
> $db = mysql_select_db("addtodb" , $connection)
> or die ("Cannot connect to the database");
>
> //insert the text box data into the sample table
> $sql_query = "INSERT INTO tshirts VALUES ('' , '$_POST['mylink']')";
> $result = mysql_query($sql_query);
>
> Thanks,

attached mail follows:


On Monday 26 May 2003 08:50, David McGlone wrote:
> $sql_query = "INSERT INTO tshirts VALUES ('' , '$_POST['mylink']')";

Have you checked that $sql_query contains what you expect it to contain?

> $result = mysql_query($sql_query);

  $result = mysql_query($sql_query) OR die(mysql_error());

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
A child of five could understand this! Fetch me a child of five.
*/

attached mail follows:


I have a issue with my PHP binary..

Up until last Tuesday I have had not issue with my binary, I
Have automated scripts run from crontab which run daily, and this has
been fine...

This morning I notice that the scripts are no longer been run.

I have tracked it back to breaking somewhere after 11am Tuesday and
before Wednesday morning..

The error I get when I run the binary is "[26-May-2003 10:55:21] PHP
Fatal error: Unable to start session mm module in Unknown on line 0"

Anyone know what this error means or why all of a sudden it killed my
binary?

PHP with apache runs fine which it should..

When I use the binary it looks as tho it executes but it does not, it
just goes back to command line..

I can not run php -v or php -I or php -m, nothing I do will get it to
work.

Anyone seen this before?

System is RH 7.2
Server version: Apache/2.0.40
PHP 4.3.1

Any help would be great....

---------------------------------------------------------
Chris Kay
Techex Communications
Website: www.techex.com.au Email: chris.kaytechex.net.au
Telephone: 1300 88 111 2 - Fax: 1300 882 221
---------------------------------------------------------

attached mail follows:


It happened to me when my binary was different from the version I had
installed.

/usr/bin/php was older than the version i was running from apache which was
in the module form.

"Chris Kay" <Chris.Kaytechex.com.au> wrote in message
news:E00ACB0129A4C748B02A744610798CE5B4FEheadoffice-fs.techex.net.au...

I have a issue with my PHP binary..

Up until last Tuesday I have had not issue with my binary, I
Have automated scripts run from crontab which run daily, and this has
been fine...

This morning I notice that the scripts are no longer been run.

I have tracked it back to breaking somewhere after 11am Tuesday and
before Wednesday morning..

The error I get when I run the binary is "[26-May-2003 10:55:21] PHP
Fatal error: Unable to start session mm module in Unknown on line 0"

Anyone know what this error means or why all of a sudden it killed my
binary?

PHP with apache runs fine which it should..

When I use the binary it looks as tho it executes but it does not, it
just goes back to command line..

I can not run php -v or php -I or php -m, nothing I do will get it to
work.

Anyone seen this before?

System is RH 7.2
Server version: Apache/2.0.40
PHP 4.3.1

Any help would be great....

---------------------------------------------------------
Chris Kay
Techex Communications
Website: www.techex.com.au Email: chris.kaytechex.net.au
Telephone: 1300 88 111 2 - Fax: 1300 882 221
---------------------------------------------------------

attached mail follows:


Check your php.ini if you don't have session.save_handler set to "mm"

Chris Kay wrote:

>I have a issue with my PHP binary..
>
>Up until last Tuesday I have had not issue with my binary, I
>Have automated scripts run from crontab which run daily, and this has
>been fine...
>
>This morning I notice that the scripts are no longer been run.
>
>I have tracked it back to breaking somewhere after 11am Tuesday and
>before Wednesday morning..
>
>The error I get when I run the binary is "[26-May-2003 10:55:21] PHP
>Fatal error: Unable to start session mm module in Unknown on line 0"
>
>Anyone know what this error means or why all of a sudden it killed my
>binary?
>
>PHP with apache runs fine which it should..
>
>When I use the binary it looks as tho it executes but it does not, it
>just goes back to command line..
>
>I can not run php -v or php -I or php -m, nothing I do will get it to
>work.
>
>Anyone seen this before?
>
>System is RH 7.2
>Server version: Apache/2.0.40
>PHP 4.3.1
>
>Any help would be great....
>
>---------------------------------------------------------
>Chris Kay
>Techex Communications
>Website: www.techex.com.au Email: chris.kaytechex.net.au
>Telephone: 1300 88 111 2 - Fax: 1300 882 221
>---------------------------------------------------------
>
>
>
>

attached mail follows:


I am using Solaris 9 (sparc) trying to compile php 4.3.1 with gd support.
(I can compile and use php *without* gd support, but alas, since many
scripts will require gd support, I'd like to compile it in.)

While running the configure, I get errors that do not appear until:
...
checking for gdImageGifCtx in -lgd... no
checking for gdImageCreate in -lgd... no
configure: error: GD build test failed. Please check the config.log for
details.
Then I look in the config.log:
guy ~/builds/php-4.3.1 214 $less config.log
<skip to first mention of a gd problem>...
configure:30184: checking for gdImageString16 in -lgd
configure:30203: gcc -o
conftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=290 -DUSE_EXPAT -L/u
sr/local/lib -R/usr/ucblib -L
/usr/ucblib -R/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.2.3 -L/usr/local
/lib/gcc-lib/sparc-sun-solaris2.9/3.2.3 -R/usr/local/lib
 -L/usr/local/lib
conftest.c -lgd -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lz -lcrypt -l
resolv -lm -ldl -lnsl -lsocket -lgcc
-lcrypt 1>&5
Undefined first referenced
 symbol in file
libiconv /usr/local/lib/libgd.so
libiconv_open /usr/local/lib/libgd.so
libiconv_close /usr/local/lib/libgd.so
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 30192 "configure"
#include "confdefs.h"
...

From here, the log will show problems of the "Undefined Symbol" for quite a
few lines (repeats similair to above.)

I am using Sun freeware gd 2.0.12 and Sun freeware xpm.

Here is my configure line:
./configure --with-apxs=/usr/local/apache/bin/apxs --with-zlib=/usr/local --
with-gd=/usr/local --with-mysql=/usr/local/mysql --enable-ftp --with-jpeg-di
r=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --with
-freetype-dir=/usr/local --with-xpm-dir=/usr/local/lib

Any help and leads are appreciated!

thanks
eric

attached mail follows:


sorry i cant help much as i've never done it on linux , but i do know that
the gd library is buggered to compile in 4.3 u have to use the internal
one , of course the jpeg libraries are ok to link to externally so maybe
--with-gd might help ??

> I am using Solaris 9 (sparc) trying to compile php 4.3.1 with gd
> support. (I can compile and use php *without* gd support, but alas,
> since many scripts will require gd support, I'd like to compile it in.)
>
> While running the configure, I get errors that do not appear until: ...
> checking for gdImageGifCtx in -lgd... no
> checking for gdImageCreate in -lgd... no
> configure: error: GD build test failed. Please check the config.log for
> details.
> Then I look in the config.log:
> guy ~/builds/php-4.3.1 214 $less config.log
> <skip to first mention of a gd problem>...
> configure:30184: checking for gdImageString16 in -lgd
> configure:30203: gcc -o
> conftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=290 -DUSE_EXPAT
> -L/u sr/local/lib -R/usr/ucblib -L
> /usr/ucblib -R/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.2.3
> -L/usr/local /lib/gcc-lib/sparc-sun-solaris2.9/3.2.3 -R/usr/local/lib
> -L/usr/local/lib
> conftest.c -lgd -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lz
> -lcrypt -l resolv -lm -ldl -lnsl -lsocket -lgcc
> -lcrypt 1>&5
> Undefined first referenced
> symbol in file
> libiconv /usr/local/lib/libgd.so
> libiconv_open /usr/local/lib/libgd.so
> libiconv_close /usr/local/lib/libgd.so
> ld: fatal: Symbol referencing errors. No output written to conftest
> collect2: ld returned 1 exit status
> configure: failed program was:
> #line 30192 "configure"
> #include "confdefs.h"
> ...
>
>>From here, the log will show problems of the "Undefined Symbol" for
>>quite a
> few lines (repeats similair to above.)
>
> I am using Sun freeware gd 2.0.12 and Sun freeware xpm.
>
> Here is my configure line:
> ./configure --with-apxs=/usr/local/apache/bin/apxs
> --with-zlib=/usr/local -- with-gd=/usr/local
> --with-mysql=/usr/local/mysql --enable-ftp --with-jpeg-di r=/usr/local
> --with-png-dir=/usr/local --with-freetype-dir=/usr/local --with
> -freetype-dir=/usr/local --with-xpm-dir=/usr/local/lib
>
> Any help and leads are appreciated!
>
> thanks
> eric
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


Thanks!

After removing the =/usr/local from the --with-gd option, the configure and
makes worked. Now, the gd is working as I had hoped!

Thanks again!
eric

> sorry i cant help much as i've never done it on linux , but i do know that
> the gd library is buggered to compile in 4.3 u have to use the internal
> one , of course the jpeg libraries are ok to link to externally so maybe
> --with-gd might help ??
>
> > I am using Solaris 9 (sparc) trying to compile php 4.3.1 with gd
> > support. (I can compile and use php *without* gd support, but alas,
> > since many scripts will require gd support, I'd like to compile it in.)
> >
> > While running the configure, I get errors that do not appear until: ...
> > checking for gdImageGifCtx in -lgd... no
> > checking for gdImageCreate in -lgd... no
> > configure: error: GD build test failed. Please check the config.log for
> > details.
> > Then I look in the config.log:
> > guy ~/builds/php-4.3.1 214 $less config.log
> > <skip to first mention of a gd problem>...
> > configure:30184: checking for gdImageString16 in -lgd
> > configure:30203: gcc -o
> > conftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=290 -DUSE_EXPAT
> > -L/u sr/local/lib -R/usr/ucblib -L
> > /usr/ucblib -R/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.2.3
> > -L/usr/local /lib/gcc-lib/sparc-sun-solaris2.9/3.2.3 -R/usr/local/lib
> > -L/usr/local/lib
> > conftest.c -lgd -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lz
> > -lcrypt -l resolv -lm -ldl -lnsl -lsocket -lgcc
> > -lcrypt 1>&5
> > Undefined first referenced
> > symbol in file
> > libiconv /usr/local/lib/libgd.so
> > libiconv_open /usr/local/lib/libgd.so
> > libiconv_close /usr/local/lib/libgd.so
> > ld: fatal: Symbol referencing errors. No output written to conftest
> > collect2: ld returned 1 exit status
> > configure: failed program was:
> > #line 30192 "configure"
> > #include "confdefs.h"
> > ...
> >
> >>From here, the log will show problems of the "Undefined Symbol" for
> >>quite a
> > few lines (repeats similair to above.)
> >
> > I am using Sun freeware gd 2.0.12 and Sun freeware xpm.
> >
> > Here is my configure line:
> > ./configure --with-apxs=/usr/local/apache/bin/apxs
> > --with-zlib=/usr/local -- with-gd=/usr/local
> > --with-mysql=/usr/local/mysql --enable-ftp --with-jpeg-di r=/usr/local
> > --with-png-dir=/usr/local --with-freetype-dir=/usr/local --with
> > -freetype-dir=/usr/local --with-xpm-dir=/usr/local/lib

attached mail follows:


Hi, I wonder if someone would be so kind to explain the following error
message I sometimes get from a PHP web page that accesses a MySQL database:

Error: Unable to select database: XXX :Commands out of sync; You can't run
this command now

Thanks in advance
Petras

attached mail follows:


Use mysql_connect as opposed to mysql_pconnect.

"Petras Virzintas" <petrascfs.com.au> wrote in message
news:003801c32326$070b0d00$0b65c80acfs.com...
> Hi, I wonder if someone would be so kind to explain the following error
> message I sometimes get from a PHP web page that accesses a MySQL
database:
>
> Error: Unable to select database: XXX :Commands out of sync; You can't run
> this command now
>
> Thanks in advance
> Petras
>

attached mail follows:


Running version 4.3.1 of PHP on RedHat Linux 7.3 and Apache 1.3.27

This is a shared server with many users running so I don't have direct
control over all the code. Although, is there a way to see what socket
descriptors apache is using at a current time? Perhaps what process or
script they are attached to, then I could find out what are the problem
scripts. Your suggestion seems very plausible and would explain it
working for a short time after a restart.

-Steven

> Do you close the socket you're opening? If PHP is running as Apache
module,
> opened sockets may be left open if you don't close them (which opsys
or
> Apache version would do this?) so Apache or PHP is running out of
socket
> descriptors, probably.
>
> Just guessing.

attached mail follows:


At 03:42 26.05.2003, Steven said:
--------------------[snip]--------------------
>Running version 4.3.1 of PHP on RedHat Linux 7.3 and Apache 1.3.27
>
>This is a shared server with many users running so I don't have direct
>control over all the code. Although, is there a way to see what socket
>descriptors apache is using at a current time? Perhaps what process or
>script they are attached to, then I could find out what are the problem
>scripts. Your suggestion seems very plausible and would explain it
>working for a short time after a restart.
--------------------[snip]--------------------

Hmm - maybe you could/should ask on PHP-DEVEL for this as the guys with
knowledge about the internals are usually hanging around...

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


My code:
----------------------------------------------------------------------------
-------------------
$Open = opendir ("files");
while ($Files = readdir ($Open)) {
$Filename = "files/" . $Files;
if (is_file ($Filename)) {
$Size = filesize ("files/$Files");
echo "<td><a href=files/$Files target=_blank>$Files</a><br>\n";
}
}
closedir ($Open);
----------------------------------------------------------------------------
-------------------
I want it to print out the files alphabetically.

attached mail follows:


Instead of echoing straight from the opendir, add them all to an array, then
sort the array, then print from the array.

<table>
    <tr>
<?

// get array of files
$dir = 'files';
$fileHandle = opendir($dir);
while ($myFile = readdir($fileHandle)) {
    if (is_file($dir.'/'.$myFile)) {
        $myFileArray[] = $myFile;
    }
}
closedir($fileHandle);

// sort and reset the array
asort ($myFileArray);
reset ($myFileArray);

// print <td>'s
foreach($myFileArray as $k => $fileName) {
    echo "<td><a href='files/{$fileName}'
target='_blank'>{$fileName}</a></td>";
}

?>
    </tr>
</table>

Justin

on 25/05/03 8:32 AM, zavaboy (zavaboycomcast.net) wrote:

> My code:
> ----------------------------------------------------------------------------
> -------------------
> $Open = opendir ("files");
> while ($Files = readdir ($Open)) {
> $Filename = "files/" . $Files;
> if (is_file ($Filename)) {
> $Size = filesize ("files/$Files");
> echo "<td><a href=files/$Files target=_blank>$Files</a><br>\n";
> }
> }
> closedir ($Open);
> ----------------------------------------------------------------------------
> -------------------
> I want it to print out the files alphabetically.
>
>

attached mail follows:


"Jason Wong" <php-generalgremlins.biz> wrote in message
news:200305260137.29668.php-generalgremlins.biz...
> On Sunday 25 May 2003 16:05, JJ Harrison wrote:
> > Well, any suggestions how to fix it? (I'm running a just downloaded
version
> > of php 4.3.1)
>
> Try connecting using the mysql commandline. If it doesn't work ask on the
> mysql list to get it working.

I could already run it from the command line, however, i found the problem.
Previously all the scripts had localhost as the mysql host. Changing them to
the actual name of the box (hs) fixed the problem.

--
---
JJ Harrison
lizner2002yahoo.com.au

attached mail follows:


Thankyou you all,

Decided to go with Wendell's suggestion which works well but am having
troubles with relative image paths will take it to a more suitable list
though :)

Regards,

Joseph

-----Original Message-----
From: Comex [mailto:ngxemoc.cjb.net]
Sent: Saturday, 24 May 2003 2:29 AM
To: Wendell Brown; Joseph Blythe; Php-General (E-mail)
Subject: Re: [PHP] Search Engine Friendly Url using mod_rewrite

Wendell Brown wrote:
> On Fri, 23 May 2003 17:34:33 +0930, Joseph Blythe wrote:
>
>> http://index.php?id=1
>>
>> to:
>>
>> http://index.html/id/1
>
> Errrr... not a php question (so we will probably both be punished,
> but....), I think this will do what you want:
>
> RewriteEngine on
> RewriteRule index.html/id/([0-9]+) index.php?id=$1
>
> I'm using this type of functionality on one of my pages.

Or you can use PHP (tested):

[on index.php]

$m = explode("/",$_SERVER['path_info']);

for($i=1;$i<=count($m);$i = $i + 2) {
$_GET[$m[$i - 1]] = $m[$i];
}

1.41421356237309504880168872420969807856967187537694
Yes, it's true that the above isn't not false, unless it isn't.
The search is more profitable than the find.
Never, ever back down.
The e-mail given is a spam trap.
..==// Why not? \\==..

attached mail follows:


hi there i am having a few problems with my headers with content
disposition inline to output to the screen, i have been generating pdf
content with htmldoc , although it requires to save a temp file from the
html content first , i cannot unlink the temp file created with tempnam
after a header like so

Header('Content-Type: application/octet-stream');
Header('Content-disposition: attachment; filename='.$filename);

i am also having a similar issue with a xls generator i cannot output to
the screen and also created a generated file and store on the server after
the output , what can i do ?

attached mail follows:


> $you = "some";
> if ($you == ("few" || "some" || "one")) {
> echo "yes";
> }else{
> echo "no";
> }
>
> How can I make it print out "yes" if $you is equal to "few", "some", or
> "one"?

One more option, may be useful if your list is long, or if your
association is to more than just "yes" --

$someWords =
array(
    "few" => "yes",
    "some" => "yes",
    "one" => "yes",
    "many" => "maybe"
);

$you = "some";

$theWord = $someWords[ $you ];

if ( isset( $theWord ) )
{ echo $theWord;
}
else
{ echo "no";
}

--
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp

attached mail follows:


Hi there.

Quick question: which one of the two is more secure and faster? fopen() or
fsockopen(). We are opening with an http call.
Also, fsockopen() lets you decide whether to POST or GET, what does fopen
do?

peace
Thomas

--
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!

attached mail follows:


http://uk.php.net/manual/en/wrappers.php

"Thomas Hochstetter" <fisherofmengmx.net> wrote in message
news:9183.1053934394www15.gmx.net...
> Hi there.
>
> Quick question: which one of the two is more secure and faster? fopen() or
> fsockopen(). We are opening with an http call.
> Also, fsockopen() lets you decide whether to POST or GET, what does fopen
> do?
>
> peace
> Thomas
>
> --
> +++ GMX - Mail, Messaging & more http://www.gmx.net +++
> Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!
>

attached mail follows:


Please I need a php code to disable all the menu and buttons in the browser.

Please Advise

attached mail follows:


PHP runs on the server, it's a server-side language. It can't control
user's screen resolution, printer, browser, or anything else. It can do
those things on the server, but I'm pretty sure that's not what you
want. Look into javascript.

nabil wrote:

>Please I need a php code to disable all the menu and buttons in the browser.
>
>Please Advise
>
>
>
>
>

--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

attached mail follows:


        Hi,

    You should use:

    <input type='reset' src='/path_to_image ... >
    and then it works.
    Note that the TYPE is RESET not IMAGE as you set it

Cheers,
Catalin

"Philip D Heady" <philipignission.com> wrote in message
news:20030525184527.32592.qmailpb1.pair.com...
> I have a form with drop down boxes coded in PHP that validates fields,
> etc...and when I use an graphic to reset the forms via javascript (reset)
> function. Well, it does not work. Any help is appreciated.
>
>
> <td>
> <a href="javascript:document.form1.reset()">
> <input type="image" src="/contact/images/clear-request.gif" border="0"
> alt="Clear Request" value="reset" width="119" height="27">
> </a>
> </td>
>
>
> Philip D Heady
> Ignission, Inc.
>
>

attached mail follows:


hi guys

im conduction INSERT query to my database
but ive no success, its weird that my user in the
database have ALL priveledges. i can insert
through the command line but on my php
script wont

this is my simpel query

INSERT INTO information VALUES($name, $email, $age, $location, $tel)

thanks

attached mail follows:


Try doing the full query first:

insert into database.table (x,y,z) values ('1','2','3')

Try using mysql_error() to determine what the problem is.

"Aris Santillan" <arisfemalenetwork.com> wrote in message
news:831411C4CBD37C4A91DBEC9B98A64C8B6CF356spmail.summitmedia.com.ph...
hi guys

im conduction INSERT query to my database
but ive no success, its weird that my user in the
database have ALL priveledges. i can insert
through the command line but on my php
script wont

this is my simpel query

INSERT INTO information VALUES($name, $email, $age, $location, $tel)

thanks

attached mail follows:


Hi folks

Does anyone know of a simple (free) script that will allow me to drop a web
based WYSIWYG text editor into a page on my site. I want the clients to be
able to configure a 'Description' text area in a form and then have the
variable stored in a database for display on a PHP page.

Thanks and regards

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.483 / Virus Database: 279 - Release Date: 19/05/2003

attached mail follows:


editize (editize.com???) is one of many

justin

on 26/05/03 8:12 PM, Don Mc Nair (donmcn.ie) wrote:

> Hi folks
>
> Does anyone know of a simple (free) script that will allow me to drop a web
> based WYSIWYG text editor into a page on my site. I want the clients to be
> able to configure a 'Description' text area in a form and then have the
> variable stored in a database for display on a PHP page.
>
> Thanks and regards
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.483 / Virus Database: 279 - Release Date: 19/05/2003
>
>

attached mail follows:


HTMLArea - www.interactivetools.com

Don Mc Nair wrote:

>Hi folks
>
>Does anyone know of a simple (free) script that will allow me to drop a web
>based WYSIWYG text editor into a page on my site. I want the clients to be
>able to configure a 'Description' text area in a form and then have the
>variable stored in a database for display on a PHP page.
>
>Thanks and regards
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.483 / Virus Database: 279 - Release Date: 19/05/2003
>
>
>
>
>

attached mail follows:


I have upgraded to Apache 2.0.45 and PHP-4.3.2RC2 and find now many lines in the apache log files:

[client 192.168.250.117] PHP Warning: ob_start(): output handler 'ob_gzhandler' conflicts with 'zlib output compression' in /usr/local/httpd/virtual/e-paper.elmit.com/htdocs/mainfile.php on line 19

What have I missed? What does it do to the browser?

bye

Ronald

--
Ronald Wiplinger (CEO of ELMIT)
http://www.elmit.com +886 (0) 915 653-452
- I'm a SpamCon Foundation Member, #694, Verify it at http://www.spamcon.org

PS: Spam prevention!
Our system is protected with a spam prevention program.
If you send us an e-mail, our system will send you a confirmation message back. Just reply to this confirmation message please.
After receiving this confirmation message, our system will send the hold message (one) and all future messages (after the received confirmation message) to me without asking you again.

attached mail follows:


I have input that I want to control for the usage of only alfanumeric signs.
"/^[a-zA-Z0-9]{10}$/" is the codeblock I use. I get a no-go (as desired)
when I start with a not-allowed character, but when it appears after an
allowed character , it does not give me a no-go. Should I check each
variable in the string separately ?

Wim