|
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-help_at_lists.php.net
Date: Mon Oct 21 2002 - 21:39:10 CDT
php-general Digest 22 Oct 2002 02:39:10 -0000 Issue 1658
Topics (messages 120741 through 120845):
problem with informix
120741 by: Erwin Speybroeck
120761 by: Adam Williams
Re: MySQL result to Associative array
120742 by: Jason Wong
Re: pro modules?
120743 by: Henry
120745 by: Marek Kilimajer
120750 by: Henry
120760 by: Marek Kilimajer
Re: How to prevent HTML from being pharsed?
120744 by: Justin French
Re: filemtime problem
120746 by: Todd Cary
Inadvertant Session Hijacking
120747 by: Thomas Deliduka
120751 by: 1LT John W. Holmes
120752 by: Marek Kilimajer
120758 by: SHEETS,JASON (HP-Boise,ex1)
Content Feed
120748 by: php.erars.demon.co.uk
120749 by: Marco Tabini
120753 by: Marek Kilimajer
120759 by: olinux
Failed opening XYZ at high workload
120754 by: Gerald Roehrbein/Pctdmn
120756 by: Marco Tabini
MySQL installation problem
120755 by: Alberto Brea
120757 by: John Nichel
120767 by: John Nichel
Getting gibberish, sometimes, in PDF output
120762 by: Sarah Gray
120774 by: Marek Kilimajer
120775 by: Matt Schroebel
120778 by: David Erickson
120781 by: Sarah Gray
120784 by: David Erickson
120788 by: Matt Schroebel
120790 by: Sarah Gray
curl library
120763 by: Andres, Cyrille
120771 by: jacob.keystreams.com
120772 by: jacob.keystreams.com
120795 by: jacob.keystreams.com
Re: Environment Variable with mod_rewrite
120764 by: Marek Kilimajer
120836 by: Tom Rogers
Re: Build error
120765 by: Marek Kilimajer
Re: php compiling bug
120766 by: Marek Kilimajer
Multidimensional array help
120768 by: Gerard Samuel
120770 by: Marek Kilimajer
120773 by: Marek Kilimajer
120776 by: Gerard Samuel
Having problems with displaying flash from db
120769 by: Yonatan Ben-Nes
_()
120777 by: peter a
120782 by: 1LT John W. Holmes
Libraries includes
120779 by: Tyler BIRD
120786 by: 1LT John W. Holmes
120835 by: Justin French
120839 by: Justin French
Unable to access the assigned session variable
120780 by: ppf
120783 by: 1LT John W. Holmes
120785 by: Kevin Stone
120794 by: John Nichel
Re: Max and min values in array
120787 by: Liam.Gibbs.dfait-maeci.gc.ca
Quick Cookie Question
120789 by: PHP List
120791 by: 1LT John W. Holmes
Problems configuring with XML
120792 by: Chris Boget
120793 by: .: B i g D o g :.
120797 by: Chris Boget
120798 by: .: B i g D o g :.
120801 by: Chris Boget
120802 by: Geoff Hankerson
Re: problems with odbc fuctions
120796 by: Jeff Bluemel
displaying flash from db
120799 by: Yonatan Ben-Nes
120800 by: Jason Young
query problem
120803 by: Jennifer Swofford
120804 by: Stephen
120805 by: Tim Sailer
120820 by: Omar
120829 by: Jennifer Swofford
120844 by: Tim Sailer
Session Expire
120806 by: PHP List
120807 by: .: B i g D o g :.
Elementary Problem
120808 by: php.erars.demon.co.uk
120809 by: Brad Bonkoski
gettext
120810 by: peter a
Quick MySql Question
120811 by: Taylor York
120812 by: Brad Bonkoski
120813 by: Taylor York
120814 by: Taylor York
120815 by: Omar
120828 by: John Nichel
slow form - database
120816 by: Omar
mail() function is taking too LONG
120817 by: Negretti, John (CCI-San Diego)
120818 by: Rasmus Lerdorf
120821 by: Negretti, John (CCI-San Diego)
120822 by: Manuel Lemos
120823 by: Negretti, John (CCI-San Diego)
image gd and
120819 by: ngabesoola
Verify if a file exists and.....
120824 by: Kevin Fradkin
120825 by: Brad Bonkoski
120826 by: Brad Bonkoski
120827 by: Kevin Fradkin
120831 by: Brad Bonkoski
Re: [PHP-DB] displaying flash from db
120830 by: Beau Lebens
Apache 2.0.40 and php 4.2.2 on Redhat 8.0
120832 by: Wayne McCloud
120833 by: David Freeman
Preg_match_all question
120834 by: .: B i g D o g :.
How to do fast display of Images
120837 by: N.Paramaguru
120843 by: David Freeman
How to do Calender in PHP like Yahoo Calender
120838 by: N.Paramaguru
120842 by: Manuel Lemos
HTML to PDF
120840 by: gamin
120841 by: gamin
random rows using MySQL's rand()
120845 by: Tanat
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
I'm struggling with a problem for quite some time.
I have a webserver with apache-1.3.22, php 4.0.6 (patched for some security issues), informix ESQL 9.30 and a databaseserver with Informix IDS 7.31. This construction works very fine.
As soon as i go to newer versions --> last try : httpd-2.0.43, php-4.2.3, with the same informix configuration the problem appears. Everything went well for about a week --> so it lloks ok, but ...
On the databaseserver shared memory gets taken by the php-actions on the webserver and at a certain moment this memory is all used and the server (database) crashes.
Is there somebody who has experienced a similar problem or is there somebody who can give some hints in the direction to look for ???
Thanks in advance,
Erwin Speybroeck
erwin.speybroeck
vrv.be
Neem eens een kijkje op onze website --> www.vrv.be
attached mail follows:
I'd go back to apache 1.3.27 and php-4.2.3 if I were you and see if that
fixes your problem.
I run Informix, PHP, and Apache on a server and have had no problems.
Adam
On Mon, 21 Oct 2002, Erwin Speybroeck wrote:
> Hi,
>
> I'm struggling with a problem for quite some time.
> I have a webserver with apache-1.3.22, php 4.0.6 (patched for some security issues), informix ESQL 9.30 and a databaseserver with Informix IDS 7.31. This construction works very fine.
>
> As soon as i go to newer versions --> last try : httpd-2.0.43, php-4.2.3, with the same informix configuration the problem appears. Everything went well for about a week --> so it lloks ok, but ...
>
> On the databaseserver shared memory gets taken by the php-actions on the webserver and at a certain moment this memory is all used and the server (database) crashes.
>
> Is there somebody who has experienced a similar problem or is there somebody who can give some hints in the direction to look for ???
>
> Thanks in advance,
>
> Erwin Speybroeck
> erwin.speybroeck
vrv.be
> Neem eens een kijkje op onze website --> www.vrv.be
>
attached mail follows:
On Monday 21 October 2002 22:25, Tony Crockford wrote:
> > -----Original Message-----
> > From: Jacob Miller
> >
> > Try using " instead of '. Variables are not resolved to
> > their values in
> > single quoted strings.
> >
> > while ($row = mysql_fetch_array($md_result))
> >
> > {
> >
> > $md_ref=$row['md_ref'];
> > $md_title=$row['md_title'];
> >
> > $myarray["$md_ref"]=$md_title;
> >
> > }
>
> Genius!
>
> Thanks for that - too much looking in the wrong place I guess!
Also, you should use print_r() or var_dump() to help debug stuff like this.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* static from nylon underwear */
attached mail follows:
Unfortunately I don't!
Any idea about this pro modules/apache?
Henry
"Jason Wong" <php-general
gremlins.com.hk> wrote in message
news:200210211910.34669.php-general
gremlins.com.hk...
> On Monday 21 October 2002 16:19, Henry wrote:
> > Hi All,
> >
> > I am using PHP on a shared server and wish to do file uploads. My ISP
has
> > advised me that this is not configured and that I should look at "pro
> > modules"/"apache" by doing a search on the web in order to get a work
> > around. Does anyone know what they are refering to? Can anyone point me
in
> > the right direction?
>
> Do you have control of php.ini? If so configure this section
appropriately:
>
> ;;;;;;;;;;;;;;;;
> ; File Uploads ;
> ;;;;;;;;;;;;;;;;
>
> ; Whether to allow HTTP file uploads.
> file_uploads = On
>
> ; Temporary directory for HTTP uploaded files (will use system default if
not
> ; specified).
> ;upload_tmp_dir =
>
> ; Maximum allowed size for uploaded files.
> upload_max_filesize = 2M
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> I've looked at the listing, and it's right!
> -- Joel Halpern
> */
>
attached mail follows:
Can you use PUT method?
Henry wrote:
>Unfortunately I don't!
>
>Any idea about this pro modules/apache?
>
>Henry
>
>"Jason Wong" <php-general
gremlins.com.hk> wrote in message
>news:200210211910.34669.php-general
gremlins.com.hk...
>
>
>>On Monday 21 October 2002 16:19, Henry wrote:
>>
>>
>>>Hi All,
>>>
>>>I am using PHP on a shared server and wish to do file uploads. My ISP
>>>
>>>
>has
>
>
>>>advised me that this is not configured and that I should look at "pro
>>>modules"/"apache" by doing a search on the web in order to get a work
>>>around. Does anyone know what they are refering to? Can anyone point me
>>>
>>>
>in
>
>
>>>the right direction?
>>>
>>>
>>Do you have control of php.ini? If so configure this section
>>
>>
>appropriately:
>
>
>>;;;;;;;;;;;;;;;;
>>; File Uploads ;
>>;;;;;;;;;;;;;;;;
>>
>>; Whether to allow HTTP file uploads.
>>file_uploads = On
>>
>>; Temporary directory for HTTP uploaded files (will use system default if
>>
>>
>not
>
>
>>; specified).
>>;upload_tmp_dir =
>>
>>; Maximum allowed size for uploaded files.
>>upload_max_filesize = 2M
>>
>>
>>--
>>Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>>Open Source Software Systems Integrators
>>* Web Design & Hosting * Internet & Intranet Applications Development *
>>
>>/*
>>I've looked at the listing, and it's right!
>>-- Joel Halpern
>>*/
>>
>>
>>
>
>
>
>
>
attached mail follows:
Excuse my ignorance but....
How whould I find out if I can use PUT?
Thanks, look forward to getting your reply.
Henry
"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
news:3DB41860.6020609
webglobe.sk...
> Can you use PUT method?
>
> Henry wrote:
>
> >Unfortunately I don't!
> >
> >Any idea about this pro modules/apache?
> >
> >Henry
> >
> >"Jason Wong" <php-general
gremlins.com.hk> wrote in message
> >news:200210211910.34669.php-general
gremlins.com.hk...
> >
> >
> >>On Monday 21 October 2002 16:19, Henry wrote:
> >>
> >>
> >>>Hi All,
> >>>
> >>>I am using PHP on a shared server and wish to do file uploads. My ISP
> >>>
> >>>
> >has
> >
> >
> >>>advised me that this is not configured and that I should look at "pro
> >>>modules"/"apache" by doing a search on the web in order to get a work
> >>>around. Does anyone know what they are refering to? Can anyone point me
> >>>
> >>>
> >in
> >
> >
> >>>the right direction?
> >>>
> >>>
> >>Do you have control of php.ini? If so configure this section
> >>
> >>
> >appropriately:
> >
> >
> >>;;;;;;;;;;;;;;;;
> >>; File Uploads ;
> >>;;;;;;;;;;;;;;;;
> >>
> >>; Whether to allow HTTP file uploads.
> >>file_uploads = On
> >>
> >>; Temporary directory for HTTP uploaded files (will use system default
if
> >>
> >>
> >not
> >
> >
> >>; specified).
> >>;upload_tmp_dir =
> >>
> >>; Maximum allowed size for uploaded files.
> >>upload_max_filesize = 2M
> >>
> >>
> >>--
> >>Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> >>Open Source Software Systems Integrators
> >>* Web Design & Hosting * Internet & Intranet Applications Development *
> >>
> >>/*
> >>I've looked at the listing, and it's right!
> >>-- Joel Halpern
> >>*/
> >>
> >>
> >>
> >
> >
> >
> >
> >
>
attached mail follows:
If your ISP lets you write this line into your <Virtualhost> block, you can: Script PUT /your_file_for_handling_this.php and then you can look at http://www.php.net/manual/en/features.file-upload.put-method.php
Henry wrote:
>Excuse my ignorance but....
>
>How whould I find out if I can use PUT?
>
>Thanks, look forward to getting your reply.
>
>Henry
>
>"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
>news:3DB41860.6020609
webglobe.sk...
>
>
>>Can you use PUT method?
>>
>>Henry wrote:
>>
>>
>>
>>>Unfortunately I don't!
>>>
>>>Any idea about this pro modules/apache?
>>>
>>>Henry
>>>
>>>"Jason Wong" <php-general
gremlins.com.hk> wrote in message
>>>news:200210211910.34669.php-general
gremlins.com.hk...
>>>
>>>
>>>
>>>
>>>>On Monday 21 October 2002 16:19, Henry wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>Hi All,
>>>>>
>>>>>I am using PHP on a shared server and wish to do file uploads. My ISP
>>>>>
>>>>>
>>>>>
>>>>>
>>>has
>>>
>>>
>>>
>>>
>>>>>advised me that this is not configured and that I should look at "pro
>>>>>modules"/"apache" by doing a search on the web in order to get a work
>>>>>around. Does anyone know what they are refering to? Can anyone point me
>>>>>
>>>>>
>>>>>
>>>>>
>>>in
>>>
>>>
>>>
>>>
>>>>>the right direction?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>Do you have control of php.ini? If so configure this section
>>>>
>>>>
>>>>
>>>>
>>>appropriately:
>>>
>>>
>>>
>>>
>>>>;;;;;;;;;;;;;;;;
>>>>; File Uploads ;
>>>>;;;;;;;;;;;;;;;;
>>>>
>>>>; Whether to allow HTTP file uploads.
>>>>file_uploads = On
>>>>
>>>>; Temporary directory for HTTP uploaded files (will use system default
>>>>
>>>>
>if
>
>
>>>>
>>>>
>>>not
>>>
>>>
>>>
>>>
>>>>; specified).
>>>>;upload_tmp_dir =
>>>>
>>>>; Maximum allowed size for uploaded files.
>>>>upload_max_filesize = 2M
>>>>
>>>>
>>>>--
>>>>Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>>>>Open Source Software Systems Integrators
>>>>* Web Design & Hosting * Internet & Intranet Applications Development *
>>>>
>>>>/*
>>>>I've looked at the listing, and it's right!
>>>>-- Joel Halpern
>>>>*/
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
>
>
attached mail follows:
What do you mean???
a) Would you rather that tags were printed to the screen/browser as plain text? check out htmlspecialchars() and htmlentities() in the manual
or
b) Would you like to strip all the HTML tags from the text? check out striptags()
Justin
on 21/10/02 11:26 PM, iphoting (myself
iphoting.com) wrote:
> How to prevent HTML code or tags from being pharsed in echo(); ? > > Anyone has any idea? > > Thanks in advance! > >
attached mail follows:
Many thanks! That is the suggestion I needed. Forgot about "keys"!!
Todd
-- Ariste Software, Petaluma, CA 94952
attached mail follows:
Now this is not the malicious kind where a user intentionally takes over another session. I'm speaking of a case where the random session ID generator happens to give another user someone else's session whether active or inactive (inactive and not yet cleared by garbage collection).
I had a case just this weekend where this happened, a user got another visitor's shopping cart. The potential is for someone to get another person's logged in session. The site I work with gets 5,000 unique visitors a day, it's a very very busy website and I'm thinking that garbage collection isn't up to snuff or that the random ID generation isn't quite random enough.
What can I do about this? I have increased the percentage of garbage collection already, what else can I do?
--Thomas Deliduka IT Manager ------------------------- Xenocast Street Smart Media Solutions http://www.xenocast.com/
attached mail follows:
> Now this is not the malicious kind where a user intentionally takes over > another session. I'm speaking of a case where the random session ID > generator happens to give another user someone else's session whether active > or inactive (inactive and not yet cleared by garbage collection). > > I had a case just this weekend where this happened, a user got another > visitor's shopping cart. The potential is for someone to get another > person's logged in session. The site I work with gets 5,000 unique visitors > a day, it's a very very busy website and I'm thinking that garbage > collection isn't up to snuff or that the random ID generation isn't quite > random enough. > > What can I do about this? I have increased the percentage of garbage > collection already, what else can I do?
Use session_id() to create your own session ids before you call session_start(). Make them 64 characters instead of 32 using two calls to uniqid(). That would make it less likely that someone gets assigned the same ID, wouldn't it?
---John Holmes...
attached mail follows:
You can reimplement varios parts of session handling ( see session_set_save_handler() ) together with making your own (better) session id with session_id(), or implement your own session module ( session_module_name() )
Thomas Deliduka wrote:
>Now this is not the malicious kind where a user intentionally takes over >another session. I'm speaking of a case where the random session ID >generator happens to give another user someone else's session whether active >or inactive (inactive and not yet cleared by garbage collection). > >I had a case just this weekend where this happened, a user got another >visitor's shopping cart. The potential is for someone to get another >person's logged in session. The site I work with gets 5,000 unique visitors >a day, it's a very very busy website and I'm thinking that garbage >collection isn't up to snuff or that the random ID generation isn't quite >random enough. > >What can I do about this? I have increased the percentage of garbage >collection already, what else can I do? > > >
attached mail follows:
You can generate your own session ids, you could use a randomly assign it or use part of the ip address in conjunction with a randomly generated key (something like appending the last 3 digits of the visiting IP address to a randomly generated session key).
You could keep track of them in a database as well and check to see if it is already in use before assigning it to the user, but this would generate additional load on your database server.
Jason Sheets
-----Original Message-----
From: Thomas Deliduka [mailto:thomas
xenocast.com]
Sent: Monday, October 21, 2002 9:15 AM
To: php-general
lists.php.net
Subject: [PHP] Inadvertant Session Hijacking
Now this is not the malicious kind where a user intentionally takes over another session. I'm speaking of a case where the random session ID generator happens to give another user someone else's session whether active or inactive (inactive and not yet cleared by garbage collection).
I had a case just this weekend where this happened, a user got another visitor's shopping cart. The potential is for someone to get another person's logged in session. The site I work with gets 5,000 unique visitors a day, it's a very very busy website and I'm thinking that garbage collection isn't up to snuff or that the random ID generation isn't quite random enough.
What can I do about this? I have increased the percentage of garbage collection already, what else can I do?
--Thomas Deliduka IT Manager ------------------------- Xenocast Street Smart Media Solutions http://www.xenocast.com/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I have developed my own content feed in that you enter an article from somewhere which is posted into a mysql database and then anyone with access to it can use a java call to the feed and have the neadlines of the the most recent news articles displayed on their web site.
When you click on a headline it refers to an ID in the news table and a new window is opened and the article is displayed but without any formatting at all.
When an article is entered people may press enter to separate paragraphs etc and would like to know how to get these spaces to be reciprocated when the article is displayed as currently it ommits the breaks.
This is the code which I currently have in place:
<?php
mysql_connect ("localhost", "root","testhouse");
mysql_select_db ("content");
$result = mysql_query ("select * FROM articles WHERE articleId='$articleId'");
while ($row = mysql_fetch_row($result)) {
printf ("<tr><td>%s</td></tr>", $row[2]); }
?>
I presume I need to insert something in the printf section, although it might be something to do with the code that inserts it into the database not being able to handle breaks.
Any help and direction would be much appreciated.
thanks
JCook
attached mail follows:
try using:
printf ("<tr><td>%s</td></tr>", nl2br ($row[2]));
On Mon, 2002-10-21 at 11:22, php
erars.demon.co.uk wrote:
> I have developed my own content feed in that you enter an article from somewhere which is posted into a mysql database and then anyone with access to it can use a java call to the feed and have the neadlines of the the most recent news articles displayed on their web site.
>
> When you click on a headline it refers to an ID in the news table and a new window is opened and the article is displayed but without any formatting at all.
>
> When an article is entered people may press enter to separate paragraphs etc and would like to know how to get these spaces to be reciprocated when the article is displayed as currently it ommits the breaks.
>
> This is the code which I currently have in place:
>
> <?php
>
> mysql_connect ("localhost", "root","testhouse");
>
> mysql_select_db ("content");
>
>
>
> $result = mysql_query ("select * FROM articles WHERE articleId='$articleId'");
>
> while ($row = mysql_fetch_row($result))
> {
>
> printf ("<tr><td>%s</td></tr>",
> $row[2]);
> }
>
> ?>
>
> I presume I need to insert something in the printf section, although it might be something to do with the code that inserts it into the database not being able to handle breaks.
>
> Any help and direction would be much appreciated.
>
> thanks
>
> JCook
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
str_replace(' ',' ',nl2br($row[2])) should help you.
php
erars.demon.co.uk wrote:
>I have developed my own content feed in that you enter an article from somewhere which is posted into a mysql database and then anyone with access to it can use a java call to the feed and have the neadlines of the the most recent news articles displayed on their web site. > >When you click on a headline it refers to an ID in the news table and a new window is opened and the article is displayed but without any formatting at all. > >When an article is entered people may press enter to separate paragraphs etc and would like to know how to get these spaces to be reciprocated when the article is displayed as currently it ommits the breaks. > >This is the code which I currently have in place: > ><?php > >mysql_connect ("localhost", "root","testhouse"); > >mysql_select_db ("content"); > > > >$result = mysql_query ("select * FROM articles WHERE articleId='$articleId'"); > >while ($row = mysql_fetch_row($result)) >{ > >printf ("<tr><td>%s</td></tr>", > $row[2]); >} > >?> > >I presume I need to insert something in the printf section, although it might be something to do with the code that inserts it into the database not being able to handle breaks. > >Any help and direction would be much appreciated. > >thanks > >JCook > > > >
attached mail follows:
You are looking for nl2br() http://www.php.net/nl2br
Try this printf nl2br("<tr><td>%s</td></tr>", $row[2]); > }
--- php
erars.demon.co.uk wrote:
> I have developed my own content feed in that you
> enter an article from somewhere which is posted into
> a mysql database and then anyone with access to it
> can use a java call to the feed and have the
> neadlines of the the most recent news articles
> displayed on their web site.
>
> When you click on a headline it refers to an ID in
> the news table and a new window is opened and the
> article is displayed but without any formatting at
> all.
>
> When an article is entered people may press enter to
> separate paragraphs etc and would like to know how
> to get these spaces to be reciprocated when the
> article is displayed as currently it ommits the
> breaks.
>
> This is the code which I currently have in place:
>
> <?php
>
> mysql_connect ("localhost", "root","testhouse");
>
> mysql_select_db ("content");
>
>
>
> $result = mysql_query ("select * FROM articles WHERE
> articleId='$articleId'");
>
> while ($row = mysql_fetch_row($result))
> {
>
> printf ("<tr><td>%s</td></tr>",
> $row[2]);
> }
>
> ?>
>
> I presume I need to insert something in the printf
> section, although it might be something to do with
> the code that inserts it into the database not being
> able to handle breaks.
>
> Any help and direction would be much appreciated.
>
> thanks
>
> JCook
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/
attached mail follows:
Hello,
at a Solaris installation with Netscape Enterprise Server during times of a high number of accesse the use of PHP scripts results in following errors:
Fatal error: Failes opening required './common.php' Warning: Failed opening xyz for inclusion Warning: Cannot add header information - headers already sent by (output started at ./common.php:346) in ./common.php line 350
There is no hint in the HTTP Server logs for errors related to the number of open file handles.
Any idea for a reason? Is it possible to get the errno of the errors? Because with errno it would be a little easier to understand the reasons for this!
best regards Gerald
attached mail follows:
You're running out of file descriptors--too many files open. Try increasing the maximum number of files available.
On Mon, 2002-10-21 at 14:45, Gerald Roehrbein/Pctdmn wrote: > > Hello, > > at a Solaris installation with Netscape Enterprise Server during times of a > high number of accesse the use of PHP scripts results in following errors: > > Fatal error: Failes opening required './common.php' > Warning: Failed opening xyz for inclusion > Warning: Cannot add header information - headers already sent by (output > started at ./common.php:346) in ./common.php line 350 > > There is no hint in the HTTP Server logs for errors related to the number > of open file handles. > > Any idea for a reason? Is it possible to get the errno of the errors? > Because with errno it would be a little easier to understand the reasons > for this! > > > best regards > Gerald > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
I have just installed Apache, PHP and MySQL, but when I try to do: mysql_connect($localhost,$mysqlusr); there is an error message like this: "MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)" Now, in /var/run/mysql there is in fact a file called mysql.sock Could anybody please tell me what I'm doing wrong? Thanks Alberto
attached mail follows:
What's the permissions set for mysql.sock?
Alberto Brea wrote: > I have just installed Apache, PHP and MySQL, but when I try to do: > mysql_connect($localhost,$mysqlusr); > there is an error message like this: > "MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)" > Now, in /var/run/mysql there is in fact a file called mysql.sock > Could anybody please tell me what I'm doing wrong? > Thanks > Alberto >
attached mail follows:
How about the permissions for the directory that mysql.sock is in?
Alberto Brea wrote: > The permissions for mysql.sock are s-rwx-rwx-rwx, and I'm running as root.
attached mail follows:
hi I'm generating a pdf file and giving users a link to the file (an online certificate). The link is just a regular link with a query string.
Sometimes in the browser the pdf file opens correctly, and other times the page spews out gibberish (uncompiled).
I am including the header header("Content-type: application/pdf"); in the file and it is on the first line (before includes, etc.).
This is the first time I am outputting pdf files and suspect that probably I am missing something simple -- a step, call to a plugin, header, something. Can anyone tell me what that might be?
thanks, s.
attached mail follows:
Save the file and look, if you don't have some php errors showing up in it. What is different between the case when it shows up correctly and when it shows gibberish?
Sarah Gray wrote:
>hi >I'm generating a pdf file and giving users a link to the file (an online >certificate). The link is just a regular link with a query string. > >Sometimes in the browser the pdf file opens correctly, and other times >the page spews out gibberish (uncompiled). > >I am including the header header("Content-type: application/pdf"); in >the file and it is on the first line (before includes, etc.). > >This is the first time I am outputting pdf files and suspect that >probably I am missing something simple -- a step, call to a plugin, >header, something. Can anyone tell me what that might be? > >thanks, >s. > > > >
attached mail follows:
> -----Original Message-----
> From: Sarah Gray [mailto:sarah
fabled.net]
> Sent: Monday, October 21, 2002 12:21 PM
> To: PHP
> Subject: [PHP] Getting gibberish, sometimes, in PDF output
>
>
> hi
> I'm generating a pdf file and giving users a link to the file
> (an online
> certificate). The link is just a regular link with a query string.
>
> Sometimes in the browser the pdf file opens correctly, and other times
> the page spews out gibberish (uncompiled).
>
> I am including the header header("Content-type: application/pdf"); in
> the file and it is on the first line (before includes, etc.).
>
> This is the first time I am outputting pdf files and suspect that
> probably I am missing something simple -- a step, call to a plugin,
> header, something. Can anyone tell me what that might be?
Make sure to send a content-length header, or IE won't like the pdf. IE has this terrible habit of remembering the content-type within a window of the browser, so if you ever had sent the page without the content-type, then IE will treat it as text and you get gibberish. The same is true in reverse -- if you get a parse error and had previously sent a content-type header, you'll get a broken icon image unless you close the window and re-open the page.
Also, you may want to move the content-type header to a place right before you output the pdf, so that if there are parse errors, the browser will show them and not try to send the page to Aacrobat.
These are the headers I send: header('Content-type: application/pdf'); header("Content-Disposition: inline; filename=$fileName"); header("Content-Length: $length");
attached mail follows:
Well could be several things from my experience.. if you leave off the trailing empty header(""); or a \n at the end of the last header it could cause your problem. The other problem I have had is when I put a session_start() after any of my headers in my code. The session_start() must be the first thing executed before all headers are processed... That is if you are using sessions like that.
David Erickson, CCSA
erickson
mddsg.com
>> -----Original Message-----
>> From: Sarah Gray [mailto:sarah
fabled.net]
>> Sent: Monday, October 21, 2002 12:21 PM
>> To: PHP
>> Subject: [PHP] Getting gibberish, sometimes, in PDF output
>>
>>
>> hi
>> I'm generating a pdf file and giving users a link to the file
>> (an online
>> certificate). The link is just a regular link with a query string.
>>
>> Sometimes in the browser the pdf file opens correctly, and other times
>> the page spews out gibberish (uncompiled).
>>
>> I am including the header header("Content-type: application/pdf"); in
>> the file and it is on the first line (before includes, etc.).
>>
>> This is the first time I am outputting pdf files and suspect that
>> probably I am missing something simple -- a step, call to a plugin,
>> header, something. Can anyone tell me what that might be?
>
> Make sure to send a content-length header, or IE won't like the pdf. IE
> has this terrible habit of remembering the content-type within a window
> of the browser, so if you ever had sent the page without the
> content-type, then IE will treat it as text and you get gibberish. The
> same is true in reverse -- if you get a parse error and had previously
> sent a content-type header, you'll get a broken icon image unless you
> close the window and re-open the page.
>
> Also, you may want to move the content-type header to a place right
> before you output the pdf, so that if there are parse errors, the
> browser will show them and not try to send the page to Aacrobat.
>
> These are the headers I send:
> header('Content-type: application/pdf');
> header("Content-Disposition: inline; filename=$fileName");
> header("Content-Length: $length");
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
My file outputs in NS4.79 but not IE6 (although it used to work in IE no problem. not sure why it stopped). These are my last lines of code:
pdf_close($p); $buf = pdf_get_buffer($p); $len = strlen($buf); $filename = "Certificate.pdf"; header("Content-type: application/pdf"); header("Content-disposition:inline;filename=$filename"); header("Content-length: $len"); print $buf; pdf_delete($p); ?>
(I'm not using sessions).
Anything? thanks, s.
Matt Schroebel wrote:
>
> > -----Original Message-----
> > From: Sarah Gray [mailto:sarah
fabled.net]
> > Sent: Monday, October 21, 2002 12:21 PM
> > To: PHP
> > Subject: [PHP] Getting gibberish, sometimes, in PDF output
> >
> >
> > hi
> > I'm generating a pdf file and giving users a link to the file
> > (an online
> > certificate). The link is just a regular link with a query string.
> >
> > Sometimes in the browser the pdf file opens correctly, and other times
> > the page spews out gibberish (uncompiled).
> >
> > I am including the header header("Content-type: application/pdf"); in
> > the file and it is on the first line (before includes, etc.).
> >
> > This is the first time I am outputting pdf files and suspect that
> > probably I am missing something simple -- a step, call to a plugin,
> > header, something. Can anyone tell me what that might be?
>
> Make sure to send a content-length header, or IE won't like the pdf. IE
> has this terrible habit of remembering the content-type within a window
> of the browser, so if you ever had sent the page without the
> content-type, then IE will treat it as text and you get gibberish. The
> same is true in reverse -- if you get a parse error and had previously
> sent a content-type header, you'll get a broken icon image unless you
> close the window and re-open the page.
>
> Also, you may want to move the content-type header to a place right
> before you output the pdf, so that if there are parse errors, the
> browser will show them and not try to send the page to Aacrobat.
>
> These are the headers I send:
> header('Content-type: application/pdf');
> header("Content-Disposition: inline; filename=$fileName");
> header("Content-Length: $length");
attached mail follows:
Try this:
header("Content-length: $len\n\n");
You need to have a blank header line after your content-length or IE goes wacky on you... If that doesn't work then hmmmm I'm not quite sure where to go from there..
Any headers before that in your code? or output's at all accidentily?
David Erickson, CCSA
erickson
mddsg.com
> My file outputs in NS4.79 but not IE6 (although it used to work in IE no
> problem. not sure why it stopped). These are my last lines of code:
>
> pdf_close($p);
> $buf = pdf_get_buffer($p);
> $len = strlen($buf);
> $filename = "Certificate.pdf";
> header("Content-type: application/pdf");
> header("Content-disposition:inline;filename=$filename");
> header("Content-length: $len");
> print $buf;
> pdf_delete($p);
> ?>
>
> (I'm not using sessions).
>
> Anything?
> thanks,
> s.
>
>
>
> Matt Schroebel wrote:
>>
>> > -----Original Message-----
>> > From: Sarah Gray [mailto:sarah
fabled.net]
>> > Sent: Monday, October 21, 2002 12:21 PM
>> > To: PHP
>> > Subject: [PHP] Getting gibberish, sometimes, in PDF output
>> >
>> >
>> > hi
>> > I'm generating a pdf file and giving users a link to the file
>> > (an online
>> > certificate). The link is just a regular link with a query string.
>> >
>> > Sometimes in the browser the pdf file opens correctly, and other
>> times the page spews out gibberish (uncompiled).
>> >
>> > I am including the header header("Content-type: application/pdf");
>> in the file and it is on the first line (before includes, etc.).
>> >
>> > This is the first time I am outputting pdf files and suspect that
>> probably I am missing something simple -- a step, call to a plugin,
>> header, something. Can anyone tell me what that might be?
>>
>> Make sure to send a content-length header, or IE won't like the pdf.
>> IE has this terrible habit of remembering the content-type within a
>> window of the browser, so if you ever had sent the page without the
>> content-type, then IE will treat it as text and you get gibberish.
>> The same is true in reverse -- if you get a parse error and had
>> previously sent a content-type header, you'll get a broken icon image
>> unless you close the window and re-open the page.
>>
>> Also, you may want to move the content-type header to a place right
>> before you output the pdf, so that if there are parse errors, the
>> browser will show them and not try to send the page to Aacrobat.
>>
>> These are the headers I send:
>> header('Content-type: application/pdf');
>> header("Content-Disposition: inline; filename=$fileName");
>> header("Content-Length: $length");
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Content-length must be right for IE. Check what David said about outputing something accidently, thus messing up the content length. I use ob_start(), ob_get_length(), and ob_end_flush(), but your code should work fine. Maybe you could start ob just to see if the pdf_get_buffer() value matches the ob_get_length() value?
> -----Original Message-----
> From: Sarah Gray [mailto:sarah
fabled.net]
> Sent: Monday, October 21, 2002 2:16 PM
> To: PHP
> Subject: Re: [PHP] Getting gibberish, sometimes, in PDF output
>
>
> My file outputs in NS4.79 but not IE6 (although it used to
> work in IE no
> problem. not sure why it stopped). These are my last lines of code:
>
> pdf_close($p);
> $buf = pdf_get_buffer($p);
> $len = strlen($buf);
> $filename = "Certificate.pdf";
> header("Content-type: application/pdf");
> header("Content-disposition:inline;filename=$filename");
> header("Content-length: $len");
> print $buf;
> pdf_delete($p);
> ?>
>
> (I'm not using sessions).
>
> Anything?
> thanks,
> s.
>
>
>
> Matt Schroebel wrote:
> >
> > > -----Original Message-----
> > > From: Sarah Gray [mailto:sarah
fabled.net]
> > > Sent: Monday, October 21, 2002 12:21 PM
> > > To: PHP
> > > Subject: [PHP] Getting gibberish, sometimes, in PDF output
> > >
> > >
> > > hi
> > > I'm generating a pdf file and giving users a link to the file
> > > (an online
> > > certificate). The link is just a regular link with a query string.
> > >
> > > Sometimes in the browser the pdf file opens correctly,
> and other times
> > > the page spews out gibberish (uncompiled).
> > >
> > > I am including the header header("Content-type:
> application/pdf"); in
> > > the file and it is on the first line (before includes, etc.).
> > >
> > > This is the first time I am outputting pdf files and suspect that
> > > probably I am missing something simple -- a step, call to
> a plugin,
> > > header, something. Can anyone tell me what that might be?
> >
> > Make sure to send a content-length header, or IE won't like
> the pdf. IE
> > has this terrible habit of remembering the content-type
> within a window
> > of the browser, so if you ever had sent the page without the
> > content-type, then IE will treat it as text and you get
> gibberish. The
> > same is true in reverse -- if you get a parse error and had
> previously
> > sent a content-type header, you'll get a broken icon image
> unless you
> > close the window and re-open the page.
> >
> > Also, you may want to move the content-type header to a place right
> > before you output the pdf, so that if there are parse errors, the
> > browser will show them and not try to send the page to Aacrobat.
> >
> > These are the headers I send:
> > header('Content-type: application/pdf');
> > header("Content-Disposition: inline; filename=$fileName");
> > header("Content-Length: $length");
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
'accidental output' rang a bell .... turns out the include file to access my database was the culprit, though only effecting IE. When I took it out & simply called the database from within the script (which is how it had been for weeks, when it was working), the file opened pdf, no gibberish. I guess I could put it back and use the ob_ functions, but for now it's fine.
thanks all. s.
Matt Schroebel wrote:
>
> Content-length must be right for IE. Check what David said about
> outputing something accidently, thus messing up the content length. I
> use ob_start(), ob_get_length(), and ob_end_flush(), but your code
> should work fine. Maybe you could start ob just to see if the
> pdf_get_buffer() value matches the ob_get_length() value?
>
> > -----Original Message-----
> > From: Sarah Gray [mailto:sarah
fabled.net]
> > Sent: Monday, October 21, 2002 2:16 PM
> > To: PHP
> > Subject: Re: [PHP] Getting gibberish, sometimes, in PDF output
> >
> >
> > My file outputs in NS4.79 but not IE6 (although it used to
> > work in IE no
> > problem. not sure why it stopped). These are my last lines of code:
> >
> > pdf_close($p);
> > $buf = pdf_get_buffer($p);
> > $len = strlen($buf);
> > $filename = "Certificate.pdf";
> > header("Content-type: application/pdf");
> > header("Content-disposition:inline;filename=$filename");
> > header("Content-length: $len");
> > print $buf;
> > pdf_delete($p);
> > ?>
> >
> > (I'm not using sessions).
> >
> > Anything?
> > thanks,
> > s.
> >
> >
> >
> > Matt Schroebel wrote:
> > >
> > > > -----Original Message-----
> > > > From: Sarah Gray [mailto:sarah
fabled.net]
> > > > Sent: Monday, October 21, 2002 12:21 PM
> > > > To: PHP
> > > > Subject: [PHP] Getting gibberish, sometimes, in PDF output
> > > >
> > > >
> > > > hi
> > > > I'm generating a pdf file and giving users a link to the file
> > > > (an online
> > > > certificate). The link is just a regular link with a query string.
> > > >
> > > > Sometimes in the browser the pdf file opens correctly,
> > and other times
> > > > the page spews out gibberish (uncompiled).
> > > >
> > > > I am including the header header("Content-type:
> > application/pdf"); in
> > > > the file and it is on the first line (before includes, etc.).
> > > >
> > > > This is the first time I am outputting pdf files and suspect that
> > > > probably I am missing something simple -- a step, call to
> > a plugin,
> > > > header, something. Can anyone tell me what that might be?
> > >
> > > Make sure to send a content-length header, or IE won't like
> > the pdf. IE
> > > has this terrible habit of remembering the content-type
> > within a window
> > > of the browser, so if you ever had sent the page without the
> > > content-type, then IE will treat it as text and you get
> > gibberish. The
> > > same is true in reverse -- if you get a parse error and had
> > previously
> > > sent a content-type header, you'll get a broken icon image
> > unless you
> > > close the window and re-open the page.
> > >
> > > Also, you may want to move the content-type header to a place right
> > > before you output the pdf, so that if there are parse errors, the
> > > browser will show them and not try to send the page to Aacrobat.
> > >
> > > These are the headers I send:
> > > header('Content-type: application/pdf');
> > > header("Content-Disposition: inline; filename=$fileName");
> > > header("Content-Length: $length");
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
attached mail follows:
Hello everybody,
I try to retrieve and display an 128-byte encrypted page on the internet ( https protocol) . For this I had to install the curl library.
I use this code but all I have is a white page :
$ch = curl_init(); $sample_URL = "https://www.example.com"; curl_setopt($ch, curlOPT_URL, $sample_URL); curl_setopt($ch, curlOPT_RETURNTRANSFER, 1); $result=curl_exec($ch); curl_close($ch);
I don't have any error, I just retrieve a white page.
Thanx for any advice !!!
Cyrille.
attached mail follows:
Quoting "Andres, Cyrille" <Cyrille.Andres
icn.siemens.com>:
> > Hello everybody, > > I try to retrieve and display an 128-byte encrypted page on the internet ( > https protocol) . For this I had to install the curl library. > > I use this code but all I have is a white page : > > $ch = curl_init(); > $sample_URL = "https://www.example.com"; > curl_setopt($ch, curlOPT_URL, $sample_URL); > curl_setopt($ch, curlOPT_RETURNTRANSFER, 1); > $result=curl_exec($ch); > curl_close($ch); > > I don't have any error, I just retrieve a white page. > > Thanx for any advice !!! > > > > Cyrille. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Oops, sorry about the blank response - hit the send button too quickly.
Not sure if this is the cause of your problem but try changing curlOPT_RETURNTRANSFER to CURLOPT_RETURNTRANSFER and curlOPT_URL to CURLOPT_URL
Quoting "Andres, Cyrille" <Cyrille.Andres
icn.siemens.com>:
> > Hello everybody, > > I try to retrieve and display an 128-byte encrypted page on the internet ( > https protocol) . For this I had to install the curl library. > > I use this code but all I have is a white page : > > $ch = curl_init(); > $sample_URL = "https://www.example.com"; > curl_setopt($ch, curlOPT_URL, $sample_URL); > curl_setopt($ch, curlOPT_RETURNTRANSFER, 1); > $result=curl_exec($ch); > curl_close($ch); > > I don't have any error, I just retrieve a white page. > > Thanx for any advice !!! > > > > Cyrille. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
----- End forwarded message -----
attached mail follows:
This might be obvious but make sure you:
echo $result;
Quoting "Andres, Cyrille" <Cyrille.Andres
icn.siemens.com>:
> Thanks a lot, but it still doesn't work :((
>
> Would you have another idea ?? :)
>
> Thanx !!
>
> -----Original Message-----
> From: jacob
keystreams.com [mailto:jacob
keystreams.com]
> Sent: Monday, October 21, 2002 10:29 AM
> To: php-general
lists.php.net
> Subject: Fwd: Re: [PHP] curl library
>
>
> Oops, sorry about the blank response - hit the send button too quickly.
>
> Not sure if this is the cause of your problem but try changing
> curlOPT_RETURNTRANSFER to CURLOPT_RETURNTRANSFER and curlOPT_URL to
> CURLOPT_URL
>
> Quoting "Andres, Cyrille" <Cyrille.Andres
icn.siemens.com>:
>
> >
> > Hello everybody,
> >
> > I try to retrieve and display an 128-byte encrypted page on the internet (
> > https protocol) . For this I had to install the curl library.
> >
> > I use this code but all I have is a white page :
> >
> > $ch = curl_init();
> > $sample_URL = "https://www.example.com";
> > curl_setopt($ch, curlOPT_URL, $sample_URL);
> > curl_setopt($ch, curlOPT_RETURNTRANSFER, 1);
> > $result=curl_exec($ch);
> > curl_close($ch);
> >
> > I don't have any error, I just retrieve a white page.
> >
> > Thanx for any advice !!!
> >
> >
> >
> > Cyrille.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> ----- End forwarded message -----
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Are you sure this is not availeble only to CGI scripts?
Frank Wenzke wrote:
> Hi, > > I just tried the following with php 4.1.2 as an Apache Modul. I added > a RewriteRule to my .htaccess file like this: > > RewriteRule ^(.*)/SID([^/]+)/(.*) $1/$3 [E=SID:$2] > > afterwards there should be an environment variable SID. But the > Superglobal > $_ENV['SID'] do not exist. HTTP-Method is GET. > Does anyone have a suggestion how the environment variable could be > accessed?` > > Thanks in advance > Frank Wenzke > >
attached mail follows:
Hi,
Monday, October 21, 2002, 11:31:30 PM, you wrote: FW> Hi,
FW> I just tried the following with php 4.1.2 as an Apache Modul. I added a FW> RewriteRule to my .htaccess file like this:
FW> RewriteRule ^(.*)/SID([^/]+)/(.*) $1/$3 [E=SID:$2]
FW> afterwards there should be an environment variable SID. But the Superglobal FW> $_ENV['SID'] do not exist. HTTP-Method is GET. FW> Does anyone have a suggestion how the environment variable could be accessed?`
FW> Thanks in advance FW> Frank Wenzke
I use this which is similar and works ok RewriteRule ^/sa/(.*)$ /sa/index.php [E=USERNAME:$1]
But I have had troubles getting mod-rewrite to function with domains that are outside of the main apache document_root. For example I use mod_dynvhost and mod-rewrite totally ignores any rules set for those virtual domains. Maybe a clue..
-- regards, Tom
attached mail follows:
You miss mysql and perl compatible reg. espr. libraries to link against
SpamSucks86 wrote:
>http://nopaste.snit.ch:8001/85 > > > >That's the compile error I'm getting. > >I'm using ./configure with no options > >I'm trying to compile a cgi version in my user account (I'm not root, >it's redhat linux, it's a virtual hosting account and I need to be able >to run shell scripts). > >Any and all help is appreciated! > > > > > >
attached mail follows:
should not that be just ../imap-2002.RC8/ ?
Olexandr aka M
cro$ wrote:
>I can't compike php with imap support - I got error such "Can't find imap library". > >System: Slackware Linux 8.0 (kernel 2.2.19) >configure parameters: ./configure --with-mysql --with-imap=../imap-2002.RC8/src --with-apache=../apache_1.3.26 > >HELP ME!!! > >I need IMAP in PHP very much! > > >
attached mail follows:
Hi all. Im trying to sort a multidimensional array using uasort(). I haven't used it before, so Im not too sure on its usage. Here is what I have -> -------------------- <?php
echo header('Content-type: text/plain');
$foo[0][] = array('title' => 'Title 1', 'summary' => 'Summary 1', 'rank' => 13); $foo[1][] = array('title' => 'Title 2', 'summary' => 'Summary 2', 'rank' => 7); $foo[1][] = array('title' => 'Title 3', 'summary' => 'Summary 3', 'rank' => 3); $foo[2][] = array('title' => 'Title 4', 'summary' => 'Summary 4', 'rank' => 11); $foo[1][] = array('title' => 'Title 9', 'summary' => 'Summary 9', 'rank' => 4);
function cmp ($a, $b) { foreach($a as $k => $null) { if ($a[$k]['rank'] < $b[$k]['rank']) return 1; if ($a[$k]['rank'] > $b[$k]['rank']) return -1; if ($a[$k]['rank'] == $b[$k]['rank']) return 0; } }
uasort ($foo, 'cmp'); print_r($foo);
?> ----------------------
Im trying to sort the array in descending order by the rank's value. Im not sure if Im heading in the right direction with this, but any help would be appreciated. Thanks.
-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/
attached mail follows:
The foreach loop is useless, as one of the conditions will be met nad your functions returns. I'm not sure, if you know you now have $foo contain $foo[0][0], $foo[1][0], $foo[1][1], $foo[1][2], $foo[2][0], and this makes it inconsistent, there is one in $foo[0] and 3 in $foo[1]. Maybe you want
function cmp ($a, $b) { if ($a[$k]['rank'] < $b[$k]['rank']) return 1; if ($a[$k]['rank'] > $b[$k]['rank']) return -1; if ($a[$k]['rank'] == $b[$k]['rank']) return 0; }
foreach($a as $k => $null) { uasort ($foo[$k], 'cmp'); }
Gerard Samuel wrote:
> Hi all. Im trying to sort a multidimensional array using uasort(). > I haven't used it before, so Im not too sure on its usage. > Here is what I have -> > -------------------- > <?php > > echo header('Content-type: text/plain'); > > $foo[0][] = array('title' => 'Title 1', 'summary' => 'Summary 1', > 'rank' => 13); > $foo[1][] = array('title' => 'Title 2', 'summary' => 'Summary 2', > 'rank' => 7); > $foo[1][] = array('title' => 'Title 3', 'summary' => 'Summary 3', > 'rank' => 3); > $foo[2][] = array('title' => 'Title 4', 'summary' => 'Summary 4', > 'rank' => 11); > $foo[1][] = array('title' => 'Title 9', 'summary' => 'Summary 9', > 'rank' => 4); > > function cmp ($a, $b) > { > foreach($a as $k => $null) > { > if ($a[$k]['rank'] < $b[$k]['rank']) return 1; > if ($a[$k]['rank'] > $b[$k]['rank']) return -1; > if ($a[$k]['rank'] == $b[$k]['rank']) return 0; > } > } > > uasort ($foo, 'cmp'); > print_r($foo); > > ?> > ---------------------- > > Im trying to sort the array in descending order by the rank's value. > Im not sure if Im heading in the right direction with this, but any > help would be appreciated. > Thanks. >
attached mail follows:
Sorry, too much copypasting, the line should read foreach($foo as $k => $null)
Marek Kilimajer wrote:
> The foreach loop is useless, as one of the conditions will be met nad > your functions returns. > I'm not sure, if you know you now have $foo contain > $foo[0][0], $foo[1][0], $foo[1][1], $foo[1][2], $foo[2][0], and this > makes it inconsistent, > there is one in $foo[0] and 3 in $foo[1]. > Maybe you want > > function cmp ($a, $b) > { > if ($a[$k]['rank'] < $b[$k]['rank']) return 1; > if ($a[$k]['rank'] > $b[$k]['rank']) return -1; > if ($a[$k]['rank'] == $b[$k]['rank']) return 0; > } > > foreach($a as $k => $null) > { > uasort ($foo[$k], 'cmp'); > } > > > > Gerard Samuel wrote: > >> Hi all. Im trying to sort a multidimensional array using uasort(). >> I haven't used it before, so Im not too sure on its usage. >> Here is what I have -> >> -------------------- >> <?php >> >> echo header('Content-type: text/plain'); >> >> $foo[0][] = array('title' => 'Title 1', 'summary' => 'Summary 1', >> 'rank' => 13); >> $foo[1][] = array('title' => 'Title 2', 'summary' => 'Summary 2', >> 'rank' => 7); >> $foo[1][] = array('title' => 'Title 3', 'summary' => 'Summary 3', >> 'rank' => 3); >> $foo[2][] = array('title' => 'Title 4', 'summary' => 'Summary 4', >> 'rank' => 11); >> $foo[1][] = array('title' => 'Title 9', 'summary' => 'Summary 9', >> 'rank' => 4); >> >> function cmp ($a, $b) >> { >> foreach($a as $k => $null) >> { >> if ($a[$k]['rank'] < $b[$k]['rank']) return 1; >> if ($a[$k]['rank'] > $b[$k]['rank']) return -1; >> if ($a[$k]['rank'] == $b[$k]['rank']) return 0; >> } >> } >> >> uasort ($foo, 'cmp'); >> print_r($foo); >> >> ?> >> ---------------------- >> >> Im trying to sort the array in descending order by the rank's value. >> Im not sure if Im heading in the right direction with this, but any >> help would be appreciated. >> Thanks. >> > >
attached mail follows:
I've tried the way you mentioned. It doesn't work. Here is what I did. I ran a double foreach() to create a new flat multidimensional array out of the original array. Then apply uasort to the new array and it seems to be working. If anyone knows of a better, more efficient way, feel free to chime in... New code -> ---------------------------- <?php
echo header('Content-type: text/plain');
$foo[0][] = array('title' => 'Title 1', 'summary' => 'Summary 1', 'rank' => 13); $foo[1][] = array('title' => 'Title 2', 'summary' => 'Summary 2', 'rank' => 7); $foo[1][] = array('title' => 'Title 3', 'summary' => 'Summary 3', 'rank' => 3); $foo[2][] = array('title' => 'Title 4', 'summary' => 'Summary 4', 'rank' => 11); $foo[1][] = array('title' => 'Title 9', 'summary' => 'Summary 9', 'rank' => 4);
foreach($foo as $key => $temp) { foreach($temp as $value) { $bar[] = $value; } }
function cmp ($a, $b) { if ($a['rank'] > $b['rank']) $return = -1; if ($a['rank'] < $b['rank']) $return = 1; if ($a['rank'] == $b['rank']) $return = 0; return $return; }
uasort ($bar, 'cmp'); print_r($bar);
?> ------------------
Marek Kilimajer wrote:
> The foreach loop is useless, as one of the conditions will be met nad > your functions returns. > I'm not sure, if you know you now have $foo contain > $foo[0][0], $foo[1][0], $foo[1][1], $foo[1][2], $foo[2][0], and this > makes it inconsistent, > there is one in $foo[0] and 3 in $foo[1]. > Maybe you want > > function cmp ($a, $b) > { > if ($a[$k]['rank'] < $b[$k]['rank']) return 1; > if ($a[$k]['rank'] > $b[$k]['rank']) return -1; > if ($a[$k]['rank'] == $b[$k]['rank']) return 0; > } > > foreach($a as $k => $null) > { > uasort ($foo[$k], 'cmp'); > } > > > > Gerard Samuel wrote: > >> Hi all. Im trying to sort a multidimensional array using uasort(). >> I haven't used it before, so Im not too sure on its usage. >> Here is what I have -> >> -------------------- >> <?php >> >> echo header('Content-type: text/plain'); >> >> $foo[0][] = array('title' => 'Title 1', 'summary' => 'Summary 1', >> 'rank' => 13); >> $foo[1][] = array('title' => 'Title 2', 'summary' => 'Summary 2', >> 'rank' => 7); >> $foo[1][] = array('title' => 'Title 3', 'summary' => 'Summary 3', >> 'rank' => 3); >> $foo[2][] = array('title' => 'Title 4', 'summary' => 'Summary 4', >> 'rank' => 11); >> $foo[1][] = array('title' => 'Title 9', 'summary' => 'Summary 9', >> 'rank' => 4); >> >> function cmp ($a, $b) >> { >> foreach($a as $k => $null) >> { >> if ($a[$k]['rank'] < $b[$k]['rank']) return 1; >> if ($a[$k]['rank'] > $b[$k]['rank']) return -1; >> if ($a[$k]['rank'] == $b[$k]['rank']) return 0; >> } >> } >> >> uasort ($foo, 'cmp'); >> print_r($foo); >> >> ?> >> ---------------------- >> >> Im trying to sort the array in descending order by the rank's value. >> Im not sure if Im heading in the right direction with this, but any >> help would be appreciated. >> Thanks. >> > >
-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/
attached mail follows:
Hi all!
I'm trying to display a flash which is stored at my db (postgresql). to retrieve the information i created a file named show_swf.swf with this content: <? $conn = pg_connect ("dbname=name user=doumind password=hmmmno"); $filename = $_GET['filename']; $sql = "select bin_data from banners where filename='$filename'"; $res = pg_query ($conn, $sql); $data = pg_result ($res, 0, "bin_data"); header('Content-type: application/x-shockwave-flash'); echo stripcslashes($data); ?>
and i call this file at the code of the flash (i've bolded and underline the places where i called the file): function flash_code_up_right($filename) {
$output = <<<html_snip <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" width="208" height="60"><param name="banner_small" value="show_swf.swf?filename=$filename" /><param name="quality" value="high" /><param name="bgcolor" value="white" /> <script type="text/javascript"> <!-- Hide this var ShockMode = 0; if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) { if (navigator.plugins && navigator.plugins["Shockwave Flash"]) ShockMode = 1; } if ( ShockMode ) { document.write('<EMBED SRC="show_swf.swf?filename=$filename"'); document.write(' swLiveConnect=FALSE width=208 height=60'); document.write(' QUALITY=high '); document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?1_P od_ ers on= hoc wav Flah"> ); doc ument.write('</EMBED>'); } else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("3.")>=0) || (navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){ NoFlash(); } function NoFlash() { document.write('get flash'); } // Done --> </script></object>
html_snip;
return $output; }
now when i do this i c instead of the flash a white square with the right measures. if i just call show_swf.swf?filename=filename from the address row at the browser i can c the flash being displayed but its huge (all over the screen).
does anyone have any idea or can just give me a link to related info?
With Thanks in Advance! Yonatan Ben-Nes
attached mail follows:
does anyone know what the function _() do and why it is on my redhat apache-server as before I even declares it? /peter a
attached mail follows:
> does anyone know what the function _() do > and why it is on my redhat apache-server as > before I even declares it? > /peter a
It's an alias to gettext().
---John Holmes...
attached mail follows:
I have made a library of functions that I include() when I try call a function I am given a error message of undefined funtion, etc
are included files in a separate namespace or something anybody have any ideas or questions for me maybe I'm doing something wrong.
Tyler
attached mail follows:
> I have made a library of functions that I include() > when I try call a function I am given a error message of undefined > funtion, etc > > are included files in a separate namespace or something > anybody have any ideas or questions for me maybe I'm doing something > wrong.
Included files get the same scope as the place the include is called. So, what your doing should work fine if you have the include at the top of the file and try to use a function within it later in the page. If you have your include() in a function, then it may not work.
Show us _some_ of your code if this doesn't help.
---John Holmes...
attached mail follows:
on 22/10/02 4:01 AM, Tyler BIRD (BIRDTY
uvsc.edu) wrote:
> I have made a library of functions that I include() > when I try call a function I am given a error message of undefined > funtion, etc > > are included files in a separate namespace or something > anybody have any ideas or questions for me maybe I'm doing something > wrong.
That's how they're supposed to work. If mylib.php has a function called makeMeLunch():
<? include('mylib.php'); makeMeLunch(); ?>
... will work.
Perhaps you should paste some code?
Justin
attached mail follows:
on 22/10/02 4:01 AM, Tyler BIRD (BIRDTY
uvsc.edu) wrote:
> I have made a library of functions that I include() > when I try call a function I am given a error message of undefined > funtion, etc > > are included files in a separate namespace or something > anybody have any ideas or questions for me maybe I'm doing something > wrong.
Also, make sure the any PHP code in the mylib.php file is wrapped in php tags:
<? function makeMyLunch() { ... } ?>
NOT just
function makeMyLunch() { ... }
Justin
attached mail follows:
Hi : I am new to Php, i am having some problem with session in PHP I am not sure what went wrong, I am using php4.2.3 when i try to set session with following code <?php $os="BSD"; session_register($os); $name="devon"; $devon="my Name"; session_register($name); ?>
<?php session_start(); $user="dodell"; if(session_register("user")){ echo("User Field set to $user."); } else{ echo("Coud not set the session variable"); } ?>
it works well and it write the session value into session file ************ user|s:6:"dodell"; **************** but when i try to access the same session variable (used the following code)
<?php session_start(); echo("Welcome to the user area , $user"); ?>
I am getting some error message ******************************** Notice: Undefined variable: user in c:\projects\test\session2.php on line 3 Welcome to the user area , ****************************** Can any one please specify what went wrong with my code Or should i need to make any chages in my php.ini files etc..
when i run phpinfo(); it out put shows that Session support enabled Thanks in advance Prad
__________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/
attached mail follows:
> Hi : > I am new to Php, i am having some problem with session > in PHP > I am not sure what went wrong, I am using php4.2.3 > when i try to set session with following code > <?php > $os="BSD"; > session_register($os); > $name="devon"; > $devon="my Name"; > session_register($name); > ?> > > <?php > session_start(); > $user="dodell"; > if(session_register("user")){ > echo("User Field set to $user."); > } > else{ > echo("Coud not set the session variable"); > } > ?> > > it works well and it write the session value into > session file > ************ > user|s:6:"dodell"; > **************** > but when i try to access the same session variable > (used the following code) > > > <?php > session_start(); > echo("Welcome to the user area , $user");
Try
echo("Welcome to the user area , {$_SESSION['user']}");
Do you know if you have register_globals ON or OFF in your php.ini?
---John Holmes...
attached mail follows:
Is register_globals OFF perhaps? Try..
echo "Welcome to the user area , ".$_SESSION['user']; -Kevin
----- Original Message -----
From: "ppf" <ppf2u
yahoo.com>
To: <php-general
lists.php.net>
Sent: Monday, October 21, 2002 12:10 PM
Subject: [PHP] Unable to access the assigned session variable
> > Hi : > I am new to Php, i am having some problem with session > in PHP > I am not sure what went wrong, I am using php4.2.3 > when i try to set session with following code > <?php > $os="BSD"; > session_register($os); > $name="devon"; > $devon="my Name"; > session_register($name); > ?> > > <?php > session_start(); > $user="dodell"; > if(session_register("user")){ > echo("User Field set to $user."); > } > else{ > echo("Coud not set the session variable"); > } > ?> > > it works well and it write the session value into > session file > ************ > user|s:6:"dodell"; > **************** > but when i try to access the same session variable > (used the following code) > > > <?php > session_start(); > echo("Welcome to the user area , $user"); > ?> > > I am getting some error message > ******************************** > Notice: Undefined variable: user in > c:\projects\test\session2.php on line 3 > Welcome to the user area , > ****************************** > Can any one please specify what went wrong with my > code > Or should i need to make any chages in my php.ini > files etc.. > > when i run phpinfo(); > it out put shows that Session support enabled > Thanks in advance > Prad > > > __________________________________________________ > Do you Yahoo!? > Y! Web Hosting - Let the expert host your web site > http://webhosting.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Also, you should call session_start before any other session function.
1LT John W. Holmes wrote: >>Hi : >>I am new to Php, i am having some problem with session >>in PHP >>I am not sure what went wrong, I am using php4.2.3 >>when i try to set session with following code >><?php >>$os="BSD"; >>session_register($os); >>$name="devon"; >>$devon="my Name"; >>session_register($name); >>?> >> >><?php >>session_start(); >>$user="dodell"; >>if(session_register("user")){ >>echo("User Field set to $user."); >>} >>else{ >>echo("Coud not set the session variable"); >>} >>?> >> >>it works well and it write the session value into >>session file >>************ >>user|s:6:"dodell"; >>**************** >> but when i try to access the same session variable >>(used the following code) >> >> >><?php >>session_start(); >>echo("Welcome to the user area , $user"); > > > Try > > echo("Welcome to the user area , {$_SESSION['user']}"); > > Do you know if you have register_globals ON or OFF in your php.ini? > > ---John Holmes... >
attached mail follows:
> Is there a way of finding out the max and min values in an array without > resorting it?
>How about Min() and max().
Wow. I am King Idiot. I don't know how I missed those. Thanks.
attached mail follows:
Hi, Lets say I set a cookie like this:
setcookie(session_name(), $szSessionID, time()+$expireTime, "/");
The cookie does get set fine. Now, how can I change the cookie value $szSessionID without affecting the cookies expire time? Will $_COOKIE['szSessionID'] = $newsessionid store the new value to the cookie?
So if the cookie time was set to expire in 7 days, I would like to be able to change the cookies value 3 days later, but the expire time would not be reset to 7 days, it would still have the original time which would mean 4 days left to the cookie life. If I can retreive the current expire time of the cookie, I could just subtract that value, but I don't know how to get the cookies set expire time. And I don't want to store the expire time as another cookie or part of this cookie.
Thanks for any help. Chris
attached mail follows:
> Will $_COOKIE['szSessionID'] = $newsessionid store the new value to the cookie?
No, it will not. It'll only adjust the value for the current script.
---John Holmes...
attached mail follows:
I'm running 'configure' with the following directives:
--with-dom --enable-xslt --with-expat-dir=/usr/lib --with-xslt-sablot=/usr/lib
among others. I can forward the entire list I'm using upon request. However, I'm noticing the following problems:
checking for DOM XSLT support... no checking for DOM EXSLT support... no
Why are both of those "no"? Also, I'm getting the following problems as well:
checking external libexpat install dir... yes configure: error: not found. Please reinstall the expat distribution.
Both expat 1.95.5 and sablotron 0.96 are installed in /usr/lib.
Why am I getting these problems. I've been trying to figure this out for the last 4 hours and trying to install various packages. Any help would be greatly appreciated!
Chris
attached mail follows:
Make sure that you have the configuration options correctly.
--with-xml --with-dom=/usr --with-xslt-sablot=/usr/local/sablot --with-expat-dir=/usr --with-dom-xslt=/usr --enable-xslt
That should work for ya...
On Mon, 2002-10-21 at 13:21, Chris Boget wrote: > I'm running 'configure' with the following directives: > > --with-dom --enable-xslt --with-expat-dir=/usr/lib --with-xslt-sablot=/usr/lib > > among others. I can forward the entire list I'm using upon request. > However, I'm noticing the following problems: > > checking for DOM XSLT support... no > checking for DOM EXSLT support... no > > Why are both of those "no"? > Also, I'm getting the following problems as well: > > checking external libexpat install dir... yes > configure: error: not found. Please reinstall the expat distribution. > > Both expat 1.95.5 and sablotron 0.96 are installed in /usr/lib. > > Why am I getting these problems. I've been trying to figure this > out for the last 4 hours and trying to install various packages. > Any help would be greatly appreciated! > > Chris > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
-- .: B i g D o g :.
attached mail follows:
> --with-dom=/usr > --with-expat-dir=/usr > --with-dom-xslt=/usr
Why /usr and not /usr/lib. The latter is where they are installed...
> --with-xslt-sablot=/usr/local/sablot
Also, sablotron isn't installed in the above directory. It's installed in /usr/lib. This is what I get when I run rpm -ql sablotron-0.96-1
/usr/bin/sabcmd /usr/lib/libsablot.so.0 /usr/lib/libsablot.so.0.96.0 /usr/share/doc/sablotron-0.96 /usr/share/doc/sablotron-0.96/README /usr/share/doc/sablotron-0.96/RELEASE /usr/share/doc/sablotron-0.96/sabcmd.1
In any case, what you suggested got me much farther than I've ever been before. However, now I'm getting this:
checking for XSLT Sablotron backend... yes checking libexpat dir for Sablotron XSL support... yes
all good so far, but:
checking for Sablotron libraries in the default path... configure: error: not fo und. Please re-install the Sablotron distribution
Should I change this line:
--with-xslt-sablot=/usr/local/sablot
to something else? To be more in line with where sablotron is actually installed?
Chris
attached mail follows:
Because of how the makefile is set up...i looks in certain directories...
On Mon, 2002-10-21 at 13:43, Chris Boget wrote: > > --with-dom=/usr > > --with-expat-dir=/usr > > --with-dom-xslt=/usr > > Why /usr and not /usr/lib. The latter is where they are installed... > > > --with-xslt-sablot=/usr/local/sablot > > Also, sablotron isn't installed in the above directory. It's installed in > /usr/lib. This is what I get when I run rpm -ql sablotron-0.96-1 > > /usr/bin/sabcmd > /usr/lib/libsablot.so.0 > /usr/lib/libsablot.so.0.96.0 > /usr/share/doc/sablotron-0.96 > /usr/share/doc/sablotron-0.96/README > /usr/share/doc/sablotron-0.96/RELEASE > /usr/share/doc/sablotron-0.96/sabcmd.1 > > > In any case, what you suggested got me much farther than I've ever been > before. > However, now I'm getting this: > > checking for XSLT Sablotron backend... yes > checking libexpat dir for Sablotron XSL support... yes > > all good so far, but: > > checking for Sablotron libraries in the default path... configure: error: not fo > und. Please re-install the Sablotron distribution > > Should I change this line: > > --with-xslt-sablot=/usr/local/sablot > > > to something else? To be more in line with where sablotron is actually > installed? > > Chris >
-- .: B i g D o g :.
attached mail follows:
It never ends. :( Ok, I finally got PHP compiled with XML support. Yay! However, when I went to restart apache (I had PHP working previously w/o XML), I'm getting the following error:
Cannot load /usr/local/apache/libexec/libphp4.so into server: /usr/lib/libxsltbr eakpoint.so.1: shared object not open
Has anyone ever come across this? What's the deal with apache and libxsltbr? I did some searches on Yahoo and PHPBuilder, but they yielded nothing.
Chris
attached mail follows:
I had to patch the Sablotron libraries and php to get it to compile with xslt on Linux and php 4.2.3
see this thread: http://marc.theaimsgroup.com/?l=php-general&m=102994073520406&w=2
.: B i g D o g :. wrote:
>Because of how the makefile is set up...i looks in certain >directories... > >On Mon, 2002-10-21 at 13:43, Chris Boget wrote: > > >>>--with-dom=/usr >>>--with-expat-dir=/usr >>>--with-dom-xslt=/usr >>> >>> >>Why /usr and not /usr/lib. The latter is where they are installed... >> >> >> >>>--with-xslt-sablot=/usr/local/sablot >>> >>> >>Also, sablotron isn't installed in the above directory. It's installed in >>/usr/lib. This is what I get when I run rpm -ql sablotron-0.96-1 >> >>/usr/bin/sabcmd >>/usr/lib/libsablot.so.0 >>/usr/lib/libsablot.so.0.96.0 >>/usr/share/doc/sablotron-0.96 >>/usr/share/doc/sablotron-0.96/README >>/usr/share/doc/sablotron-0.96/RELEASE >>/usr/share/doc/sablotron-0.96/sabcmd.1 >> >> >>In any case, what you suggested got me much farther than I've ever been >>before. >>However, now I'm getting this: >> >>checking for XSLT Sablotron backend... yes >>checking libexpat dir for Sablotron XSL support... yes >> >>all good so far, but: >> >>checking for Sablotron libraries in the default path... configure: error: not fo >>und. Please re-install the Sablotron distribution >> >>Should I change this line: >> >>--with-xslt-sablot=/usr/local/sablot >> >> >>to something else? To be more in line with where sablotron is actually >>installed? >> >>Chris >> >> >>
attached mail follows:
I am going to have to apologize - I forgot to update this post. I am using informix, and I was under the impression that if informix was running on another server I could not use the native informix connectivity. however, I have seen gotten the native informix connectivity to work.
Thanks,
Jeff
"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
news:3DB3E325.6060109
webglobe.sk...
> What does the error say? Did you test odbc_connect, odbc_prepare, or
> odbc_exec(ute) was successfull? What says odbc_errormsg?
>
> Jeff Bluemel wrote:
>
> >I recompiled php 4.2.3 using (copied from phpinfo()) '--with-unixODBC' .
> >However, I am able to use some of the odbc functions like odbc_connect or
> >odbc_pconnect, odbc_num_rows.
> >
> >however, some factions like odbc_fetch_array give me errors. it believe
> >it's missing some components, but I'm not sure what components.
> >
> >Jeff
> >
> >
> >
> >
> >
>
attached mail follows:
Hi all!
Does anyone know where can i find some information about displaying flash from a db?
I'm breaking my head over it, searching at newsgroups, searching at the net, addressing newsgroups but still nothing! Help b4 im cutting my hands off!!!!!!!
With hopes to be saved :P Yonatan Ben-Nes
attached mail follows:
Well how exactly are you using this DB? Are you using a 'blob' type format to actually write the flash binary to the database, or are you using it to keep track of where it is in the filesystem?
-J
Yonatan Ben-Nes wrote:
> Hi all! > > Does anyone know where can i find some information about displaying > flash from a db? > > I'm breaking my head over it, searching at newsgroups, searching at > the net, addressing newsgroups but still nothing! > Help b4 im cutting my hands off!!!!!!! > > > With hopes to be saved :P > Yonatan Ben-Nes >
attached mail follows:
I am in need of fresh eyes and brains. :)
I have a database full of products. The client needs to be able to update the products in the database, so I set up a maintenance area for them to do so. They are able to view the product details, edit the details, and then submit the changes. All very standard, in a form, using php and mysql.
And it was working fine, or so I thought, until recently.
The client was doing a whole batch of updates... and it seems that the query works for some items and not for others. For instance, I have a category called "Auto and Garage", and of the 7 items in that category, only 1 is updatable. In the "For the Birds" category, 12 of the 20 items are updatable. It is always the same items that fail.
The page that does the editing is called edit_product.php, and the query looks like this:
mysql_query("UPDATE products SET prod_name='$prod_name', prod_sku='$prod_sku', prod_price='$prod_price', prod_sdesc='$prod_sdesc', prod_ldesc='$prod_ldesc', prod_cat='$prod_cat', itemnum='$itemnum', assoc='$assoc', best_seller='$best_seller' where ID = '$prod_ID'");
To test, I've added lines that echo each of those values, including $prod_ID, which is the most important. (When I went to debug, I noticed that $prod_ID was not in quotes, and then I added the quotes, but it still doesn't work... I always forget the proper quoting convention.) And they all echo just fine. It's trying to update the product with ID of 12, for instance, and it echoes "12" for $prod_ID, and it seems like it has all the right values... but the database ain't getting updated. Looking at the ID numbers, and the rest of the field values, I can't see any pattern. (I was hoping to find a problem with the items that had quotes, or that started with the number "1", or some such... but no luck so far.)
Now, is it obvious to everyone what I'm overlooking here? Can anyone tell me what else to do to try to debug this?
Eternal thanks in advance, Jen
attached mail follows:
One thing I've noticed in the new version of PHP is it's not to be exact. It's also nice to put your SQL in it's own varible. Taking what you have, I'd put this:
$sql = "UPDATE products SET prod_name='$prod_name', prod_sku='$prod_sku', prod_price='$prod_price', prod_sdesc='$prod_sdesc', prod_ldesc='$prod_ldesc', prod_cat='$prod_cat', itemnum='$itemnum', assoc='$assoc', best_seller='$best_seller' where ID = '$prod_ID'"; $conn = **YOUR DATABASE CONNECTION** $query = mysql_query($sql, $conn); if(!$query) { echo "Error running query<br>".mysql_error();
Hope that helps!
Thanks, Stephen Craton http://www.melchior.us
----- Original Message -----
From: "Jennifer Swofford" <jen
littleduck.com>
To: <php-general
lists.php.net>
Sent: Monday, October 21, 2002 4:05 PM
Subject: [PHP] query problem
I am in need of fresh eyes and brains. :)
I have a database full of products. The client needs to be able to update the products in the database, so I set up a maintenance area for them to do so. They are able to view the product details, edit the details, and then submit the changes. All very standard, in a form, using php and mysql.
And it was working fine, or so I thought, until recently.
The client was doing a whole batch of updates... and it seems that the query works for some items and not for others. For instance, I have a category called "Auto and Garage", and of the 7 items in that category, only 1 is updatable. In the "For the Birds" category, 12 of the 20 items are updatable. It is always the same items that fail.
The page that does the editing is called edit_product.php, and the query looks like this:
mysql_query("UPDATE products SET prod_name='$prod_name', prod_sku='$prod_sku', prod_price='$prod_price', prod_sdesc='$prod_sdesc', prod_ldesc='$prod_ldesc', prod_cat='$prod_cat', itemnum='$itemnum', assoc='$assoc', best_seller='$best_seller' where ID = '$prod_ID'");
To test, I've added lines that echo each of those values, including $prod_ID , which is the most important. (When I went to debug, I noticed that $prod_ID was not in quotes, and then I added the quotes, but it still doesn't work... I always forget the proper quoting convention.) And they all echo just fine. It's trying to update the product with ID of 12, for instance, and it echoes "12" for $prod_ID, and it seems like it has all the right values... but the database ain't getting updated. Looking at the ID numbers, and the rest of the field values, I can't see any pattern. (I was hoping to find a problem with the items that had quotes, or that started with the number "1", or some such... but no luck so far.)
Now, is it obvious to everyone what I'm overlooking here? Can anyone tell me what else to do to try to debug this?
Eternal thanks in advance, Jen
attached mail follows:
On Mon, Oct 21, 2002 at 04:05:06PM -0500, Jennifer Swofford wrote: > The client was doing a whole batch of updates... and it seems that the > query works for some items and not for others. For instance, I have a > category called "Auto and Garage", and of the 7 items in that category, > only 1 is updatable. In the "For the Birds" category, 12 of the 20 > items are updatable. It is always the same items that fail.
Make sure these fields don't have any special characters in them, either at the database level, shell level, or html level. Proper quoting/encoding is essential for things like this to work. Also, make sure you are not passing GET or POST data with imbeded spaces as part of the query, as the URL will break.
See urlencode in the php manual.
Tim
-- Tim Sailer <sailerbnl.gov> Application Services Information Technology Division Brookhaven National Laboratory (631) 344-3001
attached mail follows:
Try to update one of the items which fail directly in the database. Maybe that will help you to see if there's a mistake on your query. Be careful with ' (single quote) in the middle of a value and stuff like that.
Good Luck.
"Jennifer Swofford" <jen
littleduck.com> escribió en el mensaje
news:005801c27945$892f7bd0$4663f90c
newdell...
I am in need of fresh eyes and brains. :)
I have a database full of products. The client needs to be able to update the products in the database, so I set up a maintenance area for them to do so. They are able to view the product details, edit the details, and then submit the changes. All very standard, in a form, using php and mysql.
And it was working fine, or so I thought, until recently.
The client was doing a whole batch of updates... and it seems that the query works for some items and not for others. For instance, I have a category called "Auto and Garage", and of the 7 items in that category, only 1 is updatable. In the "For the Birds" category, 12 of the 20 items are updatable. It is always the same items that fail.
The page that does the editing is called edit_product.php, and the query looks like this:
mysql_query("UPDATE products SET prod_name='$prod_name', prod_sku='$prod_sku', prod_price='$prod_price', prod_sdesc='$prod_sdesc', prod_ldesc='$prod_ldesc', prod_cat='$prod_cat', itemnum='$itemnum', assoc='$assoc', best_seller='$best_seller' where ID = '$prod_ID'");
To test, I've added lines that echo each of those values, including $prod_ID, which is the most important. (When I went to debug, I noticed that $prod_ID was not in quotes, and then I added the quotes, but it still doesn't work... I always forget the proper quoting convention.) And they all echo just fine. It's trying to update the product with ID of 12, for instance, and it echoes "12" for $prod_ID, and it seems like it has all the right values... but the database ain't getting updated. Looking at the ID numbers, and the rest of the field values, I can't see any pattern. (I was hoping to find a problem with the items that had quotes, or that started with the number "1", or some such... but no luck so far.)
Now, is it obvious to everyone what I'm overlooking here? Can anyone tell me what else to do to try to debug this?
Eternal thanks in advance, Jen
attached mail follows:
Thanks to Tim, Stephen, and Sarah. It did turn out to be an issue with quotes after all. Single quotes in particular. ;) I went and got meticulous with my urlencode/urldecode-ing. Phew!!!
Jen
> On Mon, Oct 21, 2002 at 04:05:06PM -0500, Jennifer Swofford wrote: > > The client was doing a whole batch of updates... and it seems that the > > query works for some items and not for others. For instance, I have a > > category called "Auto and Garage", and of the 7 items in that category, > > only 1 is updatable. In the "For the Birds" category, 12 of the 20 > > items are updatable. It is always the same items that fail. > > Make sure these fields don't have any special characters in them, > either at the database level, shell level, or html level. Proper > quoting/encoding is essential for things like this to work. > Also, make sure you are not passing GET or POST data with imbeded > spaces as part of the query, as the URL will break. > > See urlencode in the php manual. > > Tim
attached mail follows:
On Mon, Oct 21, 2002 at 07:53:24PM -0500, Jennifer Swofford wrote: > Thanks to Tim, Stephen, and Sarah. It did turn out to be an issue with > quotes after all. Single quotes in particular. ;) I went and got > meticulous with my urlencode/urldecode-ing. Phew!!!
Yeah, it's a pain, but you have to be very careful. I did the php backend for the nsiinnovations and nsitoys web sites, and they insisted on having descriptions with '&', '*' amd '!' in them. Talk about encoding mangling! I'm glad I only had to do that one time!
Tim
-- Tim Sailer <sailerbnl.gov> Application Services Information Technology Division Brookhaven National Laboratory (631) 344-3001
attached mail follows:
Is it possible to save a session for say a year? The manual seems to be telling me that if you change the session expire time, it is still only good for that instance of the browser, so as soon as you close the browser, the session is lost no matter what the expire time. Is this correct? I need to use cookies to save any session data longer right?
The other question, assuming I am correct, is why don't they allow you to save sessions independent of browser like you can cookies?
attached mail follows:
You might want to look into using cookies instead of sessions maybe use the cookies with your session...
On Mon, 2002-10-21 at 15:25, PHP List wrote: > Is it possible to save a session for say a year? > The manual seems to be telling me that if you change the session expire time, it is still only good for that instance of the browser, so as soon as you close the browser, the session is lost no matter what the expire time. > Is this correct? > I need to use cookies to save any session data longer right? > > The other question, assuming I am correct, is why don't they allow you to save sessions independent of browser like you can cookies?
-- .: B i g D o g :.
attached mail follows:
I have recently moved one php app from one server to another, it is working fine on one system but has thrown up several errors on the new one. I am convinced that it is a simple fault but I just can't see it.
These are the errors I get:
--------------------------------------------------------------------------------
Notice: Undefined variable: articleId in C:\phpweb\submitnews.php on line 27
Notice: Undefined variable: title in C:\phpweb\submitnews.php on line 27
Notice: Undefined variable: content in C:\phpweb\submitnews.php on line 27 Article Uploaded: Notice: Undefined variable: title in C:\phpweb\submitnews.php on line 31
This is the submitnews.php script:
<html> <body> <title> Add Item to Testhouse Databases</title> <style>
body { color:#000000; font-family: Verdana; font-size:9pt } th { color:#FFFFFF; font-family: Verdana; font-size:9pt } td { color:#000000; font-family: Verdana; font-size:8pt } a { color:#000000; font-family: Verdana; font-size:8pt; font-weight: bold; }
</style> <img src="testhouse.gif">
</head> <body bgcolor="#C2D7EA">
<h2>Results:-</h2> <hr noshade size="1" color="#20158F"> <?php
mysql_connect ("localhost");
mysql_select_db ("content");
mysql_query("INSERT INTO articles(articleId, title, content) VALUES ('$articleId', '$title', '$content')");
print("Article Uploaded:"); print($title); print("<p>");
?> </body> </html>
What is strange is that an articleID is actually added but nothing else even though it says that articleId is undefined.
This the form script where the data is added from:
<html> <head> <title> Upload a News Article </title> </head> <body bgcolor="#FFFFFF"> <a href="http://www.testhouse.org.uk"> <img border="0" src="testhouse.gif"> </a>
<form action="submitnews.php" name="post"> <input type="hidden" name="articleId" value="NOT NULL">
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#111111" width="100%">
<tr> <td width="100%" bgcolor="#999999" height="22" colspan="2"> <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> Upload a News Article</font></b></td>
</tr>
<tr> <td width="100%" bgcolor="#FFE300" height="22" colspan="2"> <br> <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> </font></b></td>
</tr>
<tr> <td width="15%" bgcolor="#FFE300"> <p style="margin-left: 10"><font face="Verdana" size="2"> Article Title:</font></td> <td width="85%" bgcolor="#FFE300"> <input type="text" name="title" size="20" maxlength="20"></td> </tr>
<tr> <td width="100%" bgcolor="#FFE300" height="22" colspan="2"> <br> <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> </font></b></td>
</tr>
<tr> <td width="15%" bgcolor="#FFE300"> <p style="margin-left: 10"><font face="Verdana" size="2"> Article Body:</font></td> <td width="85%" bgcolor="#FFE300"> <textarea name ="content" rows=16 cols=60 input type="text" name="content"></textarea></td> </tr>
<tr> <td width="15%" bgcolor="#FFE300"> <p style="margin-left: 10"><font face="Verdana" size="2"> </font></td> <td width="85%" bgcolor="#FFE300"> <br> <input type="submit" name="submit" value="Publish"></td> </tr>
<tr> <td width="100%" bgcolor="#FFE300" height="22" colspan="2"> <br> <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> </font></b></td> </tr>
<tr> <td width="100%" bgcolor="#999999" height="22" colspan="2"> <br> <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> </font></b></td>
</tr>
</table> </form>
</body> </html>
Thanks in advance for any help or direction.
attached mail follows:
my hunch, register_globals is turned on in one, and off in the other in the php.ini file. Plenty of documentation about this change between versions online
php.net, and also in the archives.
-Brad
php
erars.demon.co.uk wrote:
> I have recently moved one php app from one server to another, it is working fine on one system but has thrown up several errors on the new one. I am convinced that it is a simple fault but I just can't see it. > > These are the errors I get: > > -------------------------------------------------------------------------------- > > Notice: Undefined variable: articleId in C:\phpweb\submitnews.php on line 27 > > Notice: Undefined variable: title in C:\phpweb\submitnews.php on line 27 > > Notice: Undefined variable: content in C:\phpweb\submitnews.php on line 27 > Article Uploaded: > Notice: Undefined variable: title in C:\phpweb\submitnews.php on line 31 > > This is the submitnews.php script: > > <html> > <body> > <title> Add Item to Testhouse Databases</title> > <style> > > body { color:#000000; font-family: Verdana; font-size:9pt } > th { color:#FFFFFF; font-family: Verdana; font-size:9pt } > td { color:#000000; font-family: Verdana; font-size:8pt } > a { color:#000000; font-family: Verdana; font-size:8pt; font-weight: bold; } > > </style> > <img src="testhouse.gif"> > > </head> > <body bgcolor="#C2D7EA"> > > <h2>Results:-</h2> > <hr noshade size="1" color="#20158F"> > <?php > > mysql_connect ("localhost"); > > mysql_select_db ("content"); > > mysql_query("INSERT INTO articles(articleId, title, content) > VALUES ('$articleId', '$title', '$content')"); > > print("Article Uploaded:"); > print($title); > print("<p>"); > > ?> > </body> > </html> > > What is strange is that an articleID is actually added but nothing else even though it says that articleId is undefined. > > This the form script where the data is added from: > > <html> > <head> > <title> Upload a News Article </title> > </head> > <body bgcolor="#FFFFFF"> > <a href="http://www.testhouse.org.uk"> > <img border="0" src="testhouse.gif"> > </a> > > <form action="submitnews.php" name="post"> > <input type="hidden" name="articleId" value="NOT NULL"> > > <table border="0" cellpadding="0" cellspacing="0" bordercolor="#111111" width="100%"> > > <tr> > <td width="100%" bgcolor="#999999" height="22" colspan="2"> > <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> > Upload a News Article</font></b></td> > > </tr> > > <tr> > <td width="100%" bgcolor="#FFE300" height="22" colspan="2"> > <br> > <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> > </font></b></td> > > </tr> > > <tr> > <td width="15%" bgcolor="#FFE300"> > <p style="margin-left: 10"><font face="Verdana" size="2"> > Article Title:</font></td> > <td width="85%" bgcolor="#FFE300"> > <input type="text" name="title" size="20" maxlength="20"></td> > </tr> > > <tr> > <td width="100%" bgcolor="#FFE300" height="22" colspan="2"> > <br> > <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> > </font></b></td> > > </tr> > > > <tr> > <td width="15%" bgcolor="#FFE300"> > <p style="margin-left: 10"><font face="Verdana" size="2"> > Article Body:</font></td> > <td width="85%" bgcolor="#FFE300"> > <textarea name ="content" rows=16 cols=60 input type="text" name="content"></textarea></td> > </tr> > > > <tr> > <td width="15%" bgcolor="#FFE300"> > <p style="margin-left: 10"><font face="Verdana" size="2"> > </font></td> > <td width="85%" bgcolor="#FFE300"> > <br> > <input type="submit" name="submit" value="Publish"></td> > </tr> > > <tr> > <td width="100%" bgcolor="#FFE300" height="22" colspan="2"> > <br> > <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> > </font></b></td> > </tr> > > <tr> > <td width="100%" bgcolor="#999999" height="22" colspan="2"> > <br> > <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> > </font></b></td> > > </tr> > > </table> > </form> > > </body> > </html> > > Thanks in advance for any help or direction. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
does anyone of any good gettext tutorials or something like that? or just anywhere where I