|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Thu Aug 30 2001 - 16:26:36 CDT
php-general Digest 30 Aug 2001 21:26:36 -0000 Issue 847
Topics (messages 65183 through 65367):
Re: 2nd Pass of array empty
65183 by: David Robley
65189 by: CC Zona
65191 by: Andrey Hristov
Re: HELP : How to suggest a download-filename for IE on MAC
65184 by: Sebastian Stadtlich
65241 by: Richard Lynch
Sessions in classes dosn't work!?
65185 by: Thomas Watson
65186 by: Andrey Hristov
65200 by: Thomas Watson
65213 by: Andrey Hristov
65253 by: Thomas Watson
Re: session and global
65187 by: Ben-Nes Michael
Re: GUI for PHP
65188 by: Nic Skitt
65203 by: sagar
65214 by: Ben-Nes Michael
Re: If i use preg_match() how can i preg_match next?
65190 by: _lallous
65194 by: Andrey Hristov
65263 by: _lallous
Locale Month Name
65192 by: Veniamin Goldin
65351 by: Don Read
Headers already sent....
65193 by: Nic Skitt
65195 by: Andrey Hristov
65197 by: Nic Skitt
65205 by: sagar
65212 by: Nic Skitt
65247 by: Nic Skitt
65350 by: Don Read
Re: strings in a function return
65196 by: * R&zE:
HTML mail
65198 by: Rosen
65199 by: jacky
65202 by: Andrey Hristov
Re: The future of PHP or my 2 cents
65201 by: Navid Yar
Re: PHP and PWS
65204 by: sagar
65206 by: sagar
65246 by: Richard Lynch
Re: GET/POST "name=value" query var convention?
65207 by: sagar
65208 by: sagar
65210 by: sagar
Re: Count
65209 by: sagar
65211 by: sagar
Re: The future of PHP
65215 by: Richard Lynch
65222 by: Richard Lynch
65229 by: Richard Lynch
65291 by: Egan
65325 by: Zeev Suraski
Re: Reading php source code?
65216 by: Richard Lynch
Re: Images Download
65217 by: Richard Lynch
Re: PHP Install Problem - Please Help
65218 by: Richard Lynch
Re: last bit of help ....
65219 by: Richard Lynch
Re: PHP as an Apache module
65220 by: Richard Lynch
Re: PHP auth logout
65221 by: Richard Lynch
Re: I need some help with this code
65223 by: Richard Lynch
Re: How to create thumbnails?
65224 by: Richard Lynch
Re: Cookieless =(
65225 by: Richard Lynch
Re: Generating Variables
65226 by: Richard Lynch
Re: Update 2 documents with only 1 POST?
65227 by: Richard Lynch
Re: path error while calling files
65228 by: Richard Lynch
Re: dose some one know of a scrip that will .......
65230 by: Richard Lynch
Re: A Separate Process?
65231 by: Richard Lynch
Re: javascript code beautification
65232 by: Richard Lynch
Re: payflow pro hosed
65233 by: Richard Lynch
Re: session.use_cookie
65234 by: Richard Lynch
Re: remote hosts
65235 by: Richard Lynch
Re: PHP on Win NT , IIS
65236 by: Richard Lynch
Re: mkdir failed
65237 by: Richard Lynch
Re: line by line
65238 by: Richard Lynch
Re: perl-esque data parsing for hex post variables
65239 by: Richard Lynch
Re: HTTP 500 server error
65240 by: Richard Lynch
Re: PHP Article... Comments??
65242 by: Richard Lynch
Re: Using PHP to move a row of information to another table
65243 by: Richard Lynch
Re: unset($PHP_AUTH_USER, $PHP_AUTH_PW)
65244 by: Richard Lynch
Re: overlaying alpha channel png over jpeg
65245 by: Richard Lynch
Associative arrays (names and strings)
65248 by: _lallous
65249 by: Andrey Hristov
65259 by: _lallous
65262 by: Andrey Hristov
65277 by: _lallous
Socket Server
65250 by: Ninety-Nine Ways To Die
Referrer
65251 by: Nic Skitt
65252 by: Larry Rosenman
65254 by: * R&zE:
65255 by: Andrey Hristov
65256 by: Nic Skitt
Reg-Session problem
65257 by: senthilvellan
65260 by: Andrey Hristov
Asynchronous SNMP?
65258 by: Robert Schultz
Quick TXT document stuff
65261 by: Kyle Smith
65264 by: Kyle Smith
65266 by: Tim
65267 by: _lallous
65306 by: Franklin van Velthuizen
Re: Variable is not showing up in the print string
65265 by: Girish P
Vairable is not showing up in the print string
65268 by: Girish P
65275 by: _lallous
Apache Segmentation fault.
65269 by: Bill Koch
Re: Regular Expression Problem and PHP 4 (urgent) --- continued
65270 by: Ross Nielsen
FORMAT return?
65271 by: Glyndower
65273 by: Andrey Hristov
65292 by: Alexander Skwar
65343 by: Don Read
Simple Char Swapping in String crashes Webserver
65272 by: Jens Kisters
Databases, arrays and woes
65274 by: Kath
65280 by: Hugh Bothwell
65284 by: _lallous
use php Convert between(foxpro) `.dbf' files and MySQL
65276 by: yang
September PHP meeting - SouthEast Michigan Php User Group (SEMPUG)
65278 by: Michael Kimsal
mail() not supported
65279 by: cyrille mortreux
Log file analysis
65281 by: Mark Lo
65285 by: Tim
Random number
65282 by: Rosen
65288 by: Hugh Bothwell
65365 by: Augusto Cesar Castoldi
PHP with Access?
65283 by: Jeff Lewis
Uploading large files
65286 by: Ulrich Hacke
65295 by: * R&zE:
include_path directive
65287 by: Gary
Non selected submited form-array values
65289 by: Julio Nobrega Trabalhando
PHP make install error
65290 by: james.iph.ac.ug
Re: Prevent user to close web browser
65293 by: Peter
Re: Making gd Extensions
65294 by: Chris Mulcahy
Delete Files on Server with PHP
65296 by: Paul Cohen
65299 by: Jason Brooke
65301 by: Paul Cohen
PHP and SOCKETS
65297 by: Dariusz Malinowski
65298 by: Jason Brooke
adding functionality to join
65300 by: Jack Dempsey
[PHP406]:No HTTP_POST_FILES on WinNT?
65302 by: Michael.Thanry.Artemisinternational.fr
65307 by: Franklin van Velthuizen
Re: Strange Form Error
65303 by: PHP List
If statement within a variable?
65304 by: Brandon Orther
65308 by: Andrey Hristov
65310 by: Jack Dempsey
65311 by: * R&zE:
65313 by: Franklin van Velthuizen
65315 by: * R&zE:
65323 by: Alexander Skwar
JOIN
65305 by: Jeremy Morano
Re: php and Interbase
65309 by: V
65332 by: Todd Cary
Re: correction to JOIN
65312 by: Jeremy Morano
65361 by: Sheridan Saint-Michel
Header() function and redirect
65314 by: Zhu George-CZZ010
65318 by: * R&zE:
65324 by: Zhu George-CZZ010
65328 by: * R&zE:
Date formatting in PHP 3.0
65316 by: Paul McGee
65327 by: * R&zE:
65329 by: Paul McGee
65330 by: * R&zE:
headers...
65317 by: Nic Skitt
65319 by: Franklin van Velthuizen
65321 by: Nic Skitt
65326 by: Simon Robson
Re: script preprocessor?
65320 by: Christian Reiniger
Re: fgets
65322 by: Christian Reiniger
fpassthru (was: fgets)
65331 by: Joseph Bannon
65341 by: Christopher William Wesley
65348 by: Joseph Bannon
65353 by: Christopher William Wesley
65358 by: Joseph Bannon
65364 by: Joseph Bannon
How to Return a Real Filename?
65333 by: Henrik Hudson
65359 by: Henrik Hudson
65360 by: Franklin van Velthuizen
determining the pixel width of a string
65334 by: John Meyer
Re: how to sort search results by relevance? thanks
65335 by: BRACK
Grabbing all files and adding to select boxes...
65336 by: Jeff Lewis
How to do "Add More"/expanding forms?
65337 by: Chris Bailey
65339 by: Jack Dempsey
kdevelop?
65338 by: Daniel Adams
imagecreatefromgif
65340 by: Chris
Whacky WGET issue...
65342 by: Sondra Russell
Decent Web Calendar With Moderated Public Postings
65344 by: Mike Gifford
65347 by: Rasmus Lerdorf
65352 by: Mike Gifford
Re: Add Slashes - Server Adds Them Automatically - Advice Requested!
65345 by: Mike Gifford
file upload size, before upload complete
65346 by: christopher johnson
65349 by: Joseph Bannon
65354 by: * R&zE:
Directing A Parked Domain To A Sub Directory
65355 by: Jeff Gannaway
65357 by: Boget, Chris
begginer needs help
65356 by: Nikola Veber
65362 by: Patrick Calkins
65367 by: Erols
Re: Database Preference? -- Manuel, Michael, Miles
65363 by: Manuel Lemos
imap_search?
65366 by: shi
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 Thu, 30 Aug 2001 17:33, Ben.Edwards
chase.com wrote:
> I have some code which loops through a n array using a for loop. This
> works fine but if I try to loop through the array again in the same
> script the array seems to be empty (i,e, the loop douse not do any
> interations). Do I need to reset the array pointer at the begining? Is
> there something else I need to do?
>
> Regards,
> Ben
Reset the array pointer before the second any any subsequent iteration.
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAIf cats have kittens, do bats have bittens?
attached mail follows:
In article <OF8B587473.AE8B21CC-ONC1256AB8.002C017D
notes.chase.com>,
Ben.Edwards
chase.com (Ben Edwards) wrote:
> I have some code which loops through a n array using a for loop. This > works fine but if I try to loop through the array again in the same script > the array seems to be empty (i,e, the loop douse not do any interations). > Do I need to reset the array pointer at the begining? Is there something > else I need to do?
Yes, a reset sounds like the likely solution. <http://php.net/reset> If that's not it, then repost with a code example.
-- CC
attached mail follows:
Use foreach and there will not be a need of reset because foreach is not moving the internal array pointer.
foreach ($somearray => $value){ } foreach ($somearray as $key => $value) { }
Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%
----- Original Message -----
From: "CC Zona" <cczona
nospam.invalid>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 12:42 PM
Subject: [PHP] Re: 2nd Pass of array empty
> In article <OF8B587473.AE8B21CC-ONC1256AB8.002C017D
notes.chase.com>,
> Ben.Edwards
chase.com (Ben Edwards) wrote:
>
> > I have some code which loops through a n array using a for loop. This
> > works fine but if I try to loop through the array again in the same script
> > the array seems to be empty (i,e, the loop douse not do any interations).
> > Do I need to reset the array pointer at the begining? Is there something
> > else I need to do?
>
> Yes, a reset sounds like the likely solution. <http://php.net/reset> If
> that's not it, then repost with a code example.
>
> --
> CC
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Thanks David
That behavior is the best i could acomplish be header() also. But i found another way : 1. I link to a nonexiting directroy: http://www.mydomain.de/pdfs/test.pdf 2. i catch 404s by htaccess redirection 3. i parse the REDIRECT_URI if the request is for a pdf in that vitual directory 4. if true and the file exists i include the downloadscript, which checks for authorisation 5. else raise either authentication of 404 6. works on all browsers !!!!
thanks for your suggestions
Sebastian
> -----Ursprungliche Nachricht-----
> Von: David Minor [mailto:dave
dminor.com]
> Gesendet: Donnerstag, 30. August 2001 07:11
> An: Sebastian Stadtlich
> Betreff: re: HELP : How to suggest a download-filename for IE on MAC
>
>
> I just submitted my results from a download script test. You can see
> the full results in the archive search "force download".
>
> The short version is:
> IE for Mac users must click and hold the link until the
> contextual menu
> appears and choose the option "Download Link to Disk".
>
> This is not what I was wanting either, but alas ...
>
> I put up a javascript pop up window with instructions for IE for mac
> users. Not the best news, but hope this helps.
>
> David Minor
>
attached mail follows:
Change the URL to read: www.myserver.de/securedownload.php/checkliste3.pdf?pdfdownload=checkliste3.p df
Yes, it looks funky... But everybody but IE5 on the Mac will ignore that extra stuff between / and ?, and IE will use that as the filename prompt now.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Sebastian Stadtlich <Stadtlich
mediaworx.de> Newsgroups: php.general To: 'Php-General (E-Mail) <php-general
lists.php.net> Sent: Wednesday, August 29, 2001 10:12 AM Subject: HELP : How to suggest a download-filename for IE on MAC
HELP i'm desperate.... I try to write a downloadskript, which results in the fillowing URL : http://www.myserver.de/securedownload.php?pdfdownload=checkliste3.pdf
yes you guessed right : securedownload does some auth-stuff .... it works on win2000 IE 6.0,5.5 NE 6.0 AND 4.76. it also works well on MAC when used with Netscape 4.5 but not when used with IE 5. it always suggests 'securedownload.php' as the filename, which of cause sucks !!!! I tried EVERY combination of the suggested headers at www.php.net/header , but can't get it to work. here is what i use :
..... header( "Content-type: application/download\n" ); header( "Content-Disposition: filename=$download" ); header( "Content-Description: PHP3 Generated Data" );
set_time_limit(0); readfile('/home/path/to/myfiles/securepdfs/'.$download); ....
Anyone ever found a solution for MAC ?????? ( i hate Mac, but my boss uses one, so ....... )
Sebastian
attached mail follows:
How come that I cannot store a varible in the session when I do this from within another object?
This is my code: ******************************************** <?php session_start();
class MyClass { function MyClass($state) { if($state == "page2") { print("[" . $foo . "]"); session_destroy(); } else { session_register("foo"); $foo = "Hello World!"; print("<a href=\"?state=page2\">Click here</a>\n"); } } }
new MyClass($state); ?> ********************************************
/watson
attached mail follows:
This is because $foo is local to the member functions of the class. declare global $foo at the start of every function.
Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%
----- Original Message -----
From: "Thomas Watson" <w
tson.dk>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 12:10 PM
Subject: [PHP] Sessions in classes dosn't work!?
> How come that I cannot store a varible in the session when I do this
> from within another object?
>
> This is my code:
> ********************************************
> <?php
> session_start();
>
> class MyClass {
> function MyClass($state) {
> if($state == "page2") {
> print("[" . $foo . "]");
> session_destroy();
> } else {
> session_register("foo");
> $foo = "Hello World!";
> print("<a href=\"?state=page2\">Click here</a>\n");
> }
> }
> }
>
> new MyClass($state);
> ?>
> ********************************************
>
> /watson
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
> This is because $foo is local to the member functions of the class. > declare global $foo at the start of every function.
Ok thnx... it worked... but how do you then explain this?:
*********************************************** <?php
class TestClass { var $foo; function setFoo($bar) { $this->foo = $bar; } function getFoo() { return $this->foo; }
}
class TestClass2 { function TestClass2($state) { global $obj; if($state == "page2") { print("TYPE: " . gettype($obj) . "<br />\n"); print($obj->getFoo()); session_destroy(); } else { session_register("obj"); $obj =& new TestClass(); $obj->setFoo("Hello World!"); print("TYPE: " . gettype($obj) . "<br />\n"); print("<a href=\"?state=page2\">Click here</a>\n"); } }
}
session_start(); new TestClass2($state);
?> ***********************************************
When I on "page1" print("TYPE: " . gettype($obj) . "<br />\n"); I get this output: TYPE: object
When I on "page2" print("TYPE: " . gettype($obj) . "<br />\n"); I get this output: TYPE: NULL (and the linie saying print($obj->getFoo()); generates an error: Fatal error: Call to a member function on a non-object in /home/httpd/html/test/save_objects.php on line 27
(just so you know: I have no problems saving an object in the session when it's done outside a class. It's when I do this from within a class that the problem occurs)
/watson
attached mail follows:
Hmmm, it seems that "obj" is not saved to the session file.
I don't thik that & before new is needed. Also may the problem is in that you use the class contructor. When objects are saved in session, and on other page you want to wakeup them you must provide two methods for the class: function __sleep(){ return array("r","l","p","m_id"); } function __wakeup(){ $this->res_id=mysql_connnect("user","pass","host"); } __sleep() (double under) is called before wrinting in session file. it returns names (as strings) of variables which have to be saved. Why not all, because you can have a $res_id of db_link which is meaningless to save. __wakeup() is called when the object is restored in memory. If you have $res_id you have to create it here, so the persistent object after restoring to be as before saving.
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
99%
----- Original Message -----
From: "Thomas Watson" <dev.null
tson.dk>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 2:18 PM
Subject: Re: [PHP] Sessions in classes dosn't work!?
> > This is because $foo is local to the member functions of the class.
> > declare global $foo at the start of every function.
>
> Ok thnx... it worked... but how do you then explain this?:
>
> ***********************************************
> <?php
>
> class TestClass {
>
> var $foo;
>
> function setFoo($bar) {
> $this->foo = $bar;
> }
>
> function getFoo() {
> return $this->foo;
> }
>
> }
>
> class TestClass2 {
>
> function TestClass2($state) {
> global $obj;
> if($state == "page2") {
> print("TYPE: " . gettype($obj) . "<br />\n");
> print($obj->getFoo());
> session_destroy();
> } else {
> session_register("obj");
> $obj =& new TestClass();
> $obj->setFoo("Hello World!");
> print("TYPE: " . gettype($obj) . "<br />\n");
> print("<a href=\"?state=page2\">Click here</a>\n");
> }
> }
>
> }
>
> session_start();
> new TestClass2($state);
>
> ?>
> ***********************************************
>
> When I on "page1" print("TYPE: " . gettype($obj) . "<br />\n");
> I get this output: TYPE: object
>
> When I on "page2" print("TYPE: " . gettype($obj) . "<br />\n");
> I get this output: TYPE: NULL
> (and the linie saying print($obj->getFoo()); generates an error:
> Fatal error: Call to a member function on a non-object in
> /home/httpd/html/test/save_objects.php on line 27
>
> (just so you know: I have no problems saving an object in the session when
> it's done outside a class. It's when I do this from within a class that the
> problem occurs)
>
>
> /watson
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
> Hmmm, it seems that "obj" is not saved to the session file. > > > I don't thik that & before new is needed.
This is weird :) It worked when I removed the & (thought that I tried that ;). Now I just can't remember why I put it there in the first place. I hope it wasn't importent ... well I will proboply find out when some of the code dosn't work.
> Also may the problem is in that you use the class contructor. When > objects are saved in session, and on other page you want to wakeup them > you must provide two methods for the class: > function __sleep(){ > return array("r","l","p","m_id"); > } > function __wakeup(){ > $this->res_id=mysql_connnect("user","pass","host"); > } > __sleep() (double under) is called before wrinting in session file. it > returns names (as strings) of variables which have to be saved. Why not > all, because you can have a $res_id of db_link which is meaningless to > save. __wakeup() is called when the object is restored in memory. If > you have $res_id you have to create it here, so the persistent object > after restoring to be as before saving.
I knew about the __sleep() and __wakeup() but not about the returning of an array containing the names of the varibles that needs to be stored. Cool feature - Thanks for the tip :)
/watson
attached mail follows:
if global $var; is called from within a function and $var exist outside the nested function then the $var will be available to the function. example
$var = "hello world";
function say_hello() { global $var; echo $var; } will echo "hello world"
while
$var = "hello world";
function say_hello() { echo $var; } wont echo "hello world"
-------------------------- Canaan Surfing Ltd. Internet Service Providers Ben-Nes Michael - Manager Tel: 972-4-6991122 http://sites.canaan.co.il --------------------------
----- Original Message -----
From: "jacky" <jacky
activelifestyle.com>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 11:40 AM
Subject: [PHP] session and global
Hi folks I just wonder as I saw someone useing session with global and some don't. What is the reason to use session together with global? Like this: session_start(); global $test session_register('test');
I look up in manual using keyword "global", but could not find anything near this. Jack
attached mail follows:
Although.....
PHAKT is an addon to Macromedia Ultradev that handles PHP in a GUI environment. If you do a search for "PHAKT" on http://askhiran.com you should find the relevant links.
As with most GUI scripting tools, a good deal more code is written than is needed and I would have to agree with Matthew that hand coding is the way forward. I use PrimalScript. Its pretty nifty and you can store your own code snippets to speed up coding. Plus it has intellisense style help while writing your code which comes in handy.
Hope that helps
Nic Skitt http://ultradevfaq.com
"Matthew A. Schneider" <matsch
sasites.com> wrote in message
news:00a001c13106$a13bcc20$bf7ba8c0
satx.rr.com...
> As someone who has little programming experience I'd have to say jump
right
> in and forget the "GUI" (I'm not aware of any IDE for PHP). PHP is pretty
> easy (to learn, becoming a master is something else I suspect) and there
is
> always outstanding support either by reading this newsgroup's archive or
> posting a question if you don't find an answer. I've been dabbling for
close
> to a year now and have yet had a need to post any questions. I have
> invariably found the solution after a quick search.
>
> There are a number of good books as well. For the novice (I speak with
some
> authority here) try Julie C. Meloni's "PHP Essentials".
>
> If you're looking for an editor try PHPEd,
> http://www.soysal.com/PHPEd/index.php3
>
> And listen to what the experts (not me) have to say.
>
> Good luck,
>
> Matt
>
> ----- Original Message -----
> From: "Eric" <eric
sisgrate.com>
> To: "Php-General (E-mail)" <php-general
lists.php.net>
> Sent: Wednesday, August 29, 2001 6:12 PM
> Subject: [PHP] GUI for PHP
>
>
> > Does anyone have any suggestions for GUI PHP programming software. I am
> new
> > the PHP and would like to make the learning experience as quick and
simple
> > as possible.
> >
> > Thanks for your help,
> > Eric JT Harlow
> > www.sisgrate.com
> > Phone: 360 891 6991
> > Fax: 360 891 6865
> > Email: eric
sisgrate.com
> >
> >
> >
>
attached mail follows:
PHP is the cooolest language i have ever came across. If u have a least knowledge with C u can rule over it in a few days. And moreover what for v r all here ? if u have any problem just drop in a post u'll have ur inbox full of solutions from all over the world. this in one of (no not one of the) the best mailing lists.
ok have a great programming, /sagar
----- Original Message -----
From: Matthew A. Schneider <matsch
sasites.com>
To: <eric
sisgrate.com>; Php-General (E-mail) <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 9:18 AM
Subject: Re: [PHP] GUI for PHP
> As someone who has little programming experience I'd have to say jump
right
> in and forget the "GUI" (I'm not aware of any IDE for PHP). PHP is pretty
> easy (to learn, becoming a master is something else I suspect) and there
is
> always outstanding support either by reading this newsgroup's archive or
> posting a question if you don't find an answer. I've been dabbling for
close
> to a year now and have yet had a need to post any questions. I have
> invariably found the solution after a quick search.
>
> There are a number of good books as well. For the novice (I speak with
some
> authority here) try Julie C. Meloni's "PHP Essentials".
>
> If you're looking for an editor try PHPEd,
> http://www.soysal.com/PHPEd/index.php3
>
> And listen to what the experts (not me) have to say.
>
> Good luck,
>
> Matt
>
> ----- Original Message -----
> From: "Eric" <eric
sisgrate.com>
> To: "Php-General (E-mail)" <php-general
lists.php.net>
> Sent: Wednesday, August 29, 2001 6:12 PM
> Subject: [PHP] GUI for PHP
>
>
> > Does anyone have any suggestions for GUI PHP programming software. I am
> new
> > the PHP and would like to make the learning experience as quick and
simple
> > as possible.
> >
> > Thanks for your help,
> > Eric JT Harlow
> > www.sisgrate.com
> > Phone: 360 891 6991
> > Fax: 360 891 6865
> > Email: eric
sisgrate.com
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
_________________________________________________________
Do You Yahoo!?
Get your free
yahoo.com address at http://mail.yahoo.com
attached mail follows:
htmlkit rule :) and it for free to.
it have all what editor need + an ftp client build in which make life very easy. -------------------------- Canaan Surfing Ltd. Internet Service Providers Ben-Nes Michael - Manager Tel: 972-4-6991122 http://sites.canaan.co.il --------------------------
----- Original Message -----
From: "Nic Skitt" <nic
nicskitt.co.uk>
To: <php-general
lists.php.net>
Sent: Wednesday, August 29, 2001 12:23 PM
Subject: Re: [PHP] GUI for PHP
> Although.....
>
> PHAKT is an addon to Macromedia Ultradev that handles PHP in a GUI
> environment. If you do a search for "PHAKT" on http://askhiran.com you
> should find the relevant links.
>
> As with most GUI scripting tools, a good deal more code is written than is
> needed and I would have to agree with Matthew that hand coding is the way
> forward. I use PrimalScript. Its pretty nifty and you can store your own
> code snippets to speed up coding. Plus it has intellisense style help
while
> writing your code which comes in handy.
>
> Hope that helps
>
> Nic Skitt
> http://ultradevfaq.com
>
>
>
> "Matthew A. Schneider" <matsch
sasites.com> wrote in message
> news:00a001c13106$a13bcc20$bf7ba8c0
satx.rr.com...
> > As someone who has little programming experience I'd have to say jump
> right
> > in and forget the "GUI" (I'm not aware of any IDE for PHP). PHP is
pretty
> > easy (to learn, becoming a master is something else I suspect) and there
> is
> > always outstanding support either by reading this newsgroup's archive or
> > posting a question if you don't find an answer. I've been dabbling for
> close
> > to a year now and have yet had a need to post any questions. I have
> > invariably found the solution after a quick search.
> >
> > There are a number of good books as well. For the novice (I speak with
> some
> > authority here) try Julie C. Meloni's "PHP Essentials".
> >
> > If you're looking for an editor try PHPEd,
> > http://www.soysal.com/PHPEd/index.php3
> >
> > And listen to what the experts (not me) have to say.
> >
> > Good luck,
> >
> > Matt
> >
> > ----- Original Message -----
> > From: "Eric" <eric
sisgrate.com>
> > To: "Php-General (E-mail)" <php-general
lists.php.net>
> > Sent: Wednesday, August 29, 2001 6:12 PM
> > Subject: [PHP] GUI for PHP
> >
> >
> > > Does anyone have any suggestions for GUI PHP programming software. I
am
> > new
> > > the PHP and would like to make the learning experience as quick and
> simple
> > > as possible.
> > >
> > > Thanks for your help,
> > > Eric JT Harlow
> > > www.sisgrate.com
> > > Phone: 360 891 6991
> > > Fax: 360 891 6865
> > > Email: eric
sisgrate.com
> > >
> > >
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
I don't really get it! in preg_match_all() the $matches array what will it contain?
i mean $matches[0] is the whole match, and every $match[0][1] $match[0][2] $match[0][n] is my subexpression. now what does the $match[1] have? or $match[2] ?
I usually use these modifiers: "/is"
"Cc Zona" <cczona
nospam.invalid> wrote in message
news:20010830085210.3727.qmail
pb1.pair.com...
> In article <20010830083215.95556.qmail
pb1.pair.com>,
> elias_bachaalany
yahoo.com (_lallous) wrote:
>
> > If i have this string: "1 2 3 4 5 6 7 no more!"
> > and this regular expression: "([0-9]+)"
> >
> > now how can i run preg_match to get result by result until no results
are
> > returned?
>
> <http://php.net/preg_match_all>
>
> --
> CC
attached mail follows:
It depends of the last parameter to preg_match_all. PREG_PATTERN_ORDER and PREG_SET_ORDER. One of these is the default value. |<a (.*?)>(.*?)></a>|
PREG_PATTERN_ORDER : ----Orders results so that $matches[0] is an array of full pattern matches, $matches[1] is an array of strings matched by the first parenthesized subpattern, and so on. Using above pattern if we have some links in text to search for matches then $matches[1][0],$matches[1][1].... will contain the params of <a> . $matches[2][0],$matches[2][1].... will contain the link text.
PREG_SET_ORDER : ----Orders results so that $matches[0] is an array of first set of matches, $matches[1] is an array of second set of matches, and so on. Using above pattern $matches[1][0] will be te params for fist matched link. $matches[1][1] link text. $matches[2][0] params of second matched <a>, $matches[2][1] link text ...and so on.
Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%
----- Original Message -----
From: "_lallous" <elias_bachaalany
yahoo.com>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 1:40 PM
Subject: [PHP] Re: If i use preg_match() how can i preg_match next?
> I don't really get it! in preg_match_all()
> the $matches array what will it contain?
>
> i mean $matches[0] is the whole match, and every $match[0][1] $match[0][2]
> $match[0][n] is my subexpression.
> now what does the $match[1] have? or $match[2] ?
>
> I usually use these modifiers: "/is"
>
> "Cc Zona" <cczona
nospam.invalid> wrote in message
> news:20010830085210.3727.qmail
pb1.pair.com...
> > In article <20010830083215.95556.qmail
pb1.pair.com>,
> > elias_bachaalany
yahoo.com (_lallous) wrote:
> >
> > > If i have this string: "1 2 3 4 5 6 7 no more!"
> > > and this regular expression: "([0-9]+)"
> > >
> > > now how can i run preg_match to get result by result until no results
> are
> > > returned?
> >
> > <http://php.net/preg_match_all>
> >
> > --
> > CC
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Thanks alot Andrey.
"Andrey Hristov" <ahristov
icygen.com> wrote in message
news:017a01c13139$e1bb2600$0b01a8c0
ANDreY...
> It depends of the last parameter to preg_match_all.
> PREG_PATTERN_ORDER and PREG_SET_ORDER.
> One of these is the default value.
> |<a (.*?)>(.*?)></a>|
>
> PREG_PATTERN_ORDER :
> ----Orders results so that $matches[0] is an array of full pattern
matches, $matches[1] is an array of strings matched by the first
> parenthesized subpattern, and so on. Using above pattern if we have some
links in text to search for matches then
> $matches[1][0],$matches[1][1].... will contain the params of <a> .
$matches[2][0],$matches[2][1].... will contain the link text.
>
> PREG_SET_ORDER :
> ----Orders results so that $matches[0] is an array of first set of
matches, $matches[1] is an array of second set of matches, and so
> on. Using above pattern $matches[1][0] will be te params for fist matched
link. $matches[1][1] link text. $matches[2][0] params of
> second matched <a>, $matches[2][1] link text ...and so on.
>
>
> Andrey Hristov
> IcyGEN Corporation
> http://www.icygen.com
> 99%
>
>
> ----- Original Message -----
> From: "_lallous" <elias_bachaalany
yahoo.com>
> To: <php-general
lists.php.net>
> Sent: Thursday, August 30, 2001 1:40 PM
> Subject: [PHP] Re: If i use preg_match() how can i preg_match next?
>
>
> > I don't really get it! in preg_match_all()
> > the $matches array what will it contain?
> >
> > i mean $matches[0] is the whole match, and every $match[0][1]
$match[0][2]
> > $match[0][n] is my subexpression.
> > now what does the $match[1] have? or $match[2] ?
> >
> > I usually use these modifiers: "/is"
> >
> > "Cc Zona" <cczona
nospam.invalid> wrote in message
> > news:20010830085210.3727.qmail
pb1.pair.com...
> > > In article <20010830083215.95556.qmail
pb1.pair.com>,
> > > elias_bachaalany
yahoo.com (_lallous) wrote:
> > >
> > > > If i have this string: "1 2 3 4 5 6 7 no more!"
> > > > and this regular expression: "([0-9]+)"
> > > >
> > > > now how can i run preg_match to get result by result until no
results
> > are
> > > > returned?
> > >
> > > <http://php.net/preg_match_all>
> > >
> > > --
> > > CC
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
attached mail follows:
Hello !
Please help me,
How to get Month name according to server's locale setings ?
I tryed to use:
setlocale("LC_ALL", "LT"); $month = strftime("%B", mktime(0,0,0,$m,1,$y));
But I get message:
Warning: Passing locale category name as string is deprecated. Use the LC_* -constants instead. in
(My PHP runes on Windows Server)
Thank You.
attached mail follows:
On 30-Aug-2001 Veniamin Goldin wrote: > Hello ! > > Please help me, > > How to get Month name according to server's locale setings ? > > I tryed to use: > > setlocale("LC_ALL", "LT"); > $month = strftime("%B", mktime(0,0,0,$m,1,$y)); > > But I get message: > > Warning: Passing locale category name as string is deprecated. Use the > LC_* -constants instead. in >
Try what it says, use the constant: setlocale(LC_ALL, 'LT');
-- Don Read dreadtexas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
Hi all,
I have a bit of a confusing one here. I have two enviroments:
1) Live server -PHP Version 4.0.3pl1 - Nov 21 2000 -Apache/1.3.12 Cobalt (Unix) -Linux
2) Local development -PHP Version 4.0.6 -Apache/1.3.20 (Win32) -Windows 2000 Pro
Now on the live server everything works fine but on my dev server, certain scripts return errors claiming that "Cannot add header information - headers already sent by..."
Both servers have output_buffering set to off.
The pages where the issue seems to arise contain session handling code and location headers eg:
<?
session_start(); $sid=session_id(); $uid=$HTTP_SESSION_VARS[userid];
if (!$uid){ header("location:client-login.php?validate=1"); exit(); }
?>
Anyone any ideas?? I am clean out.
Cheers
Nic
attached mail follows:
See if there is any symbol before <?php open tag. Also this seems bad : $uid=$HTTP_SESSION_VARS[userid]; may be: $uid=$HTTP_SESSION_VARS["userid"];
Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%
----- Original Message -----
From: "Nic Skitt" <nic
nicskitt.co.uk>
To: <php-general
lists.php.net>
Sent: Wednesday, August 29, 2001 12:50 PM
Subject: [PHP] Headers already sent....
> Hi all,
>
> I have a bit of a confusing one here. I have two enviroments:
>
> 1) Live server
> -PHP Version 4.0.3pl1 - Nov 21 2000
> -Apache/1.3.12 Cobalt (Unix)
> -Linux
>
> 2) Local development
> -PHP Version 4.0.6
> -Apache/1.3.20 (Win32)
> -Windows 2000 Pro
>
> Now on the live server everything works fine but on my dev server, certain
> scripts return errors claiming that "Cannot add header information - headers
> already sent by..."
>
> Both servers have output_buffering set to off.
>
> The pages where the issue seems to arise contain session handling code and
> location headers eg:
>
> <?
>
> session_start();
> $sid=session_id();
> $uid=$HTTP_SESSION_VARS[userid];
>
> if (!$uid){
> header("location:client-login.php?validate=1");
> exit();
> }
>
> ?>
>
>
> Anyone any ideas?? I am clean out.
>
> Cheers
>
> Nic
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Hi all,
I have a bit of a confusing one here. I have two enviroments:
1) Live server -PHP Version 4.0.3pl1 - Nov 21 2000 -Apache/1.3.12 Cobalt (Unix) -Linux
2) Local development -PHP Version 4.0.6 -Apache/1.3.20 (Win32) -Windows 2000 Pro
Now on the live server everything works fine but on my dev server, certain scripts return errors claiming that "Cannot add header information - headers already sent by..."
Both servers have output_buffering set to off.
The pages where the issue seems to arise contain session handling code and location headers eg:
<?
session_start(); $sid=session_id(); $uid=$HTTP_SESSION_VARS[userid];
if (!$uid){ header("location:client-login.php?validate=1"); exit(); }
?>
Anyone any ideas?? I am clean out.
Cheers
Nic
attached mail follows:
This will not work even if the code is like this <html>
<? your php
?> remaining html
see that theres no spaces till the php code starts. the code must be like <html> <? php code
?> remaining html
/sagar
----- Original Message -----
From: Nic Skitt <nic
nicskitt.co.uk>
To: <php-general
lists.php.net>
Sent: Wednesday, August 29, 2001 3:20 PM
Subject: [PHP] Headers already sent....
> Hi all,
>
> I have a bit of a confusing one here. I have two enviroments:
>
> 1) Live server
> -PHP Version 4.0.3pl1 - Nov 21 2000
> -Apache/1.3.12 Cobalt (Unix)
> -Linux
>
> 2) Local development
> -PHP Version 4.0.6
> -Apache/1.3.20 (Win32)
> -Windows 2000 Pro
>
> Now on the live server everything works fine but on my dev server, certain
> scripts return errors claiming that "Cannot add header information -
headers
> already sent by..."
>
> Both servers have output_buffering set to off.
>
> The pages where the issue seems to arise contain session handling code and
> location headers eg:
>
> <?
>
> session_start();
> $sid=session_id();
> $uid=$HTTP_SESSION_VARS[userid];
>
> if (!$uid){
> header("location:client-login.php?validate=1");
> exit();
> }
>
> ?>
>
>
> Anyone any ideas?? I am clean out.
>
> Cheers
>
> Nic
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
_________________________________________________________
Do You Yahoo!?
Get your free
yahoo.com address at http://mail.yahoo.com
attached mail follows:
Sagar,
Thanks but there isnt any spaces or HTML. The code on the page starts with the PHP tags and nothing else.
Nic
"Sagar" <sagarphp
yahoo.com> wrote in message
news:00c001c13141$cd995d60$5bed7ccb
ravella...
> This will not work even if the code is like this
> <html>
>
> <?
> your php
>
> ?>
> remaining html
>
> see that theres no spaces till the php code starts.
> the code must be like
> <html>
> <?
> php code
>
> ?>
> remaining html
>
> /sagar
>
>
> ----- Original Message -----
> From: Nic Skitt <nic
nicskitt.co.uk>
> To: <php-general
lists.php.net>
> Sent: Wednesday, August 29, 2001 3:20 PM
> Subject: [PHP] Headers already sent....
>
>
> > Hi all,
> >
> > I have a bit of a confusing one here. I have two enviroments:
> >
> > 1) Live server
> > -PHP Version 4.0.3pl1 - Nov 21 2000
> > -Apache/1.3.12 Cobalt (Unix)
> > -Linux
> >
> > 2) Local development
> > -PHP Version 4.0.6
> > -Apache/1.3.20 (Win32)
> > -Windows 2000 Pro
> >
> > Now on the live server everything works fine but on my dev server,
certain
> > scripts return errors claiming that "Cannot add header information -
> headers
> > already sent by..."
> >
> > Both servers have output_buffering set to off.
> >
> > The pages where the issue seems to arise contain session handling code
and
> > location headers eg:
> >
> > <?
> >
> > session_start();
> > $sid=session_id();
> > $uid=$HTTP_SESSION_VARS[userid];
> >
> > if (!$uid){
> > header("location:client-login.php?validate=1");
> > exit();
> > }
> >
> > ?>
> >
> >
> > Anyone any ideas?? I am clean out.
> >
> > Cheers
> >
> > Nic
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free
yahoo.com address at http://mail.yahoo.com
>
attached mail follows:
Thanks Andrey but that still hasnt fixed it.
The full error I am getting is:
Cannot add header information - headers already sent by (output started at c:\apache\apache\htdocs\client-secure.php:11) in c:\apache\apache\htdocs\client-secure.php on line 18
Line 11 refers to:
$uid=$HTTP_SESSION_VARS["userid"];
Now I cant understand why PHP thinks this has written to headers. Surely it is simply reading. And more to the point, why does this work on the live server but not on my dev box?
Cheers
Nic
attached mail follows:
On 30-Aug-2001 Nic Skitt wrote: > Thanks Andrey but that still hasnt fixed it. > > The full error I am getting is: > > Cannot add header information - headers already sent by (output started at > c:\apache\apache\htdocs\client-secure.php:11) in > c:\apache\apache\htdocs\client-secure.php on line 18 > > Line 11 refers to: > > $uid=$HTTP_SESSION_VARS["userid"]; > > Now I cant understand why PHP thinks this has written to headers.
Just a guess, but is $HTTP_SESSION_VARS["userid"] set ? if not you you might be getting some error warning here.
> Surely it > is simply reading. And more to the point, why does this work on the live > server but not on my dev box? >
error_reporting();
Regards,
-- Don Read dreadtexas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
<Original message>
From: Gerard Samuel <trini0
optonline.net>
Date: Wed, Aug 29, 2001 at 09:58:12PM -0400
Message-ID: <3B8D9DB4.10803
optonline.net>
Subject: Re: [PHP] strings in a function return
> I found an error, but it didn't do me any good. > I tried this, any tips... > Thanks > > function assign() { > global $adminurl, $string; > top(); > if ($string) { > $data = explode ("|", $string); > foreach ($data as $foo) { > echo $foo[0]; } > } > <form> > > $array = array("$new_cat","$assigned_to","$job","$assigned_by"); > $string = implode("|",$array); > return $string; > } > > The variables that form $array are from the form....
</Original message>
<Reply>
Why use array("$new_cat",...,"$assigned_by"); Loose the quotes: array ($new_cat,...,$assigned_by);
You don't need to use implode(). Just return the array. In the calling function you can then get the results in two ways:
$results = assign(); /* $results is an array */ or list ($new_cat,...,$assigned_by) = assign();
If you want a better answer on what is going wrong, you'll need to send some more code. Eg the code that you've now replaced by <form>. It might just be that the error is in that part.
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Hi, how can I send HTML mail via "mail()" function ? I readed the tutorial, but can someone write me example ?
Thanks, Rosen
attached mail follows:
you add this into your header bit:
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
HTH
Jack
----- Original Message -----
From: Rosen <rosen_dm
dir.bg>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 5:18 PM
Subject: [PHP] HTML mail
> Hi,
> how can I send HTML mail via "mail()" function ?
> I readed the tutorial, but can someone write me example ?
>
> Thanks,
> Rosen
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Try this : <?php
$EMAIL = array( 'plain' => "Haha hoho hehe ", 'html' => "<html><font size=3>Haha hoho hehe</font></html>" );
$headers='From: ahristov
icygen.com
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="=====================_4195058==_.ALT"
';
$message = ' --=====================_4195058==_.ALT Content-Type: text/plain; charset="us-ascii"; format=flowed
'.$EMAIL['plain'].'
--=====================_4195058==_.ALT Content-Type: text/html; charset="us-ascii"
'.$EMAIL['html'].'
--=====================_4195058==_.ALT--';
mail("php-general
list.php.net", $subject, $message, $headers);
?>
Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%
----- Original Message -----
From: "Rosen" <rosen_dm
dir.bg>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 1:18 PM
Subject: [PHP] HTML mail
> Hi,
> how can I send HTML mail via "mail()" function ?
> I readed the tutorial, but can someone write me example ?
>
> Thanks,
> Rosen
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
I think with everyone replying to "The future of PHP" e-mails and putting in their two cents, we're eventually going to raise that $100,000 in no time. <g>
Navid
-----Original Message-----
From: CC Zona [mailto:cczona
nospam.invalid]
Sent: Thursday, August 30, 2001 3:08 AM
To: php-general
lists.php.net
Subject: Re: [PHP] The future of PHP or my 2 cents
In article <010001c1311e$d86ebb40$bf7ba8c0
satx.rr.com>,
matsch
sasites.com (Matthew A. Schneider) wrote:
> > Rather than whining about the future of PHP, why don't you be proactive > > and take on the goal of raising the $100,000 for the project?
> Although Fred's comments appear rhetorical, the suggestion has some merit. > Anyone have a feel for how many PHP devotees are out there? How many people > subscribe to this list? Do these numbers make it feasible to ask for a $1-10 > contribution? How about $0.02 from each of the 7 million domains running > PHP?
To continue this (speculative) train of thought:
Would it be feasible to collect some kind of contest entry fee, either instead of or in addition to donations toward the prize? If maximum participation were the goal (and I'm not sure that it would/should be, but for the sake of argument...), it might be a way to get entrants intestered in recruiting more entrants by reminding them that more developers in the contest, the bigger the reward to be won by one of them...
As for collecting funds for such an endeavor, FWIW I (and presumably others) would be more likely to give if it were through the PHP.net group or Zend than through any third-party. At least then if the contest were to fall through, I'm confident that the money would still be well-spent on furthering PHP development/marketing.
-- CC-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
put the entire php in c:\php then intall it from there so that it'll be installed there only. check out for readme.txt or install.txt. it will contain the instructions. you have to put a file like browscap.ini (or dll) in c:\windows\system and the php.ini must be in c:\windows now edit the php.ini to your needs. this file contains the root directory of the php where u have to put the path to C:\php
hope this will help u, /sagar
----- Original Message -----
From: frank clarke <frankzclarke
yahoo.com>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 3:09 AM
Subject: [PHP] PHP and PWS
> I downloaded and installed PHP 4.06. The readme file
> says that the auto install prog setsup PHP to work
> with PWS and sets up php.ini. However, when I look at
> php.ini, there are no entries for these two parameters
>
> ; The root of the PHP pages, used only if nonempty.
> doc_root=
> ; The directory under which PHP opens the script using
> /~usernamem used only
> ; if nonempty.
> user_dir=
>
> is that good? I put in c:\inetpup\wwwroot for doc
> root, but it's still not working. Is there somethin
> I'm missin?
>
> thanx
> franx
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger
> http://im.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
_________________________________________________________
Do You Yahoo!?
Get your free
yahoo.com address at http://mail.yahoo.com
attached mail follows:
put the entire php in c:\php then intall it from there so that it'll be installed there only. check out for readme.txt or install.txt. it will contain the instructions. you have to put a file like browscap.ini (or dll) in c:\windows\system and the php.ini must be in c:\windows now edit the php.ini to your needs. this file contains the root directory of the php where u have to put the path to C:\php
hope this will help u, /sagar
----- Original Message -----
From: frank clarke <frankzclarke
yahoo.com>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 3:09 AM
Subject: [PHP] PHP and PWS
> I downloaded and installed PHP 4.06. The readme file
> says that the auto install prog setsup PHP to work
> with PWS and sets up php.ini. However, when I look at
> php.ini, there are no entries for these two parameters
>
> ; The root of the PHP pages, used only if nonempty.
> doc_root=
> ; The directory under which PHP opens the script using
> /~usernamem used only
> ; if nonempty.
> user_dir=
>
> is that good? I put in c:\inetpup\wwwroot for doc
> root, but it's still not working. Is there somethin
> I'm missin?
>
> thanx
> franx
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger
> http://im.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
_________________________________________________________
Do You Yahoo!?
Get your free
yahoo.com address at http://mail.yahoo.com
attached mail follows:
use / not \
And spell inetpub correctly :-)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Frank Clarke <frankzclarke
yahoo.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Wednesday, August 29, 2001 4:39 PM Subject: PHP and PWS
> I downloaded and installed PHP 4.06. The readme file > says that the auto install prog setsup PHP to work > with PWS and sets up php.ini. However, when I look at > php.ini, there are no entries for these two parameters > > ; The root of the PHP pages, used only if nonempty. > doc_root= > ; The directory under which PHP opens the script using > /~usernamem used only > ; if nonempty. > user_dir= > > is that good? I put in c:\inetpup\wwwroot for doc > root, but it's still not working. Is there somethin > I'm missin? > > thanx > franx > > > __________________________________________________ > Do You Yahoo!? > Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger > http://im.yahoo.com
attached mail follows:
this might be u r asking for
while(list($key,$value)=each($HTTP_POST_VARS)) { echo($key . " = " . $value); }
this should be in the page to where the variables r posted
/sagar
----- Original Message -----
From: Scott Thomason <SThomaso
hii.com>
To: <php-general
lists.php.net>; <cgi-list
mail.jann.com>;
<webmaster-l
yahoogroups.com>; <zope
zope.org>
Sent: Friday, August 03, 2001 4:48 AM
Subject: [PHP] GET/POST "name=value" query var convention?
Does anyone know of a more-or-less authoritative source that states that the common convention for HTTP GET/POST queries is a series of "name=value" pairs joined by "&" characters? I know I'm not just making this up, but I need to persuade someone that it is a commonly-accepted practice. Before you look... it's not in the HTTP RFCs.
Also...would it be accurate to say that life as a PHP and/or ColdFusion programmer is easier if the aforementioned HTTP GET/POSTs are performed in this manner? I know as a frequent user of Perl's CGI.pm module that I take this convention for granted. ---scott
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
_________________________________________________________ Do You Yahoo!? Get your free
yahoo.com address at http://mail.yahoo.com
attached mail follows:
this might be u r asking for
while(list($key,$value)=each($HTTP_POST_VARS)) { echo($key . " = " . $value); }
this should be in the page to where the variables r posted
/sagar
----- Original Message -----
From: Scott Thomason <SThomaso
hii.com>
To: <php-general
lists.php.net>; <cgi-list
mail.jann.com>;
<webmaster-l
yahoogroups.com>; <zope
zope.org>
Sent: Friday, August 03, 2001 4:48 AM
Subject: [PHP] GET/POST "name=value" query var convention?
Does anyone know of a more-or-less authoritative source that states that the common convention for HTTP GET/POST queries is a series of "name=value" pairs joined by "&" characters? I know I'm not just making this up, but I need to persuade someone that it is a commonly-accepted practice. Before you look... it's not in the HTTP RFCs.
Also...would it be accurate to say that life as a PHP and/or ColdFusion programmer is easier if the aforementioned HTTP GET/POSTs are performed in this manner? I know as a frequent user of Perl's CGI.pm module that I take this convention for granted. ---scott
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
_________________________________________________________ Do You Yahoo!? Get your free
yahoo.com address at http://mail.yahoo.com
attached mail follows:
----- Original Message -----
From: sagar <sagarphp
yahoo.com>
To: Scott Thomason <SThomaso
hii.com>
Cc: php <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 4:22 PM
Subject: Re: [PHP] GET/POST "name=value" query var convention?
> this might be u r asking for
>
> while(list($key,$value)=each($HTTP_POST_VARS))
> {
> echo($key . " = " . $value);
> }
>
> this should be in the page to where the variables r posted
>
> /sagar
>
> ----- Original Message -----
> From: Scott Thomason <SThomaso
hii.com>
> To: <php-general
lists.php.net>; <cgi-list
mail.jann.com>;
> <webmaster-l
yahoogroups.com>; <zope
zope.org>
> Sent: Friday, August 03, 2001 4:48 AM
> Subject: [PHP] GET/POST "name=value" query var convention?
>
>
> Does anyone know of a more-or-less authoritative source that states that
the
> common convention for HTTP GET/POST queries is a series of "name=value"
> pairs joined by "&" characters? I know I'm not just making this up, but I
> need to persuade someone that it is a commonly-accepted practice. Before
you
> look... it's not in the HTTP RFCs.
>
> Also...would it be accurate to say that life as a PHP and/or ColdFusion
> programmer is easier if the aforementioned HTTP GET/POSTs are performed in
> this manner? I know as a frequent user of Perl's CGI.pm module that I take
> this convention for granted.
> ---scott
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
_________________________________________________________
Do You Yahoo!?
Get your free
yahoo.com address at http://mail.yahoo.com
attached mail follows:
can do another way
$sql = "select count(fieldname) from Products"; $result=mysql_query($sql); $myrow=$mysql_fetch_row($result); $countrows = $myrow[0]; ( or might be $myrow[1] check out)
will do the job
/sagar
----- Original Message -----
From: David Robley <huntsman
flinders.edu.au>
To: Kevin P <kevin.pottie
odellwebdesign.com>; <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 6:06 AM
Subject: Re: [PHP] Count
> On Thu, 30 Aug 2001 08:16, Kevin P wrote:
> > Hi
> > I have counted some rows in MySQL and I need to know how to pull out
> > the number of rows.
> > "SELECT COUNT(*) AS myCount FROM Products"
> >
> > Thanks
> > Kevin
>
> $query = "SELECT COUNT(*) AS myCount FROM Products";
> $result = mysql_db_query($database, $query);
> $row = mysql_fetch_array($result);
> extract($row);
> echo $myCount;
>
> might do the trick; unless I've left a syntax error in there :-)
>
> --
> David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
>
> I'm so broke, I can't even pay attention.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
_________________________________________________________
Do You Yahoo!?
Get your free
yahoo.com address at http://mail.yahoo.com
attached mail follows:
----- Original Message ----- From: sagar To: php Sent: Thursday, August 30, 2001 4:22 PM Subject: Re: [PHP] Count
can do another way
$sql = "select count(fieldname) from Products"; $result=mysql_query($sql); $myrow=$mysql_fetch_row($result); $countrows = $myrow[0]; ( or might be $myrow[1] check out)
will do the job
/sagar
----- Original Message -----
From: David Robley <huntsman
flinders.edu.au>
To: Kevin P <kevin.pottie
odellwebdesign.com>; <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 6:06 AM
Subject: Re: [PHP] Count
> On Thu, 30 Aug 2001 08:16, Kevin P wrote:
> > Hi
> > I have counted some rows in MySQL and I need to know how to pull out
> > the number of rows.
> > "SELECT COUNT(*) AS myCount FROM Products"
> >
> > Thanks
> > Kevin
>
> $query = "SELECT COUNT(*) AS myCount FROM Products";
> $result = mysql_db_query($database, $query);
> $row = mysql_fetch_array($result);
> extract($row);
> echo $myCount;
>
> might do the trick; unless I've left a syntax error in there :-)
>
> --
> David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
>
> I'm so broke, I can't even pay attention.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
_________________________________________________________
Do You Yahoo!?
Get your free
yahoo.com address at http://mail.yahoo.com
attached mail follows:
> > >Can small business live from e-commerce today? > > > > What is the relevance of your question? Do businesses "live" from > > their telephone? Whether they do or not, they need it in either case. > > AFAIK, it costs a lot more money to have any start and operate a > e-commerce business than a telephone.
Actually... If you are starting a *SMALL* e-commerce business, you can probably start it up for about the same as a phone installation... :-)
Shared web-server: $35 setup + $20/month (or less) Registration: $10/year CCNow or similar processing: very small setup fee, moderate cut of each transaction.
Telephone setup, in Chicago at least, is quite expensive, and probably is more than that. At least, it was 15 years ago when I moved in :-)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> (Even though I didn't understand quite how shared objects work. <g> )
Like, I only did it once, and it was GD, and about 80% of the time it puked trying to display an image, but...
Basically, if you compile using --with-apxs in the first place, and then you re-compile from source using that --with-apxs thingie again only you add more --with-foobar options, you get these .so files in the libs directory that you can just http://php.net/dl into your script rather than install the whole new PHP binary. More importantly, you could compile them on a different machine (same hardware with all the same versions of everything) and then put them onto a server that ain't got those toys.
(In my case it was about not altering the "main" PHP binary and making it non-standard from the other 7 boxes for what was just a test run of something I wanted to play with for a day...)
Or, at least, that's how my vague memory of stumbling through this once goes...
Now if somebody more organized than me (most of you, I imagine) wants to try that and turn it into a HowTo to add to the PHP site, that would be pretty nifty :-)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
This has strayed off-topic a bit. Unless you're into music and/or business planning for e-commerce, you probably should hit delete now...
> > How about this one, doing *EXTREMELY* well selling CDs online: > > > > http://CDBaby.com/ > > > > Of course, that has almost nothing to do with his choice of PHP (the > > language he could understand the easiest) and everything to do with > > intelligent business decisions on the back-side. > > > > No VC. > > No "we'll make money later". > > Just great service at a fair price. > > > > I'm sure there are others out there. > > > > *CAN* it be done? Sure. > > > > Can the idiots who invested millions in companies with a business plan that > > involved *NO* revenue model make it? No. > > What is "doing extremely well"? Do you know that from facts or you have > just been told?
Number 1 volume seller of CDs on the 'net? Amazon.com Number 2: CDBaby.com
Reference: http://musicians.about.com/library/sellcds/blcdbaby.htm (Follow "Back to Retailers Index" to read about his few competitors that are still around)
And is Amazon even making money yet? Last I heard, they were going to lose "only" a few million this year. :-^
I would say that being #2 behind Amazon that's spent a bazillion dollars promoting themselves and has lost money year after year that amounts to more than the GNP of small countries is pretty good, wouldn't you?
And he doesn't even accept major label music -- only indie. So, like, how does he get to be #2? He works his ass off and has a savvy business plan that's good for his vendors (the musicians), and fair to his customers.
Just in case that's not enough, here are some more reasons that I know it's successful.
#1. He has grown the company slowly from him and a friend part-time to six (6) full-time employees. Wanna see a picture of them? It's on the site or the companion site http://cdbaby.ORG (.ORG is for musicians behind-the-scenes info) Meanwhile, his competitors (now defunct) spent VC money to hire 120 people to do the same job... Hmmm. VC to hire 120 people overnight, or grow slowly to 6. Which one was the good business plan? #2. He's been around for several years, survived all the dot-bombs, and has (I think) acquired the content/inventory of a former competitor or two and cut a deal to sell CDs for a complementery web-site (http://garageband.com). #3. His competitors have almost all folded or laid off 80% of their staff. He's had no layoffs. #4. He sells ~10,000 CDs per month (more near Xmas). He gets $4 a CD. You do the math. #5. I've done some work for him. #6. Never met a dissatisfied vendor, and I'm in contact with hundreds of them. #6b. Most of his competitors have many, many dissatisfied vendors, and I'm in contact with them. :-| You can review archives from just about any music-related mailing list, and look for "CDBaby", "Amazon", "The Orchard", and "CDStreet" and so on. I'll tell you now which one is always recommended by virtually everybody. #7. He has a chart online from his accountant of what he sold. Some doofus tried to sue him for "false advertising". He sent his books to the judge, and the case was thrown out. So that chart showing his sales of 10K units a month is almost-for-sure not fake, eh?... #8. I'm a satisfied vendor and customer. #9. He's routinely invited to speak at music conferences, so I'm not alone in my assessment. #10. You can estimate what he spends on bandwidth etc, and employees, and work it all out. He ain't wealthy (yet), but his business is healthy. #11. Visit the site. You'll figure out why he's successful. There's no BS or huge over-blown hype. Just CDs for sale. Hell, find a CD you like and buy it. You'll understand even better why it's successful :-) Try mine first: http://cdbaby.com/rosner http://cdbaby.com/jademaze #12. One of the artists (Of A Revolution) that was listed on the cover of Performing Songwriter a few months ago derived much of their success and sales from his site. Getting your band name listed on the cover of Performing Songwriter is not trivial. Getting it there without major label support is phenomenol. #13. He *UNDERSTANDS* his vendors, because he got started by needing a site to sell his CDs. He's the *ONLY* one who passes on the contact info for the purchaser to the artist. His TCO to get started as a vendor is minimal ($35+ 5CDs). The $35 covers him scanning the artwork and RealAudio encoding the songs, cuz he knows not every musician can do that easily/correctly. His forms to fill in to sell a CD are designed for anybody to figure out.
I actually could go on with a lot more little stuff, but I reckon that's more than enough :-)
> If they are really doing so well because they have a business plan with > a revenue model, why do they succeed when others that also have a > business plan with revenue model don't?
Which dot-bomb had a business plan, with a revenue model, which did *NOT* involve going into heavy debt and blowing huge piles of VC money for several years in a market-share grab on the Internet, where the barrier to change brands is one (1) click, where the only "plan" for payoff was to go IPO "some day"?... That's not a business plan. That's a recipe for disaster. *MOST* of the dot-bombs never had a chance.
A business plan is a *REALISTIC* estimate of what you're gonna spend, what you *CAN* do, and how much money the things you *CAN* do will make. Either the income exceeds the expenses, or it's not a business plan any more.
> Would their model work outside the US?
It already *DOES* work outside the US! He'll sell indie music CDs for anybody on the planet. For buyers, he'll accept anybody's money, and ship CDs anywhere on the planet. Shipping charges are in his "Help" page. He'll even open the CD up and only ship the CD and artwork (no plastic jewel box) if you're outside the US.
Actually, there's no reason why another one couldn't be set up outside the US to focus on a different music market, if somebody was willing to invest the time initially to run it. Count on a lot of time opening boxes, entering data, scanning artwork, encoding audio, and stuffing CDs into mailer packs... But if somebody's actually ready to work, yeah, it could be done. I'd keep the day job at first though.
It would have to be some place with an existing populace of music buyers within reasonable shipping distance to get started, and, most critical, an e-Commerce provider who will work with you as a non-US business to run the CC transactions. That could easily be a fatal snag if you're not willing to open a US checking account or do whatever needs to be done to set up e-commerce in that country.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
On Thu, 30 Aug 2001 02:52:33 -0500, "Richard Lynch" <ceo
l-i-e.com>
wrote:
>Which dot-bomb had a business plan, with a revenue model, which did *NOT* >involve going into heavy debt and blowing huge piles of VC money for several >years in a market-share grab on the Internet, where the barrier to change >brands is one (1) click
Internet market share is an illusion when you can change brands with a few clicks. The only way to keep Internet customers is to provide good service and products at competitive prices, and continue doing so year after year.
It's virtually impossible for big corporations to compete on that playing field, because their overhead costs are too high. The only way they can sell at a competitive price is to lose money on every sale, a dead-end tactic that only works until you burn through all your investors' cash.
Businesses need profit to survive. So why would any business be willing to lose money on a sale? To gain Internet market share which is an illusion in the first place? Obviously, that's a fundamental mistake made by many large corporations trying to grab Internet market share.
Small businesses, like CDBaby, are the future of this market.
Egan
attached mail follows:
Manuel,
I started answering your letter point by point, but stopped, as it wouldn't have gotten us anywhere.
I'm sorry if sharing my (IMHO very realistic) estimate of the PHP world seemed like an insult to you or anybody else. Not everything that is done in the PHP world is of good quality. PHP and the various services around it are not magical, and are not free of flaws. It would be scary if it was. I basically said it out loud. Do I appreciate each and every effort made to improve PHP and the community around it? Definitely. Is everything that's done perfect? No. Some of the efforts are young, and will mature. Some are just not that good. Many are great. I'm sorry you fail to understand that this is a tricky business and not black&white, and try to show my points in a very negative light. Talking in theoretical terms is much easier than trying to work with the real-world resources and context, and picking realistic routes.
As for the GUI business, I'll repeat what I answered to others on this list, and on other lists, in many occassions. First off, Perl and Python are *NOT* successful GUI platforms. They may be feature complete, they may be very easy to use and develop (I don't use either, so I don't know) but in practice, they're completely negligible in the GUI world. I don't think anybody has a good reason to believe this is going to change in a revolutionary manner. Now, does the fact that I think that hurts the developers of Perl's and Python's GUI bindings? I sure as hell hope it doesn't, and it doesn't, if they're realistic people. I don't see the efforts made in the PHP-GUI front as fundamentally different. It's useful, it's cool, it should be developed and improved, and no, it will not take over the world.
About a central resource of PHP sites that has a voting system - I think that's a good idea. You're quite welcome to implement it if you volunteer. www.php.net will happily host it.
Zeev
attached mail follows:
Another user on the same shared server can probably work at it and manage to read anything in your web-tree...
Stuff like database passwords should be moved to a directory not in your web tree, and change your include_path to reach it -- It's still readable by somebody who works at it, but not as easy.
If you have an algorithm that *MUST* stay secret, re-code it in C and compile it into PHP, or use the Zend Encoder off-line to make a binary.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Seb Frost <seb
raceshoot.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Monday, August 27, 2001 7:56 PM Subject: Reading php source code?
> How hard is it for someone to somehow read the source code out of my php > files on my isp hosted website. They use linux & apache & php 4.0.6. > > I ask because in my logfile it seems someone accessed a uniquely named > not-guessable folder in my web root. It is mentioned in my source code. I > use imagecreatefromjpeg on files in this directory. How can someone see my > folders if not by viewing my source code? > > - seb >
attached mail follows:
Read their HTML file with fopen (or Snoopy, whatever that is).
Then figure out what you want, and go read that with fopen.
It's just a URL, and PHP doesn't really care whether it's HTML or what that you read.
Snoopy might even be able to do it.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Pereira Romulo <romulo_roberto_pereira
yahoo.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Saturday, August 25, 2001 10:58 AM Subject: Images Download
> Hello, > > I want to create a script that would read the contents > of an HTML file (I can use Snoopy class for that) and > then, download some respective type of files from a > page (let's say .zip files)... > > Any ideas how do I start or if anyone create something > like that? > > Thank you and please, reply to > romulo_roberto_pereira
yahoo.com > > Rom > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/
attached mail follows:
> To Install PHP I have done this ( ihave specified the location of apxs > as Suse Installed an Apache server also, but I want the one I've > installed to /usr/local/apache):
It's better to specify exactly where apxs is anyway, just so you know for sure you don't get the wrong one.
> ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs
> "Syntax error on line 236 of /usr/local/apache/conf/httpd.conf: > API module structure `php4_module' in file > /usr/local/apache/libexec/libphp4.so is garbled - perhaps this is not an > Apache module DSO? "
> "libphp4.so: ELF 32-bit LSB shared object, Intel 80386, version 1, not > stripped "
Well, it's a DSO, but it got broken somehow when you built it... I mean, a car that you build from scratch with no carbuerator is still gonna look like a car, but it ain't gonna run too good. :-)
> So....Can anybody Help ??? > > I don't have MySQL installed yet - do I need to have that first ???
YES!
(Technically, in some situations, no... But for now, just go with YES! as the answer.)
If you don't have MySQL installed, PHP has to use its "built-in version".
This "built-in version" has a rather low chance of matching up with the version you are actually running. In some instances, I conjecture that it might also conflict with a version that Apache is *already* using with mod_auth_mysql or some other nifty Apache module I've never heard of that uses MySQL... But I dunno for sure about that part.
Anyway, if the versions are far enough off, your PHP and your MySQL won't talk to each other, or will talk, but some functions won't work right, or PHP itself won't even be able to be loaded.
At any rate, get MySQL, install it, and be sure to use --with-mysql=/path/to/mysql when you re-compile to get the right stuff.
*ALSO* -- You have to watch what goes by during configure. Some "errors" are printed but aren't big enough to stop the configure script. Alas, they are, in some cases, big enough to make your PHP non-functional, or at least not having all the features you asked for. You can check the files left behind from configure name config.log and config.cache. They're just text files. A little digging in there may help you figure out what exactly went wrong.
WISH LIST: config.log doesn't seem to record the Yes/No answer to what happened...
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> I need to output an array to a text file, now I have created the text file now I just need to > write to it, well I need to get the output of the browser to this text file. HOw can i do this, > oh and return each line ...
$file = fopen($new_file_name, 'w') or die("Could not open $new_file_name"); # loop through lines/rows/whatever # For each field, do: $field = str_replace('"', '\\"', $field); $field = '"$field"'; fputs($file, "$field,$field2,$field3"); # end loop.
http://php.net/fopen http://php.net/fputs
Oh yeah: You probably don't need the touch stuff... If you can do all that, you probably have permission to just create the file using fopen.
> heres the code > > that gets the output > array1.php > > <? > // Mail text file extractor. > // Written to extract out certain parts of the file and output in a csv friendly format. > // Dan McCullough > > > include("functions.php"); > > if ($submit) { > $extract = eXtractor1($file_name,$tmp_file_name,$new_file_name); > > > if ($extract) { > > file://here goes, get the parsed file from the output of the grep command. > file://read the file and output > $fcontents = file("/tmp/$tmp_file_name", "r"); > > // run this funtion to format and display the file in a certain output. > function GetField($offset) > { > global $fcontents; > global $new_file_name; > return trim(substr($fcontents[$offset], strpos($fcontents[$offset], > " "))); > } > > for($i = 0, $count = sizeof($fcontents); $i < $count; $i += 6) > { > // Make the numbers 1-6 constants if desired > > echo GetField($i + 1) . "," . > GetField($i + 2) . "," . > GetField($i + 3) . "," . > GetField($i) . "," . > GetField($i + 5) . "," . > GetField($i + 4) . ",yes<br>\n"; > } > exit;} > } > ?> > > <html> > <head> > <title>Extractor</title> > </head> > <body> > <form method="post" action="<? echo $PHP_SELF; ?>"> > Please input the name of the text file.<br><br> > File to extract: <input type="text" name="file_name"><br> > Temp file name: <input type="text" name="tmp_file_name"><br> > CSV File Name: <input type="text" name="new_file_name"><br> > <input type="submit" name="submit" value="submit"> > </form> > </body> > </html> > > function.php > function eXtractor1($file_name,$tmp_file_name,$new_file_name) > { > global $file_name; > global $tmp_file_name; > global $new_file_name; > > $filename = "/tmp/$tmp_file_name"; > $newfilename = "/tmp/$new_file_name"; > > if (!file_exists($filename))
> touch($filename); // Create blank file > touch($newfilename); > chmod($filename,0777); > chmod($newfilename,0777); > > $command = "cat /home/sites/projects/web/extractor/$file_name | egrep > 'State:|Name:|Address:|City:|e-mail:|Zip:'>$filename"; > system($command); > ## nothing worked for me until I added this next line. > system("exit(0)"); > } > return $tmp_file_name; > return $new_file_name; > } > > ?> > > anythoughts would be appreaciated > > dan > > ===== > Dan McCullough > ------------------------------------------------------------------- > "Theres no such thing as a problem unless the servers are on fire!" > h: 603.444.9808 > w: McCullough Family > w: At Work > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
Odds are good the Module version is not looking for your php.ini in the same place as where the CGI version is...
Using the Module version, where does it *think* php.ini is? It should be listed in phpinfo.
You'll have to copy your php.ini file there for the Module version.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Chris <cjirwin
hotmail.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Sunday, August 26, 2001 2:35 AM Subject: PHP as an Apache module
> I have PHP 4.06 and using it as an Apache module, but for some reason I > cannot get my changes to take effect after I change something in the > PHP.ini file. I've tried to restart Apache, restart Windows98, nothing. > But if I run as a CGI, the changes are there in the phpinfo()! > > Any help with this would be great... > > Thanks, Chris Irwin
attached mail follows:
> Thanks for all the answers to this question but hitting the back button will > work, no authorization required to see the pages all over.
You need to get those pages to not be cached by the browser. http://php.net/header
> Repost problem: > I'm having a PHP based auth. It seems that unset($PHP_AUTH_USER) or > unset($PHP_AUTH_PW) doesn't work.
The *BROWSER* re-sends those variables, so your unset() has no meaning on the next page.
> Also, 401 Unauthorized header does not > work also.
What you need to do is re-send the challenge headers, *ONLY* with a new *REALM*.
IE, keep track of what realm each user is in, and change it when you want them to be logged out.
> Is there a way to logout and no back button or the user just have to close > his browser in order to accomplish this?
Closing the browser is the best answer. You'll never get 100% no back button caching on every single minor browser release.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
You may want to use: http://php.net/chown http://php.net/umask http://php.net/chmod
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Javi - Neodigit <javi
neodigit.es> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Sunday, August 26, 2001 6:03 AM Subject: I need some help with this code
> I'm using copy() and the final owner is "nobody", I'm opening a socket > connection with fsockopen() so I have a validate user. > I want the validated user to be the owner of the new file > That`s de code: > - open the socket > - validate user > - change dir chmod so we can write > - write the file (with "nobody" owner and I need the "user" owner) > - change back dir chmod > - close connection > > ---------------------------------- > $tftp = fsockopen("ftp.dominio.com", 21, $errno, $errstr, 60) or > die("Fallode Conexión"); > > socket_set_blocking($tftp, false); > fputs($tftp, "user $login\n"); > fputs($tftp, "pass $password\n"); > > $ruta = "/www/".$direc; > fputs($tftp, "SITE chmod 0777 $ruta\n"); > > copy ("file1.php", "file2.php"); > > fputs($tftp, "SITE chmod $perm $ruta\n"); > sleep(1); > > fclose($tftp); > ------------------------------------ > Thanks for helping > Javi > > > >
attached mail follows:
I think you just described this:
http://php.net/manual/en/function.imagecopymerge.php
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Jan <vincev
gmx.de> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Sunday, August 26, 2001 12:22 PM Subject: How to create thumbnails?
For thumbnail creation I would need to know how I scale a loaded image or better: How do I copy a scaled version of an image created with imagecreatefromjpeg onto a background I have previously created?
Jan
attached mail follows:
You're using HTTP_COOKIE_VARS, all CAPS, right?
Did you declare it global inside any functions where you use it?
Does phpinfo() show HTTP_COOKIE_VARS? Perhaps you have track_vars turned off.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Andy Ladouceur <SacredSilver
razza.org> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Monday, August 27, 2001 12:40 AM Subject: Cookieless =(
> I love cookies. > I hate it when they dont work. > I was previously accessing cookies by just using their name (I had > global_vars turned on), I recently decided to turn it off(for security > reasons) and I can no longer even set cookies? > Yes,cookies are enabled and everything..in fact,I never even touched any of > the cookie functions.. thats what I dont get... anyone have any ideas on > what could be wrong? (And yes, im using $HTTP_Cookie_VARS["cookiename"]; to > access (try and access, that is) them now.. > Anyone know what might be wrong? > Any helps appreciated, thanks. > -Andy > >
attached mail follows:
You probably need http://php.net/stripslashes somewhere.
Also, this is not a very secure way to do this...
Somebody could easily alter the HTML source of your hidden var_list_1 and alter whatever columns they wanted.
It would be better to pass each value separately.
And, finally, you could put all of this in one file with a couple of if() statements, instead of spread out over three files, and probably make life much easier on yourself.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: P.Agenbag <internet
psimation.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Monday, August 27, 2001 2:51 PM Subject: Generating Variables
> Hi > I am trying to auto generate some sql strings. > The resulting string should look like this: > update $table_name set var1='$var1', var2='$var2' ............. where > id=$id > > I used a foreach loop to get the keys from a table and in each foreach > loop I tried the following. > foreach($myrow as $key=>$val) { > $var_list .= " $key = '\$$key', "; > } > > > The first php page is the "table generator"; VIEW_ALL.PHP > <?php > $username_1 = "user"; > $password_1 = "password"; > $db_name = "test"; > $table_name = "users_db"; > $link = mysql_connect("localhost",$username_1,$password_1); > mysql_select_db($db_name,$link); > $sql = "select * from $table_name"; > $result = mysql_query($sql); > $result_2 = mysql_query($sql); > echo "<table border=\"1\">"; > $myrow = mysql_fetch_assoc($result); > echo"<tr bgcolor=\"#CCCCCC\">"; > foreach($myrow as $key=>$val) { > echo "<td><b>$key</b></td>"; > } > echo"</tr>"; > $count = 2; > while($myrow_2 = mysql_fetch_assoc($result_2)) { > $id = $myrow_2["id"]; > if ($count == 2) { > $bgcol = "#FFFFFF"; > $count = $count - 1; > } > else { > $bgcol = "#EFEFEF"; > $count = $count + 1; > } > echo"<tr bgcolor=\"$bgcol\">"; > foreach($myrow_2 as $key=>$val) { > echo"<td>$val</td>"; > } > echo"<td><a > href=\"edit.php?id_1=$id&table_name=$table_name&db_name=$db_name&username_1= $username_1&password_1=$password_1\">Edit</a></td>"; > > echo"</tr>"; > } > echo"</table>"; > ?> > > Goes through to EDIT.PHP > <?php > $link = mysql_connect("localhost",$username_1,$password_1); > mysql_select_db($db_name,$link); > $sql = "select * from $table_name where id=$id_1"; > $result = mysql_query($sql); > $myrow = mysql_fetch_assoc($result); > $count_fields = 0; > echo"<form name=\"form_1\" method=\"post\" > action=\"update.php?username_1=$username_1&password_1=$password_1&db_name=$d b_name&table_name=$table_name\">"; > > echo"<table border\"1\">"; > foreach($myrow as $key=>$val) { > echo"<tr bgcolor=\"#CCCCCC\"><td>$key</td><td><textarea > name=\"$key\">$val</textarea></td></tr>"; > $var_list_1 .= "$key = '\$$key',"; > $count_fields = $count_fields + 1; > } > echo"</table>"; > $count = strlen($var_list); > $new_count = $count - 1; > $var_list_1[$new_count] = ""; > echo"<input type=\"hidden\" name=\"var_list\" value=\"$var_list_1\">"; > echo"<input type=\"submit\" value=\"submit\" name=\"submit\">"; > echo"</form>"; > ?> > > And this goes to UPDATE.PHP > > <?php > $link = mysql_connect("localhost",$username_1,$password_1); > mysql_select_db($db_name,$link); > $sql_1 = "update $table_name set $var_list where id=$id"; > $result = mysql_query($sql_1); > echo "Your data has been updated!<br>"; > echo "$sql_1 <br>"; > echo "result: $result<br>"; > ?> > > This is where the problems comes in, the SQL is not brought over > correctly, rather is written "as-is" with the single quotes \-ed out, > can someone plz help me? > > >
attached mail follows:
>Is there a smart way, that I have overseen, to update/download 2 (or more) >PHP-docs with only one POST/GET instruction ? > >I do not want to use either javascript or cockies!
I don't really understand the question: What are you actually trying to do, and why?
An HTTP POST, by definition, returns one, and only one, HTML document to the browser.
Within your PHP script, you can alter whatever you want.
If you want to have a download as a result of a POST, I guess you could Zip two files up and download that. Is that what you mean?
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
I think you want
require 'daten/menu.data';
No, you can't go up two directories and back down, or you'd be able to go down into other people's web-sites, and that would be bad. You can go up only as far as your own site.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Carsten Weber <carsten
itp.physik.tu-berlin.de> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Monday, August 27, 2001 11:11 AM Subject: path error while calling files
> Hello. > I am reading in text files in a php-script and am getting path errors. > > I have set the php-path in php.ini to > /home/web/public_html/cgi-bin/chanet/ and am trying to call a file in > /home/web/public_html/cgi-bin/chanet/daten/. I use the path > ../../cgi-bin/chanet/daten/ to call the files (the reason for leaving > the directory twice is that I have another place where my webpage is > running with a different structure). > > I get the following error: > > Warning: Failed opening '../../cgi-bin/chanet/daten/menu.dat' for > inclusion > > (include_path='.:/usr/share/php:/home/web/public_html/cgi-bin/chanet') > in /home/web/public_html/inhalt/chanet.php4 on line 80 > > However, when I set the php-path just to /home/web/public_html/cgi-bin/ > and call the files with ../cgi-bin/chanet/daten/, it works. > > I have to test set all the rights in public_html to 777, so I don't > think it's a rights problem. > > Am I not allowed to call up directories which require me to go up two > directories?? > > Thanks for any help! > Carsten
attached mail follows:
Move your images out of your web-tree.
Write a display.php script that use http://php.net/header and http://php.net/readfile to serve them up.
Log each IP and $HTTP_USER_AGENT into MySQL with a timestamp.
$query = "select count(*) from piclog where thetime + '35 seconds' >= now() and ip = '$REMOTE_ADDR' and browser = '$HTTP_USER_AGENT'";
If that count is too high, do whatever.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Danial <webmaster
cyberhoties.com> Newsgroups: php.general,php.windows To: <php-general
lists.php.net>; <php-windows
lists.php.net> Sent: Monday, August 27, 2001 1:46 AM Subject: dose some one know of a scrip that will .......
> dose some one know of a scrip that will stop someone from leeching my > images.. > > like. if someone downloads 4 picturs in 35 sec. he will be and for 60 sec. > im looking for something that will stop ppl for useing things like > http://www.quadsucker.com/quadweb/ (( QuadSucker-Web )) - witch says to the > server it is a Mozilla/4.0 browser -to download my hole website it kills my > server when 2 or 3 ppl start to do it... > > I Could use > <? > $browser = array ("Wget", "EmailSiphon", > "WebZIP","MSProxy/2.0","EmailWolf","webbandit","MS FrontPage"); > $punish = 0; > while (list ($key, $val) = each ($browser)) { > if (strstr ($HTTP_USER_AGENT, $val)) { > $punish = 1; > } > } > if ($punish) { > echo " <head> > <title>Access Denied</title> > </head> > <p>We're sorry. The software you are using to access our website is not > allowed. > Some examples of this are e-mail harvesting programs and programs that will > copy websites to your hard drive. If you feel you have gotten this message > in error, please send an e-mail addressed to admin. Your I.P. address has > been logged > Thanks.</p> > <BR> > -Yourname > <BR> > </body> > > "; > exit; } ?> > > > But dont do any good if the USER_AGENT stats it is a Mozilla/4.0 > > > > any help would be cool > > thanks > > danial lee smith > Danial, http://WWW.CYBERHOTIES.COM > >
attached mail follows:
You could just log the IP into a database, and then look it up later in another script in a "cron" job. You'll need PHP installed as a stand-alone binary (aka CGI) and you'll want to read:
man 5 crontab
You could use select distinct and then would only need to look up each IP once for a user that viewed many pages.
If you wait too long, though, the IPs will change on you for DHCP clients. Still the same country probably though.
To answer your original question :-) what you are talking about is called "fork" (like a fork in the road) and you do it something not unlike this:
exec("/path/to/some/other/script &", $results, $errorcode); echo implode("<BR>\n", $results); if ($errorcode){ echo "OS Error: $errorcode. Usually path/permissions. man errno<BR>\n"; }
It's the & symbol that tells the shell to fork.
The other script in question has to, errrr, I forget exactly, but I think it has to *NOT* bind up stdin, stdout, or stderr, because then Apache and PHP are waiting for that output...
Search the archives for "fork" and "&" and "exec" and you should find more posts.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Jordan Pickup <JPickup
gprc.ab.ca> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Monday, August 27, 2001 4:03 PM Subject: A Separate Process?
> Is there any way to make a separate process in PHP? > > I do real-time stats collection on my site and one of the things I collect > is the domain of the user (to get their country). > > Sometimes getting the domain name takes a few seconds to come back and the > user has to wait for that time before their page displays. > > Is there any way to split of a separate process - that doesn't end when the > current process ends - to do the stats collecting so that the user doesn't > have to wait? > > Or, if not, is there some way to tell the browser that it has all the data > (so that it will finish rendering the page and run my javascript) and the > script can continue running and do the ns lookup? > > I'm sorry if this question has been asked and answered before but I couldn't > find an answer anywhere else... and the archive for this list seems to be > down. > > Jordan
attached mail follows:
exec("indent $source", $result, $errorcode); http://php.net/exec
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: <alvarez
sto13.st-oneline.de> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Tuesday, August 28, 2001 9:24 AM Subject: javascript code beautification
> > Does someone know of a PHP-function to reformat Sources of C-like langs? > I need to generate syntactically uniform Javascripts independent of the > specific user input. > > Thanks, > > D. Alvarez Arribas <alvarez
st-oneline.net>
attached mail follows:
If you can't alter php.ini to load the extension, you might be able to using .htaccess or http://php.net/dl
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Dan Harrington <dan
tudan.net> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Monday, August 27, 2001 5:12 PM Subject: payflow pro hosed
> Hello, > I am having a problem with an ISP that has installed the payflow pro (top of > phpinfo shown) and yet > it keeps showing up as an unknown function. > > PHP Fatal error: Call to undefined function: pfpro_init() in /..... > PHP Fatal error: Call to undefined function: pfpro_process() in /..... > > I noticed its compiled as --with-pfpro=shared,/usr/local/payflow and in > /usr/local/payflow are found the following files: > > /usr/local/payflow/bin/pfpro.c > /usr/local/payflow/bin/pfpro.h > /usr/local/payflow/bin/pfpro > /usr/local/payflow/bin/pfpro-file > /usr/local/payflow/lib/libpfpro.so > > Anyone care to share their configuration options, phpinfo, hints, tips? I'm > at a loss, it looks like everything is setup > correctly, but it still doesn't work. > > Thanks > Dan Harrington > > > > PHP Version 4.0.6 > > System Linux www.foobar.com 2.2.14-5.0smp #1 SMP Tue Mar 7 21:01:40 > EST 2000 i686 unknown > Build Date Aug 20 2001 > Configure Command './configure' '--prefix=/usr' > '--with-apxs=/usr/sbin/apxs' '--with-config-file-path=/etc/httpd' > '--enable-save-mode' '--with-zlib' '--enable-debugger' > '--enable-magic-quotes' '--enable-track-vars' '--with-xml' '--with-ftp' > '--with-mysql=/usr' '--with-gd=/usr/local' '--with-png-dir=/usr/local' > '--with-jpeg-dir=/usr/local' '--with-pfpro=shared,/usr/local/payflow' > Server API Apache > Virtual Directory Support disabled > Configuration File (php.ini) Path /etc/httpd/php.ini > ZEND_DEBUG disabled > Thread Safety disabled > > This program makes use of the Zend scripting language engine: > Zend Engine v1.0.6, Copyright (c) 1998-2001 Zend Technologies > > > > > >
attached mail follows:
You are correct.
The point is you can turn it OFF to force cookies to *NOT* be used, and use PHP_SESSID in the URL instead. Thus, you don't even present the user with a cookie to deny/accept/whatever.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Richard Baskett <rickbaskett
home.com> Newsgroups: php.general To: PHP General <php-general
lists.php.net> Sent: Tuesday, August 28, 2001 1:49 AM Subject: session.use_cookie
> Could someone tell me how session.use_cookie works? To me it seems that if > this is enabled and the user has cookies off.. then sessions will not work > period. Any help on this would be appreciated :) > > Rick >
attached mail follows:
You'd have to fake out GeoCities into believing PHP is a real browser by sending all the headers a real browser sends such as HTTP_USER_AGENT etc...
Be easier to just let users upload photos or just tell GeoCities people to move to a real server :-)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Joseph Bannon <JBannon
advparadigm.com> Newsgroups: php.general To: PHP (E-mail) <php-general
lists.php.net> Sent: Tuesday, August 28, 2001 9:59 AM Subject: remote hosts
> I run a community website with a bulletin board which I wrote in PHP. Each > member gets a profile and can submit a picture with it. However, those > members with pictures on geocites are having problems. Seems their server > denies remote hosts. Is there a way with PHP to tell their server to let > images be viewed on my website? > > Thanks, > Joseph
attached mail follows:
You may want to try php-windows
lists.php.net
> What web server is better on NT with PHP?
I prefer Apache. http://apache.org
> What PHP installation mode performs better i.e. CGI, SAPI Module , build or > not build etc ?
ISAPI will be faster, but not as stable for *SOME* of the DLLs that have not yet been field-repaired for thread-safe running.
CGI will be slower, but very stable. (Well, as stable as anything on Windows gets...) If you are planning on heavy traffic, not so good...
> What 'S' in SAPI?
Server?
> Any suggestions on PHP configuration for Oracle, IIS, and LDAP?
Oracle has a bunch of environment variables in Un*x that you have to set. No idea how you do that in Windows, or if it's even needed, or what.
LDAP -- dunno how many Windows users use LDAP...
> Also I am planning to use PHP scripts to run some jobs from scheduler. Is it > a bad idea? If not what need to be considered while installing PHP.
Not a bad idea at all.
You'll still use the php.exe file for the scheduler, even if you use the ISAPI php.dll
Once you've converted to PHP and Apache, the next step is to move to Linux and you'll have a really stable setup :-)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
Are you sure it's ../tmp and not just /tmp?...
See if you can do opendir and readdir on ../tmp
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Christian Darsow <christian
nudden.de> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Tuesday, August 28, 2001 2:11 PM Subject: mkdir failed
> hi everybody! > > i have an account at strato (german provider) who > hosts my php-scripts. > now i want to make a dir with mkdir("../tmp/$id", 0777).... > it doesn't work at all eventhough the rights of tmp are set > to 777..... > the script also doesn't alert anything, not a failed or anything...... > > does anybody know where the problem may be???? > > thank you so much. > > christian > >
attached mail follows:
http://php.net/fopen http://php.net/fgets
Call fopen. Call fgets 3 times. Call fread($file, 1000000) to get the rest.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Gary <gbland
worldnet.att.net> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Monday, August 27, 2001 4:10 PM Subject: line by line
> Hi All, > I need to get info from a flat file line by line. What I need to do is > get 3 separate lines and then a paragraph. Can someone point me to a > tutorial or info on the subject. > > TIA > Gary >
attached mail follows:
I'm guessing that you have to swap every other byte as Windows is the other-endian...
I don't really know for sure though...
You could just use:
exec("/path/to/sox $infile $outfile", $results, $errorcode); echo implode("<BR>\n", $results); if ($errorcode){ echo "OS Error $errorcode. Usually path/permission. man errno<BR>\n"; }
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Jason Mercer <jasonmercer
yahoo.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Tuesday, August 28, 2001 9:13 PM Subject: perl-esque data parsing for hex post variables
> I can't get the php to convert audio data to nicely formed binary wav > format. For instance, in perl you simply do a > > $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; > > and you're done with it. > > In php, there are two problems: > > 1. no existence of a handy builtin hex2bin() function (though many have been > written, such as > > function hex2bin($hex_str) > > > for ($i = 0; $i < strlen($hex_str); $i += 2) > > > $bin_str .= chr(hexdec(substr($hex_str, $i, 2))); > > } > > return $bin_str; > > } > > which seems to get the case done, > > 2. But the real problem is that doing a straight hex2bin conversion is not > what that beautiful little perl script does. The part that confuses me is > the hash oriented piece /%([a-fA-F0-9][a-fA-F0-9])/ -- what exactly is it > doing? Is it just stepping through the string two characters at a time and > comparing them? Or is it doing something more ambitious and arcane that I'm > not really grasping. I tried to emulate it with the following php > workaround, but come up short... > > for ($i = 0; $i < strlen($hex_str); $i += 2) > > > $newdata =. > preg_replace("/[a-fA-F0-9][a-fA-F0-9]/",pack("C",hexdec(substr($hex_str, $i, > 2))),$hex_str); > > } > > Any help? > > >
attached mail follows:
Try to change PWS so you are running as a CGI first.
Then move up to ISAPI.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Web User <random11
telekbird.com.cn> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Wednesday, August 29, 2001 8:49 AM Subject: HTTP 500 server error
> It always gets HTTP 500 server error, when I try to run the php scripts on Windows98 SE + PWS4.0. > THE PHP installed is Ver 4.06 -win32, as a server module. > > However I get a screen full of html codes when I run c:\php\php.exe -i in MS-DOS command line > > So what's problem with the installation or configuration? > Thanks > > BAKER >
attached mail follows:
Read the archives. Also read php-dev archives. You'll find plenty of thoughts.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: <KPortsmout
aol.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Wednesday, August 29, 2001 12:55 PM Subject: PHP Article... Comments??
> Hi > > I had this article sent to me on another list I am subscribed to, just > wondered what other people thought of it :-) > > http://www.securereality.com.au/studyinscarlet.txt > > Ade
attached mail follows:
You probably want to wrap this in a transaction...
$query = "insert into foo select * from bar"; #Execute that. $query = "delete from foo"; #Execute that.
Add lots of error-checking and a "begin" and "end" (or "rollback" for an error)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Brandon Orther <orther
webintellects.com> Newsgroups: php.general To: PHP User Group <php-general
lists.php.net> Sent: Monday, August 27, 2001 4:33 PM Subject: Using PHP to move a row of information to another table
> Hello, > > In MSSQL: > > I want to take one row of information from one table and put it into > another row. Does anyone know of an easy way? Or do I have to go > column by column copying each column into the new table? > > > Thank you, > > -------------------------------------------- > Brandon Orther > WebIntellects Design/Development Manager > brandon
webintellects.com > 800-994-6364 > www.webintellects.com > -------------------------------------------- > >
attached mail follows:
After you unset them, the *BROWSER* re-presents the values that it has...
You can only change the "REALM" out from under the browser to get a new dialog.
Keep track of a dynamic range of realms to present, and who's in which realm etc.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Jason Bell <jbell
barkingrat.com> Newsgroups: php.general To: PHP Users <php-general
lists.php.net> Sent: Wednesday, August 29, 2001 4:06 PM Subject: unset($PHP_AUTH_USER, $PHP_AUTH_PW)
anyone know why this isnt working for me?
if (isset($PHP_AUTH_USER) && isset($PHP_AUTH_PW)) { CheckCredentials($PHP_AUTH_USER,$PHP_AUTH_PW); unset ($PHP_AUTH_USER, $PHP_AUTH_PW); } else if ($AuthAction) { auth($AuthAction); };
If someone submits false credentials, the page keeps $PHP_AUTH_USER and $PHP_AUTH_PW, and won't allow another login attempt until the browser is closed. Is there another way to effectively "unset" the variables?
Thanks,
Jason Bell
attached mail follows:
If I were doing this, I would attempt to un-set the PNG transparency right after loading in the PNG...
But I wouldn't know an alpha channel if it bit me :-)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Vahan Yerkanian <VP.Technical
abideweb.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Monday, August 27, 2001 6:40 AM Subject: overlaying alpha channel png over jpeg
> I hope someone has got solution for this: > > I'm trying to write a script which will watermark a jpeg file with png logo, > and output the resulting jpeg to a file. Unfortunately, whatever I do, I'm > unable to get transparent color in png to disappear, by any means. > > the png file is 8bit, jpeg is true color; > Am I doing something wrong? have a look: > > <? > > $sourcefile="test2.jpg"; > $insertfile="peoplestamp.png"; > $targetfile="test.jpg"; > $transition=50; > > > $insertfile_id = imageCreateFromPNG($insertfile); > $sourcefile_id = imageCreateFromJPEG($sourcefile); > > > $sourcefile_width=imageSX($sourcefile_id); > $sourcefile_height=imageSY($sourcefile_id); > $insertfile_width=imageSX($insertfile_id); > $insertfile_height=imageSY($insertfile_id); > > $dst = imageCreateTrueColor($sourcefile_width,$sourcefile_height); > imagealphablending($dst,TRUE); > imagecopy($dst,$sourcefile_id,0,0,0,0,$sourcefile_width,$sourcefile_height); > > > $aaa=imagecolorresolvealpha($insertfile_id,255,255,255,255); > > imagecolortransparent($insertfile_id,$aaa); > > imageCopyMerge($dst, > $insertfile_id,0,0,0,0,$insertfile_width,$insertfile_height,$transition); > imagepng ($dst,"$targetfile"); > > > ?> > <img src="<?=$targetfile?>" border=0> > > Best regards, > -- > Vahan Yerkanian vp.technical
abideweb.com > Vice President, Design & Development Website
http://www.abideweb.com/ > AbideWeb Technologies, LLC Phone +3741 238650 | Mobile +3749 416358
attached mail follows:
Anyway to do this fast:
$arr = array("set1" => array(1, 2, 3, 4), "set2" => array(11, 22, 33, 44), "set3" => array(111, 222, 333, 444));
It's not that I want to access $arr like: echo $arr['set1'] I also want to access it as: echo $arr[1] (and it must be equal to $arr['set1'];
and It seems i can't do this: $arr = array("set1", 1 => array(1, 2, 3, 4), "set2", 2 => array(11, 22, 33, 44), "set3", 3 => array(111, 222, 333, 444));
any suggestion to get an array associated by both number and string keys?
attached mail follows:
<?php $arr = array("set1" => array(1, 2, 3, 4), "set2" => array(11, 22, 33, 44), "set3" => array(111, 222, 333, 444)); $a=array_keys($arr); var_dump($a); // var_dump(array_keys($arr)["set1"]); not possible
?>
Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%
----- Original Message -----
From: "_lallous" <elias_bachaalany
yahoo.com>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 3:00 PM
Subject: [PHP] Associative arrays (names and strings)
> Anyway to do this fast:
>
> $arr = array("set1" => array(1, 2, 3, 4), "set2" => array(11, 22, 33, 44),
> "set3" => array(111, 222, 333, 444));
>
> It's not that I want to access $arr like: echo $arr['set1']
> I also want to access it as: echo $arr[1] (and it must be equal to
> $arr['set1'];
>
> and It seems i can't do this:
> $arr = array("set1", 1 => array(1, 2, 3, 4), "set2", 2 => array(11, 22, 33,
> 44), "set3", 3 => array(111, 222, 333, 444));
>
> any suggestion to get an array associated by both number and string keys?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
not what I want! i want something like this when you do mysql_fetch_array() don't you get a reference to your columuns via fieldname or array index?
ie. $row = mysql_fetch_array($result_set); echo $row['name']; or echo $row[0];
same return same value! I want something like it with my initial post.
"Andrey Hristov" <andy
anderseen.com> wrote in message
news:027101c13145$a7e2af00$0b01a8c0
ANDreY...
> <?php
> $arr = array("set1" => array(1, 2, 3, 4), "set2" => array(11, 22, 33,
44),
> "set3" => array(111, 222, 333, 444));
> $a=array_keys($arr);
> var_dump($a);
> // var_dump(array_keys($arr)["set1"]); not possible
>
> ?>
>
> Andrey Hristov
> IcyGEN Corporation
> http://www.icygen.com
> 99%
>
>
> ----- Original Message -----
> From: "_lallous" <elias_bachaalany
yahoo.com>
> To: <php-general
lists.php.net>
> Sent: Thursday, August 30, 2001 3:00 PM
> Subject: [PHP] Associative arrays (names and strings)
>
>
> > Anyway to do this fast:
> >
> > $arr = array("set1" => array(1, 2, 3, 4), "set2" => array(11, 22, 33,
44),
> > "set3" => array(111, 222, 333, 444));
> >
> > It's not that I want to access $arr like: echo $arr['set1']
> > I also want to access it as: echo $arr[1] (and it must be equal to
> > $arr['set1'];
> >
> > and It seems i can't do this:
> > $arr = array("set1", 1 => array(1, 2, 3, 4), "set2", 2 => array(11, 22,
33,
> > 44), "set3", 3 => array(111, 222, 333, 444));
> >
> > any suggestion to get an array associated by both number and string
keys?
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
attached mail follows:
The return value of mysql_fetch_array is something strange. You receive into the array data copied to times. 0 is no alias to 'name' for example. If you want this behaviour do that: $arr=array_merge_recursive($arr,array_values($arr)); now do what you want to do
Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%
----- Original Message -----
From: "_lallous" <elias_bachaalany
yahoo.com>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 4:10 PM
Subject: Re: [PHP] Associative arrays (names and strings)
> not what I want!
> i want something like this when you do mysql_fetch_array() don't you get a
> reference to your columuns via fieldname or array index?
>
> ie. $row = mysql_fetch_array($result_set);
> echo $row['name'];
> or
> echo $row[0];
>
> same return same value! I want something like it with my initial post.
>
> "Andrey Hristov" <andy
anderseen.com> wrote in message
> news:027101c13145$a7e2af00$0b01a8c0
ANDreY...
> > <?php
> > $arr = array("set1" => array(1, 2, 3, 4), "set2" => array(11, 22, 33,
> 44),
> > "set3" => array(111, 222, 333, 444));
> > $a=array_keys($arr);
> > var_dump($a);
> > // var_dump(array_keys($arr)["set1"]); not possible
> >
> > ?>
> >
> > Andrey Hristov
> > IcyGEN Corporation
> > http://www.icygen.com
> > 99%
> >
> >
> > ----- Original Message -----
> > From: "_lallous" <elias_bachaalany
yahoo.com>
> > To: <php-general
lists.php.net>
> > Sent: Thursday, August 30, 2001 3:00 PM
> > Subject: [PHP] Associative arrays (names and strings)
> >
> >
> > > Anyway to do this fast:
> > >
> > > $arr = array("set1" => array(1, 2, 3, 4), "set2" => array(11, 22, 33,
> 44),
> > > "set3" => array(111, 222, 333, 444));
> > >
> > > It's not that I want to access $arr like: echo $arr['set1']
> > > I also want to access it as: echo $arr[1] (and it must be equal to
> > > $arr['set1'];
> > >
> > > and It seems i can't do this:
> > > $arr = array("set1", 1 => array(1, 2, 3, 4), "set2", 2 => array(11, 22,
> 33,
> > > 44), "set3", 3 => array(111, 222, 333, 444));
> > >
> > > any suggestion to get an array associated by both number and string
> keys?
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > For additional commands, e-mail: php-general-help
lists.php.net
> > > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> > >
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Thanks again!
"Andrey Hristov" <ahristov
icygen.com> wrote in message
news:030201c1314e$0cc2aee0$0b01a8c0
ANDreY...
> The return value of mysql_fetch_array is something strange. You receive
into the array data copied to times. 0 is no alias to 'name'
> for example. If you want this behaviour do that:
> $arr=array_merge_recursive($arr,array_values($arr));
> now do what you want to do
>
> Andrey Hristov
> IcyGEN Corporation
> http://www.icygen.com
> 99%
>
> ----- Original Message -----
> From: "_lallous" <elias_bachaalany
yahoo.com>
> To: <php-general
lists.php.net>
> Sent: Thursday, August 30, 2001 4:10 PM
> Subject: Re: [PHP] Associative arrays (names and strings)
>
>
> > not what I want!
> > i want something like this when you do mysql_fetch_array() don't you get
a
> > reference to your columuns via fieldname or array index?
> >
> > ie. $row = mysql_fetch_array($result_set);
> > echo $row['name'];
> > or
> > echo $row[0];
> >
> > same return same value! I want something like it with my initial post.
> >
> > "Andrey Hristov" <andy
anderseen.com> wrote in message
> > news:027101c13145$a7e2af00$0b01a8c0
ANDreY...
> > > <?php
> > > $arr = array("set1" => array(1, 2, 3, 4), "set2" => array(11, 22, 33,
> > 44),
> > > "set3" => array(111, 222, 333, 444));
> > > $a=array_keys($arr);
> > > var_dump($a);
> > > // var_dump(array_keys($arr)["set1"]); not possible
> > >
> > > ?>
> > >
> > > Andrey Hristov
> > > IcyGEN Corporation
> > > http://www.icygen.com
> > > 99%
> > >
> > >
> > > ----- Original Message -----
> > > From: "_lallous" <elias_bachaalany
yahoo.com>
> > > To: <php-general
lists.php.net>
> > > Sent: Thursday, August 30, 2001 3:00 PM
> > > Subject: [PHP] Associative arrays (names and strings)
> > >
> > >
> > > > Anyway to do this fast:
> > > >
> > > > $arr = array("set1" => array(1, 2, 3, 4), "set2" => array(11, 22,
33,
> > 44),
> > > > "set3" => array(111, 222, 333, 444));
> > > >
> > > > It's not that I want to access $arr like: echo $arr['set1']
> > > > I also want to access it as: echo $arr[1] (and it must be equal to
> > > > $arr['set1'];
> > > >
> > > > and It seems i can't do this:
> > > > $arr = array("set1", 1 => array(1, 2, 3, 4), "set2", 2 => array(11,
22,
> > 33,
> > > > 44), "set3", 3 => array(111, 222, 333, 444));
> > > >
> > > > any suggestion to get an array associated by both number and string
> > keys?
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > > For additional commands, e-mail: php-general-help
lists.php.net
> > > > To contact the list administrators, e-mail:
php-list-admin
lists.php.net
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
attached mail follows:
Dear all,
This is my quandry... I am trying to build a socket server to transfer simple information, more of a monitoring tool. But after about 14+ hours it just kicks out, without rhyme or reason. No errors, no nothing... I was curious if anyone could see big gaping holes in my code that would allow for this, it's being run on Linux via the command: /web/sockets/socketserver 2 > /web/sockets/logs/error.log & Same for the client piece.. and the code in each is as follows, the client is:
#!/scs/pkg/bin/php <? set_time_limit (0);
error_reporting (E_ALL);
echo "TCP/IP Connection
";
echo exec('date');
echo "\n";
$address = "mymain.server.net"; $port = 4001;
do {
exec('/usr/bin/uptime > /tmp/uptime');
exec('/bin/date >> /tmp/uptime');
exec('/usr/bin/top -bn1 > /tmp/proc');
exec('df -k > /tmp/dfk');
$sock =
socket_create(AF_INET,SOCK_STREAM,0) or die("Can't create socket.\n");
echo "Socket created, [$sock].\n";
socket_setopt($sock, SOL_SOCKET, SO_REUSEADDR, 1);
echo "Attempting to connect to '$address' on port '$port'...";
$result =
socket_connect($sock,$address, $port) or die("connect() failed.\n Reason: " . socket_strerror($result) . "\n");
echo "Connection established.\n";
$in = file('/tmp/uptime'); $inb = file('/tmp/proc'); $inc = file('/tmp/dfk'); $out = ''; $clear = "new\n";
$ret =
socket_read($sock, 4096, PHP_NORMAL_READ);
socket_write ($sock, $clear, strlen($clear));
sleep(5);
if($ret == "Ready\n") {
echo "Sending file...\n ";
$num = 0;
$numb = 0;
$numc = 0;
for($num; $num != count($in); $num++) {
socket_write($sock, $in[$num], strlen($in[$num]));
usleep(50000);
}
echo "OK...\t";
for($numc; $numc != count($inc); $numc++) {
socket_write($sock, $inc[$numc], strlen($inc[$numc]));
usleep(50000);
}
echo "OK...\n";
} else {
echo "Sleeping for Retry\n";
socket_write ($sock, "quit\n", 5);
socket_close ($sock);
sleep(10);
continue;
}
echo "\nClosing socket... ";
socket_write ($sock, "quit\n", 5);
echo "\nOK. Socket Closed
";
echo exec('date');
echo "\n\n";
socket_close ($sock);
sleep(70);
$ret = "";
exec('rm -rf /tmp/uptime /tmp/dfk'); # /tmp/proc');
} while (true);
?>
And the main server code is as follows:
#!/scs/pkg/bin/php <?
set_time_limit (0);
$address = "mymain.server.net"; $port = 4001;
$sock =
socket_create(AF_INET,SOCK_STREAM,0) or die("Can't create socket.\n");
echo "Socket created, [$sock].\n";
socket_setopt($sock, SOL_SOCKET, SO_REUSEADDR, 1);
if(!
socket_bind($sock,$address,$port)) {
socket_close($sock);
die("Can't bind to port $port, exiting.\n");
}
echo "Socket binding successful on $address:$port
";
echo exec('date');
echo "\n";
if (
socket_listen($sock,10) < 0) {
socket_close($sock);
die("Can't setup socket for listening.\n Reason: " . socket_strerror($sock) . "\n");
}
echo "Socket is now listening for connection requests...\n\n";
do {
if(!$msgsock =
socket_accept($sock)) {
echo "Can't accept connection.\n Reason: " . socket_strerror($msgsock) . "\n";
break;
}
socket_getpeername($msgsock,$remote_host,$remote_port);
echo "Accepted socket connection for $remote_host:$remote_port [$msgsock]\n";
do {
socket_write($msgsock,"Ready\n",6);
if(!$ret = socket_read($msgsock,4096)) {
echo "Error reading output, possible broken connection.";
break;
}
if ($temp) {
$ret .= $temp;
$mylength = strlen($ret);
$offset = strpos($ret, "\n");
if ($offset === false) {
$temp = $ret;
continue;
} else {
# String Slice
$cmd = substr($ret, 0, $offset);
if ($cmd != $ret) {
$temp = substr($ret, $offset+1);
} else {
$temp = "";
}
}
} elseif ($ret == "\n") {
$cmd .= $ret . "\n";
} else {
$ret .= $temp;
$mylength = strlen($ret);
$offset = strpos($ret, "\n");
if ($offset === false) {
$temp = $ret;
continue;
} else {
# String Slice
$cmd = substr($ret, 0, $offset);
if ($cmd != $ret) {
$temp = substr($ret, $offset+1);
} else {
$temp = "";
}
}
}
$ret = $cmd;
if (!$ret) {
echo "Socket read error. \n Reason: " . socket_strerror($ret) . "\n";
break;
} elseif (strlen(chop($ret)) > 0) {
$talkback = "PHP: You said \"" . chop($ret) . "\"\r\n";
$response =
socket_write($msgsock,$talkback,strlen($talkback));
echo "$remote_host:$remote_port said: " . chop($ret) . "\r\n";
if(chop($ret) != "quit") {
if(chop($ret) == "new") {
exec("rm -rf /web/downloads/$remote_host/uptime");
$file = "new";
} elseif (chop($ret) == "proc") {
exec("rm -rf /web/downloads/$remote_host/proc");
$file = "proc";
} elseif (chop($ret) == "dfk") {
exec("rm -rf /web/downloads/$remote_host/dfk");
$file = "dfk";
}
if ($file == "new" && chop($ret) != "new") {
$file1 = fopen("/web/downloads/$remote_host/uptime","a+");
fputs($file1, "$ret \n");
fclose($file1);
} elseif ($file == "proc" && chop($ret) != "proc") {
$file2 = fopen("/web/downloads/$remote_host/proc","a+");
fputs($file2, "$ret \n");
fclose($file2);
} elseif ($file == "dfk" && chop($ret) != "dfk") {
$file3 = fopen("/web/downloads/$remote_host/dfk","a+");
fputs($file3, "$ret \n");
fclose($file3);
}
}
}
if (chop($ret) == "quit") {
break;
}
} while (true);
socket_close($msgsock);
echo "Closed socket connection, [$msgsock]
";
echo exec('date');
echo "\n";
} while (true);
socket_close($sock);
echo "Closed server socket.\n";
?>
Get 250 color business cards for FREE! http://businesscards.lycos.com/vp/fastpath/
attached mail follows:
Hi all,
What is the server variable for referrer?
Cheers
Nic
attached mail follows:
* Nic Skitt <nic
nicskitt.co.uk> [010830 06:30]:
> Hi all,
>
> What is the server variable for referrer?
$HTTP_REFERER
>
> Cheers
>
> Nic
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: lerlerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
attached mail follows:
<Original message>
From: Nic Skitt <nic
nicskitt.co.uk>
Date: Thu, Aug 30, 2001 at 12:25:44PM +0100
Message-ID: <20010830121903.18104.qmail
pb1.pair.com>
Subject: [PHP] Referrer
> Hi all, > > What is the server variable for referrer? > > Cheers > > Nic
</Original message>
<Reply>
$HTTP_SERVER_VARS["HTTP_REFERER"]
Check phpinfo() next time... ;)
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
or $GLOBALS["HTTP_REFERER"];
Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%
----- Original Message -----
From: "Nic Skitt" <nic
nicskitt.co.uk>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 2:25 PM
Subject: [PHP] Referrer
> Hi all,
>
> What is the server variable for referrer?
>
> Cheers
>
> Nic
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
D'oh!
New it would be something simple.
Cheers lads.
Nic
"Andrey Hristov" <ahristov
icygen.com> wrote in message
news:029b01c13148$1bcb01e0$0b01a8c0
ANDreY...
> or
> $GLOBALS["HTTP_REFERER"];
>
> Andrey Hristov
> IcyGEN Corporation
> http://www.icygen.com
> 99%
>
> ----- Original Message -----
> From: "Nic Skitt" <nic
nicskitt.co.uk>
> To: <php-general
lists.php.net>
> Sent: Thursday, August 30, 2001 2:25 PM
> Subject: [PHP] Referrer
>
>
> > Hi all,
> >
> > What is the server variable for referrer?
> >
> > Cheers
> >
> > Nic
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
attached mail follows:
Helo techies ,
Iam getting the following error .Any help is appreciated.
Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition user of the object you are trying to operate on was loaded _before_ the session was started in theme.inc on line 6 Thanks in advance, Senthilvellan.
attached mail follows:
May be you save as session variable a object and try to recreate in another script. But in this second script you don't include/require the script with definition of the class. If this definition is in the first script cut it from there and paste into a new file save it using some name and include()/require() in every file which uses sessions.
Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%
----- Original Message -----
From: "senthilvellan" <senthilvellan
visolve.com>
To: "Richard Lynch" <ceo
l-i-e.com>; <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 3:51 PM
Subject: [PHP] Reg-Session problem
Helo techies ,
Iam getting the following error .Any help is appreciated.
Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition user of the object you are trying to operate on was loaded _before_ the session was started in theme.inc on line 6
Thanks in advance, Senthilvellan.
attached mail follows:
I'm working on a project that involves a lot of SNMP data gathering. I was wondering if it's possible to have a multi-threaded PHP script. Basically the SNMP queries I'm running are taking a long time to complete (several seconds). However I found that running multiple at the same time does not slow down the response time of any of the others. So I was wondering how easy it would be to get 5 or 6 SNMP queries running at the same time.
If PHP is unable to, I'm going to have to write a C/C++ app, that will do it, then insert the results into a database. Then the PHP script will grab from there.
Any suggestions?
-- Robert Schultz - robert.schultzadelphiacom.com Knowledge Engineer - Adelphia Communications
attached mail follows:
Ok im like in a realy hurry here, so can someone please tell me (or show) how i make a script read the first (top) 1 or 5 lines from a text document?
Thanks!
-lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man!
ICQ: 115852509
MSN: dbzno1fan
hotmail.com
AIM: legokiller666
attached mail follows:
ok i have this code to do whats below, but its not working
<?php $fp = fopen("meh.txt","r"); for($i=0;$i<2;$i++) { print "$fp[$i]"; } ?>
-lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man!
ICQ: 115852509
MSN: dbzno1fan
hotmail.com
AIM: legokiller666
----- Original Message -----
From: "Kyle Smith" <dbzno1fan
hotmail.com>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 1:15 PM
Subject: [PHP] Quick TXT document stuff
Ok im like in a realy hurry here, so can someone please tell me (or show) how i make a script read the first (top) 1 or 5 lines from a text document?
Thanks!
-lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man!
ICQ: 115852509
MSN: dbzno1fan
hotmail.com
AIM: legokiller666
attached mail follows:
change the first line to
$fp = file("meh.txt");
- Tim
On Thu, 2001-08-30 at 16:31, Kyle Smith wrote:
> ok i have this code to do whats below, but its not working
>
> <?php
> $fp = fopen("meh.txt","r");
> for($i=0;$i<2;$i++)
> {
> print "$fp[$i]";
> }
> ?>
>
>
> -lk6-
> http://www.StupeedStudios.f2s.com
> Home of the burning lego man!
>
> ICQ: 115852509
> MSN: dbzno1fan
hotmail.com
> AIM: legokiller666
>
>
> ----- Original Message -----
> From: "Kyle Smith" <dbzno1fan
hotmail.com>
> To: <php-general
lists.php.net>
> Sent: Thursday, August 30, 2001 1:15 PM
> Subject: [PHP] Quick TXT document stuff
>
>
> Ok im like in a realy hurry here, so can someone please tell me (or show)
> how i make a script read the first (top) 1 or 5 lines from a text document?
>
> Thanks!
>
>
> -lk6-
> http://www.StupeedStudios.f2s.com
> Home of the burning lego man!
>
> ICQ: 115852509
> MSN: dbzno1fan
hotmail.com
> AIM: legokiller666
>
>
>
>
attached mail follows:
Fast and dirty:
function readnlines($filename, $count) { return array_slice(file($filename), 0, $count); }
readnlines('file.txt', 5);
should work,
"Kyle Smith" <dbzno1fan
hotmail.com> wrote in message
news:OE52m5UxP9Fekzabtne0000034e
hotmail.com...
Ok im like in a realy hurry here, so can someone please tell me (or show)
how i make a script read the first (top) 1 or 5 lines from a text document?
Thanks!
-lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man!
ICQ: 115852509
MSN: dbzno1fan
hotmail.com
AIM: legokiller666
attached mail follows:
Kyle Smith wrote:
>ok i have this code to do whats below, but its not working > Try to use file(), which will return an array. So that would be:
$lines = file(filename); for($i=0; $i<2; $i++) { print($lines[$i]); }
/franklin
attached mail follows:
----- Original Message -----
From: Girish P <mailto:girishp
aztec.soft.net>
To: php-general-help
lists.php.net
<mailto:php-general-help
lists.php.net>
Sent: Thursday, August 30, 2001 6:10 PM
Subject: Variable is not showing up in the print string
Hi, I am passing a value from one php page(FirstB.php ) to another php page (Sql.php) with in a link. <a href="Sql.php?ws=100"> </a>.. When try to print the value $ws .. its empty.. Am i missing something ?? I am using apache 1.3.12 on Winnt.. Both the files are attached. TIA Girish
attached mail follows:
Hi, I am passing a value from one php page(FirstB.php ) to another php page (Sql.php) with in a link. <a href="Sql.php?ws=100"> </a>.. When try to print the value $ws .. its empty.. Am i missing something ?? I am using apache 1.3.12 on Winnt.. Both the files are attached. TIA Girish
attached mail follows:
maybe register_globals was turned off in your php.ini ?
"Girish P" <girishp
aztec.soft.net> wrote in message
news:00cb01c13151$d2333d90$c196a8c0
aztec.soft.net...
Hi,
I am passing a value from one php page(FirstB.php ) to another php page
(Sql.php) with in a link.
<a href="Sql.php?ws0"> </a>.. When try to print the value $ws .. its empty.. Am i missing something ?? I am using apache 1.3.12 on Winnt..
Both the files are attached.
TIA Girish
attached mail follows:
I am getting Apache errors everytime that I try and run a Java class I get a segmentation error. Here is the error from my log
[Thu Aug 30 08:35:33 2001] [notice] child pid xxxxx exit signal Segmentation fault (11) I am running RH 7.1(2.4.2) Apache 1.3.19 with mod_ssl and OpenSSL, PHP is configured as follows:
./configure --with-mysql=/usr/local/mysql --with-pfpro=shared,/tmp/verisign/payflowpro/linux --enable-trackvars --with-apxs=/usr/local/apache/bin/apxs --with-java=/usr/java/jdk1.3.1 --with-zlib
everything works fine except the Java. I have configured the Java before using Kaffe and everything ran fan. I switched to JDK1.3.1, and also configured PHP as a DSO instead of static in case I wanted to upgrade I didn't have to fight with my system all over again. I have read where php4.0.5 had this trouble and that several people switched to back to 4.0.4. Also is this a bug that needs reporting or is everyone well aware of it and I just need to change my set up. Any suggestions would be helpful.
Bill
attached mail follows:
Andrey,
Thanks for the time that you put into this! After some tweaking (for my scripts) I got this working nicely, and learned a thing or two about PREG also.
Ross Nielsen
chunga668
yahoo.com
"Andrey Hristov" <andy
icygen.com> wrote in message
news:02d801c12f2e$c1a60a90$0b01a8c0
ANDreY...
> Some time spent to try but now i think it works:
>
> <?php
> echo "<pre>";
> $a='datadatadatadata[link1]datadatadata{link2}data[link3]';
> // $a='datadata{link1}data[link2]datadatadata{link3}data[link4]';
> $pattern='/((\[)|\{)(.+?)(?(2)\]|\})/';
> echo $a."\n";
> echo $pattern."\n";
> preg_match_all($pattern,$a,$matches,PREG_MATCH_ORDER);
> var_dump($matches);
> ?>
>
> Produces :
> <pre>datadatadatadata[link1]datadatadata{link2}data[link3]
> /(\[)|\{(.+?)(?(1)\]|\})/
> array(3) {
> [0]=>
> array(3) {
> [0]=>
> string(1) "["
> [1]=>
> string(7) "{link2}"
> [2]=>
> string(1) "["
> }
> [1]=>
> array(3) {
> [0]=>
> string(1) "["
> [1]=>
> string(0) ""
> [2]=>
> string(1) "["
> }
> [2]=>
> array(1) {
> [0]=>
> string(5) "link2"
> }
> }
>
> Also works with the commented string.
> Explanation : Looking for more than one using preg_match_all. Matching for
[ or {, [ is in () because at the end we test if we found
> [ so we look for ] otherwise { is found so we look for matching }. (?(1)
true|false) is 1 as a backreference is set so we found [.
>
> Hope this will help you.
>
> Andrey Hristov
> IcyGEN Corporation
> http://www.icygen.com
> 99%
>
>
> ----- Original Message -----
> From: "Ross Nielsen" <chunga668
yahoo.com>
> To: <php-general
lists.php.net>
> Sent: Monday, August 27, 2001 9:42 PM
> Subject: [PHP] Regular Expression Problem and PHP 4 (urgent) --- continued
>
>
> > Well my first solution didn't really work the way I needed it too so
here
> > goes again...
> >
> > Data returned from server process looks like following...
> >
> > Header
> > datadatadatadata[link]datadatadata{link}data[link]
> > datadata{link}data[link]datadatadata{link}data[link]
> > datadatadatadata[link]datadatadata{link}data[link]
> > Closer
> >
> > I need to grep the values between [] and {} to turn them into a links.
> > (BTW I need to retain the values for use in JS)
> > Any suggestions?
> >
> > Thanks,
> > Ross
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
attached mail follows:
If i have a feild in a database that has a currency amount like 1000000.00
Is there a way to FORMAT AS (x,xxx,xxx.xx) in the sql so that the return is 1,000,000.00 ?
Or is there way to do it in PHP?
I've done this in ASP, but I can't seem to find it in MySql or in PHP
attached mail follows:
Try number_format()
Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%
----- Original Message -----
From: "Glyndower" <idesign
tampabay.rr.com>
To: <mysql
lists.mysql.com>; <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 3:58 PM
Subject: [PHP] FORMAT return?
> If i have a feild in a database that has a currency amount like 1000000.00
>
> Is there a way to FORMAT AS (x,xxx,xxx.xx) in the sql so that the return is
> 1,000,000.00 ?
>
> Or is there way to do it in PHP?
>
> I've done this in ASP, but I can't seem to find it in MySql or in PHP
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
So sprach »Glyndower« am 2001-08-30 um 08:58:54 -0400 : > Is there a way to FORMAT AS (x,xxx,xxx.xx) in the sql so that the return is
format()
http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
> Or is there way to do it in PHP?
number_format()
BTW: Searching for "format" would have returned both
Alexander Skwar
-- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 1 day 1 hour 28 minutes
attached mail follows:
On 30-Aug-2001 Glyndower wrote: > If i have a feild in a database that has a currency amount like 1000000.00 > > Is there a way to FORMAT AS (x,xxx,xxx.xx) in the sql so that the return is > 1,000,000.00 ? > > Or is there way to do it in PHP? >
function moneynbsp($f=0.00) { $rv=' '; if (isset($f)) { if ( abs($f) > 0.004) $rv='$' .number_format($f, 2); } return($rv); }
Regards,
-- Don Read dreadtexas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. (53kr33t w0rdz: sql table query)
attached mail follows:
Hey there i just managed something that i never accomplished beforei kill a httpd process from PHP, i run the following code
<? $slen=strlen($enc); for ($i=0;$i<$slen;$i=$i+2) { $swap=$enc[$i]; $enc[$i]=$enc[$i+1]; $enc[$i+1]=$swap; } ?>
$enc is a string and has an even length
This silly lines of code make the apache child process crash, if i change it to
<? $slen=strlen($enc); for ($i=0;$i<$slen;$i=$i+2) { $swap=$enc[$i]; $swap2=$enc[$i+1]; $enc[$i]=$swap2; $enc[$i+1]=$swap; } ?>
it works well. what the hell is happening here?
i run php 4.04pl1 as apache module under linux.
-- Grüße aus dem schönen Kleve Jens Kistersrosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau
Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 j.kisters
rosomm-partner.de http://www.rosomm-partner.de
attached mail follows:
I have a MySQL table which stores information like this:
| Type | Place Name | Place Abbrv |
and lets say I have data in the table like:
Example #1: | Office | Bill's Office | bo | | Store | Millcreek Supply | mcs | | Office | Harry's Office | ho | | Store | Sam's Discount Taxidermy | sdt | | Shipping | East Coast Distribution Facility | ecdf |
What I'd like to do is be able to have PHP grab the information out of the database and sort like this on a webpage:
Type Name #1: - Place Name (with hyperlink using the abbrv) - Place Name (with hyperlink using the abbrv)
Type Name #2: - Place Name (with hyperlink using the abbrv) - Place Name (with hyperlink using the abbrv)
For a better illustration, using the information from Example #1:
Example #2:
Office - Bill's Office (link using bo) - Harry's Office (link using ho)
Store - Millcreek Supply (link using mcs) - Sam's Discount Taxidermy (link using sdt)
Shipping - East Coast Distribution Facility (link using ecdf)
So basically it has to group the common "Type" fields together and list them together and make a hyperlink.
What is the best way to do this? I've tried arrays, different MySQL calls, voodoo, ouija boards and drinking, but nothing has gotten me what I need.
btw, the information in "Type" is not a set number. There could be 2 or 200 different "Type". (Otherwise this would be much easier and I might not have a hangover from aforementioned drinking ;p )
- k
attached mail follows:
"Kath" <kath
kathweb.net> wrote in message
news:015301c13156$2c273500$82e53181
resnet.sunysb.edu...
> I have a MySQL table which stores information like this:
>
> | Type | Place Name | Place Abbrv |
>
> and lets say I have data in the table like:
>
> Example #1:
> | Office | Bill's Office | bo |
> | Store | Millcreek Supply | mcs |
> | Office | Harry's Office | ho |
> | Store | Sam's Discount Taxidermy | sdt |
> | Shipping | East Coast Distribution Facility | ecdf |
>
> What I'd like to do is be able to have PHP grab the information out of the
> database and sort like this on a webpage:
>
> Type Name #1:
> - Place Name (with hyperlink using the abbrv)
> - Place Name (with hyperlink using the abbrv)
>
> Type Name #2:
> - Place Name (with hyperlink using the abbrv)
> - Place Name (with hyperlink using the abbrv)
>
> What is the best way to do this? I've tried arrays, different MySQL
calls,
> voodoo, ouija boards and drinking, but nothing has gotten me what I need.
This is a recurrent question; I'm going to write a quick answers page for the _next_ 20 people who ask this.
Basically, the answer is a mix of MySQL and PHP:
In MySQL, query your records, sorted by the header column (so that all occurrences with the same value are together).
In PHP, keep a 'last-known header' variable. If the next header doesn't match the previous one, you're starting a new block - so print a new header. Otherwise, you're continuing an existing block, so skip the header.
<?php
$conn =
mysql_pconnect("host", "user", "pwd")
or die("Error connecting: ".mysql_error());
$query =
"SELECT type, placename, placeabbrv "
."FROM places "
."ORDER BY type,placename";
$res =
mysql_db_query("db", $query, $conn)
or die("Error querying: ".mysql_error());
$lasttype = ""; echo "\n\t<ul>"; while ($row = mysql_fetch_array($res)) { extract($row);
if ($lasttype != $type) { echo "\n\t</ul>\n<br>$type\n\t<ul>"; $lasttype = $type; }
echo "\n\t\t<li><a href='places_$placeabbrv.html'>$placename</a></li>"; } echo "\n\t</ul>"; ?>
Hope that helps.
attached mail follows:
made that for ya,
<pre> <? $lines = "| Office | ZZBill's Office | bo | | Office | Bill's Office | bo | | Store | Millcreek Supply | mcs | | Office | Harry's Office | ho | | Store | Sam's Discount Taxidermy | sdt | | Shipping | East Coast Distribution Facility | ecdf |"; $lines = split("\n", $lines);
$tree = array();
for ($i=0;$i<count($lines);$i++) { $line = trim($lines[$i]); $temp = split('\|', $line); $key1 = trim($temp[1]); $key2 = trim($temp[2]); $key3 = trim($temp[3]); $tree[$key1][$key2] = $key3; }
echo '<hr>'; ksort($tree); var_dump($tree);
echo '<hr>'; $lastplace = ''; while (list($key, $arr) = each($tree)) { if ($lastplace != $key) { echo '* ' . $key . "\n"; $lastplace = $key; } ksort($arr); while (list($pers, $plc) = each($arr)) echo " $pers is in <b>$plc</b>\n"; }
?> </pre>
"Kath" <kath
kathweb.net> wrote in message
news:015301c13156$2c273500$82e53181
resnet.sunysb.edu...
> I have a MySQL table which stores information like this:
>
> | Type | Place Name | Place Abbrv |
>
> and lets say I have data in the table like:
>
> Example #1:
> | Office | Bill's Office | bo |
> | Store | Millcreek Supply | mcs |
> | Office | Harry's Office | ho |
> | Store | Sam's Discount Taxidermy | sdt |
> | Shipping | East Coast Distribution Facility | ecdf |
>
> What I'd like to do is be able to have PHP grab the information out of the
> database and sort like this on a webpage:
>
> Type Name #1:
> - Place Name (with hyperlink using the abbrv)
> - Place Name (with hyperlink using the abbrv)
>
> Type Name #2:
> - Place Name (with hyperlink using the abbrv)
> - Place Name (with hyperlink using the abbrv)
>
> For a better illustration, using the information from Example #1:
>
> Example #2:
>
> Office
> - Bill's Office (link using bo)
> - Harry's Office (link using ho)
>
> Store
> - Millcreek Supply (link using mcs)
> - Sam's Discount Taxidermy (link using sdt)
>
> Shipping
> - East Coast Distribution Facility (link using ecdf)
>
> So basically it has to group the common "Type" fields together and list
them
> together and make a hyperlink.
>
> What is the best way to do this? I've tried arrays, different MySQL
calls,
> voodoo, ouija boards and drinking, but nothing has gotten me what I need.
>
> btw, the information in "Type" is not a set number. There could be 2 or
200
> different "Type". (Otherwise this would be much easier and I might not
have
> a hangover from aforementioned drinking ;p )
>
> - k
>
attached mail follows:
use php Convert between(foxpro) `.dbf' files and MySQL thk
attached mail follows:
EARLY REMINDER:
Our next meeting is NOT tonight (as some people have asked) but *next* Thursday evening (first Thursday in September - September 6, 2001).
Address 125 N Huron #400 Ypsilanti, MI 48197 2 blocks north of Michigan Ave in downtown Ypsi.
As usual, we'll see you all between 7 and 8 for eats, then a presentation from Brian Bruns on - refresh me Brian(!) - SOAP/XML and PHP.
For those of you who haven't met Brian yet, he is a minor deity in the open source pantheon, and quite a knowledgeable programmer in many arenas (PHP being just one). You won't want to miss his presentation!
Anyone with questions is welcome to call me directly at 734-480-9961.
RSVPs are encouraged so we get a rough headcount for food (pizza and pop - if there's something you don't like on pizza, and are planning to attend, let me know. If there's enough vegetarians coming, we normally get a veggie pizza or two as well)
PS: Anyone not on our mailing list is welcome to join the sempug group at http://groups.yahoo.com/group/sempug
attached mail follows:
Hi. Troubles with PhpNuke and mail(): When an user register, no mail i sent to him, but a message "warning; mail() is not supported in this php build". I got postfix working fine, php.ini all right with sendmail_path=/usr/sbin/sendmail -t -i Any idea ???
attached mail follows:
Hi,
Is there any software or program exists that can show the site statistics for each virtual domain when individual client access statistics page from their browser. (Assume virtual domain is used, and all of the domain's log file is in one large file). I am using php 4 + Redhat Linux 6.2 + Apache. Any ideas ???
Thank you
Mark
attached mail follows:
You can use the Apache CustomLog directive to send each virtual host's traffic to it's own logfile.
http://httpd.apache.org/docs-2.0/logs.html#accesslog
- Tim http://www.phptemplates.org
On Thu, 2001-08-30 at 09:59, Mark Lo wrote: > Hi, > > Is there any software or program exists that can show the site > statistics for each virtual domain when individual client access statistics > page from their browser. (Assume virtual domain is used, and all of the > domain's log file is in one large file). I am using php 4 + Redhat Linux > 6.2 + Apache. Any ideas ??? > > > > Thank you > > Mark > >
attached mail follows:
Hi, I'm using PHP code from manual: srand( (double) microtime() * 1000000); // Get random User ID $uid=rand();
but it dowsn't work !
Thanks,
Rosen
attached mail follows:
"Rosen" <rosen_dm
dir.bg> wrote in message
news:20010830144831.34808.qmail
pb1.pair.com...
> Hi,
> I'm using PHP code from manual:
> srand( (double) microtime() * 1000000);
> // Get random User ID
> $uid=rand();
>
> but it dowsn't work !
... I would make sure that microtime() is doing what you think it is;
something like
for ($i = 0; $i < 100; $i++) { $k = (int) microtime(); echo "<br>$k";
for ($j = 0; $j < 10000; $j++) $m = $j *3; }
If you get a page of '0 / 0 / 0' you'll know what your problem is...
attached mail follows:
Use this function, the "$num" argument, is the total of numbers. Ex: if $num is 5, the funtion will return "56743", is five numbers.
function random($num) { srand ((double) microtime() * 1000000); $temp = rand().rand().rand(); $temp = substr($temp, 0, $num); return $temp;
} //fim function random
--- Rosen <rosen_dm
dir.bg> escreveu: > Hi,
> I'm using PHP code from manual:
> srand( (double) microtime() * 1000000);
> // Get random User ID
> $uid=rand();
>
> but it dowsn't work !
>
> Thanks,
>
> Rosen
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
_______________________________________________________________________________________________ Yahoo! GeoCities Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! http://br.geocities.yahoo.com/
attached mail follows:
I am using mySQL with all of my stuff but a friend who started writing some files for our online baseball league was using Access as his database. We tried running it on my server but it returns an error that says undefined function odbc_connect.
Now my questions, can I get this to work on a Linux box? If not, is there a nice way to convert the MDB to mySQL? :)
Jeff
attached mail follows:
Hi, i have a form for uploading files to a server. It looks like this:
<form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="name"> <input type="submit" value="Go"> </form>
Whenever I choose a file bigger than about 4 or 5 MB i get an internal server error. I changed the values for post_max_size, upload_max_file_size and max_execution_time in php.ini - without any success. Does anyone knows why?
I am running php 4.0.6 on Win98 SE and Apache 1.3.12
Thanks, Uli
attached mail follows:
<Original message>
From: Ulrich Hacke <hacke
trilos.de>
Date: Thu, Aug 30, 2001 at 04:16:28PM +0200
Message-ID: <NFBBKILAMLGENOJCMHCGCECKCPAA.hacke
trilos.de>
Subject: [PHP] Uploading large files
> Hi, > i have a form for uploading files to a server. It looks like this: > > <form action="upload.php" method="post" enctype="multipart/form-data"> > <input type="file" name="name"> > <input type="submit" value="Go"> > </form> > > Whenever I choose a file bigger than about 4 or 5 MB i get an internal > server error. I changed the values for post_max_size, upload_max_file_size > and max_execution_time in php.ini - without any success. Does anyone knows > why? > > I am running php 4.0.6 on Win98 SE and Apache 1.3.12 > > Thanks, Uli
</Original message>
<Reply>
Have you checked your Apache's .conf file(s). I believe the maximum upload size can be also deterimined there...
I thought...
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Our host has set-up a php .ini file in our cgi-bin. We were having trouble writing and reading from flat files. I have never set the include_path directive from a cgi-bin before. Can someone tell how to set the path? I know it has to be diffrent from the way I am used to.
TIA Gary
attached mail follows:
Hi All,
I already spent too much time trying to solve this one by myself, so I am in need of a little bit of help.
I have a form with checkboxes, all with the same name (name="noticias[]"). When it is submited, only the selected checkboxes become a value on the array $noticias on the next page. So:
<checkbox name="noticias[]" value="m" checked> <checkbox name="noticias[]" value="w">
$noticias will have only one value, 'm'. Right? I come to this conclusion, but I might be wrong. The values are dinamic, which means not always certain boxes will be checked or have the same value, form by form. So form X can have 3 checkboxes with different values than form Y with 8 checkboxes.
Okay. Now I need to compare the submited values with another 'parsed string', or not if I took the wrong path from the beggining to solve this problem. For example:
$string = 'w=1&r=0&m=0'; parse_str($string); // Will become $w = 1, $r = 0, etc...
Back with the array $noticias, I need to compare the selected values with the ones on the parsed string, still mantaining the parts equal to zero. If array $noticias will only have values with the checked boxes, how can I 'update' the $string (returning a new one, for example) with the new checked boxes and still maintain the ones that equals to zero, if the $string can have an uncertain number of values after parsed?
That's a hard one, I believe ;-)
Say, just to clarify, another example:
$noticias = Array("m","d") $string = "m=0&d=1&w=1&d=0";
The resulted string would need to be: "m=1&d=1&w=0&d=0";
A solution I am trying to unfold for dinamic (or uncertain) strings, it to make a function that one of the parameters is the 'old string', which I would pass to this function, to serve as a 'base' to be updated with the values from the form array ($noticias).
But I am stuck at the part where this old string is compared, and its values are updated if the form's checkboxs are selected, or not.
Am I missing some simple function from the manual that can do this for me? If not, how can I accomplish this result?
Thanks a lot if you read it until here ;-)
--Julio Nobrega
A hora está chegando: http://toca.sourceforge.net
attached mail follows:
Hi all
i am new to the list and trying to install php on Suse 6.1. My apache is ver 1.3.6 and am installing php ver 4.0.6. The kind of error I get is as follows:
/usr/local/etc/php-4.0.6/build/shtool mkdir -p "/usr/lib/apache" && apxs -S LIBEXECDIR="/usr/lib/apache" -i -a -n php4 libs/libphp4.so apxs:Error: Unkown option: S
-------------------
The above happens when i run "make install"
Please advise.
Thanks in advance.
James
attached mail follows:
> > I need it for my intranet web site, some of my users close browser on long > > lasting script and I need to prevent this.
The question to ask is: "How do you convince people to not close their browser?". Peter
attached mail follows:
So far, there have been no answers, so I'm guessing that either we're the only two receiving this or everyone who has received it has been unable to resolve the problem.
My searches on Google have been unsuccessful so far. There are quite a few reports of the problem, but no responses.
If I learn anything, I'll be sure to let you know.
Thanks Chris
> -----Original Message-----
> From: Dennis Moore [mailto:dmoore
ravens-nest.com]
> Sent: Wednesday, August 29, 2001 8:59 PM
> To: Chris Mulcahy; php-general
lists.php.net
> Subject: Re: [PHP] Making gd Extensions
>
>
> I am having a similar problem using gd-2.0.1 where the
> compilation complains
> about "conflicting type gdIOCtx". I am getting a knot on my
> forehead from
> the wall in front of me. Any ideas?
>
> /dkm
>
>
>
> ----- Original Message -----
> From: "Chris Mulcahy" <cmulcahy
cmulcahy.com>
> To: <php-general
lists.php.net>
> Sent: Wednesday, August 29, 2001 9:31 AM
> Subject: [PHP] Making gd Extensions
>
> >
> > The current item I'm wrestling with is the gd extensions.
> I've rebuilt
> > PHP and Apache so many times to enable one feature only to
> learn that I
> > forgot to recompile one that I'd relied on previously. It's a never
> > ending battle to get all of the features required.
> >
> > The .so extensions option is a great feature that I'd like
> to make use
> > of.
> >
> > In trying to compile the gd .so extension (gd-1.8.4), I'm
> receiving the
> > following errors. Any ideas?
> >
> > Thanks
> > Chris Mulcahy
> > ---
> >
> > Making all in ext
> > make[1]: Entering directory
> > `/home/cmulcahy/transfer/webserver/php-4.0.6/ext'
> > Making all in gd
> > make[2]: Entering directory
> > `/home/cmulcahy/transfer/webserver/php-4.0.6/ext/gd'
> > make[3]: Entering directory
> > `/home/cmulcahy/transfer/webserver/php-4.0.6/ext/gd'
> > gcc -I.
> -I/home/cmulcahy/transfer/webserver/php-4.0.6/ext/gd -I/home/cm
> > ulcahy/transfer/webserver/php-4.0.6/main
> -I/home/cmulcahy/transfer/webse
> > rver/php-4.0.6
> -I/home/cmulcahy/transfer/webserver/php-4.0.6/Zend -I/hom
> > e/cmulcahy/transfer/webserver/php-4.0.6/ext/mysql/libmysql
> -I/home/cmulc
> > ahy/transfer/webserver/php-4.0.6/ext/xml/expat/xmltok
> -I/home/cmulcahy/t
> > ransfer/webserver/php-4.0.6/ext/xml/expat/xmlparse
> -I/home/cmulcahy/tran
> > sfer/webserver/php-4.0.6/TSRM -DSUPPORT_UTF8
> -DXML_BYTE_ORDER=12 -g -O2
> > -c gd.c && touch gd.lo
> > gd.c:95: conflicting types for `gdIOCtx'
> > /usr/local/include/gd_io.h:18: previous declaration of `gdIOCtx'
> > gd.c: In function `php_if_imagecreatefromgif':
> > gd.c:1209: `gdImageCreateFromGif' undeclared (first use in this
> > function)
> > gd.c:1209: (Each undeclared identifier is reported only once
> > gd.c:1209: for each function it appears in.)
> > gd.c: In function `php_if_imagegif':
> > gd.c:1404: `gdImageGif' undeclared (first use in this function)
> > make[3]: *** [gd.lo] Error 1
> > make[3]: Leaving directory
> > `/home/cmulcahy/transfer/webserver/php-4.0.6/ext/gd'
> > make[2]: *** [all-recursive] Error 1
> > make[2]: Leaving directory
> > `/home/cmulcahy/transfer/webserver/php-4.0.6/ext/gd'
> > make[1]: *** [all-recursive] Error 1
> > make[1]: Leaving directory
> > `/home/cmulcahy/transfer/webserver/php-4.0.6/ext'
> > make: *** [all-recursive] Error 1
> >
attached mail follows:
I have checked the archives but have not been able to find a suitable answer.
I have a couple of scripts that allow my users to upload files to the server. At the same time, it logs an entry in a MySQL database that links the temp file name created on the server to a name that makes sense for the user.
Here is the problem:
When a user deletes a file from their area, it only deletes in the MySQL database. It does not remove the actual file from the directory on the server.
How can I send a command to remove it from the server within PHP?
Thanks,
Paul
________________ Paul A. Cohen www.networkoil.com 713.590.1422
attached mail follows:
> How can I send a command to remove it from the server within PHP? > > Thanks, > > Paul
You go to the online manual, browse to the Filesystem Functions section and look up a function that removes files http://www.php.net/manual/en/ref.filesystem.php
jason
attached mail follows:
Thanks Jason,
I was using a hard copy manual and couldn't find it in the file functions.
Paul
-----Original Message-----
From: Jason Brooke [mailto:jb
qgl.org]
Sent: Thursday, August 30, 2001 10:27 AM
To: Paul Cohen; php-general
lists.php.net
Subject: Re: [PHP] Delete Files on Server with PHP
> How can I send a command to remove it from the server within PHP? > > Thanks, > > Paul
You go to the online manual, browse to the Filesystem Functions section and look up a function that removes files http://www.php.net/manual/en/ref.filesystem.php
jason
attached mail follows:
Hi there,
I need use sockets in my code, but PHP doesn't see function named 'socket'. Does any one have any expirience with PHP sockets ? Maybe name has changed ?
Please, answer in private e-mail.
TIA, Dariusz Malinowski
attached mail follows:
> Hi there, > > I need use sockets in my code, but PHP doesn't see function named > 'socket'. Does any one have any expirience with PHP sockets ? > Maybe name has changed ?
Did you --enable-sockets in your ./configure line ?
jason
attached mail follows:
Would anyone find this useful? join(' glue ',$array,0,5) instead of this join(' glue ',array_slice($array,0,5))
Its not the extra typing i mind, it just seems that the parameters go well with the join function..
Any thoughts?
Jack
attached mail follows:
Whatever I do (phpinfo(), echo $HTTP_POST_FILES['userfile']['type']) to display the array $HTTP_POST_FILES , I get nothing.
My HTML form seems to be correct according to the previous messages in the mailing-list. phpinfo() displays infos about http_post_vars and I get the proper variables according to my file there but nothing about http_post_files.
register_global and track_var are on in php.ini but still no luck.
Any idea?
Michael
attached mail follows:
Michael.Thanry
Artemisinternational.fr wrote:
>Whatever I do (phpinfo(), echo $HTTP_POST_FILES['userfile']['type']) to >display the array $HTTP_POST_FILES , I get nothing. > Did you include enctype="multipart/form-data" in your form tag?
/franklin
attached mail follows:
> On Thu, 30 Aug 2001 02:25, PHP List wrote: > > Hi, > > Can anyone tell me why php is behaving like this? > > > > If I use enctype="multipart/form-data", it seems the first form field > > is not passed to php. ex: > > <form method="post" action="products.asp" > > enctype="multipart/form-data"> <input type="hidden" name="cmd" > > value="edit"> > > > > $cmd will not be passed to php, I have to do this: > > > > <form method="post" action="products.asp" > > enctype="multipart/form-data"> <input type="hidden" name="null" > > value="null"> > > <input type="hidden" name="cmd" value="edit"> > > > > Now I can use $cmd. > > Is this normal? > > If you are trying to upload a file, I think you need to have a hidden > field for MAX_FILE_SIZE - check the Handling File Uploads section of the > manual. >
I do have that field later on in the form and the uploading is working fine. It just seems to ignore the first form field.
attached mail follows:
Hello, Is there a way to put an if statement in a variable? For example: $var = "Hello".IF($var2 = 1) { ."Mr. Bean". } else { ."New Comer". }." To The Coffee House."; Thank you, Brandon Orther
attached mail follows:
$var="Hello".(($var==1)? "Mr. Bean":"New Comer")."To somewhere";
Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS
----- Original Message -----
From: "Brandon Orther" <orther
webintellects.com>
To: "PHP User Group" <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 6:59 PM
Subject: [PHP] If statement within a variable?
> Hello, > > Is there a way to put an if statement in a variable? > > For example: > > $var = "Hello".IF($var2 = 1) { ."Mr. Bean". } else { ."New Comer". }." > To The Coffee House."; > Thank you, > Brandon Orther >
attached mail follows:
$var = $var2==1 ? 'Hello Mr. Bean' : 'Hello New Comer'; be careful of your if statements and only using one equals..
jack
Brandon Orther wrote:
> Hello, > > Is there a way to put an if statement in a variable? > > For example: > > $var = "Hello".IF($var2 = 1) { ."Mr. Bean". } else { ."New Comer". }." > To The Coffee House."; > Thank you, > Brandon Orther
attached mail follows:
<Original message>
From: Brandon Orther <orther
webintellects.com>
Date: Thu, Aug 30, 2001 at 08:59:44AM -0700
Message-ID: <006301c1316c$c9395010$0a00a8c0
webintel>
Subject: [PHP] If statement within a variable?
> Hello, > > Is there a way to put an if statement in a variable? > > For example: > > $var = "Hello".IF($var2 = 1) { ."Mr. Bean". } else { ."New Comer". }." > To The Coffee House."; > Thank you, > Brandon Orther
</Original message>
<Reply>
This is it:
$var = "Hello".($var2 = 1 ? "Mr. Bean" : "New Comer")."To The Coffee House.";
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Brandon Orther wrote:
>Hello, > >Is there a way to put an if statement in a variable? > >For example: > >$var = "Hello".IF($var2 = 1) { ."Mr. Bean". } else { ."New Comer". }." >To The Coffee House."; > $var = "Hello ".($var2==1 ? "Mr. Bean" : "New Comer");
/franklin
attached mail follows:
<Original message>
From: * R&zE: <renze
datalink.nl>
Date: Thu, Aug 30, 2001 at 06:05:57PM +0200
Message-ID: <20010830180557.B15130
pro-pain.telemediair.nl>
Subject: Re: [PHP] If statement within a variable?
> This is it: > > $var = "Hello".($var2 = 1 ? "Mr. Bean" : "New Comer")."To The Coffee House.";
</Original message>
<Reply>
Oops... copying your code I also copied an error. It should be "$var2 == 1" io "$var2 = 1". So your check will be:
$var = "Hello".($var2 == 1 ? "Mr. Bean" : "New Comer")."To The Coffee House.";
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
So sprach »Brandon Orther« am 2001-08-30 um 08:59:44 -0700 : > $var = "Hello".IF($var2 = 1) { ."Mr. Bean". } else { ."New Comer". }."
$var = "Hello" . (($var2 = 1)?("Mr. Bean"):("New Comer"));
But why do you assign 1 to $var2?
To circumvent these kind of problems, I always write:
$var = "Hello" . ((1 == $var2)?("Mr. Bear"):("New Comer"));
Or, in this case, you could have used:
$var = "Hello"; if (1 == $var2){ $var .= "Mr. Bean"; } else { $var .= "New Comer"; }
Alexander Skwar
-- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 1 day 3 hours 15 minutes
attached mail follows:
Sorry everone but I 'm having a hard time with joins
How do I add this clause:
users.uid = selection.user_uid from table selection
to this query:
$sql = "SELECT users.uid, users.username FROM users LEFT JOIN picks ON users.uid = picks.user_id WHERE picks.user_id IS NULL
Thank You.
attached mail follows:
i do
-----Mensaje original-----
De: Edney Marcel Imme [mailto:edney
bludata.com.br]
Enviado el: miércoles 29 de agosto de 2001 22:19
Para: php-general
lists.php.net
Asunto: [PHP] php and Interbase
HI.
Anyone use php with Interbase here?
Tks. Edney Marcel Imme ICQ: 109374340
attached mail follows:
Yes! I use it as my routine DB.
Todd
-- Todd Cary Ariste Software toddaristesoftware.com
attached mail follows:
-----Original Message-----
From: Jeremy Morano [mailto:jeremy
prepresshelp.com]
Sent: Thursday, August 30, 2001 12:05 PM
To: php-general
lists.php.net
Subject: JOIN
Sorry everone but I 'm having a hard time with joins
How do I add this clause:
users.uid <> selection.user_uid from table selection
to this query:
$sql = "SELECT users.uid, users.username FROM users LEFT JOIN picks ON users.uid = picks.user_id WHERE picks.user_id IS NULL
Thank You.
attached mail follows:
> -----Original Message-----
> From: Jeremy Morano [mailto:jeremy
prepresshelp.com]
> Sent: Thursday, August 30, 2001 12:05 PM
> To: php-general
lists.php.net
> Subject: JOIN
>
>
> Sorry everone but I 'm having a hard time with joins
Let me give you a brief explanation of how Left Join works (or at least how I think it works =P)
Lets say your two tables in the below query (users and picks) have 4 and 2 rows respectively. If you were to do select * from users left join picks on users.uid=picks.user_id you would get something like
| uid | username | user_id | | 1 | Sheridan | 1 | | 2 | Mark | 2 | | 3 | Jason | NULL | | 4 | Henry | NULL |
That is, you had it show all the rows from both tables while checking only the rows where users.uid has a value (and returning null if picks.user_id doesn't have an equal value). Now what if you were to do select * from picks left join users on users.uid=picks.user_id? You would get
| user_id | uid | username | | 1 | 1 | Sheridan | | 2 | 2 | Mark |
because you told it to show you all the rows from both tables while checking only the rows where picks.user_id has a value. It would have returned null for both users.uid and users.username for any row where user_id had a value that uid didn't. For example, if picks had the values (1,2,11) instead of (1,2) you would get
| user_id | uid | username | | 1 | 1 | Sheridan | | 2 | 2 | Susuan | | 11 | NULL | NULL|
Does that make sense? > How do I add this clause: > > users.uid <> selection.user_uid from table selection > > to this query: > > $sql = "SELECT users.uid, users.username > FROM users LEFT JOIN picks > ON users.uid = picks.user_id > WHERE picks.user_id IS NULL
I am not sure I am following you. What are you trying to do exactly? Are you trying to list all the entries in table users that do not have equivalents in either table picks or table selection? If so I guess you could do something like:
select users.uid,users.username from users left join picks on users.uid = picks.user_id left join selection on users.uid = selection.user_uid where picks.user_id is null and selection.user_uid is null;
If this is not what you are trying to accomplish, reply with a clear description of what you are trying to accomplish. > Thank You.
No Problem. Hope that helps.
Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.com
attached mail follows:
I am using Apache and PHP. I encountered a redirect problem in PHP, and traced it down, so, I generated a very short PHP page as following:
<?php sleep(30); $goto = "http://tt.mot.com/to_pdf/pdf_tmp/test.pdf"; Header("Location: $goto"); exit; ?>
If the "sleep(30);" statement is commented out, this page works fine in both IE4.0/IE5.0 and netscape, but if "sleep(30)" statement is in this page, it will only work in Netscape, but not in IE.
Is there another way to do the "redirect" in PHP? or how to fix this problem (I can't remove the "sleep" statement because in the real program, it is a "System call" and will take more than 30 seconds)?
Thank you very much in advance.
Regards, George
attached mail follows:
<Original message>
From: Zhu George-CZZ010 <George.Z.Zhu
motorola.com>
Date: Thu, Aug 30, 2001 at 11:10:19AM -0500
Message-ID: <1FA6C7249817D4119B9800D0B73E99A6050A79FB
il02exm27.comm.mot.com>
Subject: [PHP] Header() function and redirect
>
> I am using Apache and PHP. I encountered a redirect problem in PHP, and traced it down, so, I generated a very short PHP page as following:
>
> <?php
> sleep(30);
> $goto = "http://tt.mot.com/to_pdf/pdf_tmp/test.pdf";
> Header("Location: $goto");
> exit;
> ?>
>
> If the "sleep(30);" statement is commented out, this page works fine in both IE4.0/IE5.0 and netscape, but if "sleep(30)" statement is in this page, it will only work in Netscape, but not in IE.
>
> Is there another way to do the "redirect" in PHP? or how to fix this problem (I can't remove the "sleep" statement because in the real program, it is a "System call" and will take more than 30 seconds)?
>
> Thank you very much in advance.
>
> Regards,
> George
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
</Original message>
<Reply>
You can (possibly) just redirect before the rest of your script. Ofcourse you can't do that when the rest of the script produces output, but it seems to me like it doesn't.
Try the next code:
--- PHP code --- <?php header ("Location: http://somewhere.com"); error_log ("And still my script is running!", 0); ?> --- End of PHP code ---
You'll see that the original script will write the line to the logfile although the user is already redirected to the next page.
Btw... 30 seconds is a rather long time. No user will ever want to wait that long. Just my opinion...
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
But I have to wait for the application to finish. The idea is: the application will take the file, and convert it into PDF file (it takes more than 30 seconds generally), then display the generated PDF file.
I am just wondering if I can use "Header()" to redirect to a general php page, then in that page, redirect to the PDF file.
Thanks, George
-----Original Message-----
From: * R&zE: [mailto:renze
datalink.nl]
Sent: Thursday, August 30, 2001 11:19 AM
To: Zhu George-CZZ010; php-general
lists.php.net
Subject: Re: [PHP] Header() function and redirect
<Original message>
From: Zhu George-CZZ010 <George.Z.Zhu
motorola.com>
Date: Thu, Aug 30, 2001 at 11:10:19AM -0500
Message-ID: <1FA6C7249817D4119B9800D0B73E99A6050A79FB
il02exm27.comm.mot.com>
Subject: [PHP] Header() function and redirect
>
> I am using Apache and PHP. I encountered a redirect problem in PHP, and traced it down, so, I generated a very short PHP page as following:
>
> <?php
> sleep(30);
> $goto = "http://tt.mot.com/to_pdf/pdf_tmp/test.pdf";
> Header("Location: $goto");
> exit;
> ?>
>
> If the "sleep(30);" statement is commented out, this page works fine in both IE4.0/IE5.0 and netscape, but if "sleep(30)" statement is in this page, it will only work in Netscape, but not in IE.
>
> Is there another way to do the "redirect" in PHP? or how to fix this problem (I can't remove the "sleep" statement because in the real program, it is a "System call" and will take more than 30 seconds)?
>
> Thank you very much in advance.
>
> Regards,
> George
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
</Original message>
<Reply>
You can (possibly) just redirect before the rest of your script. Ofcourse you can't do that when the rest of the script produces output, but it seems to me like it doesn't.
Try the next code:
--- PHP code --- <?php header ("Location: http://somewhere.com"); error_log ("And still my script is running!", 0); ?> --- End of PHP code ---
You'll see that the original script will write the line to the logfile although the user is already redirected to the next page.
Btw... 30 seconds is a rather long time. No user will ever want to wait that long. Just my opinion...
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
<Original message>
From: Zhu George-CZZ010 <George.Z.Zhu
motorola.com>
Date: Thu, Aug 30, 2001 at 11:27:41AM -0500
Message-ID: <1FA6C7249817D4119B9800D0B73E99A6050A79FC
il02exm27.comm.mot.com>
Subject: RE: [PHP] Header() function and redirect
> But I have to wait for the application to finish. The idea is: the application will take the file, and convert it into PDF file (it takes more than 30 seconds generally), then display the generated PDF file. > > I am just wondering if I can use "Header()" to redirect to a general php page, then in that page, redirect to the PDF file. > > Thanks, > George
</Original message>
<Reply>
Ah... well...
Don't know what you exactly mean, but you either have to wait 'till the processing has been done (which, like I said, takes too long to wait for), or you can use one of the following options:
- You can have an email send to the user telling him/her that the PDF is ready. You can either send it as an attachment, or just send a URL of the page where the PDF can be downloaded. - You can have the user redirected to a page with a download link on it. Then you still have to problem, though, that the PDF isn't ready yet at the moment the user gets that link.
But you get back to what you're wondering ("if I can use "Header()" to redirect to a general php page"); Yes, ofcourse... you can do it before or after the processing. But! You can't do anything about client-timeouts. And let's be honest... It's not that weird that a browser gives up if it doesn't get any answer for more than 30 seconds. It's a pretty long timeout already.
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
I'm looping through a MSQL db pulling out the dates where I would like to display the date and then the day of the week. The problem is that every date returns the same day of the week, Wed. I checked the documentation and it doesn't say anything about the expression only being executed once during inside the WHILE loop.
I've tried:
$m = substr($row[0],0,4); $d = substr($row[0],5,2); $y = substr($row[0],8,2); $dy = date ("D", mktime(0,0,0,$m,$d,$y));
and just using the date field
$dy = date ("D", $row[0]);
Any help would be greatly appreciated!
attached mail follows:
<Original message>
From: Paul McGee <pmcgee
inprise.com>
Date: Thu, Aug 30, 2001 at 12:13:21PM -0400
Message-ID: <20010830170839.89933.qmail
pb1.pair.com>
Subject: [PHP] Date formatting in PHP 3.0
> I'm looping through a MSQL db pulling out the dates where I would like to > display the date and then the day of the week. The problem is that every > date returns the same day of the week, Wed. I checked the documentation and > it doesn't say anything about the expression only being executed once during > inside the WHILE loop. > > I've tried: > > $m = substr($row[0],0,4); > $d = substr($row[0],5,2); > $y = substr($row[0],8,2); > $dy = date ("D", mktime(0,0,0,$m,$d,$y)); > > and just using the date field > > $dy = date ("D", $row[0]); > > Any help would be greatly appreciated!
</Original message>
<Reply>
Did you give a look at your own code? A month consisting of 4 digits? And a year consisting of 2 digits? I'd say:
--- PHP code --- $y = substr($row[0],0,4); $m = substr($row[0],5,2); $d = substr($row[0],8,2); $dy = date ("D", mktime(0,0,0,$m,$d,$y));
and just using the date field
$dy = date ("D", $row[0]); --- End of PHP code ---
</Reply>
--* R&zE:
</Reply>
--
* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Thanks, I knew it was something stupid!
However, the $dy = date ("D", $row[0]) doesn't work.
"* R&Ze:" <renze
datalink.nl> wrote in message
news:20010830183255.E15130
pro-pain.telemediair.nl...
> <Original message>
> From: Paul McGee <pmcgee
inprise.com>
> Date: Thu, Aug 30, 2001 at 12:13:21PM -0400
> Message-ID: <20010830170839.89933.qmail
pb1.pair.com>
> Subject: [PHP] Date formatting in PHP 3.0
>
> > I'm looping through a MSQL db pulling out the dates where I would like
to
> > display the date and then the day of the week. The problem is that
every
> > date returns the same day of the week, Wed. I checked the documentation
and
> > it doesn't say anything about the expression only being executed once
during
> > inside the WHILE loop.
> >
> > I've tried:
> >
> > $m = substr($row[0],0,4);
> > $d = substr($row[0],5,2);
> > $y = substr($row[0],8,2);
> > $dy = date ("D", mktime(0,0,0,$m,$d,$y));
> >
> > and just using the date field
> >
> > $dy = date ("D", $row[0]);
> >
> > Any help would be greatly appreciated!
>
> </Original message>
>
> <Reply>
>
> Did you give a look at your own code?
> A month consisting of 4 digits?
> And a year consisting of 2 digits?
> I'd say:
>
> --- PHP code ---
> $y = substr($row[0],0,4);
> $m = substr($row[0],5,2);
> $d = substr($row[0],8,2);
> $dy = date ("D", mktime(0,0,0,$m,$d,$y));
>
> and just using the date field
>
> $dy = date ("D", $row[0]);
> --- End of PHP code ---
>
> </Reply>
>
> --
>
> * R&zE:
>
> </Reply>
>
> --
>
> * R&zE:
>
>
> -- »»»»»»»»»»»»»»»»»»»»»»»»
> -- Renze Munnik
> -- DataLink BV
> --
> -- E: renze
datalink.nl
> -- W: +31 23 5326162
> -- F: +31 23 5322144
> -- M: +31 6 21811143
> --
> -- Stationsplein 82
> -- 2011 LM HAARLEM
> -- Netherlands
> --
> -- http://www.datalink.nl
> -- ««««««««««««««««««««««««
attached mail follows:
<Original message>
From: Paul McGee <pmcgee
inprise.com>
Date: Thu, Aug 30, 2001 at 12:45:49PM -0400
Message-ID: <20010830174139.31338.qmail
pb1.pair.com>
Subject: Re: [PHP] Date formatting in PHP 3.0
> Thanks, I knew it was something stupid! > > However, the $dy = date ("D", $row[0]) doesn't work.
</Original message>
<Reply>
You're welcome...
and eh... for the "However, the $dy = date ("D", $row[0]) doesn't work.":
It shouldn't. date() requires a timestamp as a second argument, not a string. Unless you retrieve an actual timestamp from your db (which you don't) you could directly feed it to date(). So as long as you get strings from your db you'll have to parse 'm first and then put them through mktime() (like you do in your example). Then you have a real timestamp and you can put that through date().
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Hi all,
I am constantly getting Headers already sent errors.
What I dont understand is why when I read something that could have come from a cookie or session does that right out to headers.
eg:
if (!$HTTP_COOKIE_VARS["TrackID"]){
}
The header error refers to this line as having first sent output. Is that the case?? if so how do I deal with that?
Cheers
Nic
attached mail follows:
Nic Skitt wrote:
>Hi all, > >I am constantly getting Headers already sent errors. > >What I dont understand is why when I read something that could have come >from a cookie or session does that right out to headers. > >eg: > >if (!$HTTP_COOKIE_VARS["TrackID"]){ > >} > >The header error refers to this line as having first sent output. Is that >the case?? if so how do I deal with that? > Perhaps you have some whitespace lingering over there?
/ Franklin
attached mail follows:
I cant see any. Again this seems to be a difference between my dev server and the live server. The live server doesnt compain.
Any more ideas?
NIc
"Franklin Van Velthuizen" <php
yoki.org> wrote in message
news:3B8E689D.1060502
yoki.org...
> Nic Skitt wrote:
>
> >Hi all,
> >
> >I am constantly getting Headers already sent errors.
> >
> >What I dont understand is why when I read something that could have come
> >from a cookie or session does that right out to headers.
> >
> >eg:
> >
> >if (!$HTTP_COOKIE_VARS["TrackID"]){
> >
> >}
> >
> >The header error refers to this line as having first sent output. Is that
> >the case?? if so how do I deal with that?
> >
> Perhaps you have some whitespace lingering over there?
>
> / Franklin
>
>
>
attached mail follows:
At 17:18 30/08/01 +0100, Nic Skitt wrote: >I cant see any. Again this seems to be a difference between my dev server >and the live server. The live server doesnt compain.
That's the best way round, at least :-)
Have you also checked any included/required files for extra lines (after the final '?>'')? It's an easy thing to overlook...
Simon
---------- Simon Robson www.intropica.com ----------
attached mail follows:
On Wednesday 29 August 2001 20:15, alvarez
sto13.st-oneline.de wrote:
> I do not need a cmd-line utility but something I can use _in_ a PHP4
> script without the need to apply changes to the interpreter or weird
> system interfaces. Something similiar to the #define preprocessing
> instructions of cc (or hopefully more flexible) would suit my needs.
Well, it kind of *is* like C's #define - it adds a kind of "compilation" step to the entire process. Preprocess all the scripts and then you upload them to the server. The problem with comparing things to C is that C is a compiled language anyway :)
> If your programm can substitute script parts during a page request > it'd be nice if you could pass me a source copy.
No, it can't.
> Personally I've no idea how such a facility could be implemented if > not being part of the PHP core.
if (FOOBAR == 42) { include ("code1.php"); } else { include ("code2.php"); }
-- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/)CPU not found. retry, abort, ignore?
attached mail follows:
On Wednesday 29 August 2001 23:45, Christopher William Wesley wrote: > On Wed, 29 Aug 2001, Joseph Bannon wrote: > > I want to use fgets to get an image off the server and then print it. > > Kinda like if you call the script picture.php, an image will appear. > > How do I do > > I do this, with fopen() and fpassthru() ... > > $im = fopen( "myImage.jpg", "r" ); > if( !$im ){ > // FILE WASN'T FOUND > } else {
// important: header ("Content-Type: image/jpeg"); // or image/png
> // ALL GOOD - SEND IT TO THE BROWSER > fpassthru( $im ); > } > fclose( $im );
-- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/)CPU not found. retry, abort, ignore?
attached mail follows:
What exactly does fpassthru do? Does it download it to my server and then shoot it to the browser??
Joseph
attached mail follows:
On Thu, 30 Aug 2001, Joseph Bannon wrote:
> What exactly does fpassthru do? Does it download it to my server and then > shoot it to the browser??
For the file pointer on which it operates, it reads the file pointer until EOF and sends the data to STDOUT. It is very much like the 'cat' command in Unix. The file pointer can be to a local or remote file opened with fopen(), or a remote data source opened with fsockopen().
And as always, there's a gem in the docs ... readfile() does the same thing as fpassthru() but doesn't need a file pointer. It just needs a path to a file, so you can eliminate the fopen().
~Chris /"\ \ / Pine Ribbon Campaign Microsoft Security Specialist X Against Outlook The moron in Oxymoron. / \ http://www.thebackrow.net
attached mail follows:
The thing I want to avoid is using my server's bandwidth. Each member gets a profile and can have a photo referenced from their homepage. I use to allow people to upload photos, but I'm getting close to using my 60GB bandwith limit. The people that have photos on geocities couldn't reference a photo because their servers don't allow remote hosts displaying pictures off their site. Using 'fpassthru' fixed that. However, my next question is if the 'fpassthru' brings the information to my server and then shoots it to the visitor's browser. I know I'm not saving their photos to my server, I just want to make sure I'm not killing my alotted bandwith. Does 'fpassthru' do this? If so, is there another solution?
Thanks for helping me with this.
Joseph
-----Original Message-----
On Thu, 30 Aug 2001, Joseph Bannon wrote:
> What exactly does fpassthru do? Does it download it to my server and then > shoot it to the browser??
For the file pointer on which it operates, it reads the file pointer until EOF and sends the data to STDOUT. It is very much like the 'cat' command in Unix. The file pointer can be to a local or remote file opened with fopen(), or a remote data source opened with fsockopen().
And as always, there's a gem in the docs ... readfile() does the same thing as fpassthru() but doesn't need a file pointer. It just needs a path to a file, so you can eliminate the fopen().
attached mail follows:
On Thu, 30 Aug 2001, Joseph Bannon wrote:
> The thing I want to avoid is using my server's bandwidth. Each member gets a > profile and can have a photo referenced from their homepage. I use to allow > people to upload photos, but I'm getting close to using my 60GB bandwith > limit. The people that have photos on geocities couldn't reference a photo > because their servers don't allow remote hosts displaying pictures off their > site. Using 'fpassthru' fixed that. However, my next question is if the > 'fpassthru' brings the information to my server and then shoots it to the > visitor's browser. I know I'm not saving their photos to my server, I just > want to make sure I'm not killing my alotted bandwith. Does 'fpassthru' do > this? If so, is there another solution?
If the image you're sending to the browser comes from a remote host, unfortunately, yes, that image data does get transferred to your server, and then gets transferred again to the users' browsers. Since PHP is a server-side solution, there isn't a way to skip out on the data transfer to your server and use PHP to send the image. The image data has to come from your server when using PHP. You may have to get creative with HTML, DHTML, etc. to work around displaying the remote images from your site.
~Chris /"\ \ / Pine Ribbon Campaign Microsoft Security Specialist X Against Outlook The moron in Oxymoron. / \ http://www.thebackrow.net
attached mail follows:
Dang it! -lol Any ideas how to get around my problem?
J
attached mail follows:
What if I pass something in the header? Will that work?
Joseph
-----Original Message-----
From: Christopher William Wesley [mailto:cwwesley
udlug.org]
Sent: Thursday, August 30, 2001 1:05 PM
To: PHP (E-mail)
Subject: RE: [PHP] fpassthru (was: fgets)
On Thu, 30 Aug 2001, Joseph Bannon wrote:
> The thing I want to avoid is using my server's bandwidth. Each member gets a > profile and can have a photo referenced from their homepage. I use to allow > people to upload photos, but I'm getting close to using my 60GB bandwith > limit. The people that have photos on geocities couldn't reference a photo > because their servers don't allow remote hosts displaying pictures off their > site. Using 'fpassthru' fixed that. However, my next question is if the > 'fpassthru' brings the information to my server and then shoots it to the > visitor's browser. I know I'm not saving their photos to my server, I just > want to make sure I'm not killing my alotted bandwith. Does 'fpassthru' do > this? If so, is there another solution?
If the image you're sending to the browser comes from a remote host, unfortunately, yes, that image data does get transferred to your server, and then gets transferred again to the users' browsers. Since PHP is a server-side solution, there isn't a way to skip out on the data transfer to your server and use PHP to send the image. The image data has to come from your server when using PHP. You may have to get creative with HTML, DHTML, etc. to work around displaying the remote images from your site.
attached mail follows:
Morning List-
I have a script which gets passed a "fileID" and using that fileID it queries a SQL database and grabs an actual filename and then does a fopen, fpassthru, etc.... I added the header info (application/octet-stream) so it actually downloads the file right away, instead of just displaying the binary content :)
Anways, the filename that shows up in the "Save As" box is the script name from the calling HREF. Is there anyway to get around this and have it display the actual filename?
A) I can't link to the file directly because these files are not stored in web accessible space.
B) I am using Apache 1.3.20 (FreeBSD 4.3) and PHP 4.06 . Need any other info?
Thanks!
Henrik rhavenn at rhavenn.net
attached mail follows:
FYI: Since this may be a problem for others, I did figure it out sort of.
If my script is called: filereturn.php I pass this in my HREF: A HREF="filereturn.php/filename.exe?fileID=3333
I don't know if this is a hack or whatever, but Netscape (NIX and Windoze) and IE on Mac will now save the file as filename.exe vs. filereturn.php IE 5.5 on Windoze will return it as filename and forget the extension.
> Morning List-
>
> I have a script which gets passed a "fileID" and using that fileID it
> queries a SQL database and grabs an actual filename and then does a
> fopen, fpassthru, etc.... I added the header info
> (application/octet-stream) so it actually downloads the file right
> away, instead of just displaying the binary content :)
>
> Anways, the filename that shows up in the "Save As" box is the script
> name from the calling HREF. Is there anyway to get around this and
> have it display the actual filename?
>
> A) I can't link to the file directly because these files are not
> stored in web accessible space.
>
> B) I am using Apache 1.3.20 (FreeBSD 4.3) and PHP 4.06 . Need any
> other info?
>
>
> Thanks!
>
> Henrik
> rhavenn at rhavenn.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
attached mail follows:
Henrik Hudson wrote: > Morning List- > > I have a script which gets passed a "fileID" and using that fileID it > queries a SQL database and grabs an actual filename and then does a fopen, > fpassthru, etc.... I added the header info (application/octet-stream) so it > actually downloads the file right away, instead of just displaying the > binary content :) > > Anways, the filename that shows up in the "Save As" box is the script name > from the calling HREF. Is there anyway to get around this and have it > display the actual filename?
header("Content-Disposition: filename=$filename");
/ franklin
-- Franklin van Velthuizen fvebiris.se +46-(0)70-6786613 Ebiris Applications AB http://www.ebiris.se/ +46-(0)19-109917
attached mail follows:
Is there anyway to determine the pixel width of a string?
attached mail follows:
Oh yeah!
I just had old MySQL manual but I have upgraded MySQL and this function is working in my version, just was not described in docs
Okay, thank you for help, I managed to do it.
> On Wed, 29 Aug 2001 13:58:34 +0200, BRACK (brak
nettaxi.com) wrote: >>
> In article <3B8A1D6A.4295.2947D
localhost>, bodybuilders
comic.com >>
> (Yura) wrote: >> >> > How to sort search results of php-mysql site by
> relevance? >> >> See the mysql manual's chapter on FULLTEXT indexes. >
> >I indexed column 'text' and tried to add "ORDER BY text DESC" in
> >query and deleted wildcards in front of variables but still it
> >doesn't >sort results by number of found words (or parts of words).
> Maybe I >didn't quite understand what to do?
>
> or maybe you didn't look up fulltext indexes :)
>
>
<>< <>< <>< <>< God is our provider ><> ><> ><> ><> http://www.body-builders.org
attached mail follows:
I want to open a particular directory that stores images and I want the images to be added to drop down box, was wondering if someone could help me with some code for that. I want to set it up this way so that people can just upload images there and they would be available on each load of the page.
Jeff
attached mail follows:
I have a page that is for a little recipe database app. On the page where you enter your recipe, there is a set of form fields for ingredients - one line per ingredient, and a couple of fields per (e.g. amount, measurement, ingredient).
I'd like to have say 5-10 ingredient lines in the form by default, but put an "Add More" button next to the last one that will let the user say add 5 more ingredient lines to the form. How can I do this?
The problem for me is that I figure I'd want the Add More button to either do a POST to the same page (and add a parameter indicating the number of ingredient lines to use or something like that), but that the standard form Submit/Add Recipe button would go to a different PHP page that actually inserted the recipe into the database. But, this requires two forms and thus I'd lose the recipe's form variables when hitting one or the other of the buttons.
I've looked around online for solutions to this, but haven't found any. Can someone point me in the right direction?
____
Chris Bailey mailto:chris
codeintensity.com
Code Intensity http://www.codeintensity.com
attached mail follows:
Try looking for javascript solutions. Give them the default 5 and a javascript function that prints out another input variable and dynamically names it. Then you can just normally post at the end. i don't think the javascript is difficult either, and i'm sure you could find a script for it. check dynamicdrive.com hotscripts.com and google.
Jack
Chris Bailey wrote:
> I have a page that is for a little recipe database app. On the page where
> you enter your recipe, there is a set of form fields for ingredients - one
> line per ingredient, and a couple of fields per (e.g. amount, measurement,
> ingredient).
>
> I'd like to have say 5-10 ingredient lines in the form by default, but put
> an "Add More" button next to the last one that will let the user say add 5
> more ingredient lines to the form. How can I do this?
>
> The problem for me is that I figure I'd want the Add More button to either
> do a POST to the same page (and add a parameter indicating the number of
> ingredient lines to use or something like that), but that the standard form
> Submit/Add Recipe button would go to a different PHP page that actually
> inserted the recipe into the database. But, this requires two forms and
> thus I'd lose the recipe's form variables when hitting one or the other of
> the buttons.
>
> I've looked around online for solutions to this, but haven't found any. Can
> someone point me in the right direction?
>
> ____
> Chris Bailey mailto:chris
codeintensity.com
> Code Intensity http://www.codeintensity.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Is there like a syntax hilighting plugin for kdevelop or something? - Dan
--
attached mail follows:
The version of php that I use states that Gif Support is enabled. And in fact I am able to create and display gif images. However when it comes to creating an image from a file the imagecreatefromgif function doesn't seem to work. I'll qualify doesn't work to mean a broken image icon is displayed when I try to use this function. I don't know of a way to display error messages yet.
Also there are no other graphic formats supported in the gd section of my phpinfo() report so I am assuming jpeg, wbmp and png can't be used.
I've read many posts and am aware of the problems with gif support, regarding the fact that gif isn't supported in certain versions of php.
Since I have been able to create gifs using imagecreate() I'm a little puzzled about using imagecreatefromgif()
I also found in the posts the idea of using the fread() function which works well to display my gif. Unfortunately what I want to do is annotate the gif before I display it.
Any comments welcome. Chris
attached mail follows:
Hello everyone!
Crazy question:
I've created a little script that reads in .txt files and, with the help of phplib templates, matches them up with a collection of templates and spits out the beautiful html page.
In order to avoid sending variables through the URL I've stolen this bizarre workaround where, when you call http://www.mysite.com/somepage.html for example, the apache configuration realizes it's a 404 and redirects all 404s through my cms script. Then my script looks for http://www.mysite.com/somepage.txt and does the rest.
This works beautifully, and my plan was to have a "dev" environment that runs against the little CMS system and then wget the whole site periodically for the live server (so, the live site actually *is* a collection of flat pages).
Beautiful plan, but it turns out that WGET doesn't see the apache configuration change that runs all 404s through my CMS script. It sees a 404 and tells me its a 404 and then goes back to its coffee break, you know?
Anyone else tried this workaround before with similar results? Anyone else have a better workaround? Bueller?
Anyway, best, Sondra
attached mail follows:
Hello,
I'd like to find a good web calendar which will allow the general public to enter suggested events into a web calendar. I would want these suggested events to be moderated so that they can be verified.
Does anyone know of a package that would allow this type of moderated public posting? I looked at Webcalendar: http://webcalendar.sourceforge.net/
Which looks great for a number of things, but it doesn't seem to allow moderated anonymous posting.
Suggestions would be appreciated.
Mike
-- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein
attached mail follows:
> I'd like to find a good web calendar which will allow the general public to enter suggested events > into a web calendar. I would want these suggested events to be moderated so that they can be verified. > > Does anyone know of a package that would allow this type of moderated public posting? I looked at > Webcalendar: > http://webcalendar.sourceforge.net/ > > Which looks great for a number of things, but it doesn't seem to allow moderated anonymous posting. > > Suggestions would be appreciated.
Well, the one on php.net is very simple, but it meets those basic requirements. http://www.php.net/cal.php
You can grab the source for it out of cvs. See http://cvs.php.net
-Rasmus
attached mail follows:
Rasmus Lerdorf wrote: > Well, the one on php.net is very simple, but it meets those basic > requirements. http://www.php.net/cal.php
This looks like it would probably work!
> You can grab the source for it out of cvs. See http://cvs.php.net
I couldn't get it from here, but I think I was able to grab the source files for all of the related files..
Mike
-- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein
attached mail follows:
Hmm.. Forms always produced slashed data than I wouldn't have gotten a MySQL error on the ' in O'Neil.. But perhaps it is something on my server..
Andrey Hristov wrote:
> I think that always from a form the script gets slashed data.
>
> Andrey Hristov
> IcyGEN Corporation
> http://www.icygen.com
> 99%
>
> ----- Original Message -----
> From: "Mike Gifford" <mike
openconcept.on.ca>
> To: <php-general
lists.php.net>
> Sent: Wednesday, August 29, 2001 6:58 PM
> Subject: [PHP] Add Slashes - Server Adds Them Automatically - Advice Requested!
>
>
>
>>Hello,
>>
>>I've created a little opensource script:
>>http://openconcept.ca/guide-petition.phtml
>>
>>Which uses addslashes() to help clean up data inserted from a web form.
>>
>>This is fine, except that it appears that you can set up php, so that addslashes are automatically
>>added:
>>
>>"one small thing i noticed was the "addSlashes" issue. it seems like php is
>>sometimes installed (such as on my machine) in such a way that addSlashes
>>AUTOMATICALLY happens and therefore MANUAL addSlashes adds a SECOND,
>>superfluous forward slash."
>>
>>"eg
>>Patrick "the skier" kuharic
>>comes out in invitea friend emails by your system as
>>Patrick \the skier\ kuharic"
>>
>>Has anyone else experienced this? Any suggestions for work arounds?
>>
>>Mike
>>--
>>Mike Gifford, OpenConcept Consulting, http://openconcept.ca
>>Offering everything your organization needs for an effective web site.
>>Abolish Nuclear Weapons Now!: http://pgs.ca/petition/
>>It is a miracle that curiosity survives formal education. - A Einstein
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>>For additional commands, e-mail: php-general-help
lists.php.net
>>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>>
>>
>>
>
-- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein
attached mail follows:
Can anyone think of a way to determine the file size of what the user is uploading before it has been fully uploaded? I know because of security restrictions javascript can't do this, but is it possible in php? I'm trying to make an upload progress bar, it doesn't have to be exact, but a close approximation would be nice.
Thanks, Chris
attached mail follows:
Yes, I use to do this with my site.
# The original name of the file on the client machine. $filename = $HTTP_POST_FILES['file']['name'];
# The mime type of the file, if the browser provided this information. An example would be "image/gif". $filetype = $HTTP_POST_FILES['file']['type'];
# The size, in bytes, of the uploaded file. $filesize = $HTTP_POST_FILES['file']['size']; # The temporary filename of the file in which the uploaded file was stored on the server. $filetemp = $HTTP_POST_FILES['file']['tmp_name'];
attached mail follows:
<Original message>
From: christopher johnson <chrisj
thecyberpunk.com>
Date: Thu, Aug 30, 2001 at 12:47:00PM -0500
Message-ID: <20010830183748.85476.qmail
pb1.pair.com>
Subject: [PHP] file upload size, before upload complete
> Can anyone think of a way to determine the file size of what the user is > uploading before it has been fully uploaded? > I know because of security restrictions javascript can't do this, but is it > possible in php? > I'm trying to make an upload progress bar, it doesn't have to be exact, but > a close approximation would be nice. > > Thanks, > Chris
</Original message>
<Reply>
Not possible. You first have to submit the form before the PHP starts. And then it's too late, 'cause at the moment you submit the form, the files are already being uploaded. You should really have a client-side solution for this (if there is any).
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
I've got a website, we'll call it MainDomain.com.
I created a specialty site in a sub-directory. We'll call the sub-directory Widgets.
I want a different domain to point to that sub directory. We'll call the new domain WidgetWorld.com
My webhost will allow me to park WidgetWorld.com at MainDomain.com. However, if someone goes to WidgetWorld.com, it would pull up the index page for MainDomain.com.
How can I use PHP to detect if the visitor wanted MainDomain.com (and display MainDomain/index.php) or WidgetWorld.com (and then display MainDomain/Widgets/index.php).
Thanks, Jeff Gannaway ___________________________________________________________
Find the right art print for your home. * Search by artist, color, art style and subject. * Preview the art prints against your wall color. * Specializing in contemporary, abstract and African American art. * Every day discounts on thousands of fine art prints.
PopStreet.com is your avenue to art.
http://www.popstreet.com ___________________________________________________________
attached mail follows:
> How can I use PHP to detect if the visitor wanted MainDomain.com (and > display MainDomain/index.php) or WidgetWorld.com (and then display > MainDomain/Widgets/index.php).
I *believe* what you are looking for is $HTTP_HOST.
Chris
attached mail follows:
I have been doing some amateur web-design by now, but I decided to learn something like php. I was wondering if there is a way to test php code without a server(on local computer).
Thanx in advance
Nikola Veber
attached mail follows:
Sure, you should just (for Windows) download the Apache web server for windows, and get the PHP for windows off of php.net. Then you can run a 'local' server that processes your PHP code. Or do the same for a Unix machine...
-- Patrick Calkins OEMSupport.Com, Inc. ** please remove the _ to reply ** "Nikola Veber" <veberptt.yu> wrote in message news:200108301818.f7UIIrS18599
pop33.ptt.yu... > I have been doing some amateur web-design by now, but I decided to learn > something like php. I was wondering if there is a way to test php code without a > server(on local computer). > > Thanx in advance > > Nikola Veber > >
attached mail follows:
Sure, you can test PHP code without running any servers. Run PHP as follows:
php.exe my_test.php
----- Original Message -----
From: "Nikola Veber" <veber
ptt.yu>
To: "php forum" <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 12:18 PM
Subject: [PHP] begginer needs help
> I have been doing some amateur web-design by now, but I decided to learn
> something like php. I was wondering if there is a way to test php code
without a
> server(on local computer).
>
> Thanx in advance
>
> Nikola Veber
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Hello,
James wrote: > Regarding a database abstraction package: does Metabase handle all > "standard" SQL constructs (as opposed to vendor-specific SQL extensions)? > The GUI applications to be ported were built with JAM, which basically > provides an abstraction layer via its JPL language. JPL has not been > restrictive in terms of required functionality, nor was there any real > performance hits. Can the same be said of Metabase? Also, would Metabase > present a significant learning curve for experienced C and SQL programmers? > > I will download PostgreSQL and check it out.
Metabase does much more than you probably may want. Basically you can just submit any queries to the database server. Metabase doesn't touch them. What it does is when you are composing your queries with constant values, it may convert the respective data type values from a database independent data type set to the target database data types.
Let's say you have strings or date constant values. Each database may have different ways to escape strings or format dates. Metabase provides functions to do that translation if you want to use direct queries. I you want to use prefered queries, with placeholders ( ? ) in the queries that are replace with constant values when the queries are executed, the functions to set those values perform the translations for you.
For retrieving result data returned by SELECT queries, Metabase also provides functions to translate the data to a database independent format, so in your applications you only have to handle one universal format that you do not need to adapt if you decide to switch to your database backend.
That is not all. Metabase also provides unique features, that are very important for Web programming, all in a database independent way. One is the ability to create and access to database sequence objects. Sequences are objects that can generate sequential integer unique numbers. They are often used to generate id values for table primary keys. Sequence number generation is guaranteed to be atomic, so it is adequate for environments where many users access the database concurrently, like the Web. Sequences are implemented with real sequence objects in databases that support it like Oracle and Postgres, but others that don't support real sequence objects are emulated with tables with a single auto-incremented integer field.
Another important feature is the ability for Web programming is the ability to limit the range of rows that are returned from a select query, like MySQL LIMIT clause, but in a way that is supported by all databases supported by Metabase. This is great to let you develop applications that display query results split in multiple pages if they have too many rows.
Metabase is not also good for develop applications to access databases. It is also able to install databases for you creating tables, fields, indexes and sequence from a database independent schema description defined in a specific XML format. Also, if later you need to change your database schema, all you need to do is change the schema description XML file. Metabase manager is able to figure the differences between the new and the previously installed schema and then it just alters the database without affecting the data that was stored after the database was installed for the first time or changed for the last time. This saves you toons of hours and maintenance headache.
Metabase is easy to learn. In the site there is a tutorial document that get you started real quick. If you need further help, you may join to the Metabase development mailing list that is listed in the Metabase page links sections. Look also in the database section of the PHP Classes site for components ready to use with Metabase.
Regards, Manuel Lemos
attached mail follows:
Hello I'm trying to use imap_search to retrieve the all the post after a given date and then put them into a mysql DB. I don't know if this is the best way to do it.
$searchstr = "SINCE Thu, 30 Aug 2001 12:05:49 +0200"; $search = imap_search($nntp, $searchstr, SE_UID);
This should give me a array of all the post after the date in $searchstr, but instead it gives me all the posts in the newsgroup.
Is there anyone that can help me? Thank you
Shimon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]