|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Tue Jul 09 2002 - 13:03:21 CDT
php-general Digest 9 Jul 2002 18:03:21 -0000 Issue 1454
Topics (messages 106241 through 106410):
Re: Editing Word Documents
106241 by: Miguel Cruz
106312 by: Richard Lynch
106324 by: Marek Kilimajer
106333 by: Chris Hewitt
106336 by: Chris Hewitt
106345 by: Marek Kilimajer
106369 by: Chris Hewitt
106384 by: Andrew Chase
Re: mbstring: Japanese conversion not working for me
106242 by: Jean-Christian Imbeault
106245 by: Jean-Christian Imbeault
106246 by: Alberto Serra
106248 by: Alberto Serra
106254 by: Jean-Christian Imbeault
106256 by: Alberto Serra
106258 by: Jean-Christian Imbeault
106262 by: Alberto Serra
106283 by: Jean-Christian Imbeault
106321 by: Alberto Serra
Re: [PHP-DB] Session data not being deleted on browser close.
106243 by: Beau Lebens
Postgres and chinese, korean, japanese charsets
106244 by: Alberto Serra
106247 by: Jean-Christian Imbeault
106249 by: Alberto Serra
106252 by: Jean-Christian Imbeault
Re: if statement
106250 by: Philip Olson
imagecopyresized() problems
106251 by: Lance Earl
106264 by: joakim.andersson.cybercom.se
problem with ftp_put/upload files
106253 by: jusob.free.fr
Re: HELP !!! : Sablotron and not good HTML
106255 by: Markas
Submitting form in new window!
106257 by: Thomas Edison Jr.
106332 by: Chris Hewitt
106335 by: Thomas Edison Jr.
106346 by: Jason Wong
106363 by: Chris Hewitt
Delete me from this fuckin list!!!!!!!! My mailbox is full
106259 by: Erik Hegreberg
PLZ HELP -- - GET & POST form problem
106260 by: Lucam
Re: don't want to receive but email please
106261 by: Brian McGarvie
Grr SQL syntax error silghtly OT
106263 by: JJ Harrison
106266 by: Brian McGarvie
106267 by: joakim.andersson.cybercom.se
106270 by: JJ Harrison
106271 by: joakim.andersson.cybercom.se
106272 by: joakim.andersson.cybercom.se
106276 by: JJ Harrison
Re: Session data not being deleted on browser close.
106265 by: Yasuo Ohgaki
Re: Converting PCX to ...
106268 by: BB
106273 by: BB
106282 by: BB
106311 by: Richard Lynch
106340 by: BB
106342 by: Jay Blanchard
Sending data in table, multiple rows, via mail()
106269 by: Thomas Edison Jr.
106275 by: Jason Wong
106328 by: Thomas Edison Jr.
106334 by: joakim.andersson.cybercom.se
106339 by: Thomas Edison Jr.
Delete me from list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
106274 by: Erik Hegreberg
106279 by: Brian McGarvie
Moderator where are you, delete me from the list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
106277 by: Erik Hegreberg
106278 by: Martin Towell
106285 by: Brian McGarvie
PHP Image Functions
106280 by: Mark Colvin
106322 by: joakim.andersson.cybercom.se
106327 by: Mark Colvin
106330 by: joakim.andersson.cybercom.se
106331 by: Mark Colvin
Bad table iso-8859-1
106281 by: Philippe
Browser Troubles...
106284 by: Brian McGarvie
106287 by: René Moonen
106320 by: Brian McGarvie
EXIF and thumbnails
106286 by: Victor Spång Arthursson
Re: Figuring Out the Best Day in stats program
106288 by: Richard Lynch
Re: Thanks
106289 by: Richard Lynch
Re: PHP/MySQL and parameterized queries
106290 by: Richard Lynch
Re: Error: Parse error: parse error, unexpected $ in...
106291 by: Richard Lynch
Re: Stored Procedures
106292 by: Richard Lynch
Re: Mailing all the elements of a form
106293 by: Richard Lynch
Re: Thanks -> Actually POSTING without javascript
106294 by: Richard Lynch
Re: Problem with SQL query
106295 by: Richard Lynch
Re: transporting variable via post to another site
106296 by: Richard Lynch
Re: suppressing errors with "
"
106297 by: Richard Lynch
106305 by: Richard Lynch
Re: About submitting multipart.forms
106298 by: Richard Lynch
Re: inserting linebrakes in multisite forms
106299 by: Richard Lynch
106301 by: Richard Lynch
Re: Survey: MySQL vs PostgreSQL for PHP
106300 by: Richard Lynch
Re: newbie: a couple basic questions
106302 by: Richard Lynch
106350 by: Alexander Ross
Re: configure breaks at return type of qsort...
106303 by: Richard Lynch
Re: Printing Problem
106304 by: Richard Lynch
Re: Software on web Accessing mySQL/PHP
106306 by: Richard Lynch
Re: Little php execution question.
106307 by: Richard Lynch
Re: A problem in mysql_fetch_array
106308 by: Richard Lynch
Re: Parsing CGI for PHP?
106309 by: Richard Lynch
Re: keep textformating ?
106310 by: Richard Lynch
Re: add to basket
106313 by: Richard Lynch
Re: regex for emoticon codes
106314 by: Richard Lynch
Re: $_REQUEST???
106315 by: Richard Lynch
Re: Passing variables
106316 by: Richard Lynch
Re: Cross-Site Sesison ID Propagation
106317 by: Richard Lynch
Re: Time to Calculate Time
106318 by: Richard Lynch
Re: PHP Script Speed
106319 by: Richard Lynch
Bug in SQL can you help?
106323 by: JJ Harrison
106326 by: Jason Wong
106337 by: joakim.andersson.cybercom.se
106338 by: JJ Harrison
Somehone having a problem to write to the list
106325 by: Alberto Serra
Re: qmail with perl and php
106329 by: adi
Re: getting the IP address off a visitor
106341 by: Kondwani Spike Mkandawire
mbstring: php.ini: need help understanding some settings/functions
106343 by: Jean-Christian Imbeault
Re: Print Question
106344 by: Kondwani Spike Mkandawire
Executing Script through image
106347 by: JJ Harrison
106348 by: BB
106370 by: Marek Kilimajer
I am out of pleases now get me off this fuckin list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
106349 by: Erik Hegreberg
Re: I am out of pleases now get me off this fuckin list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
106351 by: Zac Hillier
another php_functions.c compile problem
106352 by: ldadams.mindspring.com
Server does somethingwierd
106353 by: AcIDeR
106373 by: Analysis & Solutions
php loopholes
106354 by: Chris Taylor
Re: I am out of pleases now get me off this fun list!
106355 by: 1LT John W. Holmes
106359 by: Bret L Conard
106361 by: Brian McGarvie
Re: newbie: question about question marks
106356 by: Alexander Ross
106360 by: Martin Clifford
Re: storing an array in mysql - what's the best data type?
106357 by: Steven Jarvis
Re: HTTPS vs. HTTP ?
106358 by: Brinkman, Theodore
106365 by: Analysis & Solutions
Re: GD Lib
106362 by: Dave MacRae
106404 by: Yang
106407 by: Steve Edberg
Build-up of MySQL Sessions
106364 by: SpamSucks86
106366 by: Martin Clifford
No server var array, why
106367 by: Todd Cary
Trying to locate an image file name from another site
106368 by: Merritt, Dave
hiding submitted variable values in location bar of browser !
106371 by: chand.mihiramail.net
Re:
106372 by: Bogdan Stancescu
Dual Server...
106374 by: Brian McGarvie
106376 by: Collins, Robert
106378 by: Brian McGarvie
"Invalid content" using FastTemplates
106375 by: PeterV
106381 by: PeterV
106382 by: PeterV
Qmail and PHP
106377 by: vins
header()
106379 by: Taylor York
Odd Request: Image 2 HEX
106380 by: JSheble
106397 by: Steve Edberg
Wait/Timeout
106383 by: Michael
106391 by: Michael
106403 by: Marek Kilimajer
Postal / Zip Code Proximity Search
106385 by: Brandon Pearcy
106386 by: Ray Hunter
106389 by: Brian McGarvie
106392 by: Peter J. Schoenster
106405 by: Matt Schroebel
Help w/ Proximity Search
106387 by: Brandon Pearcy
106390 by: Adam Voigt
Re: PHP - not PHP3 or PHP4 extension
106388 by: LLS SYSOP
Stupid install ???
106393 by: Hopp3r
106394 by: Tyler Longren
106410 by: Alberto Serra
Script File Permissions
106395 by: Chris Earle
can I call a variable... using variables?
106396 by: Joseph Szobody
106398 by: Adam Voigt
106400 by: Derick Rethans
106401 by: Martin Clifford
106408 by: Joseph Szobody
106409 by: Chris Earle
passing objects in url
106399 by: Alexander Ross
106402 by: Derick Rethans
106406 by: Marek Kilimajer
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:
On Mon, 8 Jul 2002, David Russell wrote:
> I have just had a request about editing Word Documents...
>
> I have an intranet, which provides access to, amongst others, Word
> Documents about policies, etc. What the guys are looking for is a way to
> do the following:
>
> 1. Show a list of files available for editing
> 2. If a file is clicked, then it is locked for other users (no access)
> 3. The file opens on the client's machine
> 4. The client edits it
> 5. The client then closes the file, it "auto-saves" and he goes about
> his business.
>
> Points 1 through 3 are relatively trivial. Point 4 and 5 (especially 5)
> have me lost.
>
> How do you get a file to be edited, and then automatically returned to
> the server by M$ Word in it's changed format. Is this possible?
>
> How would this change in a database-backended system (including the
> files as BLOBs)?
Assuming you're using Apache, you can use mod_dav (http://www.webdav.org/)
to provide read/write access to files for clients with newer operating
systems (WinXP, OSX, maybe a few earlier versions) over HTTP. Combine this
with a simple locking mechanism in your database (i.e., update file set
locked='1' and lockedat=now() and lockedby=$user where file_id=$file) and
you're good to go.
miguel
attached mail follows:
>I have an intranet, which provides access to, amongst others, Word
>Documents about policies, etc. What the guys are looking for is a way to
>do the following:
>
>1. Show a list of files available for editing
>2. If a file is clicked, then it is locked for other users (no access)
>3. The file opens on the client's machine
>4. The client edits it
>5. The client then closes the file, it "auto-saves" and he goes about
>his business.
>
>Points 1 through 3 are relatively trivial. Point 4 and 5 (especially 5)
>have me lost.
>
>How do you get a file to be edited, and then automatically returned to
>the server by M$ Word in it's changed format. Is this possible?
>
>How would this change in a database-backended system (including the
>files as BLOBs)?
They'd have to be "uploaded" *SOMEHOW*...
If the employees can't do that "by hand", then perhaps some kind of
"scheduled" task on the Win boxes could be programmed to do it.
Don't forget to *UNLOCK* after a successful upload, but not when, not if,
when, the upload fails.
There's simply NO WAY the server can reach out and suck in a file of its own
volitoin... Major privacy/security problem there.
You *COULD* also install Apache + PHP on every desktop, and have them
serving up their edited Word files to the Intranet, and then PHP could use
HTTP to suck them back in...
But that's probably not gonna fly for non-technical reasons. Well, not
counting really bad Security as a "technical" reason.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
The only way I see this can be done is simly let every user mount a share under the same letter, all you need to do then is <a href="file:///X:/directory/file.doc">file</a>, then locking files is up to samba or windows server.
Marek
Richard Lynch wrote:
>>I have an intranet, which provides access to, amongst others, Word >>Documents about policies, etc. What the guys are looking for is a way to >>do the following: >> >>1. Show a list of files available for editing >>2. If a file is clicked, then it is locked for other users (no access) >>3. The file opens on the client's machine >>4. The client edits it >>5. The client then closes the file, it "auto-saves" and he goes about >>his business. >> >>Points 1 through 3 are relatively trivial. Point 4 and 5 (especially 5) >>have me lost. >> >>How do you get a file to be edited, and then automatically returned to >>the server by M$ Word in it's changed format. Is this possible? >> >>How would this change in a database-backended system (including the >>files as BLOBs)? >> >> > >They'd have to be "uploaded" *SOMEHOW*... > >If the employees can't do that "by hand", then perhaps some kind of >"scheduled" task on the Win boxes could be programmed to do it. > >Don't forget to *UNLOCK* after a successful upload, but not when, not if, >when, the upload fails. > >There's simply NO WAY the server can reach out and suck in a file of its own >volitoin... Major privacy/security problem there. > >You *COULD* also install Apache + PHP on every desktop, and have them >serving up their edited Word files to the Intranet, and then PHP could use >HTTP to suck them back in... > >But that's probably not gonna fly for non-technical reasons. Well, not >counting really bad Security as a "technical" reason. > > >
attached mail follows:
I think what the OP meant (certainly what I meant), is that the Word doc is accessed from a normal link. Clients use windows and the browser has the .doc mime type set and spawns Word. The user edits it. I had (vainly) hoped for a way of setting the "File..Save As" to trigger PHP's File Upload facility.
Has anyone had this need, found a way around it or found it not possible?
Thanks for the WebDAV pointer. I shall certainly be looking into that but I had hoped for a simpler way compatible with existing windows versions. Longer term it looks the right way to go.
Thanks Chris
Kevin Stone wrote:
>Of course you can open and edit any file in PHP you just need to know the
>file format. But I highly doubt there is any method using PHP that will
>allow you to prompt the opening of a file into an external application.
>Editing of the file would have to be done in memory, or manually in the
>browser (HTML form, textarea field). Unfortunately Microsoft is notoriously
>protective of its file formats.
>-Kevin
>
>----- Original Message -----
>From: "Chris Hewitt" <g0pae
manordat.demon.co.uk>
>To: "David Russell" <DavidR
BarloworldOptimus.com>
>Cc: "php-general" <php-general
lists.php.net>
>Sent: Monday, July 08, 2002 11:51 AM
>Subject: Re: [PHP] Editing Word Documents
>
>
>>David Russell wrote:
>>
>>>------------snip----------------------
>>>5. The client then closes the file, it "auto-saves" and he goes about
>>>his business.
>>>
>>By coincidence, I'd be very interested in this too, particularly from a
>>linux server.
>>
>>Regards
>>
>>Chris
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
attached mail follows:
Marek,
Yes I thought about windows shares. On the internet (as opposed to intranet) the word "security" leapt to mind and I went away from the idea. Has anyone used Samba shares on the internet or know if its secure/insecure?
Thanks
Chris
Marek Kilimajer wrote:
> The only way I see this can be done is simly let every user mount a > share under the same letter, > all you need to do then is <a > href="file:///X:/directory/file.doc">file</a>, then locking files is up > to samba or windows server. > > Marek > > Richard Lynch wrote: > >>> I have an intranet, which provides access to, amongst others, Word >>> Documents about policies, etc. What the guys are looking for is a >>> way to do the following: >>> >>> 1. Show a list of files available for editing >>> 2. If a file is clicked, then it is locked for other users (no access) >>> 3. The file opens on the client's machine >>> 4. The client edits it >>> 5. The client then closes the file, it "auto-saves" and he goes >>> about his business. >>> >>> Points 1 through 3 are relatively trivial. Point 4 and 5 (especially >>> 5) have me lost. >>> >>> How do you get a file to be edited, and then automatically returned >>> to the server by M$ Word in it's changed format. Is this possible? >>> >>> How would this change in a database-backended system (including the >>> files as BLOBs)? >>> >> >> >> They'd have to be "uploaded" *SOMEHOW*... >> >> If the employees can't do that "by hand", then perhaps some kind of >> "scheduled" task on the Win boxes could be programmed to do it. >> >> Don't forget to *UNLOCK* after a successful upload, but not when, not >> if, >> when, the upload fails. >> >> There's simply NO WAY the server can reach out and suck in a file of >> its own >> volitoin... Major privacy/security problem there. >> >> You *COULD* also install Apache + PHP on every desktop, and have them >> serving up their edited Word files to the Intranet, and then PHP >> could use >> HTTP to suck them back in... >> >> But that's probably not gonna fly for non-technical reasons. Well, not >> counting really bad Security as a "technical" reason. >> >> >> > > >
attached mail follows:
If you can use virtual private network, it is secure. But I don't know about plain Samba solution.
Chris Hewitt wrote:
> Marek, > > Yes I thought about windows shares. On the internet (as opposed to > intranet) the word "security" leapt to mind and I went away from the > idea. Has anyone used Samba shares on the internet or know if its > secure/insecure? > > Thanks > > Chris > > Marek Kilimajer wrote: > >> The only way I see this can be done is simly let every user mount a >> share under the same letter, >> all you need to do then is <a >> href="file:///X:/directory/file.doc">file</a>, then locking files is up >> to samba or windows server. >> >> Marek >> >> Richard Lynch wrote: >> >>>> I have an intranet, which provides access to, amongst others, Word >>>> Documents about policies, etc. What the guys are looking for is a >>>> way to do the following: >>>> >>>> 1. Show a list of files available for editing >>>> 2. If a file is clicked, then it is locked for other users (no access) >>>> 3. The file opens on the client's machine >>>> 4. The client edits it >>>> 5. The client then closes the file, it "auto-saves" and he goes >>>> about his business. >>>> >>>> Points 1 through 3 are relatively trivial. Point 4 and 5 >>>> (especially 5) have me lost. >>>> >>>> How do you get a file to be edited, and then automatically returned >>>> to the server by M$ Word in it's changed format. Is this possible? >>>> >>>> How would this change in a database-backended system (including the >>>> files as BLOBs)? >>>> >>> >>> >>> >>> They'd have to be "uploaded" *SOMEHOW*... >>> >>> If the employees can't do that "by hand", then perhaps some kind of >>> "scheduled" task on the Win boxes could be programmed to do it. >>> >>> Don't forget to *UNLOCK* after a successful upload, but not when, >>> not if, >>> when, the upload fails. >>> >>> There's simply NO WAY the server can reach out and suck in a file of >>> its own >>> volitoin... Major privacy/security problem there. >>> >>> You *COULD* also install Apache + PHP on every desktop, and have them >>> serving up their edited Word files to the Intranet, and then PHP >>> could use >>> HTTP to suck them back in... >>> >>> But that's probably not gonna fly for non-technical reasons. Well, not >>> counting really bad Security as a "technical" reason. >>> >>> >>> >> >> >> > >
attached mail follows:
Thanks
Marek Kilimajer wrote:
> If you can use virtual private network, it is secure. But I don't know > about plain Samba solution. >
attached mail follows:
Hmm, I don't know about intercepting the "Save As..." option from word to trigger a PHP URL, but you could direct people to save their edited word files to a specific directory on a network share on a PHP-enabled server (easy enough on a Windows network, and not too much harder with Samba on Linux)... then you could run a PHP script as a cron job to check for modified files in that directory every five or ten minutes, and have the script upload them as needed.
It's not instantaneous, and there would definitely be some logistics to work out (what if two people are editing the same file at the same time, how do you account for that 5-10 minute lag, etc.) but it might be better than nothing.
-Andy
> -----Original Message-----
> From: Chris Hewitt [mailto:g0pae
manordat.demon.co.uk]
> Sent: Tuesday, July 09, 2002 3:47 AM
> To: Kevin Stone
> Cc: David Russell; php-general
> Subject: Re: [PHP] Editing Word Documents
>
>
> I think what the OP meant (certainly what I meant), is that the Word doc
> is accessed from a normal link. Clients use windows and the browser has
> the .doc mime type set and spawns Word. The user edits it. I had
> (vainly) hoped for a way of setting the "File..Save As" to trigger PHP's
> File Upload facility.
>
> Has anyone had this need, found a way around it or found it not possible?
>
attached mail follows:
Alberto Serra wrote:
>
> I'll be extending an existing content-repository > to add chinese text management in the winter so I'll better start to > worry about it.
Worry and worry a lot ...
> As for your problem, I am afraid you would better turn to a japanese > programmers' mailing list. That's if you speak japanese yourself, but > you seem to do, so...
Nope, I don't speak japanese ...so this ML is all I can turn to :(
Jc
attached mail follows:
Found my problem.$B!!(BThere was no problem. I was trying to test my code by displaying the INPUT and OUTPUT in a web browser. I forgot to realize that my input and oupts were in different encodings.
The browser can only display one encoding charset so of course either the input or the output string I was displaying would be mangled.
So nothing was wrong with the output string I was trying to display. If I changed the document encoding in my browser setting to that of the out put string then I could read the output string fine and the input string became mangled. Just as it should ;)
Jc
attached mail follows:
ðÒÉ×ÅÔ!
Jean-Christian Imbeault wrote: > Worry and worry a lot ...
I already do :( The most terrorizing thing is that desolating "There are no user contributed notes for this page." that appears almost on every function in the online manual.
And the fact that there is no pointer for people in trouble to contact the developers of the library. The few user notes are from us europeans and tend to focus on how you can port utf-8 to old ISO standards.
IMHO such delicate matters would deserve a bit more of a detailed explanation, especially since most of us are going to use those functions to treat strings that they cannot read themselves to check the output result. Anyone knows how to get hold of the mblib developers mail address?
But okay, there *is* such a thing as a chinese/korean/japanese internet, so it means it can be done. Whether you and I can make it... well, it's another question :(
ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
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:
ðÒÉ×ÅÔ!
Jean-Christian Imbeault wrote: > Found my problem.There was no problem. I was trying to test my code by > displaying the INPUT and OUTPUT in a web browser. I forgot to realize > that my input and oupts were in different encodings. >
Now THAT'S NEWS! :) Okay, just put the SPAN thing around your different output sections and you'll be able to check both in and out on the same page :)
uuuf... I feel better now :)
ðÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
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:
Alberto Serra wrote:
> > Now THAT'S NEWS! :)
Tell me about it!
> Okay, just put the SPAN thing around your different > output sections and you'll be able to check both in and out on the same > page :)
Can you explain that SPAN thing a bit more. You said to use:
<SPAN charset="yourset" lang="yourlang"> your text </SPAN>
I can understand the charset param but what is the lang param used for?
Jc
attached mail follows:
ðÒÉ×ÅÔ!
> Can you explain that SPAN thing a bit more. You said to use: > > <SPAN charset="yourset" lang="yourlang"> your text </SPAN> > > I can understand the charset param but what is the lang param used for?
Basically it might even be useless. But id does not harm to use it. Like this:
<BODY>
this text uses the header charset language setting
<SPAN charset="KOI-8" lang="ru"> This is russian text in KOI-8 format Á ×ÏÔ ÜÔÏ ÒÏÄÎÏÊ ÑÚÙË! </SPAN>
This again uses your header settings
<SPAN charset="ISO-8859-1" lang="en"> This is english text in basic format yes, it is </SPAN>
This again uses your header settings
</BODY>
Note that SPAN will not change anything in your formatting (like tables and so on).
Another (and safer) way to do it, is to define classes in a CSS sheet and apply the to SPAN areas. So you keep a centralized control on your char formatting.
But if you just need it to debug output you can be happy with a direct charset/lan specification.
ðÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
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 tried the following but it did not seem to do anything.
[some text here in japanese ...]
1 : 111$B$"$$$&$($*!!4A;z$R$i$,$J(B1235<BR>
[now i want to change the charset so]
<SPAN charset="EUC" lang="japanese"><BR> 2 : 111$B!"!V!"!"!"%r!"%#!"%'!#!#%(%A%5yh%a!"r&%c!"%O(B1235<BR> </SPAN>
(I tried EUC/EUC-JP/EUC_JP but nothing worked).
Jc
attached mail follows:
ðÒÉ×ÅÔ!
> <SPAN charset="EUC" lang="japanese"><BR> > 2 : 111??????????????????????1235<BR> > </SPAN>
language codes are zh = chinese ko = korean ja = japanese
the charset codes must be fully specified, such as ISO-2022-JP (the one you are using yourself) SHIFT-JIS EUC-JP
otherwise it will make no sense to your browser. Usually looking at what you can find in your "preferences->navigator->languages" will do the trick (talking about Mozilla).
EUC-KR would mean korean, and so on, which is which just EUC will not mean anything.
ðÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
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:
Alberto Serra wrote:
> > the charset codes must be fully specified, such as > ISO-2022-JP (the one you are using yourself) > SHIFT-JIS > EUC-JP
I tried EUC-JP and ISO-2022-JPand neither worked. Ah well ... so much for a nice idea quick hack to displaying multiple charsets at once.
Jc
attached mail follows:
ðÒÉ×ÅÔ!
Jean-Christian Imbeault wrote: > I tried EUC-JP and ISO-2022-JPand neither worked. Ah well ... so much > for a nice idea quick hack to displaying multiple charsets at once.
They should. I checked out w3c.org at that and it definitely should. No exception for japanese mentioned anywhere.
The two parameters actually open a local exception from the
<meta http-equiv="Content-Language" content="{LANCODE}"> <meta http-equiv="Content-Type" content="text/html; charset={CHARSET}">
headers. And SPAN sections can be nested. At least, so the standard goes.
Besides, while checking the docs I stepped onto something really funny (to say the very least). I quote from
http://www.htmlcompendium.org/attributes-list/attributes-notes/lang.htm
------------------- The argument to the "lang=" attribute is made up of two parts; a primary code and an optional subcode (separated by a "-" hyphen). The primary code is a two character language code. i.e.<tag lang="en">
The subcode is "understood to be a (ISO 3166) country code". However, W3C also gives several examples: <tag lang="en-US"> <tag lang="en-cockney"> <tag lang="i-cherokee">
They also propose a method of handling such "artificial languages" as Elfish and Klingon. For such languages they propose the primary code of "x" ---------------------
Now I hope I shall never manage a porting to a Klingon repository LOLOL
Anyway, if you do not need it for your application but just for a debugging procedure you can just forget about it :)
ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
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:
have you closed all browser windows?
eg. if you open your browser, then spawn a new window (ctrl-n or similar) then do something with one of them which creates session vars, then close that window, then open a new one again, the session has probably remained active because the first window was still open
can you provide a code sample of how you are using the session variables? have you modified any of the expiry times etc?
Beau
// -----Original Message-----
// From: Youngie [mailto:youngie
youngie.com]
// Sent: Tuesday, 9 July 2002 12:42 PM
// To: php-general
lists.php.net; php-db
lists.php.net
// Subject: [PHP-DB] Session data not being deleted on browser close.
//
//
// Why would my session data not be deleted after my browser is closed?
//
// I can set some session variables, close my browser, reopen
// them and the old
// values are still present,
// I can verify this by seeing that the file still containts my
// session data
// and values.
//
// Thanks
//
// John.
//
//
//
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
//
attached mail follows:
ðÒÉ×ÅÔ!
Jean-Christian Imbeault wrote: > Alberto Serra wrote: >> I hope you mean one charset per language. Otherwise I can just cancel >> POstgres from my list of usable engines. But yes, it can't be just one. > > I'm no pgsql expert but I think that yes, it will only accept input in > one charset. But for charsets that use only 8-bits I think you can > insert data that is in more than one charset. > > But for charsets that use more than 8-bits I think pgsql actually checks > that the input is in the charset the DB expects it to be in.
Can anyone say something about this? It would mean that a content repository ported to Postgres would not be able to hold chinese, korean and japanese content at the same time. Quite a big minus, I'd say.
Any chinese, korean or japanese programmers on this list? (I put the countries list in alphabetical order, no personal preferences implied).
ðÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
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:
Don't know the answer to your question exactly but how about transforming all user input into something like unicode/UTF-8 (or UTF-16) and *then* putting it into the DB?
That way all the DB input has the same charset.
Jc
Alberto Serra wrote:
> ðÒÉ×ÅÔ!
>
> Jean-Christian Imbeault wrote:
>
>> Alberto Serra wrote:
>>
>>> I hope you mean one charset per language. Otherwise I can just cancel
>>> POstgres from my list of usable engines. But yes, it can't be just one.
>>
>>
>> I'm no pgsql expert but I think that yes, it will only accept input in
>> one charset. But for charsets that use only 8-bits I think you can
>> insert data that is in more than one charset.
>>
>> But for charsets that use more than 8-bits I think pgsql actually
>> checks that the input is in the charset the DB expects it to be in.
>
>
> Can anyone say something about this? It would mean that a content
> repository ported to Postgres would not be able to hold chinese, korean
> and japanese content at the same time. Quite a big minus, I'd say.
>
> Any chinese, korean or japanese programmers on this list? (I put the
> countries list in alphabetical order, no personal preferences implied).
>
> ðÏËÁ
> áÌØÂÅÒÔÏ
> ëÉÅ×
>
>
>
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
>
> 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:
ðÒÉ×ÅÔ!
Jean-Christian Imbeault wrote: > Don't know the answer to your question exactly but how about > transforming all user input into something like unicode/UTF-8 (or > UTF-16) and *then* putting it into the DB? > > That way all the DB input has the same charset.
That was my first idea, yes. Normalizing to utf and get read of whatever trouble might lie on the way. Then I read on the MBlib docs that japanase chars may take up to 6 byte each, and that would hardly fit into a utf-16 format.
Again, all my worries are probably based on the sole fact that I never treated chinese/korean/japanese text in my life so I easily get deceived in my elaboration.
Thanks a lot for starting the subject. You saved me a lot of trouble in the coming winter :)
ðÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
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:
Alberto Serra wrote:
> > That was my first idea, yes. Normalizing to utf and get read of whatever > trouble might lie on the way. Then I read on the MBlib docs that > japanase chars may take up to 6 byte each, and that would hardly fit > into a utf-16 format.
True but I think that is for an encoding other than UTF (because of the escape sequences they use?). UTF-16 should be safe.
Jc
attached mail follows:
> Thanks the array worked just perfect. Where do you find stuff like > this I looked all over the manual and could not find anything that > told me how to do this.
A good way to learn this sorta thing is with experience. The more you learn and understand, the easier it is to write your own useful code, from scratch.
Read the manual section on arrays. Twice. And after awhile your brain will go crazy with ideas :)
http://www.php.net/manual/en/language.types.array.php
Regards, Philip Olson
> MT> You can do this:
>
> MT> if ($type == "test1" || $type == "test2" || $type == "test3") {
>
> MT> or, what I prefer in this case
>
> MT> if (in_array($type, array("test1", "test2", "test3"))) {
>
> MT> Martin
>
> MT> -----Original Message-----
> MT> From: rdkurth
starband.net [mailto:rdkurth
starband.net]
> MT> Sent: Tuesday, July 09, 2002 2:11 PM
> MT> To: php-general
> MT> Subject: [PHP] if statement
>
>
>
> MT> Is it possible to do something like this all on one line.
> MT> What I need is if any one of these are true then run the script
>
> MT> if($type=="test1")or($type=="test2")or($type=="test3"){
>
>
>
>
>
>
> --
> Best regards,
> rdkurth mailto:rdkurth
starband.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I am trying to create a piece of code that will create and display thumbnail image. When trying to send the image to a browser, I see binary data rather then an image. You can see the problem at www.dallypost.com/a/test.php
The troubled cose for this page follows:
<?PHP
//a master image may be any image of any size
//If the master image exists, the thumb will be created and output to the browser
//requires path from the file system home directory as $master_image_path
//requires the name of the master image as $master image
//test variables -- will eventually be defined by the calling module $master_image_path = "/home/html/74ranch/uploads/"; $master_image = "chex34.jpg";
if(!isset($thumb_width)) { $thumb_width = 80; }//end if
//make sure that the master file exists $master_image_all = "$master_image_path"; $master_image_all .= "$master_image";
//remove this section after coding is complete $master_image_all_link = "/74ranch/uploads/"; $master_image_all_link .= "$master_image"; print("<img src = $master_image_all_link>");
if(file_exists($master_image_all)) { $size = getimagesize("$master_image_all"); $width = $size[0]; $height = $size[1];
//calculate thumb height $factor = $width / $thumb_width; $thumb_height = $height * $factor; $thumb_height = $thumb_height * .1; $thumb_height = round($thumb_height); print("<P> Origional: height: $height width: $width<BR>Target: height:$thumb_height width: $thumb_width<P>"); //build the thumbnail $src_img = imagecreatefromjpeg("$master_image_all"); $dst_img = imagecreate($thumb_width,$thumb_height); //$dst_img = imagecreatetruecolor($thumb_width,$thumb_height);//requires gd 2.0 or higher print("<P>Variables that will be inserted into the imagecopyresized function"); print("<BR>width: $width"); print("<br>height $height"); print("<br>thumb_width $thumb_width"); print("<br>thumb_height $thumb_height"); print("<P>Display the new thumb image<P>"); imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $thumb_width, $thumb_height, $width, $height); //imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_width, $thumb_height, $width, $height);//requires gd 2.0 or higher //imagejpeg($dst_img, "path and file name", 75);//saves the image to a file imagejpeg($dst_img, '', 50);//sends the image to the browser imagedestroy($src_img); imagedestroy($dst_img);
}//end if ?>
attached mail follows:
Hi,
Output the correct headers before you output the image ie header("Content-type: image/jpeg"); imagejpeg($dst_img, '', 50);
Remove all print statements from this code. You cannot output anything but the headers and the image itself.
Use imagecopyresampled if you can. It gives much better quality.
Then to output the image from another script (not within test.php) use this: <img src="test.php">
Regards Joakim Andersson
> -----Original Message-----
> From: Lance Earl [mailto:lance
dallypost.com]
> Sent: Tuesday, July 09, 2002 8:54 AM
> To: php-general
lists.php.net
> Subject: [PHP] imagecopyresized() problems
>
>
> I am trying to create a piece of code that will create and display
> thumbnail image. When trying to send the image to a browser, I see
> binary data rather then an image. You can see the problem at
> www.dallypost.com/a/test.php
>
> The troubled cose for this page follows:
>
> <?PHP
>
> //a master image may be any image of any size
>
> //If the master image exists, the thumb will be created and output to
> the browser
>
> //requires path from the file system home directory as
> $master_image_path
>
> //requires the name of the master image as $master image
>
>
> //test variables -- will eventually be defined by the calling module
> $master_image_path = "/home/html/74ranch/uploads/";
> $master_image = "chex34.jpg";
>
>
>
> if(!isset($thumb_width))
> {
> $thumb_width = 80;
> }//end if
>
>
> //make sure that the master file exists
> $master_image_all = "$master_image_path";
> $master_image_all .= "$master_image";
>
> //remove this section after coding is complete
> $master_image_all_link = "/74ranch/uploads/";
> $master_image_all_link .= "$master_image";
> print("<img src = $master_image_all_link>");
>
> if(file_exists($master_image_all))
> {
> $size = getimagesize("$master_image_all");
> $width = $size[0];
> $height = $size[1];
>
>
> //calculate thumb height
> $factor = $width / $thumb_width;
> $thumb_height = $height * $factor;
> $thumb_height = $thumb_height * .1;
> $thumb_height = round($thumb_height);
> print("<P> Origional: height: $height width:
> $width<BR>Target:
> height:$thumb_height width: $thumb_width<P>");
>
> //build the thumbnail
> $src_img = imagecreatefromjpeg("$master_image_all");
> $dst_img = imagecreate($thumb_width,$thumb_height);
> //$dst_img =
>
> imagecreatetruecolor($thumb_width,$thumb_height);//requires
> gd 2.0
> or higher
>
> print("<P>Variables that will be inserted into
> the imagecopyresized
> function");
> print("<BR>width: $width");
> print("<br>height $height");
> print("<br>thumb_width $thumb_width");
> print("<br>thumb_height $thumb_height");
>
> print("<P>Display the new thumb image<P>");
>
> imagecopyresized($dst_img, $src_img, 0, 0, 0,
> 0, $thumb_width,
> $thumb_height, $width, $height);
>
>
> //imagecopyresampled($dst_img, $src_img, 0, 0,
> 0, 0, $thumb_width,
> $thumb_height, $width, $height);//requires gd
> 2.0 or higher
>
>
> //imagejpeg($dst_img, "path and file name",
> 75);//saves the image to
> a file
>
> imagejpeg($dst_img, '', 50);//sends the image
> to the browser
>
> imagedestroy($src_img);
> imagedestroy($dst_img);
>
>
>
> }//end if
> ?>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hello I would like to create a php script to upload file. With the POST method, I can't upload files whose size are more than 1 Mo (but my php.ini should allow up to 30 Mo, and the hidden field MAX_FILE_SIZE too!). So, I use a ftp connection to upload. But I have always the same error: Warning: error opening C:\folder\file.ext in /my/script.php when using ftp_put
local server: linux RedHat 7.3, php 4.1.2, apache 1.3.23, proftpd 1.2.5 client: IE 5.5 on Windows NT
Thanks Julien SObrier
attached mail follows:
But how with the case when I need xml like tag for some reason, but which in fact is NOT an xml/html tag, and generally the output doc is not xml/html document. but I just need this constructtion <...> or any of these symbols??? Or you mean that XSL is only capable of generating another (and the only) XML like document?
"Michael Sweeney" <sweeney
verisity.com> wrote in message
news:1026172583.11378.87.camel
catalyst...
> The way out is to write standards compliant markup (meaning 'good'
> HTML). Read the RFCs, use a validator, Sablotron will stop complaining.
> (eg: <img src="path/to/image" /> ) <- (note method to close an image
> tag)
>
> ..mike..
>
> On Mon, 2002-07-08 at 16:52, Markas wrote:
> > Sablotron seems not to like, when in my xsl file occurs "not good" html,
> > like <IMG ...> (without closing tag), so how can I deal with this
> > problem?!!! Checking and fixing all my HTML , which I want to use in XSL
is
> > not the way for me..., so I really HAVE to produce bad "not XML like"
HTML,
> > so I'll have to keep it in my XSL files, and Sablotron doesnt like
that!!!
> >
> > Is there any way OUT?!!!
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi,
When i press the Submit button, i would like it to open in a new Javascript Windows with well-defined characteristics like size, width etc.
I create a window.open function and gave the name of my PHP page .. but the Form Variables are not passing into it..
Thanks, T. Edison Jr.
=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : abraxastech
yahoo.com
Tel : 91-4546512/4522124
*******************************************
__________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com
attached mail follows:
Thomas,
If using JavaScript to open the window, then php is not going to be able to transfer variables as it is not being used. As you form is not being submitted (you intercepted it with a JavaScript call, right?) then you need to transfer them manually by getting the JavaScript to add the variables to the end of the url as GET data.
If I have this wrong (and I've had to make some assumptions) then please show us some code.
HTH Chris
Thomas Edison Jr. wrote:
>Hi,
>
>When i press the Submit button, i would like it to
>open in a new Javascript Windows with well-defined
>characteristics like size, width etc.
>
>I create a window.open function and gave the name of
>my PHP page .. but the Form Variables are not passing
>into it..
>
>Thanks,
>T. Edison Jr.
>
>
>
>=====
>Rahul S. Johari (Director)
>******************************************
>Abraxas Technologies Inc.
>Homepage : http://www.abraxastech.com
>Email : abraxastech
yahoo.com
>Tel : 91-4546512/4522124
>*******************************************
>
>__________________________________________________
>Do You Yahoo!?
>Sign up for SBC Yahoo! Dial - First Month Free
>http://sbc.yahoo.com
>
attached mail follows:
Hi,
Ok, let me show some code :
<form name=\"drama\" action=\"add2cart.php\" method=post target=\"blank\"> <input type=hidden name=sessid value= $PHPSESSID > <input type=hidden name=proid value= $result[vProID] > <input type=hidden name=proname value= $result[vProName] > <font color=#000000 face=verdana size=2>Quantity <input type=\"text\" size=3 name=\"qty\"> <input type=\"submit\" value=\"Add To Cart\"></font>
This is the SUBMIT button that submits the form alongwith the Form Variables to a file called "Add2Cart.php" !! But this file simply opens in an unadministered new window.
i would like to use the window.open function, or whatever can accomplish this, to restrict parameters of the window in which add2cart.php opens, at the same time the variables of my form should get submitted into the add2cart.php
T. Edison Jr.
__________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com
attached mail follows:
On Tuesday 09 July 2002 19:25, Thomas Edison Jr. wrote: > Hi, > > Ok, let me show some code : > > <form name=\"drama\" action=\"add2cart.php\" > method=post target=\"blank\"> > <input type=hidden name=sessid value= $PHPSESSID > > <input type=hidden name=proid value= > $result[vProID] > > <input type=hidden name=proname value= > $result[vProName] > > <font color=#000000 face=verdana size=2>Quantity > <input type=\"text\" size=3 name=\"qty\"> <input > type=\"submit\" value=\"Add To Cart\"></font> > > > This is the SUBMIT button that submits the form > alongwith the Form Variables to a file called > "Add2Cart.php" !! But this file simply opens in an > unadministered new window. > > i would like to use the window.open function, or > whatever can accomplish this, to restrict parameters > of the window in which add2cart.php opens, at the same > time the variables of my form should get submitted > into the add2cart.php
Attach a javascript event to the submit button such that on submit opens up a window with your required specs. Then set the url of that window to point to add2cart.php, and also attach the form values to the url.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* People need good lies. There are too many bad ones. -- Bokonon, "Cat's Cradle" by Kurt Vonnegut, Jr. */
attached mail follows:
Thomas,
Yes, I understand what you want to do, but this is a limitation of HTML itself, rather than PHP. There are no HTML commands for doing this. JavaScript, being client side, has much more control over the browser and can define window size etc. If, on your submit button, you use the onClick event to submit the form, then the only way to pass the data is by making up a GET string in the url.
At least, I have not found a way around this. The above solution is what I use. This assumes the client browser has JS turned on too, which in my case (on an intranet application) I can specify.
HTH Chris
Thomas Edison Jr. wrote:
><input >type=\"submit\" value=\"Add To Cart\"></font> > > >This is the SUBMIT button that submits the form >alongwith the Form Variables to a file called >"Add2Cart.php" !! But this file simply opens in an >unadministered new window. >
attached mail follows:
attached mail follows:
Hi, I've this problem:
Server Apache / PHP v.4.1.2 At the moment the parametere register_globals is still set to on; I'm triyng to use $_POST and $_FILES between different pages, but variables are always empty !!!
Page1 ---------------------------------------------------------------------------- ------------------------ <form method="POST" action="test_upload_conferma.php" ENCTYPE "multipart/form-data" > <input type="file" name="img1"> <input type="text" name="mytext"> <input type="submit" name="Inserisci" value="Inserisci"> </form>
Page2 ---------------------------------------------------------------------------- ---------------------- $text = $_POST['mytext']; $files = $_FILES['img1']['name']; $filestmp = $_FILES['img1']['tmp_name'];
these variables are empty..................
attached mail follows:
> only if user stupidity can be considered a virus.
It can indeed ;)
attached mail follows:
Sorry :}
I get a SQL syntax error at line two of the query:
$query = "select 2count(*) as tececo_stats.views, meta_data.title from meta_data, tececo_stats where meta_data.id = tececo_stats.id";
I have stared at this 'till i felt dizzy. can someone tell me what I am doing wrong so that I can learn from it?
Thanks in advance
-- JJ Harrison webmastertececo.com www.tececo.com
attached mail follows:
2count(*)? don't look right
> -----Original Message-----
> From: JJ Harrison [mailto:webmaster
tececo.com]
> Sent: 09 July 2002 9:10 AM
> To: php-general
lists.php.net
> Subject: [PHP] Grr SQL syntax error silghtly OT
>
>
> Sorry :}
>
> I get a SQL syntax error at line two of the query:
>
> $query = "select
> 2count(*) as tececo_stats.views, meta_data.title
> from
> meta_data, tececo_stats
> where
> meta_data.id = tececo_stats.id";
>
> I have stared at this 'till i felt dizzy. can someone tell me
> what I am
> doing wrong so that I can learn from it?
>
> Thanks in advance
>
>
> --
> JJ Harrison
> webmaster
tececo.com
> www.tececo.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
I assume that 2count should really be count and 2 is just the line-number you added in this post...
tececo_stats.views is (probably) the name of a column and cannot be used as an alias. Change it to something else. change count(*) to count(tececo_stats.*) (I think that's what you want) And you probably need a group by-statement at the end: GROUP BY whatever_you_need_to_group_by
It's really difficult to answer your questions without the table designs, the error message and what you expect this query to do. And, it's not slightly OT. It's totally OT. :-)
Regards Joakim Andersson
> -----Original Message-----
> From: JJ Harrison [mailto:webmaster
tececo.com]
> Sent: Tuesday, July 09, 2002 10:10 AM
> To: php-general
lists.php.net
> Subject: [PHP] Grr SQL syntax error silghtly OT
>
>
> Sorry :}
>
> I get a SQL syntax error at line two of the query:
>
> $query = "select
> 2count(*) as tececo_stats.views, meta_data.title
> from
> meta_data, tececo_stats
> where
> meta_data.id = tececo_stats.id";
>
> I have stared at this 'till i felt dizzy. can someone tell me
> what I am
> doing wrong so that I can learn from it?
>
> Thanks in advance
>
>
> --
> JJ Harrison
> webmaster
tececo.com
> www.tececo.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
table structure for tececo stats(Stores information about the visitors to my site.visited is either 0 or 1 depending on whether or not the stats cookie has been set):
id int(11) unsigned NOT NULL auto_increment, page_id int(11) NOT NULL default '0', visited int(11) NOT NULL default '0', time int(11) NOT NULL default '0', remote_dns varchar(100) NOT NULL default '', remote_ip varchar(15) NOT NULL default '', referer varchar(200) NOT NULL default '', browser varchar(100) NOT NULL default '', system varchar(100) NOT NULL default '', PRIMARY KEY (id), KEY page_id (page_id,time)
table structure for meta_data(contains information about the pages in my website):
id int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned NOT NULL default '0', title varchar(200) NOT NULL default '', page_name varchar(75) NOT NULL default '', description text NOT NULL, keywords text NOT NULL, PRIMARY KEY (id), KEY pid (pid)
main file(required.php automaticly does a DB connect and is used elsewhere so I know is not the problem). <? include "includes/required.php"; do_html_header('Page Detail Statistics');
$query = "select count(tececo_stats.*) as tececo_stats.views, meta_data.title from meta_data, tececo_stats where meta_data.id = tececo_stats.id order by meta_data.id group by meta_data.id"; $result = mysql_query($query) or die("Query failed: $query<br>" . mysql_error()); $num_results = mysql_num_rows($result); ?> <table width="500"> <tr style="black_row"><td width="200">Page Name</td><td>Tota;Number of Sessions</td></tr> <? for ($i=0; $i < $num_results; $i++) { $row = mysql_fetch_array($result); echo '<tr><td>'.$row['meta_data.title'].'</td><td>'.$row['tececo_stats.views'].'< /td></tr>'; } ?> </table> <? do_html_footer(); ?>
error message: Query failed: select count(tececo_stats.*) as tececo_stats.views, meta_data.title from meta_data and tececo_stats where meta_data.id = tececo_stats.id order by meta_data.id You have an error in your SQL syntax near '*) as tececo_stats.views, meta_data.title from meta_data and tececo_stats whe' at line 2
What I want to do: This is essentially a script for a stats program that I am writting that returns the number of hits for each page. Instead of looping a query I decieded to try and join the two tables to make it more efficiant. I am trying to get it to work with hits now than make it sessions later.
I hope this is enough info and thank you for your help.
-- JJ Harrison webmastertececo.com www.tececo.com
"Joakim Andersson" <joakim.andersson
cybercom.se> wrote in message news:791CA4EB1F1AD2119BB900062905C91F02CE800C
adam.cybercom.se... > I assume that 2count should really be count and 2 is just the line-number > you added in this post... > > tececo_stats.views is (probably) the name of a column and cannot be used as > an alias. Change it to something else. > change count(*) to count(tececo_stats.*) (I think that's what you want) > And you probably need a group by-statement at the end: GROUP BY > whatever_you_need_to_group_by > > It's really difficult to answer your questions without the table designs, > the error message and what you expect this query to do. And, it's not > slightly OT. It's totally OT. :-) > > Regards > Joakim Andersson > > > > -----Original Message----- > > From: JJ Harrison [mailto:webmaster
tececo.com] > > Sent: Tuesday, July 09, 2002 10:10 AM > > To: php-general
lists.php.net > > Subject: [PHP] Grr SQL syntax error silghtly OT > > > > > > Sorry :} > > > > I get a SQL syntax error at line two of the query: > > > > $query = "select > > 2count(*) as tececo_stats.views, meta_data.title > > from > > meta_data, tececo_stats > > where > > meta_data.id = tececo_stats.id"; > > > > I have stared at this 'till i felt dizzy. can someone tell me > > what I am > > doing wrong so that I can learn from it? > > > > Thanks in advance > > > > > > -- > > JJ Harrison > > webmaster
tececo.com > > www.tececo.com > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
I would try something like this...
SELECT COUNT(tececo_stats.id) as num_hits, meta_data.title FROM tececo_stats, meta_data WHERE meta_data.id = tececo_stats.page_id GROUP BY tececo_stats.page_id ORDER BY num_hits DESC
/Joakim
> -----Original Message-----
> From: JJ Harrison [mailto:webmaster
tececo.com]
> Sent: Tuesday, July 09, 2002 11:07 AM
> To: php-general
lists.php.net
> Subject: Re: [PHP] Grr SQL syntax error silghtly OT
>
>
> table structure for tececo stats(Stores information about the
> visitors to my
> site.visited is either 0 or 1 depending on whether or not the
> stats cookie
> has been set):
>
> id int(11) unsigned NOT NULL auto_increment,
> page_id int(11) NOT NULL default '0',
> visited int(11) NOT NULL default '0',
> time int(11) NOT NULL default '0',
> remote_dns varchar(100) NOT NULL default '',
> remote_ip varchar(15) NOT NULL default '',
> referer varchar(200) NOT NULL default '',
> browser varchar(100) NOT NULL default '',
> system varchar(100) NOT NULL default '',
> PRIMARY KEY (id),
> KEY page_id (page_id,time)
>
> table structure for meta_data(contains information about the
> pages in my
> website):
>
> id int(11) unsigned NOT NULL auto_increment,
> pid int(11) unsigned NOT NULL default '0',
> title varchar(200) NOT NULL default '',
> page_name varchar(75) NOT NULL default '',
> description text NOT NULL,
> keywords text NOT NULL,
> PRIMARY KEY (id),
> KEY pid (pid)
>
> main file(required.php automaticly does a DB connect and is
> used elsewhere
> so I know is not the problem).
> <?
> include "includes/required.php";
> do_html_header('Page Detail Statistics');
>
> $query = "select
> count(tececo_stats.*) as tececo_stats.views, meta_data.title
> from
> meta_data, tececo_stats
> where
> meta_data.id = tececo_stats.id
> order by meta_data.id
> group by meta_data.id";
> $result = mysql_query($query) or die("Query failed: $query<br>" .
> mysql_error());
> $num_results = mysql_num_rows($result);
> ?>
> <table width="500">
> <tr style="black_row"><td width="200">Page Name</td><td>Tota;Number of
> Sessions</td></tr>
> <?
> for ($i=0; $i < $num_results; $i++)
> {
> $row = mysql_fetch_array($result);
> echo
> '<tr><td>'.$row['meta_data.title'].'</td><td>'.$row['tececo_st
> ats.views'].'<
> /td></tr>';
> }
> ?>
> </table>
> <?
> do_html_footer();
> ?>
>
> error message:
> Query failed: select count(tececo_stats.*) as tececo_stats.views,
> meta_data.title from meta_data and tececo_stats where meta_data.id =
> tececo_stats.id order by meta_data.id
> You have an error in your SQL syntax near '*) as tececo_stats.views,
> meta_data.title from meta_data and tececo_stats whe' at line 2
>
> What I want to do: This is essentially a script for a stats
> program that I
> am writting that returns the number of hits for each page. Instead of
> looping a query I decieded to try and join the two tables to
> make it more
> efficiant. I am trying to get it to work with hits now than
> make it sessions
> later.
>
> I hope this is enough info and thank you for your help.
>
>
> --
> JJ Harrison
> webmaster
tececo.com
> www.tececo.com
>
>
> "Joakim Andersson" <joakim.andersson
cybercom.se> wrote in message
> news:791CA4EB1F1AD2119BB900062905C91F02CE800C
adam.cybercom.se...
> > I assume that 2count should really be count and 2 is just
> the line-number
> > you added in this post...
> >
> > tececo_stats.views is (probably) the name of a column and
> cannot be used
> as
> > an alias. Change it to something else.
> > change count(*) to count(tececo_stats.*) (I think that's
> what you want)
> > And you probably need a group by-statement at the end: GROUP BY
> > whatever_you_need_to_group_by
> >
> > It's really difficult to answer your questions without the
> table designs,
> > the error message and what you expect this query to do.
> And, it's not
> > slightly OT. It's totally OT. :-)
> >
> > Regards
> > Joakim Andersson
> >
> >
> > > -----Original Message-----
> > > From: JJ Harrison [mailto:webmaster
tececo.com]
> > > Sent: Tuesday, July 09, 2002 10:10 AM
> > > To: php-general
lists.php.net
> > > Subject: [PHP] Grr SQL syntax error silghtly OT
> > >
> > >
> > > Sorry :}
> > >
> > > I get a SQL syntax error at line two of the query:
> > >
> > > $query = "select
> > > 2count(*) as tececo_stats.views, meta_data.title
> > > from
> > > meta_data, tececo_stats
> > > where
> > > meta_data.id = tececo_stats.id";
> > >
> > > I have stared at this 'till i felt dizzy. can someone tell me
> > > what I am
> > > doing wrong so that I can learn from it?
> > >
> > > Thanks in advance
> > >
> > >
> > > --
> > > JJ Harrison
> > > webmaster
tececo.com
> > > www.tececo.com
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Forgot. You have to change $row['tececo_stats.views'] to $row['num_hits']
/J
> -----Original Message-----
> From: joakim.andersson
cybercom.se
> [mailto:joakim.andersson
cybercom.se]
> Sent: Tuesday, July 09, 2002 11:15 AM
> To: php-general
lists.php.net
> Subject: RE: [PHP] Grr SQL syntax error silghtly OT
>
>
> I would try something like this...
>
> SELECT COUNT(tececo_stats.id) as num_hits, meta_data.title
> FROM tececo_stats, meta_data
> WHERE meta_data.id = tececo_stats.page_id
> GROUP BY tececo_stats.page_id
> ORDER BY num_hits DESC
>
> /Joakim
>
> > -----Original Message-----
> > From: JJ Harrison [mailto:webmaster
tececo.com]
> > Sent: Tuesday, July 09, 2002 11:07 AM
> > To: php-general
lists.php.net
> > Subject: Re: [PHP] Grr SQL syntax error silghtly OT
> >
> >
> > table structure for tececo stats(Stores information about the
> > visitors to my
> > site.visited is either 0 or 1 depending on whether or not the
> > stats cookie
> > has been set):
> >
> > id int(11) unsigned NOT NULL auto_increment,
> > page_id int(11) NOT NULL default '0',
> > visited int(11) NOT NULL default '0',
> > time int(11) NOT NULL default '0',
> > remote_dns varchar(100) NOT NULL default '',
> > remote_ip varchar(15) NOT NULL default '',
> > referer varchar(200) NOT NULL default '',
> > browser varchar(100) NOT NULL default '',
> > system varchar(100) NOT NULL default '',
> > PRIMARY KEY (id),
> > KEY page_id (page_id,time)
> >
> > table structure for meta_data(contains information about the
> > pages in my
> > website):
> >
> > id int(11) unsigned NOT NULL auto_increment,
> > pid int(11) unsigned NOT NULL default '0',
> > title varchar(200) NOT NULL default '',
> > page_name varchar(75) NOT NULL default '',
> > description text NOT NULL,
> > keywords text NOT NULL,
> > PRIMARY KEY (id),
> > KEY pid (pid)
> >
> > main file(required.php automaticly does a DB connect and is
> > used elsewhere
> > so I know is not the problem).
> > <?
> > include "includes/required.php";
> > do_html_header('Page Detail Statistics');
> >
> > $query = "select
> > count(tececo_stats.*) as tececo_stats.views, meta_data.title
> > from
> > meta_data, tececo_stats
> > where
> > meta_data.id = tececo_stats.id
> > order by meta_data.id
> > group by meta_data.id";
> > $result = mysql_query($query) or die("Query failed: $query<br>" .
> > mysql_error());
> > $num_results = mysql_num_rows($result);
> > ?>
> > <table width="500">
> > <tr style="black_row"><td width="200">Page
> Name</td><td>Tota;Number of
> > Sessions</td></tr>
> > <?
> > for ($i=0; $i < $num_results; $i++)
> > {
> > $row = mysql_fetch_array($result);
> > echo
> > '<tr><td>'.$row['meta_data.title'].'</td><td>'.$row['tececo_st
> > ats.views'].'<
> > /td></tr>';
> > }
> > ?>
> > </table>
> > <?
> > do_html_footer();
> > ?>
> >
> > error message:
> > Query failed: select count(tececo_stats.*) as tececo_stats.views,
> > meta_data.title from meta_data and tececo_stats where meta_data.id =
> > tececo_stats.id order by meta_data.id
> > You have an error in your SQL syntax near '*) as tececo_stats.views,
> > meta_data.title from meta_data and tececo_stats whe' at line 2
> >
> > What I want to do: This is essentially a script for a stats
> > program that I
> > am writting that returns the number of hits for each page.
> Instead of
> > looping a query I decieded to try and join the two tables to
> > make it more
> > efficiant. I am trying to get it to work with hits now than
> > make it sessions
> > later.
> >
> > I hope this is enough info and thank you for your help.
> >
> >
> > --
> > JJ Harrison
> > webmaster
tececo.com
> > www.tececo.com
> >
> >
> > "Joakim Andersson" <joakim.andersson
cybercom.se> wrote in message
> > news:791CA4EB1F1AD2119BB900062905C91F02CE800C
adam.cybercom.se...
> > > I assume that 2count should really be count and 2 is just
> > the line-number
> > > you added in this post...
> > >
> > > tececo_stats.views is (probably) the name of a column and
> > cannot be used
> > as
> > > an alias. Change it to something else.
> > > change count(*) to count(tececo_stats.*) (I think that's
> > what you want)
> > > And you probably need a group by-statement at the end: GROUP BY
> > > whatever_you_need_to_group_by
> > >
> > > It's really difficult to answer your questions without the
> > table designs,
> > > the error message and what you expect this query to do.
> > And, it's not
> > > slightly OT. It's totally OT. :-)
> > >
> > > Regards
> > > Joakim Andersson
> > >
> > >
> > > > -----Original Message-----
> > > > From: JJ Harrison [mailto:webmaster
tececo.com]
> > > > Sent: Tuesday, July 09, 2002 10:10 AM
> > > > To: php-general
lists.php.net
> > > > Subject: [PHP] Grr SQL syntax error silghtly OT
> > > >
> > > >
> > > > Sorry :}
> > > >
> > > > I get a SQL syntax error at line two of the query:
> > > >
> > > > $query = "select
> > > > 2count(*) as tececo_stats.views, meta_data.title
> > > > from
> > > > meta_data, tececo_stats
> > > > where
> > > > meta_data.id = tececo_stats.id";
> > > >
> > > > I have stared at this 'till i felt dizzy. can someone tell me
> > > > what I am
> > > > doing wrong so that I can learn from it?
> > > >
> > > > Thanks in advance
> > > >
> > > >
> > > > --
> > > > JJ Harrison
> > > > webmaster
tececo.com
> > > > www.tececo.com
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Thanks
"Joakim Andersson" <joakim.andersson
cybercom.se> wrote in message
news:791CA4EB1F1AD2119BB900062905C91F02CE800F
adam.cybercom.se...
> I would try something like this...
>
> SELECT COUNT(tececo_stats.id) as num_hits, meta_data.title
> FROM tececo_stats, meta_data
> WHERE meta_data.id = tececo_stats.page_id
> GROUP BY tececo_stats.page_id
> ORDER BY num_hits DESC
>
> /Joakim
>
> > -----Original Message-----
> > From: JJ Harrison [mailto:webmaster
tececo.com]
> > Sent: Tuesday, July 09, 2002 11:07 AM
> > To: php-general
lists.php.net
> > Subject: Re: [PHP] Grr SQL syntax error silghtly OT
> >
> >
> > table structure for tececo stats(Stores information about the
> > visitors to my
> > site.visited is either 0 or 1 depending on whether or not the
> > stats cookie
> > has been set):
> >
> > id int(11) unsigned NOT NULL auto_increment,
> > page_id int(11) NOT NULL default '0',
> > visited int(11) NOT NULL default '0',
> > time int(11) NOT NULL default '0',
> > remote_dns varchar(100) NOT NULL default '',
> > remote_ip varchar(15) NOT NULL default '',
> > referer varchar(200) NOT NULL default '',
> > browser varchar(100) NOT NULL default '',
> > system varchar(100) NOT NULL default '',
> > PRIMARY KEY (id),
> > KEY page_id (page_id,time)
> >
> > table structure for meta_data(contains information about the
> > pages in my
> > website):
> >
> > id int(11) unsigned NOT NULL auto_increment,
> > pid int(11) unsigned NOT NULL default '0',
> > title varchar(200) NOT NULL default '',
> > page_name varchar(75) NOT NULL default '',
> > description text NOT NULL,
> > keywords text NOT NULL,
> > PRIMARY KEY (id),
> > KEY pid (pid)
> >
> > main file(required.php automaticly does a DB connect and is
> > used elsewhere
> > so I know is not the problem).
> > <?
> > include "includes/required.php";
> > do_html_header('Page Detail Statistics');
> >
> > $query = "select
> > count(tececo_stats.*) as tececo_stats.views, meta_data.title
> > from
> > meta_data, tececo_stats
> > where
> > meta_data.id = tececo_stats.id
> > order by meta_data.id
> > group by meta_data.id";
> > $result = mysql_query($query) or die("Query failed: $query<br>" .
> > mysql_error());
> > $num_results = mysql_num_rows($result);
> > ?>
> > <table width="500">
> > <tr style="black_row"><td width="200">Page Name</td><td>Tota;Number of
> > Sessions</td></tr>
> > <?
> > for ($i=0; $i < $num_results; $i++)
> > {
> > $row = mysql_fetch_array($result);
> > echo
> > '<tr><td>'.$row['meta_data.title'].'</td><td>'.$row['tececo_st
> > ats.views'].'<
> > /td></tr>';
> > }
> > ?>
> > </table>
> > <?
> > do_html_footer();
> > ?>
> >
> > error message:
> > Query failed: select count(tececo_stats.*) as tececo_stats.views,
> > meta_data.title from meta_data and tececo_stats where meta_data.id =
> > tececo_stats.id order by meta_data.id
> > You have an error in your SQL syntax near '*) as tececo_stats.views,
> > meta_data.title from meta_data and tececo_stats whe' at line 2
> >
> > What I want to do: This is essentially a script for a stats
> > program that I
> > am writting that returns the number of hits for each page. Instead of
> > looping a query I decieded to try and join the two tables to
> > make it more
> > efficiant. I am trying to get it to work with hits now than
> > make it sessions
> > later.
> >
> > I hope this is enough info and thank you for your help.
> >
> >
> > --
> > JJ Harrison
> > webmaster
tececo.com
> > www.tececo.com
> >
> >
> > "Joakim Andersson" <joakim.andersson
cybercom.se> wrote in message
> > news:791CA4EB1F1AD2119BB900062905C91F02CE800C
adam.cybercom.se...
> > > I assume that 2count should really be count and 2 is just
> > the line-number
> > > you added in this post...
> > >
> > > tececo_stats.views is (probably) the name of a column and
> > cannot be used
> > as
> > > an alias. Change it to something else.
> > > change count(*) to count(tececo_stats.*) (I think that's
> > what you want)
> > > And you probably need a group by-statement at the end: GROUP BY
> > > whatever_you_need_to_group_by
> > >
> > > It's really difficult to answer your questions without the
> > table designs,
> > > the error message and what you expect this query to do.
> > And, it's not
> > > slightly OT. It's totally OT. :-)
> > >
> > > Regards
> > > Joakim Andersson
> > >
> > >
> > > > -----Original Message-----
> > > > From: JJ Harrison [mailto:webmaster
tececo.com]
> > > > Sent: Tuesday, July 09, 2002 10:10 AM
> > > > To: php-general
lists.php.net
> > > > Subject: [PHP] Grr SQL syntax error silghtly OT
> > > >
> > > >
> > > > Sorry :}
> > > >
> > > > I get a SQL syntax error at line two of the query:
> > > >
> > > > $query = "select
> > > > 2count(*) as tececo_stats.views, meta_data.title
> > > > from
> > > > meta_data, tececo_stats
> > > > where
> > > > meta_data.id = tececo_stats.id";
> > > >
> > > > I have stared at this 'till i felt dizzy. can someone tell me
> > > > what I am
> > > > doing wrong so that I can learn from it?
> > > >
> > > > Thanks in advance
> > > >
> > > >
> > > > --
> > > > JJ Harrison
> > > > webmaster
tececo.com
> > > > www.tececo.com
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
attached mail follows:
Don't cross post such question...
All you need to understand is how cookie is managed unless you are passing session id via URL.
Read RFC2965 and RFC2964. You probably want to read netscape cookie spec also.
-- Yasuo OhgakiYoungie wrote: > Why would my session data not be deleted after my browser is closed? > > I can set some session variables, close my browser, reopen them and the old > values are still present, > I can verify this by seeing that the file still containts my session data > and values. > > Thanks > > John. > >
attached mail follows:
Thanks, installed and working
"Miguel Cruz" <mnc
stoic.net> wrote in message
news:Pine.LNX.4.44.0207081105460.10484-100000
stoic.net...
> On Mon, 8 Jul 2002, BB wrote:
> > I'm writing a reporting system and I have a problem.
> >
> > I need to insert PCXs into a PDF (using PDFLib), but it doesn't support
> > PCXs.
> >
> > So, to get round the problem, I need to convert the PCXs to JPGs or GIFs
> >
> > Does anyone know of a piece of PHP that can do this inline, (by that I
mean,
> > can be called and run in PHP script), because the images will have
additions
> > and modifications on a regular basis; and they come as PCXs.
>
> You can do it with Imagemagick. As I recall, there used to be direct PHP
> functions for Imagemagick but they have disappeared many versions ago, so
> you'll have to run it via system() et al.
>
> miguel
>
attached mail follows:
im having problem getting this converter to work, im running the following code:
exec("cmd /c f:; cd \Products\legacyipc\ipc_dev\Chapter 21; convert test.pcx PDF_Cache\test.gif");
which is built from a load of data from a database.
Unfortunatly, nothing happens.
I don't see the new gif, and I don't get any errors. Nothing
Someone please help,
note: the location of the images cannot be changed
"Miguel Cruz" <mnc
stoic.net> wrote in message
news:Pine.LNX.4.44.0207081105460.10484-100000
stoic.net...
> On Mon, 8 Jul 2002, BB wrote:
> > I'm writing a reporting system and I have a problem.
> >
> > I need to insert PCXs into a PDF (using PDFLib), but it doesn't support
> > PCXs.
> >
> > So, to get round the problem, I need to convert the PCXs to JPGs or GIFs
> >
> > Does anyone know of a piece of PHP that can do this inline, (by that I
mean,
> > can be called and run in PHP script), because the images will have
additions
> > and modifications on a regular basis; and they come as PCXs.
>
> You can do it with Imagemagick. As I recall, there used to be direct PHP
> functions for Imagemagick but they have disappeared many versions ago, so
> you'll have to run it via system() et al.
>
> miguel
>
attached mail follows:
batch files rock!
:o)
"Bb" <ben
themidwestgroup.com> wrote in message
news:20020709091639.38939.qmail
pb1.pair.com...
> im having problem getting this converter to work, im running the following
> code:
>
> exec("cmd /c f:; cd \Products\legacyipc\ipc_dev\Chapter 21; convert
test.pcx
> PDF_Cache\test.gif");
>
> which is built from a load of data from a database.
>
> Unfortunatly, nothing happens.
>
> I don't see the new gif, and I don't get any errors. Nothing
>
> Someone please help,
>
> note: the location of the images cannot be changed
>
> "Miguel Cruz" <mnc
stoic.net> wrote in message
> news:Pine.LNX.4.44.0207081105460.10484-100000
stoic.net...
> > On Mon, 8 Jul 2002, BB wrote:
> > > I'm writing a reporting system and I have a problem.
> > >
> > > I need to insert PCXs into a PDF (using PDFLib), but it doesn't
support
> > > PCXs.
> > >
> > > So, to get round the problem, I need to convert the PCXs to JPGs or
GIFs
> > >
> > > Does anyone know of a piece of PHP that can do this inline, (by that I
> mean,
> > > can be called and run in PHP script), because the images will have
> additions
> > > and modifications on a regular basis; and they come as PCXs.
> >
> > You can do it with Imagemagick. As I recall, there used to be direct PHP
> > functions for Imagemagick but they have disappeared many versions ago,
so
> > you'll have to run it via system() et al.
> >
> > miguel
> >
>
>
attached mail follows:
>I'm writing a reporting system and I have a problem. > >I need to insert PCXs into a PDF (using PDFLib), but it doesn't support >PCXs. > >So, to get round the problem, I need to convert the PCXs to JPGs or GIFs > >Does anyone know of a piece of PHP that can do this inline, (by that I mean, >can be called and run in PHP script), because the images will have additions >and modifications on a regular basis; and they come as PCXs.
I think you will be stuck with using http://php.net/exec to run some external process to convert them.
Image Magik seems to convert almost every format known to man...
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
I got a problem with that!
I've written a batch file that sits in the same dir as the PHP script and when I exec it, it doesn't work! I've thouroghly thrashed the batch file for errors and it came up ok every time. if I echo the exec it only returns the first line of the batch file.
Anyone?
"Richard Lynch" <rich
phpbootcamp.com> wrote in message
news:php.general-106311
news.php.net...
> >I'm writing a reporting system and I have a problem.
> >
> >I need to insert PCXs into a PDF (using PDFLib), but it doesn't support
> >PCXs.
> >
> >So, to get round the problem, I need to convert the PCXs to JPGs or GIFs
> >
> >Does anyone know of a piece of PHP that can do this inline, (by that I
mean,
> >can be called and run in PHP script), because the images will have
additions
> >and modifications on a regular basis; and they come as PCXs.
>
> I think you will be stuck with using http://php.net/exec to run some
> external process to convert them.
>
> Image Magik seems to convert almost every format known to man...
>
> --
> Like Music? http://l-i-e.com/artists.htm
>
attached mail follows:
[snip] I've written a batch file that sits in the same dir as the PHP script and when I exec it, it doesn't work! I've thouroghly thrashed the batch file for errors and it came up ok every time. if I echo the exec it only returns the first line of the batch file. [/snip]
I have found that even though the batch, shell, or other procedural call in an exec(), system(), sits in the same directory as the PHP script you must include the /full/path/to/the/script in order for it to work properly.
HTH!
Jay
attached mail follows:
Hi,
Ok i have a bunch of rows in my table, with some data.
I want my mail() function to be able to pick up the data from the rows and send to a specified email.
Basicall let's say there are 3 fields, and 3 rows, the data sent in email should be something like :
row1field1 : dkjhdkj row1field2 : dsjdkj row1field3 : skljskj
row2field1 : dkjhdkj row2field2 : dsjdkj row2field3 : skljskj
And so on, apart from the other mail info.
Can anyone help me out with this...
Thanks, T. Edison Jr.
__________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com
attached mail follows:
On Tuesday 09 July 2002 17:01, Thomas Edison Jr. wrote: > Hi, > > Ok i have a bunch of rows in my table, with some data. > > I want my mail() function to be able to pick up the > data from the rows and send to a specified email. > > Basicall let's say there are 3 fields, and 3 rows, the > data sent in email should be something like : > > row1field1 : dkjhdkj > row1field2 : dsjdkj > row1field3 : skljskj > > row2field1 : dkjhdkj > row2field2 : dsjdkj > row2field3 : skljskj > > And so on, apart from the other mail info.
You've stated what you want to do, but you haven't stated what your problem is.
> Can anyone help me out with this...
Did you want someone to write the whole code for you? Or did you want pointers in how to go about writing the code? If you wanted pointers, then you should state _what_ you need help in. That way people needn't waste time in covering things that you already know.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* those damn racoons! */
attached mail follows:
Thank you for your *extreme* kindness...
I do not know where to begin to make this happen. I created a variable and ran the entire do while loop to read contents of the table and tried storing them in the variable, which could be used as Content of the mail. However, i just get the Last Row in my DB Table sent in mail.. not all the rows. Following is part of the code i'm using, and it could be absolutely wrong, but that's all i know..
<?
$db = mysql_connect("localhost","user", "pwd"); mysql_select_db("tbl",$db);
$result = mysql_query("SELECT * FROM cart where sid='$s'",$db);
$realcontent="
if ($myrow = mysql_fetch_array($result)) { do {
$myrow[pid]<br> $myrow[nm]<br> $myrow[q]<br> } while ($myrow = mysql_fetch_array($result)); }
";
$to = "thomasedisonjr
yahoo.com";
$subject = "Purchase order Website";
$from = "Purchase Order";
$stuff = "
Name : $name\n
Phone : $phone\n
Fax : $fax\n
Email : $email\n
Address : $address\n
Country : $country\n
Order:\n\n
$realcontent\n\n";
mail($to,$subject,$stuff,$from); ?>
__________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com
attached mail follows:
This bit looks kind of wierd. Don't know if it even should be possible to do like that... > $realcontent=" > > if ($myrow = mysql_fetch_array($result)) { > do { > > > $myrow[pid]<br> > $myrow[nm]<br> > $myrow[q]<br> > > > } while ($myrow = mysql_fetch_array($result)); > } > > ";
You might wanna do like this instead:
$realcontent = ""; while ($myrow = mysql_fetch_array($result)) { $realcontent .= "$myrow['pid']<br>"; $realcontent .= "$myrow['nm']<br>"; $realcontent .= "$myrow['q']<br>"; }
Regards Joakim Andersson
attached mail follows:
Hi,
WOW... THANKS A LOT!! This actually did it .. i was on a slight wrong track..
> $realcontent = ""; > while ($myrow = mysql_fetch_array($result)) > { > $realcontent .= "$myrow['pid']<br>"; > $realcontent .= "$myrow['nm']<br>"; > $realcontent .= "$myrow['q']<br>"; > } >
Thanks,
T. Edison Jr.
__________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com
attached mail follows:
attached mail follows:
Obviously you are one of those ppl who dont keep important emails...
I can handle administrative requests automatically. Please do not send them to the list address! Instead, send your message to the correct command address:
For help and a description of available commands, send a message to:
<php-general-help
lists.php.net>
To subscribe to the list, send a message to:
<php-general-subscribe
lists.php.net>
To remove your address from the list, just send a message to
the address in the ``List-Unsubscribe'' header of any list
message. If you haven't changed addresses since subscribing,
you can also send a message to:
<php-general-unsubscribe
lists.php.net>
or for the digest to:
<php-general-digest-unsubscribe
lists.php.net>
For addition or removal of addresses, I'll send a confirmation message to that address. When you receive it, simply reply to it to complete the transaction.
If you need to get in touch with the human owner of this list, please send a message to:
<php-general-owner
lists.php.net>
Please include a FORWARDED list message with ALL HEADERS intact to make it easier to help you.
> -----Original Message-----
> From: Erik Hegreberg [mailto:ehegrebe
online.no]
> Sent: 09 July 2002 10:28 AM
> To: php-general
lists.php.net
> Subject: [PHP] Delete me from
> list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
>
>
>
attached mail follows:
attached mail follows:
look at the footer!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
-----Original Message-----
From: Erik Hegreberg [mailto:ehegrebe
online.no]
Sent: Tuesday, July 09, 2002 7:40 PM
To: php-general
lists.php.net
Subject: [PHP] Moderator where are you, delete me from the
list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
attached mail follows:
good call... tis getting annying with his lame mails...
> -----Original Message-----
> From: Martin Towell [mailto:martin.towell
world.net]
> Sent: 09 July 2002 10:36 AM
> To: 'Erik Hegreberg'; php-general
lists.php.net
> Subject: RE: [PHP] Moderator where are you, delete me from the
> list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
>
> look at the footer!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> -----Original Message-----
> From: Erik Hegreberg [mailto:ehegrebe
online.no]
> Sent: Tuesday, July 09, 2002 7:40 PM
> To: php-general
lists.php.net
> Subject: [PHP] Moderator where are you, delete me from the
> list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
I have a directory of jpegs that I want to display thumbnails of and have a link to the original jpeg. I would rather not create separate thumbnails images preferring to create them in memory to display them. I have installed GD v.1.8.4. The code below outputs jumbled text to the browser (possibly the jpeg stream?). Code is as follows:
</tr> <td><img alt="text" src="<?php echo CreateThumbnail(); ?>" valign="top" /></td> </tr>
<?php function CreateThumbnail() { $x = 130; $y = 100;
$quality = 75;
$thumbnail = imagecreate($x, $y); $originalimage = imagecreatefromjpeg('test.jpg');
imagecopyresized($thumbnail, $originalimage, 0, 0, 0, 0, $x, $y, ImageSX($originalimage),ImageSY($originalimage));
header("Content-Type: image/jpeg"); imagejpeg($thumbnail,'test.jpg',$quality);
imagedestroy($thumbnail); } ?>
Why will this not work?
**************************************************** This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. ****************************************************
attached mail follows:
Well, you're halfway there... You just have to separate the image-script from the rest like this:
image_spewing_script.php: <?php $x = 130; $y = 100;
$quality = 75;
$thumbnail = imagecreate($x, $y); $originalimage = imagecreatefromjpeg('test.jpg');
imagecopyresized($thumbnail, $originalimage, 0, 0, 0, 0, $x, $y, ImageSX($originalimage),ImageSY($originalimage));
header("Content-Type: image/jpeg"); imagejpeg($thumbnail,'test.jpg',$quality);
imagedestroy($thumbnail); ?>
and in the other file (your actual page):
</tr> <td><img alt="text" src="image_spewing_script.php" valign="top" /></td> </tr>
Regards Joakim Andersson
> -----Original Message-----
> From: Mark Colvin [mailto:mark.colvin
ccmltd.co.uk]
> Sent: Tuesday, July 09, 2002 11:27 AM
> To: Php (E-mail)
> Subject: [PHP] PHP Image Functions
>
>
> I have a directory of jpegs that I want to display thumbnails
> of and have a
> link to the original jpeg. I would rather not create separate
> thumbnails
> images preferring to create them in memory to display them. I
> have installed
> GD v.1.8.4. The code below outputs jumbled text to the
> browser (possibly the
> jpeg stream?). Code is as follows:
>
> Why will this not work?
>
>
> ****************************************************
> This e-mail is intended for the recipient only and
> may contain confidential information. If you are
> not the intended recipient then you should reply
> to the sender and take no further ation based
> upon the content of the message.
> Internet e-mails are not necessarily secure and
> CCM Limited does not accept any responsibility
> for changes made to this message.
> Although checks have been made to ensure this
> message and any attchments are free from viruses
> the recipient should ensure that this is the case.
> ****************************************************
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Thanks for your reply. Its a bit further forward but still not working. I have split the files and the output now shows the text part of 'img alt="text" src="...' ie it won't recognise the image. Anything else you can think of?
**************************************************** This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. ****************************************************
attached mail follows:
imagejpeg($thumbnail,'test.jpg',$quality); should of course be imagejpeg($thumbnail,'',$quality);
Otherwise you are creating a new image on your server and not outputting it to the browser.
/Joakim
> -----Original Message-----
> From: Mark Colvin [mailto:mark.colvin
ccmltd.co.uk]
> Sent: Tuesday, July 09, 2002 12:30 PM
> To: joakim.andersson
cybercom.se
> Cc: Php (E-mail)
> Subject: RE: [PHP] PHP Image Functions
>
>
> Thanks for your reply. Its a bit further forward but still
> not working. I
> have split the files and the output now shows the text part of 'img
> alt="text" src="...' ie it won't recognise the image.
> Anything else you can
> think of?
>
>
>
> ****************************************************
> This e-mail is intended for the recipient only and
> may contain confidential information. If you are
> not the intended recipient then you should reply
> to the sender and take no further ation based
> upon the content of the message.
> Internet e-mails are not necessarily secure and
> CCM Limited does not accept any responsibility
> for changes made to this message.
> Although checks have been made to ensure this
> message and any attchments are free from viruses
> the recipient should ensure that this is the case.
> ****************************************************
>
attached mail follows:
That's the winner!! Everything working good now. Thanks again.
**************************************************** This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. ****************************************************
attached mail follows:
Hello everyone,
I have a problem with charset iso-8859-1. My configuration is : Apache 1.3.26 on MacOS X with PHP 4.2.1
when I execute this script : <? print ord("é"); ?> I have result 142 which is the code of the macinstosh table and when i send it to my browser or in a email, this doesn't work. I must have the windows table where this caracter has the code 233.
I've added in Apache a "AddDefaultCharset iso-8859-1". I also made a ini_set("default_charset","iso-8859-1") But it doesn't change anything. It seems to change the 'local values' but not the 'master values' I canno't change the value in php.ini because on MacOS X, there wans't a file php.ini
So I've made a personal function to change code on fly but it isn't speed.
Any suggestions ??
best regards.
Philippe BARRIELLE
Sce Informatique
---------------------------------------------------------------------------------------------------
* S.A. Editions et Publicites - ABRITEL *
109, La Canebière - B.P 2033 - 13201 Marseille cedex 01 - France
Tél : 33 (0)4 91 11 00 72 Wap : http://wap.abritel.fr
Email: pbarrielle
abritel.fr Web : http://www.abritel.fr
---------------------------------------------------------------------------------------------------
LOCATIONS VACANCES - FRANCE - SPAIN - DOM - PORTUGAL
---------------------------------------------------------------------------------------------------
attached mail follows:
OK...
I have developed a web-application... on Windows 2k Server, IIS5, PHP, MsSQL/MySQL.
Now... on certain browser platforms the browser spuriously dies for no reason. (Primarily Oldish IE 5.0(but not all releases) and 5.5).
I have tried MS's mailing lists/support but not had any usefull feedback.
Has anyone came accross this kind of thing before?
Thanks In Advance...
[ http://www.the-local-guide.com :: http://www.mcgarvie.net ]
attached mail follows:
<snip>
>Now... on certain browser platforms the browser spuriously dies for no reason. (Primarily Oldish IE 5.0(but not all releases) and 5.5). > >Has anyone came accross this kind of thing before? > ></snip> > > What? M$ software crashing? Na... never seen that ;-)
sorry... coudn't help that!
What output do you produce with your PHP script? Is it plain HTML, does it include Javascripts or some our scripts? Did you check the HTML code of the output? Does it contain invalid tags or missing end tags?
René
attached mail follows:
There is rather a lot to check... i have checked *most* of it... the only JS is to open a pop-up window, but that functions correctly...
In one particular version of IE it fails even to submit the login form ;\
Works perfectly in Mozzilla/NN(4->6)... also fine in IE 6, and as I mentiond most IE5.0 except a handfull... but I obviously cant let the client view it as I am unsure what browser they will use...
> -----Original Message-----
> From: René Moonen [mailto:rene.moonen
oberthur.nl]
> Sent: 09 July 2002 11:05 AM
> To: php-windows
lists.php.net; php-general
lists.php.net
> Subject: Re: [PHP] Browser Troubles...
>
>
> <snip>
>
> >Now... on certain browser platforms the browser spuriously
> dies for no reason. (Primarily Oldish IE 5.0(but not all
> releases) and 5.5).
> >
> >Has anyone came accross this kind of thing before?
> >
> ></snip>
> >
> >
> What? M$ software crashing? Na... never seen that ;-)
>
> sorry... coudn't help that!
>
> What output do you produce with your PHP script? Is it plain
> HTML, does
> it include Javascripts or some our scripts? Did you check the
> HTML code
> of the output? Does it contain invalid tags or missing end tags?
>
>
> René
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hello!
I know it's possible to read thumbnails from the EXIF-headers in for example jpeg-images.
But is it also possible to _write_ EXIF-data, that is, if I want to create a thumbnail where there is none?
Sincerely
Victor
attached mail follows:
><? >$query = "select count(*) as monthly_views from visitors group by >extract('year', time), extract('month', time) order by monthly_view desc >limit 1";
>Warning: Supplied argument is not a valid MySQL result resource in >C:\Inetpub\TecEco_PHP\stats_interface\summary.php on line 75 >You have an error in your SQL syntax near ''year', time), extract('month',
>> Dig through the manual of your database (you didn't say which one) in the >> Date/Time functions section, and see if you can find one that will extract >> the year and month from a timestamp.
>> 1. 'extract' is probably not the right function name. You'll have to look >> that up.
http://www.mysql.com/doc/D/a/Date_and_time_functions.html
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Probably a stupid question. Is there anyway to force POSTing a form from >the refresh META? > ><META HTTP-EQUIV="Refresh" CONTENT="2;URL=someURL/somescript.php"> > >IMHO that is NOT possible, but maybe I am wrong.
You are correct -- it cannot be done.
If there is no JavaScript, you can only "force" a POST by getting the user to click on a FORM element, some how, some way...
*UNLESS*
Use PHP in a GET URL to call something like Rasmus' old 'posttohost' function which will do the POST.
I don't know if that will "work" for what you are trying to achieve...
I guess the root question is *WHY* do you want to force a POST?
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Does MySQL support parameterized queries (e.g., "INSERT INTO table >(Col1,Col2) VALUES (?,?)"), and if so, is there a PHP function that allows >you to create and attach parameters to MySQL queries?
I don't believe MySQL supports that, so there's no PHP mechanism for it.
However, you *can* insert a bunch of rows at once with something like:
$query = "insert into table (col1, col2) values (1, 2), (3, 4), (5, 6)";
I don't guarantee I got the MySQL syntax correct, though.
This is, however, not supported under other database engines, so be aware that you'll need to alter it if you ever move to something other than MySQL.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Hi all. Im getting the above mentioned error: *Parse error*: parse >error, unexpected $ in *c:\program files\apache >group\apache\htdocs\login.php* on line *38* when I try to view the page >I just created. As a forewarning, I am very new to PHP, so I may have >done something stupid, and if it matters, I am also using windows, not >*nix. Any help with this would be greatly appreciated.
You kinda gotta show us line 38, and the lines before it...
Wild Guess would be a missing ; in the line *BEFORE* 38. Second choice would be a missing } somewhere, or a missing quote.
Consider looking into configuring your editor to "syntax-highlight" your PHP for you.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>On Sat, 06 Jul 2002 15:27:47 -0500 >> Do you have *ANY* idea how quickly: >> >> "select * from MyTable" can be parsed and an execution plan selected?! >> >> It's CHUMP CHANGE in time. >> >> *ONLY* if your SQL is so incredibly complicated that you can't even >> understand it will the parse/compile time of SQL be a factor in >> performance. > >It is "CHUMP CHANGE" when you make a tinie web site with 2 users. Do the >math. If you have a SQL statement that takes 250 milliseconds to parse >and create an execution plan, then 250 * 1,000,000 page request per week >(which is what the site I finished averages, the company I >work for has 110,000 employees) = ??? This is second grade math. > >No matter how you look at it, 10 extra milliseconds here or there >adds up when you work on a big site. The db's I work with are not >simple "select foo from bar" queries. An enterprise db is usually pretty >complex. My main reason for posting a reply was not to start a stupid >flame war with you. It was from stopping you from filling the heads of >new programmers on this list with bunk. Stored procedures are not junk! >I wonder why they are the most requested feature for MySQL? Why would all >the Big DB's (Oracle, DB2, PostgreSQL, SQL Server, etc.) support them >if they had no benifit? The biggest benifit is SPEED, the second is >the ability to encapsulate the underlying database structure. A DBA can >change the db structure at will as long as the sproc returns the same >columns.
Yes, if your site gets millions of hits, an SPROC can improve raw SPEED.
And it *MAY* be the only option available to wring out that performance you need.
There are some significant down-sides to the administration of SRPOC, as I noted earlier.
The company I was working for was *NOT* getting millions of hits, had no *CHANCE* of getting millions of hits, and mindlessly wasted weeks' of developer time and drastically increased maintenance costs because "SPROCS make it faster" has been the watch-word.
Their DBA was their chief IT who was their main lead developer, and then there was me. Two programmers in the entire 7-person company.
If somebody actually *HAS* a system large enough to need SPROCs and *has* a DBA who isn't also the chief-bottle-washer, they almost-for-sure don't need me, or you, to tell them about SPROCs. :-)
My primary concern is the little guy who's going to run out and change their entire architecture around for a 3000-hits-a-month web-site because they keep hearing "SPROCs will make it faster" without anybody ever bothering to mention little things like "overhead" and "administration" and "maintenance" to them.
I'm sorry my rant touched off a nerve, and if there *IS* anybody stuck with a million-hits-a-day site, by all means, *TEST* some SPROCs and see if they improve your performance enough to make the maintenance hit worthwhile!
By all means, *DESIGN* the darn thing with as many layers of solid, clean, simple API as it takes.
But if you're trying to improve page load speed on a low-traffic site, SPROCs are almost for sure not your answer.
If you don't even *have* a speed problem, running out and spending a gazillion $$$ worth of people-hours on SPROCs is downright silly.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I have looked in PHP manual but I cannot seem to find what I am looking for. > >I have a very large form that I need to be able to mail. I just don't want >to have to code all of the field into my mail() function.
I think this one is still in the FAQ, so maybe it's time to re-read that.
I asked the same question myself, lo these many years ago, when I had *read* the FAQ, but didn't understand the question, much less the answer... Felt pretty silly when I went and re-read the FAQ, and there it was, plain as day. :-)
Also cleared up a few other things that had been bugging the back of my brain:
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>javascript in this page verifies user configuration (screen, java >enabled, platform etc) and stuffs this data into a hidden form then >sends it back to index.html where data will be used to understand >whether we can rely on jscript and cookies within this session.
Aha!
What you probably should do is have your index.php page spew out some JavaScript that re-directs them to the JavaScript-enabled home page, and then whatever you wish to display to the non-JavaScript users.
The JavaScript users will end up on the other home page, and the non-JavaScript users won't.
Separate the non-JavaScript users right away.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>LIMIT was not included in the SQL92 SQL standards and very few vendors >implement all of SQL99; the use of ANSI standards to promote "portable" >programs has always been beset by this kind of problems.
Wow! There's actually an SQL99 that vendors are targeting, kinda sorta?
Hey, with any luck, but 2009, they'll all be SQL99-compliant, and we can start all over!
Not that they ever all reached SQL92 compliance.
Oh, just in case people don't know.
SQL92 is named SQL92 because it was defined in... [drum roll] 1992
That's 100 years ago in doggie years :-)
Consider yourself lucky if any of your SQL is really portable without jumping through hoops.
I do want to apologize for my month_view/monthly_views typo.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I do have a multisite form. There are several fields on page 1 and several >on page 2. > >Everything works fine exept of error handling. Which means if a user wants >to go back from step 2 to one and has already filled in some data in site 2 >he will loose this data for sure. It is not possible to transport the data >via get anymor because the text is way to long.
POST text can be very large, but your server is allowed to limit it as low as 2K, I think.
GET data can be limited as small as 255 characters, I think.
Those limits may have increased, but the bottom line is still GET *can* have a much lower limit.
It's up to the server to impose (or not) this limit.
>So how could this be done with post? I tryed to include a hidden text field, >but since this must be another form (action links to page 1) I can't get the >value of the entered data.
You'll be able to do a quick hack to fix it just using POST, but, truly, you'll save yourself a lot of headache long-term to use:
to just keep track of the user's ID, and store all the data as they fill it in in a 'temporary' table in your database.
Create a table with all the fields in all the forms, and call it something like 'incomplete_applications'
Then, when the user has clicked around on all the pages and is happy, they can submit the 'final' application.
You can then double-check all the data and make sure it's good, and then insert it to the "real" table, and delete it from the "temp" table.
You'll need to sit down and plan this out a bit more, but you'll be much happier with the results.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Doesn't
surpress output (in general)?
>Variables don't usually produce an output so putting
before it shouldn't
>make any difference.
suppresses *ERROR* output, not just any old output.
echo "foo";
will echo foo out.
echo $foo;
will echo out anything in $foo, but if you haven't *PUT* anything in $foo
yet, and if you have E_ALL turned on like you should, then the
will
suppress the "Warning:" message.
can generally appear just about anywhere, and not necessarily just in
front of functions (unless this changed on purpose in 4.2 for some reason
beyond my ken) I don't use
a whole lot, except for pg_fetch_row() where
you pretty much have to (ugh!)
Anyway, this is legal (or was before 4.2), if silly:
if (
$foo){
}
Here, the test for $foo, which might not be set, will suppress the
"Warning:" about $foo not being set, because there is an
in front of it.
Of course, you *OUGHT* to be using:
if (isset($foo)){ }
in the first place!
I dunno why the
behaviour changed in the original post's case.
Might even be an actual bug...
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I use it in front of variables (never tried it on $GLOBALS, etc though)
>
>eg: (using register_globals = on thingo - hey don't blame me, it's the
>tech guys who have it on, and there's too much legacy code to turn it off :(
>- anyway)
>
><?
> if (
$var) { echo "Yep, var is there"; } else { echo "nope"; }
>?>
The risk is in hackers using an un-initialized $var to pass in their own data.
If you've *correctly* programmed and caught *every* single case where that might happen, by using isset() or even something like the above, only doing something more useful, you're almost-for-sure okay.
register_globals off just annoys me since I *always* initialize variables, and there's no point to me re-writing the tons of scripts for it, but that's life.
That said, the sheer number of non-programmers writing PHP made register_globals on a Bad Idea (tm) really...
I guess even some good programmers could occasionally miss a variable initialization, though I never do :-)
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>has anyone met with this problem.. using IE to submit multipart forms. in >text fields if there is "&" ... all text after it will disappear..quite a >nuisance when submitting
You probably aren't using http://php.net/htmlentities as you pass data back out to the browser.
Microsoft, in it's infinite wisdom, has decided that things like:
© don't really need the semi-colon to be HTML Character Entity thingies, and © is just as good. (Try it!)
Thus, if you don't use htmlentities to turn "®ulation require" into "&regulations require", then MS has foolishly decided that "®" *must* be the HTML Entity ®, and you're just forgetting the ;
You should be using htmlentities anyway, but it's quite annoying when dumping data to the browser that MS does such stupid things with it.
Sigh.
Anyway, moral of the story:
*ANY* time you are sending strings out to the browser as data, use <?php echo htmlentities($data);?> on the data part.
EG:
<INPUT TYPE=HIDDEN NAME=data VALUE="<?=htmlentities($data);?>">
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>That looks like the result of htmlentities(nl2br($string)).
Actually, it's probably the result of just nl2br($string) and being in the midst of the INPUT tag in the first place...
>Do it the other way around. > >Better yet, don't call nl2br or htmlentities or anything else on data that >you are inserting into your database. Madness that way lies. >Instead, use those functions only when outputting data to the browser.
Yes! I forgot to say that part. Don't put the nl2br() part in before you insert it to the database.
You'll give yourself a major headache some day, like when you need to send that data off to something that's *not* a browser. And it *will* happen, sooner or later.
You *DO* need the htmlentities() to change your $string into valid HTML, so you can send it to the browser and fish it back out reliably.
You are essentially treating the browser as a "data storage facility", but a browser only accepts HTML data.
Thus, you must convert your data into HTML using htmlentities() when storing it there.
You do *NOT* want to convert it with htmlentities() or nl2br() when storing it in MySQL.
You only want to use Magic Quotes *OR* addslashes() to store into MySQL.
Then, only when you *finally* output it to the end-user do you want to use nl2br() to add any HTML needed to properly display it.
I hope this is making some sense now. It's hard to know when to apply these functions, but the two basic rules I would suggest you try to follow are:
Be sure you use the right function to store the data in the place you're putting it:
htmlentities to "store" HTML data addlashes() to "store" MySQL data (Or Magic Quotes instead of addslashes) nl2br() only to output the data in the final rendering to the end-user
And, only apply these functions at the last minute that you have to -- Applying them any sooner than that will give you a data-headache.
Still, though, using the browser as "data storage facility" in a multi-page FORM is not such a Good Idea (tm) in the first place.
The browser is really good at *presenting* data, but wasn't really designed as a substitute for a database. Put your data into the database as soon as possible. MySQL is *really* good at data storage.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>One Form has a textfield, I submit it to another html site where there is >another form with a textfield. Inside this textfield I place a hidden field >with the value of the field from page 1 then I submit to the actual php site >inserting the values into a db.
On the "middle" page, use "View Source" in your browser to look at the HTML and your HIDDEN text.
I'm guessing that where you spit that HIDDEN text out, you are not using:
EG:
<?php echo "<INPUT TYPE=HIDDEN NAME=whatever VALUE\"", htmlentities($whatever), "\">\n"; ?>
>at this point I do insert the linebrakes (nl2br) but only the field from >page 2 is really stored with linebrakes the other one is not. How come? > >Has anybody a good idea or even know how to do this?
You may also want to consider storing each page's worth of data in a temporary table, kinda like a shopping cart, and then you only have to pass the User's ID around to keep track of all their stuff.
I'll go into this more in the answer to your next question :-)
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I've been using MySQL/PHP for quite some time. Several months ago, I >wanted to port a project over to PostgreSQL. I found everything about pg >(eg the website, documentation, installation process) far less straight >ahead than MySQL. So much so, that I didn't get around to actually >installing pg.
I actually found PostgreSQL more straight-forward, since the arguments are required. (Or used to be.) So I better understood what was going on in PostgreSQL.
Not as many examples "out there" but, really, changing:
mysql_query($query) to pg_exec($connection, $query)
in reading the examples is not that tricky...
Oh well. Different tastes for different folks.
>Plus, as others have pointed out, the supporting functions in PHP aren't >as powerful/diverse. For example, there's no insert id function.
Yes, there *IS* such a function, but it's a two-step process.
$oid = pg_getlastoid() followed by a SELECT ... where oid = $oid
http://www.php.net/manual/en/function.pg-last-oid.php
OID stands for "Object ID", and every PosgreSQL object has a unique OID. Every row, every Large Object, every everything.
Whoops. Just double-checked, and apparently pSQL 7.2 doesn't *have* to have OIDs for everything. This could get interesting, folks... A quick perusal of the PHP Docs makes me say: Only get rid of the optional OID if you are 100% sure you'll never need go use pg_last_oid() or you'll be in deep trouble.
You do *NOT* want to "just use the oid as my own id" however. OIDs can change when you export/import database data, if you're not careful, and it's just bad form to use that internal ID as your own.
PostgreSQL (and any SQL database) would be completely un-usable (*) if there wasn't some way to reliably get the last tuple inserted from your own connection.
Kinda funny that never made it into SQL92 :-)
(*) Yeah, okay, you can generate your own unique ID before the insert, and then SELECT on that to get the auto-generated ID... Might as well not bother with an auto-generated ID, then, eh?
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>1) in a fuction, does a return statment automatically exit the function as >well?
Yes. Nothing more will get executed inside the function after the "return;"
Some purists claim that you should *NEVER* have a return *ANYWHERE* except the last line of a function.
EG:
# WRONG function divide($numerator, $denominator){ if ($denomiator == 0){ return ''; } else{ return $numerator/$denominator; } }
# RIGHT function divide($numerator, $denominator){ $result = ''; if ($denominator == 0){ $result = ''; } else{ $result = $numerator/$denominator; } return $result; }
It probably seems "silly" here, but when your functions get to be three or four screenfuls long, a "return" you aren't seeing on the monitor can frequently get you very confused, very fast.
>2) can someone give me a better explination of $HTTP_POST_VARS
If you give somebody an HTML FORM (like those forms you fill out on-line), after they fill it out, the PHP page that *proccess* the FORM page will find all the data in an array named $HTTP_POST_VARS.
Actually, it got renamed to $_POST recently. (The old one will still work for a while, but convert ASAP).
Sample HTML:
<HTML><BODY><FORM ACTION=process.php METHOD=POST> <INPUT NAME=searchkey> <INPUT TYPE=SUBMIT NAME=search VALUE="Search"> </FORM></BODY></HTML>
Sample PHP: (note the filename must match the ACTION= part above)
<?php echo "Searchkey is ", $_POST['searchkey'], "<BR>\n"; echo "search button was clicked: ", isset($_POST['search']), "<BR>\n"; ?>
You could even not "know" what fields are in the FORM, and just output all of them:
(this would be a "replacement" process.php file) <?php while (list($variable, $value) = each($_POST)){ echo "$variable is $value<BR>\n"; } ?>
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
Thank you kindly ...
"Richard Lynch" <rich
phpbootcamp.com> wrote in message
news:php.general-106302
news.php.net...
> >1) in a fuction, does a return statment automatically exit the function
as
> >well?
>
> Yes. Nothing more will get executed inside the function after the
"return;"
>
> Some purists claim that you should *NEVER* have a return *ANYWHERE* except
> the last line of a function.
>
> EG:
>
> # WRONG
> function divide($numerator, $denominator){
> if ($denomiator == 0){
> return '';
> }
> else{
> return $numerator/$denominator;
> }
> }
>
> # RIGHT
> function divide($numerator, $denominator){
> $result = '';
> if ($denominator == 0){
> $result = '';
> }
> else{
> $result = $numerator/$denominator;
> }
> return $result;
> }
>
> It probably seems "silly" here, but when your functions get to be three or
> four screenfuls long, a "return" you aren't seeing on the monitor can
> frequently get you very confused, very fast.
>
>
> >2) can someone give me a better explination of $HTTP_POST_VARS
>
> If you give somebody an HTML FORM (like those forms you fill out on-line),
> after they fill it out, the PHP page that *proccess* the FORM page will
find
> all the data in an array named $HTTP_POST_VARS.
>
> Actually, it got renamed to $_POST recently. (The old one will still work
> for a while, but convert ASAP).
>
> Sample HTML:
>
> <HTML><BODY><FORM ACTION=process.php METHOD=POST>
> <INPUT NAME=searchkey> <INPUT TYPE=SUBMIT NAME=search VALUE="Search">
> </FORM></BODY></HTML>
>
> Sample PHP:
> (note the filename must match the ACTION= part above)
>
> <?php
> echo "Searchkey is ", $_POST['searchkey'], "<BR>\n";
> echo "search button was clicked: ", isset($_POST['search']), "<BR>\n";
> ?>
>
> You could even not "know" what fields are in the FORM, and just output all
> of them:
>
> (this would be a "replacement" process.php file)
> <?php
> while (list($variable, $value) = each($_POST)){
> echo "$variable is $value<BR>\n";
> }
> ?>
>
> --
> Like Music? http://l-i-e.com/artists.htm
>
attached mail follows:
>configure: error: Cannot find header files under /usr/include/mysql >Bad exit status from /home/askwar/RPM/tmp/rpm-tmp.64223 (%build) > >I called configure with these parameters: >
>--with-mysql=/usr/include/mysql
>host:/S.u.S.E. # ls -la /usr/include/mysql
>Does anyone have an idea about why this error happens?
Here's the thing:
PHP needs to find the MySQL headers, and you made a really good guess on the --with-mysql part so it could have found those...
But, PHP *ALSO* needs to find the MySQL "libraries", which are probably under /usr/lib/mysql
Now, you only get to specify *ONE* pathname in your --with-mysql=xxx
So, here's the deal-io.
You tell ./configure the directory *UP* *TO* the "common" part of where MySQL headers and libraries are, and it digs down inside there to find both:
--with-mysql=/usr
Does that make sense?
PHP needs to dig inside of that to find the "include" dir, *AND* the "lib" dir where stuff like libmysql.so are living.
So only give ./configure enough info to know where to start digging, not the whole path to just the "include" and then it can't find the "lib" -- and, paradoxically enough, it can't "dig" down to find the "include" inside the include, because you dug too deep already.
In your case, it's just /usr
Somebody else might have:
/usr/local/mysql/ include/ lib/
and they would use /usr/local/mysql
Don't worry about exactly how ./configure is going to dig down inside of /usr/include/mysql and /usr/lib/mysql as opposed to /usr/local/mysql/include and /usr/local/mysql/lib on some other system (See how the directory structures are "inverted" ?)
./configure is real good at digging "down" the directories either way it's laid out.
It just ain't good at backing up a directory or two to find the parts it needs.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I'll repeat my ealier question because some people can not think for >themselves..
There are actually two (2) possibilities here...
One is that you actually want to print the invoices on the printer connected to the *WEB* *SERVER* If that is the case, you really should skip the whole JavaScript part, and just mess with lp and PHP from the command line, if at all possible.
The other is that you have a little "hole" in the background knowledge you need to understand why you're really not making a lot of sense by insisting that PHP "pause" the dialogs...
>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? > >Thanks in advance.. > >(PS: I have sent this to this group because > 1. The loop is done in php and NOT javascript
The loop you are using in PHP is *generating* JavaScript.
The *PRINTING* is being done on the *BROWSER* and PHP lives on the *SERVER*
So the loop speed is not the controlling factor. Honest. More on this in a minute.
> 2. My question is regarding php and pausing the loop and not >with the javascript code)
You can, if you like, use http://php.net/sleep to pause that loop as much as you want.
*BUT* this is almost for sure *NOT* going to work all by itself.
Look at this picture:
+-------------------+ +---------------------+ | Browser 1.|-- URL---->|2. Web Server | | | |3, 4, 5. | | JavaScript 7.|<----------|6. PHP | | 8.| | | | 9. | +---------------------+ +-------------------+ | | | | v PRINTER
Now, take this in "slow motion"
1. Browser asks for URL. 2. Web-Server gets Request. 3. Web-Server identifies it as PHP page. 4. Web-Server fires up PHP. 5. PHP spews out HTML/JavaScript response. 6. PHP finishes HTML/JavaScript output. 7. Browser gets HTML/JavaScript. 8. Browser displays HTML. 9. Browser executes JavaScript.
As you can see, it really doesn't matter how fast or how slow your PHP script delivers the HTML/JavaScript to the browser, really.
The *JAVASCRIPT* execution determines how fast those dialogs are going to pop up, no matter how quick/fast PHP delivers it.
Think of it this way: Whether the pitcher throws a fast ball or a curve, it's how hard the batter *HITS* the ball that makes it a home run or not. So the speed of the ball delivery is irrelevent to the distance the ball travels.
[Technically, Newton's action/reaction laws do factor in a trifle on the ball's speed, but let's not pick nits, okay?]
Similarly, no matter what speed PHP delivers the JavaScript, it's the Java engine that runs it. Don't matter if PHP delivers it slow or fast, the *BROWSER* gonna run it the same speed.
Actually, 5, 6, 7, and 8 can "over-lap" a little.
So, really long and complicated PHP with lots of HTML going out *might* have the browser displaying the top of the HTML before PHP finishes spewing out the bottom of the HTML...
But, honestly, even when you *think* that's happening, it's usually really just the browser being slow to *draw* the HTML, and PHP has finished and gone home already.
So for all practical purposes, you might as well just think of each of those 9 steps as one after the other. (And if you have TABLE tags, it *IS* going to be one after the other.)
Now, you just *MIGHT* achieve a very crude control over PHP output and convince *SOME* browsers to execute the JavaScript if you do this "just right"
1. You'll probably have to have all the "print" happen in the HEAD tag, or maybe even before the HTML tag, so the browser doesn't get "distracted" by the layout of the BODY.
2. You'll almost-for-sure have to send each "Print" job in a *SEPARATE* <SCRIPT></SCRIPT> tag, or the JavaScript compiler will be waiting for the closing </SCRIPT> before it compiles the JavaScript and executes it.
3. You'll need to call http://php.net/flush after each "print" is output, so that the JavaScript is forced out to the browser.
Even, then, I'm betting this just isn't gonna work... It *might* on *some* browsers, but not reliably...
Still, here it is:
<?php while (list($invoice) = each($invoices)){ echo "<SCRIPT LANGUAGE=JavaScript>\n"; echo javaprint($invoice); # Whatever it takes to do the "print" in JavaScript echo "</SCRIPT>\n"; flush(); sleep(5); } ?> <HTML> <HEAD> <TITLE>Whatever</TITLE> </HEAD> <BODY> </BODY> </HTML>
You *MIGHT* be able to get away with putting the JavaScript into the HEAD part, but almost-for-sure if you put it into the BODY or lower, it ain't gonna work. I could be wrong on that part, but I doubt it.
Of course, if it's in the HEAD or higher, then while you're waiting for the printing, the browser can't display the BODY, since it hasn't received it yet, so you'll have a blank page the whole time you're printing. Maybe that's okay, though.
Meanwhile, you are *SHAMELESSLY* tying up your web-server to do a timed loop, which JavaScript is *perfectly* capable of doing. I think I even posted some sample code of a JavaScript timeout recently that you can use.
Certainly, if you *INSIST* on doing this in PHP, you *MIGHT* get it to work (or might not), but I *KNOW* you can do the timing part in JavaScript, without tying up your web-server needlessly.
HTTP connections are a very expensive resource. Tying one up long enough to wait a couple seconds for the user to click "Ok" 200+ times is a Bad Idea (tm).
Deliver the HTML and JavaScript to the browser, and use the JavaScript to "time" your print jobs.
I hope this helps better explain why everybody was saying "It's not a PHP issue -- It's JavaScript"
PS I also know that sitting there and clicking "Ok" 200+ times on the print dialogs is sheer torture. If you're only torturing yourself, go ahead, but if it's a real user, or an employee, don't count on them doing the job right.
Good Luck!
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Basically we have created a Software in Visual Basic. >Now the software uses mySQL on the internet as >Backend. However, our server does not allow Remote >Host Connection, which means we cannot access our >mySQL Database on the Internet by our Software on a >local client. We need the mySQL Database on the >Internet because basically everything will be >available on a website later through PHP Pages. > >Now, my problem is how to connect to my mySQL DB on >the Internet, via my Software, when my Server Company >doesn't allow Remote Host Connection to mySQL. > >What is suggested to me is to place the Software on >the Internet. I have no clue how to do that. Because >if i place an .exe file on the net, it will just start >downloading instead of running.
*IF* your ISP is running PHP on Windows, you *MIGHT* be able to just upload your .exe to the CGI-BIN directory and get it to work somehow through that...
But, really, your ISP is gonna be able to clarify this much faster than any of us...
If all else fails, and this is really, really crude, you *COULD* build a PHP script that would spew out whatever data you needed from MySQL, and you *COULD* (I assume) get your VB program to read the HTML via HTTP, and then you *COULD* POST back to the web-server from VB any changes and PHP could process them...
This would be really ugly, but does satisfy the conditions I think you have laid out...
>How then can i accomplish this? >The software feeds in Data in the mySQL DB on the >internet, and then the PHP pages access the mySQL DB >to show data to users on the Website. It's something >like that. The software involves a lot of processing, >decryption, conversion etc. to convert a .dat data >into usable mySQL Tables Data.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Hello php-general, > > I finally finish my work on one of the projects. I got a question > how PHP executes a script. > Let's say i got a little script but it takes him a long time to work > (don't blame me please) If a user stops loading page of will close > the window. Will Script continue working till the end or php will > kill that process?
Yes.
:-)
http://php.net/ignore_user_abort
Test thoroughly!
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I have insert some text with space to mysql DB with varchar() > >When I use mysql_fetch_array function to retrieve the data from DB . I >found only the first session text can be shown . It means if any space >there . It will split like session by session. for example. my DB have a >text "Hello World" , It can retrieve only "HELLO" by using mysql_fetch_array .
Wild Guess:
Somewhere, you have something like this:
echo "<INPUT TYPE=HIDDEN NAME=hello VALUE=$hello>"; (Where $hello is your variable with "Hello World" in it.)
This turns into this in the HTML
<INPUT TYPE=HIDDEN NAME=hello VALUE=Hello World>
Which, in HTML terms, means that "World" is part of the *TAG*, not the data -- It's an attribute, because there is a space and no quotes around your data.
You need to convince the HTML to look like this:
<INPUT TYPE=HIDDEN NAME=hello VALUE="Hello World">
so the PHP should be:
echo "<INPUT TYPE=HIDDEN NAME=hello VALUE=\"$hello\">";
And, just in case $hello might some day contain < or > or " or & or anything else that has special meaning in HTML, it should *really* be this:
echo "<INPUT TYPE=HIDDEN NAME=hello VALUE=\"", htmlentities($hello), "\">";
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Can this be done with apache 1.3 ? >I want to have the output of my CGI-script to be parsed with PHP, or >rather, have the php within the <? .. ?> parsed, of course, since the >script outputs alot more than just php-code. > >Is it possible?
I don't think so.
Apache 1.x was designed to "hand off" the URL to one, and only one, CGI or Handler pre-processor.
Only with Apache 2.x can you "stack" handlers. I dunno if Apache 2.x lets you mix&match CGI with Handlers, though.
Unless you can output to some kind of file somewhere, and send the user there with a Location: header, which is really ugly....
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Lets say I have a guestbook, and I want the text the visitors write in it be >saved in a database(mysql) and when retrieved, if should have the same >textformating, I guess this is a really basic thing, but I don't know what >to look for :) >I've caught \n and ereg*, but I'm not sure that's the thing, help bitte .)
Also use WRAP=VIRTUAL in the TEXTAREA tags, unless you want annoyed users when they type too much...
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>What's the best way to implement functions like 'add to basket' or 'add to >wishlist' and so on. > >I mean: you are on a page with detail information about a product. If the >user clicks the link for 'add to basket' I have to perform a piece of >script and then go back to the detail page of the given product. But >clicking on this link leads me away form the page... > >I was thinking of using $HTTP_REFERER i the "ad_to_basket.php" page in >order to retrieve the last url, but now I don't know how to go back to this >detailpage, is there a php command for this, or is my approach totally wrong??
------------- sample.php ------------------------ <?php require 'basket.inc'; ?> Display rest of page here. <A HREF=<?=$PHP_SELF?>?item_id=42>Item # 42</A> Display items already in cart: <?php $query = "select item_id from basket where user_id = '$user_id'"; $basket = mysql_query($query) or error_log(mysql_error()); while (list($item_id) = mysql_fetch_row($basket)){ echo "$item_id<BR>\n"; } ?> ----------------------------------------------------
------------- basket.inc ------------------- <?php session_start(); $user_id = session_id(); if (isset($item_id)){ $query = "insert into basket (user_id, item_id) values('$user_id', $item_id)"; mysql_query($query) or error_log(mysql_error()); } ?> -------------------------------------------
You'll want to complicate this horribly with a "quantity" so you'll need to check if they have any or not, and then do an "insert" if they don't and an "update quantity = quantity + 1" if they do, and then validating data, and so on, but that's really all there is to a shopping cart at its most simplistic.
What most people mean when they say "shopping cart" these days is "shopping cart" and "shipping charges" and "catalog system" and "pricing structures" and "secure checkout" and...
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>i have something like >$str = "sometext sometext [emoticon01] sometext [emoticon23] sometext"; > >i would like to use regex to replace those codes into: >sometext sometext /images/emot/01.gif sometext /images/emot/23.gif sometext > >all numerics after the code "emoticon" consisted of exactly 2 digits; and they >are in the range from emoticon01 to emoticon30. > >i have spent the whole day starring at my crt and reading manpages plus >examples. i achieved nothing but sore eyes. > >i would GREATLY-GREATLY appreciate if someone could gimme a code snippet on how >to this sorta thing.
You're lucky. You don't have to strain your brain with Regex. :-)
<?php for ($i = 1; $i <= 30; $i++){ $emoticon[] = '[emoticon' . sprintf("%02d", $i) . ']'; $images[] = '/images/emot/' . sprintf("%02d", $i) . '.gif'; } $str = "sometext sometext [emoticon01] sometext [emoticon23] sometext"; echo str_replace($emoticons, $images, $str); ?>
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Can the $_REQUEST be trusted?? The documentation said it is the combination >of $_GET, $_POST, $_COOKIE & $_FILE. If the PHPSESSID is found in >$_REQUEST, I can tell it is from $_COOKIE. I wonder if the PHPSESSID can be >stored into $_REQUEST if hte $_COOKIE is unavailable or turned off?
Since *NONE* of $_GET $_POST or $_COOKIE can be trusted, I don't think any combination of them should be trusted.
$_REQUEST is useful when you con't *CARE* if the data came from GET/POST, and have a script that accepts either.
I have written several such scripts, and the interface of one site/application accesses it with GET, and the other with POST, and I really don't give a [bleep] whether the incoming data is GET or POST.
It's all coming from the Internet and is not to be trusted.
Forging a POST is not significantly more "tricky" than changing a URL.
Just do "Save As..." HTML from somebody's site, change the HTML FORM elements, and then open the local file in your browser and POST away.
I've even used this technique to make use of "broken" sites simply by providing the FORM elements they forgot that their processing script told me it needed.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>After reading Kevin Yank's "Managing Users ..." at www.sitepoint.com, I >tried the following 2 scripts. Unfortunately, the variable $course is NOT >being passed to the 2nd script. Thus, per the script, the Home page is >displayed. Why?
In addition to needing session_start() in page 2, you simply cannot reliably use session_start() which sends a Cookie and a Location: to the browser.
You're going to have to send your data as GET data, or not do all those header("Location: ...") calls, and just combine the three scripts into one.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Hello all fellow-hackers > >I am working on a project that includes a number of web sites, which are >grouped together into one network. Kind of like the ‘OSDN’ network, of which >Slashdot.org, for example, is a member. > >I need to implement a cross-site session. Using a technique, similar to the >one described at PHPBuilder >(http://www.phpbuilder.com/columns/chriskings20001128.php3) I implemented >this without too much difficulty. > >The links at the top of each site (links to other sites in the network) >simply include the session id in the GET request: > ><a href="http://www.site.com/?sid=1234567">Site1</a> | <a >href="http://www.site2.com/?sid=1234567">Site2</a> | <a >href="http://www.site3.com/?sid=1234567">Site3</a> etc > >As per article, the session id is passed between the sites with ease and the >session from Site 1 can be continued on Site 3 for example. > >However, there are a number of cross-site links in the main body of the site >(i.e. not in the network link bar at the top of the page) that link various >articles from one site to another. > >Thus, when a user clicks on one of these cross-site links, s/he cannot >continue her/his session, as the session ID is not propagated; the >‘--enable-trans-sid’ option only works on internal links (a very wise design >choice, may I add). > >However, in my case, I would like to be able to define a list of external >sites that the ‘--enable-trans-sid’ option works with. (i.e. the sites in >the network). > >Is this possible? > >If not, which method could I use to propagate the session id between the >sites in the network? > >I know, it would be possible to manually add the session id to each >cross-site link, but this is not a great idea, as a number of the links are >from web site visitors in user-comments / forum posts they have submitted. > >I may be possible to use output buffering to rewrite the cross-site links to >include the session id (like the ‘--enable-trans-sid’ option works, I >guess). But, as I am using compression >(ob_start("zlib.output_compression");), that may not work. Plus, it seems a >very fiddly method to me. > >Any suggestions from anyone, on how I may perform the cross-site session >propagation?
Wild Guess:
Would setCookie('user_id', $PHPSESSID, 0, '/othersite.com');
let you get away with setting the cookies for the "other" site?
Surely not, or you could wipe out other site's cookies, or worse, replace them with hacker data...
But 5 minutes will tell you for sure...
Hey, but all those stupid "Banner Ad" sites give me a cookie from the *other* guy's site.
All ya gotta do is have three invisible GIFs on all three sites that come from the *other* sites and the GIF does the set_cookie() of whatever their user ID is.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>i have variables $Start, $End each with a timestamp 2 hours apart >(20020707140000, 20020707160000) respectively.... 01234567890123 > >How do i calculate those to timestamps to get the answer 2????? > >I've tried working them into unix timestamps and then calculating but no >luck... > >any one got any ideas ??
I'm guessing these are coming from MySQL... If so, you can subtract the two in MySQL much easier/faster than PHP...
If not:
$s = mktime(substr($Start, 8, 2), substr($Start, 10, 2), substr($Start, 12, 2), substr($Start, 4, 2), substr($Start, 6, 2), substr($Start, 0, 4)); $e = mktime(substr($End, 8, 2), substr($End, 10, 2), substr($End, 12, 2), substr($End, 4, 2), substr($End, 6, 2), substr($End, 0, 4));
$delta = $e - $s;
At this point, it boils down to the question -- Will it ever be, like, *DAYS* instead of hours, or, more importantly, *MONTHS*?
Because as soon as you get into "months" or larger time units, it gets complicated...
Until then, you can divide by 60, or 60*60, or 60*60*24 to get the number of minutes, hours, days respectively...
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>but I am wondering if it is at the cost of a slower page loading. The reason >I think this is whenever I would like to display a variable I have to put in >a script tag like <?PHP print $S_Current; ?>. I might have as many as 20 of >these on a page. Every time doesn't PHP have to start again and parse out >this information causing it to be really slow?
PHP is already started, and going, and reading your HTML.
It only has to notice when you have <?php and start paying a little more attention instead of just spewing out the HTML it encounters.
The context change from HTML mode to PHP mode is a negligible, practically un-measurable performance hit.
I switch back/forth way more than 20 times in most scripts.
Rule of Thumb: 90% of your script's time is being spent in 10% of the code.
If it's "too slow" figure out where that 90% is, and optimize that.
Actually, it's a bit more complicated than that in the web...
That 90% might all be in MySQL, or in the network congestion, or in your messed-up reverse DNS lookup, or...
But, still, if you've narrowed the speed problem down to PHP itself, then start figuring out where it's spending all its time *before* you change a line of code.
If it's not "too slow" don't even worry about performance, unless you are actually working on a site that is likely to balloon into millions of users or whatever.
Even then -- only testing *YOUR* site, and *YOUR* set up will find the 90% reliably.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
Here is my SQL(used in a PHP script so this isn't ot)
SELECT extract(year FROM time), extract(month FROM time), count(*) as monthly_views, time FROM tececo_stats group by extract(year FROM time), extract(month FROM time) order by monthly_views desc limit 1
the problem is that is counts the number of rows in the whole thing not the echoed row. How can I get it count the best days only?
-- JJ Harrison webmastertececo.com www.tececo.com
attached mail follows:
On Tuesday 09 July 2002 18:32, JJ Harrison wrote: > Here is my SQL(used in a PHP script so this isn't ot)
Aside from the fact that this has _nothing_ to do with php, you would most likely get a better response from the php-db list where, hopefully, the sql experts hangout.
> SELECT > extract(year FROM time), > extract(month FROM time), > count(*) as monthly_views, > time
[snip]
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Philadelphia is not dull -- it just seems so because it is next to exciting Camden, New Jersey. */
attached mail follows:
> -----Original Message-----
> From: JJ Harrison [mailto:webmaster
tececo.com]
> Sent: Tuesday, July 09, 2002 12:33 PM
> To: php-general
lists.php.net
> Subject: [PHP] Bug in SQL can you help?
>
>
> Here is my SQL(used in a PHP script so this isn't ot)
PHP-script or not, it's still an SQL-query, right?
I'll give it a shot anyway...
> SELECT > extract(year FROM time), > extract(month FROM time), > count(*) as monthly_views, > time > FROM > tececo_stats > group by > extract(year FROM time), > extract(month FROM time) > order by > monthly_views desc > limit 1 > > the problem is that is counts the number of rows in the whole > thing not the > echoed row. How can I get it count the best days only?
SELECT CONCAT(YEAR(time), MONTH(time)) AS my_period, MAX(COUNT(*)) AS monthly_views FROM tececo_stats GROUP BY my_period
/Joakim
attached mail follows:
Thanks
"Jason Wong" <php-general
gremlins.com.hk> wrote in message
news:200207091836.45278.php-general
gremlins.com.hk...
> On Tuesday 09 July 2002 18:32, JJ Harrison wrote:
> > Here is my SQL(used in a PHP script so this isn't ot)
>
> Aside from the fact that this has _nothing_ to do with php, you would most
> likely get a better response from the php-db list where, hopefully, the
sql
> experts hangout.
>
> > SELECT
> > extract(year FROM time),
> > extract(month FROM time),
> > count(*) as monthly_views,
> > time
>
> [snip]
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Philadelphia is not dull -- it just seems so because it is next to
> exciting Camden, New Jersey.
> */
>
attached mail follows:
To the *list* *maintainers*: this guy says he is registered but cannot write to the list. So he wrote me in instead.
úÄÒÁ×Ï! (it's like that, right?)
Djurovski Dejan wrote:
> $aDBLink=
mysql_connect("$host", "$user", "$password");
> mysql_select_db("$db", $aDBLink);
you might want to take the
sign off the connection step to get the
error message. Looks like you did not connect at all but got no warning
because you told your function to keep shut.
At that point you cannot query anything, but you cannot know about it.
ðÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
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:
try to specify the sender with -f:
mail("joecool
example.com", "My Subject", "Line 1\nLine 2\nLine 3"," From:
adrian
zone.com" , -fadrian
zone.rcom);
>
> ----- Original Message -----
> From: "Jeff MacDonald" <jeff
tsunamicreek.com>
> To: "Qmail" <qmail
list.cr.yp.to>
> Sent: Thursday, August 08, 2002 8:05 AM
> Subject: qmail with perl and php
>
>
> > Hi
> >
> > I've installed qmail with vopmail, it works the way i want it, however
> >
> > php does not want to send mail [i've made the change re qmail-inject in
> > php.ini]
> >
> > as well Mail::Mailer with perl does not work.
> >
> > This is on FreeBSD, i've symlinked /usr/sbin/sendmail to
> > /var/qmail/bin/sendmail
> > as well
> >
> > any insight would be REALLY appreciated.
> >
> >
> > Thanks.
> >
>
attached mail follows:
Despite all downfalls of using IP addresses, if you are in North America most people in a University or business environment use a fast connection (DSL or Cable) you may choose to use the following chunk of code to retrieve someone's IP number
if (getenv(HTTP_X_FORWARDED_FOR)){ $ip=getenv(HTTP_X_FORWARDED_FOR); } else { $someones = getenv(REMOTE_ADDR); } // From Klemens Karssen's code from www.php.net
Alternatively use Cookies which are easy to use (check the cookie function on www.php.net Cookies and Sessions from my understanding of earlier discussions in this forum might be a wiser idea...
Spike..
"Sebastian Marcu" <sebimarcu
yahoo.com> wrote in message
news:20020704162223.8082.qmail
pb1.pair.com...
> Hi there,
>
> I am new to PHP and need some help.
> I was wondering if there is a way to get hold of the IP address of a site
> visitor with PHP. I'm trying to develop an interaction where the server
> would recognise a new visitor from a returning visitor via the IP address.
>
> Regards,
>
>
> Sebastian
>
>
>
>
attached mail follows:
I am trying to use the mbstring library so I can receive user input in japanese and then put it into my pgsql DB. But the documentation is really sparse and sometimes confusing.
I can't understand some of the functions provided by mbstring or it's settings in php.ini. Some functions/settings don't seem to do what they say or the explanation of how to use them is missing.
For example I tought internal_encoding was used along with --enable-mbstring-enc-trans so that any input would be automatically converted to the internal encoding.
But it is isn't. When I check what charset POST data is in it is always in the charset the user used, never in the internal_encoding charset. I have to manually convert myself using mbstring functions.
I guess I don't understand what the settings of mbstring in php.ini and at compile time really do.
Can someone explain to me what is the use of:
--enable-mbstring-enc-trans at compile time mb_http_input() mb_http_output() mb_internal_encoding() mb_language() mb_output_handler()
Thanks!
Jc
attached mail follows:
I wasn't in the office hence haven't visited this group for a while... Here's an idea though I still may not understand the whole situation but from what I think it is here goes:
I guess you will have to mix javascript and php in the following manner... use onclick for a particular HTML variable and create a function in Java Script that runs when you click this and returns true or writes to an HTML variable say input type= hidden name=hasClicked value=false... the HTML value will give this hidden variable the value true when clicked otherwise it will be defaulted at false... You can use document.write.formName.hasClicked.value = true...
Then continue with:
if($hasClicked == "true") Run the Script... This will mean your script won't run until OK is pressed...
I hope this helps and I hope its not too late...
Spike...
"Chris Kay" <Chris.Kay
techex.com.au> wrote in message
news:E00ACB0129A4C748B02A744610798CE50652B3
headoffice-fs.techex.net.au...
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?
Thanks in advance..
------------------------------------------------------------------------
--- Chris Kay Technical Support - Techex Communications Website: www.techex.com.au Email: chris.kaytechex.net.au Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 Platinum Channel Partner of the Year - Request DSL - Broadband for Business ------------------------------------------------------------------------ ---
attached mail follows:
I am making a stats program.
When the nessicary include file is included it does a reverse-DNS lookup to find the remote host's DNS name. The problem with this is that is seems slow(at least on my test server with a DSL connection). I thought the best way to speed things up would be putting the entire script into a file and then using <img src="stats.php"> within the page. The problem is that I don't know how to output the image with PHP.
The image would not be dynamic just a file on the server.
I would appreciate peoples comments or other suggestions
JJ Harrison
webmaster
tececo.com
www.tececo.com
attached mail follows:
$filename = "your/file.gif"; header("Content-Type: image/gif"); header("Content-length:".filesize($filename)); $fn=fopen($filename,"rb"); while(!feof($fn)) { echo fread($fn, 4096); }
in fopen( , ""); the b denotes to read as binary and is only nessecary on a windows system
"Jj Harrison" <webmaster
tececo.com> wrote in message
news:20020709125042.90160.qmail
pb1.pair.com...
> I am making a stats program.
>
> When the nessicary include file is included it does a reverse-DNS lookup
to
> find the remote host's DNS name. The problem with this is that is seems
> slow(at least on my test server with a DSL connection). I thought the best
> way to speed things up would be putting the entire script into a file and
> then using <img src="stats.php"> within the page. The problem is that I
> don't know how to output the image with PHP.
>
> The image would not be dynamic just a file on the server.
>
> I would appreciate peoples comments or other suggestions
>
> JJ Harrison
> webmaster
tececo.com
> www.tececo.com
>
>
>
>
>
attached mail follows:
instead of
$fn=fopen($filename,"rb"); while(!feof($fn)) { echo fread($fn, 4096); }
use
readfile($filename);
BB wrote:
>$filename = "your/file.gif";
>header("Content-Type: image/gif");
>header("Content-length:".filesize($filename));
>$fn=fopen($filename,"rb");
>while(!feof($fn)) {
> echo fread($fn, 4096);
>}
>
>in fopen( , "");
>the b denotes to read as binary and is only nessecary on a windows system
>
>"Jj Harrison" <webmaster
tececo.com> wrote in message
>news:20020709125042.90160.qmail
pb1.pair.com...
>
>
>>I am making a stats program.
>>
>>When the nessicary include file is included it does a reverse-DNS lookup
>>
>>
>to
>
>
>>find the remote host's DNS name. The problem with this is that is seems
>>slow(at least on my test server with a DSL connection). I thought the best
>>way to speed things up would be putting the entire script into a file and
>>then using <img src="stats.php"> within the page. The problem is that I
>>don't know how to output the image with PHP.
>>
>>The image would not be dynamic just a file on the server.
>>
>>I would appreciate peoples comments or other suggestions
>>
>>JJ Harrison
>>webmaster
tececo.com
>>www.tececo.com
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
attached mail follows:
attached mail follows:
Maybe everybody should send him a copy then he'll get the message? Maybe!!!!
To remove your address from the list, just send a message to
the address in the ``List-Unsubscribe'' header of any list
message. If you haven't changed addresses since subscribing,
you can also send a message to:
<php-general-unsubscribe
lists.php.net>
or for the digest to:
<php-general-digest-unsubscribe
lists.php.net>
For addition or removal of addresses, I'll send a confirmation message to that address. When you receive it, simply reply to it to complete the transaction.
----- Original Message -----
From: "Erik Hegreberg" <ehegrebe
online.no>
To: <php-general
lists.php.net>
Sent: Tuesday, July 09, 2002 2:15 PM
Subject: [PHP] I am out of pleases now get me off this fuckin
list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
attached mail follows:
HI,
I just joined the list - reviewed the archives, and found that Chip Weigand (2002-07-05) entered a problem with php_functions.c in the ~/php-4.2.1/sapi/apache2filter directory.
I have a similar situation - my error:
php_functions.c:93:27: missing binary operator before '!' make[3]: *** [php_functions.lo] Error 1
Same line as Chip's compile failure.
I'm running gcc 3.0.4 under Solaris 8. I'm not sure if this is a gcc issue or just the syntax of line 93 in php_functions.c.
Has anyone else had a problem with this in compiling php4.2.1?
Larry
attached mail follows:
Whenn i acces a page then there will automatichly be a phpsesion id created
but i dont have got any key pressed or used sersion start in the code.
i just wanne login to my page wich the page sets a cookie in my browser but this doest work because the cookies does not be created in my browser
www.bos.hn.org(to see it your self)
please reply
thx -AcIDeR
attached mail follows:
On Tue, Jul 09, 2002 at 03:37:04PM +0200, AcIDeR wrote: > Whenn i acces a page then there will automatichly be a phpsesion id created
What's your session.auto_start setting in php.ini?
--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
attached mail follows:
Hi every1, i am currently undertaking some research into PHP security and its flaws / loopholes etc. What i am looking for is information on any aspects of PHP that can be hacked or cracked and how developers have got around these problems.
Any help would b much appreciated
Thanks
--------------------------------- Relive the FIFA World Cup goals with exclusive video highlights!
http://fifaworldcup.yahoo.com/fc/en
attached mail follows:
My favorite part is that he requests a read receipt for every one of these messages. I hope everyone is sending him one of those, too, to clutter up his email even more.
---John Holmes...
----- Original Message -----
From: "Zac Hillier" <zac
affectors.net>
To: "Erik Hegreberg" <ehegrebe
online.no>; <php-general
lists.php.net>
Sent: Tuesday, July 09, 2002 9:16 AM
Subject: Re: [PHP] I am out of pleases now get me off this fuckin
list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> Maybe everybody should send him a copy then he'll get the message?
> Maybe!!!!
>
>
> To remove your address from the list, just send a message to
> the address in the ``List-Unsubscribe'' header of any list
> message. If you haven't changed addresses since subscribing,
> you can also send a message to:
> <php-general-unsubscribe
lists.php.net>
>
> or for the digest to:
> <php-general-digest-unsubscribe
lists.php.net>
>
> For addition or removal of addresses, I'll send a confirmation
> message to that address. When you receive it, simply reply to it
> to complete the transaction.
>
>
>
> ----- Original Message -----
> From: "Erik Hegreberg" <ehegrebe
online.no>
> To: <php-general
lists.php.net>
> Sent: Tuesday, July 09, 2002 2:15 PM
> Subject: [PHP] I am out of pleases now get me off this fuckin
>
list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
>I hope everyone is sending him one of those, too, to clutter up > his email even more.
Well absolutely............... would not want to be rude and ignore the request ;)
----- Original Message -----
From: "1LT John W. Holmes" <holmes072000
charter.net>
To: "Zac Hillier" <zac
affectors.net>; "Erik Hegreberg"
<ehegrebe
online.no>; <php-general
lists.php.net>
Sent: Tuesday, July 09, 2002 9:55 AM
Subject: Re: [PHP] I am out of pleases now get me off this fun list!
> My favorite part is that he requests a read receipt for every one of these
> messages. I hope everyone is sending him one of those, too, to clutter up
> his email even more.
>
> ---John Holmes...
>
> ----- Original Message -----
> From: "Zac Hillier" <zac
affectors.net>
> To: "Erik Hegreberg" <ehegrebe
online.no>; <php-general
lists.php.net>
> Sent: Tuesday, July 09, 2002 9:16 AM
> Subject: Re: [PHP] I am out of pleases now get me off this fuckin
>
list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
>
> > Maybe everybody should send him a copy then he'll get the message?
> > Maybe!!!!
> >
> >
> > To remove your address from the list, just send a message to
> > the address in the ``List-Unsubscribe'' header of any list
> > message. If you haven't changed addresses since subscribing,
> > you can also send a message to:
> > <php-general-unsubscribe
lists.php.net>
> >
> > or for the digest to:
> > <php-general-digest-unsubscribe
lists.php.net>
> >
> > For addition or removal of addresses, I'll send a confirmation
> > message to that address. When you receive it, simply reply to it
> > to complete the transaction.
> >
> >
> >
> > ----- Original Message -----
> > From: "Erik Hegreberg" <ehegrebe
online.no>
> > To: <php-general
lists.php.net>
> > Sent: Tuesday, July 09, 2002 2:15 PM
> > Subject: [PHP] I am out of pleases now get me off this fuckin
> >
>
list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> >
>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
just keep a note of his mail for when he final reads simple instructions and periodically forward him any interesting posts ;)
> -----Original Message-----
> From: Bret L Conard [mailto:bretlc
donet.com]
> Sent: 09 July 2002 2:58 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] I am out of pleases now get me off this fun list!
>
>
> >I hope everyone is sending him one of those, too, to clutter up
> > his email even more.
>
>
> Well absolutely...............
> would not want to be rude and ignore the request
> ;)
>
> ----- Original Message -----
> From: "1LT John W. Holmes" <holmes072000
charter.net>
> To: "Zac Hillier" <zac
affectors.net>; "Erik Hegreberg"
> <ehegrebe
online.no>; <php-general
lists.php.net>
> Sent: Tuesday, July 09, 2002 9:55 AM
> Subject: Re: [PHP] I am out of pleases now get me off this fun list!
>
>
> > My favorite part is that he requests a read receipt for
> every one of these
> > messages. I hope everyone is sending him one of those, too,
> to clutter up
> > his email even more.
> >
> > ---John Holmes...
> >
> > ----- Original Message -----
> > From: "Zac Hillier" <zac
affectors.net>
> > To: "Erik Hegreberg" <ehegrebe
online.no>;
> <php-general
lists.php.net>
> > Sent: Tuesday, July 09, 2002 9:16 AM
> > Subject: Re: [PHP] I am out of pleases now get me off this fuckin
> >
> list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!!!!!
> >
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!!!!!
> > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> >
> >
> > > Maybe everybody should send him a copy then he'll get the message?
> > > Maybe!!!!
> > >
> > >
> > > To remove your address from the list, just send a message to
> > > the address in the ``List-Unsubscribe'' header of any list
> > > message. If you haven't changed addresses since subscribing,
> > > you can also send a message to:
> > > <php-general-unsubscribe
lists.php.net>
> > >
> > > or for the digest to:
> > > <php-general-digest-unsubscribe
lists.php.net>
> > >
> > > For addition or removal of addresses, I'll send a confirmation
> > > message to that address. When you receive it, simply reply to it
> > > to complete the transaction.
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Erik Hegreberg" <ehegrebe
online.no>
> > > To: <php-general
lists.php.net>
> > > Sent: Tuesday, July 09, 2002 2:15 PM
> > > Subject: [PHP] I am out of pleases now get me off this fuckin
> > >
> >
> list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!!!!!
> > >
> >
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!!!!!
> > > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
How bout the question marks in the following line of php generated html:
<input type = hidden name = parent value = <?=$parent;?>
what do they mean?
"Miguel Cruz" <mnc
stoic.net> wrote in message
news:Pine.LNX.4.44.0207072139290.29387-100000
stoic.net...
> On Sun, 7 Jul 2002, Alexander Ross wrote:
> > Can someone explain to me what the ? does. I have a vague idea of what
> > it means in a URL (please cearify that) but I haven't the slightest what
> > it means in php code. Thanks for your help
>
> Read about the ternary operator at:
>
> http://www.php.net/manual/en/language.operators.comparison.php
>
> miguel
>
attached mail follows:
In that case, the question marks are part of the PHP opening and closing tags.
There are several ways to open and close sections of PHP script, mainly being <?php ?>, <? ?>, and <% %>. What the below equals is <?php echo $parent; ?>, since <?= is the equivalent of saying "echo" or "print" the following.
Hope that wasn't too jumbled. :o)
Martin Clifford http://www.completesource.net (Now Open!)
>>> "Alexander Ross" <alexross
bleen.net> 07/09/02 09:54AM >>>
How bout the question marks in the following line of php generated html:
<input type = hidden name = parent value = <?=$parent;?>
what do they mean?
"Miguel Cruz" <mnc
stoic.net> wrote in message
news:Pine.LNX.4.44.0207072139290.29387-100000
stoic.net...
> On Sun, 7 Jul 2002, Alexander Ross wrote:
> > Can someone explain to me what the ? does. I have a vague idea of what
> > it means in a URL (please cearify that) but I haven't the slightest what
> > it means in php code. Thanks for your help
>
> Read about the ternary operator at:
>
> http://www.php.net/manual/en/language.operators.comparison.php
>
> miguel
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Kevin,
>> I have an array that I want to store in a field of a mysql db. I've got >> it set as type text currently, but when I retrieve it, I can't get the >> arrary to parse. >> >> If I look at the listings in the mysql cli, it just says "Array" for >> that field. >> >> Here's my retrieval code: >> >> $storyid = $_REQUEST['storyid']; >> >> $db = mysql_connect("localhost", "user", "pass") or die ("Could Not >> connect to db."); >> mysql_select_db("storiestest", $db) or die("Could not select >> database."); >> $query = "SELECT * FROM ADGstories WHERE (storyid='$storyid')"; >> $results = mysql_query($query, $db); >> $num_results = mysql_num_rows($results); >> >> for ($i=0; $i < $num_results; $i++) >> { >> $row = mysql_fetch_array($results); >> while ($element = each($row)) >> { >> echo $element["key"]; >> echo ": "; >> echo $element["value"]; >> echo "<br>\n"; >> >> $varname = $element["key"]; >> $$varname = $element["value"]; >> } >> >> echo "<h2>$headline</h2>\n >> <p class='byline'>$byline</p>\n"; >> >> // just as a test, not looping through the array. Loop code not >> included. >> echo "<p class='bodycopy'>$bodycopy[0]</p>\n"; >> } >> >> Even with the version at the end there, I get "A" echoed to the screen. >> >> If I try a print_r($bodycopy), it says "Array". >> >> Where did I screw up?
> You can store arrays as strings with.. > > $str = serialize($ary); > > .. and turn a serialized string back into an array with.. > > $ary = unserialize($str); > > The string can be stored in either a TEXT or TINYTEXT field. Is this > what > you wanted to know?
Yes. That worked.
> I had trouble following your code after the for loop. > $headline, $byline and $bodycopy are variable names stored in the > database?
Yes. Sorry about that. I should have explained what those variables were.
In any case, your solution worked for me.
thanks!
Steven
-- Steven Jarvis Web Publishing Manager/Web Developer NWAnews.com: Arkansas Democrat-Gazette, Northwest Edition Northwest Arkansas Times Benton County Daily Record
attached mail follows:
You know the retail establishment has invested alot of money, what about the underpaid waiter/checkout person they employ?
What is that waiter doing with your credit card when he/she takes it from the table for processing?
Is the checkout person have a photographic memory writing down name/credit card combinations when they take their smoke break?
Is the establishment using unencrypted wireless networks to link their POS terminals to their backend systems?
What if the b&m store has an antiquated system that prints out your entire CC# on the reciepts?
What if they still use a card-impression system?
Heck, what if they set your card on the big magnet they use to turn off the security tags on the stuff you just bought?
What if they pretend your card has been denied with a code which requires them to destroy the card? They certainly won't give it back, and they'll be able to copy the numbers down at their leisure.
You can play 'what if' until the cows come home. That doesn't change the fact that the *VAST* majority of stolen credit card information was *NOT* stolen as a result of an online transaction. Most are stolen through much more mundane methods, like 'shoulder surfing' at the register, or a waiter copying the info while they're away from the table. I don't shop at b&m shops that I don't feel I can trust, any more than I shop at e-sites that I don't feel I can trust. I don't trust *ANY* e-site that isn't willing to go to the effort to properly protect the transaction (certificates from a trusted CA, encrypted communication, reasonable security efforts, etc.).
Properly signed certificates don't prove the vendor is trustworthy. They provide some sound evidence that the vendor is who they say they are. A self-signed certificate doesn't say anything except that they say they are who they say they are. The encryption provides a reasonable guarantee that nobody except you and the vendor will be able to see your transaction.
The reason more CC fraud happens online isn't that more info is stolen there. It's that the vendor has no way of knowing that YOU are who you say you are. Thousands of sets of credit card info are stolen every day *offline*. You don't hear about it because it happens in ways that are impossible to detect. Some vendor's online site gets hacked, and you hear about it because it could be detected.
- Theo
P.S.: Shopping carts 'too boring'?! Of course they're boring!
-----Original Message-----
From: Richard Lynch [mailto:rich
phpbootcamp.com]
Sent: Monday, July 08, 2002 4:33 PM
To: php-general
lists.php.net
Subject: Re: [PHP] HTTPS vs. HTTP ?
>>>How do you know their certificate hasn't been stolen, and they haven't even >figured it out yet? How do you know they were trustworthy people in the >first place?<< > >Why do you ASSUME that they're NOT trustworthy people? Do you go through >your entire life in that shell?
Everybody gets a limited amount of trust extended to them, for "free"
That amount is NOWHERE NEAR the trust where I hand them my credit card number.
Do you hand your credit-card to random people in the street?
With a brick-and-mortar retail establishment, I can tell a lot from location, size, even the "look" of the store -- I also know, right off the bat, that they've invested a *TON* of money and won't be able to make it back in a short-time con.
With a web-site, I can tell: They paid $119 to somebody for the CA. They paid $20/month or so to somebody else. They maybe paid somebody to design/build the site, or a turn-key system, or...
That really doesn't tell me a whole lot.
I don't know:
They aren't storing my credit card number in their database "just temporarily" while we process it. [I've had to fix this error a couple times myself, and I hate doing shopping carts. Too boring. I quit doing them. I can't imagine how many times a shopping cart "regular" has walked into this situation.]
They aren't using a badly-designed system where my CC# appears in "ps auxwwww" output.
They aren't using a badly-designed system where the CC# is stored on the disk during processing. [Hint -- Last I checked, Linkpoint's PHP interface did this. Guess what happens when you get a network time out or the script fails for some reason? Your CC# is left hanging around in that file. Sure, if the instructions were followed, only root can read it... If the server hasn't been hacked. If, if, if...]
The scripts that process my CC # have correct permissions, and are accessible only to one, okay, *two* people to avoid somebody inserting a back-door.
The list of failure points is endless, and I *STILL* don't even trust that randomsite.com has had any kind of background check carried out by the people issuing Certifcates. Jeez, people -- We're talking one of the major players is MICROSOFT! Do you trust them with Security?!
I've seen too many bad home-brew shopping carts to have any faith in them. I still shop on-line, but rely on the fact that I can only get dinged for $50, and we'll all be paying even higher interest rates next year. I have no trust that my CC# isn't being exposed.
>>>The more I think about this, the more I agree with people who just won't do >eCommerce at all...<<
Hey, I'm not saying I don't shop on-line. I'm saying I have no faith that I won't be calling up the credit card company and canceling the stolen account much faster than at a traditional store.
I have no faith that the e-theft of credit cards won't raise my interest rates.
The CC companies have already proven that they will accept an inordinately high level of theft and just pass on the cost to consumers. What do they care what your interest rates are?
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
Hey Folks:
Speaking of identity theft, here's a fun story. Involves a Hollywood Video store. HV is a large chain of video rental stores.
http://www.nydailynews.com/2002-07-09/News_and_Views/Crime_File/a-156851.asp
--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
attached mail follows:
> Hi there; > > I installed Apache2.0.39 and PHP4.2.1 on RedHat Linux 7.2. The > installation > procedure is fine. The php installation inlcude gd and some > extension, but I > can't find the php-gd.so on my computer. > > Anybody can help?
Looks like the problem is that you haven't installed GD.
Dave
attached mail follows:
Hi Dave:
I have gd installed and now the configure, make and make install are working fine. but aftere installation, I can't find any extension there.
Yang
"Dave Macrae" <dave
datacash.com> wrote in message
news:OOENIPCKDPJBIGJECPONKEPJCFAA.dave
datacash.com...
> > Hi there;
> >
> > I installed Apache2.0.39 and PHP4.2.1 on RedHat Linux 7.2. The
> > installation
> > procedure is fine. The php installation inlcude gd and some
> > extension, but I
> > can't find the php-gd.so on my computer.
> >
> > Anybody can help?
>
> Looks like the problem is that you haven't installed GD.
>
> Dave
attached mail follows:
Are you compiling php with the --with-gd=shared option?
Personally (Solaris 8, gcc 2.95.3 , php 4.1.1 and later) I've never been able to get the gd shared object to work (gd.so load errors), so I've always ended up compiling it into PHP.
-steve
At 1:23 PM -0400 7/9/02, Yang wrote:
>Hi Dave:
>
>I have gd installed and now the configure, make and make install are working
>fine. but aftere installation, I can't find any extension there.
>
>Yang
>
>"Dave Macrae" <dave
datacash.com> wrote in message
>news:OOENIPCKDPJBIGJECPONKEPJCFAA.dave
datacash.com...
>> > Hi there;
>> >
>> > I installed Apache2.0.39 and PHP4.2.1 on RedHat Linux 7.2. The
>> > installation
>> > procedure is fine. The php installation inlcude gd and some
>> > extension, but I
>> > can't find the php-gd.so on my computer.
>> >
>> > Anybody can help?
>>
>> Looks like the problem is that you haven't installed GD.
>>
> > Dave
>
-- +------------------------------------------------------------------------+ | Steve Edberg sbedbergucdavis.edu | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | +------------------------------------------------------------------------+ | The end to politics as usual: | | The Monster Raving Loony Party (http://www.omrlp.com/) | +------------------------------------------------------------------------+
attached mail follows:
I'm running windows 2000 and the latest releases of PHP and MySQL. All database connections are made with mysql_pconnect(). Connections build up, however. The only person connecting to this webserver at the moment is myself. It seems that it opens connections and keeps them open, but doesn't always reuse them, thus causing it to open new ones. Is this a bug in mysql_pconnect()? Should I just use mysql_connect()? Any and all help is appreciated.
attached mail follows:
My advice is to use mysql_connect(). The only instance I would consider using mysql_pconnect() would be if I had to access multiple databases and servers at the same time.
Martin
>>> SpamSucks86 <spamsucks86
comcast.net> 07/09/02 10:26AM >>>
I'm running windows 2000 and the latest releases of PHP and MySQL. All
database connections are made with mysql_pconnect(). Connections build
up, however. The only person connecting to this webserver at the moment
is myself. It seems that it opens connections and keeps them open, but
doesn't always reuse them, thus causing it to open new ones. Is this a
bug in mysql_pconnect()? Should I just use mysql_connect()? Any and all
help is appreciated.
attached mail follows:
I just moved an application from one Linux server running Apache to another running Apache. The version of Apache on both is 1.3.12. The version of PHP on one is 4.0.3pl1 and on the other it is 4.0.1pl2.
Here is what is baffling for me: one the second server the $HTTP_ENV_VARS array is empty. I have to get my information by calling what would ususally be the indexes e.g. $HTTP_SCRIPTNAME.
Is there a switch I did not set?
Todd
-- Todd Cary Ariste Software 2200 D Street Extension Petaluma, CA 94952 707-773-4523 toddaristesoftware.com
attached mail follows:
All,
I have a page on our intranet site that is pulling an image from our corporate web server. The corporate server & the image I am accessing is beyond my control. The image is generated daily and appears to be named with a timestamp in the file name so therefore the image name changes daily.
On my site I have the page to check if a cookie exists with the image's file name. If the cookie is set then the page will create the IMAGE tag using the file name specified in the cookie. If the cookie value is not set then the code will go open the web page on the corporate server, dump the page's content into an array, and then the array is parsed until a known string is found and then the image file name can be pulled out and displayed.
Currently the code I have is working. However, I know that it can/needs to be improved but I'm not sure what/how to go about implementing the following improvements:
1) If the image file name doesn't exist go to the corporate web server, access the page, and parse the page contents until we find the image. The problem I currently have is that the page on the corporate site is huge with several hundred lines of html in the page and the image I need to access is closer to the bottom of the page. How do I walk through the contents of the page searching for the image starting further down the page than from the beginning if the page?
2) Is there a better way of trying to find/strip the image name in the page contents than by using the strpos & substr functions? If so how?
3) Once I've found the image file name, is there then some way that I can download the image from the corporate site to our local site? If so, how do I do this? If I can download the image locally, then I can rewrite the code to check for the existence of the file locally before going out and accessing the corporate site every time.
Code is below. Thanks in advance
Dave Merritt
dave.merritt
arvinmeritor.com
<% $Image = $_COOKIE['ImageToday']; $WebLocation = 'http://www.somesite.com';
if (empty($Image)) { $Find = '<IMG SRC="/archive/images';
$PageContents =
file($WebLocation);
if (! empty($PageContents))
{
while (list ($ArrayNo, $Line) = each ($PageContents))
{
$Image = stristr($Line, $Find);
if ($Image != "")
{
$Image = substr($Image, 0, strpos($Image, '" BORDER=0'));
$Image = substr($Image, strpos($Image, '"') + 1);
$Image = $WebLocation . $Image;
%>
<SCRIPT type= "text/javascript" language="JavaScript">
<!--
document.cookie = "ImageToday=<%echo $Image%>; path=/"
//-->
</SCRIPT>
<A href="<%echo $WebLocation%>">
<IMG src="<%echo $Image%>" border="0" alt="Some label">
</A>
<%
}
}
}
else
{
%>
<P class="text">Unable to display
<A href="<%echo $WebLocation%>" class="text">image from
site</A>!
</P>
<%
}
}
else
{
%>
<A href="<%echo $WebLocation%>"><IMG src="<%echo $Image%>" border="0"
alt="Some label"></A>
<%
}
%>
attached mail follows:
Hi everyone,
Is there any way to hide my form submitted variables (like passwords etc) in the location bar "http://somedomain.org/checkpassword.php? password=mypassword" or atleast show in an encypted form n the location bar.
/Chandu
----------------------------------------------- Powered by MihiraMail, Fast secure & reliable Brought to you by Mihira Net Pvt Ltd.
attached mail follows:
Use the POST method instead of GET for submitting forms.
Bogdan
- wrote:
>Hi everyone, > >Is there any way to hide my form submitted variables (like >passwords etc) >in the location >bar "http://somedomain.org/checkpassword.php? >password=mypassword" >or atleast show in an encypted form n the location bar. > > >/Chandu > > >----------------------------------------------- > Powered by MihiraMail, Fast secure & reliable > Brought to you by Mihira Net Pvt Ltd. > > > >
attached mail follows:
OK following from my thread 'Browser Issues' I have found that when serving the site from apache, that the aforementioned errors go away... mostly...
OK so... What is the best way to setup so that IIS/Apache co-exist...
I'd like to keep the 'entry' to the site on IIS as we have other sites too... and use apache to serve the content of it.
Any help mucho appreciated... also working to a deadline!
attached mail follows:
I have Apache and IIS coexisting on my intranet server and the way I set them up was to put each on a different port. (Apache serves http://intranet and IIS serves http://intranet:8080) this appears to work fine. Hope this helps
Robert W. Collins II
Webmaster
New Orleans Regional Transit Authority
Phone : (504) 248-3826
Fax: (504) 248-3866
Email : rcollins
norta.com <mailto:rcollins
norta.com>
-----Original Message-----
From: Brian McGarvie [mailto:bmcgarvie
lennox-mckinlay.co.uk]
Sent: Tuesday, July 09, 2002 10:39 AM
To: php-windows
lists.php.net; php-general
lists.php.net
Subject: [PHP] Dual Server...
OK following from my thread 'Browser Issues' I have found that when serving the site from apache, that the aforementioned errors go away... mostly...
OK so... What is the best way to setup so that IIS/Apache co-exist...
I'd like to keep the 'entry' to the site on IIS as we have other sites too... and use apache to serve the content of it.
Any help mucho appreciated... also working to a deadline!
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I will probably do this the other way round as we have a few sites...
so if i have a single file with a frame and point contents of frame to apache this should work?
> -----Original Message-----
> From: Collins, Robert [mailto:RCollins
NORTA.COM]
> Sent: 09 July 2002 4:41 PM
> To: Brian McGarvie; php-windows
lists.php.net;
> php-general
lists.php.net
> Subject: RE: [PHP] Dual Server...
>
>
> I have Apache and IIS coexisting on my intranet server and
> the way I set
> them up was to put each on a different port. (Apache serves
> http://intranet
> and IIS serves http://intranet:8080) this appears to work
> fine. Hope this
> helps
>
> Robert W. Collins II
> Webmaster
> New Orleans Regional Transit Authority
> Phone : (504) 248-3826
> Fax: (504) 248-3866
> Email : rcollins
norta.com <mailto:rcollins
norta.com>
>
>
>
> -----Original Message-----
> From: Brian McGarvie [mailto:bmcgarvie
lennox-mckinlay.co.uk]
> Sent: Tuesday, July 09, 2002 10:39 AM
> To: php-windows
lists.php.net; php-general
lists.php.net
> Subject: [PHP] Dual Server...
>
>
> OK following from my thread 'Browser Issues' I have found
> that when serving
> the site from apache, that the aforementioned errors go
> away... mostly...
>
> OK so... What is the best way to setup so that IIS/Apache co-exist...
>
> I'd like to keep the 'entry' to the site on IIS as we have other sites
> too... and use apache to serve the content of it.
>
> Any help mucho appreciated... also working to a deadline!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Help! I was using FastTemplates on my local machine AND on my personal server and it all worked well. When I am uploading the code to my client's server today, I get this strange warning whenever using FastTemplates:
Warning: Invalid content of \{\} in /home/httpd/includes/fasttemplate.class.php on line 199
I get about 50 lines like this. A google search shows other sites have had the same problem with FastTemplates: http://www.google.com/search?sourceid=navclient&q=%22Invalid+content%22 But a search on the php.net site didn't give any results.
In the code, line 199 of fasttemplate.class.php is empty, followed by the following code:
function utime ()
{
$time = explode( " ", microtime());
$usec = (double)$time[0];
$sec = (double)$time[1];
return $sec + $usec;
}
I really am stuck: this didn't happen on my local machine or on my test server, it's happening on the client's machine now and they are expecting the site today and I have no idea what's wrong. We've had problems with permissions on their server, maybe that has something to do with it???? I'm no sysadmin and the sysadmin they use doesn't know much.
Any ideas on what to do?? I really need to fix this asap - help! Peter
attached mail follows:
I am using php4.0.6, and on this page http://twig.screwdriver.net/file.php3?file=FAQ&plaintext=1 I found a mention of this error saying that it is because of changes in PHP4. However, I am using PHP 4 locally and on the test server and they both work. Do I have to ask them to upgrade to PHP 4.2.0?? If that doesn't fix it I'll look stupid having asked that! Peter
At 11:38 AM 7/9/2002, you wrote: >Help! >I was using FastTemplates on my local machine AND on my personal server >and it all worked well. When I am uploading the code to my client's server >today, I get this strange warning whenever using FastTemplates: > >Warning: Invalid content of \{\} in >/home/httpd/includes/fasttemplate.class.php on line 199 > >I get about 50 lines like this. >A google search shows other sites have had the same problem with >FastTemplates: >http://www.google.com/search?sourceid=navclient&q=%22Invalid+content%22 >But a search on the php.net site didn't give any results. > >In the code, line 199 of fasttemplate.class.php is empty, followed by the >following code: > > function utime () > > { > > $time = explode( " ", microtime()); > > $usec = (double)$time[0]; > > $sec = (double)$time[1]; > > return $sec + $usec; > > } > >I really am stuck: this didn't happen on my local machine or on my test >server, it's happening on the client's machine now and they are expecting >the site today and I have no idea what's wrong. We've had problems with >permissions on their server, maybe that has something to do with it???? >I'm no sysadmin and the sysadmin they use doesn't know much. > >Any ideas on what to do?? I really need to fix this asap - help! >Peter > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
The fix presented on the top of this page http://www.thewebmasters.net/php/FastTemplate.phtml Doesn't solve the problem. I have tried to replace $key = '{'."$key".'}';½ with $key = '\{'."$key".'\}'; still no luck!
Is there a version of FastTemplates available somewhere that just works? thanks Peter
At 11:38 AM 7/9/2002, you wrote: >Help! >I was using FastTemplates on my local machine AND on my personal server >and it all worked well. When I am uploading the code to my client's server >today, I get this strange warning whenever using FastTemplates: > >Warning: Invalid content of \{\} in >/home/httpd/includes/fasttemplate.class.php on line 199 > >I get about 50 lines like this. >A google search shows other sites have had the same problem with >FastTemplates: >http://www.google.com/search?sourceid=navclient&q=%22Invalid+content%22 >But a search on the php.net site didn't give any results. > >In the code, line 199 of fasttemplate.class.php is empty, followed by the >following code: > > function utime () > > { > > $time = explode( " ", microtime()); > > $usec = (double)$time[0]; > > $sec = (double)$time[1]; > > return $sec + $usec; > > } > >I really am stuck: this didn't happen on my local machine or on my test >server, it's happening on the client's machine now and they are expecting >the site today and I have no idea what's wrong. We've had problems with >permissions on their server, maybe that has something to do with it???? >I'm no sysadmin and the sysadmin they use doesn't know much. > >Any ideas on what to do?? I really need to fix this asap - help! >Peter > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
You know really anoying mailing lists that send you e-mail you don't want
Wait... thats called spam... well...
to unsubscribe all you have to do is send an email back
remove
anoyingmaillist.com with the subject "REMOVE"
PHP === Can this wonder process things like that ????
Kindest Regards vins
attached mail follows:
I'm trying to change some information in the header...lets say that User Agent for example...but it just wont change.
putenv() will change the User Agent..but nothing else will
<? $ua = "Mozilla/4.0 (compatible;)";
header("User-Agent: $ua\n", TRUE); header("Accept: */*", TRUE);
//putenv("HTTP_USER_AGENT=$ua");
echo "\n<br>user agent: "; echo getenv("HTTP_USER_AGENT"); ?>
Suggestions?
attached mail follows:
I'm using a Zebra label printer in an application I have and in order to display an image on the label, according to the ZPL II printer language, any image must be converted to HEX code. Does anyone hvae a code snippet or know of a free utility that will take a graphic image (BMP, GIF, JPG, etc...) and convert it to HEX values?
Thanx...
attached mail follows:
$hFile = fopen($PathToFile,'r'); $File = fread($hFile, $SizeOfLargestImageYouHave); fclose($hFile); $HexVal = bin2hex($File);
This doesn't do any error checking or stripping of image headers that may be necessary; you'll have to use string functions (eg; substr() or maybe regexps) to do that.
For more info, see:
http://www.php.net/manual/en/function.fopen.php http://www.php.net/manual/en/function.fread.php http://www.php.net/manual/en/function.bin2hex.php
-steve
At 9:08 AM -0700 7/9/02, JSheble wrote: >I'm using a Zebra label printer in an application I have and in >order to display an image on the label, according to the ZPL II >printer language, any image must be converted to HEX code. Does >anyone hvae a code snippet or know of a free utility that will take >a graphic image (BMP, GIF, JPG, etc...) and convert it to HEX values? > >Thanx... >
-- +------------------------------------------------------------------------+ | Steve Edberg sbedbergucdavis.edu | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | +------------------------------------------------------------------------+ | The end to politics as usual: | | The Monster Raving Loony Party (http://www.omrlp.com/) | +------------------------------------------------------------------------+
attached mail follows:
Hi!
I've been using PHP to write shell scripts and was wondering how to implement the following:
- I have a menuing system - If a user does not give an input within a certain amount of time, I want it to go to a default value
I checked the PHP functions page and the closest thing I found was "sleep" which isn't quite right. I'm sure this is a common thing, so does anyone have any suggestions? Again, this is a terminal program and not a web CGI.
While I have your attention, I also wanted to create one of those "spinners" while users wait for longer tasks to complete. I tried using the ncurses stuff to print and erase characters, but it didn't seem to work. What is a good way to create a "spinner" so that users know that the program is working.
For those who don't know what I mean, I'm thinking of something like...
- (backspace) \ (backspace) | (backspace) / (backspace) etc. etc.
Thanks in advance!
Michael
attached mail follows:
Well, the problem is this. I work for an all-Microsoft company that is currently being forced to take on a number of Linux servers. They have this framework that allows for the automated installation and configuration of servers based on a number of Windows 2000 staging servers and a SQL server. The problem? They want the same framework to build out Linux servers as well.
So basically I had to find a way to get these Linux servers to talk to the existing framework. It didn't seem so bad at first, but I had a hell of a time getting the Linux box to talk to the MS SQL server. ODBC didn't seem to work nor did the variety of Perl modules that I tried. The only thing I got to work was PHP (Sybase) and FreeTDS. I really wanted to do this in Perl, but alas, I'm forced to do it in PHP.
That's the story. ;-)
Michael
----- Original Message -----
From: "Taylor York" <taylor
dreamstargroup.com>
To: "Michael" <php
twentyten.org>
Sent: Tuesday, July 09, 2002 9:47 AM
Subject: Re: Wait/Timeout
> Hum. Im kindof curious about the shell...
> I really know next to nothing about them, but anyway..just wondering why
you
> are making one?
> and just little details or something...sounds like an interesting project.
>
> ----- Original Message -----
> From: "Michael" <php
twentyten.org>
> Newsgroups: php.general
> To: "PHP General" <php-general
lists.php.net>
> Sent: Tuesday, July 09, 2002 11:14 AM
> Subject: Wait/Timeout
>
>
> > Hi!
> >
> > I've been using PHP to write shell scripts and was wondering how to
> > implement the following:
> >
> > - I have a menuing system
> > - If a user does not give an input within a certain amount of time, I
> want
> > it to go to a default value
> >
> > I checked the PHP functions page and the closest thing I found was
"sleep"
> > which isn't quite right. I'm sure this is a common thing, so does
anyone
> > have any suggestions? Again, this is a terminal program and not a web
> CGI.
> >
> > While I have your attention, I also wanted to create one of those
> "spinners"
> > while users wait for longer tasks to complete. I tried using the
ncurses
> > stuff to print and erase characters, but it didn't seem to work. What
is
> a
> > good way to create a "spinner" so that users know that the program is
> > working.
> >
> > For those who don't know what I mean, I'm thinking of something like...
> >
> > - (backspace) \ (backspace) | (backspace) / (backspace) etc. etc.
> >
> > Thanks in advance!
> >
> >
> > Michael
> >
>
attached mail follows:
You could call another script in language of your choise using $output =exec('command');
Marek
Michael wrote:
>Hi! > >I've been using PHP to write shell scripts and was wondering how to >implement the following: > > - I have a menuing system > - If a user does not give an input within a certain amount of time, I want >it to go to a default value > >I checked the PHP functions page and the closest thing I found was "sleep" >which isn't quite right. I'm sure this is a common thing, so does anyone >have any suggestions? Again, this is a terminal program and not a web CGI. > >While I have your attention, I also wanted to create one of those "spinners" >while users wait for longer tasks to complete. I tried using the ncurses >stuff to print and erase characters, but it didn't seem to work. What is a >good way to create a "spinner" so that users know that the program is >working. > >For those who don't know what I mean, I'm thinking of something like... > >- (backspace) \ (backspace) | (backspace) / (backspace) etc. etc. > >Thanks in advance! > > >Michael > > > >
attached mail follows:
Hello, I have a couple of questions with respect to creating a postal / zip code proximity search that is remotely accurate. The system I am using now is OK for small distances, but is terrible at calculating large distances.
What I have is a database of establishments and their corresponding latitudes and longitudes, and I need to have users enter their own postal / zip code, and have the system calculate which establishments fall into a set range ($range) from their location. Not only does it need to find the establishments, it needs to calculate the distances (straight line, of course).
Now, I have dug through the PHP archives, but there is no single clear explanation of how to do this, from beginning to end. I will start by putting down what I need, and then maybe other people can contribute to this and in the end we will have the solution, nice and tidy, in one place.
*** NOTE: I know doing this in PHP will be SLOW, but I do not want to write a MySQL user-defined function and recompile it and blah, blah, blah... (unless someone wants to cover that aspect!!! :D)
Step 1: Take the postal / zip code that the user entered, and search the national postal / zip code database (which I already have) and return its corresponding latitude and longitude ($userLat and $userLong).
Step 2: ???
Step 3: Return the establishments information to the user, complete with the distances to them, ordered by smallest distance to largest.
If you can't help me out, maybe you can direct me to some online tutorials on this topic!
Thanks in Advance!
-- -------------------------- Brandon Pearcy Internet TechnicianBowes Online -------------------------- phone: 1-780-532-1110 ext. 265 fax: 1-780-532-2120 bpearcy
bowesnet.com
attached mail follows:
One suggestion is to use the geo functionality of Postgres....
We use postgres to calculate city, state, and/or country by using the geo functions in postgresql.
I would really suggest using postgres for your calculations.
You can pass the lat and long and have postgres give you the intersection of these and reference a table that has the zip codes....
B i g D o g
----- Original Message -----
From: "Brandon Pearcy" <bpearcy
mail.bowesnet.com>
To: <php-general
lists.php.net>
Sent: Thursday, July 04, 2002 9:33 AM
Subject: [PHP] Postal / Zip Code Proximity Search
> Hello,
> I have a couple of questions with respect to creating a postal /
> zip code proximity search that is remotely accurate. The system I am
> using now is OK for small distances, but is terrible at calculating
> large distances.
>
> What I have is a database of establishments and their corresponding
> latitudes and longitudes, and I need to have users enter their own
> postal / zip code, and have the system calculate which establishments
> fall into a set range ($range) from their location. Not only does it
> need to find the establishments, it needs to calculate the distances
> (straight line, of course).
>
> Now, I have dug through the PHP archives, but there is no single
> clear explanation of how to do this, from beginning to end. I will
> start by putting down what I need, and then maybe other people can
> contribute to this and in the end we will have the solution, nice and
> tidy, in one place.
>
> *** NOTE: I know doing this in PHP will be SLOW, but I do not want to
> write a MySQL user-defined function and recompile it and blah, blah,
> blah... (unless someone wants to cover that aspect!!! :D)
>
> Step 1: Take the postal / zip code that the user entered, and
> search the national postal / zip code database (which I already have)
> and return its corresponding latitude and longitude ($userLat and
> $userLong).
>
> Step 2: ???
>
> Step 3: Return the establishments information to the user, complete
> with the distances to them, ordered by smallest distance to largest.
>
>
>
> If you can't help me out, maybe you can direct me to some online
> tutorials on this topic!
>
> Thanks in Advance!
> --
> --------------------------
> Brandon Pearcy
> Internet Technician
>
> Bowes Online
> --------------------------
> phone: 1-780-532-1110 ext. 265
> fax: 1-780-532-2120
> bpearcy
bowesnet.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
http://www.totalscripts.com/pages/Perl_Scripts/Calculator/
GeoZip... only for US postcodes tho.. but is ur US fine ;)
> -----Original Message-----
> From: Brandon Pearcy [mailto:bpearcy
mail.bowesnet.com]
> Sent: 04 July 2002 4:34 PM
> To: php-general
lists.php.net
> Subject: [PHP] Postal / Zip Code Proximity Search
>
>
> Hello,
> I have a couple of questions with respect to creating a postal /
> zip code proximity search that is remotely accurate. The system I am
> using now is OK for small distances, but is terrible at calculating
> large distances.
>
> What I have is a database of establishments and their
> corresponding
> latitudes and longitudes, and I need to have users enter their own
> postal / zip code, and have the system calculate which establishments
> fall into a set range ($range) from their location. Not only does it
> need to find the establishments, it needs to calculate the distances
> (straight line, of course).
>
> Now, I have dug through the PHP archives, but there is no single
> clear explanation of how to do this, from beginning to end. I will
> start by putting down what I need, and then maybe other people can
> contribute to this and in the end we will have the solution, nice and
> tidy, in one place.
>
> *** NOTE: I know doing this in PHP will be SLOW, but I do not want to
> write a MySQL user-defined function and recompile it and blah, blah,
> blah... (unless someone wants to cover that aspect!!! :D)
>
> Step 1: Take the postal / zip code that the user entered, and
> search the national postal / zip code database (which I already have)
> and return its corresponding latitude and longitude ($userLat and
> $userLong).
>
> Step 2: ???
>
> Step 3: Return the establishments information to the user,
> complete
> with the distances to them, ordered by smallest distance to largest.
>
>
>
> If you can't help me out, maybe you can direct me to some online
> tutorials on this topic!
>
> Thanks in Advance!
> --
> --------------------------
> Brandon Pearcy
> Internet Technician
>
> Bowes Online
> --------------------------
> phone: 1-780-532-1110 ext. 265
> fax: 1-780-532-2120
> bpearcy
bowesnet.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On 9 Jul 2002 at 10:39, Ray Hunter wrote:
> One suggestion is to use the geo functionality of Postgres.... > > We use postgres to calculate city, state, and/or country by using the > geo functions in postgresql.
> ----- Original Message -----
> From: "Brandon Pearcy" <bpearcy
mail.bowesnet.com>
> > I have a couple of questions with respect to creating a postal / > > zip code proximity search that is remotely accurate. The system I am > > using now is OK for small distances, but is terrible at calculating > > large distances.
> > Not only does it need to find the establishments, it needs to > > calculate the distances (straight line, of course).
I don't know what you mean by straight line. AFAIK all of this will be as "the crow flies".
The following came from Jann Linder of cgi-list fame and it worked for me. Odd, I used it in PostgreSQL not knowing that there was something homegrown.
SELECT /*+FIRST_ROWS */ o.zip, (3956 * (2 * ASIN(SQRT( POWER(SIN(((z.latitude-o.latitude)*0.017453293)/2),2) + COS(z.latitude*0.017453293) * COS(o.latitude*0.017453293) * POWER(SIN(((z.longitude-o.longitude)*0.017453293)/2),2) )))) dist FROM zipcodes z, zipcodes o WHERE z.zip=94112 AND (3956 * (2 * ASIN(SQRT( POWER(SIN(((z.latitude-o.latitude)*0.017453293)/2),2) + COS(z.latitude*0.017453293) * COS(o.latitude*0.017453293) * POWER(SIN(((z.longitude-o.longitude)*0.017453293)/2),2) )))) < 5 order by dist; CREATE TABLE zipcodes ( recordid int(11) unsigned NOT NULL auto_increment, zip varchar(5) NOT NULL default '', state char(2) NOT NULL default '', city varchar(50) NOT NULL default '', longitude double NOT NULL default '0', latitude double NOT NULL default '0', sure tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (recordid), KEY idx_zip(zip), KEY idx_state(state), KEY idx_city(city), KEY idx_latitude(latitude), KEY idx_longitude(longitude), KEY idx_sure(sure) ) TYPE=MyISAM;
More stuff about this here:
http://mathforum.org/library/drmath/view/51711.html http://www.movable-type.co.uk/scripts/LatLong.html http://earth.uni-muenster.de/~eicksch/GMT-Help/msg00147.html
Peter
attached mail follows:
> -----Original Message-----
> From: Peter J. Schoenster [mailto:peter
schoenster.com]
> Sent: Tuesday, July 09, 2002 1:26 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] Postal / Zip Code Proximity Search
>
>
> I don't know what you mean by straight line. AFAIK all of
> this will be as "the crow flies".
>
> The following came from Jann Linder of cgi-list fame and it
> worked for me. Odd, I used it in PostgreSQL not knowing that
> there was something homegrown.
>
> SELECT /*+FIRST_ROWS */
> o.zip,
> (3956 * (2 * ASIN(SQRT(
> POWER(SIN(((z.latitude-o.latitude)*0.017453293)/2),2) +
> COS(z.latitude*0.017453293) *
> COS(o.latitude*0.017453293) *
> POWER(SIN(((z.longitude-o.longitude)*0.017453293)/2),2)
> )))) dist
> FROM zipcodes z,
> zipcodes o
> WHERE z.zip=94112
> AND (3956 * (2 * ASIN(SQRT(
> POWER(SIN(((z.latitude-o.latitude)*0.017453293)/2),2) +
> COS(z.latitude*0.017453293) *
> COS(o.latitude*0.017453293) *
> POWER(SIN(((z.longitude-o.longitude)*0.017453293)/2),2)
> )))) < 5 order by dist;
>
>
> CREATE TABLE zipcodes (
> recordid int(11) unsigned NOT NULL auto_increment,
> zip varchar(5) NOT NULL default '',
> state char(2) NOT NULL default '',
> city varchar(50) NOT NULL default '',
> longitude double NOT NULL default '0',
> latitude double NOT NULL default '0',
> sure tinyint(3) unsigned NOT NULL default '0',
> PRIMARY KEY (recordid),
> KEY idx_zip(zip),
> KEY idx_state(state),
> KEY idx_city(city),
> KEY idx_latitude(latitude),
> KEY idx_longitude(longitude),
> KEY idx_sure(sure)
> ) TYPE=MyISAM;
>
>
>
> More stuff about this here:
>
> http://mathforum.org/library/drmath/view/51711.html
> http://www.movable-type.co.uk/scripts/LatLong.html
> http://earth.uni-muenster.de/~eicksch/GMT-Help/msg00147.html
I found the points file here: ftp://ftp.census.gov/pub/tiger/pts/geoex.zip
attached mail follows:
Hello, I have a couple of questions with respect to creating a postal / zip code proximity search that is remotely accurate. The system I am using now is OK for small distances, but is terrible at calculating large distances.
What I have is a database of establishments and their corresponding latitudes and longitudes, and I need to have users enter their own postal / zip code, and have the system calculate which establishments fall into a set range ($range) from their location. Not only does it need to find the establishments, it needs to calculate the distances (straight line, of course).
Now, I have dug through the PHP archives, but there is no single clear explanation of how to do this, from beginning to end. I will start by putting down what I need, and then maybe other people can contribute to this and in the end we will have the solution, nice and tidy, in one place.
*** NOTE: I know doing this in PHP will be SLOW, but I do not want to write a MySQL user-defined function and recompile it and blah, blah, blah... (unless someone wants to cover that aspect!!! :D)
Step 1: Take the postal / zip code that the user entered, and search the national postal / zip code database (which I already have) and return its corresponding latitude and longitude ($userLat and $userLong).
Step 2: ???
Step 3: Return the establishments information to the user, complete with the distances to them, ordered by smallest distance to largest.
If you can't help me out, maybe you can direct me to some online tutorials on this topic!
Thanks in Advance!
-- -------------------------- Brandon Pearcy Internet TechnicianBowes Online -------------------------- phone: 1-780-532-1110 ext. 265 fax: 1-780-532-2120 bpearcy
bowesnet.com
attached mail follows:
I would suggest a creative solution of stealing MapQuest's distance calculations somehow. Or maybe just do a comparison query, like try and match all digits of the postal code and this will be closest, then match all but the last digit, then all but the last two, and so on, this will give you a list of address's with increasing distance.
Adam Voigt
adam.voigt
cryptocomm.com
On Thu, 2002-07-04 at 15:21, Brandon Pearcy wrote:
> Hello,
> I have a couple of questions with respect to creating a postal /
> zip code proximity search that is remotely accurate. The system I am
> using now is OK for small distances, but is terrible at calculating
> large distances.
>
> What I have is a database of establishments and their corresponding
> latitudes and longitudes, and I need to have users enter their own
> postal / zip code, and have the system calculate which establishments
> fall into a set range ($range) from their location. Not only does it
> need to find the establishments, it needs to calculate the distances
> (straight line, of course).
>
> Now, I have dug through the PHP archives, but there is no single
> clear explanation of how to do this, from beginning to end. I will
> start by putting down what I need, and then maybe other people can
> contribute to this and in the end we will have the solution, nice and
> tidy, in one place.
>
> *** NOTE: I know doing this in PHP will be SLOW, but I do not want to
> write a MySQL user-defined function and recompile it and blah, blah,
> blah... (unless someone wants to cover that aspect!!! :D)
>
> Step 1: Take the postal / zip code that the user entered, and
> search the national postal / zip code database (which I already have)
> and return its corresponding latitude and longitude ($userLat and
> $userLong).
>
> Step 2: ???
>
> Step 3: Return the establishments information to the user, complete
> with the distances to them, ordered by smallest distance to largest.
>
>
>
> If you can't help me out, maybe you can direct me to some online
> tutorials on this topic!
>
> Thanks in Advance!
> --
> --------------------------
> Brandon Pearcy
> Internet Technician
>
> Bowes Online
> --------------------------
> phone: 1-780-532-1110 ext. 265
> fax: 1-780-532-2120
> bpearcy
bowesnet.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
¡i ¦b pbenoit
triton-network.com (Peter Benoit) ªº¤j§
¤¤´£¨ì: ¡j
: I've seen sites with just php as the file extension, but it doesn't work on
: my host. Is there a setting for this?
: TIA,
: Peter
What's your httpd server?
-- [m[1;33m¡° ¨Ó·½:¡ELastLoveSong lls.twbbs.org¡E[FROM: localhost.localdomai][m
attached mail follows:
I have installed PHP4.2.1 and when I open a browser to look at a test php page? all I see is the php code, not the output of phpinfo(). I know it is something small that I have overlooked. Can someone help? Please???
Thanks in advance, RC Hopp3r
attached mail follows:
I'll assume you're using Apache. Did you add (or uncomment) the relavent lines in httpd.conf? Check the php installation manual for the lines to add.
-- Tyler Longren Captain Jack Communications tylercaptainjack.com www.captainjack.com
On Tue, 9 Jul 2002 12:02:27 -0500 "Hopp3r" <rclark
swbanktx.com> wrote:
> I have installed PHP4.2.1 and when I open a browser to look at a test > php page? all I see is the php code, not the output of phpinfo(). I > know it is something small that I have overlooked. Can someone help? > Please??? > > Thanks in advance, > RC Hopp3r > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
ðÒÉ×ÅÔ!
Hopp3r wrote: > I have installed PHP4.2.1 and when I open a browser to look at a test php > page? all I see is the php code, not the output of phpinfo(). I know it is > something small that I have overlooked. Can someone help? Please??? >
Yes, you forgot reading the instructions :) You are missing these lines:
AddType application/x-httpd-php .php AddType application/x-httpd-php .phtml AddType application/x-httpd-php .php3 AddType application/x-httpd-php-source .phps
in your /usr/local/apache/conf/httpd.conf file
ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
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've been trying and trying to get my site to work lately and all but one part does. Of course that one part is the most important part (it always is).
My problem is probably rather simple to most of you, but I don't know how to get around it: My script does not have permissions to write/append files or just flat out create the files; it can read any files (accessed "files//nameoffile.xml"). Originally I was working with text files, but that didn't work either (and had the exact same problems).
So my question is this: how do I get my script to have permissions to write or append to any file?
attached mail follows:
So here's what I'm trying to do:
I have a form submitting dozens of variables called var1, var2, var3, ...... and on and on.
I want to check the value of each of these variables:
for($i = 1;$i < 100; $i++) { if($var$i > 0) echo "Yup. $var$i is greater than 0"; }
I get a parse error when trying to run this code. Can I not use $i to call the $var1, $var2, etc. variables? Is there another way of doing this?
Thanks,
Joseph
attached mail follows:
It's called Variable Variables.
for($i = 1; $i < 100; $i++) { $varname = "var" . $i; if($$varname > 0) echo "Yup."; }
Adam Voigt
adam.voigt
cryptocomm.com
On Tue, 2002-07-09 at 14:12, Joseph Szobody wrote: > So here's what I'm trying to do: > > I have a form submitting dozens of variables called var1, var2, var3, ...... and on and on. > > I want to check the value of each of these variables: > > for($i = 1;$i < 100; $i++) { > if($var$i > 0) > echo "Yup. $var$i is greater than 0"; > } > > I get a parse error when trying to run this code. Can I not use $i to call the $var1, $var2, etc. variables? Is there another way of doing this? > > Thanks, > > Joseph > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Joseph Szobody wrote: > So here's what I'm trying to do: > > I have a form submitting dozens of variables called var1, var2, var3, ...... and on and on. > > I want to check the value of each of these variables: > > for($i = 1;$i < 100; $i++) { > if($var$i > 0) > echo "Yup. $var$i is greater than 0"; > }
Do it like this:
for ($i = 1; $i < 100; $i++) { if (${"var$i"} > 0) { echo "Yup, $var$1 is greate than 0"; } }
Derick
attached mail follows:
You would have to set up a dummy variable to hold the value of two concatenated variable names. I'd love to write an example, but work is draggin' me down, sorry!
Martin
>>> "Joseph Szobody" <jszobody
excite.com> 07/09/02 02:12PM >>>
So here's what I'm trying to do:
I have a form submitting dozens of variables called var1, var2, var3, ...... and on and on.
I want to check the value of each of these variables:
for($i = 1;$i < 100; $i++) { if($var$i > 0) echo "Yup. $var$i is greater than 0"; }
I get a parse error when trying to run this code. Can I not use $i to call the $var1, $var2, etc. variables? Is there another way of doing this?
Thanks,
Joseph
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thanks folks. Worked like a charm
attached mail follows:
Why not just make the form's input names "var[]" then PHP will make them into an array:
for ($i = 1; $i < 100; $i++) { if ($var[$i -1] > 0) echo "Yup. ". $var[$i - 1] ." is greater than 0."; }
"Martin Clifford" <MLC1
nrc.gov> wrote in message
news:sd2ae23f.004
nrcgwia.nrc.gov...
You would have to set up a dummy variable to hold the value of two
concatenated variable names. I'd love to write an example, but work is
draggin' me down, sorry!
Martin
>>> "Joseph Szobody" <jszobody
excite.com> 07/09/02 02:12PM >>>
So here's what I'm trying to do:
I have a form submitting dozens of variables called var1, var2, var3, ...... and on and on.
I want to check the value of each of these variables:
for($i = 1;$i < 100; $i++) { if($var$i > 0) echo "Yup. $var$i is greater than 0"; }
I get a parse error when trying to run this code. Can I not use $i to call the $var1, $var2, etc. variables? Is there another way of doing this?
Thanks,
Joseph
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
If $this is an object, can I have the following link?
<a href="process_this.php?this=$this">Process</a>
Will the URL become too long? Will teh info get passed correctly? thanks
Alexander Ross
attached mail follows:
Hello,
this will not work, but what you can do is this:
$ser = serialize($this); echo "<a href="foo.php?this=$ser">Bar</a>\n";
and then do this in foo.php: $object = deserialize($_GET['this']);
Another way could be to use sessions, which will be a lot easier to work with in this case. (http://www.php.net/session_start)
Derick
Alexander Ross wrote: > If $this is an object, can I have the following link? > > <a href="process_this.php?this=$this">Process</a> > > Will the URL become too long? Will teh info get passed correctly? thanks > > Alexander Ross > > >
attached mail follows:
This won't work, you must register it within a session, just remember to declare the class befor session_start()
Alexander Ross wrote:
>If $this is an object, can I have the following link? > ><a href="process_this.php?this=$this">Process</a> > >Will the URL become too long? Will teh info get passed correctly? thanks > >Alexander Ross > > > > > >
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]