php-general Digest 21 Feb 2001 00:10:25 -0000 Issue 524 Topics (messages 40732 through 40863): Re: Strange behaviour: Cannot exit as expected AND Script starts from the beginning, executed TWICE. Anyone? 40732 by: Ben Peter Re: HTTP Content-length... 40733 by: Ben Peter 40735 by: Hrishi 40815 by: Simon Garner Redirect page 40734 by: Rosen 40736 by: Ben Peter MyODBC and Crystal Reports 40737 by: Bruno Freire LDAP Admin Tool 40738 by: Ali processing form data 40739 by: Denis L. Menezes 40740 by: Thomas Deliduka 40741 by: Thomas Deliduka 40742 by: John Vanderbeck 'use' and 'import' 40743 by: Michael Dearman Re: Multiple URLs and cookies 40744 by: Jeremy Gillies 40811 by: Richard Lynch SMS again 40745 by: Siim Einfeldt aka Itpunk Help? 40746 by: Wee Chua is eval expensive? 40747 by: Jaxon Re: Open location automatically after checking 40748 by: Edith Lai Newbie password-check program 40749 by: Ronald Hemmink 40752 by: Chris Lee Re: using include_path with file_exists() 40750 by: Michael Dearman 40754 by: Ben Peter Re: Getting LDAPS to work 40751 by: Victor V . Evtushenko Re: GD with Jpeg Support Problems 40753 by: Chris Lee Re: what's the difference between include and require?? 40755 by: Sam Leibowitz file grabber help 40756 by: Brian C. Doyle 40761 by: Brian V Bonini 40764 by: Brian C. Doyle redirect if sql = nothing 40757 by: Matt Davis 40758 by: Joe Sheble (Wizaerd) 40760 by: Brian V Bonini 40765 by: Website4S.aol.com 40766 by: Joe Sheble (Wizaerd) 40767 by: Matt Davis Display Format 40759 by: Website4S.aol.com 40789 by: Robert V. Zwink checkboxes & sessions 40762 by: kaab kaoutar 40771 by: Chris Lee Adding a string and a numeric 40763 by: Don 40772 by: Chris Lee Where do i look up return status codes? 40768 by: George Herson 40812 by: Simon Garner 40823 by: Chris Carbaugh 40836 by: ..s.c.o.t.t.. [gts] unlik by sending variabel? 40769 by: Jan Grafström 40813 by: Simon Garner Uploading files will it time out? 40770 by: Brandon Orther Re: HTTP POST Question 40773 by: Julian Wood 40774 by: Jan Grafström 40788 by: Julian Wood Re: checkboxes & sessions thanks 40775 by: kaab kaoutar Header ("location: test.php"); 40776 by: Christopher Allen 40777 by: Nuno Silva 40780 by: Hoover, Josh No result - need advice. 40778 by: Kenneth R Zink II 40779 by: Website4S.aol.com Get name of current function 40781 by: Ide, Jim 40844 by: Richard Lynch mailto ? 40782 by: kaab kaoutar 40783 by: kaab kaoutar email a page as attachment 40784 by: kaab kaoutar 40790 by: atom.qosip.ttt.bme.hu Can you make a file empty? 40785 by: Jan Grafström 40845 by: Richard Lynch Postgresql session handling 40786 by: Bolt Thrower 40846 by: Richard Lynch Terrible Hosting Experience 40787 by: Thomas Deliduka 40797 by: richard merit 40799 by: Brian V Bonini 40800 by: Thomas Deliduka 40801 by: Thomas Deliduka 40834 by: Krznaric Michael 40838 by: Brian V Bonini ereg match problem 40791 by: W.D. 40798 by: richard merit 40807 by: ..s.c.o.t.t.. [gts] reports in the EPSON LX-810 Printer 40792 by: Emerson 40847 by: Richard Lynch PHP vs. FreeTDS 40793 by: Scott Fletcher 40795 by: Michael Kimsal 40837 by: Scott Fletcher Re:Is there a PHP equivalent of DATE_FORMAT ? 40794 by: Phil Daintree PHP and SuEXEC? 40796 by: Matthew Toledo 40803 by: Thomas Deliduka system() PHP newbie!! 40802 by: Kevin Connolly 40848 by: Richard Lynch Re: form's variable access problem 40804 by: Ivo Stoykov How to delete session variables 40805 by: Conover, Ryan 40850 by: James, Yz httpd.conf question... 40806 by: Brandon Orther 40810 by: Thor M. Steindorsson 40814 by: Brandon Orther Uploading files 40808 by: Ashley M. Kirchner 40826 by: Chris Lee AIX 4.3.3 + Oracle 9iAS + PHP 4.0.4pl1 with OCI8 instructions 40809 by: Michael Champagne how to urlencode array data for PostToHost ? 40816 by: Sergiy Zhenochin 40849 by: Richard Lynch 40861 by: Sergiy Zhenochin Newbie: [PHP] $HTTP_POST_VARS 40817 by: Phil Labonte 40820 by: Chris Lee 40821 by: Jerry Lake 40822 by: Simon Garner Re: add user to ldap using php 40818 by: Patrick Brown Getting LDAP attribute values 40819 by: Patrick Brown How do I .... 40824 by: Michael Zornek 40825 by: Simon Garner 40827 by: Alexander Wagner CGI BIN PHP 40828 by: cguilette.att.net PHP SSI 40829 by: Brandon Orther 40830 by: Simon Garner Help me! What is wrong? 40831 by: Ana Carolina Blanco Abascal 40833 by: Hoover, Josh 40852 by: Ana Carolina Blanco Abascal 40854 by: Simon Garner Cache Problem 40832 by: Peter Houchin Simple Fail-Safe E-Business Opportunity! 40835 by: dbcarolina.verizonmail.com Re: High and Low ASCII characters 40839 by: Richard Lynch Re: PHP has encountered an Access Violation at 10014D15 40840 by: Richard Lynch Re: Is it possible to use CyberCash w/o MCK? 40841 by: Richard Lynch Re: listing files and directories... 40842 by: Richard Lynch Re: sending variables 40843 by: Richard Lynch Function/method syntax limitations 40851 by: Simon Garner 40855 by: James Moore 40858 by: Simon Garner Re: SNMP question 40853 by: Michael Geier How do I limit a file size? 40856 by: Kenneth R Zink II 40863 by: David Robley Novell LDAP and PHP? 40857 by: Patrick Brown Does anyone have a link to ImageMagick's web site? 40859 by: Brandon Orther 40860 by: Simon Garner I am looking for an image library that can do blurs 40862 by: Brandon Orther 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] ----------------------------------------------------------------------
Yasuo, the function you call is > $msg = user_regist(); while in regist_util.inc, the function defined is > function regist_user() { Could that be the problem? Do you see any errors about undefined functions? Cheers, Ben Yasuo Ohgaki wrote: > > This is really strange. PHP fails to exit / die form script after include / > require / include_once / required_once (I tested with all of them, same > result). > In addition to this, script gets started again automatically from the > beginning. > (You probably think this is a another newbie mistakes, but I think it is > not) > > Does anyone have the same experience? > I'm asking to decide if this is worth to report as a bug. If anyone does not > have this problem but me. I'll just leave it alone. (I cannot reproduce this > with simple script anyway) > > I cannot reproduce this behavior with simple script, but it does every time > on my script. > > PHP 4.0.4pl1 with PostgreSQL, mhash, mcript, gd, and others > Apache 1.3.17 (mod_php, mod_gzip, mod_ssl and others) > RedHat Linux7.0.1/ja > (Apache and PHP are build from source) > > My code does as follows > > In user registration form (regist.php) > - require_once() to include registration function > - call registration function > - if the function does not exit, display HTML in this registration file. > regist.php looks like > ------------ > <?php > require_once('regist_util.inc'); > > $msg = user_regist(); // defined in regist_util.inc > > ?> > <html> > <form method=post action=regist.php> > <?php @print($msg); // print errors for users' inputs if there is ?> > ........................ > <input type="text" name="username"></input> > <input type="text" name="email"></input> > ........................ > </html> > ------------- > > regist_util.inc does <= THIS FILE HAS PROBLEM > - check if there is the same user name is registered > - if there is, return 'Choose other name' error (or other error) > - if not, insert user data into database and send notify email, include > other html file > to show user registered successfully. Then exit script. > regist_util.inc looks like > -------------- > <?php > function regist_user() { > global $HTTP_POST_VARS; > $error = array(); > // check inputs add errors, add error like $error[] = 'Error1'; $error[] = > 'Error2'; > // check database > $db = pg_pconnect(); > $qid = pg_exec("select * from user where username = '". > $HTTP_POST_VARS['username'] ."'"); > if (pg_numrow($qid) > 0) { > $error[] = 'Choose other name'; > } > if (count($error) == 0) { > // INSERT DATA - data is inserted if username is new > ......................... > // SEND EMAIL - mail is sent if username is new > ....................... > <= **** if I put die() or exit() BEFORE include PHP exits from script as > expected. **** > // include HTML file (with just a little PHP code) > include('registered.php'); <= **** THIS IS NOT DISPLAYED AT ALL ****** > // If I remove include(), it exits from script. > exit; <= ************* DOES NOT EXIT or DIE HERE ************* > > // Script seems start from the beginning. It shows 'Choose other name' error > and > // there is the data newly creating in database, even if the user table is > empty. > // Because data with the username was inserted at 1 first time script > iteration. > // For the second time, script finds the username (of course) and return > 'Choose > // other name' error. > > // Since I did get ANY additional HTML, but HTML codes in regist.php when > // this happened, I thought it might something to do with 'ob_gzhandler'. I > // disabled it. But no difference. This makes difficult to find out what PHP > is > // doing, now I'm sure PHP is executing the scripts TWICE. > // Reason: > // 1) There will be a new db table row every time I use new username. > // 2) I get notification email every time I use new username. > // (I thought PHP never buffer outputs unless user explicitly to do so) > > // If I redirect, it works as expected.... I would rather not to show > registered.php, since > // user does not have to access this page directly. (I can work around this > with different > // way, so I will do so) > > // By the way, I use EUC-JP code, which is multi-byte char code set, in > scripts > // and HTML part, etc. EUC-JP supposed to work well for many programs > written > // for single byte char code set. However, it might something to do with > char code. > // I'm using. So far, I didn't have problems. May be this is the first time. > (I haven't > // investigated yet) > } > } > --------------- > > registered.php looks like > -------------- > <html> > <body> > You have been registered to this web site<br> > username = <?php @print($HTTP_POST_VARS['username']; ?><br> > .......................... > </body> > </html> > --------------- > > -- > Yasuo Ohgaki > > -- > 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]
Evan, I have no good answer to your problem, but probably you should have a look at Snoopy (snoopy.sourceforce.net), which implements HTTP posts, along with some other nifty functions and is very easy to use. Cheers, Ben "Montgomery-Recht, Evan" wrote: > > I'm working through geting the raw sockets implementation to send a http > post command to a cgi-script. > > But there's one thing I'm trying to figure out. > > How do I create the content-length? > > I don't see a obvious way but my expection would be the following code. > > $string ="foo=bar&food=apple"; > $contentlength=$string.size; > $uuencodestring=uuencode($string); > > but I don't seem to see the easy $string.size ? > > any ideas on a good way to do this? > > thanks, > > evan > > -- > 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]
> $string ="foo=bar&food=apple"; > $contentlength=$string.size; > $uuencodestring=uuencode($string); uuencode ? are you looking at urlencode ? use $contentlength=strlen($string); also remember according to the HTTP protocol, you have to show the length of the encoded string, not the original; which in PHP will look like : <? $string ="foo=bar&food=apple"; $encodedstring=urlencode($string); $contentlength=strlen($encodedstring); ?> other methods may or may not work if they're not HTTP compliant. cheers, hrishi
From: "Hrishi" <[EMAIL PROTECTED]> > > $string ="foo=bar&food=apple"; > > $contentlength=$string.size; > > $uuencodestring=uuencode($string); > > uuencode ? are you looking at urlencode ? > > use > $contentlength=strlen($string); > > also remember according to the HTTP protocol, you have to show the length of > the encoded string, not the original; which in PHP will look like : > > <? > $string ="foo=bar&food=apple"; > $encodedstring=urlencode($string); > $contentlength=strlen($encodedstring); > > ?> > > other methods may or may not work if they're not HTTP compliant. > > cheers, > hrishi > Note that you should not urlencode() the string after it's already URL-formatted. $string ="foo=bar&food=apple"; $encodedstring=urlencode($string); echo $encodedstring; // Will output: foo%3Dbar%26food%3Dapple If "bar" and "apple" were variables, you would rather urlencode() them individually. Cheers Simon Garner
Hi, I have php script and I want to redirect user to different pages. I tryed with header("Location: main.php"); but i receive error: Warning: Cannot add header information - headers already sent by (output started at F:\Inetpub\wwwroot\pernik\go.php:2) in F:\Inetpub\wwwroot\pernik\go.php on line 6
Rosen, You have to make sure that nothing is output before the header function. Make sure that you neither employ an echo or print before, and have nothing outside of th ephp code (the part enwrapped in <?php or <? and ?>), not even whitespace. You critical spot seems to be line 2 in go.php Cheers, Ben Rosen wrote: > > Hi, > I have php script and I want to redirect user to different pages. > I tryed with > header("Location: main.php"); > > but i receive error: > > Warning: Cannot add header information - headers already sent by (output > started at F:\Inetpub\wwwroot\pernik\go.php:2) in > F:\Inetpub\wwwroot\pernik\go.php on line 6 > > -- > 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, everybody! It's me again.... Bruno, from Brazil. Now i'm having some problems with MyODBC and Crystal. I have an ODBC named MyCOMERCIAL. I did make a report in the Crystal linked at this ODBC. When I call this report or update the data in the report from crystal reports, everythink is OK. When I call from the browser, the report comes with the last saved data. But when I update this data, the Crystal Reports ask me for database login and password. I did enter my passwords but the Crystal ask me again..... Somebody have any idea what can this be??????? Thanks!! Bruno
Hello, does anybody know of a LDAP Admin Tool (apart from LDAP Explorer) written in php. Any hint would be appreciated. Ali
Hello friends. I am new to php4 which I am running on an intel machine with NT4 sp6 and IIS4. I have 2 forms name.php and username.php When I run the name.php, and click "submit data" button, the username.php does not appear. I have both the files in the same directory which is c:\inetpub\wwwroot. Appears to me that the FORM ACTION is not working and my username.php is noyt called. Can someone please help me and advise what I am doing wrong. <HTML> <!-- Name.php --> <BODY> <FORM ACTION="Processform.php" METHOD=POST><BR><BR> Please enter your name here : <INPUT TYPE=TEXT NAME="username"><BR><BR> <INPUT TYPE=SUBMIT VALUE="Submit data"> </FORM> </BODY> </HTML> <HTML> <!-- processform.php --> <BODY> <?php echo ("Welcome, " . $username . "!") ?> </BODY> </HTML> Thanks in advance Denis
Change your form method to GET and find out what's being passed. Check your php.ini file. I think it's the "track vars" command that determines whether the variables will be parsed on the next page. On 2/20/01 9:16 AM this was written: > I am new to php4 which I am running on an intel machine with NT4 sp6 and > IIS4. > > I have 2 forms name.php and username.php When I run the name.php, and click > "submit data" button, the username.php does not appear. I have both the > files in the same directory which is c:\inetpub\wwwroot. Appears to me that > the FORM ACTION is not working and my username.php is noyt called. Can > someone please help me and advise what I am doing wrong. > > <HTML> > <!-- Name.php --> > <BODY> > <FORM ACTION="Processform.php" METHOD=POST><BR><BR> > Please enter your name here : > <INPUT TYPE=TEXT NAME="username"><BR><BR> > <INPUT TYPE=SUBMIT VALUE="Submit data"> > </FORM> > </BODY> > </HTML> > > > <HTML> > <!-- processform.php --> > <BODY> > <?php > echo ("Welcome, " . $username . "!") > ?> > </BODY> > </HTML> > > Thanks in advance > Denis -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
Correction.... To quote from a previous e-mail from some one else: If register_globals is true, the variable is also available in the global scope as $rosen (as in Rosen's example). If this does not work, it would seem that register_globals is not set [in the php.ini file]. On 2/20/01 9:16 AM this was written: > Hello friends. > > I am new to php4 which I am running on an intel machine with NT4 sp6 and > IIS4. > > I have 2 forms name.php and username.php When I run the name.php, and click > "submit data" button, the username.php does not appear. I have both the > files in the same directory which is c:\inetpub\wwwroot. Appears to me that > the FORM ACTION is not working and my username.php is noyt called. Can > someone please help me and advise what I am doing wrong. > > <HTML> > <!-- Name.php --> > <BODY> > <FORM ACTION="Processform.php" METHOD=POST><BR><BR> > Please enter your name here : > <INPUT TYPE=TEXT NAME="username"><BR><BR> > <INPUT TYPE=SUBMIT VALUE="Submit data"> > </FORM> > </BODY> > </HTML> > > > <HTML> > <!-- processform.php --> > <BODY> > <?php > echo ("Welcome, " . $username . "!") > ?> > </BODY> > </HTML> -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
Try changing your echo line to: echo ("Welcome $HTTP_POST_VARS[username]!"); - John Vanderbeck - Admin, GameDesign > <HTML> > <!-- processform.php --> > <BODY> > <?php > echo ("Welcome, " . $username . "!") > ?> > </BODY> > </HTML> > > Thanks in advance > Denis > > > > > -- > 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 give up. The PEAR docs refer to 'use' or 'import'. I know I've seen 'import' somewhere, but I can't find either in my ref books, searches on Zend.org, nor the manual. Could someone direct me to where these 2 functions? / statements? / directives? are explained. Thanks, Mike D.
How will that work with three URLs and frequent language switching? Thanks, jer > You can't do setcookie and Location: in the same page. > Once they picked a language, set the cookie and return the > HTML content for > that home page, don't redirect. > > -- > Visit the Zend Store at http://www.zend.com/store/ > Wanna help me out? Like Music? Buy a CD: > http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > ----- Original Message ----- > From: Jeremy Gillies <[EMAIL PROTECTED]> > Newsgroups: php.general > Sent: Monday, February 19, 2001 9:43 AM > Subject: [PHP] Multiple URLs and cookies > > > > Hello all! > > > > Okay, still going at it with PHP vs. JavaScript -- although > one can remove > > the power if they disable cookies -- in fact, with the way > it is set up > > here, it is doubtful they will get to the right page if they switch > > languages, but i can work that out later with a simple > if-then statement > > that will create the link -- a test to see if cookies are > enabled then > print > > the correct URL. > > > > 1) Joe: I used the index (splash.php) and choice pages > (choice.php) as per > > your suggestion. It works without a hitch. The cookie is > set and it goes > > accordingly from the splash.php page once you have mad a selection. > > > > 2) Angela: I have added a third page to this mix, a > lang_swap.php which is > > called from the document that people are looking at. So now > it goes from a > > language button on a doc, passes a document id to the > lang_swap.php page > > where a similar process tot he choice.php page takes place, sets the > cookie > > value to the other language, and kicks it back to the > french version of > the > > english document (and vice-versa). It's all pretty quick, so i'm not > worried > > about the page requests and lag. > > > > > > The trouble is... the lang_swap.php will not set the cookie for the > language > > change. If i swap to french and then i go back and load the > splash page, > it > > send me to the english-front again, but it should send me to the > > french-front... i was having this problem before when i was > trying to get > > this all to work... once the variable was set, i could not get it to > change. > > > > Thanks for your help and in advance of some more! > > Jer > > Canadian Union of Postal Workers > > > > > > ------------------------------ > > The splash.php is as follows: > > ------------------------------ > > <?php > > if ((IsSet($lang)) || ($lang = "1") || ($lang = "2")) > > switch($lang) > > { > > case 1: > > header("Location: > http://www.english.com/english-front-page.php"); > > exit; > > break; > > case 2: > > header("Location: http://www.franch.com/french-front-page.php"); > > exit; > > break; > > } > > ?> > > <HTML> > > ..... > > passes a value to choice.php... depending upon langauge select... > > ..... > > </HTML> > > > > ------------------------------ > > > > > > ------------------------------ > > The choice.php is as follows: > > ------------------------------ > > > > <?PHP > > > > if(strlen($lang)) > > { > > switch($lang) > > { > > case 1: > > setcookie ("lang", "1", "http://www.english.com/", "", 0); > > header("Location: http://www.english.com/english-front-page.php"); > > exit; > > break; > > case 2: > > setcookie ("lang", "2", "http://www.french.com/", "", 0); > > header("Location: http://www.franch.com/french-front-page.php"); > exit; > break; > } > } > ?> > > <html> > <head> > <title>Choice</title> > </head> > <body></body> > </html> > > > ------------------------------ > > > ------------------------------ > The lang_swap.php is as follows: > ----------------------------- > > <?PHP > if ((IsSet($lang)) || ($lang = "1") || ($lang = "2")) > switch($lang) > { > /* here is the swap */ > case 1: > setcookie ("lang", "2", "http://www.french.com/", "", 0); > header("Location: > http://www.french.com/document-fra.php?Doc_ID=$Ident"); > exit; > break; > case 2: > setcookie ("lang", "1", "http://www.english.com/", "", 0); > header("Location: > http://www.english.com/document-eng.php?Doc_ID=$Ident"); > exit; > break; > } > ?> > > <html> > <head> > <title>Lang Swap</title> > </head> > <body></body> > </html> > > > -- > 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 don't know how it will work, or even if you can do whatever it is you are trying to do. I only know what won't work. header("Location:")+setcookie() in one script will not work on many browsers. At a guess, I'd say you'll have to include() the file the user was attempting to reach while switching languages rather than doing the redirect. Or, perhaps the content negotiationn will be sufficient. http://apache.org Or, maybe you'll need to have a language-switching page after all. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Jeremy Gillies <[EMAIL PROTECTED]> To: 'Richard Lynch' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, February 20, 2001 8:31 AM Subject: RE: [PHP] Multiple URLs and cookies > How will that work with three URLs and frequent language switching? > > Thanks, > jer > > > You can't do setcookie and Location: in the same page. > > Once they picked a language, set the cookie and return the > > HTML content for > > that home page, don't redirect. > > > > -- > > Visit the Zend Store at http://www.zend.com/store/ > > Wanna help me out? Like Music? Buy a CD: > > http://l-i-e.com/artists.htm > > Volunteer a little time: http://chatmusic.com/volunteer.htm > > ----- Original Message ----- > > From: Jeremy Gillies <[EMAIL PROTECTED]> > > Newsgroups: php.general > > Sent: Monday, February 19, 2001 9:43 AM > > Subject: [PHP] Multiple URLs and cookies > > > > > > > Hello all! > > > > > > Okay, still going at it with PHP vs. JavaScript -- although > > one can remove > > > the power if they disable cookies -- in fact, with the way > > it is set up > > > here, it is doubtful they will get to the right page if they switch > > > languages, but i can work that out later with a simple > > if-then statement > > > that will create the link -- a test to see if cookies are > > enabled then > > print > > > the correct URL. > > > > > > 1) Joe: I used the index (splash.php) and choice pages > > (choice.php) as per > > > your suggestion. It works without a hitch. The cookie is > > set and it goes > > > accordingly from the splash.php page once you have mad a selection. > > > > > > 2) Angela: I have added a third page to this mix, a > > lang_swap.php which is > > > called from the document that people are looking at. So now > > it goes from a > > > language button on a doc, passes a document id to the > > lang_swap.php page > > > where a similar process tot he choice.php page takes place, sets the > > cookie > > > value to the other language, and kicks it back to the > > french version of > > the > > > english document (and vice-versa). It's all pretty quick, so i'm not > > worried > > > about the page requests and lag. > > > > > > > > > The trouble is... the lang_swap.php will not set the cookie for the > > language > > > change. If i swap to french and then i go back and load the > > splash page, > > it > > > send me to the english-front again, but it should send me to the > > > french-front... i was having this problem before when i was > > trying to get > > > this all to work... once the variable was set, i could not get it to > > change. > > > > > > Thanks for your help and in advance of some more! > > > Jer > > > Canadian Union of Postal Workers > > > > > > > > > ------------------------------ > > > The splash.php is as follows: > > > ------------------------------ > > > <?php > > > if ((IsSet($lang)) || ($lang = "1") || ($lang = "2")) > > > switch($lang) > > > { > > > case 1: > > > header("Location: > > http://www.english.com/english-front-page.php"); > > > exit; > > > break; > > > case 2: > > > header("Location: http://www.franch.com/french-front-page.php"); > > > exit; > > > break; > > > } > > > ?> > > > <HTML> > > > ..... > > > passes a value to choice.php... depending upon langauge select... > > > ..... > > > </HTML> > > > > > > ------------------------------ > > > > > > > > > ------------------------------ > > > The choice.php is as follows: > > > ------------------------------ > > > > > > <?PHP > > > > > > if(strlen($lang)) > > > { > > > switch($lang) > > > { > > > case 1: > > > setcookie ("lang", "1", "http://www.english.com/", "", 0); > > > header("Location: http://www.english.com/english-front-page.php"); > > > exit; > > > break; > > > case 2: > > > setcookie ("lang", "2", "http://www.french.com/", "", 0); > > > header("Location: > http://www.franch.com/french-front-page.php"); > > exit; > > break; > > } > > } > > ?> > > > > <html> > > <head> > > <title>Choice</title> > > </head> > > <body></body> > > </html> > > > > > > ------------------------------ > > > > > > ------------------------------ > > The lang_swap.php is as follows: > > ----------------------------- > > > > <?PHP > > if ((IsSet($lang)) || ($lang = "1") || ($lang = "2")) > > switch($lang) > > { > > /* here is the swap */ > > case 1: > > setcookie ("lang", "2", "http://www.french.com/", "", 0); > > header("Location: > > http://www.french.com/document-fra.php?Doc_ID=$Ident"); > > exit; > > break; > > case 2: > > setcookie ("lang", "1", "http://www.english.com/", "", 0); > > header("Location: > > http://www.english.com/document-eng.php?Doc_ID=$Ident"); > > exit; > > break; > > } > > ?> > > > > <html> > > <head> > > <title>Lang Swap</title> > > </head> > > <body></body> > > </html> > > > > > > -- > > 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] > > > >
Hey I know this topic has been 'in the area' lots od times, but does anybody know of any scripts that are out there whichi I could use to let users of my website send SMS? And secondly, can I offer it as a free service (this would assume I don`t have to pay for it myself either)? Or is anyone using some related script on his/her website? Thanks Siim EInfeldt
Hi all, I am sorry for asking this question but I just need some opinions or answers from you all. The question is "What are the limitations of software testing?" Thanks for any helps in advance. Calvin
Hi, is eval() really that expensive? I want to parse a bunch of PHP 'modules' into an HTML string, so I can mostly separate content from markup. I've found a couple of comments on the list that say it is expensive, but none of my PHP books mention it :) cheers! jaxon
I tried this but get error message. It says that i've opened a header and can't open another things like that. Is this the only way to do that? For your reference, my php file looks like this: <?php if ($submit){ if (checking not succeed){ echo "...."; }else{ (redirection to another php form for further input ) } }else{ (display html form) } ?> ""Richard Lynch"" <[EMAIL PROTECTED]> wrote in message 01e801c09ac4$9f0a6520$[EMAIL PROTECTED]">news:01e801c09ac4$9f0a6520$[EMAIL PROTECTED]... > You could do: > > header("Location: page2.php"); > > But you may need to pass some variables such as: > > header("Location: page2.php?SESSID=$SESSID"); > > You'd probably be better of having the error checking at the top of the > second page and sending them *back* to the first page if they got it wrong. > > -- > Visit the Zend Store at http://www.zend.com/store/ > Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > ----- Original Message ----- > From: "Edith Lai" <[EMAIL PROTECTED]> > Newsgroups: php.general > Sent: Monday, February 19, 2001 9:54 AM > Subject: [PHP] Open location automatically after checking > > > > Hi, > > I have a form for user input and after checking, it's gonna go to another > > page for further input. What should i code to bring the second input page > up > > after checking done on the first?? > > Thanks. > > > > Edith Lai > > > > > > > > -- > > 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] >
Hello there fellow programmer, I just started learning PHP (I got version 4 installed with Apache on a Win98 machine). At the moment I'm trying to write a little program that verifies a user login. I know the program is not professional but for me it will do. Only I got stuck with the following problem. I have written a class (I'm not very sure if this is the right way to do this) in which I specified a function that does the password check. Now I like the program to check the password and return me a true or a false which I can read from somewhere else in my program. I wrote it like this: <html> <head> <title>Password Check</title> <?PHP class password { function checkpwd() { ?> <FORM ACTION="<?php print("$PHP_SELF"); ?>" METHOD="POST"> User name is:<BR> <INPUT TYPE="text" NAME="UserName"> <P> <?php echo "Give Password:<BR>" ?> <INPUT TYPE="PASSWORD" NAME="passwd"> <INPUT TYPE="HIDDEN" NAME="GeefInfo" VALUE=1> <p> <INPUT TYPE="submit"> <?PHP if (IsSet($this->GeefInfo)&&IsSet($this->UserName)) { $this->UserName=strtoupper($this->UserName); $this->passwd=strtoupper($this->passwd); if (IsSet($this->passwd)) { if ($this->passwd=="MYPASS" && $this->UserName=="RONALD") { $this-> testvar=1; exit(1); } else { $this-> testvar=0; exit(0); } } } } }?> </head> <body> <?php $exec_pwd=new password; $vexec_pwd->checkpwd(); print $exec_pwd; // Where is my output ????? ?> </body> </html> If you can and like to help me I will be very pleased. Thanks in advance !!! Ronald
try this. <?php class password { function checkpwd() { $this->username = @$GLOBALS['username']; $this->passwd = @$GLOBALS['passwd']; $this->username = strtoupper($this->username); $this->passwd = strtoupper($this->passwd); if ($this->passwd == 'MYPASS' AND $this->username == 'RONALD') return 1; else return 0; } } echo " <html> <head> <title>Password Check</title> </head> <body> <form action='$PHP_SELF' method='post'> User name is:<input type='text' name='username'> <br> Give Password:<input type='password' name='passwd'> <br> <input type='submit'> </form> "; $exec_pwd = new password; if ($exec_pwd->checkpwd() ) echo "GOOD PASS <br>\n"; else echo "BAD PASS <br>\n"; ?> want to use http auth, its another way of doing login/pass <? include_once('cookie.egn'); include_once('database.egn'); function bad_passwd() { echo "You have entered an invalid password.<br>\n"; exit(); } if ( isset($PHP_AUTH_USER) AND isset($PHP_AUTH_PW) AND $peop_r = fetch_db_value('people_manager', "WHERE username = '$PHP_AUTH_USER' AND password = '$PHP_AUTH_PW' ") ) $SessionID = $peop_r['peopleID']; else { Header("WWW-Authenticate: Basic realm='$SERVER_NAME' "); Header("HTTP/1.0 401 Unauthorized"); bad_passwd(); } ?> where cookie.egn sets SessionID as a session var. and database.egn contiains mysql wrapers (fetch_db_value). -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 ""Ronald Hemmink"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello there fellow programmer, I just started learning PHP (I got version 4 installed with Apache on a Win98 machine). At the moment I'm trying to write a little program that verifies a user login. I know the program is not professional but for me it will do. Only I got stuck with the following problem. I have written a class (I'm not very sure if this is the right way to do this) in which I specified a function that does the password check. Now I like the program to check the password and return me a true or a false which I can read from somewhere else in my program. I wrote it like this: <html> <head> <title>Password Check</title> <?PHP class password { function checkpwd() { ?> <FORM ACTION="<?php print("$PHP_SELF"); ?>" METHOD="POST"> User name is:<BR> <INPUT TYPE="text" NAME="UserName"> <P> <?php echo "Give Password:<BR>" ?> <INPUT TYPE="PASSWORD" NAME="passwd"> <INPUT TYPE="HIDDEN" NAME="GeefInfo" VALUE=1> <p> <INPUT TYPE="submit"> <?PHP if (IsSet($this->GeefInfo)&&IsSet($this->UserName)) { $this->UserName=strtoupper($this->UserName); $this->passwd=strtoupper($this->passwd); if (IsSet($this->passwd)) { if ($this->passwd=="MYPASS" && $this->UserName=="RONALD") { $this-> testvar=1; exit(1); } else { $this-> testvar=0; exit(0); } } } } }?> </head> <body> <?php $exec_pwd=new password; $vexec_pwd->checkpwd(); print $exec_pwd; // Where is my output ????? ?> </body> </html> If you can and like to help me I will be very pleased. Thanks in advance !!! Ronald -- 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 Ben, I thought maybe there was something like HTTP_SERVER_VARS["INCLUDE_PATH"], but apparently not. Could you just define your own $GLOBALS["my_include_path"] = and use that with file_exists()?? Mike D. Ben Peter wrote: > > Hi all, > > is there a decent way to check whether a file is available on the > include_path? The only soultion I have found is > > if ( ( $fd = fopen( 'my_file', 'r', 1 ) ) ) { > fclose( $fd ); > /* ok, file is there */ > } > > That one's not really nice, at it opens the file for reading. > > It would be best to have the include_path switch for file_exists, just > as it works with fopen. > > Can someone better my workaround above? > > Cheers, > Ben >
Michael, the include_path is available via ini_get("include_path"). One could split that path by ":", append the filename to each path and check with file_exists(), true. I'm not sure whether this wouldn't be more expensive than using fopen(,,1). Have to check that. Thanks for the idea, Ben Michael Dearman wrote: > > Hi Ben, > I thought maybe there was something like HTTP_SERVER_VARS["INCLUDE_PATH"], > but apparently not. > > Could you just define your own $GLOBALS["my_include_path"] = > and use that with file_exists()?? > > Mike D. > > Ben Peter wrote: > > > > Hi all, > > > > is there a decent way to check whether a file is available on the > > include_path? The only soultion I have found is > > > > if ( ( $fd = fopen( 'my_file', 'r', 1 ) ) ) { > > fclose( $fd ); > > /* ok, file is there */ > > } > > > > That one's not really nice, at it opens the file for reading. > > > > It would be best to have the include_path switch for file_exists, just > > as it works with fopen. > > > > Can someone better my workaround above? > > > > Cheers, > > Ben > >
* John Hallam <[EMAIL PROTECTED]> [010215 17:58]: > I have got php 4.0.4p1 configured with openssl 0.9.6 > and ldap and I'm trying to get an ldap_connect to work > over ldaps as described in the ldap_connect > documentation. > > I have no problem connecting using > ldap_connect(hostname) format but I do have a problem > with the URL format. This is what I am doing :- > > $Host='ldaps://hostname/'; > $ds=ldap_connect($Host); > > What is wrong ?? any ideas ?? > Why don't you try $ds = ldap_connect("hostname", 689); where 689 is port number for SSL connection? If you use another port number, you should change 689 to whatever you use. Victor.
what does configure spit out when compiled with your options? does it say checking for libjpeg (needed by gd-1.8+)... yes checking for jpeg_read_header in -ljpeg... yes checking for gdImageCreateFromJpeg in -lgd... yes if not find out where your jpeg libs are [ie. /usr/local/lib] then change your --with-jpeg-dir=/usr/local -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 ""Michael Bryan"" <[EMAIL PROTECTED]> wrote in message 004001c09af6$ded35cc0$f45efea9@default">news:004001c09af6$ded35cc0$f45efea9@default... > Hey Guys.. > > I've been working on installing GD with support for Jpeg. I cannot seem to > get it working in PHP, however. When I try to use it in practice, I get the > following error: > > Warning: ImageCreateFromJpeg: No JPEG support in this PHP build > > Here's the configure command I used: > > ./configure --with-apache=/usr/local/src/SOURCES/apache_1.3.12 --with-mysql= > /usr/local --with-jpeg-dir=/usr --with-gd=/usr/local --enable-track-vars > > I've tried all different types of directories in the --with-jpeg, and I > can't get anything to work. I thought that perhaps GD wasn't compiled with > Jpeg Support, so I went ahead and installed the RPMs from Redhat, which I > know are compiled with that support..because they require the libjpg package > to install. > > What am I doing wrong? I've compiled until I'm blue in the face. > > The GD Section of phpinfo() shows the following information: > -------------------- > GD Support enabled > GD Version 1.6.2 or higher > PNG Support enabled > WBMP Support enabled > --------------------- > But, why is Jpeg Support not enabled? > > Thanks, > > Michael Bryan > Virginia Beach, VA > > > > -- > 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] >
> An unsuccessful include will give you an error. > > An unsuccessful require will kill the program. Also: require() statements cannot be embedded inside conditionals. For example: <?PHP if ($something) { include("somefile.php") // this is okay. } if ($something) { require("somefile.php") // this is wrong. } ?> The reason: require() is taken care of on an initial pass of the parser, which makes it faster than include(). Unfortunately, that means that the parser doesn't check to see if it's embedded in a conditional statement. Finally, unless you're using these functions to pull in actual HTML, as opposed to code, think hard about using include_once() or require_once(), which spares you those obnoxious "Cannot redefine function blah() in blah blah blah" errors. ----- Sam Leibowitz ([EMAIL PROTECTED]) Project Manager Business Technology Center
Hello all, I need to write a script to grab files via a web port. Is there any way to do this??
Is this what you mean? $fp = fopen("http://www.domain.com/file.xxx", "a+"); -Brian > -----Original Message----- > From: Brian C. Doyle [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 20, 2001 11:27 AM > To: [EMAIL PROTECTED] > Subject: [PHP] file grabber help > > > Hello all, > > I need to write a script to grab files via a web port. Is there any way > to do this?? > > > > -- > 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] > >
That will get me the html/txt files with will definatly save time ... WIll that work with image files??? I dont want to have to go and manually save them all At 11:54 AM 2/20/01 -0500, Brian V Bonini wrote: >Is this what you mean? > >$fp = fopen("http://www.domain.com/file.xxx", "a+"); > >-Brian > > > -----Original Message----- > > From: Brian C. Doyle [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, February 20, 2001 11:27 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] file grabber help > > > > > > Hello all, > > > > I need to write a script to grab files via a web port. Is there any way > > to do this?? > > > > > > > > -- > > 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 my SQL returns no results then i want to redirect to a page saying no results etc but if results are found then I want it to continue on down the script how would i do this. Matt.
by checking the return value of mysql_num_rows() At 04:32 PM 2/20/01 +0000, Matt Davis wrote: >If my SQL returns no results then i want to redirect to a page saying no >results etc but if results are found then I want it to continue on down the >script how would i do this. > >Matt. > > >-- >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]
$sql = "select * from table where bla bla bla"; if(!isset($sql)) { do this; } else { do this; } I think.... ? -Brian ************** > -----Original Message----- > From: Matt Davis [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 20, 2001 11:33 AM > To: Php Mailing List > Subject: [PHP] redirect if sql = nothing > > > If my SQL returns no results then i want to redirect to a page saying no > results etc but if results are found then I want it to continue > on down the > script how would i do this. > > Matt. > > > -- > 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] > >
In a message dated 20/02/2001 16:42:51 GMT Standard Time, [EMAIL PROTECTED] writes: << $sql = "select * from table where bla bla bla"; if(!isset($sql)) { do this; } else { do this; } I think.... ? -Brian >> This way might be a little easier $sql = "select * from table where bla bla bla"; $num_rows = mysql_num_rows($sql); if ($num_rows==0){ header ("Location: Http://www.YOURURL.com/"); } Although depending on the rest of your script the header may have already been sent in which case it won`t work. HTH Ade
Actually this won't work since the actual query never runs.... try: $sql = "select * from table where bla bla bla"; $rResults = mysql_query( $sql, $dbConnection ); if( mysql_num_rows($rResults) == 0 ) { do this; } else { do this; } At 11:52 AM 2/20/01 -0500, Brian V Bonini wrote: >$sql = "select * from table where bla bla bla"; > >if(!isset($sql)) { > do this; >} else { > do this; >} > >I think.... ? > >-Brian >************** > > > -----Original Message----- > > From: Matt Davis [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, February 20, 2001 11:33 AM > > To: Php Mailing List > > Subject: [PHP] redirect if sql = nothing > > > > > > If my SQL returns no results then i want to redirect to a page saying no > > results etc but if results are found then I want it to continue > > on down the > > script how would i do this. > > > > Matt. > > > > > > -- > > 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 have put this code in but its not making any difference if ($num==0) { header("location: http://www.***********/0/cambridgeshire/_shared/database_files/php_files/nor esults.htm"); } else {; } Matt. -----Original Message----- From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]] Sent: 20 February 2001 16:46 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Php Mailing List Subject: RE: [PHP] redirect if sql = nothing Actually this won't work since the actual query never runs.... try: $sql = "select * from table where bla bla bla"; $rResults = mysql_query( $sql, $dbConnection ); if( mysql_num_rows($rResults) == 0 ) { do this; } else { do this; } At 11:52 AM 2/20/01 -0500, Brian V Bonini wrote: >$sql = "select * from table where bla bla bla"; > >if(!isset($sql)) { > do this; >} else { > do this; >} > >I think.... ? > >-Brian >************** > > > -----Original Message----- > > From: Matt Davis [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, February 20, 2001 11:33 AM > > To: Php Mailing List > > Subject: [PHP] redirect if sql = nothing > > > > > > If my SQL returns no results then i want to redirect to a page saying no > > results etc but if results are found then I want it to continue > > on down the > > script how would i do this. > > > > Matt. > > > > > > -- > > 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] -- 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`m using the following code to display the contents of a file..... <? $filename = "category/category.inc"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); fclose ($fd); $content = explode (",", $contents); for ($a=0;$a<count($content);$a++){ printf("<TR><TD><A HREF='showcat.php?Cat=%s'>%s</A></TD></TR>", str_replace(" ","",strtolower($content[$a])), $content[$a]); } ?> It is working fine at the moment but I want to try and be a tad more ambitious, say for example the category.inc contains the following: Paul,Mark,Tom,Ade My code will display the results like so... (Obviously with my HTML in there too) Paul Mark Tom Ade Firstly is there any way I can sort these in alphabetical order?? More importantly is there any way of formatting them so they display Paul Mark Tom Ade So they are in two columns in a table rather than one?? Thanks for any help Ade
In Reply to: >Firstly is there any way I can sort these in alphabetical order?? > >More importantly is there any way of formatting them so they display > >Paul Mark >Tom Ade > >So they are in two columns in a table rather than one?? > >Thanks for any help >Ade <? $filename = "category/category.inc"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); fclose ($fd); $content = explode (",", $contents); // Look at the array functions in the manual. Php has no problem sorting arrays // http://www.php.net/manual/en/function.sort.php sort($content); // I have the habit of taking function calls out of loops // The loop does not need to call function every iteration $array_count = count($content); for ($a=0;$a<$array_count;$a++){ echo "<TR><TD><A HREF='showcat.php?Cat=".$content[$a]."'>"; echo str_replace(" ","",strtolower($content[$a])); echo "</A></TD>"; $a++; echo "<TD><A HREF='showcat.php?Cat=".$content[$a]."'>"; echo str_replace(" ","",strtolower($content[$a])); echo "</A></TD></TR>"; // There is an article on zend.com that clearly states that the // below is incorrect usage of printf // http://www.zend.com/zend/art/mistake.php // printf("<TR><TD><A HREF='showcat.php?Cat=%s'>%s</A></TD></TR>", str_replace(" // ","",strtolower($content[$a])), $content[$a]); } ?> I can't test this, but it should give you some idea of what to do next. Robert Zwink http://zwink.levitate.org -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 11:36 AM To: [EMAIL PROTECTED] Subject: [PHP] Display Format Hi, I`m using the following code to display the contents of a file..... <? $filename = "category/category.inc"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); fclose ($fd); $content = explode (",", $contents); for ($a=0;$a<count($content);$a++){ printf("<TR><TD><A HREF='showcat.php?Cat=%s'>%s</A></TD></TR>", str_replace(" ","",strtolower($content[$a])), $content[$a]); } ?> It is working fine at the moment but I want to try and be a tad more ambitious, say for example the category.inc contains the following: Paul,Mark,Tom,Ade My code will display the results like so... (Obviously with my HTML in there too) Paul Mark Tom Ade Firstly is there any way I can sort these in alphabetical order?? More importantly is there any way of formatting them so they display Paul Mark Tom Ade So they are in two columns in a table rather than one?? Thanks for any help Ade -- 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 folks! How can i do the following using php: in a page i have many checkboxes that were generated dynamically, the user may check many of them, i want that when a checkbox is checked, add it to a session variable ! i thaught of using javascript, but i can't use session variables in javascript. Any idea please ?! _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
is it ok to just check the ckecboxs and hit submit? thats what most sites do? thats real easy todo. follow up if you want some code examples. -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 ""kaab kaoutar"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi folks! > > How can i do the following using php: > in a page i have many checkboxes that were generated dynamically, > the user may check many of them, i want that when a checkbox is checked, add > it to a session variable ! > i thaught of using javascript, but i can't use session variables in > javascript. > Any idea please ?! > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] >
I know this is most assuredly in the manual and I have looked but either the search engine is not robust enough or my eyes require additional laser treatment. I have a string variable called "released" and an integer, 1. I wish to concatenate so that I get the result: "released1". How may I accomplish this? Thanks, Don
<?php $released = 'released'; $released .= '1'; ?> <?php $released = 'released'; $released = $released .'1'; ?> -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 "Don" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I know this is most assuredly in the manual and I have looked but either > the search engine is not robust enough or my eyes require additional > laser treatment. > > I have a string variable called "released" and an integer, 1. I wish to > concatenate so that I get the result: "released1". How may I accomplish > this? > > 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] >
How do i find out what the return status of an exec() executed command means? For example, i have the line $ciphertext = exec("perl /home/httpd/cgi-bin/passgen.pl $plaintext",$arr,$retstat); which makes $retstat = 126. thanks, geo
From: "George Herson" <[EMAIL PROTECTED]> > How do i find out what the return status of an exec() executed command > means? For example, i have the line > > $ciphertext = exec("perl /home/httpd/cgi-bin/passgen.pl > $plaintext",$arr,$retstat); > > which makes $retstat = 126. > > thanks, > geo > That's the return code from passgen.pl. Fortunately being a Perl script you can just open it up and look for an exit(126) line. Otherwise you'll need some docs for the program you're exec()ing.
I'm not familiar with perl, but I would said either the script it's self is returning the code, or the perl interpreter. Chris On Tue, 20 Feb 2001, George Herson wrote: > Date: Tue, 20 Feb 2001 12:13:35 -0500 > To: [EMAIL PROTECTED] > From: George Herson <[EMAIL PROTECTED]> > Subject: [PHP] Where do i look up return status codes? > > How do i find out what the return status of an exec() executed > command > means? For example, i have the line > > $ciphertext = exec("perl /home/httpd/cgi-bin/passgen.pl > $plaintext",$arr,$retstat); > > which makes $retstat = 126. > > thanks, > geo > > > -- > 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] >
for system("perl test.pl", $retval); and exec("perl test.pl", $ary, $retval); the value of $retval is the value that the perl script "test.pl" returns, (not a perl status code). as someone else suggested, go and look for exit(126) statements (or just exit(), if exit returns the value of a variable, and not the constant "126") within the perl script and you'll probably find a little note as to *what* the 126 means... ----- Original Message ----- From: "Chris Carbaugh" <[EMAIL PROTECTED]> To: "George Herson" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, February 20, 2001 5:10 PM Subject: Re: [PHP] Where do i look up return status codes? > > I'm not familiar with perl, but I would said either the script it's self > is returning the code, or the perl interpreter. > > Chris > > On Tue, 20 Feb 2001, George Herson wrote: > > Date: Tue, 20 Feb 2001 12:13:35 -0500 > > To: [EMAIL PROTECTED] > > From: George Herson <[EMAIL PROTECTED]> > > Subject: [PHP] Where do i look up return status codes? > > > > How do i find out what the return status of an exec() executed > > command > > means? For example, i have the line > > > > $ciphertext = exec("perl /home/httpd/cgi-bin/passgen.pl > > $plaintext",$arr,$retstat); > > > > which makes $retstat = 126. > > > > thanks, > > geo > > > > > > -- > > 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] >
Hi! I am trying to get a file deleted when I send a variabel with the value "delete". I have this file: ----- $message = ereg_replace("\r","", $message); $message = "<list><med>$message</med><nam>$name</nam></list>; $fp = fopen (basename($PHP_SELF) . ".xml", "a"); fwrite ($fp, $string); fclose ($fp); ----- and the file I want unlnked is the .xml-file I am very thankful if I can get any help with this. Regards jan
From: "Jan Grafström" <[EMAIL PROTECTED]> > Hi! > I am trying to get a file deleted when I send a variabel with the value > "delete". > I have this file: > > ----- > $message = ereg_replace("\r","", $message); > $message = "<list><med>$message</med><nam>$name</nam></list>; > $fp = fopen (basename($PHP_SELF) . ".xml", "a"); > fwrite ($fp, $string); > fclose ($fp); > ----- > > and the file I want unlnked is the .xml-file > > I am very thankful if I can get any help with this. > Regards jan Try: <? system("rm $file"); ?> :-)
Hello, If I use a form to upload will it time out after 30m seconds ? When the php script runs for 30 seconds it shuts down and I was wondering if the uploading of the file counts for this. Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com --------------------------------------------
Check out http://px.sklar.com/code-pretty.html?code_id=313 It is a post class written by Alan van den Bosch which will do what you want (post to a perl script, retrieve the results, and let you manipulate them from within the posting php script). Here's some code using this class. I've simplified this so it is untested in its current state, but should work. I've used this class in many projects and it works very well. <?php include("post.php"); $a=new http_post; #where do you want to post today $a->set_action("http://$SERVER_ADDR/cgi-bin/hello.pl"); # add some post arguments $a->set_element('foo','bar'); #do the post $res = $a->send(); #strip header $res = strstr($res, "\r\n\r\n"); #display the results echo $res; ?> HTH, J -- Julian Wood Multimedia Developer University of Calgary on 2/19/01 10:15 AM, John Monfort at [EMAIL PROTECTED] wrote: > > > >> 1. It appears if I use the header function I have to redirect the page to >> another page, it doesn't appear possible to retrieve a page into the current >> page? Unless someone can show me some code that would do that. >> > > If all you want is to display the remote page, within the local page, > then all you need is fpassthru() > > ex. > > $server = "http://www.site.com"; > > $fp = fopen($server,"r") // "r" is for reading > fpassthru($fp); > > This will display the results of the remote file (html or whatever) into > the local file (in this case, your PHP file). > > >> >> >>> -----Original Message----- >>> From: Milan Mlynarcik [SMTP:[EMAIL PROTECTED]] >>> Sent: Monday, February 19, 2001 7:33 AM >>> To: Montgomery-Recht, Evan >>> Subject: Re: [PHP] HTTP POST Question >>> >>> You have to use header() function and how POST work you can find in HTTP >>> RFC >>> at http://www.w3.org/Protocols/rfc2616/rfc2616.html >>> ------------------------------------------------------------- >>> Milan Mlynarcik >>> Web Programmer >>> Charmed Technology Slovakia >>> Nam. sv. Egidia 16/37 >>> 058 01 Poprad, Slovakia >>> E-mail: [EMAIL PROTECTED] >>> Office: 00421 92 7881 874 >>> Mobile: 00421 905 964 535 >>> Web page: http://www.charmed.com/ >>> ------------------------------------------------------------- >>> ----- Original Message ----- >>> From: "Montgomery-Recht, Evan" <[EMAIL PROTECTED]> >>> To: <[EMAIL PROTECTED]> >>> Sent: Monday, February 19, 2001 1:06 PM >>> Subject: [PHP] HTTP POST Question >>> >>> >>>> Good morning... >>>> >>>> This should be a good monday morning question. >>>> >>>> I have a cgi-bin written in perl (it's actually, a interface to a >>>> perl-module which is a interface to a telnet-like protocol). >>>> >>>> Anyways what I need to do is I have already existing code written in >>> PHP, >>>> but at some point I need to call this cgi-bin and get a return code from >>> it >>>> and process (good/bad result) and return to completed php script that >>> says >>>> it called this cgi-bin. It's not very clear how to set the >>> HTTP_POST_VARS >>>> for sending to a post command (which doesn't seem to exist); >>>> >>>> Any ideas I don't see a function called: >>>> >>>> $HTTP_POST_VARS =set variables; >>>> $result = http_post("http://localhost/cgi-bin/script.pl"); >>>> >>>> Thanks, >>>> >>>> evan >>>> >>>> PS. I'd appricate a working example, even if it's a dummy version. >>>> >>>> -- >>>> 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] >> >> >
Thankyou Julian but I am posting my variable from flash5. The posting is not my problem. I just can`t write the unlink code. Julian Wood wrote: > Check out http://px.sklar.com/code-pretty.html?code_id=313 > > It is a post class written by Alan van den Bosch which will do what you want > (post to a perl script, retrieve the results, and let you manipulate them > from within the posting php script). Here's some code using this class. I've > simplified this so it is untested in its current state, but should work. > I've used this class in many projects and it works very well. > > <?php > > include("post.php"); > > $a=new http_post; > > #where do you want to post today > $a->set_action("http://$SERVER_ADDR/cgi-bin/hello.pl"); > > # add some post arguments > $a->set_element('foo','bar'); > > #do the post > $res = $a->send(); > > #strip header > $res = strstr($res, "\r\n\r\n"); > > #display the results > echo $res; > > ?> > > HTH, > > J > > -- > Julian Wood > > Multimedia Developer > University of Calgary > > on 2/19/01 10:15 AM, John Monfort at [EMAIL PROTECTED] wrote: > > > > > > > > >> 1. It appears if I use the header function I have to redirect the page to > >> another page, it doesn't appear possible to retrieve a page into the current > >> page? Unless someone can show me some code that would do that. > >> > > > > If all you want is to display the remote page, within the local page, > > then all you need is fpassthru() > > > > ex. > > > > $server = "http://www.site.com"; > > > > $fp = fopen($server,"r") // "r" is for reading > > fpassthru($fp); > > > > This will display the results of the remote file (html or whatever) into > > the local file (in this case, your PHP file). > > > > > >> > >> > >>> -----Original Message----- > >>> From: Milan Mlynarcik [SMTP:[EMAIL PROTECTED]] > >>> Sent: Monday, February 19, 2001 7:33 AM > >>> To: Montgomery-Recht, Evan > >>> Subject: Re: [PHP] HTTP POST Question > >>> > >>> You have to use header() function and how POST work you can find in HTTP > >>> RFC > >>> at http://www.w3.org/Protocols/rfc2616/rfc2616.html > >>> ------------------------------------------------------------- > >>> Milan Mlynarcik > >>> Web Programmer > >>> Charmed Technology Slovakia > >>> Nam. sv. Egidia 16/37 > >>> 058 01 Poprad, Slovakia > >>> E-mail: [EMAIL PROTECTED] > >>> Office: 00421 92 7881 874 > >>> Mobile: 00421 905 964 535 > >>> Web page: http://www.charmed.com/ > >>> ------------------------------------------------------------- > >>> ----- Original Message ----- > >>> From: "Montgomery-Recht, Evan" <[EMAIL PROTECTED]> > >>> To: <[EMAIL PROTECTED]> > >>> Sent: Monday, February 19, 2001 1:06 PM > >>> Subject: [PHP] HTTP POST Question > >>> > >>> > >>>> Good morning... > >>>> > >>>> This should be a good monday morning question. > >>>> > >>>> I have a cgi-bin written in perl (it's actually, a interface to a > >>>> perl-module which is a interface to a telnet-like protocol). > >>>> > >>>> Anyways what I need to do is I have already existing code written in > >>> PHP, > >>>> but at some point I need to call this cgi-bin and get a return code from > >>> it > >>>> and process (good/bad result) and return to completed php script that > >>> says > >>>> it called this cgi-bin. It's not very clear how to set the > >>> HTTP_POST_VARS > >>>> for sending to a post command (which doesn't seem to exist); > >>>> > >>>> Any ideas I don't see a function called: > >>>> > >>>> $HTTP_POST_VARS =set variables; > >>>> $result = http_post("http://localhost/cgi-bin/script.pl"); > >>>> > >>>> Thanks, > >>>> > >>>> evan > >>>> > >>>> PS. I'd appricate a working example, even if it's a dummy version. > >>>> > >>>> -- > >>>> 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] > >> > >> > > > > -- > 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]
Hmmm, I'm sorry - I didn't see any mention of flash in this thread. That is a completely different story from what has been talked about so far. What do you mean you can't write the unlink code? You mean you want to delete a file somewhere from flash? That shouldn't be a problem - post from flash to a php script - the script can do the unlink (make sure you have correct permissions and *build* the correct path), then return a result code back to flash. Not sure if I'm on target for your question or not. HTH, J -- Julian Wood Multimedia Developer University of Calgary on 2/20/01 9:46 AM, Jan Grafström at [EMAIL PROTECTED] wrote: > > Thankyou Julian but I am posting my variable from flash5. > The posting is not my problem. I just can`t write the unlink code. > > Julian Wood wrote: > >> Check out http://px.sklar.com/code-pretty.html?code_id=313 >> >> It is a post class written by Alan van den Bosch which will do what you want >> (post to a perl script, retrieve the results, and let you manipulate them >> from within the posting php script). Here's some code using this class. I've >> simplified this so it is untested in its current state, but should work. >> I've used this class in many projects and it works very well. >> >> <?php >> >> include("post.php"); >> >> $a=new http_post; >> >> #where do you want to post today >> $a->set_action("http://$SERVER_ADDR/cgi-bin/hello.pl"); >> >> # add some post arguments >> $a->set_element('foo','bar'); >> >> #do the post >> $res = $a->send(); >> >> #strip header >> $res = strstr($res, "\r\n\r\n"); >> >> #display the results >> echo $res; >> >> ?> >> >> HTH, >> >> J >> >> -- >> Julian Wood >> >> Multimedia Developer >> University of Calgary >> >> on 2/19/01 10:15 AM, John Monfort at [EMAIL PROTECTED] wrote: >> >>> >>> >>> >>>> 1. It appears if I use the header function I have to redirect the page to >>>> another page, it doesn't appear possible to retrieve a page into the >>>> current >>>> page? Unless someone can show me some code that would do that. >>>> >>> >>> If all you want is to display the remote page, within the local page, >>> then all you need is fpassthru() >>> >>> ex. >>> >>> $server = "http://www.site.com"; >>> >>> $fp = fopen($server,"r") // "r" is for reading >>> fpassthru($fp); >>> >>> This will display the results of the remote file (html or whatever) into >>> the local file (in this case, your PHP file). >>> >>> >>>> >>>> >>>>> -----Original Message----- >>>>> From: Milan Mlynarcik [SMTP:[EMAIL PROTECTED]] >>>>> Sent: Monday, February 19, 2001 7:33 AM >>>>> To: Montgomery-Recht, Evan >>>>> Subject: Re: [PHP] HTTP POST Question >>>>> >>>>> You have to use header() function and how POST work you can find in HTTP >>>>> RFC >>>>> at http://www.w3.org/Protocols/rfc2616/rfc2616.html >>>>> ------------------------------------------------------------- >>>>> Milan Mlynarcik >>>>> Web Programmer >>>>> Charmed Technology Slovakia >>>>> Nam. sv. Egidia 16/37 >>>>> 058 01 Poprad, Slovakia >>>>> E-mail: [EMAIL PROTECTED] >>>>> Office: 00421 92 7881 874 >>>>> Mobile: 00421 905 964 535 >>>>> Web page: http://www.charmed.com/ >>>>> ------------------------------------------------------------- >>>>> ----- Original Message ----- >>>>> From: "Montgomery-Recht, Evan" <[EMAIL PROTECTED]> >>>>> To: <[EMAIL PROTECTED]> >>>>> Sent: Monday, February 19, 2001 1:06 PM >>>>> Subject: [PHP] HTTP POST Question >>>>> >>>>> >>>>>> Good morning... >>>>>> >>>>>> This should be a good monday morning question. >>>>>> >>>>>> I have a cgi-bin written in perl (it's actually, a interface to a >>>>>> perl-module which is a interface to a telnet-like protocol). >>>>>> >>>>>> Anyways what I need to do is I have already existing code written in >>>>> PHP, >>>>>> but at some point I need to call this cgi-bin and get a return code from >>>>> it >>>>>> and process (good/bad result) and return to completed php script that >>>>> says >>>>>> it called this cgi-bin. It's not very clear how to set the >>>>> HTTP_POST_VARS >>>>>> for sending to a post command (which doesn't seem to exist); >>>>>> >>>>>> Any ideas I don't see a function called: >>>>>> >>>>>> $HTTP_POST_VARS =set variables; >>>>>> $result = http_post("http://localhost/cgi-bin/script.pl"); >>>>>> >>>>>> Thanks, >>>>>> >>>>>> evan >>>>>> >>>>>> PS. I'd appricate a working example, even if it's a dummy version. >>>>>> >>>>>> -- >>>>>> 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] >>>> >>>> >>> >> >> -- >> 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! well I've managed to make it work by comparing the checkbbox value (on)! Thanks anyway _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Hello, I am using the Header call in a script that has multiple submit buttons: if ($submit =1) { Header (location: test1.php); } if ($submit ==2) { Header(location: test2.php); } Should not the form varaibles be passed along to each of these pages respectively? I have about 30 variables that should be passed to each different page...none of these variables are showing up. Do I need to attach these to the url for each different header? such as: Header ("Location: test1.php?add=1&name=juan"); ??? Thanks Christopher C. M. Allen
Christopher Allen wrote: > Hello, > I am using the Header call in a script that has multiple submit buttons: > > if ($submit =1) > { > Header (location: test1.php); > } > if ($submit ==2) > { > Header(location: test2.php); > } > > Should not the form varaibles be passed along to each of these pages > respectively? I have about 30 variables that should be passed to each > different page...none of these variables are showing up. Do I need to attach > these to the url for each different header? > such as: > Header ("Location: test1.php?add=1&name=juan"); > ??? > > Thanks > > Christopher C. M. Allen > > yes
The answer is yes, you need to pass along your form variables. You could do this with the following: <?php $formVars = ""; //Use $HTTP_GET_VARS if form is a get type while(list($name,$value)=each($HTTP_POST_VARS)) { $formVars .= $name . "=" . $value . "&"; } if($submit == 2) Header("Location: test2.php?" . $formVars); ?> Hope that helps you out some. Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here > if ($submit ==2) > { > Header(location: test2.php); > } > > Should not the form varaibles be passed along to each of these pages > respectively? I have about 30 variables that should be passed to each > different page...none of these variables are showing up. Do I > need to attach > these to the url for each different header? > such as: > Header ("Location: test1.php?add=1&name=juan");
I'm having problem with a php script. I get a valid insert statment echoed to the screen but I don't get a result from it. If I cut and paste into the SQL query box in PHPMyadmin, it insert fine, but it will not do it from the script. Through debuging (echoing to the screen), I have determinde that it is connecting to the database and it does get the variables passed to it, but it just won't work. Here is the PHP. <html> <!-- Coded by the grace of God! --> <LINK REL=stylesheet HREF="../index.css" TYPE="text/css"> <? $db = mysql_connect("localhost", "root", ""); mysql_select_db("memberstest",$db); echo "db = ".$db."<p>"; $date = date("m.d.y"); echo "date ".$date."<p>"; if (!$name || !$year || !$make || !$model || !$pass || !$cab || !$drive || !$active || !$mlist || !$pass || !$loc) { echo "<P><CENTER><TABLE WIDTH=\"500\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\"> <TR> <TD WIDTH=\"500\"><P><CENTER><FONT SIZE=\"+2\">You didn't fill in the required fields!</FONT></CENTER><P><CENTER><FONT SIZE=\"+2\">Press the back button on your browser and fill in the required fields which have a </FONT><FONT COLOR=\"#ff0000\" SIZE=\"+2\">*</FONT><FONT SIZE=\"+2\"> next to them.</FONT></CENTER></TD> </TR> </TABLE> "; exit(); } echo "passed requirements<p>"; $sql = "INSERT INTO memberstest VALUES ('', '$name', '$icq', '$loc', '$active', '$date', '$mlist', '$email', '$url', '$year', '$make', '$model', '', '$et', '$mph', '$six', '$track', '$engine', '$notes', '', '$pass', '$drive', '$cab', '$length', '', '$aim', '$irc', '$city', '$bday', '$color', '$emods', '$tmods', '$elec', '$hmods', '$bmods', '$app', '$audio', '$user', '$vin')"; echo "sql = ".$sql."<p>"; $result = mysql_query($sql); echo "result = ".$result."<p>"; $myrow = mysql_fetch_array($result); echo "my row = ".$myrow."<p>"; if ($result) { echo "<p><center><B>Thank you!</B><P>Your Member info has been added to the database.</center>"; $sql = "SELECT id FROM memberstest WHERE name=$name AND date=$date AND model=$model"; $result = mysql_query($sql); $myrow = mysql_fetch_array($result); echo "id = ".$id."<p>"; $pic1 = $id.$picture1_name; $pic2 = $id.$upicture1_name; echo "pic1<p>"; if($picture1 == 'none'){ $pic1="na.gif"; } echo $pic1."<p>"; echo "pic2<p>"; if($upicture1 == 'none'){ $pic2="na.gif"; } echo $pic2."<p>"; $sql = "UPDATE memberstest SET $pic1='$pic1' and $pic2='$pic2' WHERE id=$id"; exec("cp $picture1 /var/www/html/members/images/$pic1"); exec("cp $upicture1 /var/www/html/members/images/$pic2"); echo $pic1."<p>"; echo $pic2."<p>"; echo "<head><meta HTTP-EQUIV=\"Refresh\" CONTENT=\"10\" URL=\"http://www.s-series.org/member/detail-wip?".$myrow["id"]."></head>"; Here is what gets echoed to the screen. db = Resource id #1 date 02.20.01 passed requirements sql = INSERT INTO memberstest VALUES ('', 'Kenneth R Zink II', '5095094', 'Texas', 'yes', '02.20.01', 'yes', '[EMAIL PROTECTED]', 'http://www.s-series.org/htm/firestorm/firestorm.htm', '1985', 'Chevrolet', 'Blazer', '', '0.000', '0.000', '0.000', '', '3.4L', '', '', '', '2WD', '2 Door', '', '', '', '', 'Spring', '14 December 1976', 'Red', 'See my project page for details.', 'See my project page for details.', 'See my project page for details.', 'See my project page for details.', 'See my project page for details.', 'See my project page for details.', 'this is a test. let\'s see if this goes through.', '', '1gtcs14r3h8515786') result = Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/member/add2-wip.php on line 31 my row = What am I doing wrong??? I can cut and pas Kenneth R Zink II [EMAIL PROTECTED] ICQ# 5095094 '87 2.8L TBI GMC S-15 Ext. Cab (Hurricane) ...524 in the works !!! http://www.s-series.org/htm/windstorm/project-windstorm.htm '85 3.4L Carbed Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI DIS !!! http://www.s-series.org/htm/firestorm/firestorm.htm Racing by the Grace of God!!
Try adding where the Values go.... "INSERT INTO memberstest (Name, ICQ, Location) VALUES ('', '$name', '$icq', '$loc', '$active', '$date', '$mlist', '$email', '$url', '$year', '$make', '$model', '', '$et', '$mph', '$six', '$track', '$engine', '$notes', '', '$pass', '$drive', '$cab', '$length', '', '$aim', '$irc', '$city', '$bday', '$color', '$emods', '$tmods', '$elec', '$hmods', '$bmods', '$app', '$audio', '$user', '$vin')"; Where Name, ICQ and Location are all Valid table rows HTH Ade
Hi - Is there some way I can get the name of the currently executing function? For example: <?php function MyFunction () { echo "The currently executing function is: " . <here> ; } MyFunction(); ?> I want this to produce: The currently executing function is: MyFunction() Is there some way to do this in PHP? Thanks - Jim
I don't think you can do that yet. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Ide, Jim" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Tuesday, February 20, 2001 12:19 PM Subject: [PHP] Get name of current function > > Hi - > > Is there some way I can get the name of the currently executing function? > > For example: > > <?php > > function MyFunction () { > echo "The currently executing function is: " . <here> ; > } > > MyFunction(); > > ?> > > I want this to produce: > The currently executing function is: MyFunction() > > Is there some way to do this in PHP? > > Thanks - > Jim > > > -- > 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 have a page taht is generated dynamically and that the user may email! the question is how can the receiver receives it as "an html" file whatever email software he's using ? I thouhgt of using mailto but i need a form however i have no inputs to use it, it's worthless! Thanks _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Hi i have a page taht is generated dynamically and that the user may email! the question is how can the receiver receives it as "an html" file whatever email software he's using ? I thouhgt of using mailto but i need a form however i have no inputs to use it, it's worthless! Thanks _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Hi! how can i email from a page, that page as attachment ? thanks _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> how can i email from a page, that page as attachment ? http://www.phpwizard.net/resources/phpMisc/scripts/pretty/mail.php3 Bye, Atom
Hi! I am trying to delete all text in a file. $yourfile = "file.txt"; $fp = fopen($yourfile,w) "is there any good code to put in here?" fclose($fp); Thanks for any help. Regards Jan
> I am trying to delete all text in a file. > $yourfile = "file.txt"; > $fp = fopen($yourfile,w) > "is there any good code to put in here?" > fclose($fp); You should check that $fp is valid. if (!$fp){ echo "Unable to empty $yourfile<BR>\n"; } But pretty much, the fopen($yourfile, 'w') is going to make the file be empty. NOTE: If you are doing this for security reasons, that doesn't mean that a *real* hacker can't have some sort of tool to dig into random bytes of the hard drive and see what used to be in the file... But any user that has that much access to your web server probably has more interesting things to do to mess you up... Still, there may be better ways to wipe the data itself out if it's particularly sensitive. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
PHP 4.04pl1, PostgresQL 7.0.3 on a RedHat 6.2 system. I'm trying to get session data to be stored in a postgres table. I'm using the pgsql session handler from http://www.csh.rit.edu/~jon/projects/php/pgsql_session_handler/, and I think I've got it set up correctly, but I thought I'd ask here first. With the following test script +----------------------------------------------------------------- | <? include("pgsql_session_handler.inc"); ?> | <? | session_start(); | session_register("count"); | $HTTP_SESSION_VARS[count]++; | ?> | <html> | <head> | <title>Test page</title> | </head> | <body> | Hello! You've been here <?= $HTTP_SESSION_VARS[count]; ?> times!<br> | | <? print "To continue, <A HREF=\"test-session.php\">click here</a>"; ?> | | </body> | </html> +----------------------------------------------------------------- I can see php querying the database for session data (in the postgres logs), but never writing session data to the database. Thus, the counter is always '1'. Any ideas where I'm going wrong? Why wouldn't session data get written to the database? Thanks, -- Steve <[EMAIL PROTECTED]> Now playing: Five Magics (Megadeth - "Rust In Peace")
The writing of the session data occurs *after* the server-browser HTTP connection is cut. If you have any error-reporting happening in your session_write function, you won't see it. Alter that function to log errors to a file or something. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Bolt Thrower <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Tuesday, February 20, 2001 12:45 PM Subject: [PHP] Postgresql session handling > PHP 4.04pl1, PostgresQL 7.0.3 on a RedHat 6.2 system. > > I'm trying to get session data to be stored in a > postgres table. I'm using the pgsql session handler from > http://www.csh.rit.edu/~jon/projects/php/pgsql_session_handler/, and I > think I've got it set up correctly, but I thought I'd ask here first. > With the following test script > > +----------------------------------------------------------------- > | <? include("pgsql_session_handler.inc"); ?> > | <? > | session_start(); > | session_register("count"); > | $HTTP_SESSION_VARS[count]++; > | ?> > | <html> > | <head> > | <title>Test page</title> > | </head> > | <body> > | Hello! You've been here <?= $HTTP_SESSION_VARS[count]; ?> times!<br> > | > | <? print "To continue, <A HREF=\"test-session.php\">click here</a>"; ?> > | > | </body> > | </html> > +----------------------------------------------------------------- > > I can see php querying the database for session data (in the postgres > logs), but never writing session data to the database. Thus, the > counter is always '1'. > > Any ideas where I'm going wrong? Why wouldn't session data get > written to the database? > > Thanks, > -- > Steve <[EMAIL PROTECTED]> > Now playing: Five Magics > (Megadeth - "Rust In Peace") > > -- > 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 just need to tell all of you about my terrible hosting experience with yourwebhost.com which owned by hostingventures.com which is also kinda owned by alabanza.com (same owners, I believe, different company) Anyway. I have several sites hosted for free with them because they USED to host non-profit organizations for free. We just haven't rocked the boat with them so we remain free. ;-) Well, what I'm about to say may be followed with "That's what you expect with a free hosting service." But they have done this to a paying client too. Two weeks ago they moved one of the domains I work with to another server (without prior notification) and they didn't bother even check the front page of the website to see if it came up correctly! The database wasn't moved over so almost the whole site was completely broken. Then The SSL Cert wasn't brought over with it (I found out later) so no orders could be taken. Two day later I realized that Cybercash was not installed on the same location on the server as the last server so no credit card charges could go through! 5 days went by with no e-commerce and 2 of those five days the site was completely disabled! When I e-mailed them (tried calling, no answer even though they have 'phone support' listed as an option on their website.) and they simply replied with 'the site is now working'. No explanation, no apology, nothing. I was so angry. I finally weeded an apology out of them and they offered me three months of free hosting. Well, gee, we're free hosted so there's nothing they can give us. I simply said that I hoped they learned that prior notification and CHECKING OUT THE SITE would be things they would do next time. Now, two weeks later I find today, BAM they did it to TWO MORE DOMAINS that I have hosted with them! I cannot believe this company. So, I try calling, I leave voicemail, no response. I call and hit 'zero' for the operator, it will either jump from phone to phone and eventually hit voicemail or they will pick up the phone and hang it up! Can you believe that?! Stay away from these guys, they're terrible. -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
Actually alabanza hosts a number of "hosting" companies from their baltimore <sp?> location. About two weeks ago a "hosting" service I used went down, they use alabanza as well, down for almost two days. Then when it did come up, the permissions were all wrong and I couldn't change the files for a time. The problem appears to be with the alabanza servers and that caused problems for a number of "hosting" services. rm --- Thomas Deliduka <[EMAIL PROTECTED]> wrote: > I just need to tell all of you about my terrible > hosting experience with > yourwebhost.com which owned by hostingventures.com > which is also kinda owned > by alabanza.com (same owners, I believe, different > company) > __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
We host and provide servers to a good number of clients that have come over from Alabanza. All of them complaining of similar experiences.... I think that company has been plagued for a long time.... -Brian *************** > -----Original Message----- > From: richard merit [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 20, 2001 3:02 PM > To: Thomas Deliduka; PHP List > Subject: Re: [PHP] Terrible Hosting Experience > > > Actually alabanza hosts a number of "hosting" > companies from their baltimore <sp?> location. About > two weeks ago a "hosting" service I used went down, > they use alabanza as well, down for almost two days. > Then when it did come up, the permissions were all > wrong and I couldn't change the files for a time. The > problem appears to be with the alabanza servers and > that caused problems for a number of "hosting" > services. > > rm > > > --- Thomas Deliduka <[EMAIL PROTECTED]> wrote: > > I just need to tell all of you about my terrible > > hosting experience with > > yourwebhost.com which owned by hostingventures.com > > which is also kinda owned > > by alabanza.com (same owners, I believe, different > > company) > > > > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - only $35 > a year! http://personal.mail.yahoo.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 2/20/01 3:02 PM this was written: > Actually alabanza hosts a number of "hosting" > companies from their baltimore <sp?> location. About > two weeks ago a "hosting" service I used went down, > they use alabanza as well, down for almost two days. > Then when it did come up, the permissions were all > wrong and I couldn't change the files for a time. The > problem appears to be with the alabanza servers and > that caused problems for a number of "hosting" > services. Yeah, they're the biggens. The history is that Alabanza used to be a Virtual Hosting service as well as dedicated. Well, they sold off their virtual hosting clients to "yourwebhost.com", which is owned by the same person and, they simply provide dedicated services now. Many of the Hosting companies that I have found to have great plans were all Alabanza-hosted companies. I knew a good friend of mine who worked for one of them. He said the servers they had from them were the most insecure on the Internet. When they would lock it down, Alabanza would open the hole again and tell them to stop messing with the server. One day they changed their root passwords and locked down the server tight (security-wise) They were given a cease and desist order. I have heard, however, that they have gotten a little more security conscience since then. -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
On 2/20/01 3:17 PM this was written: > We host and provide servers to a good number > of clients that have come over from Alabanza. > All of them complaining of similar experiences.... > I think that company has been plagued for a > long time.... I agree. I have dealt with them on one level or another since 1997. They used to have great customer service and skillful people. Well, those people left out of frustration and better opportunities and they were replaced with idiots. These idiots that man their help desks and other services now have very little to know about how to even work a computer. I know that they have their help their help-desk in a college town and employ people from the university. Some of the CS reps are philosophy and other liberal arts students. I called one day to give my updated credit card information to a billing rep but they weren't in so I got a CS rep. They said, "You can update it online", I said, "Your control panel isn't behind a secure server. I will not update my Credit card information online." I asked her write it down, put it in an envelope and deliver it to the billing rep by hand. The CS rep said, "No problem." About a week later I received an e-mail. I was forwarded from the CS rep the conversation that took place 0VER E-MAIL with my CC information included in the e-mail from the very first sending. I was so mad. I told her that she just compromised my CC number! She said, "But I sent it right to her in the office." I said, "You office is in a whole-nother state from where the server is. It traveled unsecurely from your location to the server and back again several times in the last few days." she was clueless. Okay, I'm shutting up now. -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
I was about to buy a server from Alabanza. Am I ever glad I didn't. The only thing impressive about them is their connection. And for all I know they could be lying about that, as well. Mike -----Original Message----- From: Thomas Deliduka [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 3:18 PM To: PHP List Subject: Re: [PHP] Terrible Hosting Experience On 2/20/01 3:17 PM this was written: > We host and provide servers to a good number > of clients that have come over from Alabanza. > All of them complaining of similar experiences.... > I think that company has been plagued for a > long time.... I agree. I have dealt with them on one level or another since 1997. They used to have great customer service and skillful people. Well, those people left out of frustration and better opportunities and they were replaced with idiots. These idiots that man their help desks and other services now have very little to know about how to even work a computer. I know that they have their help their help-desk in a college town and employ people from the university. Some of the CS reps are philosophy and other liberal arts students. I called one day to give my updated credit card information to a billing rep but they weren't in so I got a CS rep. They said, "You can update it online", I said, "Your control panel isn't behind a secure server. I will not update my Credit card information online." I asked her write it down, put it in an envelope and deliver it to the billing rep by hand. The CS rep said, "No problem." About a week later I received an e-mail. I was forwarded from the CS rep the conversation that took place 0VER E-MAIL with my CC information included in the e-mail from the very first sending. I was so mad. I told her that she just compromised my CC number! She said, "But I sent it right to her in the office." I said, "You office is in a whole-nother state from where the server is. It traveled unsecurely from your location to the server and back again several times in the last few days." she was clueless. Okay, I'm shutting up now. -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.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]
Hmmm, last I heard they were using an OC-3 circuit, that's not too impressive..... lots of those floating around..... We've been running on an OC-48 for some time now.... > -----Original Message----- > From: Krznaric Michael [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 20, 2001 5:56 PM > To: 'Thomas Deliduka'; PHP List > Subject: RE: [PHP] Terrible Hosting Experience > > > I was about to buy a server from Alabanza. Am I ever glad I didn't. The > only thing impressive about them is their connection. And for all I know > they could be lying about that, as well. > > Mike > > -----Original Message----- > From: Thomas Deliduka [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 20, 2001 3:18 PM > To: PHP List > Subject: Re: [PHP] Terrible Hosting Experience > > > On 2/20/01 3:17 PM this was written: > > > We host and provide servers to a good number > > of clients that have come over from Alabanza. > > All of them complaining of similar experiences.... > > I think that company has been plagued for a > > long time.... > > I agree. I have dealt with them on one level or another since 1997. They > used to have great customer service and skillful people. Well, > those people > left out of frustration and better opportunities and they were > replaced with > idiots. These idiots that man their help desks and other > services now have > very little to know about how to even work a computer. > > I know that they have their help their help-desk in a college town and > employ people from the university. Some of the CS reps are philosophy and > other liberal arts students. > > I called one day to give my updated credit card information to a > billing rep > but they weren't in so I got a CS rep. They said, "You can update it > online", I said, "Your control panel isn't behind a secure server. I will > not update my Credit card information online." I asked her write it down, > put it in an envelope and deliver it to the billing rep by hand. > The CS rep > said, "No problem." > > About a week later I received an e-mail. I was forwarded from the > CS rep the > conversation that took place 0VER E-MAIL with my CC information > included in > the e-mail from the very first sending. I was so mad. I told her that she > just compromised my CC number! She said, "But I sent it right to > her in the > office." I said, "You office is in a whole-nother state from where the > server is. It traveled unsecurely from your location to the > server and back > again several times in the last few days." she was clueless. > > Okay, I'm shutting up now. > -- > > Thomas Deliduka > IT Manager > ------------------------- > New Eve Media > The Solution To Your Internet Angst > http://www.neweve.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] > > -- > 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'm testing email address, but want to test not only characters but the @ sign and for .com, .net, .org, or .tv. How would I include all of these? $test = $email if( ereg("[a-zA-Z0-9]+)\@([a-zA-Z0-9]+)\.com how would I include the rest? _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
There's a code section at zend.com. I noticed someone wrote an email check routine that checks for all domains and the correct format. You might try there. rm --- "W.D." <[EMAIL PROTECTED]> wrote: > I'm testing email address, but want to test not only > characters but the @ > sign and for .com, .net, .org, or .tv. How would I > include all of these? > > $test = $email > if( ereg("[a-zA-Z0-9]+)\@([a-zA-Z0-9]+)\.com > how would I include the > rest? > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at > http://mail.yahoo.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] > __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
this will work... (if you wnat to check against any other possible domains, just add it into the "|" separated list... (com|edu|cc|uk|org|tv), and so on. (the following regexp should be all on one line) preg_match("/([a-zA-Z0-9]+)\@([a-zA-Z0-9]+)\.(com|edu|net|org|tv)/", $email); ----- Original Message ----- From: "richard merit" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 20, 2001 3:06 PM Subject: Re: [PHP] ereg match problem > There's a code section at zend.com. I noticed someone > wrote an email check routine that checks for all > domains and the correct format. You might try there. > > rm > > --- "W.D." <[EMAIL PROTECTED]> wrote: > > I'm testing email address, but want to test not only > > characters but the @ > > sign and for .com, .net, .org, or .tv. How would I > > include all of these? > > > > $test = $email > > if( ereg("[a-zA-Z0-9]+)\@([a-zA-Z0-9]+)\.com > > how would I include the > > rest? > >
Hello Everybody... I'm having problems with my printer. I'm generating fiscal documents in PHP and I have to print this documents in a 9 pin printer. The printer doesn't print in bi-direcional mode. If I print in MS-DOS mode the printer prints in bi-direcional. Exists a way to print, in client's side, a document in MS-DOS mode using PHP? I'm waiting for answers. Thanks Emerson Souza Melo
> I'm having problems with my printer. I'm generating fiscal documents > in PHP and I have to print this documents in a 9 pin printer. The > printer doesn't print in bi-direcional mode. If I print in MS-DOS mode > the printer prints in bi-direcional. > Exists a way to print, in client's side, a document in MS-DOS mode > using PHP? PHP doesn't have anything to do with the printer on the client... Can you print a normal test document from NotePad or any page from your browser? -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
Hi! I am installing the FreeTDS so that unix machine can use PHP to connect to MS-SQL Server using odbc_connect. However, the direction is pretty tricky and it isn't much of a help in clarification. I have been wonder if I am suppose to use the sybase environment variable and library path. From what I understand is that I don't need to use those because it is for SYBASE only. All I can do is to compile FreeTDS with the "./config --with-sybase=../freetds-0.51" and it would take care of that for PHP use. Am I wrong? Please help me out! Thanks, Scott
Scott Fletcher wrote: > Hi! I am installing the FreeTDS so that unix machine can use PHP to > connect to MS-SQL Server using odbc_connect. I assume you mean mssql_connect, not odbc_connect. > However, the direction is > pretty tricky and it isn't much of a help in clarification. I have been > wonder if I am suppose to use the sybase environment variable and library > path. From what I understand is that I don't need to use those because it > is for SYBASE only. All I can do is to compile FreeTDS with the > "./config --with-sybase=../freetds-0.51" and it would take care of that for > PHP use. > You might have to set the sybase variable, but I don't think I did. It wasn't too much harder than ./configure ./make ./make install, then compiling PHP with --with-sybase=/usr/local/freetds Did this not work? > > Am I wrong? Please help me out! > > Thanks, > Scott > > -- > 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 can't user mssql_connect, I'm using odbc_connect! Most of the websites for my company use odbc_connect. Because we sometime move the website from unix to windows and back. So, it is more reliable that way. Scott "Michael Kimsal" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > Scott Fletcher wrote: > > > Hi! I am installing the FreeTDS so that unix machine can use PHP to > > connect to MS-SQL Server using odbc_connect. > > I assume you mean mssql_connect, not odbc_connect. > > > > However, the direction is > > pretty tricky and it isn't much of a help in clarification. I have been > > wonder if I am suppose to use the sybase environment variable and library > > path. From what I understand is that I don't need to use those because it > > is for SYBASE only. All I can do is to compile FreeTDS with the > > "./config --with-sybase=../freetds-0.51" and it would take care of that for > > PHP use. > > > > You might have to set the sybase variable, but I don't think I did. > It wasn't too much harder than ./configure ./make ./make install, > then compiling PHP with --with-sybase=/usr/local/freetds > > Did this not work? > > > > > > Am I wrong? Please help me out! > > > > Thanks, > > Scott > > > > -- > > 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] >
See Date("format_string",timestamp); Phil Daintree Dux Industries Ltd - Ph: +64 (04) 567 8900 Fax: +64 (04) 567 8904
I am using an APACHE server that has SuEXEC turned on. For those of you who don't know what that is. It is a way of adding more security to your scripts. You set your CGI scripts to permission level 700. Even text files that need to be read by your CGI scripts can be set to 700. This way, no one else on the server will be able to even read your scripts or text files. The web server assumes that it is the executor of your domain and has permission to read these files and execute these scripts. I was wondering if there is anything I have to do to get SuEXEC to work with PHP. I don't want to set my text file permissions to 777 and I don't want other people on my server to be able to read my php scripts. They could get the username and password to my sql account. Any ideas. Thanks. ========================= Matthew Toledo Athens Musician Network [EMAIL PROTECTED] http://www.athensmusician.net
On 2/20/01 2:51 PM this was written: > I am using an APACHE server that has SuEXEC turned on. For those of you who > don't know what that is. It is a way of adding more security to your > scripts. I printed out the whole thing on the Apache site about SuEXEC and I couldn't figure out how to get it working. I'm so clueless when it comes to these advanced Unix stuff. If anyone has any tips, perhaps you can e-mail me privately. Thanks! -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
Hi, I want to use the system() command for some encryption! I can't get it to work and so am trying to just get the system() command to run any program!! There is not much (in the way of examples) on the php page and was wondering if any one could give me a few pointers? I have an apache server running on win2000. If say I wanted to run a program called temp.exe in the root directory on my machine is it a matter of just adding the line: system("C:/temp.exe")?? I have also tried system("C:\temp.exe)!! This is probably a really silly question but I am new to PHP (and it is my first scripting language!!) Could someone send me an example or tell me what I am doind wrong? Any assistance is very much appreciated, Kevin Connolly.
I believe you can only get system() to work in PHP4 by running PHP4 as a CGI rather than ISAPI/Module. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Kevin Connolly" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Tuesday, February 20, 2001 2:15 PM Subject: [PHP] system() PHP newbie!! Hi, I want to use the system() command for some encryption! I can't get it to work and so am trying to just get the system() command to run any program!! There is not much (in the way of examples) on the php page and was wondering if any one could give me a few pointers? I have an apache server running on win2000. If say I wanted to run a program called temp.exe in the root directory on my machine is it a matter of just adding the line: system("C:/temp.exe")?? I have also tried system("C:\temp.exe)!! This is probably a really silly question but I am new to PHP (and it is my first scripting language!!) Could someone send me an example or tell me what I am doind wrong? Any assistance is very much appreciated, Kevin Connolly.
OK Thank you ""Richard Lynch"" <[EMAIL PROTECTED]> wrote in message 01ea01c09ac4$a08aeaa0$[EMAIL PROTECTED]">news:01ea01c09ac4$a08aeaa0$[EMAIL PROTECTED]... > Check your php.ini setting of "global_vars" > > If you used that php.ini-optimized, well, that was one of the optimizations. > > Turn it back on or switch to using $HTTP_POST_VARS['name'] everywhere. > > -- > Visit the Zend Store at http://www.zend.com/store/ > Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > ----- Original Message ----- > From: "Ivo Stoykov" <[EMAIL PROTECTED]> > Newsgroups: php.general > Sent: Monday, February 19, 2001 1:59 PM > Subject: [PHP] form's variable access problem > > > > Hi guys > > > > I'faced a problem (and was said it is a common one) using php4 with Apache > > 1.3.12 under win98se > > > > I'm using a form with an <input type="text" name="name"> > > > > The problem is that I cannot find the $name afterwards in the script. but > I > > can using $HTTP_POST_VARS["name"] > > > > I have not this problem using Linux. > > > > Any ideas how could I avoid this? Thank you > > > > Ivo > > > > > > > > -- > > 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 would like the session variable to be deleted when the user closes their browser. Any ideas on how this is done. Ryan Conover
I thought that session variables (unless set to cookie as well) WERE destroyed at the end of a session? As in when the user closes the browser? Hrms. Maybe not. Anyway, don't know about when the window is closed, but you could have a log-out page that uses session_destroy(); James. > I would like the session variable to be deleted when the user closes their > browser. Any ideas on how this is done. > > > Ryan Conover > > -- > 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, Can someone point me where in the httpd.conf file to change to make php files run longer than 30 secs and edit the max upload from a form? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com --------------------------------------------
it's in the php.ini file, which should be in your /etc folder (or windows folder on a winbox) or you can just use <? set_time_limit(0); ?> to turn it off for that particular script. -----Original Message----- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 12:37 PM To: PHP User Group Subject: [PHP] httpd.conf question... Hello, Can someone point me where in the httpd.conf file to change to make php files run longer than 30 secs and edit the max upload from a form? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.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]
Hello, Is there a way to make an .htaccess file to make the server not time out when uploading a file? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -------------------------------------------- -----Original Message----- From: Thor M. Steindorsson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 12:45 PM To: Brandon Orther; php-general Subject: RE: [PHP] httpd.conf question... it's in the php.ini file, which should be in your /etc folder (or windows folder on a winbox) or you can just use <? set_time_limit(0); ?> to turn it off for that particular script. -----Original Message----- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 12:37 PM To: PHP User Group Subject: [PHP] httpd.conf question... Hello, Can someone point me where in the httpd.conf file to change to make php files run longer than 30 secs and edit the max upload from a form? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.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] -- 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]
Before I embark on this little project, or just hunt for one already written (anyone have suggestions?), when creating an Upload script, how does one go about files coming from different platforms? We have a unix FTP server and we'd like to make an Upload function on our website, where people can fill in a form with their information, select their (local) file to be uploaded and submit it. However, I'm somewhat at a loss when it comes to things like: - how to handle files with spaces in them? - how to handle files created on a Mac platform, that include characters like / , or a Mac-dot (OPTION-8), stuff that wouldn't normally be allowed in a PC formatted file name - how to handle Mac font files. Whenever we have clients email us individual fonts, it never comes through because of the font control file. We always get a 0 byte file. (might this be because our mail server is also unix, and mac files are 7-bit, versus PC/Unix being 8-bit?) I'm sure there are other issues to cope with, but these are the immediate ones I can think off. Does anyone have a relatively robust Upload function written, or one you'd recommend using? AMK4 -- W | | I haven't lost my mind; it's backed up on tape somewhere. |____________________________________________________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 SysAdmin / Websmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . eFax 248.671.0909 http://www.pcraft.com . 3550 Arapahoe Ave #6 .................. . . . . Boulder, CO 80303, USA
I wouldnt worry about filenames :) just make your own file name, store that name with cross reference to the real filename in a db. I allow users to update images to our server, I store them directly in the db, I also store the mime-type along with the filename. every file has a unique file_id number, I set this with the time functiuon, spec microtime(). <?php include_once('database.egn'); include_once('time.egn'); if (isset($db_file)) { echo "INSERTING <br>\n"; $db_file = urlencode(fread(fopen($db_file, 'r'), filesize($db_file))); $db_file_id = mtime(); insert_db_value('images', " '$db_file_id', '$db_file', '$db_file_name', '$db_file_type' "); } echo " <html> <body> <form method=post enctype='multipart/form-data' action='$PHP_SELF'> <input type=file name=db_file> <input type=submit> </form> </body> </html> "; ?> something like this is real simple and works. might not be what your looking for but could be easily modified. -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 ""Ashley M. Kirchner"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Before I embark on this little project, or just hunt for one already > written (anyone have suggestions?), when creating an Upload script, how > does one go about files coming from different platforms? > > We have a unix FTP server and we'd like to make an Upload function > on our website, where people can fill in a form with their information, > select their (local) file to be uploaded and submit it. However, I'm > somewhat at a loss when it comes to things like: > > - how to handle files with spaces in them? > - how to handle files created on a Mac platform, that include > characters like / , or a Mac-dot (OPTION-8), stuff that wouldn't > normally be allowed in a PC formatted file name > - how to handle Mac font files. Whenever we have clients email us > individual fonts, it never comes through because of the font > control file. We always get a 0 byte file. (might this be > because our mail server is also unix, and mac files are 7-bit, > versus PC/Unix being 8-bit?) > > I'm sure there are other issues to cope with, but these are the > immediate ones I can think off. Does anyone have a relatively robust > Upload function written, or one you'd recommend using? > > AMK4 > > -- > W | > | I haven't lost my mind; it's backed up on tape somewhere. > |____________________________________________________________________ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 > SysAdmin / Websmith . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . eFax 248.671.0909 > http://www.pcraft.com . 3550 Arapahoe Ave #6 > .................. . . . . Boulder, CO 80303, USA > > > > -- > 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 just wanted to post this out here so nobody else has to go through the pain that I've gone through. Here's my instructions on installing PHP 4.0.4pl1 with OCI8 support on an AIX 4.3.3 box running Oracle's 9i Internet Application Server. Please email me if this helps you so I will feel better about the hours I spent trying to get this to work. NOTE: I ran all of this as the oracle user and I had my ORACLE_HOME set to /ias/6iserver. This shouldn't be necessary since we specify this on the configure line but I did it to be safe. Also, replace any references to the /ias directory below with whatever your 9iAS ORACLE_HOME is. Add -I/ias/Apache/perl/lib/5.00503 to the end of the #!perl call at the top of the apxs script. A perl module (strict.pm) is required but is not found in the include path when the configure script runs apxs. Also, I'm not sure why, but Oracle 9iAS automatically assumes everyone is running Solaris. In the apxs script change any '-DSOLARIS2=260' references to -DAIX=43. NOTE: When I tested this I replaced the default Oracle 9iAS apxs script with the default Apache apxs script from the AIX distribution and put in all the Oracle specific environment variables. I think this should work with the 9iAS apxs script if modified as detailed above. AIX has a sparsely documented bug where alloca() is not defined on the system and the PHP configure script does not handle this properly. We need to add -ma to any cc calls to get around this. Export this in the CC environment variable as follows: Run export CC='cc -Dinline= -ma' ./configure --with-apxs=/ias/Apache/Apache/bin/apxs --with-oci8=/ias/6iserver --without-mysql --prefix=/ias/Apache/Apache After the configure script was done I edited config_vars.mk and added -I/ias/rdbms/demo and -I/ias/rdbms/public to the INCLUDES variable. IAS keeps some of the oci8 header files in these directories. Also, for 9i I had to add -I/ias/Apache/Apache/include to the INCLUDES variable. I did not have to do this for 8iAS. Created a link in /ias/6iserver/lib for libclntsh.a. For some reason only a .so was included in 9iAS. I checked 8iAS and this file is not missing here. Run ln -s libclntsh.so libclntsh.a in this directory. The configure script generates a script named 'libtool'. Modify the archive_cmds= and archive_expsym_cmds line to include the following switch: \${wl}-bI:/ias/Apache/Apache/libexec/httpd.exp This tells PHP which calls to the Apache API have been exported and can be resolved at runtime. I found this from another post to this newsgroup. Thanks! Run make. Run make install. Make install modifies files in the Apache directory hierarchy (/ias/Apache/Apache) -- namely httpds.conf. It also adds the module to the libexec directory so there may be issues with permissions in these directories. We also had to pull the PHP module support out of an <IFDEFINE SSL> section in httpds.conf so that it is loaded all the time. We then added the following lines to httpds.conf: AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps This routes file extensions of these types to mod_php. THIS SHOULD BE IT. Restart Apache and try running <? phpinfo() ?> through as a test. Hope this comes in handy for someone. Michael Champagne, Software Engineer Capital Institutional Services, Inc. wk: [EMAIL PROTECTED] ****************************************************************** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ******************************************************************
If I want to post array data (like in case of options and checkboxes), can I urlencode the array just like a regular string? Thanks, Sergiy.
No. You can http://php.net/serialize and http://php.net/unserialize it, or you can loop through and URLEncode each element in a different INPUT TYPE=HIDDEN element. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Sergiy Zhenochin <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Tuesday, February 20, 2001 3:23 PM Subject: [PHP] how to urlencode array data for PostToHost ? > If I want to post array data (like in case of options > and checkboxes), can I urlencode the array just like a regular string? > Thanks, > Sergiy. > > > -- > 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] >
Serialize and unserialize is good when CGI script expects serialized data. I am looking to the way to POST to somebody's CGI-script that doesn't expect any PHP tricks, but data from <SELECT MULTIPLE>. Is it possible to fake this data somehow from PHP? Richard Lynch wrote: > No. > You can http://php.net/serialize and http://php.net/unserialize it, or you > can loop through and URLEncode each element in a different INPUT TYPE=HIDDEN > element. > > -- > Visit the Zend Store at http://www.zend.com/store/ > Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > ----- Original Message ----- > From: Sergiy Zhenochin <[EMAIL PROTECTED]> > Newsgroups: php.general > Sent: Tuesday, February 20, 2001 3:23 PM > Subject: [PHP] how to urlencode array data for PostToHost ? > > > If I want to post array data (like in case of options > > and checkboxes), can I urlencode the array just like a regular string? > > Thanks, > > Sergiy. > > > > > > -- > > 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 have a Newbie question, What is the syntax to get the info from HHTP_POST_VARS? I mean what is the syntax to get the variable COMPUTERNAME for example or to get HTTP_HOST? Thanks Phil Labonte Systems Administrator Atreus Systems (p) 613-233-1741 x243 (c) 613-277-1697 [EMAIL PROTECTED]
I dont think HTTP_POST_VARS is what your looking for I think its more HTTP_SERVER_VARS <?php echo $HTTP_SERVER_VARS['HTTP_HOST']; ?> -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 ""Phil Labonte"" <[EMAIL PROTECTED]> wrote in message 331AB909C797484B84CF8CF3C711BD4E0992A2@xchange">news:331AB909C797484B84CF8CF3C711BD4E0992A2@xchange... > I have a Newbie question, > > What is the syntax to get the info from HHTP_POST_VARS? > > I mean what is the syntax to get the variable COMPUTERNAME for example or to > get HTTP_HOST? > > Thanks > > > Phil Labonte > Systems Administrator > Atreus Systems > (p) 613-233-1741 x243 > (c) 613-277-1697 > [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] >
or <? phpinfo(); ?> for an entire list of php setup and http variables Jerry Lake - [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -----Original Message----- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 2:08 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Newbie: [PHP] $HTTP_POST_VARS I dont think HTTP_POST_VARS is what your looking for I think its more HTTP_SERVER_VARS <?php echo $HTTP_SERVER_VARS['HTTP_HOST']; ?> -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 ""Phil Labonte"" <[EMAIL PROTECTED]> wrote in message 331AB909C797484B84CF8CF3C711BD4E0992A2@xchange">news:331AB909C797484B84CF8CF3C711BD4E0992A2@xchange... > I have a Newbie question, > > What is the syntax to get the info from HHTP_POST_VARS? > > I mean what is the syntax to get the variable COMPUTERNAME for example or to > get HTTP_HOST? > > Thanks > > > Phil Labonte > Systems Administrator > Atreus Systems > (p) 613-233-1741 x243 > (c) 613-277-1697 > [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] > -- 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]
From: "Chris Lee" <[EMAIL PROTECTED]> > I dont think HTTP_POST_VARS is what your looking for I think its more > HTTP_SERVER_VARS > > <?php > echo $HTTP_SERVER_VARS['HTTP_HOST']; > ?> > > That should work but imho better practice is to use getenv(): <?php echo getenv("HTTP_HOST"); ?> This is especially useful inside a function, as you then do not need to declare $HTTP_SERVERS_VARS as a global variable. > > ""Phil Labonte"" <[EMAIL PROTECTED]> wrote in message > 331AB909C797484B84CF8CF3C711BD4E0992A2@xchange">news:331AB909C797484B84CF8CF3C711BD4E0992A2@xchange... > > I have a Newbie question, > > > > What is the syntax to get the info from HHTP_POST_VARS? > > > > I mean what is the syntax to get the variable COMPUTERNAME for example or > to > > get HTTP_HOST? > > > > Thanks > > > > > > Phil Labonte > > Systems Administrator > > Atreus Systems > > (p) 613-233-1741 x243 > > (c) 613-277-1697 > > [EMAIL PROTECTED] > > > >
This is code from a working script to add a user account to a Novell NDS database via Novell's LDAPv3. Hope this helps. //connect to LDAP $ds=ldap_connect("172.17.20.10"); // must be a valid LDAP server! if (!$ds) { echo "Connection to LDAP server failed<br><br>"; exit(); } //bind to LDAP $r=ldap_bind($ds,"cn=ftpadmin, ou=Corp, o=PMX", "engineer"); if (!$r) { echo "LDAP bind failed<br><br>"; exit(); } //prepare the data to be added $info1["cn"]=$login; $info1["sn"]=$login; $info1["objectclass"]="inetOrgPerson"; // add data to directory $r=ldap_add($ds, "cn=$login, ou=SomeOU, o=Org", $info1); //Close the LDAP connection. ldap_close($ds); ""Richard Lynch"" <[EMAIL PROTECTED]> wrote in message 02c401c09a4c$98a7ce20$[EMAIL PROTECTED]">news:02c401c09a4c$98a7ce20$[EMAIL PROTECTED]... > > $a=ldap_add($ds, "uid=beau, dc=graduate, dc=com", $info); > > but it's an error > > Waring LDAP: add operation could not be complete in. <my php file> > > I don't know much about LDAP: > > Have you checked that $ds is a valid LDAP connection? > Can you get your own record out of LDAP using it? > Presumably LDAP has some notion of who can add records (or whatever they > called them) and who can't. > Are you sure the user connected in ldap_open() is empowered to add records > at that level in the LDAP space? > > -- > Visit the Zend Store at http://www.zend.com/store/ > Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > > > > -- > 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'm trying to read some LDAP entries from a Novell LDAPv3 server on NetWare 5.1. Here's a piece of my code. <snip> $base = "ou=Corp, o=PMX"; $filter = "sn=*"; $attrib = array("lastLoginTime", "sn", "mail", "telephoneNumber", "homeDirectory"); // Search surname entry $sr=ldap_search($ds, $base, $filter, $attrib); $info = ldap_get_entries($ds, $sr); </snip> I can get the values for sn and mail but can't get lastLoginTime, telephoneNumber, or homeDirectory. These are valid LDAP attributes as defined by Novell. Novell developer support told me this. "These are operational attributes. For a list of operational attributes see http://developer.novell.com/ndk/doc/docui/index.htm#../ndslib/schm_enu/data/ hotadinr.htm Operational attributes are not automatically returned in search results; they must be requested by name in the search operation." Does anyone have any ideas? I'm doing an authenticated bind and am using an account with full rights to the tree. Thanks, Pat
ok, I'm starting to play with sessions and have a few things I want to do, first is recompile --with-trans-sid and I'm pretty sure I know how to do that (make clean, then configure, etc.) However, I'm thinking of changing a few of the things <? phpinfo() ?> is giving me like: session.use_cookie and/or session.save_path or anything else they list there. My question.. how do you do it? Thanks Mike
From: "Michael Zornek" <[EMAIL PROTECTED]> > ok, I'm starting to play with sessions and have a few things I want > to do, first is recompile --with-trans-sid and I'm pretty sure I know > how to do that (make clean, then configure, etc.) > > However, I'm thinking of changing a few of the things <? phpinfo() ?> > is giving me like: > > session.use_cookie and/or session.save_path or anything else they list there. > > My question.. how do you do it? > > Thanks > Mike > I think you'll find those settings in your php.ini file. Cheers Simon Garner
Simon Garner wrote: > > My question.. how do you do it? > > I think you'll find those settings in your php.ini file. You have to create that file first. <? phpinfo() ?> will tell you where php.ini should be (php.ini-Path is somewhere near the top, I think). Take one of the php.ini-templates from the unzipped tarball and copy it there (take php.ini-dist for a standard config an php.ini-optimized if you want register_globals off and similar modifications often recommended by advanced php-users). Rename it to php.ini and edit it. This should be easy. regards Wagner -- Computers are like air conditioners: Once you open the Windows, they stop working correctly!
I'm sorry for asking this question but I've pulled my hair out looking for an answer and I can't seem to find one....Here's my situation...my host has php 3.0.9 installed as an apache module and php4.0.3.pl1 setup as a cgi bin....obviously i want to use 4 because I need to do a lot of work with sessions....the question is how...i thought it woudl be much like PERL...they supply me with a path so i figured just start the php script with something like #!/usr/bin/php4 or whatever the path is to php.... and i try testing it out by using a php 4 only function but i get fatal errors stating its unsupported which is telling me its still trying to use php 3.0.9...where am i going wrong??? Someone please set me straight...I'm obviously missing something simple... Thanks in advance, Chad Guilette When You Compensate For A Lack Of Skill By Doubling Your Efforts, There's No End To What You Can't Do.
Hello, I am writing a banner rotation script and want to use Server Side include. When I try to include from any server other than the one that php script is on I get an error, Error: [an error occurred while processing this directive] Any Ideas? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com --------------------------------------------
From: "Brandon Orther" <[EMAIL PROTECTED]> > Hello, > > I am writing a banner rotation script and want to use Server Side include. > When I try to include from any server other than the one that php script is > on I get an error, > > Error: [an error occurred while processing this directive] > > Any Ideas? > > > Thank you, > > -------------------------------------------- > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.com > -------------------------------------------- SSI doesn't support opening files over HTTP, so what you're trying to do will not work. You either need to have your banner script called from an <IMG> tag in the remote file (your script would return image data) - in which case you can't do HTML banners - or the remote server needs to run PHP and do something like this where the banner will appear: <?php readfile("http://your-adserver.dom/banner.php?id=1234"); ?> Cheers Simon Garner
Help!!! Every thing seems to work ok but I just can't make apache recognize php3 files I check that mod_php3.c is load with /usr/local/apache/bin/httpd -l This is what my httpd.conf file has <IfDefine SSL> LoadModule php3_module libexec/libphp3.so </IfDefine> <IfDefine SSL> AddModule mod_php3.c </IfDefine> AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3 .html AddType application/x-httpd-php3 -source .phps My info.html looks like this: Configure command at ./configure '--with-pgsql=/usr/local/pgsql' '--with-config-file-path=/usr/local/apache/conf' '--with-apache=/usr/src/apache_1.3.11' '--enable-track-vars' '--with-gd=/usr/local' '--with-ttf=/usr/local' php3.ini file path is set to: /usr/local/apache/conf Loaded modules: mod_php3, mod_ssl, mod_setenvif, mod_so, mod_auth, mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, mod_vhost_alias, http_core Please I need some advise!!! Thanks Ana Carolina
I think this might be a problem... <IfDefine SSL> AddModule mod_php3.c </IfDefine> Shouldn't the <IfDefine SSL> be say PHP3 rather than SSL? Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here
I just don't get it, It is loading mod_php.c, I allready change that I put the AddModule without a <IfDefine>. I can use php code inside of html file but I can't load php3 files. Any ideas???? "Hoover, Josh" wrote: > I think this might be a problem... > > <IfDefine SSL> > AddModule mod_php3.c > </IfDefine> > > Shouldn't the <IfDefine SSL> be say PHP3 rather than SSL? > > Josh Hoover > KnowledgeStorm, Inc. > > Searching for a new IT solution for your company? Need to improve your > product marketing? > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify > the process for you. > KnowledgeStorm - Your IT Search Starts Here
From: "Ana Carolina Blanco Abascal" <[EMAIL PROTECTED]> > Help!!! Every thing seems to work ok but I just can't make apache > recognize php3 files > I check that mod_php3.c is load with /usr/local/apache/bin/httpd -l > This is what my httpd.conf file has > <IfDefine SSL> > LoadModule php3_module libexec/libphp3.so > </IfDefine> > > <IfDefine SSL> > AddModule mod_php3.c > </IfDefine> Lose the IfDefine. Just put: LoadModule php3_module libexec/libphp3.so AddModule mod_php3.c > > AddType application/x-httpd-php3 .php3 > AddType application/x-httpd-php3 .html > AddType application/x-httpd-php3 -source .phps Change this to: AddType application/x-httpd-php3 .php3 .html AddType application/x-httpd-php3-source .phps > > My info.html looks like this: > Configure command at > ./configure '--with-pgsql=/usr/local/pgsql' > '--with-config-file-path=/usr/local/apache/conf' > '--with-apache=/usr/src/apache_1.3.11' '--enable-track-vars' > '--with-gd=/usr/local' '--with-ttf=/usr/local' > php3.ini file path is set to: > /usr/local/apache/conf > > Loaded modules: > mod_php3, mod_ssl, mod_setenvif, mod_so, mod_auth, > mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, > > mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, > mod_negotiation, mod_mime, mod_log_config, mod_env, mod_vhost_alias, > > http_core > > Please I need some advise!!! > Thanks Ana Carolina Howcome you are installing PHP3, not PHP4? Just curious... Cheers Simon Garner
Hiya, I have a question with reguard to Cache At the moment I'm using <form name="blah" method="POST" action=""> but when i go view the page in NN all the data comes up but if say i wanted to print the data it prints a page saying "Data Missing" .. this document resulted from a POST operation and has expired from cache..." and I don't understand why .. because i thought i had this covered using this script .... if ($REQUEST_METHOD=='POST') { header('Expires: ' . gmdate("D, d M Y H:i:s", time()+1000) . ' GMT'); header('Cache-Control: Private'); } could some one please offer some suggestions Thanks Peter
Does a "Self-Run" Business interest you? CASH IN on a virtual Money Machine! Let the World's First Online Recruiter help build your group! FREE Marketing Tools (Self-Replicating Web Pages, Autoresponders, Fax-On-Demand, ...) bring you the EASIEST plan to achieve wealth. Tap into the speed/power of the Internet with our free tools and see your group grow fast! Guaranteed monthly Checks! You can earn $400 - $14,565+/month! We're Exploding! JOIN NOW and Succeed! Simply click below to request more Information About this great opportunity! mailto: [EMAIL PROTECTED]?subject=Send-Info It will ONLY take a minute to find out. You will be glad that you did! I received your e-mail as someone interested in Internet Business Opportunities. If I received your e-mail in error, or you are no longer interested, click here to be removed. Be sure REMOVE is in the Subject Title and you will not be contacted again: mailto:[EMAIL PROTECTED] ?subject=Remove Thank you! Dana
ereg-replace and/or preg-replace should be able to do this much easier... Not sure how to represent characters by Hex value in Regex though... http://php.net/ereg_replace -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: richard merit <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Monday, February 19, 2001 4:30 PM Subject: [PHP] High and Low ASCII characters > We process a lot of documents, some text, some html, > etc. I need to be able to strip out all characters > below an ascii number and above an ascii number. > Currently I check character by character, above or > below a particular number the character is deleted or > replaced in the new string. Anyone run across a > quicker way to do this in php3....I checked the usual > places and can't find anything or I missed > something.....any help appreciated > > > rm > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - only $35 > a year! http://personal.mail.yahoo.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] >
> PHP has encountered an Access Violation at 10014D15 > > What the crap does that mean? PHP and/or one of its extensions and/or some other software running on your machine has put the wrong data in the wrong place in RAM and PHP is detecting that condition and stopping. Check http://bugs.php.net for similar errors and ways to diagnose the problem. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
I think CyberCash without MCK is, like, "No."... There are alternatives to CyberCash, though... ccnow is one. VeriSign? Verio? Verisomething is another. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Ben Schumacher <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Monday, February 19, 2001 8:43 PM Subject: [PHP] Is it possible to use CyberCash w/o MCK? > Hello- > > Does anybody have any example code for using CyberCash w/o the Merchant > Connection Kit? I'm trying to setup secure credit card transactions on my > site using CyberCash, but my provider doesn't have & won't install the MCK > (no PHP support for it either). I haven't tried installing the MCK myself, > but from my previous experience with it, I would rather just find a way > around using it. > > So I guess all I really need to know is if somebody has another way of > using CyberCash with PHP without using their software. > > Thanks, > Ben Schumacher > > > -- > 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] >
You can use http://php.net/fstat to get more info about the files you see from dir/read and http://php.net/sort to sort them. You could use http://php.net/exec("ls -als", $results, $error) to get files sorted. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Miguel Loureiro" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Tuesday, February 20, 2001 3:38 AM Subject: [PHP] listing files and directories... Hello all, To see all fields(directories and files) inside a directory I use the "dir" and "read", what I would like to know is, if there other way to do the same, others commands because now I have to problems, I want to make a sort of the list (by name or by date), and I have to use my program in irix system, any ideas ??? Thank you all Best Regards
Check your global_vars with <?php phpinfo();?> Change it in the php.ini displayed there if it's off. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Rosen" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Tuesday, February 20, 2001 3:39 AM Subject: [PHP] sending variables > Hi, > I have two simple php files: > > main.php: > <A HREF="test1.php?rosen=11">LIST</A> > > test1.php: > > <?print("$rosen");?> > > > > But this doesn't work ! > > please HELP ! > > > > Rsen Marinov > > > > > > > > -- > 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 posted this to the Manual notes the other day, but I thought I'd repost it here for discussion. :) It seems there is no way to access the return value of a method (or any function) inline, without assigning it to a variable. For example: class Test { function blah () { return array(1,2,3); } function childTest () { return new Test; } } $test = new Test; // This does not work: $foo = $test->blah()[0]; // Instead have to do: $temp = $test->blah(); $foo = $temp[0]; // Similarly for objects, cannot do: $foo = $test->childTest()->blah(); // Instead have to do: $temp = $test->childTest(); $foo = $temp->blah(); :-( Regards Simon Garner
untested but.. > $foo = ${$test->blah()}[0]; > // Similarly for objects, cannot do: > $foo = $test->childTest()->blah(); $foo = ${$test->childTest()}->blah(); > // Instead have to do: > $temp = $test->childTest(); > $foo = $temp->blah(); Might work.. never had need to test it and cant be bothered now but would be intereted to hear if it works.. James
From: "James Moore" <[EMAIL PROTECTED]> > untested but.. > > > $foo = ${$test->blah()}[0]; > > > // Similarly for objects, cannot do: > > $foo = $test->childTest()->blah(); > > $foo = ${$test->childTest()}->blah(); > Nope, I tried that :) > > // Instead have to do: > > $temp = $test->childTest(); > > $foo = $temp->blah(); > > Might work.. never had need to test it and cant be bothered now but would be > intereted to hear if it works.. > > James > Cheers Simon Garner
I am attempting to compile PHP with Net-SNMP package from Sourceforge (ucd-snmp-4.2.i386.rh6.2.tar.gz). I also tried installing from the source tar ball (ucd-snmp-4.2.tar.gz) configure and make/make install work fine. starting apache returns: Cannot load /usr/local/apache/libexec/libphp4.so into server: libsnmp-0.4.2.so: cannot open shared object file: No such file or directory What directory is it trying to load from, or what environment variable is it referring to? The file does exist under /usr/local/lib. I also made a symbolic link [/usr/local/snmp -> /usr/local] so that /usr/local/snmp/lib exists. Redhat 6.2 Apache 1.3.17 PHP 4.0.4pl1 --with-snmp --with-esoob --enable-ftp --with-xml --with-apxs --enable-track-vars --enable-force-cgi-redirect --with-mysql Thanks. Michael Geier CDMSports Systems Administration EMail: [EMAIL PROTECTED]
I want to limit uploaded files to $250k. The incoming files should be images, so I also want to limit the files to .gif or .jpg files. How would I go about doing this? Kenneth R Zink II [EMAIL PROTECTED] ICQ# 5095094 '87 2.8L TBI GMC S-15 Ext. Cab (Hurricane) ...524 in the works !!! http://www.s-series.org/htm/windstorm/project-windstorm.htm '85 3.4L Carbed Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI DIS !!! http://www.s-series.org/htm/firestorm/firestorm.htm Racing by the Grace of God!!
On Wed, 21 Feb 2001 10:17, Kenneth R Zink II wrote: > > I want to limit uploaded files to $250k. The incoming files should be > images, so I also want to limit the files to .gif or .jpg files. > > How would I go about doing this? > > Kenneth R Zink II Go to http://www.php.net/manual/en/features.file-upload.php (or your favourite mirror) for more information. In particular, you'll want to look at MAX_FILE_SIZE and $userfile_type Cheers -- 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
Has anyone done any LDAP work with Novell's LDAPv3 server? --Pat
Hello, Does anyone have a link to ImageMagick's web site? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com --------------------------------------------
From: "Brandon Orther" <[EMAIL PROTECTED]> > Hello, > > Does anyone have a link to ImageMagick's web site? > > Thank you, > > -------------------------------------------- > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.com > -------------------------------------------- http://www.imagemagick.org :-)
Hello, I am looking for an Image Library that can blur text. Does anyone know of an image library that can work with php to make blured text? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com --------------------------------------------