php-general Digest 8 Feb 2001 04:18:52 -0000 Issue 499 Topics (messages 38555 through 38669): Re: Odd question regarding creating a php file 38555 by: Steve Werby Re: Hide PHP from web server header [was: PHP - CGI Version] 38556 by: Steve Werby Re: Com 38557 by: Vora Vor newbie mail() function 38558 by: Angerer, Chad 38560 by: Steve Werby 38561 by: Jon Haworth 38562 by: April 38564 by: Angerer, Chad 38565 by: Steve Werby string vs. integer... 38559 by: Julia A . Case 38567 by: Steve Werby Earn $235 - $760 Or More Weekly At Home In Your Spare Time 38563 by: Income Opportunity Re: MS SQL Question 38566 by: Wieger Uffink 38570 by: Frank M. Kromann 38588 by: Foley, John Re: HTTP Authentication 38568 by: Shane McBride PHP as Scripting Language 38569 by: John Huggins 38573 by: Shane McBride 38576 by: Frank Joerdens 38582 by: John Huggins 38601 by: Michael Dearman Sum from Arrays ? 38571 by: Keith Whyman 38574 by: Shane McBride 38575 by: Keith Whyman 38577 by: Philip Olson 38580 by: Reuben D Budiardja PHP4 Changelog 38572 by: TV Karthick Kumar OCI* function VS. ORA* function 38578 by: Reuben D Budiardja 38581 by: Sebastian Stadtlich Re: what is ::? 38579 by: John Donagher html -echo-print 38583 by: Christopher Allen 38587 by: JB 38591 by: Philip Olson 38592 by: Jeff Oien 38594 by: Philip Olson 38595 by: JB 38597 by: Christopher Allen DSO security 38584 by: Gabor Gludovatz 38619 by: Christian Reiniger reg-ex problem 38585 by: Lee Stretton 38593 by: CC Zona 38606 by: Michael Dearman 38620 by: Christian Reiniger Re: Access a printer via PHP 38586 by: Foley, John Moving files between 2 servers?? 38589 by: Michael Geary Re: parent constructor 38590 by: Aaron Tuller 38609 by: John Donagher unlink(); in windows? 38596 by: Brandon Orther 38598 by: Brian Clark PHP Newbie, Experienced Porgrammer, Annoying fread() problem 38599 by: John Vanderbeck 38600 by: James Moore 38603 by: Brian Clark Getting ASPELL to work? 38602 by: Nicholas Pappas 38604 by: Brian Clark 38605 by: Sam Masiello 38618 by: Jonathan Sharp Re: PHP - CGI Version 38607 by: Tim Livers Re: Where to put the include() 38608 by: Anna content retrieval from mp3.com band pages - need help 38610 by: MysterioZ TronSonic Re: Name of Class' instance 38611 by: Boget, Chris Is it server Push? 38612 by: Thomas Deliduka 38627 by: Alexander Wagner 38630 by: Thomas Deliduka Re: Hosting in UK 38613 by: John McCreesh Unlink for windows? 38614 by: Brandon Orther ? for the Reg Ex people 38615 by: Jason Bryner 38617 by: James, Yz 38621 by: Christian Reiniger Searching MySQL tables with LIKE 38616 by: James, Yz Sorting LDAP Entries - Please Help 38622 by: Jason Mowat problems with writing picture to the database. 38623 by: Siim Einfeldt aka Itpunk 38635 by: Mark Maggelet List of all file extensions 38624 by: Tobias Talltorp 38628 by: Alexander Wagner 38636 by: Tobias Talltorp 38637 by: Josh G 38639 by: Alexander Wagner 38640 by: Philip Olson 38641 by: Tobias Talltorp ereg everything 38625 by: Matthew Ley question about PHP use 38626 by: Don 38629 by: Cal Evans 38632 by: JB 38634 by: Alexander Wagner base dir 38631 by: Brandon Orther 38638 by: Martin A. Marques new release : phpdoc v2.0 38633 by: Christian Calloway APC install problems 38642 by: Joseph H Blythe 38647 by: Christian Reiniger 38655 by: Joseph H Blythe PHP with Oracle 38643 by: Nguyen, David M MSSQL Functions 38644 by: Toby Miller Re: [PHP-WIN] MSSQL Functions 38645 by: Flint Doungchak 38648 by: Frank M. Kromann Variable quantity chooser. 38646 by: David VanHorn Re: Ethics question... 38649 by: Michael A. Peters Confirmación 38650 by: Andrés de la Varga Re: Indexing Engine 38651 by: Brian White PHP && mySQL 38652 by: PHP user Sessions and SSL 38653 by: Jeffrey A Schoolcraft 38656 by: Chris Lee Creating Directorys (slightlyOT) 38654 by: Website4S.aol.com mail/sendmail lmitations? 38657 by: Dave VanAuken sessions & javascript problem 38658 by: Matthew Delmarter Compiling php?? 38659 by: GAYTAN BAHAMONDEZ DANIEL EDUARDO 38665 by: David Robley UN-Escaping text from a form submit? 38660 by: John Vanderbeck 38661 by: Mark Green 38662 by: David Robley 38663 by: Jason Murray 38664 by: John Vanderbeck Super SQL problem! Please advise! 38666 by: Sandeep Hundal test for undefined variables & renaming variables 38667 by: August Malson 38669 by: John Vanderbeck PHP & HTACCESS 38668 by: Sefton Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
"Dusten" <[EMAIL PROTECTED]> wrote: > In reply to Chris. The reason I'm having this page created is because people > will need to be able to see this person's "win/loss" record. I have a script > that displays all of the ppl registered and when you view their page, you > can get a real time report on their ratings. As another alternative: I could > pass the variables into a 'template' page and create it from there, but I > didn't want all my links to be buttons with hidden variables in them. I hope > I cleared that up. So essentially what you're doing is taking data from a database and building static pages based on this data as events occur? One alternative is to pull the webpage contents directly from a database in realtime. Another is to do the same, but cache the webpages and only pull from the database if a query condition is met or the timestamp on the cache is older than an acceptable age. Your method takes extra storage space, probably doesn't easily allow for the presentation of the pages to be changed and involves a disk write on top of a database query. If you don't want to pass hidden variables or variables in the URL query string then if you have Apache you can use its rewrite capability to create "virtual" webpages. For example, see my site http://www.sexcriminals.com/. All of the pages under "Sex Offender Registries", "News Articles", "Books", and "Useful Sites" are pulled from a MySQL database and are being handled by a single PHP script that Apache is directing all web accesses to and which parses the URL to determine what content to show. Maybe something like this would work for you. Then each person would have a unique static-appearing page. -- Steve Werby COO 24-7 Computer Services, LLC Tel: 804.817.2470 http://www.247computing.com/
"Tim Livers" <[EMAIL PROTECTED]> wrote: > Everything works fine except that I get "X-Powered-By: PHP/4.0.4pl1 > Content-type: text/html #!/usr/local/bin/php" at the top of the page. 1. In php.ini, set "expose_php = Off" 2. Restart Apache. -- Steve Werby COO 24-7 Computer Services, LLC Tel: 804.817.2470 http://www.247computing.com/
yes. it is all very clear to me now. however self-evident it appears to me now, imagine my disconcertation when i was in ignorance! this is so self-evident, it didn't need to be documented. Com shows up in searches about launching external apps on the client, thus i was nefariously misled by my eagerness and general enslavement to impending authorities. vora ----- Original Message ----- From: "Jonathan Sharp" <[EMAIL PROTECTED]> To: "Vora Vor" <[EMAIL PROTECTED]> Sent: Tuesday, February 06, 2001 6:17 PM Subject: RE: [PHP] Com > Are you trying to access a Windows COM object on a Linux box? > > -codeboy > > > -----Original Message----- > > From: Vora Vor [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, February 06, 2001 10:08 AM > > To: php > > Subject: [PHP] Com > > > > > > "Fatal error: Cannot instantiate non-existent class: com in > > /var/www/html/version2/file.php on line 8" > > is the result of running the following code: > > > > <? > > $word=new COM("word.application") or die("Cannot start word"); > > print "Loaded word version ($word->Version)\n"; > > $word-visible =1 ; > > ?> > > > > Why? > > > > > >
Hello! I am very new to php programming. I have been experimenting around with php's mail function and html forms. I have a generic HTML form with user_name, email_address, comments, and like_site as inputs on the HTML form. I have the following code in a seperate php file which the form calls: <?php $msg = "Sender's Full Name:\t$user_name\n"; $msg .= "Sender's Email Address:\t$email_address\n"; $msg .= "User Comments:\t$comments\n"; $msg .= "Did you like the site?\t$like_site\n\n"; $mailheaders = "From: My Web Site\n" 9>$mailheaders .= "Reply-To: $email_address\n\n"; mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); echo ("Thank you $user_name\n<br>"); echo ("I appreciate your feedback\n\n"); ?> for some reason I get a parse error on line 9. If I remove the mailheaders variables the PHP script works just fine and emails the form to the correct address. Any help on this would be appreciated. It is probably something qyite simple. I just don't see it though. Thanks. Chad
"Angerer, Chad" <[EMAIL PROTECTED]> wrote: > $mailheaders = "From: My Web Site\n" > 9>$mailheaders .= "Reply-To: $email_address\n\n"; > > mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); > > echo ("Thank you $user_name\n<br>"); > echo ("I appreciate your feedback\n\n"); > > ?> > > for some reason I get a parse error on line 9. If I remove the mailheaders > variables the PHP script works Oops! You're missing the semicolon ";" at the end of line 8. Problem solved. -- Steve Werby COO 24-7 Computer Services, LLC Tel: 804.817.2470 http://www.247computing.com/
You're missing a semicolon on line 8. HTH Jon -----Original Message----- From: Angerer, Chad [mailto:[EMAIL PROTECTED]] Sent: 07 February 2001 16:37 To: [EMAIL PROTECTED] Subject: [PHP] newbie mail() function Hello! I am very new to php programming. I have been experimenting around with php's mail function and html forms. I have a generic HTML form with user_name, email_address, comments, and like_site as inputs on the HTML form. I have the following code in a seperate php file which the form calls: <?php $msg = "Sender's Full Name:\t$user_name\n"; $msg .= "Sender's Email Address:\t$email_address\n"; $msg .= "User Comments:\t$comments\n"; $msg .= "Did you like the site?\t$like_site\n\n"; $mailheaders = "From: My Web Site\n" 9>$mailheaders .= "Reply-To: $email_address\n\n"; mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); echo ("Thank you $user_name\n<br>"); echo ("I appreciate your feedback\n\n"); ?> for some reason I get a parse error on line 9. If I remove the mailheaders variables the PHP script works just fine and emails the form to the correct address. Any help on this would be appreciated. It is probably something qyite simple. I just don't see it though. Thanks. Chad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Your ''s in your strings are the problem. They need to be escaped, or they will create a parse error. Instead of $msg = "Sender's Full Name:\t$user_name\n"; you should have > $msg = "Sender\'s Full Name:\t$user_name\n"; ----- Original Message ----- From: "Angerer, Chad" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 07, 2001 10:36 AM Subject: [PHP] newbie mail() function > Hello! > > I am very new to php programming. I have been experimenting around with > php's mail function and html forms. > > I have a generic HTML form with user_name, email_address, comments, and > like_site as inputs on the HTML > form. I have the following code in a seperate php file which the form calls: > > <?php > > $msg = "Sender's Full Name:\t$user_name\n"; > $msg .= "Sender's Email Address:\t$email_address\n"; > $msg .= "User Comments:\t$comments\n"; > $msg .= "Did you like the site?\t$like_site\n\n"; > > $mailheaders = "From: My Web Site\n" > 9>$mailheaders .= "Reply-To: $email_address\n\n"; > > mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); > > echo ("Thank you $user_name\n<br>"); > echo ("I appreciate your feedback\n\n"); > > ?> > > for some reason I get a parse error on line 9. If I remove the mailheaders > variables the PHP script works > just fine and emails the form to the correct address. Any help on this > would be appreciated. > > It is probably something qyite simple. I just don't see it though. > > Thanks. > > Chad > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
d'oh! I knew it was something simple. Thanks -----Original Message----- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 07, 2001 10:42 AM To: 'Angerer, Chad'; '[EMAIL PROTECTED]' Subject: RE: [PHP] newbie mail() function You're missing a semicolon on line 8. HTH Jon -----Original Message----- From: Angerer, Chad [mailto:[EMAIL PROTECTED]] Sent: 07 February 2001 16:37 To: [EMAIL PROTECTED] Subject: [PHP] newbie mail() function Hello! I am very new to php programming. I have been experimenting around with php's mail function and html forms. I have a generic HTML form with user_name, email_address, comments, and like_site as inputs on the HTML form. I have the following code in a seperate php file which the form calls: <?php $msg = "Sender's Full Name:\t$user_name\n"; $msg .= "Sender's Email Address:\t$email_address\n"; $msg .= "User Comments:\t$comments\n"; $msg .= "Did you like the site?\t$like_site\n\n"; $mailheaders = "From: My Web Site\n" 9>$mailheaders .= "Reply-To: $email_address\n\n"; mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); echo ("Thank you $user_name\n<br>"); echo ("I appreciate your feedback\n\n"); ?> for some reason I get a parse error on line 9. If I remove the mailheaders variables the PHP script works just fine and emails the form to the correct address. Any help on this would be appreciated. It is probably something qyite simple. I just don't see it though. Thanks. Chad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
"April" <[EMAIL PROTECTED]> wrote: > Your ''s in your strings are the problem. They need to be escaped, or they > will create a parse error. Not true. They (quotes inside a string) only need to be escaped if they are the same style as the quotes enclosing the string. And for those that don't know what "escaping" is it means prefixing them with a backslash (\). So if you enclose a string in double quotes single double quotes must be escaped and if you enclose a string in single quotes single quotes in the string must be escaped. And enclosing a string in single quotes has a different effect than enclosing in in double quotes. See a post I made yesterday about this or search the archives for more details. > Instead of > $msg = "Sender's Full Name:\t$user_name\n"; > you should have > > $msg = "Sender\'s Full Name:\t$user_name\n"; It doesn't hurt to make the change above, but it doesn't help with the actual problem (missing semicolon). -- Steve Werby COO 24-7 Computer Services, LLC Tel: 804.817.2470 http://www.247computing.com/
How do I detrmine of a value is a string or a integer? I'm trying to tell the differnce between "machine.domain.com" and "192.168.2.1" I was going to explode on "." and parse through the data and validate it. Julia -- [ Julia Anne Case ] [ Ships are safe inside the harbor, ] [Programmer at large] [ but is that what ships are really for. ] [ Admining Linux ] [ To thine own self be true. ] [ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
"Julia A . Case" <[EMAIL PROTECTED]> wrote: > How do I detrmine of a value is a string or a integer? I'm trying to > tell the differnce between "machine.domain.com" and "192.168.2.1" I was > going to explode on "." and parse through the data and validate it. is_numeric(), is_string() -- Steve Werby COO 24-7 Computer Services, LLC Tel: 804.817.2470 http://www.247computing.com/
Earn $235 - $760 Or More Weekly Home Workers Needed Nationwide Hundreds of companies are currently looking for telecommuters. There is no experience needed and you can start right away. This is NOT your average get-rich-quick program. In fact, none of the companies require any special fees to get started. Many offer free training. Start earning money in your spare time. You set the hours, you decide how much you want to make. Email [EMAIL PROTECTED] with "Work At Home" in the subject heading for complete details. Best Wishes Home Workers Directory P.S. Opportunity available only to U.S. Residents over the age of 18. Home Workers Needed Nationwide Hundreds of companies are currently looking for telecommuters. There is no experience needed and you can start right away. This is NOT your average get-rich-quick program. In fact, none of the companies require any special fees to get started. Many offer free training. Start earning money in your spare time. You set the hours, you decide how much you want to make. Email [EMAIL PROTECTED] subject heading for complete details. Best Wishes Home Workers Directory P.S. Opportunity available only to U.S. Residents over the age of 18.
Hi Ryan, You could try REPLACE INTO in combination with a select from the second table, instead of UPDATE. For the exact syntax see http://www.mysql.com/doc/R/E/REPLACE.html Maybe you can fit it to your needs. Wieger "Conover, Ryan" wrote: > > I am trying to update a table with data from another table within the same > database with the following SQL > > UPDATE common SET common.[Extended Description] = extended.[Extended > Description] WHERE common.[id] = extended.[Extended Description] > > the id is the primary key. I keep getting the following error. > > Server: Msg 107, Level 16, State 3, Line 1 > The column prefix 'extended' does not match with a table name or alias name > used in the query. > Server: Msg 107, Level 16, State 1, Line 1 > The column prefix 'extended' does not match with a table name or alias name > used in the query. > > Anyone have any ideas. > > Ryan > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
The table "extended" is not known to the update command. You shoud use a syntax like this: UPDATE table1 SET table1.field1 = (select field2 from table2 where table2.id=table1.id). - Frank >I am trying to update a table with data from another table within the same >database with the following SQL > >UPDATE common SET common.[Extended Description] = extended.[Extended >Description] WHERE common.[id] = extended.[Extended Description] > >the id is the primary key. I keep getting the following error. > >Server: Msg 107, Level 16, State 3, Line 1 >The column prefix 'extended' does not match with a table name or alias name >used in the query. >Server: Msg 107, Level 16, State 1, Line 1 >The column prefix 'extended' does not match with a table name or alias name >used in the query. > > >Anyone have any ideas. > > >Ryan > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > >
The table or view "extended" does not exist in the declared database context. If this table or view is in another database on the same server, use database.table.column (not sure about exact syntax here) John T. Foley Network Administrator Pollak Engineered Products, Actuator Products Division, A Stoneridge Company 195 Freeport Street, Boston MA 02122 ph: (617) 474-7266 fax: (617) 282-9058 The geographical center of Boston is in Roxbury. Due north of the center we find the South End. This is not to be confused with South Boston which lies directly east from the South End. North of the South End is East Boston and southwest of East Boston is the North End. > -----Original Message----- > From: Conover, Ryan [SMTP:[EMAIL PROTECTED]] > Sent: Wednesday, February 07, 2001 10:26 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: MS SQL Question > > I am trying to update a table with data from another table within the same > database with the following SQL > > UPDATE common SET common.[Extended Description] = extended.[Extended > Description] WHERE common.[id] = extended.[Extended Description] > > the id is the primary key. I keep getting the following error. > > Server: Msg 107, Level 16, State 3, Line 1 > The column prefix 'extended' does not match with a table name or alias > name > used in the query. > Server: Msg 107, Level 16, State 1, Line 1 > The column prefix 'extended' does not match with a table name or alias > name > used in the query. > > > Anyone have any ideas. > > > Ryan
Nick, I'm not sure were you are getting the value of $PHP_AUTH_USER from, so you might want to try this snippet. This causes a dialog box to open and ask for a username/password. Also, in your code: you do not need to escape the quotes in the header. <? // Check to see if $PHP_AUTH_USER already contains info if (!isset($PHP_AUTH_USER)) { // If empty, send header causing dialog box to appear header('WWW-Authenticate: Basic realm="Whatever You want to say"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required!'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER !="abc") || ($PHP_AUTH_PW !="123")) { header('WWW-Authenticate: Basic realm="Whatever You want to say"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required!'; exit; } else { // Start echo statement echo "hello"; } } ?> ----- Original Message ----- From: "Nick Kostirya" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 07, 2001 10:27 AM Subject: [PHP] HTTP Authentication > Hi, all. > HTTP Authentication in PHP 4 - Apache don't work!!! > Help me. > Best. > __________________________________________________ > <?php > if(!isset($PHP_AUTH_USER)) { > Header("WWW-Authenticate: Basic realm=\"My Realm\""); > Header("HTTP/1.0 401 Unauthorized"); > echo "Text to send if user hits Cancel button\n"; > exit; > } else { > echo "Hello $PHP_AUTH_USER.<P>"; > echo "You entered $PHP_AUTH_PW as your password.<P>"; > } > ?> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Well, I have compiled a php binary for use as yet another scripting language to work along side AWK, Perl, Sh, etc. It works too. I have this file... #!/usr/local/bin/php <? print("Hello World\n"); ?> I run it and get.. host:~/projects/PHPScripts # ./test.php Content-type: text/html Hello World Great. Now how do I get rid of the Content-type line? I have searched the docs with little clues. Thanks for your help. ******************************************* John Huggins Transmitter Location Systems, LLC 14120 Parke Long Court, 103 Chantilly, Virginia 20151 703-227-8435 703-968-8808 fax [EMAIL PROTECTED] http://www.tls2000.com/
This is just a guess, but remove the path (#!/usr/local/bin/php) If you have the php.ini and (I'm assuming Apache) the httpd.conf file configured you shouldn't need it. I never have used it. It looks like the Perl way to script... :) DISCLAIMER: I am by no means well-versed in this, or any other, topic.... - Shane ----- Original Message ----- From: "John Huggins" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 07, 2001 12:10 PM Subject: [PHP] PHP as Scripting Language > > Well, I have compiled a php binary for use as yet another scripting language > to work along side AWK, Perl, Sh, etc. > > It works too. I have this file... > > > #!/usr/local/bin/php > <? > print("Hello World\n"); > ?> > > > I run it and get.. > > > > > host:~/projects/PHPScripts # ./test.php > Content-type: text/html > > Hello World > > > > Great. Now how do I get rid of the Content-type line? I have searched the > docs with little clues. > > Thanks for your help. > > > > ******************************************* > John Huggins > > Transmitter Location Systems, LLC > 14120 Parke Long Court, 103 > Chantilly, Virginia 20151 > 703-227-8435 > 703-968-8808 fax > [EMAIL PROTECTED] > http://www.tls2000.com/ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
On Wed, Feb 07, 2001 at 12:10:46PM -0500, John Huggins wrote: [ . . . ] > > host:~/projects/PHPScripts # ./test.php > Content-type: text/html > > Hello World > > > > Great. Now how do I get rid of the Content-type line? I have searched the > docs with little clues. #!/usr/local/bin/php -q Is what you do. Annoyingly, though, this does not work if you use PHP this way for CGI Programming . . . Regards, Frank
Nailed it!!! Thanks!!!! -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 07, 2001 12:39 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP as Scripting Language Usage: php [-q] [-h] [-s] [-v] [-i] [-f <file>] | {<file> [args...]} -q Quiet-mode. Suppress HTTP Header output. -s Display colour syntax highlighted source. -f<file> Parse <file>. Implies `-q' -v Version number -p Pretokenize a script (creates a .php3p file) -e Execute a pretokenized (.php3p) script -c<path> Look for php3.ini file in this directory -i PHP information -h This help John Huggins wrote: Well, I have compiled a php binary for use as yet another scripting languageto work along side AWK, Perl, Sh, etc.It works too. I have this file...#!/usr/local/bin/php<?print("Hello World\n");?>I run it and get..host:~/projects/PHPScripts # ./test.phpContent-type: text/htmlHello WorldGreat. Now how do I get rid of the Content-type line? I have searched thedocs with little clues.Thanks for your help.*******************************************John HugginsTransmitter Location Systems, LLC14120 Parke Long Court, 103Chantilly, Virginia 20151703-227-8435703-968-8808 [EMAIL PROTECTED]http://www.tls2000.com/
John Huggins wrote: > > Well, I have compiled a php binary for use as yet another scripting language > to work along side AWK, Perl, Sh, etc. > > It works too. I have this file... > > #!/usr/local/bin/php > <? > print("Hello World\n"); > ?> > > I run it and get.. > > host:~/projects/PHPScripts # ./test.php > Content-type: text/html > Steve Werby had this solution for a previous post on the same problem. MD -------------------------------- From: "Steve Werby" <[EMAIL PROTECTED]> To: "Tim Livers" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> "Tim Livers" <[EMAIL PROTECTED]> wrote: > Everything works fine except that I get "X-Powered-By: PHP/4.0.4pl1 > Content-type: text/html #!/usr/local/bin/php" at the top of the page. 1. In php.ini, set "expose_php = Off" 2. Restart Apache. > Hello World > > Great. Now how do I get rid of the Content-type line? I have searched the > docs with little clues. > > Thanks for your help. > > ******************************************* > John Huggins > > Transmitter Location Systems, LLC > 14120 Parke Long Court, 103 > Chantilly, Virginia 20151 > 703-227-8435 > 703-968-8808 fax > [EMAIL PROTECTED] > http://www.tls2000.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
It's probably a stupid question but........... I've got the following ; SELECT t_category_name COUNT(*) AS count FROM t_city,t_zipcodecity,t_location,t_category , t_locationcategory WHERE (t_category_id_category = t_locationcategory_id_category) AND (t_location_id_location = t_locationcategory_id_location) AND (t_zipcodecity_zipcode = t_location_zipcode) AND (t_city_id_city = t_zipcodecity_id_city) AND (t_city_id_city = 1) AND ((t_location_sex = 4) OR (t_location_sex = 0)) GROUP BY t_category_name"; $result1 = mysql_db_query(DBWEB, $query); print mysql_error(); echo " <TABLE width=\"100%\"> "; if ($result1) { while ($r = mysql_fetch_array($result1)) { $numbers = $r["count"]; $names =$r["$t_category_name"]; And what I want is a total for my count - I think it something to do with the mySQL sum funktion but I've got a bit stuck !
Hum, maybe the count() function. Works with mysql_fetch_array() too. Here's a sample: $a[0] = 1; $a[1] = 3; $a[2] = 5; $result = count ($a); //$result == 3 Here's a link: http://php.net/manual/en/function.count.php DISCLAIMER: I am by no means well-versed in this, or any other, topic.... - Shane ----- Original Message ----- From: "Keith Whyman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 07, 2001 12:15 PM Subject: [PHP] Sum from Arrays ? > It's probably a stupid question but........... > I've got the following ; > > SELECT t_category_name COUNT(*) AS count > FROM t_city,t_zipcodecity,t_location,t_category , t_locationcategory > WHERE (t_category_id_category = t_locationcategory_id_category) > AND (t_location_id_location = t_locationcategory_id_location) > AND (t_zipcodecity_zipcode = t_location_zipcode) > AND (t_city_id_city = t_zipcodecity_id_city) > AND (t_city_id_city = 1) > AND ((t_location_sex = 4) OR (t_location_sex = 0)) > GROUP BY t_category_name"; > > $result1 = mysql_db_query(DBWEB, $query); > print mysql_error(); > echo " > <TABLE width=\"100%\"> > "; > if ($result1) { > > > while ($r = mysql_fetch_array($result1)) { > $numbers = $r["count"]; > $names =$r["$t_category_name"]; > > And what I want is a total for my count - I think it something to do with > the mySQL sum funktion but I've got a bit stuck ! > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
No I've explained this badly I've got the array $a what I want is a sum of what's in the array ie from your sample the answer would be 1+3+5 = 9 Thanks Keith > Hum, maybe the count() function. Works with mysql_fetch_array() too. Here's > a sample: > $a[0] = 1; > $a[1] = 3; > $a[2] = 5; > $result = count ($a); > //$result == 3 > > Here's a link: > http://php.net/manual/en/function.count.php > DISCLAIMER: I am by no means well-versed in this, or any other, topic.... > - Shane > > ----- Original Message ----- > From: "Keith Whyman" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, February 07, 2001 12:15 PM > Subject: [PHP] Sum from Arrays ? > > > > It's probably a stupid question but........... > > I've got the following ; > > > > SELECT t_category_name COUNT(*) AS count > > FROM t_city,t_zipcodecity,t_location,t_category , t_locationcategory > > WHERE (t_category_id_category = t_locationcategory_id_category) > > AND (t_location_id_location = t_locationcategory_id_location) > > AND (t_zipcodecity_zipcode = t_location_zipcode) > > AND (t_city_id_city = t_zipcodecity_id_city) > > AND (t_city_id_city = 1) > > AND ((t_location_sex = 4) OR (t_location_sex = 0)) > > GROUP BY t_category_name"; > > > > $result1 = mysql_db_query(DBWEB, $query); > > print mysql_error(); > > echo " > > <TABLE width=\"100%\"> > > "; > > if ($result1) { > > > > > > while ($r = mysql_fetch_array($result1)) { > > $numbers = $r["count"]; > > $names =$r["$t_category_name"]; > > > > And what I want is a total for my count - I think it something to do with > > the mySQL sum funktion but I've got a bit stuck ! > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > >
As of PHP 4.0.4 the function array_sum() exists (it's undocumented, but in changelog), it's used as such : $array = array(1,3,5); $sum = array_sum($array); Or loop through array as such : foreach ($array as $value) { $sum += $value; } Either way, $sum now equals 9. For info on how all the above works, see : http://www.php.net/manual/en/control-structures.foreach.php http://php.net/ChangeLog-4.php http://www.php.net/manual/en/language.operators.assignment.php Regards, Philip Olson http://www.cornado.com/ On Wed, 7 Feb 2001, Keith Whyman wrote: > No I've explained this badly > I've got the array $a what I want is a sum of what's in the array > ie from your sample the answer would be 1+3+5 = 9 > > Thanks > Keith > > > > Hum, maybe the count() function. Works with mysql_fetch_array() too. > Here's > > a sample: > > $a[0] = 1; > > $a[1] = 3; > > $a[2] = 5; > > $result = count ($a); > > //$result == 3 > > > > Here's a link: > > http://php.net/manual/en/function.count.php > > DISCLAIMER: I am by no means well-versed in this, or any other, topic.... > > - Shane > > > > ----- Original Message ----- > > From: "Keith Whyman" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, February 07, 2001 12:15 PM > > Subject: [PHP] Sum from Arrays ? > > > > > > > It's probably a stupid question but........... > > > I've got the following ; > > > > > > SELECT t_category_name COUNT(*) AS count > > > FROM t_city,t_zipcodecity,t_location,t_category , t_locationcategory > > > WHERE (t_category_id_category = t_locationcategory_id_category) > > > AND (t_location_id_location = t_locationcategory_id_location) > > > AND (t_zipcodecity_zipcode = t_location_zipcode) > > > AND (t_city_id_city = t_zipcodecity_id_city) > > > AND (t_city_id_city = 1) > > > AND ((t_location_sex = 4) OR (t_location_sex = 0)) > > > GROUP BY t_category_name"; > > > > > > $result1 = mysql_db_query(DBWEB, $query); > > > print mysql_error(); > > > echo " > > > <TABLE width=\"100%\"> > > > "; > > > if ($result1) { > > > > > > > > > while ($r = mysql_fetch_array($result1)) { > > > $numbers = $r["count"]; > > > $names =$r["$t_category_name"]; > > > > > > And what I want is a total for my count - I think it something to do > with > > > the mySQL sum funktion but I've got a bit stuck ! > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Try this: for($i=0;$i < count($the_array); $i++) $sum = $sum + $the_array[$i]; or if the index of your array is not in order, try this: while($element = array_pop($the_array)) $sum = $sum + $element; Hope that helps. Rdb At 06:38 PM 2/7/01 +0100, you wrote: >No I've explained this badly >I've got the array $a what I want is a sum of what's in the array >ie from your sample the answer would be 1+3+5 = 9 > >Thanks >Keith > > > > Hum, maybe the count() function. Works with mysql_fetch_array() too. >Here's > > a sample: > > $a[0] = 1; > > $a[1] = 3; > > $a[2] = 5; > > $result = count ($a); > > //$result == 3 > > > > Here's a link: > > http://php.net/manual/en/function.count.php > > DISCLAIMER: I am by no means well-versed in this, or any other, topic.... > > - Shane > > > > ----- Original Message ----- > > From: "Keith Whyman" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, February 07, 2001 12:15 PM > > Subject: [PHP] Sum from Arrays ? > > > > > > > It's probably a stupid question but........... > > > I've got the following ; > > > > > > SELECT t_category_name COUNT(*) AS count > > > FROM t_city,t_zipcodecity,t_location,t_category , t_locationcategory > > > WHERE (t_category_id_category = t_locationcategory_id_category) > > > AND (t_location_id_location = t_locationcategory_id_location) > > > AND (t_zipcodecity_zipcode = t_location_zipcode) > > > AND (t_city_id_city = t_zipcodecity_id_city) > > > AND (t_city_id_city = 1) > > > AND ((t_location_sex = 4) OR (t_location_sex = 0)) > > > GROUP BY t_category_name"; > > > > > > $result1 = mysql_db_query(DBWEB, $query); > > > print mysql_error(); > > > echo " > > > <TABLE width=\"100%\"> > > > "; > > > if ($result1) { > > > > > > > > > while ($r = mysql_fetch_array($result1)) { > > > $numbers = $r["count"]; > > > $names =$r["$t_category_name"]; > > > > > > And what I want is a total for my count - I think it something to do >with > > > the mySQL sum funktion but I've got a bit stuck ! > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ "God is the unrestricted act of understanding, the eternal rapture glimpsed in every Archimedean cry of Eureka." - Bernard Lonergan - ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^ Reuben Donald Budiardja [EMAIL PROTECTED] Homepage: http://www.goshen.edu/~reubendb
Hi List As I am working on the upgradation of my system into PHP 4.0 from the lower version, I want the Change log in a good format. A word document or some other good format which comprises the complete the Change log would be great for me to look through and do the upgradation process in the right direction. As I got the change log from php.net, I couldn't format them perfectly as I wanted, bcoz I want print it out also. But the formation is not good enough. Could some body send the good formatted change log to me (if you have), so that it'll b helpful to me for the upgradation process. Thanks in adv. ~ Karthick
Hi, I'm wondering if anybody can give me the advantages of using OCI* function over ORA* function. I mean, in term of speed and efficiency. The documentation does n't say a lot about this. I have my API using ORA* funct. for my development team. I'm thinking of rebuilding it using OCI*, but wondering if it worths the effort. Is it really faster? Thanks for any answer/comment you can give me. Reuben D. Budiardja
i never heard anything about speed difference, but as far as i remember OCI supports some things that don't work with ORA ( lobs, stored procedures,pl/sql,etc) and i think OCI is still improved and developed while ORA is not. Sebastian > -----Ursprungliche Nachricht----- > Von: Reuben D Budiardja [mailto:[EMAIL PROTECTED]] > Gesendet: Mittwoch, 7. Februar 2001 18:53 > An: [EMAIL PROTECTED] > Betreff: [PHP] OCI* function VS. ORA* function > > > Hi, > I'm wondering if anybody can give me the advantages of using > OCI* function > over ORA* function. I mean, in term of speed and efficiency. The > documentation does n't say a lot about this. > I have my API using ORA* funct. for my development team. I'm > thinking of > rebuilding it using OCI*, but wondering if it worths the > effort. Is it > really faster? > > Thanks for any answer/comment you can give me. > Reuben D. Budiardja > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] >
It calls a class method statically, although its exact behavior depends on the scope from which it was called. If called from outside a class, then the method has no instanciated object, it's just a function. This is also how you can use work with inheritance in PHP. If you have an instanciated subclass, you can use parent::blah() to call the inherited (and overridden) methods. On Wed, 7 Feb 2001, Chien-pin Wang wrote: > > Dear all, > > Pardon me if this is explained somewhere in the > documentation. I've found the :: notation (double colons) in class > definitions of PHP's ~/lib/php directory, such as DB.php. It looks like > doing the same thing as -> notation. Can someone help to explain this a > little bit or provide links to the explaination? Thanks a lot! > > Chien-pin > > > -- John Donagher Application Engineer Intacct Corp. - Powerful Accounting on the Web 408-395-0989 720 University Ave. Los Gatos CA 95032 www.intacct.com Public key available off http://www.keyserver.net Key fingerprint = 4024 DF50 56EE 19A3 258A D628 22DE AD56 EEBE 8DDD
Hello, Is there any way around having to go back and backslash every quote in a html table that contains millions of quotes? I noticed that <pre> print " his name's jack"; </pre> works for a single quote, but not double.... I would literally have a thousand quotes to back slash... My only other alternative is to take the table into Star Office and do a replace on ". Thanks for any replies. Christopher C. M. Allen
Uhmm.... well, you don't have to use print to display HTML. If you did there would be no reason for the <? ?> tags. <? ?> switches between HTML (which is not parsed by the interpreter and PHP code (which is interpreted). Basically, print is used when you have to print a variable. For instance name.php <? print "<b>My name is $myname, and his name is $hisname</b>"; ?> Is the same as name.php: <b> My name is <? print "$myname"; ?> and his name is <? print "$hisname"?> </b> If you have a ton of html that has some variables in it... just paste in your html and where the variables (ie $name) will be printed just insert <? print "$name"; ?> between the HTML. If this is still confusing to you, you should read a intro to PHP tutorial. ----- Original Message ----- From: Christopher Allen <[EMAIL PROTECTED]> To: php <[EMAIL PROTECTED]> Sent: Wednesday, February 07, 2001 10:16 AM Subject: [PHP] html -echo-print > Hello, > > > Is there any way around having to go back and backslash every quote in a > html table that contains millions of quotes? > I noticed that > <pre> > print " > his name's > jack"; > </pre> > > works for a single quote, but not double.... > > I would literally have a thousand quotes to back slash... My only other > alternative is to take the table into Star Office and do a replace on ". > > Thanks for any replies. > > > Christopher C. M. Allen > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Here are a few examples of what you _can_ do : <?php $color = 'blue'; $width = 300; print '<table width="300" bgcolor="blue">'; print "<table width='300' bgcolor='blue'>"; print '<table width='.$width.'" bgcolor="'.$color.'">'; print "<table width='$width' bgcolor='$color'>"; print "<table width=\"$width\" bgcolor=\"$color\">"; ?> <table width="<?php print $width ?> bgcolor="<?php print $color ?>"> For a wonderful tutorial on the subject, go here : http://www.zend.com/zend/tut/using-strings.php It's quite nice. Regards, Philip Olson http://www.cornado.com/ On Wed, 7 Feb 2001, Christopher Allen wrote: > Hello, > > > Is there any way around having to go back and backslash every quote in a > html table that contains millions of quotes? > I noticed that > <pre> > print " > his name's > jack"; > </pre> > > works for a single quote, but not double.... > > I would literally have a thousand quotes to back slash... My only other > alternative is to take the table into Star Office and do a replace on ". > > Thanks for any replies. > > > Christopher C. M. Allen > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
On that subject what's the difference between echo and print? Jeff Oien
See this : What is the difference between echo and print ? ----------------------------------------------------------- http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/41 It should help! Regards, Philip On Wed, 7 Feb 2001, Jeff Oien wrote: > On that subject what's the difference between echo > and print? > Jeff Oien > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
To the best of my knowledge, they do the same thing. I believe echo was started back in the early days of PHP. Print has now replaced it with more functionality. Echo still exists because some people are used to it and for compatibility with older code. ----- Original Message ----- From: Jeff Oien <[EMAIL PROTECTED]> To: php <[EMAIL PROTECTED]> Sent: Wednesday, February 07, 2001 10:48 AM Subject: RE: [PHP] html -echo-print > On that subject what's the difference between echo > and print? > Jeff Oien > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
JB, yes I do know that, but thanks :) I was looking for: <pre> print <<<EOF EOF; </pre> of course it was on : http://www.php.net/manual/en/function.print.php
how can I prohibit users to read arbitrary files on the system if run PHP as apache module? the best solution would be to restrict all the file system functions to the docroot or the users' home. thanks Gabor
On Wednesday 07 February 2001 19:13, Gabor Gludovatz wrote: > how can I prohibit users to read arbitrary files on the system if run > PHP as apache module? Read the chapter about Security in the manual as well as the description of the safe_mode and open_basedir options -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "These are the people who proudly call themselves "hackers" -- not as the term is now abused by journalists to mean a computer criminal, but in its true and original sense of an enthusiast, an artist, a tinkerer, a problem solver, an expert." - ESR
Hi, I am using regular expressions in a php program to decide what should be done next. I am having a problem with one of my regex's. The following is the code i am using: for( $i = 0; $i < sizeof( $arg ); $i++ ) { if( $arg[$i] == '' ) { continue; } if( preg_match( "/^\d{4}-\d{4}$/", $arg[$i], $matches ) ) { $season = $matches[0]; } elseif( preg_match( "/^[a-zA-Z]+$/", $arg[$i], $matches ) ) { if( ! isset( $display ) ) { $display = $matches[0]; } } elseif( preg_match( "/^\d+$/", $arg[$i], $matches ) ) { $value = $matches[0]; } elseif( preg_match( "/(div\d|prem)/", $arg[$i], $matches ) ) { $division = $matches[0]; }echo $arg[$i]."***<br>"; echo $division; } The first 3 work fine, but the last one "/(div\d|prem)/" doesnt work properly. It does work if I have say div1, but if I have prem it doesnt work at all. I have tried changing the regex so it only contains "/prem/" and it still doesnt work. can anyone tell me what is wrong with this code, or is it just a bug in my version of php? Thanks in advance, Lee Stretton.
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Lee Stretton) wrote: <snip> > elseif( preg_match( "/^[a-zA-Z]+$/", $arg[$i], $matches ) ) <snip> > elseif( preg_match( "/(div\d|prem)/", $arg[$i], $matches ) ) <snip> > The first 3 work fine, but the last one "/(div\d|prem)/" doesnt work > properly. It does work if I have say div1, but if I have prem it doesnt > work at all. I have tried changing the regex so it only contains > "/prem/" and it still doesnt work. can anyone tell me what is wrong with > this code, or is it just a bug in my version of php? Your earlier test for "/^[a-zA-Z]+$/" catches any string that is all letters from beginning to end. Thus a string == "prem" would be caught above, and never reach the test for "/(div\d|prem)/". -- CC
> } > elseif( preg_match( "/^\d+$/", $arg[$i], $matches ) ) Isn't this \d+ matching ----------^ > { > $value = $matches[0]; > } > elseif( preg_match( "/(div\d|prem)/", $arg[$i], $matches ) ) the \d in this-----------------^------------^ And the | is using '\d' and 'prem'. It probably should be "/(div\d)|prem/ Unless those parens are part of the expression. Then maybe "/\((div\d)|prem\)/" MD
On Wednesday 07 February 2001 21:50, Michael Dearman wrote: > > } > > elseif( preg_match( "/^\d+$/", $arg[$i], $matches ) ) > > Isn't this \d+ matching ----------^ > > > { > > $value = $matches[0]; > > } > > elseif( preg_match( "/(div\d|prem)/", $arg[$i], $matches ) ) > > the \d in this-----------------^------------^ No. the 1st expression is /^\d+$/ , i.e. match strings with at least one decimal number and nothing else (\d+) from their beginning (^) to their end ($) I.e. that one only catches strings consisting only of decimal digits. > And the | is using '\d' and 'prem'. It probably should be > "/(div\d)|prem/ Unless those parens are part of the expression. Then No, that's fine. (div\d|prem) means "match either 'div\d' or 'prem'" and memorize that part -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "These are the people who proudly call themselves "hackers" -- not as the term is now abused by journalists to mean a computer criminal, but in its true and original sense of an enthusiast, an artist, a tinkerer, a problem solver, an expert." - ESR
Make your PHP script push an HTML formatted tmp file, run it through html2ps, (then perhaps ghostscript to make it PCL et al) and redirect it to your printer. (Or, then run ps2pdf on it and also email a PDF order confirmation page to your customer . . . the potential is limitless.) You could skip several steps by writing the PS/PCL handler template class yourself, but that's a lot of work. Or . . . you could make a gif using GD primitives and your data, then push this to ghostscript for PDF or postscript or PCL or bubblejet . . . John T. Foley Network Administrator Pollak Engineered Products, Actuator Products Division, A Stoneridge Company 195 Freeport Street, Boston MA 02122 ph: (617) 474-7266 fax: (617) 282-9058 The geographical center of Boston is in Roxbury. Due north of the center we find the South End. This is not to be confused with South Boston which lies directly east from the South End. North of the South End is East Boston and southwest of East Boston is the North End. > -----Original Message----- > From: Cal Evans [SMTP:[EMAIL PROTECTED]] > Sent: Wednesday, February 07, 2001 10:22 AM > To: ThoVer Webproducties; [EMAIL PROTECTED] > Subject: RE: [PHP] Access a printer via PHP > > Thomas, > > You don't connect databases to printers. As you discerned, you could use > a > program to query the database and output the results to a printer. > > I f you absolutely MUST have it start printing AS SOON as the order is > inserted into the database (and I challenge you to re-think that > requirement) then the PHP script that adds it to the database needs to > also > output it to the printer. This might be the easiest way anyhow. > > Sorry, I've never tried to print from PHP so I don't know the specifics > but > one possible way to do it would be to open a file handle to your printer > and > write to it like it were any other file. My preference would be to write > the order out to a file and then issue a system command to print that > file. > > Cal > http://www.calevans.com > > > -----Original Message----- > From: ThoVer Webproducties [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 07, 2001 7:33 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Access a printer via PHP > > > Hello, > > For an e-commerce project we want to connect > the mySQL-database we created to a printer > (attached to a computer which has 24h > internet [and mySQL database] access). I > assume it's different to couple the > mySQL-database directly to a printer. > We are however accessing the database via > PHP, so I think it might be possible to send > a command to a printer directly from the PHP > file which puts the data into the database as > well. > > We want to do this in order to have an order > via the website printed directly. In fact, > the printer should start printing as soon as > an order is added to the seperate table in > the mySQL database (by a special PHP > document). > > Does anyone know whether this is possible > and, if it's possible, could you tell me how? > > > > > Thanks in advance, > Thomas. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Oh Ye Wizards, I'm toying around with the thought of a dev-site/live-site administration system. Among other things, administrators would be able to remotely (via a web interface), push files from the dev-site to the live-site. Can anyone help me understand what it would take to do this? Ideally, we could come up with a platform-independent solution, but I'm currently working with 2 NT boxes. I suspect this would be possible by using exec() or possibly shell_exec() to mount the remote volume and perfom file copies. If this would work, can anyone help me with the syntax? Any insights? thanks, michael geary
At 12:13 PM +0100 2/7/01, Christian Reiniger wrote: >On Wednesday 07 February 2001 05:14, Aaron Tuller wrote: > > $parentClass = get_parent_class($this); >> eval("$parentClass::$parentClass();"); >> >> still, I think I should be able to do what I wrote below. > >Um, you know the name of your parent class, so why do you use >get_parent_class() at all? so that way I can have a general purpose way of calling a parent constructor like "super()" or whatever. It seems silly to hardcode the name of my parent class into the code of the class besides in the "extends" part in the definition. that way if I change the hierarchy, I don't have to worry about changing the constructor, it just always points to the parent. sorry if that isn't clear. -aaron
Try 'parent::' On Wed, 7 Feb 2001, Aaron Tuller wrote: > At 12:13 PM +0100 2/7/01, Christian Reiniger wrote: > >On Wednesday 07 February 2001 05:14, Aaron Tuller wrote: > > > $parentClass = get_parent_class($this); > >> eval("$parentClass::$parentClass();"); > >> > >> still, I think I should be able to do what I wrote below. > > > >Um, you know the name of your parent class, so why do you use > >get_parent_class() at all? > > so that way I can have a general purpose way of calling a parent > constructor like "super()" or whatever. It seems silly to hardcode > the name of my parent class into the code of the class besides in the > "extends" part in the definition. that way if I change the > hierarchy, I don't have to worry about changing the constructor, it > just always points to the parent. > > sorry if that isn't clear. > > -aaron > > -- John Donagher Application Engineer Intacct Corp. - Powerful Accounting on the Web 408-395-0989 720 University Ave. Los Gatos CA 95032 www.intacct.com Public key available off http://www.keyserver.net Key fingerprint = 4024 DF50 56EE 19A3 258A D628 22DE AD56 EEBE 8DDD
Hello, I am trying to use unlink(); in windows. Does anyone know if unlink works in windows? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com --------------------------------------------
Hi Brandon, @ 2:02:12 PM on 2/7/2001, [EMAIL PROTECTED] wrote: > I am trying to use unlink(); in windows. Does anyone know if unlink > works in windows? "Note: This function may not work on Windows systems." http://www.php.net/manual/en/function.unlink.php Read under 'User Contributed Notes' for possible solutions. -Brian
Hello all, Please bear with me for a moment. I am new to PHP work, but have over 10 years experience in various other programming languages including C/C++ I'm just getting really frustrated here, and i'm hoping its a simple mistake. What I am running into is that ever file I open and read from, I never actually get any data. I know the data is in the file, but I don't get it. I can write to it fine. Basic scenario is this...I have 2 modules, one that creates my data and one that reads it. I'm setting up a system for book reviews. The first module has a forms page that gets the book's ASIN, TITLE, and DESCRIPTION. There is a common books directory. The module creates a subdirectory off of this dir, and the sub dir's name is the ASIN of the book. In this new sub directory a file is created that contains 3 lines. The ASIN, the TITLE, and the DESCRIPTION, each seperated by a newline (\n). This seems to work fine. The second module is one that will display everythign to the users, and eventually allow user submitted reviews. This module opens a directory handle for the common books directory, and enumerates each subdir (skipping '.' and '..'). It then attempts to open the information file in each subdir that was created above, and display the results. Its always empty. I can include code if requested, but here are a few snippets of the immediate areas.. first module 1 which does the saving of info: case 'save_info': if ($book_file = fopen("$booksdir/books.dat", "a")) { fwrite($book_file, $asin); } fclose($book_file); if ($book_file = fopen("$thisdir/book_info.dat", "w")) { fwrite($book_file, "$asin\n$title\n$description"); } fclose($book_file); break; and the module 2, the reads: // get directory handle $dir_handle = opendir($thisdir); $books = array(); // load valid book directories into an array while($book_file = readdir($dir_handle)) { if ($book_file != "." && $book_file != ".." && is_dir("$thisdir/$book_file")) { $books[] = $book_file; echo "<p>Added: $book_file"; } } // loop through books and create HTML entry for each $index = 0; for ($index = 0; $index < sizeof($books); $index++) { $book_data_file = fopen("$thisdir/$books[$index]/book_info.dat", "r"); echo "<p>Opened $thisdir/$books[$index]/book_info.dat</p>"; $book_data_in = fread($book_data_file, filesize($book_data_file)); echo "<p>book_data_in = $book_data_in</p>"; fclose($book_data_file); $book_data = explode("\n", $book_data_in); echo "ASIN:"; echo "$book_data[0]"; echo "<br>"; echo "Title:"; echo "$book_data[1]"; echo "<br>"; echo "Description:"; echo "$book_data[2]"; echo "<p></p>"; } If anyoen can clear this up for me, I would most appreciate it. I'm on a tight deadline, learning PHP as I go, and losing my mind on this seemingly simple excersise! - John Vanderbeck - Admin, GameDesign
[snip] > for ($index = 0; $index < sizeof($books); $index++) > { > $book_data_file = fopen("$thisdir/$books[$index]/book_info.dat", "r"); > echo "<p>Opened $thisdir/$books[$index]/book_info.dat</p>"; > $book_data_in = fread($book_data_file, filesize($book_data_file)); ^^^^^^^^^^^^^^^^^^^^^^^^^ should be: filesize("$thisdir/$books[$index]/book_info.dat") > echo "<p>book_data_in = $book_data_in</p>"; > fclose($book_data_file); [snip] HTH James -- James Moore PHP QA Team [EMAIL PROTECTED]
Hi John, @ 2:01:49 PM on 2/7/2001, [EMAIL PROTECTED] wrote: > Please bear with me for a moment. I am new to PHP work, but have > over 10 years experience in various other programming languages > including C/C++ > I'm just getting really frustrated here, and i'm hoping its a simple > mistake. What I am running into is that ever file I open and read > from, I never actually get any data. I know the data is in the file, > but I don't get it. I can write to it fine. [...] > If anyoen can clear this up for me, I would most appreciate it. I'm > on a tight deadline, learning PHP as I go, and losing my mind on > this seemingly simple excersise! Obviously, James has answered your question, but I'm curious as to why you aren't using a database for this particular task? Another suggestion, for the actual book data file(s) is to just include the 'cosmetic' information in with the actual $book_data when you write it to disk. IOW, instead of doing this: $book_data = explode("\n", $book_data_in); echo "ASIN:"; echo "$book_data[0]"; echo "<br>"; echo "Title:"; echo "$book_data[1]"; echo "<br>"; echo "Description:"; echo "$book_data[2]"; echo "<p></p>"; Why didn't you just write that information to the file from the very beginning? If you were to do that, all you'd need to do is use include() instead of 'module 2, the reads' It just seems like that would be a lot less painful. -Brian
Is there a secret to get the 'aspell_*' functions to work? I tried running one and got a 'unsupported function' error. :( I am running a RH7.0 system with PHP3. Aspell is installed on the system, but I did not do anything special at compile time (except MySQL support). Is there a compile time tag I need to set in order to get the aspell functions to work (couldn't find on in the docs). Many thanks for any help!! Nick
Hi Nicholas, @ 2:19:38 PM on 2/7/2001, [EMAIL PROTECTED] wrote: > Is there a secret to get the 'aspell_*' functions to work? I tried > running one and got a 'unsupported function' error. :( > I am running a RH7.0 system with PHP3. Aspell is installed on the > system, but I did not do anything special at compile time (except > MySQL support). Is there a compile time tag I need to set in order > to get the aspell functions to work (couldn't find on in the docs). % ./configure --help | egrep aspell --with-aspell[=DIR] Include ASPELL support. -Brian
When you compile PHP, you also need to include the --with-aspell flag (similar to how you did to include MySQL support). HTH -- Sam Masiello Systems Analyst Chek.Com (716) 853-1362 x289 [EMAIL PROTECTED] On 2001.02.07 14:19:38 -0500 Nicholas Pappas wrote: > Is there a secret to get the 'aspell_*' functions to work? I > tried > running one and got a 'unsupported function' error. :( > > I am running a RH7.0 system with PHP3. Aspell is installed on > the > system, but I did not do anything special at compile time (except MySQL > support). Is there a compile time tag I need to set in order to get the > aspell functions to work (couldn't find on in the docs). > > Many thanks for any help!! > > Nick > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I believe that aspell is somewhat outdated now...try pspell...(which uese aspell..check php.net docs) -codeboy > -----Original Message----- > From: Sam Masiello [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 07, 2001 11:23 AM > To: Nicholas Pappas > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Getting ASPELL to work? > > > > When you compile PHP, you also need to include the --with-aspell flag > (similar to how you did to include MySQL support). > > HTH > > -- > Sam Masiello > Systems Analyst > Chek.Com > (716) 853-1362 x289 > [EMAIL PROTECTED] > > On 2001.02.07 14:19:38 -0500 Nicholas Pappas wrote: > > Is there a secret to get the 'aspell_*' functions to work? I > > tried > > running one and got a 'unsupported function' error. :( > > > > I am running a RH7.0 system with PHP3. Aspell is installed on > > the > > system, but I did not do anything special at compile time (except MySQL > > support). Is there a compile time tag I need to set in order > to get the > > aspell functions to work (couldn't find on in the docs). > > > > Many thanks for any help!! > > > > Nick > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > >
The solution ended up being the need to re-compile php with the "--enable-discard-path" configure option. This removed the "#!/usr/local/bin/php" line from the top of the file. Thanks for the feedback. Tim Tim Livers wrote: > I have installed the CGI version of PHP and customized Apache's > httpd.conf. (Had to use CGI for this instance). > > Since I only need (and want) a few php scripts to be available on this > server, I added the following line to httpd.conf in order to get my > script to work. > > ScriptAlias /myfile.php /location/myfile.php > > Then I added the following to "myfile.php" > > #!/usr/local/bin/php > > <? > phpinfo() > ?> > > Everything works fine except that I get "X-Powered-By: PHP/4.0.4pl1 > Content-type: text/html #!/usr/local/bin/php" at the top of the page. > > Any Ideas on how to get rid of this stuff in the output? I have looked > through the php.ini file, and php.net but couldn't find anything. > > Thanks in advance > > Tim > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
----- Original Message ----- From: "Remi Ricard" <[EMAIL PROTECTED]> > Hi, > > I want to know why in the second file I don't get > a=134 as expected. <snip> > // file that don't work as expected > // print a= > <?PHP > function f2() > { > include ('./fileToBeIncluded.php'); > f1(); > } > echo "<html>"; > f2(); > echo "</html>"; > ?> Hi, Functions are separate blocks of code from the rest of the file. If you declare a function or variable inside a function (as you do here, since you include the file which contains a function inside the function) it will not be available to the rest of the script. I think. :-) Anna
Ok, I'm new to programming in PHP. What I'm trying to do is retrieve the song list with play links off of my bands' page at Mp3.com. Ultimately I want to build it into a function I can call with an array of song names and it will return the html formatted as I like So far, I've used this code to open the page and get the part of the code with the song links in it: ----------------------------------------------------------- <? $url="http://artists.mp3s.com/artists/66/wildcraft.html"; $lines_array=file($url); $lines_string = implode('', $lines_array); eregi('<!----Playlist---->(.*)<!----Playlist Controls 2---->',$lines_string, $out); ?> -------------------------------------------------------------------------------- Now, I want to take $out[0], and delete all of the special mp3.com stuff like "Add to my mp3.com" and things like that. Basically, I've been trying to take the chunk of code, which repeats for each song, and replace it with code that just closes the tables and prepares for the next entry. This is the line I've tried: echo eregi_replace('<td><phrase><a href="http://my.mp3.com(.*)</tr></table>', '</td><td nowrap></td></tr></table></td>',$out[0]); What happens though is it takes the chuck out of the first occurance, and then prints the rest of the page unchanged. I want to do further formatting to the code after I remove these chunks though, such as replacing the img reference links and such. I'm starting to think I'm going about it wrong in the first place. I'm thinking I should just pull out the m3u and mp3 links, and use them within my own formatted page. It also occured to me to go through $lines_array line by line turning printing on and off with a flag. But the script is already fairly slow and even though I'm going to put it into a frame, I don't want it to take for ever to run. Anyway, if anyone has any suggestions or wants to help me develop this script, I could really use some help because I'm stuck right now. Thanks, max [EMAIL PROTECTED]
> > $joeBob = new myClass(); > > "myClass" can somehow know that "joeBob" is the name of > > it's instance? > > I'm thinking 'no', but would like verification. > I'm not aware of a way to do so. I'm curious why you'd want > to? If you want to pass "joeBob" to the class you can do so as the > parameter of one of the methods. This is what I ended up doing. Basically what I needed this for is I've got a class that prints out a blurb of javascript and a "<form>". I wanted to make it so that each instance of a class would work with it's own data. This would require that the name of the javascript function and the name of the form be different for each class instance. If I was able to get the name of the class, it would have been all good, I wouldn't have needed to add another paramter to the constructor. But since I cannot, I needed the additional paramter. The class is actually kind of cool. It sets up and executes the sorting of table columns based on a mySQL query. My problem was if I needed to tables using 2 different queries, when I clicked on a column heading in one table, it would try to sort that column in both classes, both queries. I got around this by adding the additional argument, as I mentioned above. > And my guess is that you already know, but if you want to refer to > a method or property of a class from within the class, you do using > syntax like $this->property_here. Yes, I already knew. :P Chris
I don't know what it's called so I don't know what to search for. I have had experience with ASP apps that sometimes I'll create some scripts, say a script does multiple operations. And I want it to print to the screen after each operation is done.. The user would get a running list. Doing operation..... Done Doing this.... Done Etc With ASP it does it as you see it, with PHP it seems to do it all and the print to the screen. Is there a way to get PHP to do the same as ASP or is that just the way PHP works? -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
Thomas Deliduka wrote: > Doing operation..... Done > Doing this.... Done > Etc > > With ASP it does it as you see it, with PHP it seems to do it all and > the print to the screen. Is there a way to get PHP to do the same as > ASP or is that just the way PHP works? Use flush(); each time you want the latest output to be sent to the client. This works only with PHP as a Webserver-Module, not as CGI. regards Wagner -- Three may keep a secret, if two of them are dead.
On 2/7/01 5:09 PM this was written: > Use flush(); each time you want the latest output to be sent to the > client. > This works only with PHP as a Webserver-Module, not as CGI. Thanks! -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
In article <002901c0911e$8aefed80$[EMAIL PROTECTED]>, TV Karthick Kumar <[EMAIL PROTECTED]> writes > Can any body suggest / recommend me a good web hosting provider ?. > I want to register some domains and host with the same provider which >essentially has php, mysql, postgresql & good support. http://www.f2s.com John
Hello, Does anyone have a function that can delete files like unlink(); for windows? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com --------------------------------------------
I'm making a small script that imports HTML pages and I need to do some string replacement. I need to replace add a url to all the 'HREF' links and images, but if someone could just give me an example of how to replace and append the HREF part, I think I can figure it out. It needs to find all the variations of HREF, such as 'HREF = "', href="', 'href =', etc. So it needs to be space and capitalization carefree. THANKS TO ANYONE WHO HELPS!!! Jason Bryner [EMAIL PROTECTED]
look up eregi_replace and preg_replace www.php.net/quickref.php Gotta run J "Jason Bryner" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm making a small script that imports HTML pages and I need to do > some string replacement. I need to replace add a url to all the 'HREF' > links and images, but if someone could just give me an example of how > to replace and append the HREF part, I think I can figure it out. It needs to > find all the variations of HREF, such as 'HREF = "', href="', 'href =', etc. > So it > needs to be space and capitalization carefree. THANKS TO ANYONE > WHO HELPS!!! > > Jason Bryner > [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
On Wednesday 07 February 2001 21:48, Jason Bryner wrote: > I'm making a small script that imports HTML pages and I need to do > some string replacement. I need to replace add a url to all the 'HREF' > links and images, but if someone could just give me an example of how > to replace and append the HREF part, I think I can figure it out. It > needs to find all the variations of HREF, such as 'HREF = "', href="', > 'href =', etc. So it > needs to be space and capitalization carefree. THANKS TO ANYONE > WHO HELPS!!! $replaced = preg_replace ('/(href\s*=\s*(\'|\"))(.*?)(\\2)/i', "\\1\\3${urladdition}\\2", $matches); On a match, $matches [0] will contain the entire pattern, $matches [1] the first subpattern (everything from href to the opening quote), $matches [2] the opening quote char and $matches [3] the URL. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "These are the people who proudly call themselves "hackers" -- not as the term is now abused by journalists to mean a computer criminal, but in its true and original sense of an enthusiast, an artist, a tinkerer, a problem solver, an expert." - ESR
Hi Guys, Just a quick question. I've been using an sql query like this (using wildcards): $sql = "SELECT * FROM table WHERE $search_criteria LIKE '%$search_input%' ORDER by $search_criteria ASC"; At the moment, if the search criteria was "First_Name" and the text ($search_criteria) was "ch", the returned query contains any name containing "ch". The trouble is, if the name you are after is Chris ...., you might get a result like: id 1 CHris etc etc id 2 RiCHard etc etc id 3 CHris etc etc In other words, it seems to be sorting where the instance of the CH comes in id number rather than alphabetically. Is there a way of making the query (using wildcards or without) if someone types in "a", the list will return alphabetically with, like: a aa ab abc ac ace ade I'd explain more, but I really have to go. Sorry. Hope you can help, as most of you often do :) James
Greets all, I have been playing around with LDAP sorting, but I can't seem to get it to work. Essentially, I do an ldap_search() with a filter condition, and use a ldap_get_entries() to get all of the results. The ldap_get_entries() function returns a multi-dimensional array contain my result set. I am assuming it looks something like this: Entries = array( "count" => x, array( array ( "sn" => "Mowat", "givenname" => "Jason", ... ), array ( "sn" => "Anderson", "givenname" => "Peter", ... ), array ( ... ) ) Now, I want to sort all of the internal "person" data by "sn". But, when I try usort, it does not work. I have tried uasort as well. Basically, I need to be able to sort a nested array without touching the outside arrays based on a value in the nested array's element.. The examples I have seen on the 'Net don't seem to work (for me anyways). I have even copied them verbatim, and I get the same results. I'm not sure if their Entries array is the same as mine. Mine is the Entries returned from ldap_get_entries(). Any help is appreciated! Cheers, Jason
Hi, I write all my pictures (hotels...travels, etc) to the database. it worked, but now I`m not sure what has changed, but now it gives the following error: Warning: fopen("C:\\art\\cat2.jpg","r") - No such file or directory in /home/mycatalogue/public_html/mysubcatalogue/hotell.php3 on line 19 the cat2.jpg has been chosen through a browse button from my own hdd (the problem exists wit hall the pictures). Any ideas what might be wrong? Thanks in advance, Siim Einfeldt
On Wed, 7 Feb 2001 23:53:00 +0200 (EET), Siim Einfeldt aka Itpunk ([EMAIL PROTECTED]) wrote: >Hi, > >I write all my pictures (hotels...travels, etc) to the database. it >worked, but now I`m not sure what has changed, but now it gives the >following error: >Warning: fopen("C:\\art\\cat2.jpg","r") - No such file or >directory in >/home/mycatalogue/public_html/mysubcatalogue/hotell.php3 on >line 19 > >the cat2.jpg has been chosen through a browse button from my own hdd >(the >problem exists wit hall the pictures). > >Any ideas what might be wrong? > read the manual on handling file uploads. It looks like you're using $image_name which is the original image name on the client where you want $image which is the temporary file name on the server. If your server is running on the machine you access the form from it may look like things are working right when they aren't.
Hello. Do you know where I can find a list of all file extensions used today? Like: .gif .htm .php .doc ... Is there an organisation, like ICANN, that decide who can use these file extensions and what you need to do to register one of your own? Thanks, // Tobias
Tobias Talltorp wrote: > Do you know where I can find a list of all file extensions used > today? Like: > ..gif > ..htm > ..php > ..doc > .... I don't think so. > Is there an organisation, like ICANN, that decide who can use these > file extensions and what you need to do to register one of your own? No. People use whatever file extensions they like. MIME-types do what you need. But they don't belong to the filename. regards Wagner -- Three may keep a secret, if two of them are dead.
> No. People use whatever file extensions they like. So, If I create a 3D-program, I could say that file extensions for this program will be .pdf (not a prefered extension, but still)? Is it more a question of getting your file extension as widely used as possible, so other companies dont bother using them, since most computers have them associated with an other program? > MIME-types do what you need. But they don't belong to the filename. What do you mean by this? Regards, // Tobias
> So, If I create a 3D-program, I could say that file extensions for this > program will be .pdf (not a prefered extension, but still)? > Is it more a question of getting your file extension as widely used as > possible, so other companies dont bother using them, since most computers > have them associated with an other program? Basically, what he's saying is that the extension can be anything. It's only convention (and only on pc/unix) where it's important to determine what kind of file it is. On advanced filesystems, such as HFS+(mac), beFS(beos), and such the type of file is kept as an extended attribute and you can call your jpeg image myimage.doc and it will still get sent to the correct application when you double click on it. I think ntfs and hpfs have the ability to do this, but it's not implemented. Mime types are things like tex/html and image/jpeg that describe what kind of file you're dealing with. They are what beFS uses to keep track of what's in a file. The reason for extensions is that in unix/windows/dos, all files are the same, they have no type, they're all just a string of bytes, and the original inventors or unix needed a way to tell one file from another. Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. > > > MIME-types do what you need. But they don't belong to the filename. > > What do you mean by this? > > Regards, > // Tobias > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Tobias Talltorp wrote: > > No. People use whatever file extensions they like. > > So, If I create a 3D-program, I could say that file extensions for > this program will be .pdf (not a prefered extension, but still)? > Is it more a question of getting your file extension as widely used > as possible, so other companies dont bother using them, since most > computers have them associated with an other program? Yes. More or less. > > MIME-types do what you need. But they don't belong to the filename. > > What do you mean by this? Browsers are among the programs which do not identify files, which are sent to them, by the filename extension, but by the so called MIME-type. This MIME-type is not part of the file or the filename, but an exterior description of the file. In this case, the MIME-type is sent via the HTTP-headers. This way, a php-script can be anything, plain-text, HTML or an image, by just sending a header like: header("Content-type: image/gif"); or header("Content-type: text/plain"); Default is header("Content-type: text/html"); If you want a list of all MIME-types or something like that, try asking someone who knows, or google.com. regards Wagner -- Three may keep a secret, if two of them are dead.
This is a good start : http://directory.google.com/Top/Computers/Data_Formats/ Regards, Philip On Wed, 7 Feb 2001, Tobias Talltorp wrote: > > No. People use whatever file extensions they like. > > So, If I create a 3D-program, I could say that file extensions for this > program will be .pdf (not a prefered extension, but still)? > Is it more a question of getting your file extension as widely used as > possible, so other companies dont bother using them, since most computers > have them associated with an other program? > > > MIME-types do what you need. But they don't belong to the filename. > > What do you mean by this? > > Regards, > // Tobias > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Thanks for straightening everything out for me! // Tobias "Philip Olson" <[EMAIL PROTECTED]> wrote in message Pine.BSF.4.10.10102072314500.92822-100000@localhost">news:Pine.BSF.4.10.10102072314500.92822-100000@localhost... > This is a good start : > > http://directory.google.com/Top/Computers/Data_Formats/ > > Regards, > > Philip > > On Wed, 7 Feb 2001, Tobias Talltorp wrote: > > > > No. People use whatever file extensions they like. > > > > So, If I create a 3D-program, I could say that file extensions for this > > program will be .pdf (not a prefered extension, but still)? > > Is it more a question of getting your file extension as widely used as > > possible, so other companies dont bother using them, since most computers > > have them associated with an other program? > > > > > MIME-types do what you need. But they don't belong to the filename. > > > > What do you mean by this? > > > > Regards, > > // Tobias > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I am creating an interface for a customer where they will be creating there own db and I was wondering if there was an ereg or ereg_replace function that would get rid of all the bs in one fail swoop. I am already converting spaces to underscores with ereg_replace. Thanks in advance, ----------- Matt Ley Jatosoft, LLC www.jatosoft.com
Hi, I've been looking at using PHP but am unsure if it will do what I want. What first attracted me to PHP is the claim that I can embed PHP code within my html file and have it build dynamic content. Perhaps someone on the list can confirm that ic can do as follows: I have a web page that contains various graphics and text. At the bottom of the page, I have a table of one row by two columns. Using PHP and MySQL (I already know that PHP can access MySQL databases), I want to read data from a table and dynamically grow my table (add several rows, each with two columns). So I am guessing that I will be inserting PHP code and HTML code intertwined? IS PHP my ticket for accomplishing the above? Thanks, Don
Yeppers, it'll do that for you. Cal http://www.calevans.com -----Original Message----- From: Don [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 07, 2001 4:09 PM To: php list Subject: [PHP] question about PHP use Hi, I've been looking at using PHP but am unsure if it will do what I want. What first attracted me to PHP is the claim that I can embed PHP code within my html file and have it build dynamic content. Perhaps someone on the list can confirm that ic can do as follows: I have a web page that contains various graphics and text. At the bottom of the page, I have a table of one row by two columns. Using PHP and MySQL (I already know that PHP can access MySQL databases), I want to read data from a table and dynamically grow my table (add several rows, each with two columns). So I am guessing that I will be inserting PHP code and HTML code intertwined? IS PHP my ticket for accomplishing the above? Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
yes, that is what PHP does best (displaying dynamic content from a database). ----- Original Message ----- From: Don <[EMAIL PROTECTED]> To: php list <[EMAIL PROTECTED]> Sent: Wednesday, February 07, 2001 2:08 PM Subject: [PHP] question about PHP use > Hi, > > I've been looking at using PHP but am unsure if it will do what I want. > What first attracted me to PHP is the claim that I can embed PHP code > within my html file and have it build dynamic content. Perhaps someone > on the list can confirm that ic can do as follows: > > I have a web page that contains various graphics and text. At the > bottom of the page, I have a table of one row by two columns. Using PHP > > and MySQL (I already know that PHP can access MySQL databases), I want > to read data from a table and dynamically grow my table (add several > rows, each with two columns). > > So I am guessing that I will be inserting PHP code and HTML code > intertwined? > > IS PHP my ticket for accomplishing the above? > > Thanks, > Don > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Don wrote: > I have a web page that contains various graphics and text. At the > bottom of the page, I have a table of one row by two columns. Using > PHP > > and MySQL (I already know that PHP can access MySQL databases), I > want to read data from a table and dynamically grow my table (add > several rows, each with two columns). > > So I am guessing that I will be inserting PHP code and HTML code > intertwined? > > IS PHP my ticket for accomplishing the above? It is one possible solution to your problem, yes. ASP, JSP and ColdFusion can do this as well, but being a PHP-lover I would recommend PHP. Hell, I know _why_ I love PHP... Wagner -- Three may keep a secret, if two of them are dead.
Hello, I am sure this is a dumb/easy question but I can't seem to find it looking at the php manual... can someone tell me the function that gets the path of where the script is? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com --------------------------------------------
El Mié 07 Feb 2001 19:20, Brandon Orther escribió: > Hello, > > I am sure this is a dumb/easy question but I can't seem to find it looking > at the php manual... can someone tell me the function that gets the path of > where the script is? Check the variable $HTTP_SERVER_VARS["SCRIPT_FILENAME"] and use basename function to get the path. Saludos... :-) -- System Administration: It's a dirty job, but someone told I had to do it. ----------------------------------------------------------------- Martín Marqués email: [EMAIL PROTECTED] Santa Fe - Argentina http://math.unl.edu.ar/~martin/ Administrador de sistemas en math.unl.edu.ar -----------------------------------------------------------------
Hey everyone, I just released phpdoc v2.0, which is a program used to document PHP class definitions. This version is a complete rewrite of v1.0, and takes a different approach to creating documentation. Where most other applications try to imitate Javadoc as much as possible, this application actually does very little, because it actually uses Javadoc to create PHP documentation. Since the Javadoc API is quite open, and since my application is in Java, its a simple matter to plugin to the Javadoc program. All my application does is parse a PHP class definition through the use of regular expressions, and then convert that class definition from PHP syntax to Java Syntax, then hand the converted source over to Javadoc. What this means is that all the options and power of Javadoc is available to my program, you can use any Javadoc option, doclet, @tag or whatever in phpdoc and in your source and the resulting documentation will be no different then if an actual .java file were passed to Javadoc. All is explained in greater detail at my site, and in instructions I provide. A final note, the library of Javadoc doclets are also open to you when using phpdoc. For anyone whom doesnt know, doclets are programs written in the Java programming language that specify the content and format of the output of the Javadoc tool. By default, Javadoc uses the Standard doclet which creates the .HTML formatted documentation were all used to. You can provide any doclet you wish however to customize the output however you like. The wealth of third party doclets available at the javasoft site allow you to create for example RTF, PDF, and even Japanese based API documentation. You must have the JDK installed on your system (of which Javadoc comes part of) You can download phpdoc v2.0 at http://www.callowayprints.com/phpdoc/phpdoc.php Thanks Everyone, Christian
Hey, Does anyone know what is going wrong here: phpize autoconf: Undefined macros: configure.in:43:AC_PROG_LIBTOOL /usr/local/bin/phpize: libtoolize: command not found There does not seem to be a libtoolize on my system? I also followed the INSTALL docs, and read the online FAQ, unfortunatly I know very little about php-modules and autoconf etc.. Any help mutch appreciated, Regards, Joseph.
On Thursday 08 February 2001 10:29, Joseph H Blythe wrote: > Does anyone know what is going wrong here: > > phpize > autoconf: Undefined macros: > configure.in:43:AC_PROG_LIBTOOL > /usr/local/bin/phpize: libtoolize: command not found > > There does not seem to be a libtoolize on my system? I also followed > the INSTALL docs, and read the online FAQ, unfortunatly I know very > little about php-modules and autoconf etc.. You'll have to install some packages: libtool, autoconf and automake I'd say. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds
On Thu, 8 Feb 2001 01:39:24 +0100 Christian wrote: CR> CR> You'll have to install some packages: libtool, autoconf and automake I'd CR> say. CR> Hmm, libtool wasn't installed strange, thanks! Also I got a few warnings during the compile is this normal? -snip- In file included from /usr/local/include/php/php_compat.h:7, from /usr/local/include/php/php.h:35, from php_apc.h:19, from apc_cache.c:24: /usr/local/include/php/php_config.h:1669: warning: `PHP_BUILD_DATE' redefined -snip- Regards, Joseph.
I try to use PHP to access Oracle DB. Can someone point me to a good place for demo/sample website or documentation how to do that? I just want how to use PHP and Oracle DB only. Thanks, David
Hey all, I've got a question about using the MSSQL Functions. The only way I've been able to use them is to install Microsoft SQL Client on the web server. Is there any way to get around this to use the MSSQL Functions without installing a copy of Microsoft SQL Client? Right now I am using the ODBC Functions to get around the problem, but I was wondering if it just relies on some DLL's that I could copy to the server or something like that? I know that people are using the MSSQL Functions on Linux and they obviously didn't need to install Microsoft SQL Client to get them to work so I'm just hoping there's a way around it? Thanks, Toby
Toby, Yes, the client is requires because the MSSQL module uses some libraries from the client to function. I don't know which one. If Frank see this, he might be able to give you some detailed insight. I just know it has to be installed. -Flint -----Original Message----- From: Toby Miller [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 07, 2001 4:04 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-WIN] MSSQL Functions Hey all, I've got a question about using the MSSQL Functions. The only way I've been able to use them is to install Microsoft SQL Client on the web server. Is there any way to get around this to use the MSSQL Functions without installing a copy of Microsoft SQL Client? Right now I am using the ODBC Functions to get around the problem, but I was wondering if it just relies on some DLL's that I could copy to the server or something like that? I know that people are using the MSSQL Functions on Linux and they obviously didn't need to install Microsoft SQL Client to get them to work so I'm just hoping there's a way around it? Thanks, Toby
Hi All, the key komponent is ntwdblib.dll installed in winnt\system32. The dll uses other dll's to comunicate with the server dbmssocn.dll (tcp/ip) and dbmsnp.dll (NetBios). All the communication dll's should be installed with the ODBC driver. Just copy ntwdblib.dll from the SQL server to the php server. You will need to use the ODBC manager to create client configurations as the tools for this will not be installed. - Frank >Toby, > >Yes, the client is requires because the MSSQL module uses some libraries >from the client to function. I don't know which one. If Frank see this, he >might be able to give you some detailed insight. I just know it has to be >installed. > >-Flint > >-----Original Message----- >From: Toby Miller [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, February 07, 2001 4:04 PM >To: [EMAIL PROTECTED]; [EMAIL PROTECTED] >Subject: [PHP-WIN] MSSQL Functions > > >Hey all, > >I've got a question about using the MSSQL Functions. The only way I'v! e been >able to use them is to install Microsoft SQL Client on the web server. Is >there any way to get around this to use the MSSQL Functions without >installing a copy of Microsoft SQL Client? Right now I am using the ODBC >Functions to get around the problem, but I was wondering if it just relies >on some DLL's that I could copy to the server or something like that? I know >that people are using the MSSQL Functions on Linux and they obviously didn't >need to install Microsoft SQL Client to get them to work so I'm just hoping >there's a way around it? > >Thanks, >Toby > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > >
Is there a way, using PHP, to generate a quantity chooser that maxes out at the quantity on hand? IOW, I have $quantity from the database, for a given line item, and I'd like to have a slider that lets you run up to, but not over, the quantity on hand. This might be more of an HTML question.. -- Dave's Engineering Page: http://www.dvanhorn.org Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
On Thursday, January 18, 2001, at 10:41 PM, jeremy brand wrote: > > Apache doesn't have threading (yet). > > If your business depends upon it, you may want to take a look at > > Solaris/Zeus if you are really getting heavy load high traffic. > > We serve millions of hits a day off of a small farm of FreeBSD servers > running Apache+php for our dynamic content. Thttpd for our static > pages (images, etc). thttpd is a GREAT server. I have a phpMyAdmin rpm including thttpd with php support, for easy MySQL administration of sql servers that don't want/need the weight of apache. Occasionally I see Alan Cox posting to the thttpd list as well, so it must have something ;) I've never used thttpd under heavy load, but everything I gather, it really does quite well, and it *is* faster than apache. What would be nice is if you could set up an apache alias to a full url (maybe you can- i've never tried- but I haven't heard of it either) in the httpd.conf file- as it would make image and static page serving from thttpd that much easier... -=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michael A. Peters Abriasoft Senior Developer http://www.abriasoft.com/ (510) 623-9726x357 Fax: (510) 249-9125
Rebeca, por favor confirmame si has recibido mis E-Mails. Saludos, Andrés.
I did some research and decided to go with ht://Dig - the other thing on the short list of free products was mnoGoSearch. Try this link for a list of available serach engines: http://www.searchtools.com/tools/tools.html Regs Brian White At 23:29 6/02/2001 -0500, Steve Werby wrote: >"Diego Fulgueira" <[EMAIL PROTECTED]> wrote: > > I was wondering if anyone around knows of a tool (free if possible) to >index > > all the pages of my website and implement a search engine. I prefer it to > > run on NT. > >My favorite is mnoGoSearch (formerly udmsearch) found at >http://search.mnogo.ru/. I could hype it in great detail, but I'll let you >do your own research. It's an indexer, backend and frontend search engine. >ht://Dig is also pretty popular. Both are free. Both run on many >Linux/Unix flavors. I don't believe either run on NT. > >-- >Steve Werby >COO >24-7 Computer Services, LLC >Tel: 804.817.2470 >http://www.247computing.com/ > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] ------------------------- Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [EMAIL PROTECTED]
HI! I am Japanese in Tokyo. How about you? I still have a question. initial condition 1) three are many *html in my SQL ex:xxx.html,and yyy.html 2)I have domain ex: abc (ex: http://www.abc.com) 3)database name : aaa 4)table name :bbb I want to try next step. when I type in URL from brouze ,ex http://www.abc.com/xxx.html . I can get xxx.html from my SQL. when I type in URL from brouze ,ex http://www.abc.com/yyy.html I can get yyy.html from my SQL. How can I do this? Is it posible to create it? Please answer for me. Thank you yui
I'm wondering if it's possible to somehow transfer session data across apache virtual hosts. Or if it's needed. I'd like to have a site that can pass certain session data from http: to https: Is this possible? I'd like to do this without cookies or ugly urls. I compiled php4.0.4 with transid (or whatever made transparent session data). Thanks. Jeffrey Schoolcraft
There are two ways of doing sessions, only two cookies and ugly urls. it doesnt matter if your crossing 8 domain names, or sticking to one, there are only two options. Are these domain names on the same server? yes? great then we can work with this. you'll have to either disable cookies (cookies work per domainname) or write some code to handel forcing the PHPSESSID.... <?php include_once('time.egn'); if ( isset($HTTP_GET_VARS['PHPSESSID']) ) session_id($HTTP_GET_VARS['PHPSESSID']); if ( isset($HTTP_POST_VARS['PHPSESSID']) ) session_id($HTTP_POST_VARS['PHPSESSID']); session_start(); if (!isset($HTTP_SESSION_VARS['SessionID'])) { $SessionID = mtime(); session_register('SessionID'); } if (!isset($PHPSESSID)) $PHPSESSID = session_id(); $SID = "PHPSESSID=$PHPSESSID"; ?> now when you wan to force the SESSIONID across domains go like this. <? echo " <a href='http://www.mediawaveonline.com/index.php?$SID'>Mediawaveonline.com</a> "; ?> now as long as the domainname is on the same server, this will work. -- Chris Lee Mediawaveonline.com [EMAIL PROTECTED] "Jeffrey A Schoolcraft" <[EMAIL PROTECTED]> wrote in message 20010207203105.I16742@chimera">news:20010207203105.I16742@chimera... > I'm wondering if it's possible to somehow transfer session data across apache > virtual hosts. Or if it's needed. I'd like to have a site that can pass > certain session data from http: to https: Is this possible? I'd like to do > this without cookies or ugly urls. I compiled php4.0.4 with transid (or > whatever made transparent session data). > > Thanks. > > Jeffrey Schoolcraft > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Hi, I am trying to install a free mailing list manager for a mate, I have spent numerous hours trying to figure out why it won`t setup properly. I installed it on one of my own servers and it worked fine but not on his, however I have now dwindled it down to the fact that his server won`t allow the script to create directorys. I have checked the chmod and that is fine but I`m stumped. Anyone else have a possible solution?? Thanks Ade
anyone have an idea what the limit either in addresses or string length that sendmail can handle in a to, cc, or bcc field? Dave
I have an interesting problem with sessions (using enable-trans-sid). I have created a page with the following javascript function on it: function swapImgRestore() { var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } However when I disable browser cookies the code is altered by enable-trans-sid - notice the "" : function swapImgRestore() { var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x="a[i])&&x.oSrc;i++)" x.src="x.oSrc; " Why does enable-trans-sid do this? It effectively stuffs up the javascript. Anyone know a solution, other than rewriting the javascript :) Regards, Matthew Delmarter
Hi there, Is there a way to compile php files so that no one can read them but php will undestand them?? something like .exe in win Thanks in advance
On Thu, 8 Feb 2001 14:18, GAYTAN BAHAMONDEZ DANIEL EDUARDO wrote: > Hi there, > Is there a way to compile php files so that no one can read them > but php will undestand them?? something like .exe in win > > Thanks in advance http://www.zend.com/zend/products.php#encoder has some information. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
Hello again, I have a form that is used to submit data to my script. If the user enters something like: The title of this book doesn't really matter to "me"! When I get that back, and read it from the file, it always ends up like: The title of this book doesn\'t really matter to \"me\"! Note the addition of the escape sequences. How can I stop this? Is there some function in PHP? Or am I goign to have to write a character routine to strip out escape sequences? <shudder> - John Vanderbeck - Admin, GameDesign
run $blah = stripslashes($blah); PHP automatically does the equivalent of addslashes() to all form submits. ^^@rk John Vanderbeck wrote: > > Hello again, > > I have a form that is used to submit data to my script. If the user enters > something like: > > The title of this book doesn't really matter to "me"! > > When I get that back, and read it from the file, it always ends up like: > > The title of this book doesn\'t really matter to \"me\"! > > Note the addition of the escape sequences. How can I stop this? Is there > some function in PHP? Or am I goign to have to write a character routine to > strip out escape sequences? <shudder> > > - John Vanderbeck > - Admin, GameDesign > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- << If I was a signature file, where would I be?? >>
On Thu, 8 Feb 2001 14:17, John Vanderbeck wrote: > Hello again, > > I have a form that is used to submit data to my script. If the user > enters something like: > > The title of this book doesn't really matter to "me"! > > When I get that back, and read it from the file, it always ends up > like: > > The title of this book doesn\'t really matter to \"me\"! > > Note the addition of the escape sequences. How can I stop this? Is > there some function in PHP? Or am I goign to have to write a character > routine to strip out escape sequences? <shudder> > > - John Vanderbeck > - Admin, GameDesign addslashes and stripslashes are the functions you need. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
> The title of this book doesn't really matter to "me"! > > When I get that back, and read it from the file, it always > ends up like: > > The title of this book doesn\'t really matter to \"me\"! > > Note the addition of the escape sequences. How can I stop > this? Is there some function in PHP? Or am I goign to have > to write a character routine to strip out escape sequences? > <shudder> Very simple. If magic_quotes_gpc is on, PHP does an addslashes() on all stuff that comes in via HTTP GET, HTTP POST or a cookie. And, there's a lovely function get_magic_quotes_gpc() that tells you its status. So: if (get_magic_quotes_gpc()) { // Magic quotes is on, we don't want stuff escaped. $value = stripslashes($value); } This is handy to use in your script even if you know the way your system is set up in php.ini - if you port your script to another server that is set up differently, then it'll still work as you expect. Jason
Thanks everyone..Seems it was a very simple thing <blush> I had searched around on the PHP site, but i'm tired, and I must have missed it. Thanks! - John Vanderbeck - Admin, GameDesign ----- Original Message ----- From: "David Robley" <[EMAIL PROTECTED]> To: "John Vanderbeck" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, February 07, 2001 10:57 PM Subject: Re: [PHP] UN-Escaping text from a form submit? > On Thu, 8 Feb 2001 14:17, John Vanderbeck wrote: > > Hello again, > > > > I have a form that is used to submit data to my script. If the user > > enters something like: > > > > The title of this book doesn't really matter to "me"! > > > > When I get that back, and read it from the file, it always ends up > > like: > > > > The title of this book doesn\'t really matter to \"me\"! > > > > Note the addition of the escape sequences. How can I stop this? Is > > there some function in PHP? Or am I goign to have to write a character > > routine to strip out escape sequences? <shudder> > > > > - John Vanderbeck > > - Admin, GameDesign > > addslashes and stripslashes are the functions you need. > > -- > David Robley | WEBMASTER & Mail List Admin > RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ > AusEinet | http://auseinet.flinders.edu.au/ > Flinders University, ADELAIDE, SOUTH AUSTRALIA >
Hey all, I got this massive query, which I hope you'll be able to understand: SELECT diary.id, diary.thedate, diary.topic, diary.entry, count(comments.id) AS comments FROM diary, comments WHERE diary.month='$month' AND diary.id = comments.id GROUP BY comments.id ORDER BY diary.id DESC " Basically what I've done is made a diary table, and allowed people to comment on each diary entry, with the comments stored in a seperate comments table. What i'm doing there is getting the diary entry, plus the number of comments posted for that entry. Now the problem is that this query only displays entries from the diary table when a comment is added for that entry, otherwise it comes up with a blank, because (diary.id = comments.id) isn't true. Now, is there a way to make sure that it displays all diary entries anyway? because if i remove that check (diary.id = comments.id) - then all the numbers come up messed up. Thanks Sunny __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
Q: Does anyone know of a way to test for undefined variables? For example, I am sending a variable into the page, but the processing of the page depends on what is being passed to the page. Say, I am typing the following on the location bar: index.php?fuseaction=something&fuse=6 and I want something to happen if fuse is actually declared, and something else to happen if fuse is not defined. I have tried isdef(), but that function does not seem to work, and I couldn't find it in the manual when I was looking for it. Code to use on: if($HTTP_GET_VARS("fuse") == NULL) then do something; else do something else; Q: Also, does anyone know how to rename a variable? I want to create a variable $attributes_NameOfVariable, but it does not seem to work. is there a function that exists in PHP that will assist me in this process? Thank you for all of your help, and thank you for your time, August Malson
Not sure if this is hat you are looking for, but I do something similiar in my script. Its set up so that the action of the script depends on whether or not the ASIN was passed in.. if(isset($asin)) { $mode='save_info'; } that way if something like: "book_reviews.php?asin=000129091" is called, then it will save the information, but if "book_reviews.php" is passed, then its not defined and it goes to a different mode (which in my case is a form to get the information) - John Vanderbeck - Admin, GameDesign ----- Original Message ----- From: "August Malson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 08, 2001 2:11 AM Subject: [PHP] test for undefined variables & renaming variables > Q: > Does anyone know of a way to test for undefined variables? For example, I > am sending a variable into the page, but the processing of the page depends > on what is being passed to the page. > > Say, I am typing the following on the location bar: > index.php?fuseaction=something&fuse=6 > > and I want something to happen if fuse is actually declared, and something > else to happen if fuse is not defined. > > I have tried isdef(), but that function does not seem to work, and I > couldn't find it in the manual when I was looking for it. > > Code to use on: > > if($HTTP_GET_VARS("fuse") == NULL) then do something; else do something > else; > > > Q: > Also, does anyone know how to rename a variable? > > I want to create a variable $attributes_NameOfVariable, but it does not seem > to work. is there a function that exists in PHP that will assist me in this > process? > > Thank you for all of your help, and thank you for your time, > > August Malson > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Hello Everybody, Does anybody know or have some PHP code to read the htaccess file. I have a couple of directorys protected by the htaccess & htpasswd files on the Unix Apache server I use. But I want to create a webpage with input boxes to simulate the popup dialog that appears when entering the protected areas. So rather than enter the username & password in the dialog I want to enter them in a webpage. Its all for looks, to give the site a user friendly asthetic look. Please help. Pretty please.... Chris