|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Sat Jul 06 2002 - 12:15:28 CDT
php-general Digest 6 Jul 2002 17:15:28 -0000 Issue 1448
Topics (messages 105805 through 105871):
Re: Cannot enable extensions. Why?
105805 by: Alberto Serra
Re: I am probably dumb but why isn't this inserting stuff into my DB?
105806 by: JJ Harrison
Re: Going Nuts with Ereg/Eregi - thanks
105807 by: Patrick Teague
Re: png image doesn't show
105808 by: hugh danaher
105823 by: Richard Lynch
105838 by: hugh danaher
Re: opening pdf file in new window with a POST operation
105809 by: Pete James
Re: [PHP-GTK] Cannot enable extensions. Why?
105810 by: George Hester
105812 by: Steph
Re: Detecting Browser Type/OS from HTTP_USER_AGENT
105811 by: Patrick Teague
Re: Sort with PHP or SQL?
105813 by: Patrick Teague
105837 by: Alberto Serra
105841 by: Miguel Cruz
105854 by: Pekka Saarinen
105855 by: Pekka Saarinen
105859 by: Alberto Serra
Re: Stack Overflow with: zend optimizer
105814 by: Richard Lynch
Re: Uninitialized string offset
105815 by: Richard Lynch
Re: MySQL news database structure
105816 by: Richard Lynch
Re: includes question
105817 by: Richard Lynch
Re: HTTPS vs. HTTP ?
105818 by: Richard Lynch
105819 by: Richard Lynch
105836 by: Richard Lynch
105840 by: Miguel Cruz
105865 by: Chris Shiflett
105867 by: Chris Shiflett
Re: Print Question
105820 by: Richard Lynch
Re: how to resort results of a query
105821 by: Richard Lynch
Re: include errors
105822 by: Richard Lynch
Re: PHP Automatic Backup
105824 by: Richard Lynch
105842 by: César Aracena
Re: How to use transparent png in createfrompng?
105825 by: Richard Lynch
Re: Little optimisation question
105826 by: Richard Lynch
Re: $_SESSION troubles
105827 by: Richard Lynch
Re: textarea new line
105828 by: Richard Lynch
Re: Maybe not the right place, but...
105829 by: Richard Lynch
Re: help with session_decode in PHP 4.20 (fairly urgent)
105830 by: Richard Lynch
Re: ./configure with register_globals turned on?
105831 by: Richard Lynch
Re: Session not expiring
105832 by: Richard Lynch
Re: Scheduling tasks
105833 by: Richard Lynch
Re: Stored Procedures
105834 by: Richard Lynch
105864 by: James Drabb
Re: total (slightly OT)
105835 by: Richard Lynch
Re: help with eval problems...
105839 by: Paul Roberts
Brand New Enviroment
105843 by: César Aracena
Sockets & 'requested address is not valid in its context'
105844 by: Zac Hillier
How to copy a transparent png over an existing image using GD?
105845 by: Victor Spång Arthursson
105860 by: Rasmus Lerdorf
Charset/language request headers
105846 by: Alberto Serra
session problem
105847 by: Naintara Jain
105849 by: Naintara Jain
105851 by: B.C. Lance
Charset/language request headers. Yes, it's true :(
105848 by: Alberto Serra
Making sessions last longer?
105850 by: Leif K-Brooks
mail help, and php.ini help.
105852 by: Greg Scotts
105857 by: Alberto Serra
help help help!!!!!!pls........
105853 by: Balaji Ankem
105858 by: Alberto Serra
Re: Survey: MySQL vs PostgreSQL for PHP
105856 by: Ilia A.
105866 by: Devrim GUNDUZ
Thanks
105861 by: Skyhawk
Figuring Out the Best Day in stats program
105862 by: JJ Harrison
Compiling PHP
105863 by: Leon Mergen
phpBB Info
105868 by: BrettM
PHP 4 broken after Apache upgrade
105869 by: Chris Garaffa
105870 by: Devrim GUNDUZ
105871 by: Chris Allen
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:
ðÒÉ×ÅÔ!
Miguel Cruz wrote:
> I can't believe it! I totally forgot it was Ivan Kupala Day!
Now that's too bad :)) You missed a great chance to party :))) Well,
just as much as I did... :(
BTW, I better not say anything about Unix anymore... as soon as I sent
that mail Mysql died :(( Looks like Old Ivan's soul is quite unhappy
about me doing my work here while his party goes on... Or maybe he is on
the Microsoft paylist... The devil knows it, as they say here :)))
ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×
--
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
![]()
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
I followed that part.
I just have magic_quotes on so I don't need to use addslashes/stripslashes
-- JJ Harrison webmastertececo.com www.tececo.com
"Julie Meloni" <julie
thickbook.com> wrote in message news:60865231.20020705203115
thickbook.com... > > JH> I have magic_quotes on though so useless lecture thanks for the advice > > Having magic_quotes on doesn't preclude your query from being invalid. > You should still: > > JH> "Miguel Cruz" <mnc
stoic.net> wrote in message: > >> 1) print out $query and try it yourself at the mysql command line. > >> > >> 2) print mysql_error(). > > Any time a query fails. > > > - Julie > > --> Julie Meloni > --> julie
thickbook.com > --> www.thickbook.com > > Find "Sams Teach Yourself MySQL in 24 Hours" at > http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 >
attached mail follows:
Woohoo! it works great now :)
Thanks much!
Patrick
----- Original Message -----
From: "Analysis & Solutions" <danielc
analysisandsolutions.com>
To: "PHP List" <php-general
lists.php.net>
Sent: Tuesday, July 02, 2002 9:19 AM
Subject: Re: [PHP] Going Nuts with Ereg/Eregi
> On Tue, Jul 02, 2002 at 05:26:45AM -0500, Patrick Teague wrote: > > > > $eregi_str = "(\; |\()Win[ \.a-z0-9]*(\)|\;)"; > > $eregi_str = "(Windows|Win[^d])[^;]+"; > > > if( eregi( $eregi_str, $browser_string, $arrstring ) ) > > { > > $browser_os = $arrstring[0]; > > } > > > > This works fine except on some browsers which like to return Windows > > multiple times such as this - > > > > "Mozilla/5.0 (Windows; U; Win98; en-US;........" > > > > Knowing that it's Windows doesn't help, I need to know it's Win98, etc. > > --Dan > > -- > PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
Joakim (and James too) Thank you for your suggestion regarding the header. The php page does have a header but in playing around with things I did get it to generate an error message along with the "image missing X" the message is:
Warning: Failed opening 'var/www/html/stocks/dev/graphit2.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site201/fst/var/www/html/stocks/dev/pg3a.php on line 140
So, it appears I have work to do on figuring out the path. Again, any help will ge greatly appreciated.
----- Original Message -----
From: <joakim.andersson
cybercom.se>
To: <php-general
lists.php.net>
Sent: Friday, July 05, 2002 3:52 AM
Subject: RE: [PHP] png image doesn't show
> Hi,
>
> Do you output the right headers before you output the imagestream?
> Header("Content-type: image/png");
>
> If this doesn't help you have to post your code (graphit.php) here so we
can
> look at it.
>
> /Joakim
>
> > -----Original Message-----
> > From: hugh danaher [mailto:hdanaher
earthlink.net]
> > Sent: Friday, July 05, 2002 10:05 AM
> > To: php
> > Subject: [PHP] png image doesn't show
> >
> >
> > Hello all,
> >
> > I have been trying to modify the working of one of my pages
> > which prints a png graph. What I had was an included file
> > named "graphit.php" which creates a png file. I used the function
> > imagepng($image,'temp.png') to create an image and then used
> > <img src=temp.png> to have the image printed on the page.
> > This worked well enough when only one user (me) was using the
> > page, but I want more. In reading the imagepng() info in the
> > manual, it states that I can output the raw image stream to
> > the browser by leaving off the file name option. I've done
> > this, but get nada! How should this be done?
> > One of the notes (and it's in German) implies that I can call
> > "graphit.php" using something like
> >
> > <img src=graphit.php> to get the image output.
> > Unfortunately, I get nothing except the red X indicating a
> > missing image.
> >
> > Any and all help is greatly appreciated.
> >
> > Hugh
> >
> >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
>Hello all, > >I have been trying to modify the working of one of my pages which prints a >png graph. What I had was an included file named "graphit.php" which >creates a png file. I used the function >imagepng($image,'temp.png') to create an image and then used <img >src=temp.png> to have the image printed on the page. This worked well >enough when only one user (me) was using the page, but I want more. In >reading the imagepng() info in the manual, it states that I can output the >raw image stream to the browser by leaving off the file name option. I've >done this, but get nada! How should this be done? >One of the notes (and it's in German) implies that I can call "graphit.php" >using something like > ><img src=graphit.php> to get the image output. Unfortunately, I get >nothing except the red X indicating a missing image. > >Any and all help is greatly appreciated.
Tips:
1. Change graphit.php to have the header("Content-type: image/png") line at the *END* of the script, right before you do imagepng($image)
2. Surf directly to graphit.php, and not the page with <IMG SRC=graphit.php> in it.
At this point, you'll probably find some PHP error messages from graphit.php -- They don't look anything like a PNG image, so the browser can't display them :-)
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
Thanks Richard,
I changed from using <img src=graphit2.php> to <a
href=graphit2.php>graph</a> and now get my graph, on a page of its own,
without any error messages. Works just fine, or will, when I change how it
gets its data. However, I do want to have the graph display on a page with
other information so I'm back to wanting to use some sort of image tag. Any
suggestions?
Hugh
----- Original Message -----
From: "Richard Lynch" <rich
phpbootcamp.com>
To: <php-general
lists.php.net>
Sent: Friday, July 05, 2002 9:59 PM
Subject: [PHP] Re: png image doesn't show
> >Hello all, > > > >I have been trying to modify the working of one of my pages which prints a > >png graph. What I had was an included file named "graphit.php" which > >creates a png file. I used the function > >imagepng($image,'temp.png') to create an image and then used <img > >src=temp.png> to have the image printed on the page. This worked well > >enough when only one user (me) was using the page, but I want more. In > >reading the imagepng() info in the manual, it states that I can output the > >raw image stream to the browser by leaving off the file name option. I've > >done this, but get nada! How should this be done? > >One of the notes (and it's in German) implies that I can call "graphit.php" > >using something like > > > ><img src=graphit.php> to get the image output. Unfortunately, I get > >nothing except the red X indicating a missing image. > > > >Any and all help is greatly appreciated. > > Tips: > > 1. Change graphit.php to have the header("Content-type: image/png") line at > the *END* of the script, right before you do imagepng($image) > > 2. Surf directly to graphit.php, and not the page with <IMG SRC=graphit.php> > in it. > > At this point, you'll probably find some PHP error messages from graphit.php > -- They don't look anything like a PNG image, so the browser can't display > them :-) > > > > -- > Like Music? http://l-i-e.com/artists.htm > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Thank you, Richard. I think I understand now... I experienced this HTML behavior when trying to "debug" this problem, but figured it had little to do with the problem. HTML coming up in that page (even the pdf, as garble) was not producing a warning... Now I understand.
One last question, though... why doesn't it happen with GET?
BTW... I think I found a solution to this. Using <EMBED> I can send HTML (which it wants), _and_ display the PDF (which I want)! I guess we shall see...
Thank you so much for taking the time to answer.
Pete.
Richard Lynch wrote: > > >> >The GET method form works fine, while the POST method (which is what I > >> >need to use) pops up a message about the page containing both secure and > >> >nonsecure data. > >> > > >> >WTF? > >> > >> Well, the new browser window opens, but you're loading a PDF, not HTML, so > >> it's not really getting any data at all. The data it's not getting isn't > >> secure, by definition, since there's nothing there. > > > >I'm not sure that I understand what you're saying here... I'm loading a php > >file, that is creating the pdf on-the-fly. This php file is the one > >receiving the POST data, not the window - or do I not understand? > > Here is how HTTP usually works: > > 1. Browser requests URL, possibly in new window. > 2. Server sends content > 3. Browser displays content > > However, with a PDF, you have: > > 1. Browser requests URL, definitely in a new window > 2. Server sends content, which happens to be a PDF file. > 2a. Server does not send an HTML page > 3. Browser has opened a new browser window, which is supposed to display an > HTML page. > 3a. Browser gets a PDF, which requires that it fire up a different > application to view > 3b. Browser has this nifty browser window, with no HTML to put into it, and > it was supposed to get securely-delivered HTML, and it's pissed off you > never securely-delivered the HTML you "promised" in 2. and didn't send in > 2a. :-) > > >BTW... This example is not how the application works. It's just a test that > >I used to narrow down the problem, and recreate in a controlled situation. > >The real application needs to have the pdf file pop up in a separate window > >using POST vars, which, in the application, is done using Javascript - but I > >digress... > > Here's your fundamental problem: > > By definition, the PDF file isn't supposed to be in a browser window *AT* > *ALL*. > > Yes, some funky-ass plug-in hacks will allow a PDF to be embedded inside of > a browser window, but that's an add-on hack, long, long after HTTP protocol > was defined. > > You've *TOLD* the browser to open up a new HTML window, and you've told it > to expect some HTML sent securely, but the server isn't *sending* any HTML > data *AT* *ALL* -- Just PDF data, which is going somewhere else. > > So, the *browser* sees this HTML window, you opened up, and it ain't got no > secure HTML sent to it. Nothing. Nada. Zip. > > Again I say, GET RID OF THE TARGET="_blank" > > That's as close as you're going to get to having a new window with a PDF in > it, for most surfers. > > >How is the POST data not 'secure' but the GET data is? How is it not secure > >'by definition'? There's nothing where? Please expand. > > The server didn't send any HTML. There is no HTML to secure. If there's > nothing there, nothing sent, it's rather difficult to send it securely. > > The PDF got sent, but that's not HTML, and it can't be displayed in the > browser window, so the browser window never got nothing. But it was told, > in advance, to expect some secure HTML. That secure HTML never arrived. No > HTML arrived. Only PDF arrived. > > I think I need a picture/diagram and slow-motion animation to 'splain this > properly... > > Try to imagine this happening in slo-mo. > > Browser is told: > 1. Go get URL https://... > 2. Put the HTML from that URL in a new window, and be sure it's secure. > > Server responds with PDF file, which essentially tells browser: > 3. Go run the PDF application viewer thingie to view this data. > > Meanwhile, the browser has this HTML window, hanging around, waiting for > securely-delivered HTML to arrive... > > It's definitely a browser "bug" that you can't tell it to open up a new > window, for an HTTPS connection, and that content might not actually *be* > HTML, but there *might* be a plug-in that will handle it in that window. > Or, there might not be a plug-in, but so what? > > Unfortunately, that's not how the browsers are dealing with it, and I'm not > sure they *can* deal with it properly, since there might *NOT* be a plug-in, > so they might *not* get anything to put in that new window, so what are they > supposed to do? Display a blank secure window? > > I'm not saying it's not a bug. I'm saying it's not a PHP bug, and it's a > browser bug, and there's nothing you can do (unless you can convince both > Bill and the Mozilla guys to fix it tomorrow) and the *BEST* way to get get > kinda close to what you want is to lost the TARGET="_blank" > > It won't be a new window for people who did a PDF plug-in, but it will work > the right way for everybody else... > > That was the best solution I could come up with this for this issue when I > ran into it. > > Actually, you *MIGHT* be able to do this: > > 1. Force the new window to open up to some HTML page. > 2. That HTML page, with JavaScript or META HTTP-EQUIV=REFRESH could *maybe* > then suck down the PDF, and *maybe* you won't get that warning message... > > The crux of the problem is you are forcing a new browser window to open up, > which is expecting some securely-delivered HTML, but it never gets no HTML, > it just gets some PDF stuff, and it gets cranky about not getting the > securely-delivered HTML you "promised". > > I just told the boss he couldn't have what he wanted, and we had to lose the > pop-up window. But I hate pop-up windows anyway :-) > > -- > Like Music? http://l-i-e.com/artists.htm
attached mail follows:
Well thank you Jason. The gtk is now running. The last thing now is why I cannot uncomment the extensions in the C:\WINNT\php.ini in my PHP 4.2.1 installation. That issue still exists.
In this script
http://127.0.0.1/scripts/could.php
-------- could.php -----------
<html> <head> <title>From Newsgroup</title> <body> <?php $myvar = "Hello World1"; echo $myvar; print ("Hello World 2"); ?> <?php $myvar1 = "This is a test!"; echo $myvar1; ?> </body> </html> ------ End could.php ------------------
I get this:
Hello World1Hello World 2This is a test!
But if I uncomment php_w32api_dll in php.ini
I get this error before the page loads in a message box:
w32api: unable to initialize module Module compiled with module API=20010901, debug=0, thread-safety=1 PHP compiled with module API=20020429, debug=0, thread-safety=1 These options need to match.
and after the page loads:
X-Powered-By: PHP/4.2.1 Content-type: text/html; charset=iso-8859-1 Hello World1Hello World 2This is a test! PHP Warning: w32api: Unable to initialize module Module compiled with module API=20010901, debug=0, thread-safety=1 PHP compiled with module API=20020429, debug=0, thread-safety=1 These options need to match in Unknown on line 0
All the versions off all the files of all the downloads in all the folders of all that I know of are all what was directed to download from
Namely:
http://www.php.net/do_download.php?download_file=php-4.2.1-Win32.zip
But I first ran:
http://www.php.net/do_download.php?download_file=php-4.2.1-installer.exe
and then just poped in the components from the first link.
Trouble doing that?
Thanks again.
-- George Hester _________________________________ "Steph" <sfoxphp.net> wrote in message news:056301c224a8$a2800600$e09001d5
p2q4w7... > please follow the readme in the PHP-GTK download. You cannot mix the > dlls from separate builds and expect them to work, you should in fact be > keeping both versions of PHP completely separate if you're intending to > use a gui and web installation side by side. Both php.ini's will need > to be local to their respective version of php.exe. > > ----- Original Message ----- > From: "George Hester" <hesterloli
hotmail.com> > To: <php-general
lists.php.net>; <php-gtk-general
lists.php.net> > Sent: Saturday, July 06, 2002 3:37 AM > Subject: [PHP-GTK] Cannot enable extensions. Why? > > > > In Windows 2000 SP2 IIS 5 > > this statement works without issue: > > > > $myvar2 = strtoupper(substr(PHP_OS, 0, 3)) > > > > and myvar2 = WIN > > > > but this statement right after it: > > > > dl('php_gtk.dll'); > > > > leads to this error: > > > > Fatal error: Dynamically loaded extentions aren't enabled. in > > c:\inetpub\scripts\could.php on line 17 > > > > why? > > > > I have put php_gtk.dll in every damn directory I can think of. I've > put it in > > C:\PHP; I've put it in C:\PHP\extensions; I've put it in C:\WINNT; > I've put it > > in C:\WINNT\System32; The only place I haven't tried to put it is up > my... > > > > If I uncomment ANY of the extensions in php.ini I get this error: > > > > Say I uncomment win32api.dll: > > > > Then the above php script which worked just fine gives: > > > > w32api: unable to initialize module > > Module compiled with module API=20010901, debug=0, thread-safety=1 > > PHP compiled with module API=20020429, debug=0, thread-safety=1 > > These options need to match. > > > > Everything PHP is 4.2.1 the extensions are what they are calling > 4.2.1. > > > > What is going on with this PHP? Is it just lack of care on the part > of: > > > > http://www.php.net/ > > > > Thanks. > > > > > > -- > > George Hester > > _________________________________ > > > > > > > > -- > > PHP-GTK General Mailing List (http://gtk.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
Having just caught up with most of the threads on this thanks to MARC, can you please now explain why on earth you are insisting on loading PHP-GTK dynamically through a web server?
The results should be interesting to say the least ..
----- Original Message -----
From: "George Hester" <hesterloli
hotmail.com>
To: <php-general
lists.php.net>; <php-gtk-general
lists.php.net>
Sent: Saturday, July 06, 2002 5:49 AM
Subject: Re: [PHP-GTK] Cannot enable extensions. Why?
> Well thank you Jason. The gtk is now running. The last thing now is
why I
> cannot uncomment the extensions in the C:\WINNT\php.ini in my PHP
4.2.1
> installation. That issue still exists.
>
> In this script
>
> http://127.0.0.1/scripts/could.php
>
> -------- could.php -----------
>
> <html>
> <head>
> <title>From Newsgroup</title>
> <body>
> <?php
> $myvar = "Hello World1";
> echo $myvar;
> print ("Hello World 2");
> ?>
> <?php
> $myvar1 = "This is a test!";
> echo $myvar1;
> ?>
> </body>
> </html>
> ------ End could.php ------------------
>
> I get this:
>
> Hello World1Hello World 2This is a test!
>
> But if I uncomment php_w32api_dll in php.ini
>
> I get this error before the page loads in a message box:
>
> w32api: unable to initialize module
> Module compiled with module API=20010901, debug=0, thread-safety=1
> PHP compiled with module API=20020429, debug=0, thread-safety=1
> These options need to match.
>
> and after the page loads:
>
> X-Powered-By: PHP/4.2.1 Content-type: text/html; charset=iso-8859-1
Hello
> World1Hello World 2This is a test! PHP Warning: w32api: Unable to
initialize
> module Module compiled with module API=20010901, debug=0,
thread-safety=1 PHP
> compiled with module API=20020429, debug=0, thread-safety=1 These
options need
> to match in Unknown on line 0
>
> All the versions off all the files of all the downloads in all the
folders of
> all that I know of are all what was directed to download from
>
> http://www.php.net/
>
> Namely:
>
> http://www.php.net/do_download.php?download_file=php-4.2.1-Win32.zip
>
> But I first ran:
>
>
http://www.php.net/do_download.php?download_file=php-4.2.1-installer.exe
>
> and then just poped in the components from the first link.
>
> Trouble doing that?
>
> Thanks again.
>
> --
> George Hester
> _________________________________
> "Steph" <sfox
php.net> wrote in message
> news:056301c224a8$a2800600$e09001d5
p2q4w7...
> > please follow the readme in the PHP-GTK download. You cannot mix
the
> > dlls from separate builds and expect them to work, you should in
fact be
> > keeping both versions of PHP completely separate if you're intending
to
> > use a gui and web installation side by side. Both php.ini's will
need
> > to be local to their respective version of php.exe.
> >
> > ----- Original Message -----
> > From: "George Hester" <hesterloli
hotmail.com>
> > To: <php-general
lists.php.net>; <php-gtk-general
lists.php.net>
> > Sent: Saturday, July 06, 2002 3:37 AM
> > Subject: [PHP-GTK] Cannot enable extensions. Why?
> >
> >
> > > In Windows 2000 SP2 IIS 5
> > > this statement works without issue:
> > >
> > > $myvar2 = strtoupper(substr(PHP_OS, 0, 3))
> > >
> > > and myvar2 = WIN
> > >
> > > but this statement right after it:
> > >
> > > dl('php_gtk.dll');
> > >
> > > leads to this error:
> > >
> > > Fatal error: Dynamically loaded extentions aren't enabled. in
> > > c:\inetpub\scripts\could.php on line 17
> > >
> > > why?
>
attached mail follows:
Hey,
I ended up looking at using eregi to pull this information out of the original HTTP_USER_AGENT as this is more accurate than the extra info from browscap.ini. You have to list out all of the browsers & OSs. However, I'm having problems detecting the Amaya browser...
$browser_string = getenv(HTTP_USER_AGENT); ...... $eregi_str = "((\; |\()" . "(MSIE|IE|Netscape|Konqueror|Lynx|Links|Opera)|Gecko|Amaya)" . "[ \\\/\-\.a-z0-9]*(\)|\;|libwww)?"; if( eregi( $eregi_str, $browser_string, $arrstring ) ) { $browser_name = $arrstring[0]; $browser_name = eregi_replace( "(\;|\(|\))", "", $browser_name ); $browser_name = trim( $browser_name ); } else if( $browser->parent ) { $browser_name = $browser->parent; } else { $browser_name = "unknown"; }
Amaya displays as "amaya/V4.3.2 libwww/5.3.1" & when printing out $browser_name, it equals "amaya/V4.3.2 libwww/5.3.1"
I've thought of using - eregi_replace( "libwww[\/\.a-z0-9]*", "", $browser_name ); - but not sure if I really want to do it this way or not. Any suggestions?
Patrick
attached mail follows:
> *ANY* time you can sort/search in SQL, or you can do it in PHP, the SQL way > will be faster.
< and >
> Grouping and sorting is something databases specialize in.
Any suggestions on how to do this? Currently I have a table with Headers & another table with Pages... Should I create yet another table for Sub-Headers? The other thing I've thought of is putting everything in 1 table, but this seems slightly daunting. Here are the SQL statements I used to make the 2 tables I currently have -
CREATE TABLE Headers ( Header_ID INT NOT NULL AUTO_INCREMENT, Header VARCHAR(25), HeaderOrder INT NOT NULL, HeaderInfo TEXT, PRIMARY KEY(Header_ID));
CREATE TABLE Pages ( Page_ID INT NOT NULL AUTO_INCREMENT, PageTitle VARCHAR(25), Header_ID INT NOT NULL, PageOrder INT NOT NULL, PageContent TEXT, PRIMARY KEY(Page_ID));
& then my current sql statement for php -
$query = "SELECT * " . "FROM Headers LEFT JOIN Pages ON (Headers.Header_ID=Pages.Header_ID) " . "ORDER BY HeaderOrder DESC, Header, PageOrder DESC, PageTitle;";
Any ideas on optimizing this? DB stuff doesn't come near the top of things I'm good at :) The other problem is that any pages that end up having no Header "disappear", which is a good thing on the menu, but a bad thing on the admin pages when you're trying to connect all of them.
Patrick
attached mail follows:
ðÒÉ×ÅÔ!
> Any suggestions on how to do this?
Yes,
1) *DO* look around and find yourself some text about normalization. I mean, paper. Something you can hold in your hands without rushing to try-and-code it. Then get yourself a sigarette (if you are a smoker) and spend two hours of your life making sure you perfectly understand what data modeling is like. If you miss this step there is almost nothing that people can do to help you.
2) Look for a list that specializes in data-modeling. That's definitely OT here. Not that I don't want to talk about it, but reading this list will not give you much in that direction.
> Any ideas on optimizing this? DB stuff doesn't come near the top of things > I'm good at :)
> The other problem is that any pages that end up having no > Header "disappear", which is a good thing on the menu, but a bad thing on > the admin pages when you're trying to connect all of them.
See point 1).
ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
--
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
![]()
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
On Sat, 6 Jul 2002, Patrick Teague wrote: > $query = "SELECT * " . > "FROM Headers LEFT JOIN Pages ON (Headers.Header_ID=Pages.Header_ID) " . > "ORDER BY HeaderOrder DESC, Header, PageOrder DESC, PageTitle;"; > > Any ideas on optimizing this? DB stuff doesn't come near the top of things > I'm good at :) The other problem is that any pages that end up having no > Header "disappear", which is a good thing on the menu, but a bad thing on > the admin pages when you're trying to connect all of them.
SELECT from pages and use LEFT OUTER JOIN if you want to include pages with no header.
miguel
attached mail follows:
At 7/5/2002, you wrote: > >I'm working on a way to pull menus/pages from a database. Currently I have > >this working on 2 levels - Topic headers & actual page titles - & it prints > >it out fairly nice & doesn't take long to load. What I need to do is add a > >level between the 2, a sub-header. > > > >I'm running both the apache server & mysql server on the same linux box as > >the current load isn't very high. I'm wondering whether it would be > >better/easier to Load all the topic headers into an array, then any possible > >sub-headers into a 2nd array, then the pages into a 3rd array (or even into > >a multidimensional array?). Then go through the arrays & match the pages. > >Or would it be easier to write 1 huge SQL statement & have the SQL server > >run the whole query? > >*ANY* time you can sort/search in SQL, or you can do it in PHP, the SQL way >will be faster. > >I'm sure there's an exception to this rule, but I've never seen it :-)
Hi,
I have here a beta of my gallery software (normalized to fourth normal form and good use of indexes) where I did a user-selectable limit where you decide if pagination and sorting (SORT BY and ORDER by) are done by PHP or by MySQL.
Especially ORDER BY is quite slow compared to other SQL commands and optimizing it may not always be easy: http://www.mysql.com/doc/O/R/ORDER_BY_optimisation.html
In Apache/MySQL under Windows XP the difference is small result sets is quite big (e.g. 0.07s vs. 0.12s), and in Linux box it is much smaller but still noticeable. When result set gets bigger MySQL gains speed. The MySQL method also varies more in speed. So, offer a "treshold" value choice from "use always PHP" to "use always SLQ" and few steps in between, because there is no way of knowing which way works best in each server and image amount, without testing it.
Also, many virtual hosts share MySQL server(s), so offering a choice to use PHP for pagination and sorting on "own server RAM/CPU" may by beneficial. I also believe that anything that produces less load to MySQL is good.
This is just my experience: I believe in empirical research :)
Pekka
------------------------- Pekka Saarinen http://photography-on-the.net -------------------------
attached mail follows:
At 7/6/2002, you wrote: >SORT BY and ORDER by
I mean LIMIT and ORDER BY of course.... Time for some more coffee.
attached mail follows:
ðÒÉ×ÅÔ!
Pekka Saarinen wrote: > Also, many virtual hosts share MySQL server(s), so offering a choice to > use PHP for pagination and sorting on "own server RAM/CPU" may by > beneficial. I also believe that anything that produces less load to > MySQL is good.
Absolutely true. First time a customer of mine wanted to host in the States he got offered Oracle on dedicated machine. Looked quite good, as usually having DB server on a dedicated machine performs *much* better.
Eventually, we found out that the yanks had *one* db server for something like 50 overloaded webservers. The poor dbbox was actually serving an incredible amount of MySql dbs, too.
So poor configuration must be taken into account. Especially when you are hired into a project and cannot really choose who the provider is going to be. In that case an oracle instance was *much* slower than a PHP sort out of a plain text file. And we are talking about a ridicolous amount of rows...
Everything may happen...
ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
--
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
![]()
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
>Hi there, > >zend optimizer 1.3.1 / IIS 5 / PHP 4.2.1 / Windows 2000 > >I've been getting "Stack Overflow" errors frequently. Our software has >hundreds of db queries and hundreds of includes per page execution. Just to >give you some context, so I can't tell you exactly what I'm doing that's >causing this. > >I recently disabled the zend optimizer from the server and since then I >haven't run it again. Could it be that it the Zend Optimizer that's causing >this problem?
Anything is possible...
The Optimizer *does* have to examine the source code and do things with it. I would guess that there are some analyses that might be recursive and could overflow the stack...
You *MIGHT* try installing the Optimizer on a Dev box and turning on *ONE* opitmization group/feature at a time and then pounding on that Dev server with 'ab' until you narrow down which optimizations are the trouble-makers.
Why in the *WORLD* do you have hundreds of includes, though?
You do realize that including a hundred include files is incredibly slow, right?... You may be able to drastically improve performance if there's any way to combine those files...
To test this:
Make a list of a sample of a 100 files that get included in one page hit.
Then cat all those files into 1 big file.
Strip out all the 'include' calls.
A/B compare the real page and the big fat page under stress.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>After upgrading to Red Hat Linux 7.3 (which also includes a new PHP >version), I saw this warning (Uninitialized string offset) on my apache >error log files. It refers to a line which was perfectly legal before:
The new settings in php.ini are error_reporting E_ALL by default.
Those errors have always been there, have always been generated, and you've been "ignoring" them.
> if >(isset($GLOBALS['SPEEDY_GLOBAL_VARS']['CURRENT_USER']['UserName'])) > >I always use isset to check if a variable is defined. Do you know why I >get this warning?
Best Guess:
PHP is only checking if the *LAST* array reference "isset" -- and to do that, *has* to assume that the others are there -- IE, that $GLOBALS['SPEEDY_GLOBAL_VARS']['CURRENT_USER'] is set...
Change it to this:
if (isset($GLOBALS['SPEEDY_GLOBAL_VARS'] && $GLOBALS['SPEEDY_GLOBAL_VARS']['CURRENT_USER'] && $GLOBALS['SPEEDY_GLOBAL_VARS']['CURRENT_USER']['UserName']){
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
> Hi, i am writing a news management system in PHP, with comments, etc, and >i am wondering if theres a better way of structuring the tables to increase >speed and stability. > This is how i am structuring my tables: > > Table 1 (news) > ------------------------------ > ID > Date > Author > Title > News Text > > > Table 2 (comments) > -------------------------------- > ID > News ID (to which news it belongs to) > Date > Author > Comment text
Looks good!
Though I would avoid "two word" columns: news_text news_id comment_text
You *might* also want to record commenters' IP addresses so you can track down abusers not smart enough to hide that... Or require a vaild email before commenting, or...
*SOME* sort of control on posting.
Or, for a small site, perhaps add a field "approved" and only display approved comments.
Or, just leave it "wide open" :-)
Just some ideas to consider.
> Everytime i want to show the comments on some news article, i have to do a >query to the whole table 2, selecting the entries that have the "news ID" >equal to the ID of the news i want. It works but is this ok for when i have >hundreds of news/comments later on? Wont it slow down things? Is there an >easier way for this news/comments script?
There are two issues here:
Q. How many comments can I have in SQL before MySQL pukes? A. Oh, a few million or so.
Q. How many comments can I display on a single web page before HTTP is too slow? A. Maybe a dozen or so.
Fortunately, you can use MySQL's LIMIT clause in your SQL and some navigation links/buttons to display the first 10 (next 10, next 10, ...) comments very easily.
Search for "LIMIT" in the various MySQL/PHP sample code archives, and you'll find it fairly easy.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>what is the path of the "includes" directory >in a windows dist of PHP (current version)? > >is that where all the dlls are?
No.
The DLLs are in your "extensions_path" (or something like that).
Your include_path is where *YOUR* PHP files can be placed so you can use them in multiple scripts.
The simplest example:
Imagine you have a masthead and navigation bar that is the *SAME* on every damn page on your site.
Now, you could type it a zillion times, or you could rely on your fancy HTML editor to archive it and re-use it in every page for you, but it's *really* easy to create a 'navbar.inc' file, and then in every page do:
<?php include 'navbar.inc''?>
If you need to change your navigation bar, you just change navbar.inc
Now, when PHP goes *LOOKING* for 'navbar.inc', because you did <?php include 'navbar.inc';?>...
The include_path is *where* PHP will look.
The first thing I do on any new site is to change my include_path to something like this:
include_path = "./:/www/example.com/includes/"
This assumes your ISP uses /www/example.com/ as your "home" directory -- the one with 'htdocs' (or 'www' or 'web' or wherever you upload your HTML)
You can then throw all your include files in the 'includes' directory.
This is because you do *NOT* want malicious users surfing *directly* to:
There are just too many ways that could be abused to do nasty things and break into your site, once you start putting database passwords and other cool stuff in your include files.
Meanwhile, back to the include_path "./:/www/example.com/includes/"
The "./" part says to look in the current directory first. The ":" part separates one directory from the next. (Use ; in Windows.)
You can list as many directories as you want.
*Occasionally*, in a complex site, I'll have a different include file with the same name in the same directory as my HTML, and it will "over-ride" the other include file in the includes directory. That's why I like to have "./" first. A truly paranoid site with multiple developers should probably *NOT* do that, since it would be too easy for a file to end up in the wrong place...
But you can make the include_path list whatever makes sense to you.
I also use include for: 1. CSS, when I'm forced to use it 2. META tags of description/content 3. 'globals' functions that I use in every page -- most notably a font() function that avoids the tedium of typing long FONT tags, without using the badly-broken CSS (see 1.) 4. Any large block of display that needs to be the same in two pages due to goofy design by the client. 5. Database connections, to get them out of the public directory, and, more importantly, for when I have to move to a different web-server or change the password or whatever there's only one (1) place it's written down.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>On Fri, 5 Jul 2002, Jerome Houston wrote: >> if the browser is making a request, and it sees an https:// at the beginning >> of the request URL, it will : >> 1. get the domain's public key from a public key server >> 2. encrypt the whole request with the domain's public key >> 3. submit it to the web server. > >We have public key servers?
I know (think?) you're joking, but for any other readers... :-)
A "public key server" should not be confused with the public key on an SSL (HTTPS) web-server.
A "public key server" lets any yahoo on the planet upload the "public" half of the key-pair which is supposed to uniquely identify themselves. Alas, all too many people don't even understand how important it is to keep the PRIVATE half of their key private, so public key servers aren't all that useful.
The SSL Certificate you paid $200 (or more) for has a public half in it, which, in the course of the browser/server conversation about how to get the stuff transmitted securely, is exchanged with the browser.
That does not mean your web-server is a public key server, of course.
The SSL Certificate also has a private half. People you do not trust should *NOT* ever be allowed access to that.
>Sort of. The server's key is used to encrypt the exchange of a new key >which lasts only for the lifetime of the transaction. This ephemeral key >is what's used to encrypt the actual data. But this nuance is probably not >very important to understanding the practical issues of working with PHP >and HTTPs.
To be honest, none of this stuff is all that useful for the practical issues :-)
You use URLs that start with HTTPS when you want stuff to be secure.
Everything that gets sent "to" an HTTPS from the browser is encrypted, and everything the browser sends back from the HTTPS is encrypted.
You can safely ignore all the details of exactly how the HTTPS stuff is done internally, unless you need to install/build your own SSL server.
>> Now, one of the things that many people are confused about is that they >> think there must be a lock icon at the bottom of the browser when they >> are entering sensitive info (like credit card numbers). Nope. The only >> important thing is that the form which takes the sensitive data SUBMITS >> to an https:// URL. Because (as above) it will encrypt the request >> (which includes the sensitive data) BEFORE it submits it over the >> internet. But most people don't know how to check that a form submits >> to an to an https:// URL. > >Yup. You'd think that the browser developers would come up with a way to >indicate this (mouse pointer turning to a lock when hovering over a submit >button, etc.).
No, they're too busy adding more useless features and releasing incredibly unstable code with little or no QA :-)
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I saw that Microsoft has a Certificate Authority server package that allows >you to create your own key. Is there a way to do this in linux? In this >particular instance, it's me accessing my own web site. I'd like to encrypt >the session and I'm don't need someone to confirm anything.
You can create your own SSL key pair very, very, very easily...
But unless you paid the $200 to get it from a CA, surfers will see a nasty (and totally inaccurate/misleading) warning about how insecure it is.
The transmission is no less secure -- It's that the web-server on the other end was too cheap to pay the $200 for a CA key.
Yes, the basic model for the security of all eCommerce is:
"You pay some large corporation $200, and they trust you."
What kinda trust is worth $200, I don't know. :-^
Alas, the *BROWSER* makes it sound like the whole thing is very shady, when, in reality, if you trust the web-site (certainly more than I trust Microsoft!) then it's just as secure.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>For Miguel Cruz posting back there. If I understand correctly, the private >key are inside the public key. Is this correct?
If you have an SSL (or SSH, or whatever) key thingie, it always comes as a "pair"
The private half, and the public half.
You never, ever, ever, ever give the private half to anybody, anywhere, any time.
You give the public half to, well, everybody.
Neither the public half nor the private half ever include the other.
A message encrypted with either half can only be decrypted with the other half.
In the HTTPS exchange, however, extra key-pairs are generated on the fly, and the private half of the new pair are exchanged, encrypted with the public halfs of the old pairs, so that the server and the browser are using a UNIQUE public/private pair so that nobody can snoop on them...
Or, at least, it works something like that... I'm telling you, you really don't need to understand this stuff if it gives you a headache as bad as it gives me :-)
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
On Fri, 5 Jul 2002, Richard Lynch wrote: > But unless you paid the $200 to get it from a CA, surfers will see a nasty > (and totally inaccurate/misleading) warning about how insecure it is.
It is easy to launch a man-the-middle attack against a session being initiated between a client and a server with a self-signed certificate. You just send the client a self-signed certificate of your own, and it can't tell it apart from the real one - same error message shows up.
miguel
attached mail follows:
Richard Lynch wrote:
>You can create your own SSL key pair very, very, very easily... > >But unless you paid the $200 to get it from a CA, surfers will see a nasty >(and totally inaccurate/misleading) warning about how insecure it is. >
They should. To do otherwise would be inaccurate and misleading.
>The transmission is no less secure -- It's that the web-server on the other >end was too cheap to pay the $200 for a CA key. >
No, the transmission is much less secure. You cannot be guaranteed the identity of the Web server you're communicating with. You think just because the HTTP transaction is encrypted that it is secure? What if you're encrypted transaction is taking place with some criminal? You still feel secure?
>Yes, the basic model for the security of all eCommerce is: > >"You pay some large corporation $200, and they trust you." >
No, you pay some large corporation money, because the majority of browsers currently in use trust certificates issued by that corporation. They've had to undergo extensive C&A processes to ensure the integrity of their operation, and they've also had to shell out some big money to Microsoft and Netscape to have their root certificates installed and trusted into their browsers.
>Alas, the *BROWSER* makes it sound like the whole thing is very shady, when, >in reality, if you trust the web-site (certainly more than I trust >Microsoft!) then it's just as secure. >
The browser *should* issue a warning when the identity of the Web server it is about to communicate with cannot be guaranteed. You seem to be confused about where the trust lies. If I trust the Web site http://www.mybuddy.org/ (hypothetical best friend's Web site), does that mean I should trust any certificate that is issued to www.mybuddy.org? What if the certificate's root CA was a criminal's PC? Are you *sure* that's your friend's Web site that you are communicating with?
However, if you do trust a certain CA (perhaps your own), you can import your root certificate into your browser and check some boxes to trust it. Luckily, browsers don't even allow a method for you to "trust" a domain name.
It is quite trivial to generate a certificate for www.amazon.com. It isn't too terribly difficult to make someone's computer think www.amazon.com is your Web site. Here come the encrypted credit card numbers. Good thing they're secure. :)
The point is, PKI isn't about encryption alone. In fact, the "textbook" answer to the question of what services PKI provides is:
1. Identification 2. Authentication 3. Authorization 4. Integrity 5. Confidentiality 6. Non-Repudiation
If it only provided confidentiality, quite honestly, PKI would be useless as it is implemented today.
Happy hacking.
Chris
attached mail follows:
Richard Lynch wrote:
>In the HTTPS exchange, however, extra key-pairs are generated on the fly, >and the private half of the new pair are exchanged, encrypted with the >public halfs of the old pairs, so that the server and the browser are using >a UNIQUE public/private pair so that nobody can snoop on them... > >Or, at least, it works something like that... I'm telling you, you really >don't need to understand this stuff if it gives you a headache as bad as it >gives me :-) >
If you want a basic understanding of PKI, how it works, what problems it solves, etc., I highly recommend a single chapter in a single book that will give you enough of a foundation to "get it" (esr style).
_PKI:_Implementing_and_Managing_E-Security_ from RSA Press, Chapter 2 (50 pages - very clear and not too technical).
Happy hacking.
Chris
attached mail follows:
>Question I have is.... > >I want to run a print job of 200+ invoices > >I have a javascript code to open a print dialog box and >Then go to next invoice and do the loop.. > >Problem I am having is that I want it to pause if the ok button on the >dialog >Box is not pressed.. > >When I run the script it fly's throught and brings up a heap of printer >Dialog boxes which causes me to ctrl+alt+del... > >Anyway or pausing the script untill ok is pressed?
I doubt it... And you're real unlikely to find the answer on a PHP mailing list, as noted.
Some things you might consider.
Use PHP to concatenate all the invoices with a "new page" character (control-L, I think) between them. That's probably only gonna work on an old dot-matrix printer, though...
Use PHP to shove all the invoices into a single PDF http://php.net/pdf
Use PHP to shove all the invoices into some kind of word-processing program format with page breaks between them. I imagine that if they are simple enough, you could even do a sample MS Word and reverse-engineer the format of the document enough to get it right.
Use PHP to spew out the invoices in tab-delimited format, one per row, and download that, and then use Word's "template" or "mail-merge" or whatever they called it to print them up.
Oh, I suppose you could use JavaScript with some kind of timer loop so I can click on the "Ok" button as fast as you pop up the stupid windows, but do you really expect me to click 200+ times for your stupid print button to work?
Isn't it weird how all my good answers started with "Use PHP?" :-) :-) :-)
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Also, how can I make certain columns into links? I'm making a site that >will list college courses. When users decide to browse listings by >discipline, or college, I'd like the titles of the courses to be links to >fuller descriptions of those courses. But I'm >not sure how to do that.
<?php if (!isset($order_by)){ $order_by = 'title'; } $query = "select discipline, college, title from courses order by $order_by "; $courses = mysql_query($query) or error_log(mysql_error()); ?> <TABLE> <TR> <TD><A HREF=<?=$PHP_SELF?>?order_by=discipline</TD> <TD><A HREF=<?=$PHP_SELF?>?order_by=college</TD> <TD><A HREF=<?=$PHP_SELF?>?order_by=title</TD> </TR> <?php while (list($discipline, $college, $title) = mysql_fetch_row($courses)){ echo " <TR>\n"; echo " <TD>$discipline</TD>\n"; echo " <TD>$college</TD>\n"; echo " <TD><A HREF=details.php?title=", urlencode($title), ">$title</A></TD>\n"; echo " </TR>\n"; } ?> </TABLE>
Actually, you probably have a course "number" which would be a much better ID to use for the details.php page. :-)
If you need to generalize this for a ton of columns, or a lot of tables, there is a function named something not unlike mysql_field_name() in PHP which will let you get the field names of the columns of any table in your database.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>i work on Win98, apache 1.3.24/PHP4.2.1. >I include a PHP file (867 lines) witch contains functions : > >include("include/fonctions.php"); > >This previous code is inserted in the upper frame and the left frame. >But sometimes, i've got errors like : > >Parse error: parse error, unexpected '.' in d:\www\include\fonctions.php on >line 431 > >and > >Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE in >d:\www\include\fonctions.php on line 275 > >Error line can be 206,325,186... > >I refresh the page (F5) and all is right. >It is sure that this included script contains no errors.
If you refresh the whole page, you probably aren't getting the same content...
If you are using IE, I *think* you can right-click in the "white space" (no images or text) of a frame and reload just that frame, and get (usually) the same content again.
One thing for sure. There *ARE* errors in your PHP code.
Probably missing quotes (") or apostrophes (') or { or } somewhere.
PHP only finds them in the cases where it actually executes that line of code, so you only see them when your code hits that line in the process of your application.
You should be able to visit the individual frame contents of your site using the right-click and "Open Frame in New Window" and you *might* be able to work from there to dig into the problem with F5 reload.
Oh, and get rid of the frames if at all possible. They are a pain, and rarely are needed.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I was reading the post by Pag called “MySQL backups” and I have the same >question, but not the shell access. It came to my mind, that if will be >very useful for me, and probably for many of us newbie’s, to be able to >build an automated PHP system that could make backups by itself at a >specified time… let’s say maybe every morning at 6 am, by transferring >or uploading the MySQL files to another server. I noticed that this >could be done in PHPNuke, by clicking at “Backup Files”. ¿Is it possible >to build this kind of unattended scripts with PHP or will it always >require a magical “click” from the administrator? > >I guess that it shouldn’t be possible, but it’s worth a shot.
It *MIGHT* be possible for you to do:
<?php exec("/full/path/to/mysqldump -u USERNAME --password=PASSWORD DBNAME", $output, $error); echo implode('', $output); if ($error){ echo "OS Error: $error. Check 'man errno', but it's almost always path/permissions."; } ?>
If not, and if you have shell access on *another* machine, you could use that machine to POST to the other machine a request to push the button. Totally sucky way to do it, but you could.
It might be easier to just ask your ISP to create a cron job for you that dumps the database to a file you can FTP regularly. It would take them about 5 minutes to do this.
If all else fails: Just find another ISP that allows SSH access and switch hosts :-)
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
Well, thanks for all the ideas. I will try to "communicate" with my host, but I'm sure they will go like "...is not possible unless Cobalt authorizes...". I also like the idea of making a hidden script that visitors will activate...
C.
> -----Original Message-----
> From: Richard Lynch [mailto:rich
phpbootcamp.com]
> Sent: Saturday, July 06, 2002 2:06 AM
> To: php-general
lists.php.net
> Subject: [PHP] Re: PHP Automatic Backup
>
> >I was reading the post by Pag called “MySQL backups” and I have the
same
> >question, but not the shell access. It came to my mind, that if will
be
> >very useful for me, and probably for many of us newbie’s, to be able
to
> >build an automated PHP system that could make backups by itself at a
> >specified time… let’s say maybe every morning at 6 am, by
transferring
> >or uploading the MySQL files to another server. I noticed that this
> >could be done in PHPNuke, by clicking at “Backup Files”. ¿Is it
possible
> >to build this kind of unattended scripts with PHP or will it always
> >require a magical “click” from the administrator?
> >
> >I guess that it shouldn’t be possible, but it’s worth a shot.
>
> It *MIGHT* be possible for you to do:
>
> <?php
> exec("/full/path/to/mysqldump -u USERNAME --password=PASSWORD
DBNAME",
> $output, $error);
> echo implode('', $output);
> if ($error){
> echo "OS Error: $error. Check 'man errno', but it's almost always
> path/permissions.";
> }
> ?>
>
> If not, and if you have shell access on *another* machine, you could
use
> that machine to POST to the other machine a request to push the
button.
> Totally sucky way to do it, but you could.
>
> It might be easier to just ask your ISP to create a cron job for you
that
> dumps the database to a file you can FTP regularly. It would take
them
> about 5 minutes to do this.
>
> If all else fails: Just find another ISP that allows SSH access and
> switch
> hosts :-)
>
> --
> Like Music? http://l-i-e.com/artists.htm
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
>Hi! > >I'm having problems with createfrompng… > >I do the following: > >1 Creates a new image > >2 Fill it with black > >3 copy an jpg on to it > >4 write some text > >5 tries to use copyimageresized to put a transparent png over the whole >image… > >It's in point 5 it goes wrong, because of some reason the png loses its >transparens and becomes a white square instead of the nice transparent >picture it was from the beginning… > >What have I done wrong or is it simply impossible to perform what i want?
Wild guess:
Set the transparent color of *BOTH* images to the *SAME* color before copying?
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Hello php-general, > > I've recently faced big optimization issues. Here is mine >situation: > >I make connection to NNTP server and fetch headers from the news group >lets say bla.bla.bla. Connection made ok. Next Php tryes to put >everything into the array. It's okey if number of headers are lower >then let's say 100. But if number of headers get greater then 100, >it's a pain in the ass. I have to wait for 90-100 seconds till the >operation completes. (I'm talking here about large value news groups). >So I have faced that I need to optimize it somehow. >At this point of time i've got only idea is to put all the headers in >the database. But not sure how to update database frequently. Any >ideas even fantastic ones are welcome.
Can't you just ask the NTTP server for only the next 20 messages?
You could probably build a local cache of each message, and use that for any repeated request...
<?php get_message($message_id){ $message = get_cache($message_id); if (!$message){ $message = get_nntp_message($message_id); store_cache($message_id, $message); } } ?> Exactly where/how you store the local cache is up to you. Files, DB, whatever.
Actually, what you *MIGHT* find easiest is to simply install a news server locally, carry the groups you want, and then have PHP talk to the local news server.
Then all the caching and expiring issues are taken care of, the news feed download is automatic, and your PHP application will be talking to a LOCAL news server, which should be way more faster.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Hello hello, > >I have this strange thing with a sort of login procedure (still working it >out, but it will work eventually) >On the first page, you log in (username + password) >Then we come to 'login.php' where I have this header > 1 <?php > 2 session_start(); > 3 $loginname=$_POST["loginname"]; > 4 $loginpw=$_POST["loginpw"]; > 5 session_register('loginname'); > 6 session_register('loginpw'); > 7 ?>
Do the session_register *BEFORE* you assign the variables.
:5,6 move 3
>This works, I can use $loginname and $loginpw > >Somewhere on that page I have added a few buttons, and one of those buttons >is functional (the others have to be written yet) >But here I have this header: > 1 <?php > 2 session_start(); > 3 $loginname=$_SESSION['loginname']; > 4 $loginpw=$_SESSION['loginpw']; > 5 /* session_register('loginname'); > 6 session_register('loginpw'); -- commented out, it did not >add something seemingly */ > 7 ?>
Same thing.
>The strange thing is that if I do (hey, it's just for testing what's >happening): >print("loginname = $loginname<br>\n"); >print("loginpw=$loginpw<br>\n"); > >both loginname and loginpw contain the same information, which is the true >information of $loginpw >what am I doing wrong here?
I dunno how the data gets in there, but I'm pretty sure it isn't happening from the lines you've provided. Show us more code.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>i want to add in textarea a string with new line tag in it. how to do that? > >my try: >$string="-line1n\ -line2 n\-line3"; >echo "<br><textarea name='aria' cols='50' rows='2'>$string</textarea>"; > >but i see a single line instead of: >-line1 >-line2 >-line3 > >tx in advance for any help
In addition to using \n instead of n\, you also should do:
echo "<br><textarea name='aria' cols='50' rows='2'>", htmlentities($string), "</textarea>";
This will fix any problems with quotes, apostrophes, HTML, etc buried in $string.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Does anybody know which is the lenght limit for the parameter string >when GETting an URL? If there is a limit at all, of course.
Yes. :-)
The limit *USED* to be 255 characters.
I think it's up to 1024 now, for GET.
Any server *MAY* choose to impose *ANY* limit on GET, so long as they don't impose a limit *LOWER* than that limit.
So, maybe your server has a limit of this size, and maybe it doesn't. Maybe it has a limit of 2K. Maybe it has no limit. Maybe they didn't pay attention to the rules and it has the old limit of 255.
I would never count on a GET over 255 characters really working.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>My web host has just upgraded to PHP 4.20. My MySQL database is full of >session_encoded fields, but since the upgrade I can no longer session_decode >them. > >After doing phpinfo I find the following settings ... > >register_argc_argv on on >register_globals on on > > >I've been through the manual regarding predefined variables but must be >missing the point somewhere. > >How do I get the session_encoded fields back as useable variables?
Ouch... I'm not sure, but it's quite possible that the internal format of a session_encoded string changed... *MOST* web-sites can just dump their session data, since it's generally used only for short-lived data anyway...
You *MIGHT* be able to look at the strings by hand and write some kind of parser for them...
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I tried following all of your suggestion and so far, still the same. I >tried changing other feature in the php.ini and check the phpinfo and found >that they haven't changed either. So, the problem lie with the file path in
Aha!
Then you *missed* the one where he said:
Check phpinfo() and see where phpinfo() thinks your php.ini file lives.
1. Surf to your phpinfo page. 2. Do a "Find..." in your browser for "php.ini" 3. Note the path where php.ini is supposed to be, as it was given to ./configure + 4. Put your php.ini file *THERE* 5. Remove all other php.ini files ++ 6. Sym-link all the other places php.ini used to be to that php.ini file. 7. Stop Apache. 8. Verify Apache stopped with "ps auxwwww | grep http" 9. Start Apache.
+ If no path was given, the default is /usr/local/lib If your ISP/RedHat/Mandrake/whatever auto-installer chose some odd-ball path, well, yell at them, not us.
++ If there is no php.ini file at all in the path PHP expects it, PHP uses the defaults that would be there if you had put the default php.ini there like you were supposed to.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>All, > >My session is not expiring and I believe that I set this correctly. >I'm looking for a 15 minute expiration time. > >My current setting: > >session.cookie_lifetime = 900 ; lifetime in seconds of cookie > ; or if 0, until browser is restarted > >Is this the correct why to achieve this? If so what else can it be?
Did you start/stop Apache after changing php.ini ?
You do realize that they expire only if UNUSED for that period of time, right??? :-) [Hey, always cover the obvious first...]
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Are there any scheduling fuctions with PHP? What I'm looking for is >something functionally close to a crontab.
Most PHP sites just use crontab when they need crontab... :-)
So you not have SSH access?
How busy is your site?
What kind of actions do you need to have occuring?
You *COULD* hack up a database with date/time stamps and actions and then include() a file on your home page that essentially does what cron would do, using the database data, and if your site is busy enough, it would sorta work...
Are you sure you can't just use cron though? *WAY* easier.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
> I'm using a postgres datbase for my PHP project, how do I make stored >procedures? Or if no SPs then what would be recomendation for building >simple/reuseable "Put" and "Get" procedures for my data?
Well, if nothing else, PostgreSQL does support user-defined functions, going 'way back.
Technically not quite the same as a Stored Procedure, but should do what you need.
Of course, *WHY* you want to add such a ridiculous layer of overhead to your code is beyond my comprehension, but that's another story... :-)
I once worked at a place where the head IT guy was convinced Stored Procedures were the bomb.
Alas, he didn't tell me that until after I had coded the most of the ASP application without them.
Meanwhile, deadlines were looming, and I wasn't migrating to Stored Procedures, since I was furiously coding all the change requests (well, okay, they were really "Features The Client Thought Up During Development Because He Didn't Design Anything Beforehand" but they were called change requests anyway.
So a new guy they hired was assigned the task of converting all my:
<% $query = "select blah, blah, blah"; %>
code into Stored Procedures.
Guess what?
*ONE* of the pages was a little faster. The other hundred pages were just as fast with $query = "select..."
Guess what else?
When we migrated from SQL 6.5 to SQL 7.x, all the Stored Procedures puked.
Guess what else?
Before the Stored Procedure conversion, it was trivial to Push from the Dev box to the Production box. After the conversion, it was a nightmare. I ended up writing an Admin tool to connect to both databases and compare the text of the Stored Procedure source (buried in badly-designed Microsoft tables) between the Dev Server and the Production Server. Of course, in the first round *ALL* the procedures were different, since Microsoft added/stripped altered the text of the Stored Procedures while copying them from Dev to Server in the first place.
Guess what else?
There weren't enough queries "the same" that there was any real code re-use. I coded the application and the pages were designed properly in the first place, so very seldom were two queries the same. If they had been the same, I would have put those two pages (features) into one.
Guess what else?
The new guy was in such a hurry, that in the few instances that two queries *were* the same, he didn't bother to figure that out, so we ended up with some Stored Procedures that were duplicates of others in everything except their name.
Guess what else?
The 
INSERT_ID I was using worked differently inside a Stored Procedure, so
I wasted days tracking down a bug introduced by the Stored Procedures.
Guess what else?
When I went to edit the pages he had changed, I'd have no idea what data was coming back from the Stored Procedure, without reading way too many lines of code. With the $query = "select x, y, z" style, I knew exactly what I was getting.
All in all, the company spent 4 weeks of this guys' life, 40 hours a week, making the application less portable, less maintainable, and no faster.
And people wonder why I see little value in Stored Procedures.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
On Sat, 06 Jul 2002 01:16:28 -0500
"Richard Lynch" <rich
phpbootcamp.com> wrote:
> > I'm using a postgres datbase for my PHP project, how do I make stored
> >procedures? Or if no SPs then what would be recomendation for building
> >simple/reuseable "Put" and "Get" procedures for my data?
>
> Well, if nothing else, PostgreSQL does support user-defined functions,
> going'way back.
>
> Technically not quite the same as a Stored Procedure, but should do what
> you need.
>
> Of course, *WHY* you want to add such a ridiculous layer of overhead to
> your code is beyond my comprehension, but that's another story... :-)
>
> I once worked at a place where the head IT guy was convinced Stored
> Procedures were the bomb.
>
> Alas, he didn't tell me that until after I had coded the most of the ASP
> application without them.
>
> Meanwhile, deadlines were looming, and I wasn't migrating to Stored
> Procedures, since I was furiously coding all the change requests (well,
> okay, they were really "Features The Client Thought Up During Development
> Because He Didn't Design Anything Beforehand" but they were called change
> requests anyway.
>
> So a new guy they hired was assigned the task of converting all my:
>
> <%
> $query = "select blah, blah, blah";
> %>
>
> code into Stored Procedures.
>
> Guess what?
>
> *ONE* of the pages was a little faster. The other hundred pages were just
> as fast with $query = "select..."
>
> Guess what else?
>
> When we migrated from SQL 6.5 to SQL 7.x, all the Stored Procedures puked.
>
> Guess what else?
>
> Before the Stored Procedure conversion, it was trivial to Push from the
> Dev box to the Production box.
> After the conversion, it was a nightmare. I ended up writing an Admin
> tool to connect to both databases and compare the text of the Stored
> Procedure source (buried in badly-designed Microsoft tables) between the
> Dev Server and the Production Server.
> Of course, in the first round *ALL* the procedures were different, since
> Microsoft added/stripped altered the text of the Stored Procedures while
> copying them from Dev to Server in the first place.
>
> Guess what else?
>
> There weren't enough queries "the same" that there was any real code
> re-use.
> I coded the application and the pages were designed properly in the first
> place, so very seldom were two queries the same. If they had been the
> same, I would have put those two pages (features) into one.
>
> Guess what else?
>
> The new guy was in such a hurry, that in the few instances that two
> queries*were* the same, he didn't bother to figure that out, so we ended
> up with some Stored Procedures that were duplicates of others in
> everything except their name.
>
> Guess what else?
>
> The 
INSERT_ID I was using worked differently inside a Stored Procedure,
> so I wasted days tracking down a bug introduced by the Stored Procedures.
>
> Guess what else?
>
> When I went to edit the pages he had changed, I'd have no idea what data
> was coming back from the Stored Procedure, without reading way too many
> lines of code. With the $query = "select x, y, z" style, I knew exactly
> what I was getting.
>
> All in all, the company spent 4 weeks of this guys' life, 40 hours a week,
> making the application less portable, less maintainable, and no faster.
>
> And people wonder why I see little value in Stored Procedures.
>
> --
> Like Music? http://l-i-e.com/artists.htm
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Stored procedures are like any other type of programming construct. You can do them right or you can do them wrong. When making a stored procedure you should stick to ansi SQL as much as possible. Most of my stored procedures I can move from a SQL Server 2000 box to an Oracle 8i box with not problems at all. Stored procedures are NOT over head. If you need to change an SQL statement, then you would have to search through all your code to make changes intstead of just one stored proc. If you don't see any speed increase from stored procs then you are doing something wrong. Stored procs are compile SQL statements. Every time a your php page does something like $query="Select * from MyTable" the DB needs to parse the query and create an execution plan. The stored procs do it only ONCE the first time it is ran and all the other calls to it save you many millisecond to seconds. That might not sound like much but if you have a site with more than 5 users you will see a difference. The intranet I finished for my company has 100,000 users and sustains almost 1,000 users per second. The pages took 7 to 10 seconds without stored procs and went down to 3-4 seconds with them. Also, new features needed to be added to the site and required some tables to be changed. I only had to change one SQL in on location and everything was fine.
Jim Drabb
-- James Drabb JR - Programmer Analyst - Orlando, FL - JDrabbcfl.rr.com ---------------------------------------------------------------------
attached mail follows:
> >Hey everyone, >Am working late as usual before the weekend and so I fear i'm a bit braindead! >Anyway,heres my problem >I have fields named "total" and "avg" and no idea how many records.... >how do I get the total and average? >Do I use a function?
select sum(foo), average(foo), count(foo) from my_table
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
On Fri, 5 Jul 2002, Kelly Meeks wrote: > If I had this information stored in a database field, > <img src="<? echo $content_output["site_logo"]; ?>"> > > how could I assign it to a variable and output it?
you have to ?> first to leave php mode so you can do
$content_output = "logo.gig"; $code = "<img src='<?php echo $content_output; ?>'>"; eval("?>$code");
which will echo the outut
or catch it with output buffering
$content_output = "logo.gig"; $code = "<img src='<?php echo $content_output; ?>'>"; ob_start(); eval("?>$code"); $evaled_code = ob_get_contents(); ob_end_clean();
I have used arrays in evals before you have to watch the quotes.
Paul Roberts
roberts_paul
bigfoot.com
++++++++++++++++++++++++
attached mail follows:
Hi all.
I know this is not entirely a PHP-related question, but most of you have
been where I am now. I’m about to buy a used computer just for
development purposes and I have a couple of questions before I close the
deal.
1) It will probably be a Compaq Armada running a Celeron 600 and 256…
Does anyone knows about any trouble with Celeron based computers or
laptops in general?
2) After I get it, I will kill the HDD and start from scratch… Which
version of Windows should I use? I like Win XP Pro, but maybe I’m
letting some functionality out.
One more thing. After I install the OS ¿What should I install for
development in order to make full compatible scripts: IIS or Apache?
¿What versions of Apache (if so), MySQL and PHP should I use? ¿The
latest ones?
Thanks,
<mailto:webmaster
icaam.com.ar> Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621
attached mail follows:
Hi All,
I'm opening a port on a remote machine presently I'm using fsockopen() which is fine for opening the port and sending data however I'm having trouble reading data back from the port.
So I've considered using socket functions but do not appear to be able to get a connection. When I run the code below pointing to 127.0.0.1 everything runs fine however when I point to 192.168.123.193 (Another machine on the local network without a server running) I get these errors.
Warning: socket_bind() unable to bind address [10049]: The requested address is not valid in its context. in D:\php-dev\new.php on line 20 socket_bind() failed: reason: The requested address is not valid in its context.
Warning: socket_listen() unable to listen on socket [10022]: An invalid argument was supplied. in D:\php-dev\new.php on line 26 socket_listen() failed: reason: An invalid argument was supplied.
What does 'requested address is not valid in its context' mean?
Thanks
Zac
Code:
<?php error_reporting (E_ALL);
/* Allow the script to hang around waiting for connections. */ set_time_limit (0);
/* Turn on implicit output flushing so we see what we're getting * as it comes in. */ ob_implicit_flush ();
$address = "192.168.123.193"; $port = 5331;
if (($sock = socket_create(AF_INET, SOCK_STREAM, getprotobyname("TCP"))) < 0) { echo "socket_create() failed: reason: " . socket_strerror ($sock) . "<br>"; } else { echo 'socket<br>'; }
if (($ret = socket_bind($sock, $address, $port)) == false) { echo "socket_bind() failed: reason: " . socket_strerror(socket_last_error($sock)) . "<br>"; } else { echo 'bind<br>'; }
if (($ret = socket_listen ($sock, 5)) == false) { echo "socket_listen() failed: reason: " . socket_strerror(socket_last_error($sock)) . "<br>"; } else { echo 'listen<br>'; }
socket_close ($sock); ?>
attached mail follows:
Hi!
I'm trying to copy a transparent (copyright) image over an existing using GD, but can't get it to work…
The copyright image is a png, and can be found here: <http://adversus.no-ip.com/copyright.png>.
Does anyone either know how to perform this, or knows a link to some tutorial who explains this step by step…?
My problem is that the transparent image loses its transparens when I do the copyimageresized…
Thankful for any help,
sincerely
Victor
attached mail follows:
You need to use ImageCopyResampled() instead. And don't forget to turn on alpha blending beforehand using ImageAlphaBlending($im,true);
-Rasmus
On Sat, 6 Jul 2002, [ISO-8859-1] Victor Spång Arthursson wrote:
> Hi! > > I'm trying to copy a transparent (copyright) image over an existing > using GD, but can't get it to work… > > The copyright image is a png, and can be found here: > <http://adversus.no-ip.com/copyright.png>. > > Does anyone either know how to perform this, or knows a link to some > tutorial who explains this step by step…? > > My problem is that the transparent image loses its transparens when I do > the copyimageresized… > > Thankful for any help, > > sincerely > > Victor > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
ðÒÉ×ÅÔ!
I am not too familiar with the way language and charset requests are coupled by browsers. After processing the headers I get this two arrays (based on my personal Mozilla settings).
charset -> Array ( [0] => KOI8-R [1] => utf-8 [2] => * ) language -> Array ( [0] => ru [1] => en [2] => fr [3] => it [4] => es )
All of charset requests appear to be related to russian only, while no indication at all is given on how to print out alternate languages.
Which seems to imply that we have no data about which charset should be used to present english or french/italian/spanish text and therefore we must maintain some proprietary associative table on our own.
Is that right or the alternate charachter sets are actually buried somewhere and it's just me being too ignorant to find them? I suspect I am right, because multilinguistic sites tend to show special chars as out of context cyrillic charachters on my browser... Which *is* pretty stupid. :(
ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
I am storing some values in session variables. The behavior of the session is pretty unpredictable.
On the first page I begin with: session_name("aname") session_start() session_register("var1","var2")
In another page I check for existing value of session variable "var2". In the next page I have the following code: session_name("aname") session_start()
if(($var2)=="" || !isset($var2)) "invalid"
But the strange thing is that the session value is not accessible in the other page.
I have tried passing the session id though session_id() in the URL.
Session handling has been giving me some trouble (windows 2000, IIS) The strange thing is that it works some times.
Can anyone give any pointers?
attached mail follows:
One thing I forgot to mention is that the same code works perfectly on the web server (running on Apache and a Unix flavor).
-----Original Message-----
From: php-general-return-105847-naintara=del6.vsnl.net.in
lists.php.net
[mailto:php-general-return-105847-naintara=del6.vsnl.net.in
lists.php.ne
t]On Behalf Of Naintara Jain
Sent: Saturday, July 06, 2002 6:09 PM
To: Php-General
Lists. Php. Net
Subject: [PHP] session problem
I am storing some values in session variables. The behavior of the session is pretty unpredictable.
On the first page I begin with: session_name("aname") session_start() session_register("var1","var2")
In another page I check for existing value of session variable "var2". In the next page I have the following code: session_name("aname") session_start()
if(($var2)=="" || !isset($var2)) "invalid"
But the strange thing is that the session value is not accessible in the other page.
I have tried passing the session id though session_id() in the URL.
Session handling has been giving me some trouble (windows 2000, IIS) The strange thing is that it works some times.
Can anyone give any pointers?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
you might wanna check if register global is turned on or off.
Naintara Jain wrote:
> One thing I forgot to mention is that the same code works perfectly on the
> web server (running on Apache and a Unix flavor).
>
>
>
> -----Original Message-----
> From: php-general-return-105847-naintara=del6.vsnl.net.in
lists.php.net
> [mailto:php-general-return-105847-naintara=del6.vsnl.net.in
lists.php.ne
> t]On Behalf Of Naintara Jain
> Sent: Saturday, July 06, 2002 6:09 PM
> To: Php-General
Lists. Php. Net
> Subject: [PHP] session problem
>
>
> I am storing some values in session variables.
> The behavior of the session is pretty unpredictable.
>
> On the first page I begin with:
> session_name("aname")
> session_start()
> session_register("var1","var2")
>
> In another page I check for existing value of session variable "var2".
> In the next page I have the following code:
> session_name("aname")
> session_start()
>
> if(($var2)=="" || !isset($var2))
> "invalid"
>
> But the strange thing is that the session value is not accessible in the
> other page.
>
> I have tried passing the session id though session_id() in the URL.
>
> Session handling has been giving me some trouble (windows 2000, IIS)
> The strange thing is that it works some times.
>
> Can anyone give any pointers?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
attached mail follows:
ðÒÉ×ÅÔ!
Doing multiligual sites presumes you can somehow understand what the client expects from you. Browsers all are full of language settings, but... The HTTP specification is very little language negotiation oriented in itself (this is probably a consequence of its having started out in a 100% english speaking environment).
I have been checking the docs here and there, but that's the way it is. If russian was my second choice there would be no way to decide whether I should be sent a KOI-8 doc or its cp-1251 equivalent. And although I am not a chinese speaker I do suspect the same problem to arise there. Now I finally understood what was the need for a russian edition of Apache.
You can check some docs here: http://www.cs.tut.fi/~jkorpela/http.html it's a pretty handy site.
All language negotiation specification ignores the charset issue. It appears as if the two things had been projected separetely, by people that simply did not know about each other. And since people speaking more than one language are a minority I would expect this issue to remain "as is" for a century or so...
ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
--
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
![]()
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
Is there any way to make sessions last longer without access to php.ini? I know how to change the cookie length, but not how long the session is stored on the server. Is this possible?
attached mail follows:
i`ve coded a mass-mailer for my site but the $from header doesn't work.
when i get a test message back from it it says from "Unprivileged user" = not what i set it to.
How would i set it out using the syntax:
$to # $from # $subject # $message # mail($to, $from, $subject, $message) _______________________________________________=20
Also, i was wondering how i could use my own PHP.INI config file on a = remote webserver which hosts my site.
And can i set .php to something else, like .he for example?
-ReLik
attached mail follows:
ðÒÉ×ÅÔ!
Greg Scotts wrote: > $to # > $from # > $subject # > $message # > mail($to, $from, $subject, $message)
It always worked for me... you obviously checked variable content, did you? And I am not sure I got you right. Mail gets sent, it's just the sender address being wrong?
> Also, i was wondering how i could use my own PHP.INI config file on a = > remote webserver which hosts my site.
You need a shell with root access. I doubt you will be given one.
> And can i set .php to something else, like .he for example?
Yes, if you are root :) You need to do it in your httpd.conf (that's actually something Apache must now. For PHP file extension is totally equivalent, you could have no extension at all and they would work. It's Apache that needs some rule for it to know how it's going to process the request).
ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
--
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
![]()
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
Hi dear friend,
I have multiple check boxes ...and I gave the single name to all check boxes.....
If I post to my php script I am not getting all the values as an array.....I am getting only one value(last value).....
=====================================
<html> <head> <script language="javascript"> function checkitall() { var n=0,i=document.form1.OptionList.length;
while(n<i) { if(document.form1.checkall.checked) { document.form1.OptionList[n].checked=true; n=n+1; } else { document.form1.OptionList[n].checked=false; n=n+1; } } } function approve() {
document.form1.method="post"; document.form1.action="./approve_f.php"; document.form1.submit(); return true; }
</script> </head>
<body bgcolor="#FFFFFF" text="#000000"> <form name="form1" method="post" > <table> <tr> <td><input type="checkbox" name="OptionList" value="something1">Option 1</input></td> <td>Hello</td> </tr> <tr> <td><input type="checkbox" name="OptionList" value="something2">Option 2</input></td> <td>Hi</td> </tr> <tr> <td><input type="checkbox" name="OptionList" value="something3">Option 3</input></td> <td> How r u</td> </tr> <tr> <td><input type="checkbox" name="checkall" OnClick=checkitall()>Check All</input></td> </tr> <tr> <td><input type="submit" name="approve" OnClick="return approve();">Check All</input></td> </tr> </table> </form> </body> </html> ===============================
If I give name as OptionList[] I am getting an error for selectAll option.
Any help would be greatly appreciable.
Thanks and regards Balaji
- text/plain attachment: Wipro_Disclaimer.txt
attached mail follows:
Balaji Ankem wrote:
> I have multiple check boxes ...and I gave the single name to all check > boxes..... > > If I post to my php script I am not getting all the values as an > array.....I am getting only one value(last value).....
Correct. Since they are all named in the same way, the last one kills them all.
> If I give name as OptionList[] I am getting an error for selectAll > option.
I never came to think about it, but the [] thing may actually disturb jscript.
I usually do it like this:
HTML side -------- <tr> <td> <input type="hidden" name="control[]" value="1"> <input type="checkbox" name="OptionList_1" value="x"> Option 2 </input> </td> <td>Hi</td> </tr> <tr> <td> <input type="hidden" name="control[]" value="2"> <input type="checkbox" name="OptionList_2" value="x"> Option 2 </input> </td> <td>Hi</td> </tr>
PHP side --------- # put the received input into an ordered structure ################################################## $count = 0; while ( isset($control[$count]) ) {
# Build variable names; ####################### $w_OptionList = "OptionList_".$count;
# get actual form values ######################## $OptionList[$count] = $$OptionList;
$count++; }
Javascript ---------- I never use selectAll. But you can easily walk the array down in the very same way.
ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
--
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
![]()
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
On July 5, 2002 07:54 pm, Pete James wrote: > "Ilia A." wrote: > > The biggest annoyance I've come across is > > the fact that while using PostgreSQL with PHP is that when you fetch a > > row you must specify the number of the result, while in MySQL, that is > > handled internally by PHP for you. This means that your PHP scripts must > > track the row numbers themselves. > > This is not so... see pg_fetch_array. Since PHP 4.1.0, you no longer > need the row number.
It may work without, but according to the manual on php.net pg_fetch_array pg_fetch_object pg_fetch_row
REQUIRE a row number. If that is no longer the case as you claim, perphaps someone needs to inform the developers and have them update the documentation.
> > > Now we come to the actual database speed itself. In this regard in most > > applications MySQL is MUCH faster probably because it has to do allot > > less work then PostgreSQL does. For example, lets analyze the most common > > action performed in a database system, a SELECT. When you do a select in > > MySQL, MySQL internally locks the table for the duration of the select. > > PostgreSQL on the other hand does a row level lock, internally, for every > > row you select. > > Is this really what you want? Doesn't this mean that PostgreSQL would > be more efficient for larger user volumes? Locking an entire table > isn't usually a good thing. >
Not necessarily, locking entire table has its pluses and minuses. The BIG minues is that while the entire table is locked you cannot do anything until the lock is released. On the other hand, it is MUCH faster to lock the entire table then the inidividual rows. PostgreSQL would be more effecient on a system that does lots of locking, but on a system without or few locks MySQL will beat it hands down.
Ilia
FUDforum Core Developer
ilia
prohost.org
attached mail follows:
Hi,
On Fri, 5 Jul 2002, Lazor, Ed wrote:
> How many here feel PostgreSQL has surpassed MySQL as the better backend for > PHP? This would be based on performance (speed, scalability, etc.) and > features. >
Surely PostgreSQL!!!
If you aim is creating a "database", then use PostgreSQL. if you want to use a database, for ex. for you web page, use MySQL... (well, use PostgreSQL anyway :-) )
As written on postgresql.org : "The best open source database engine"
BEst regards.
--Devrim GUNDUZ
devrim
oper.metu.edu.tr devrim.gunduz
linux.org.tr
Web : http://devrim.oper.metu.edu.tr -------------------------------------
attached mail follows:
Thanks
"Val Petruchek" <val
alarit.com> escreveu na mensagem
news:20020706005802.3783.qmail
pb1.pair.com...
> FROM THE MANUAL:
>
> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
> header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
> // always modified
> header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
> header("Cache-Control: post-check=0, pre-check=0", false);
> header("Pragma: no-cache"); // HTTP/1.0
>
>
>
> --
> Sincerely, val petruchek
> "Skyhawk" <tecnico
doiscliques.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
> news:20020705223403.38852.qmail
pb1.pair.com...
> > Please, How do I make for my webpage expires before time?
> >
> > Thanks
> >
> > I'm sorry my english, I'm brazilian.
> >
> >
>
>
>
>
attached mail follows:
I have been going fine in a Web Stats program until now.
How can I figure out which day has had the most records(ie visitors) inserted?
There is a time column which has unix timestamp of when the record was inserted.
The best I can think of currently is: To use a while loop to repeatedly query the DB. then use an if statement to replace two variables(UNIX timestamp and number of visitors) if the value returned is higher.
-- JJ Harrison webmastertececo.com www.tececo.com
attached mail follows:
Hello,
I'm currently camping with a problem... I have written a PHP application for a client of mine, however, I do not want have him seeing the source code. I know Zend has the Zend Encoder, however, this piece of software costs $2400 and since this is a one-time encoding request, I think this is a bit too much ...
I want to know if anyone else knows another less expensive option to do this.
Thanks in advance,
Leon Mergen
attached mail follows:
I wanna be able to do some stuff, which involves getting data from my phpBB board.
Member Count: (this section should autoupdate) Number Of Forums: (this section should autoupdate) Highest Post Count: (this section shouldauto update((member) with (post count) posts)) Most Replied to topic: (this section should auto update((topic) with (number of replys) replys))
Can someone give me the code to do this
the page with this on is in my base directory. My forums are in /forums
attached mail follows:
OK, so I upgraded to Apache 1.3.26 on my RedHat machine after the security stuff last week. Saved my old httpd.conf file, just in case, and I did need it. Unfortunately, neither the old file, nor the new file, nor the new file modified to include PHP support, work. I added: LoadModule php4_module libexec/libphp4.so AddModule libphp4.c AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
to httpd.conf in their proper sections.
Also, added index.php as one of the possible index files (along with
index.html and index.shtml)
I checked libexec/; libphp4.so is there.
Then I get this:
[root
saturn /]apachectl start
Syntax error on line 276 of /usr/local/apache/conf/httpd.conf
Cannot add module via name 'libphp4.c'; not in list of loaded modules
OK, so I comment out AddModule libphp4.c, and
[root
saturn /]apachectl start
/usr/local/apache/bin/apachectl start: httpd started
[root
saturn /]
But then, I load up Internet Explorer, go to my site, and get this: "Unhandled File Type" dialog box: Internet Explorer doesn't know how to handle the type of file you have selected. You can choose to save this file to your disk or you can configure a Helper Application for this file. MIME Type: application/x-httpd-php File Name: ----- I downloaded the file via Save File AsŠ and it is the php source for index.php.
So do I need to reinstal PHP, or am I just missing something in the config file?
-- Chris Garaffa #!/usr/local/lib/php $contact_info["Name"] = "Chris Garaffa"; $contact_info["Email"] = "aquaxoptonline.net"; $contact_info["Work"] = "cgaraffa
creativeaim.com"; $contact_info["cell"] = "203.803.9066";
attached mail follows:
Hi,
On Sat, 6 Jul 2002, Chris Garaffa wrote:
> OK, so I upgraded to Apache 1.3.26 on my RedHat machine after the security
> stuff last week. Saved my old httpd.conf file, just in case, and I did need
> it. Unfortunately, neither the old file, nor the new file, nor the new file
> modified to include PHP support, work.
> I added:
> LoadModule php4_module libexec/libphp4.so
> AddModule libphp4.c
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php-source .phps
>
> to httpd.conf in their proper sections.
> Also, added index.php as one of the possible index files (along with
> index.html and index.shtml)
> I checked libexec/; libphp4.so is there.
> Then I get this:
> [root
saturn /]apachectl start
> Syntax error on line 276 of /usr/local/apache/conf/httpd.conf
> Cannot add module via name 'libphp4.c'; not in list of loaded modules
>
> OK, so I comment out AddModule libphp4.c, and
> [root
saturn /]apachectl start
> /usr/local/apache/bin/apachectl start: httpd started
> [root
saturn /]
>
> But then, I load up Internet Explorer, go to my site, and get this:
> "Unhandled File Type" dialog box:
> Internet Explorer doesn't know how to handle the type of file you have
> selected.
> You can choose to save this file to your disk or you can configure a Helper
> Application for this file.
> MIME Type: application/x-httpd-php
> File Name:
> -----
> I downloaded the file via Save File AsŠ and it is the php source for
> index.php.
>
> So do I need to reinstal PHP, or am I just missing something in the config
> file?
You need to compile php with apache again, I think.
Best regards.
--Devrim GUNDUZ
devrim
oper.metu.edu.tr devrim.gunduz
linux.org.tr
Web : http://devrim.oper.metu.edu.tr -------------------------------------
attached mail follows:
Reinstall php. Did you do that when you upgraded Apache? For static link you need to re-install. For DSO not sure I do not run my systems that way. I havent heard of anyone else having problems. I will be updating myself this weekend so...
Also you need to have the apache server "handle" the php type. Thats why IE complains.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]