[PHP] Re: [PEAR] PHP 4.4.0 references problems when using PEAR::SOAP
On 10/7/05, Denis Gerasimov [EMAIL PROTECTED] wrote: Hello list, I am facing serious troubles when using PEAR::SOAP with PHP 4.4.0 while it works fine with PHP 4.3.9. PHP 4.4.0 produces many notices like these: Notice: Only variable references should be returned by reference in C:\PHP4\PEAR\SOAP\Value.php on line 118 Notice: Only variable references should be returned by reference in C:\PHP4\PEAR\SOAP\WSDL.php on line 668 Notice: Only variable references should be returned by reference in C:\PHP4\PEAR\SOAP\Value.php on line 118 and so on. What is the problem? Currently I have rolled back to version 4.3.9 but this problem will appear again after upgrade, of course, - is there any solution (say, php.ini setting etc.)? Have a great day, The solution is to fix the SOAP package. Instead of: return $serializer- make it: $ret = $serializer-... return $ret; This notice was added because PHP has memory corruption issues when doing this particular thing (it always has). -- Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PEAR] $HTTP_POST_VARS
On Thu, 7 Oct 2004 11:19:23 -0700 (PDT), Pahlevanzadeh Mohsen [EMAIL PROTECTED] wrote: Dears,I need to my program is waitting while $HTTP_POST_VARS change Please guide me.. Sorry, that question doesn't make any sense. The POST vars only change during a script run if your script changes them. Also, you should be using the $_POST superglobal unstead of $HTTP_POST_VARS. Please try to rephrase your question. -- paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fwd: [SPAM] Plan Ahead. Shop For Life Insuranc
-- Forwarded message -- From: BonusMail from MyPoints [EMAIL PROTECTED] Date: Mon, 27 Sep 2004 11:24:19 -0600 Subject: [SPAM] Plan Ahead. Shop For Life Insuranc To: [EMAIL PROTECTED] Justin, your current Point balance is 4,565 Quotes based on a composite of participating carriers, which have at least an A-rating by SP. Your premium may differ due to your health, smoking or other activities. Rates subject to underwriting and state availability. InsWeb is a service offered by InsWeb Insurance Services, Inc., a licensed agency in most states (CA#0C24350). If you wish to opt out of receiving future emails from InsWeb.com, please click here. This will not unsubscribe you from MyPoints. InsWeb Corporation - P.O. Box 580 - Gold River, CA - 95741-0580 Hurry Justin! This Point offer expires October 11th. Show me more. I'll receive 5 Points just for reading this message and visiting InsWeb.com. You won't see an automatic confirmation for clicking on the above link. The 5 Points for reading this message will show up in your account overnight. If you use a pop-up blocker: To receive your Points you must add MyPoints to the Allow list or disable your pop-up blocker. The Point offer for this BonusMail® expires at midnight Central Time on the above mentioned expiration date. Visit Member Services to: - Change your email information - Update your account information - Cancel your account MyPoints.com, Inc., 188 Embarcadero - 5th Floor, San Francisco, CA 94105 Shop through MyPoints - Earn Points for every purchase! See what your 4,565 Points can get you! Spend your Points with over 75 top brand name partners. You've received this email advertisement because you're a member of MyPoints. If you no longer wish to receive BonusMail, click here to unsubscribe, or email [EMAIL PROTECTED] and type unsubscribe in the subject line. ©1997-2004 MyPoints.com, Inc.® All rights reserved. !DSPAM:4158b1bd97816288916596! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic HTML Creation
On Fri, 27 Aug 2004 23:17:29 -0700, Sam Hobbs [EMAIL PROTECTED] wrote: Is it possible to use the DOM to add (HTML) elements to a page at the time the page is being shown? The HTML and VBScript shown below is a simplified version of what I need to do but of course I need to do it in PHP. Since PHP is server-side (right?) perhaps it is not possible. You're right, it's not possible. You'd have to create the whole page with DOM and output it at the end. You may be able to use DOM to make a specific piece and inject it You could always just use JavaScript to inject things as wel. HTML HEAD TitleDynamic Table Demo/Title /HEAD Script Language=VBScript Sub Window_Onload Set NewRow = document.createElement(TR) Set NewCell = document.createElement(TD) NewCell.innerText = Cell Text NewRow.appendChild NewCell TableBody.appendChild NewRow End Sub /Script Body h1Dynamic Table Demo/h1 Table Id=NewTable Cols=1 border=1 Width=50% TBody Id=TableBody /TBody /Table /Body /HTML -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php !DSPAM:412fc78a52836398416238! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable variables
On Sat, 28 Aug 2004 11:43:13 +0200, JanBro [EMAIL PROTECTED] wrote: Hi List, I'm using PHP5 with global variables off. I've got around 20 dynamically generated forms with a total of 300 different variables sent thru these forms. I'd like to use variable variables, but according to the manual this is not possible. Now comes my Questoin, how do I receive my variables which have the form $a_123 or $a_124[]. Is there a workaround for PHP5 or PHP in general? Who do I make $data = $_REQUEST['a_123'] work ??? I'd hate to set global variables to on, as I'm dealing with sensitive data. Your question makes absolutely no sense. You can do $_REQUEST['a_123'] just fine. If what you want is to loop through them... foreach($_REQUEST as $key = $val) { // } or foreach($variableNames as $var) { $_REQUEST[$var] } -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function
On Sat, 28 Aug 2004 16:57:27 -0700, gc [EMAIL PROTECTED] wrote: Let me try this again, I'm Gene Candelaria and I'm a PHP and MySQL newbie. I have a feeling a lot of you may have seen this before. I'm teaching myself PHP/MySQL and trying to setup a guestbook. I'm running latest versions of Apache, PHP and MySql on WIN 2000. PHP is installed from the zip file. When serving php docs (code snippets below) I get the messages: Fatal error: Call to undefined function mysql_connect() Fatal error: Call to undefined function mysql_pconnect() You need to enable the mysql dll in your php.ini I've been reading and searching and trying all sorts of things to fix this and can't find the solution. I've removed the comment from the line extension=php_mysql.dll in php.ini. (Below is the MySQL section of php.ini. It's pretty standard, I'm using defaults.) I edited my Apache config file with the needed lines: ### Section 4: PHP 5 Module # ScriptAlias /cgi-bin/ C:/Program Files/Apache Group/Apache2/cgi-bin/ LoadModule php5_module php/php5apache2.dll AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps PHPIniDir C:/Program Files/Apache Group/Apache2/PHP When I run phpinfo, MySQL is not listed. Do I need to enable it in the configure command? How do I edit the configure command. Per phpinfo, It now reads: Configure Command cscript /nologo configure.js --with-gd=shared --enable-snapshot-build I read these comments: Ok, your php.ini file is set to 'on' for mysql.allow_persistent, but is mysql really enabled? Does your configure command look something like this? './configure' '--with-mysql=/usr/local/mysql' If you don't have --with-mysql it means that you cannot use mysql functions, so compile PHP again with this option. How do I edit that pesky configure command. I searched, but couldn't find an answer. So, where am I going wrong? Thanks for reading and big thanks for any help. gene [EMAIL PROTECTED] php.ini snippet (comments removed for easier reading: [MySQL] mysql.allow_persistent = On mysql.max_persistent = -1 mysql.max_links = -1 mysql.default_port = mysql.default_socket = mysql.default_host = mysql.default_user = mysql.default_password = mysql.connect_timeout = 60 mysql.trace_mode = Off guest.php code snippet: //connect // change localhost to your db host name mysql_pconnect( http://aulon.dyndns.org/;, $username, $password) or die( Unable to connect to SQL server); mysql_select_db( $db_name) or die( Unable to select database); guestbook.php code snippet: // Connect to DB $li = mysql_connect($dbHost, $dbUser, $dbPass) or die(Could not connect); mysql_select_db($dbDatabase, $li) or die (could not select DB); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php !DSPAM:4130ba8d143217233713689! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] changed number_format function
On Fri, 27 Aug 2004 14:06:56 +0530, Ma SivaKumar [EMAIL PROTECTED] wrote: A copy of php manual I downloaded a year back has the following about the behaviour of number_format function ?php $number = 1234.56; // english notation (default) $english_format_number = number_format($number); // 1,234.56 ? The latest on-line version is changed as below ?php $number = 1234.56; // english notation (default) $english_format_number = number_format($number); number_format($number, 2); // 1,234 In many un-updated sites I could see the old version. I am not successful finding the change log related to this. Does any one know why it is changed thus? What is the best way to format numbers to put only the thousand separator without removing or adding decimal places to the number. For example, 1000 should return 1,000 1000.5 should return 1,000.5 1000.25 should return 1,000.25 so on. I am looking at sprintf now. Thanks and Best regards, Ma SivaKumar -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] changed number_format function
On Fri, 27 Aug 2004 18:48:16 +0200, Marek Kilimajer [EMAIL PROTECTED] wrote: Justin Patrin wrote: number_format($number, 2); Does not work. Desired results: 1000 should return 1,000 1000.5 should return 1,000.5 1000.25 should return 1,000.25 so on. Actual results: 1000= 1,000.00 1000.5 = 1,000.50 1000.25 = 1,000.25 OIC. Yep, I don't think you can do that with number_format. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem using fread with https
On Thu, 26 Aug 2004 14:40:46 -0700, Pablo Gosse [EMAIL PROTECTED] wrote: Hi folks. I'm getting the following error when attempting to use PEAR::HTTP_Request to check the existence of a file. It's throwing an error from fread on an https stream: Warning: fread(): SSL: fatal protocol error in /u0/local/lib/php/Net/Socket.php on line 263 Line 263 is as follows: return fread($this-fp, $size); My PHP version is 4.3.4, and it's compiled with openssl, so I can't see why this is throwing an error since according to the docs as long as openssl is compiled https is supported. Does anyone have any suggestions? It's a bug in PHP. Upgrade or add a @ at the beginning of that fread() call. It should still work fine. Cheers and TIA, Pablo -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Undefined Variables Error Message
On Thu, 26 Aug 2004 14:47:17 -0700, Jeff - Webmaster [EMAIL PROTECTED] wrote: Removing the . got rid of most of the errors, but two remain: Notice: Undefined variable: headers in E:\domains\swinos\contact.php on line 4 Notice: Undefined variable: message in E:\domains\swinos\contact.php on line 12 The offending lines are: 4 - $headers = MIME-Version: 1.0\r\n; and if(isset($message)) { 12 - $message = stripslashes($message); } Jeff At 02:32 PM 8/26/2004, Michal Migurski wrote: Hello all. I just finished placing a new server in production and PHP is not working. I am getting undefined variable messages when trying to submit php based forms. Register Globals is on in php.ini, but it still does not work. I have even tried copying a known-good php.ini from another server and the same behavior exists. I am running IIS in Windows 2000. Any ideas? Another website dies on line 4 here: ?php $to = [EMAIL PROTECTED]; $subject = Swinos.com Booking Contact - $name; $headers .= MIME-Version: 1.0\r\n; $headers .= '...'; is equivalent to $headers = $headers . '...'; So it's probably complaining that $headers is not defined when you're trying to append something to it. Change that first .= to a =, like the line above, and see if that doesn't help. -- michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html !DSPAM:412e071553131102431894! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Looking for help with Forms and Mailing them
On Wed, 25 Aug 2004 19:13:08 -0600, Bradleigh Simms [EMAIL PROTECTED] wrote: Alright I'm apparently a complete dunce where PHP is concerned. I've tried to read the tutorials and am just getting completely mixed up. What I want: I want the form at http://ussblackwell.devermore.net/join.html to send as an email to myself and the GM of the game when the apply button is hit, without having to go through something like OE or Juno. What I don't know is *anything* at *all* about PHP. Can somebody help me? http:://www.php.net/mail -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick globalisation?
On Tue, 24 Aug 2004 12:21:03 +1000, Justin French [EMAIL PROTECTED] wrote: Jay, global $a, $b, $c is used for bringing global variables INTO the scope of the function... what I'm after is a way of making localised variables (in function) available outside of the function. Justin It also effectively makes the local variables global. As long as you do this *before* you use the vars, you're ok. Otherwise, you're going to have to use $GLOBALS. If you want a better way to do this, you could use object vars and then use get_object_vars, do a foreach, and put them in $GLOBALS. On 24/08/2004, at 1:38 AM, Jay Blanchard wrote: [snip] Is there a quicker way to globalise something other than: $a = 'foo'; $b = 'bah'; ... $GLOBALS['a'] = $a; $GLOBALS['b'] = $b; ?? I was hoping for something like $a = 'foo'; $b = 'bah'; ... makeGlobal('a','b') /*or*/ makeGlobal($a,$b); [/snip] According to http://us3.php.net/language.variables.scope you could do something like global $a, $b, $c, ...; --- Justin French http://indent.com.au -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [OFF] - Fraudulent web orders - any ideas?
On Tue, 24 Aug 2004 09:51:53 +0200, Markus Mayer [EMAIL PROTECTED] wrote: It may well be that they're using anonymous proxies. I know of a couple that spread the visiting IP addresses over a wide range of IP addresses, although everything does make it back eventually. Also possible is that they are using infected Windows machines and proxies. In the case of anonymous proxies, it should be possible to get the full range of IP addresses from somewhere and block all access through anonymous proxies - serious customers won't wast time going through such proxies, only people who really have something to hide go through such proxies. In the case of infected windows machines, you have a different problem because there are millions of such machines which act as spam relays, virus distributors, ... Keeping in mind that you want to make sales on your site as easy as possible, the best I can think of is to create a session cookie for the visitor which contains their IP address and check that IP address against one that you have stored locally for that session. If the IP address differs, blow the whistle on that visitor. To conceal that you are checking their IP address, call the cookie something like 'SaleID' or 'ItemID' and run the IP address through md5sum to get an md5 checksum and use that instead of the IP address itself. It wont get all of them, but it will make a difference, and make them have to work harder to get around the security on your site. In a case like this, you would also have to keep a database entry of what credit card number came from what IP address. If that card tries and fails more than twice and comes from different iP addresses every time, block that card number. If you do store the card number you may want to store an md5 only. Storing credit card #'s is a huge liability risk. Does Amex keep an online database of stolen/disabled credit cards? Maybe being able to query something like that in real time would be of advantage (actually I think some idea like this was presented very early in the thread). At the moment I don't have any other ideas. Hopefully what I've suggested here helps. best regards Markus On Monday 23 August 2004 23:33, Brian Dunning wrote: The plot thickens. I added AVS *and* CVM to the site - and the Amex orders are still going through. Amex ignores CVM, and the address was correct, so the thieves must have gotten ahold of printed statements that show the billing address. Any idea how to combat THAT? They are using fake IP addresses now so I can't keep up by blocking IP's. Your clever ideas appreciated. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] delimiter question?
On Tue, 24 Aug 2004 11:52:21 -0500, Steve Buehler [EMAIL PROTECTED] wrote: How can I make the following work on an apache 2.0.46/php 4.3.2 installation? /dist/gogo.php/order-inventory-form.php mod_rewrite Right now, unless it is a question mark after the gogo.php script, it will not run. Thank You Steve -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I find out if a string will fit in an area of an image?
On Tue, 24 Aug 2004 21:49:03 -0500, Brent Clements [EMAIL PROTECTED] wrote: Hi All, Let's say I have a string of text. $foo = I WANT ALot of Text to be diSPLAYed! I have an area on my image that is around 386 pixels wide. How do I find out if my text will fit in that area using any size font? Are you using PHP to create this image? If what you mean is: Will the text fit withint a certain space on a browser, the answer is that you can't tell. A user can always override the size of your fonts. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [OFF] - Fraudulent web orders - any ideas?
On Mon, 23 Aug 2004 14:33:56 -0700, Brian Dunning [EMAIL PROTECTED] wrote: The plot thickens. I added AVS *and* CVM to the site - and the Amex orders are still going through. Amex ignores CVM, and the address was correct, so the thieves must have gotten ahold of printed statements that show the billing address. Any idea how to combat THAT? They are using fake IP addresses now so I can't keep up by blocking IP's. Your clever ideas appreciated. Fake? There's always a real IP on the other end or you can't communicate with them. There *has* to be a way to get the real IP address. How are you doing it now? What makes you think it's fake? One thing nobody mentioned was a CAPTCHA. There's a new, simple, one in PEAR: http://pear.php.net/package/Text_CAPTCHA http://www.captcha.net/ I know they're annoying, but it could cut things down if they're automating this. You could also resort to the create a login method. Or even a valid e-mail address option if you really want to stop them. We implemented a nice one-step credit card, address, and login method on www.pnicorp.com. Go to the link below and click Continue Checkout. http://www.pnicorp.com/pniCart/?addItem=60 -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class Con- and Destructor Inheritance
On Sun, 22 Aug 2004 13:04:11 +0200, Daniel Schierbeck [EMAIL PROTECTED] wrote: Hello there. I was experimenting a bit with the constructors and destructors, and found that this code: ?php class First { public function __construct () { echo Hello, World!\n; } public function __destruct () { echo Goodbye, World!\n; } } class Second extends First { } $second = new Second; ? Outputs Hello, World! Goodbye, World! , yet the PHP manual (http://www.php.net/manual/en/language.oop5.decon.php) says: Note: Parent constructors are not called implicitly. In order to run a parent constructor, a call to parent::__construct() is required. Is this an error in the manual or in PHP itself? Should I report it somewhere? No, this is not a bug. This means that if you define a new constructor / destructor, the parent class's won't be called unless you put it in the new ones. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: replace value of array by key of array in string variable with pre
On Sat, 21 Aug 2004 12:54:15 -0500, Shawn McKenzie [EMAIL PROTECTED] wrote: Turbo wrote: Hi, I have array variable and string variable. I want to replace value of array by key of array in string variable with preg_replace(). Example : $message=array( 'name'='My Computer', 'version'='1.0' ); $strValue=I am $name,build version $version\n; How's to replace? You could just change your string to be: $strValue = 'I am '.$message['name'].',build version '.$message['version'].\n; or $output = preg_replace('/\$([A-Z_\-0-9]*)/ie', '$message[$1]', $strValue); This is not quite a complete solution and may not work (is not tested). Yingyos Why preg_replace? Just do extract($message); then you have vars from the keys: $name ='My Computer'; and $version = '1.0'; Then those vars are used in the $strValue var. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP with CVS...
On Fri, 20 Aug 2004 11:12:47 -0400, Paul Danko [EMAIL PROTECTED] wrote: I'm a newbie using CVS with PHP development. I created a CVS repository, which contains two directories. /CVSROOT/ /project/ where project has my code. My problem is that CVS modifies the files in the /project/ folder. the extension becomes *.php,v. I want to be able to checkout the code, check it back in, and then essentially refresh my browser and see the changes. In this case, the repository itself cannot be used by apache (because the files are modified as mentioned previously), a checked out version is required. this seems like extra steps. 1.) Check out my copy of the code 2.) Make changes to code 3.) Check the code back into cvs 4.) Checkout a copy of the current code to the web directory 5.) View the changes via the web. Is this how it is typically done? Thanks for any help! At my current job, I wrote a script (called deploy) which checks things out of CVS and puts them in their right place in our web tree. It ended up being fairly complicated as we have lots of different secionts and applications, but for a simple thing, you could make it a shell alias if you wanted to. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WAHT is my error???
On Fri, 20 Aug 2004 19:34:51 +0100, Andre [EMAIL PROTECTED] wrote: Inside of one ARRAY can I make one WHILE function tabelas($tabela_tipo){ $sql = mysql_query(SELECT * FROM .$tabela_tipo._credito ORDER BY .$tabela_tipo._ordenar); $return = select name=\tabelas\ class=\textblack\\n; $tabela_array = array(. No, you can't do such a thing. First of all, array() is a language construct and creates an array from values passed into it. Second, you're using period (.) here...what exactly are you trying to do? Perhaps you should try: $tablea_array = array(); while($registo = mysql_fetch_array($sql)){ array (.$registo[0]., *WHY* are you concatenating a value to two empty strings? This effectively changes the type of the variable to a string, but since it's coming from the DB it's already a string. And besides which, it very rarely matters to PHP whether something is a string or a number, it will convert between them automatically. .$registo[0].nbsp;.$registo[0].); Maybe you mean to do: $tablea_array[] = array ($registo[0], $registo[0].'nbsp;'.$registo[0]); }. And remove the . here. foreach($tabela_array as $subarray) { list($num, $text) = $subarray; $return .= option value=\$num\ selected$text/option\n; } $return .= /select\n; return $return; } You really need to go back and run through some PHP tutorials, it seems you don't really understand the language. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [OFF] Double charges to credit cards
On Fri, 20 Aug 2004 13:37:23 -0700, Brian Dunning [EMAIL PROTECTED] wrote: This question is not necessarily PHP-specific, though we are running PHP classes. Online store, credit card authorized at time of order, credit card charged at time of shipment (could be anywhere from a few minutes to a couple weeks later). Standard stuff. But customers are complaining that they're being double-charged. Turns out that both the authorization and the charge are showing up on their statements. Our merchant provider, ConcordEFSnet whose API we're using, says that this is just the way it works and there's nothing we can do about it. This is bull, there's no way it works this way. Sounds too incredible to be true. I've never seen anything like this on my own credit card statements, and I can't imagine that Amazon, et. al. have this problem, though they follow our same business process. Can anyone shed any light on this? How are you charging when the order ships? Are you doing a Sale or a Capture transaction. Normally when you authorize an amount, it puts a hold on the amount on the credit card. When you want to charge, you have to do a Capture of the Authorization. If you instead do a Sale, the authorization will show up as a block on the credit card. It *should* go away after 30 or so days. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linkpoint API question
On Fri, 20 Aug 2004 17:16:03 -0700, Brian Dunning [EMAIL PROTECTED] wrote: I telephoned *just* as the Linkpoint API support folks left for the weekend Currently we are doing just a SALE transaction. I want instead to first submit an authorization with AVS and CVV2 information, make a decision (2 out of 3) and then process the charge or not. The documentation is not clear to me: does anybody know which of Linkpoint's ordertypes these would be? Would the first be PREAUTH and the second be POSTAUTH? I don't know about Linkpoint, but with Verisign, this would be: Authorization for the initial check Delayed Capture to actually charge the card Void to cancel the Authorization -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/PearDB works on commandline but not via http....
On Thu, 19 Aug 2004 08:44:39 -0700, pw [EMAIL PROTECTED] wrote: Justin Patrin wrote: Did you try: if(PEAR::isError($db)) { echo $db-getMessage().' '.$db-getUserInfo(); } It's probably because: 1) the postgres the module isn't in the PHP that apache is using 2) the postgres module isn't loaded in the PHP that apache is using 3) the postgres module in the PHP that apache is using is connecting via a socket instead of a port (or vice-versa) I think you may have something with the apache module points. I'll ask if apache has been built or is just the install from the linux distro. I built apache previously, but I didn't install this machine Write a script with just: ?php phpinfo(); ? Run it through apache. Look for the postgres module (may be called pgsql). -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Nonstandard SMTP line terminator
On Thu, 19 Aug 2004 19:33:11 +0300, Ufuk M. Fakioglu [EMAIL PROTECTED] wrote: Hi, I am using mail() with php 4.3.8 on FreeBSD 4.10 to send bulk mail. Although I use \r\n in the header parameters, some mail servers respond with Nonstandard SMTP line terminator. What can I do? If you send some code, perhaps we can help. Perhaps you should be using \n instead of \r\n? Or maybe anohter part of the message uses \n instead of \r\n? Otherwise, you can look into a different mailing system. http://pear.php.net/package/Mail http://pear.php.net/package/Mail_mime -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Nonstandard SMTP line terminator
On Thu, 19 Aug 2004 21:33:22 +0300, Ufuk M. Fakioglu [EMAIL PROTECTED] wrote: Here's the piece of code that composes and sends the e-mails: $row=mysql_fetch_array($sql); $name=$row[1]; $email=$row[2]; $subject=$_POST[subject]; $msg=stripslashes($_POST[msg]); $msg=str_replace(RCPT_NAME, $name, $msg); mail($email, $subject, $msg, From: Mozaik [EMAIL PROTECTED]\r\n. Return-Path: Mozaik [EMAIL PROTECTED]\r\n. Content-type: text/html; charset=iso-8859-9\r\n); Could it be the SQL query returning the nonstandard terminator? How do I decide to use \n instead of \r\n? Check the manual and/or RFC and/or the package you end up using. Thanks, Ufuk JP On Thu, 19 Aug 2004 19:33:11 +0300, Ufuk M. Fakioglu [EMAIL PROTECTED] wrote: Hi, I am using mail() with php 4.3.8 on FreeBSD 4.10 to send bulk mail. Although I use \r\n in the header parameters, some mail servers respond with Nonstandard SMTP line terminator. What can I do? JP If you send some code, perhaps we can help. Perhaps you should be JP using \n instead of \r\n? Or maybe anohter part of the message uses \n JP instead of \r\n? JP Otherwise, you can look into a different mailing system. JP http://pear.php.net/package/Mail JP http://pear.php.net/package/Mail_mime -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[no subject]
ek [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] In-Reply-To: [EMAIL PROTECTED] Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable References: [EMAIL PROTECTED] Subject: Re: [PHP] .thaccess On Wed, 18 Aug 2004 14:00:10 +0200, V=C3=A1clav Slov=C3=A1=C4=8Dek [EMAIL PROTECTED] san.net wrote: =20 hi, =20 i would like to ask what happens when a user is downloading a large file from apache server and i modify the .htaccess file affecting the folder where is the file beeing downloaded by the user. For example i rewrite the list of ips allowed to access the file/folder and i remove the user's ip. Will the tranfer be interrupted or not? Is there any other way how to interupt the transfer? Thank you for help. =20 No, it will not be interrupted. The .htaccess is read at the *beginning* of a request only. --=20 DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OO Theory Question
On Wed, 18 Aug 2004 11:03:47 -0300, Ricardo Cezar [EMAIL PROTECTED] wrote: Probably it's a dumb question, but I'm new to OO Programming, so... How can I store the instance of the class in the session I answered this a long time ago in this thread. Did you not get my mail? Thanks, Rics Thomas Goyne [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] On Tue, 17 Aug 2004 12:25:42 -0600, Jed R. Brubaker [EMAIL PROTECTED] wrote: The real reason for having the login class like this is to eliminate database calls. I thought I could have one session variable that said yo uwere logged in, but then the database calls would still have to be made on each page. Thanks for the idea - any others? Just store the instance of the class in the session. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP HTML text editor issues...
On Wed, 18 Aug 2004 17:17:26 +, Curt Zirzow [EMAIL PROTECTED] wrote: * Thus wrote Tim Traver: Hi all, ok, I've made my own version of a file manager complete with a text editor, and I'm having troubles figuring out some issues. ... I've tried to use addslashes and stripslashes to prevent some of the clobbering of the text, but it doesn't seem to be working. If I don't do anything, it looks like PHP (or HTML) backslashes all quotes... I just want to get the EXACT text that is in the textarea to be saved to disk... Here is an example of a line that gets clobbered : $value =~ tr/\0//d; I read the file in from disk using file_get_contents. Does that do any translation ??? file_get_contents doesn't do any filtering. The issue your you're probably running into is that magic_quotes_gpc is set to On. This will addslashes to all your data by default. Two options: 1. Turn it off. 2. apply strip_slashes() to the string before writing to disk Don't you mean magic_quotes_runtime? -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/PearDB works on commandline but not via http....
On Wed, 18 Aug 2004 12:53:25 -0700, pw [EMAIL PROTECTED] wrote: Hello, I have an interesting problem with PostgreSQL via PearDB and PHP 4.3.3 . I have a php page that opens a remote connection to a Postgres database, performs a query, lists the results and then closes the connection. If I run the php from the command line the connection and query work fine. Php dumps a nice web page with all the data that I am asking for. If I serve the same php page via apache from the same machine, php fails to open the database connection and thus the page fails to fill out. PearDB is installed and working since if(DB::iserror($db)) detects the error. Anyone have any ideas? Can't help you unless you give us an error... -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/PearDB works on commandline but not via http....
On Wed, 18 Aug 2004 14:23:49 -0700, pw [EMAIL PROTECTED] wrote: Matthew Sims wrote: And check to see that PostgreSQL is accepting network connections rather than localhost. Is it listening to a port? Connecting remotely to postgres via the command line: psql -h nnn.nnn.nnn.nnn database_name -p 5432 -U user -W works fine. Like I wrote before, if I run the same script from the command line with the same php build... ie: cmd_line/ php db_test.php the script works fine and retrieves data fromt he database. If I try to serve the same php page via apache it can't connect, thus no $db object is returned from $db=DB::connect(pgsql://yada:[EMAIL PROTECTED]/databasename); I've tried running the php as various users including apache from the command line and it continues to work fine there. So, it's not a user permissions thing. Did you try: if(PEAR::isError($db)) { echo $db-getMessage().' '.$db-getUserInfo(); } It's probably because: 1) the postgres the module isn't in the PHP that apache is using 2) the postgres module isn't loaded in the PHP that apache is using 3) the postgres module in the PHP that apache is using is connecting via a socket instead of a port (or vice-versa) -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP templates
On Mon, 16 Aug 2004 09:31:04 +0300, Octavian Rasnita [EMAIL PROTECTED] wrote: Hi, I took a look to Smarty and Savant templating systems, and I like a few things from both of them. However, none of them are satisfactory. I don't like Smarty because it needs another language and I find Savant more easy to use. You could say that Smarty is another language, but it is basically PHP wrapped in a new syntax. It's pretty simple to learn and has great documentation. I've also found it quite easy to use and flexible. I would like to have a templating system that: 1. Separates: - the programming part (the main programs and the modules) - the structure and main design of the site (the templates) This is a completely developer(you)-defined thing. You can quite easily *not* seperate the Model, View, and Controller parts of your website, even using a template system like Smarty. The impetus for seperating these things comes from you, developer. - The content of the site, this meaning the body text, the title, keywords, and all other variables. Again, you can choose how to do such a thing with your templates by not supplying any ststic text, but sending it in variables. - Other files that can be included, like Javascript, .css, images, files that can be downloaded, etc. These just sit on your webserver and are linked to in your templates. The template language would very rarely have anything to do with this. 2. The templates should handle more languages, and all the content parts should be able to appear in every language supported. Again, this is a question of your design. You can choose to make all text be variables and pull that text from...wherever you want it. Easiest way would be to use a system like: http://pear.php.net/package/Translation or http://pear.php.net/package/Translation2 3. The program should be able to create a cache but not one containing PHP, but one that is just simple html that can be loaded from a cached file and presenting to the client. (I don't know how to decide yet when to re-create the cached file) Smarty can do this. It caches both compiled Smarty templates (as PHP files) and static HTML output of those templates. You can turn off any of these features. You can make it recompile everything when the original template is changed. Etc etc etc. If someone uses this templating system, someone can modify the design by modifying the templates and this change will be reflected in every language. If a translator add a new language or modifies a certain translation, the design won't be affected. Modify template, site changes. If you want multiple languages to use one template, again, that's your design decision. The programmer could add a new program for a new page that does something new, or new modules, etc. I couldn't find such a thing yet and I think I will have to create it. Sounds like you're looking for a whole Content Management System (CMS). Try looking into those if you don't want to have to build this stuff together. I like TYPO3 personally. Teddy - Original Message - From: Justin French [EMAIL PROTECTED] To: Octavian Rasnita [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, August 16, 2004 4:38 AM Subject: Re: [PHP] PHP templates On 15/08/2004, at 7:02 AM, Octavian Rasnita wrote: Hi all, I have seen that there are many templating systems for PHP. Which is the most used and the best you have found? Can you recommend me a free and good templating system? -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inline diff coded in PHP
On Mon, 16 Aug 2004 11:22:30 +0300, Skippy [EMAIL PROTECTED] wrote: I'm looking for PHP code that will produce diff's between two texts, and render them inline. By that I mean not the standard *nix diff output, which compares and outputs lines, but a diff that compares inline text and outputs the bits before and after in place, marked with a custom span or something. Example of *nix diff: - this is the old line + this is the new line Example of what I need: this is the span class=oldold/span span class=newnew/span line I've seen this done in the htmldiff package, which is a C program. Except I don't want to diff HTML code, but regular text. I actually need this for a wiki engine, so it can present diffs between page changes in a better way. So: * Anybody seen such code? the PEAR diff only does line diffs. * Know of any GPL'd wiki engine which has my kind of diffs already implemented (as PHP?) * Any pointers about how I should go about writing my own such diff? There's a python program called CVSSpam that does somehting like that. It does line changes, but also highlights the changes within the line. Sorry, I know of no in-line PHP diff engine. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OO Theory Question
On Tue, 17 Aug 2004 12:03:56 -0600, Jed R. Brubaker [EMAIL PROTECTED] wrote: Hi all! I could use some perspective on a project that I am currently working on. I am trying to utilize OO to make my PHP easier, but I keep running into problems that revolve around the stateless nature of the web. Consider the following: I have a login class that is instantiated at the top of every page. It can log you in, check to see if you are logged in, etc. This class has an assortment of class variables such as userID, userType, etc. It would be great if I could make a reference to $login-userType on any given page, but I run into errors as the login class gets reinstantiated on every page. A solution is to set all of these variables into $_SESSION, but the appeal of classes is that I might be able to maintain all of my information in a related location, and not in the session. I am sure that this is a problem that many of you more experienced (than I) developers have run into. Is there a solution? And ideas? Instead of re-instantiating the object, store it in the session. if($loginSuccessful) { $_SESSION['authObj'] = new AuthObj($loginUsername); or $_SESSION['authObj'] = $existingAuthObj; } -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pocket php
On Tue, 17 Aug 2004 18:14:52 +, dark monkey [EMAIL PROTECTED] wrote: Hello, My name is Brendan Kettle ([EMAIL PROTECTED]), and I was wondering is there anyway to test/run php code on a pocket pc? Any help is appreciated. Have you looked to see if there's an Apache/PHP build for Pocket PC? I can tell you for sure that it runs on my Sharp Zaurus. ;-) -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] code
On 14 Aug 2004 14:42:19 -, PHPDiscuss - PHP Newsgroups and mailing lists [EMAIL PROTECTED] wrote: Codes attached. In this page i used filetype instead of is_dir. ?php $dir = jdkcoders/; function getfiles($dir) { if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if($file!='.' $file!='..') { if(filetype($dir . $file)=='dir') { getfiles($dir./.$file); Look at the two above lines. One adds a '/' and the other diesn't. Try adding it to the first one. } else { echo br$file; } } } closedir($dh); } } } getfiles($dir); ? Hope you can help me. Thanks. John Holmes wrote: PHPDiscuss - PHP Newsgroups and mailing lists wrote: Hello Professionals, Can anybody help me to open all subdirectories in a directory, I used is_dir() to check whether it is a dir, and if yes, I recursively called it with the new dir name. But all subdirectories are not open the recursion is not working for more than 1 level. I tested it in windows server. Expecting your help, Expecting your code... Have you looked at the opendir manual page to see if there are any examples, there? -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What happend to _SERVER?
On Sat, 14 Aug 2004 16:08:01 -0700, Allen Wayne Best [EMAIL PROTECTED] wrote: Thomas: Thanx for your suggestion. I ran php stuff1.php stuff.out -- start of stuff.php --- ?php print_r(); http://www.php.net/manual/en/function.print-r.php ? -- end of stuff.php --- with the results of start of output --- X-Powered-By: PHP/4.2.2 Content-type: text/html end of output --- from within the browsers, the window remains blank. On Saturday 14 August 2004 15:31, Thomas Goyne pronounced: On Sat, 14 Aug 2004 15:26:46 -0700, Allen Wayne Best [EMAIL PROTECTED] wrote: Hello: I am having a spot of difficulty with PHP. I cannot get php to return the values of _SERVER. Here is a test php file. print_r($_SERVER); -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- regards, allen wayne best, esq your friendly neighborhood rambler owner my rambler will go from 0 to 105 Current date: 34:4:16::226:2004 Silverman's Law: If Murphy's Law can go wrong, it will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php !DSPAM:411e9948260948544259725! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Kerberos authentication
On Thu, 12 Aug 2004 21:15:40 -0700, Matthew Runo [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello- I am working on a project that requires Kerberos authentication, however - we are unable to use the apache module that one would normally use [sys admin.. *grumble*]. I searched the archives to find a script that would authenticate a user against a Kerberos server, and found very little. Does anyone have any ideas? I'd bow down and be very, very, excited if someone did... What exactly are you trying to authenticate against? Matthew Runo http://www.quabbo.com Quabbo Internet Services The only host with the Zend Performance Suite! -BEGIN PGP SIGNATURE- Version: PGP 8.1 iQA/AwUBQRxAc0Yfzzr/2QfwEQKtqwCg/ACfKp47RYttipmk5Ml5vFscHp8AoNg1 Hsto+UlR9bK0tbrP+X1+M9Ga =B5p0 -END PGP SIGNATURE- -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP in a Masters of Computer Science Program
On Fri, 13 Aug 2004 11:03:52 -0700, Michael Seely [EMAIL PROTECTED] wrote: HI Anyone know of a graduate masters program in computer science that is focused on PHP? Bwahahahaha! Wouldn't that be funny! I seriously doubt you'll find anything like this. Not only is PHP relatively new (compared to, say, C or C++), it's also just not great for teaching many programming concepts. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Kerberos authentication
On Fri, 13 Aug 2004 12:26:45 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Well, UC Santa Cruz uses a Kerberos server to authenticate students and faculty onto their network. We need to create a login form that will allow various departments to use a web-based-interface to log into their websites, and they'd all like to use the pre-existing Kerberos server to do so. That way, people could use their existing accounts. Any ideas? Well...I've never used Kerberos myself. Originally, we were using RADIUS to authenticate via an MS domain server. Now, we use LDAP, which runs on the same domain server. Is it possible to get LDAP access to that server? (I actually know nothing about Kerberos). --Matthew http://www.quabbo.com Quoting Justin Patrin [EMAIL PROTECTED]: On Thu, 12 Aug 2004 21:15:40 -0700, Matthew Runo [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello- I am working on a project that requires Kerberos authentication, however - we are unable to use the apache module that one would normally use [sys admin.. *grumble*]. I searched the archives to find a script that would authenticate a user against a Kerberos server, and found very little. Does anyone have any ideas? I'd bow down and be very, very, excited if someone did... What exactly are you trying to authenticate against? -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ignoring carriage returns from data field
On Fri, 13 Aug 2004 14:54:28 -0400, Vern [EMAIL PROTECTED] wrote: I am creating a datadump to a csv file and have noticed that text fields that contain carriage returns are causing trouble when opening the csv file in an Excel spreadsheet. I'm sure there's a away to ignore those extra characters but for the life of me I can't recall what it is. Anyone know how this is done? this field has a comma, and a newline to show you how quoted fields work, second, third, fourth field -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Securing Forms???
On Fri, 13 Aug 2004 15:36:34 -0400, James E Hicks III [EMAIL PROTECTED] wrote: On Friday 13 August 2004 02:57 pm, Gerard Samuel wrote: I've read (at least on 2 occasions) that one can secure their forms, to ensure that the form came from the site, and not via a script kiddie. Not the method where one puts a graphic of random text to copy to the form, but via a hidden field. It has to do with having a hidden field of data, that must match some data, when the form is posted. I've been mulling over this for some time to figure out how its possible, (as I haven't seen a live example of it). Could anyone point me to an example to how this can be done, (if its even possible)??? Thanks for your input... I think you're looking for something like this, but be warned things like HTTP_REFERER are/can be set by the client so you can't really trust this too much. if ($_SERVER['HTTP_REFERER'] != 'http://domain.com/I/AM/EXPECTING/script.php') { echo (Dang Script Kiddie Go Away!); exit; } Probably better is to include, like you said, a hidden variable on the page that would be very hard to guess in the form before presenting it to the user and also save it in a database or somewhere. Then when the user submits the form check your database for the existence of the super hard to guess value. If it exists in the DB, delete it and let the user go about her business. If it doesn't then: { echo (Dang Script Kiddie Go Away!); exit; } Of course, you can then use somehting like HTTP_Client to both get the REFERER right and parse the HTML to get the hidden field you need. There is no sure-fire way to check for non-humans. You can use CAPTCHA, but there are programs to break those, too. ;-) CAPTCHAs are actually your best bet. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] auto include?
On Fri, 13 Aug 2004 16:23:26 -0400, Jonathan Hadddad [EMAIL PROTECTED] wrote: is there a way to always have a certain script evaluate at the start of every page? Look in the php.ini settings for auto prepend. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 1.4 second lag before page loads
On Thu, 12 Aug 2004 14:07:52 +0100, Adrian Teasdale [EMAIL PROTECTED] wrote: Hi there On one site we have a 1.4 second delay before a page loads. We've added mod_gzip and mmCache to the server. Mod_gzip has definitely helped with the speed of page loading, but this 1.4 second delay is still there. The browser hits the page, then there is a delay on 1.4 seconds before the page comes back. We have uploaded the page as a static page and this does not happen, so I'm presuming that this is a php or mysql issue. Any ideas or suggestions of how to track it down? Use a profiler or an IDE which can do profiling. Check your queries to see if they're inefficient. https://www.reversefold.com/tikiwiki/tiki-index.php?page=PHPFAQs#id924218 Without more specific details, I can't help you. What is your code doing? What kind of queries are you running? How much data is there? The timestamp shows as: 21:06:10:215270 - when it hits the page 21:06:11:646549 - when the page starts loading -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with mysql_fetch_array
On Thu, 12 Aug 2004 09:20:44 -0400, Deepak Dhake [EMAIL PROTECTED] wrote: $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; while($row2 = mysql_fetch_array($query4)) { //print array } this will print whole array. i just want to print a row at a time and it should be in the loop because i am printing other things as well. can you tell me how to print a row at a time. actually as i explained earlier, i am able to print a row at a time but when it becomes i=1 and starts outer loop for the second time it just printing the same values. any suggestion? I think you're getting your terminology mixed up. $row2 is an array which corresponds to a row in the database. Yes, this will print all of the returned records, but I can think off very fe wtimes where you don't want to do that. This loop *is* what you want. Tell us what you're trying to do and we'll try to help. thanks, deepak Justin Patrin wrote: On Wed, 11 Aug 2004 17:13:49 -0400, Deepak Dhake [EMAIL PROTECTED] wrote: i am trying to print some values from a table with using mysql_fetch_array in a loop but not able to get correct values. it works fine for the loop i=0, prints all desired values but when it bocomes i=1 and starts the loop again the result values gets reset and prints the same old values. for example: outout of the query is result 1 result 2 result 3 result 4 result 5 result 6 result 7 result 8 result 9 result 10 result 11 result 12 :when i=0, it runs through the loop and prints result 1 result 2 result 3 result 4 result 5 result 6 :which is perfect. :but when i=1, it prints the same values, result 1 result 2 result 3 result 4 result 5 result 6 why is that so? can anyone help me? thanks in advance. $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; for($i=0; $i 2; ++$i)//surveys { for($j=0; $j 2; ++$j)//questions { for ($k=0; $k 3; ++$k)//sub-quesions { $row2 = mysql_fetch_array($query4); //Printing all result values one by one } } } I'm not sure what you think this should do, but you're assuming that 2 * 2 * 3 (12) records will be returned, no more, no less. I doubt this is the case. Normally, such things are done like this: $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; while($row2 = mysql_fetch_array($query4)) { //print array } If this isn't what you want, perhaps you should be doing 3 seperate queries in there? Please explain why you have 3 for loops around your fetch; -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_split()
On Thu, 12 Aug 2004 14:11:13 -0400, Aaron Todd [EMAIL PROTECTED] wrote: HAH...I found it. I have version 4.3.3 Does that version not have this function or something? http://us3.php.net/manual/en/function.str-split.php Look at the top. Only PHP5 is listed. Thanks, Aaron John Nichel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Aaron Todd wrote: I was just wondering if anyone can look an the following code and tell me if there are any obvious errors. I wrote this in DZsoft PHP editor where it works perfectly. But then when I run it on my webserver it gave me a fatal error: Fatal error: Call to undefined function: str_split() in /home/virtual/site341/fst/var/www/html/test.php on line 12 html head title/title /head body ?php $teststr = 5176948000; $parsed = str_split($teststr,3); echo $teststrbr; echo $parsed[0]-$parsed[1]-$parsed[2]$parsed[3]; ? /body /html What version of php is your webserver running? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6
On Thu, 12 Aug 2004 15:38:45 -0400, Eric L. Sammons [EMAIL PROTECTED] wrote: I have done phpinfo and I see --with-mysql=shared,/usr That doesn't really matter. Is there a mysql section in the phpinfo()? It should have information similar to this: MySQL Support enabled Active Persistent Links 0 Active Links0 Client API version 4.0.15a MYSQL_MODULE_TYPE external MYSQL_SOCKET/tmp/mysql.sock MYSQL_INCLUDE -I/usr/local/mysql//include/mysql MYSQL_LIBS -L/usr/local/mysql//lib/mysql -lmysqlclient If not, the mysql extension isn't being registered. = Original Message From Jay Blanchard [EMAIL PROTECTED] = [snip] did this, all answers came back stating to install php-mysql package. Already have that installed. Some have stated they recompiled php, I really would like to avoid doing that so I don't affect my Red Hat support agreements. [/snip] have you done phpinfo() to see if it really compiled? -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Page Referer question
On Thu, 12 Aug 2004 14:34:11 -0600, Jed R. Brubaker [EMAIL PROTECTED] wrote: Hello all. I am looking to create script will detect the page from which the user just came so that after they do something on the current page (login) it will send them back to the page they wanted. I was thinking about $_SERVER['HTTP_REFERER'], but php.net says: 'HTTP_REFERER' The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. Is this a big problem? Is there another technique I could use? It can be. Some firewalls (and some paranoid people) stop HTTP_REFERER altogether. Also, what would you do if the user failed their login? HTTP_REFERER would be set to the login page. What I've done in this situation is, when the person isn't logged in, before I redirect them to the login page, I store the current URL. (You can use cookies or a session). Once the login is done, redirect them back to the stored URL. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Page Referer question
On Thu, 12 Aug 2004 13:43:04 -0700, Robby Russell [EMAIL PROTECTED] wrote: On Thu, 2004-08-12 at 13:34, Jed R. Brubaker wrote: Hello all. I am looking to create script will detect the page from which the user just came so that after they do something on the current page (login) it will send them back to the page they wanted. I was thinking about $_SERVER['HTTP_REFERER'], but php.net says: 'HTTP_REFERER' The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. Is this a big problem? Is there another technique I could use? Thank you all! If a user takes the time to modify this, should it be a concern? If I don't want you to know where I came from and made sure you didn't know, what else can you possibly do aside from snoop? ;-) I'd bet that 99.99% of the people who surf the net do not modify this so the exception is very minimal. Except for those with a firewall that blocks this -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checking for upper case letter on string
On Thu, 12 Aug 2004 15:32:33 -0600, C.F. Scheidecker Antunes [EMAIL PROTECTED] wrote: Hello all, I need to check if there are any upper case letters on a given string. There can be one or more letters that might be upper case on a given string no matter their position within the string. Is there any way to check for it? obs: I do not want to convert to lowercase, but to check for the presence of upper case letters. I copuld iterate through the string and evaluate each caracter but I wonder if there is a more effective method to achieve that. examples: uyYmfawelk = returns true YlsngfswU = returns true kjnsdfW = true fwerg;m = false if(preg_match('/[A-Z]/', $text)) { echo 'Found caps!'; } -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [SPAM] [PHP] Date and tim
On 11 Aug 2004 10:35:37 -, DIFF FanneHH [EMAIL PROTECTED] wrote: Hi, I have this date in timestamp format: $a= 20040810114155; Convert it to a unix timestamp (that's a mysql timestamp), then add 7 days worth of seconds to it. Search the archives or the web for more. If you're stuck, try using substr. I want to add 7 days to this date. How can i do that? Thanks Home, no matter how far... http://www.home.ro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] weird error, might be javascript?
On Wed, 11 Aug 2004 13:03:23 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: yes but even If I take the page source, its not anywhere near 597 lines long...any other ideas? Sorry forgot to mention it in initial post. How long is the JavaScript file? Look at line 597 in that file. If that also does not work, try using Mozilla FireFox. I find it much easier to use for JS debugging. John Holmes [EMAIL PROTECTED] 8/11/2004 12:44:25 PM Angelo Zanetti wrote: I have been working on a pretty big project over the last couple of months and then all of a sudden I started getting errors in my browser, the error in the bottom left corner with the yellow icon. anyway Im not sure what causes these errors. It says that it expects a ) on line 597 of that page. That's a JavaScript error. Look at line 597 of the HTML source, not the PHP source, to find the error. -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: define constants within functions?
On Wed, 11 Aug 2004 06:54:35 -0500, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Sure, define them outside the function :) [/snip] I have not tried this (we usually place constants in a section of the code external to any function) but are you saying that if a constant is defined within the bounds of a function it is not global? Yes, it is global. The OP was not calling his function. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [PHP4] class overload and ref to objects
The magic methods tend to screw up references in PHP4. I've turned it off completely myself. My advise is to switch to PHP5 or not use the overloading. On Wed, 11 Aug 2004 15:06:51 +0200, Alessandro Vitale [EMAIL PROTECTED] wrote: Hi all, I have encountered some troubles in trying to achieve the following: - overload class properties by means of __set() and __get() magic functions - store references to objects rather than copies of them in the overloaded class properties using the following code I can actually store and access references to objects, but it doesn't work if I try to call a method on the referenced object: $OO = new overloadedClass(); $OO-new_property = $myObject; // this is a real ref to $myObject echo $OO-new_property-my_property // it works fine $OO-new_property-myFunction();// doesn't work and produces fatal error the error message looks like this: Fatal error: Class 'overloadedClass' does not support overloaded method calls... any help or suggestion is very much appreciated. thanks, Alessandro - code fragment ?php class overloadedClass { var $Properties = array(); function ServicesRepository() { overload(overloadedClass); } function __set($property_name, $property_value) { $this-Properties[$property_name] = $property_value; return true; } function __get($property_name, $property_value) { if(isset($this-Properties[$property_name])) { $property_value = $this-Properties[$property_name]; return true; } else return false; } } ? *** Alessandro Vitale Jr. Software Engineer Tiscali International Network Spa +39 070 4601678 [EMAIL PROTECTED] *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php !DSPAM:411a17dc169931992880537! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Load data and Insert
On Wed, 11 Aug 2004 12:49:22 -0300 (ART), Juan Pablo Herrera [EMAIL PROTECTED] wrote: Torsten Roehr [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Juan Pablo Herrera [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi! i need do two querys in one. First query is a load data and the second query is insert into. My idea is to concatenate with and, but i'not know. Is it possible? Regards, Juan Please specify a bit more clearly *what* data you want to load *from where* and insert into *what*. Then we may be able to help you. Regards, Torsten Roehr If you refer to MySQL you can use the INSERT ... SELECT syntax to do this in one query. See here: http://dev.mysql.com/doc/mysql/en/INSERT_SELECT.html Regards, Torsten Roehr It's OK, but i need concatenate load data with insert. I have a file *.cvs that used three fields (a,b,c), my database have four fields(a,b,c,d). The insert have the data for last field. Regards, Juan I assume you means a csv file, not a cvs file. No, you can't directly load it into Mysql. Yes, you can load it into PHP and then do an INSERT with that data. Google for PHP CSV. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OO Question for PHP4
On Wed, 11 Aug 2004 09:14:08 -0600, Jed R. Brubaker [EMAIL PROTECTED] wrote: Hi all. As the subject suggests, I am using PHP4 and am having something going on that I don't think should be. Presume the following code class Foo { function Foo () { return Bar; You shouldn't be returning from a constructor. } } $foo = new Foo; echo $foo; It's generally bad prcative to echo anything other than scalar types (strings and numbers). Try using print_r() or var_dump() instead. $foo comes out as an object. Does this have to be done in two line like this?: class Foo { function bar () { return Bar; } } $foo = new Foo; $bar = $foo-bar; Yes, this has to be two lines. I'm not sure how you'd want to put this as one. In addition, you should have parenthesis on your funciton call: $bar = $foo-bar(); Or is there a better design approach I should be reminded of or learn? -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/MySQL based webmail?
On Wed, 11 Aug 2004 10:15:00 -0700 (PDT), Matthew Sims [EMAIL PROTECTED] wrote: [snip] Yes. But both Squirrel and Horde must speak IMAP to the mail server, whether on localhost or remote. IMAP's nontrivial and introduces more load on the web app server than -- say -- a POP-based mail GUI. Or static web pages. There's a difference between what POP and IMAP does. Basically, do you want your users to view mail from one computer only (laptops, desktops) with no worries about disk space or from any computer (terminals all around the area) with email stored on the mail server. http://www.cit.cornell.edu/computer/email/imap-pop.html [snip] Quick comment. POP does not *have* to download the messages locally *only*. It can also leave the messages on the server, behaving much like IMAP. Of course, POP by default will not leave the message on the server and it much more lightweight (less features) than IMAP. It all depends on what you and your app need. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with mysql_fetch_array
On Wed, 11 Aug 2004 17:13:49 -0400, Deepak Dhake [EMAIL PROTECTED] wrote: i am trying to print some values from a table with using mysql_fetch_array in a loop but not able to get correct values. it works fine for the loop i=0, prints all desired values but when it bocomes i=1 and starts the loop again the result values gets reset and prints the same old values. for example: outout of the query is result 1 result 2 result 3 result 4 result 5 result 6 result 7 result 8 result 9 result 10 result 11 result 12 :when i=0, it runs through the loop and prints result 1 result 2 result 3 result 4 result 5 result 6 :which is perfect. :but when i=1, it prints the same values, result 1 result 2 result 3 result 4 result 5 result 6 why is that so? can anyone help me? thanks in advance. $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; for($i=0; $i 2; ++$i)//surveys { for($j=0; $j 2; ++$j)//questions { for ($k=0; $k 3; ++$k)//sub-quesions { $row2 = mysql_fetch_array($query4); //Printing all result values one by one } } } I'm not sure what you think this should do, but you're assuming that 2 * 2 * 3 (12) records will be returned, no more, no less. I doubt this is the case. Normally, such things are done like this: $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2; while($row2 = mysql_fetch_array($query4)) { //print array } If this isn't what you want, perhaps you should be doing 3 seperate queries in there? Please explain why you have 3 for loops around your fetch; -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File Upload Problems
On 11 Aug 2004 21:30:38 -, Mark Collin [EMAIL PROTECTED] wrote: (Sorry if this is a repost, had some problems with my news client not sending properly) Thanks for the pointers Raditha, unfortunately I still can't get it working. I have been banging away at this for a few days now, and I currently have the following my script: ini_set(max_execution_time, 600); ini_set(max_input_time, 600); also tried set_time_limit(600) The following displaying in phpinfo(): upload_max_filesize 2M post_max_size 8M memory limit 8M and in an .htaccess file in the directory. LimitRequestBody 200 httpd.conf does not have LimitRequestBody set. I either get a white screen with no errors displayed or a 404 page and really cannot work out what is going on. Does anybody have any other ideas as to where I may have gone wrong ? [EMAIL PROTECTED] [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]: Mark Collin wrote: I'm having problems with my file upload code. If I start to upload files larger than a approx 400k the page seems to time out and I get a page cannot be displayed error. I have checked the php.ini on the server and max file size is 2Mb and max Post size is 8Mb. This is typical of the default setting for LimitRequestBody directive of apache - which is set to 512kb please look at your httpd.conf file and see if this is set - just deleting that line would do. If it still does not work you might find this link usefull http://www.radinks.com/upload/config.php - it shows how to configure php for handling large uploads. 1) Have you checked the temp dir where these files are uploaded? Is it perhaps full? 2) Are the images you're uploading the right format? GD can't read non-RGB jpegs, for instance. 3) Are the file names strange at all? Filenames with spaces or special / international chars can cause problems. 4) Have you checked memory usage while the script is running? If you're in Linux, use top on the command-line. 5) Have you checked the Apache logs? Specifically, look int he error log for crashes. If it's crashing, you've probably hit your memory limit or a bug in PHP or GD. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] learning to right objects
On Wed, 11 Aug 2004 16:35:33 -0500, Blake Schroeder [EMAIL PROTECTED] wrote: I am trying to change some of my functions in to classes and objects. I have been checking out the php.net and google and still not grasping the concept. here is my example all I am trying to do is print 2 numbers to the browser that are randomly generated from dieRolls. Thanks in advance -Blake class dieRolls{ function dieRolls($die){ $num = rand(1, $die); You're storing this value in a local var, not an object property. Try: $this-num = rand(1, $die); $this-num; This does nothing as $this-num is not set (see above) and you're not *doing* anything with it. } } $num1 = new dieRolls(6); $num2 = new dieRolls(8); $bar1 = $num1-bar1; $bar2 = $num2-bar2; I don't know what you think these two lines are doing. You never set bar1 or bar2, so you'r enot going to get anything. echoHibr\n; echo$bar1br\n; echo$bar2br\n; I would suggest using this (after fixing the first problem I pointed out): echo $num1-num.br/\n; echo $num2-num.br/\n; -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] scan a text string to pick up certain words
On Wed, 11 Aug 2004 18:07:57 -0400, Alex Shi [EMAIL PROTECTED] wrote: Hi All, I guess regex can do the trick but I don't know much about regex :(( Here is what I want: Say a text string in which there're several words enclosed by { and }, for example {hellow}. I need to pick up each of the words like this and print them or do some processing one by one. Can any one please show me an example how to do this in PHP. Thanks in advance! preg_match_all('/{([^}]*)}/', $text, $matches); print_r($matches[1]); -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: MySQL PHP Examples Training Providers Required
On Wed, 11 Aug 2004 18:20:23 -0400, Lukasz Karapuda [EMAIL PROTECTED] wrote: Michael, My company has recently developed a Web site module for a local manufacturing company. The Web site module is a PHP and MySQL application composed of several screens and advanced engineering functionality (graphing, calculations etc). One of the database tables for the application has over 110,000 records. Why I chose to reply to your email is because PHP is not usually used for the development of more complex functionality like the Web site module that we have developed. I beg to differ. Many large and complex sites are written in PHP. There are also many large and complex programs written in PHP which are in production use. Take TYPO3, for example: http://www.typo3.org The module performed well in testing. It has not been released for production yet, so I don't have a good performance report on the production version of the Web site module (with many concurrent users). I could provide you the URL to the Web site when it is released to production. Regards, -- Lukasz Karapuda VP Application Development - newline Creations LLC e-mail: [EMAIL PROTECTED] http://www.thenewline.com -Original Message- From: Harlequin [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 10, 2004 7:07 PM To: [EMAIL PROTECTED] Subject: MySQL PHP Examples Training Providers Required Hi all. This might sound like a strange request but here goes. I'm looking for some examples of sites that are purely MySQL and PHP running on Unix and that contain a few thousand records preferably held in relational databases. Rationale: I need to justify PHP as a tool of choice over say vb.net or Oracle. My recommendation, despite my limited knowledge of MySQL and PHP is that even if we have 10-15 databases holding upwards of 10,000 records each PHP and MySQL are the tools of choice and I doubt that there are any functions missing that you'd find in VB.Net. I could be wrong and if so, please let me know. My other question is that I am looking for training in the UK, preferably in the North. I have no idea about accreditation or certification requirements and wondered if anyone could provide any recommendations...? Thanks for your time guys. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Escaping quotes
On Wed, 11 Aug 2004 19:03:32 -0500, Alex Hogan [EMAIL PROTECTED] wrote: Hi All, I have this expression; $query = INSERT INTO $table (%s) VALUES (%s); $query = sprintf($query, implode(,, $fld), implode(,, $val)); $result = mssql_query($query) or die($errmsg); I am trying to insert values from an array into the database. I keep getting the error that I can't pass column names in this context. I know it's because I'm not enclosing $val in quotes. I've tried a number of variations; implode(\,\, $val) implode(\',\', $val) implode(,, \.$val.\) - This blows up nicely ;-) Where am I going wrong on this? 1) By using implode to do this 2) By not escaping quotes in the data If you look in the PEAR::DB code, here's how they quote field names: function quoteIdentifier($str) { return '[' . str_replace(']', ']]', $str) . ']'; } and here's how they quote values: function quoteSmart($in) { if (is_int($in) || is_double($in)) { return $in; } elseif (is_bool($in)) { return $in ? 1 : 0; } elseif (is_null($in)) { return 'NULL'; } else { return ' . str_replace(', '', $in) . '; } } -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/MySQL based webmail?
On Wed, 11 Aug 2004 18:25:34 -0700 (PDT), Hardik Doshi [EMAIL PROTECTED] wrote: Hi Chris, Horde is little bit heavier than Squirrelmail. You can buy a Zend acclerator to speed up the things. You can also get the free TurckMMCache to cache the parsed PHP files. I think your community is not that big and Horde works fine in our organization where we have 1000 users and all are pretty active. Look and feel matters in the web mail so before you make any decision then consider this issue as well. Let me know if you need more information about Horde. Thanks, Hardik --- Chris Shenton [EMAIL PROTECTED] wrote: Matthew Sims [EMAIL PROTECTED] writes: Uh, well...Squirrelmail is simply a webpage. The number of simultaneous users is defined by the web server application, aka Apache. Perhaps we view it differently. Apache is a web server. SquirrelMail and Horde are applications, written in PHP. I'm curious about user experiences deploying both, especially in terms of resource consumption and scalability. IMAP doesn't HAVE to be on the same box. You can use SM to connect to an another server running your mail. Yes. But both Squirrel and Horde must speak IMAP to the mail server, whether on localhost or remote. IMAP's nontrivial and introduces more load on the web app server than -- say -- a POP-based mail GUI. Or static web pages. I'm also quite interested in fault-tolerance. I can deploy a couple of physical boxes running SquirrelMail behind load balancers. But Squirrel stores stuff like user address books and preferences on the web server's disk; this obviously won't work in a load balanced arrangement where a client connection is just as likely to go to the other box. I could put the files on a back-end NetApp NFS server like I do for my (balanced) SMTP/IMAP mail servers; this may introduce NFS file locking problems and corruption by simultaneous access to the same NFS-resident file. (My SMTP/IMAP servers use Maildir to avoid NFS problems). Does Horde have these same implementation issues? How does it store preferences and such? It seems a much more resource-intensive application than the relatively simpler SquirrelMail, but I haven't done any benchmarks to compare the two. Basically it boils down to this question of web app scalability and resource needs: can I support a community of (say) 2500 people, where maybe 100 are actively using webmail at any given instant on a box like a Sun Netra running Slowaris with 1GB RAM? Or some 2GHz i86 box with 1GB running FreeBSD? If not, how are you folks worrying the scalability issue? While this isn't specifically a PHP question, I think scalability of PHP applications is germane to the list. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Escaping quotes
On Thu, 12 Aug 2004 12:34:30 +1000, Tom Rogers [EMAIL PROTECTED] wrote: Hi, Thursday, August 12, 2004, 10:03:32 AM, you wrote: AH Hi All, AH I have this expression; AH $query = INSERT INTO $table (%s) VALUES (%s); AH $query = sprintf($query, implode(,, $fld), implode(,, AH $val)); AH $result = mssql_query($query) or die($errmsg); AH I am trying to insert values from an array into the database. AH I keep getting the error that I can't pass column names in this context. AH I know it's because I'm not enclosing $val in quotes. AH I've tried a number of variations; AH implode(\,\, $val) AH implode(\',\', $val) AH implode(,, \.$val.\) - This blows up nicely ;-) AH Where am I going wrong on this? AH alex hogan You can do it this way but you must make sure that any strings in your values array have been escaped before with mysql_escape_string() and probably trimmed as well. The question was about mssql, not mysql. using str_replace(', '', $str) should work. $fields = array('id','name','age'); $values = array(1,'Dave',40); $table = 'test'; $sql = sprintf(INSERT INTO %s (%s) VALUES ('%s'),$table,implode(',',$fields),implode(',',$values)); echo $sql; (It's perfectly ok to quote numbers) -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hosting provider won't enable ftp_connect()
On Tue, 10 Aug 2004 09:41:45 -0500, Brian Anderson [EMAIL PROTECTED] wrote: I am trying to get a hosting provider(Godaddy.com) to enable the ftp_connect extensions to php. They tell me that they cannot do so for security reasons. Is this really such a security issue? I don't see how it would be a security problem. They probably just don't understand and think you want FTP access to the server. Allowing outbound FTP is only an issue if people sniff the network because they can see your login in plaintext. I thought there were PEAR packages which implemented the FTP protocol, but it looks like they use the FTP functions in PHP. You can try to find a PHP class which actually implements the FTP protocol (with sockets). You may be able to find one. If not, you'll have to switch. At php.net I read the advice: for ftp to work you must do ./configure --enable-ftp in php4 and from phpcollab.com: You should ask your hosting provider to install those for you, probably they will do without much problem. Or, if they don't want to, you should consider choosing another provider. If it is an issue, does anyone know of a hosting provider that allows these extensions? -Brian Anderson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_match_all but no preg_replace_all?
On Tue, 10 Aug 2004 18:51:43 +0200, Marten Lehmann [EMAIL PROTECTED] wrote: Hello, I want to be sure, that preg_replace replaces all matches. But it doesn't accept the /g modifier. And anyhow, there's no preg_replace_all like there is an preg_match_all. Will preg_replace replace everything by default? Everytyhing in the original string that matches it will replace. Regards Marten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL Functions
On Tue, 10 Aug 2004 10:31:36 -0400, Dan Joseph [EMAIL PROTECTED] wrote: Hi Everyone, I'm trying to build a class to handle various SQL functions. One of them is to take a query, and return all rows. Here's what I have so far: function selectRows( $sql ) { $count = 0; $results = mysql_query( $sql, DB::connect() ); $data = mysql_fetch_array( $results ); return $data; } Right now it only returns 1 row. I'm guessing this is how it should be, considering I haven't looped thru any other rows. What I want to do is return something that holds all the rows, however, I cannot see a decent way of doing this. I've played with putting it into a new array, but I can't decide if that's the best way to do it. Wondering if I could get some opinions on how you all would handle this? -Dan Joseph Of course, this begs the question of why you're re-implementing what has been done so many times in the past. http://pear.php.net/package/DB http://pear.php.net/package/MDB http://pear.php.net/package/MDB2 http://adodb.sourceforge.net/ http://www.phpclasses.org/browse/package/20.html etc -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL Functions
On Tue, 10 Aug 2004 13:37:50 -0400, Dan Joseph [EMAIL PROTECTED] wrote: Hi, Of course, this begs the question of why you're re-implementing what has been done so many times in the past. http://pear.php.net/package/DB http://pear.php.net/package/MDB http://pear.php.net/package/MDB2 http://adodb.sourceforge.net/ http://www.phpclasses.org/browse/package/20.html I'm building a class for use with our PHP applications. Packages like what you've linked me to are nice, but we need a little flexibility here, so we're writing a few methods of our own. Flexibility?? Those classes are very flexible and have many useful utility methods. In addition, they all support multiple DB backends (I would call that flexibility). In addition, since they're all OO, you can extend them (or their drivers) to create a class specific to your needs. I fail to see how any of these classes is inflexible. -Dan Joseph -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hosting provider won't enable ftp_connect()
On Wed, 11 Aug 2004 01:12:40 +0800, Jason Wong [EMAIL PROTECTED] wrote: On Wednesday 11 August 2004 00:48, Justin Patrin wrote: I don't see how it would be a security problem. They probably just don't understand and think you want FTP access to the server. Huh? Isn't FTP the usual mechanism for accessing your shared hosting space? It may be. It shouldn't be, though. SFTP at the very least. Getting someone's FTP login is pretty easy compared to something secure. Allowing outbound FTP is only an issue if people sniff the network because they can see your login in plaintext. Actually any plain old ftp is subject sniffing. A better solution is to use chrooted ssh accounts. There are enough clients out there which supports file transfers over ssh to make this practical. I realize that any FTP can be sniffed. I was speaking to his host not wanting to allow the FTP command on the server, which would mean outgoing FTP requests. Yes, it should all be SSL based. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* He who attacks the fundamentals of the American broadcasting industry attacks democracy itself. -- William S. Paley, chairman of CBS */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php !DSPAM:411906b964891092692678! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot redeclare function
On Tue, 10 Aug 2004 14:07:09 -0500, Alex Hogan [EMAIL PROTECTED] wrote: Did your error_reporting level change with the upgrade? This was more than likely silently ignored with PHP4 and now showing as a warning/error in PHP5 or just dependent upon your error_reporting level. No.., I was careful to set 5 up with as many of the same settings as the previous version. I only had half a day to change the production environment so I wanted to make sure there was no lag. Unless there was something that I missed. At first I thought that I had either duplicated the function someplace else, but that wasn't the case. Well, it's very likely that that file was being included twice. You just can't do an include() on the same file twice if it defines functions or classes. Look through your code and see all of the places where the include was happening. Perhaps the file that includes that file is being included twice. alex hogan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Read External Directory
On Tue, 10 Aug 2004 15:04:42 -0500, Stephen Craton [EMAIL PROTECTED] wrote: Hello, I'm in need of some help here. I'm working on a search engine script that searches basically anywhere. One thing I'm trying to do is open an external directory to read all the files to search. However, I can't just put a URL into the readdir() function without getting an error. How would I go about reading an external directory? If you're talking about a URL directory then you can't. You can only get what the webserver sends to you. If the result page happens to be a directory listing, you can parse it for links to files the same as any normal webpage. Thanks, Stephen Craton http://www.melchior.us http://php.melchior.us http://www.chatness.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LDAP Group query examples?
On Tue, 10 Aug 2004 11:26:07 -0600 (MDT), Sam Evans [EMAIL PROTECTED] wrote: Hello.. I am wondering if someone could point me in the general direction of some examples which show how to query an LDAP group for user membership? Use Softerra LDAP browser to look at the groups and figure out the path you need to access them, then use PHP's LDAP functions to query. http://www.ldapadministrator.com/download/index.php Thanks, Sam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PEAR-QA] PEAR SITE IF DOWN FROM MY IP
On Tue, 10 Aug 2004 17:14:03 -0500, Alfonso Baqueiro [EMAIL PROTECTED] wrote: Does pear admins custom to do nasty things with users that post comments for improvement or comments they dont like? For some oscure reason i unable to acces the main page of pear: http://pear.php.net My IP is 200.39.196.122. From other IPs i dont have any troble with the page. Unlikely unless you were very rude. More likely, your DNS isn't resolving right, your computer had an issue, or your ISP has a problem. -- PEAR QA Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable just not Behaving Itself.
On Wed, 11 Aug 2004 00:36:05 +0100, Harlequin [EMAIL PROTECTED] wrote: I have the following: [SNIP] $Emp_Status_Rqmt=$row[Emp_Status_Rqmt]; } if( $Emp_Status_Rqmt == 'Permanent' ) { $UserStatus = 'Permanent'; } if( $Emp_Status_Rqmt == 'Contractor' ) { $UserStatus = 'Contractor'; } else { $UserStatus == 'Flexible'; $UserStatus = 'Flexible'; } [SNIP] which echoes OK until I change the value to something other than Permanent or Contractor. It simple echoes resource ID #n what's wrong with me...? the code I mean...? -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Incorrect trans-sid placement in PHP Version 4.3.6
On Mon, 09 Aug 2004 10:02:23 +0200, Torsten Scheck [EMAIL PROTECTED] wrote: Hi, I just stumbled over a problem after I had updated PHP, and I thought I should share my experience: I use PHP Version 4.3.6 with '--enable-trans-sid' and deactivated cookies: session.use_cookies Off session.use_trans_sid On And when I use PHP's session feature together with an empty XML tag, PHP places the Session-ID in the wrong place, if there is no blank space behind the attribute: frame name=foo src=?php echo $page_self; ?/ = frame name=foo src=test-trans-sid.php/?PHPID=xxx..xxx NOT WORKING frame name=foo src=?php echo $page_self; ? / = frame name=foo src=test-trans-sid.php?PHPID=xxx..xxx / WORKING (BTW: The blank space is optional according to XHTML specs.) I hope this message helps you to avoid the kind of trouble I had. See attached test case for further testing and bug fixing. The php version I use is too old for the bug system. If you encounter the same bug in a higher version, please report it. Thanks. Torsten Why did you update to an older version of PHP? -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] base64_decode an image, works on blank page, not on page where text is..
On Mon, 9 Aug 2004 14:23:22 -0700, Josh Acecool M [EMAIL PROTECTED] wrote: If I try to base64_decode an image which was encoded with base64_encode on a blank page, it works, if I try on a page with stuff already on it, it just shows me the source code to the image... Example: Run this code as a blank page, no spaces before or after the ? then run it again with a space or a character.. Any ideas how to fix it? Thanks. ?php if (!function_exists(ac_call_base64_image)) { function ac_call_base64_image ($Image) { //require (./ACWB/ACWB_Base64_Images.php); //$Image = $ACWB_B64I[$Image]; return base64_decode($Image); } } // RedX Image... $ACWB_B64I['ACWB'] = R0lGODlhHAAeAKIAAP8AAP///8DAwICAgP///wAAACH5BAEAAAUALAAcAB4AAAO COLrc7mGUSau9NuL Np+5g9YXhSHbmuaXF81zsEMx0HQgELFmybeO6S89HA2Z2lSHxl jsKaQDALDozipAUZZRabV6fNW43yAtvi15KDCoNcK1q7ERJhHv krSWanNSPnWV+dgUxAoaHiIZpdxcEjo+QkHwqK3iUX5eVmZqbk 50efqFECQA7; echo ac_call_base64_image ($ACWB_B64I['ACWB']); ? PS: phpBB2 somehow got it to work, not sure how though :-/ You can't display an image inline. At least, not quite like that. You *can* use a special img tag with mozilla to display inline, but this isn't very well supported. Use an img tag to link to another script and have that script base64_decode the image and display it (with the correct headers). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How PHP handles multiple inclusions of the same file?
On Mon, 09 Aug 2004 02:11:14 -0400, Gambler ZG [EMAIL PROTECTED] wrote: what do you mean by that? Nothing. The statement was based on the erroneous assumption that anonimous functions allow to go into HTML mode with '?'. But this will not stop me, for there is eval()! The general idea is simple - to use some file's code multiple times without re-reading the file and re-parsing its content. So... $file = some/script.php; $handle = fopen($file, r); $script = fread($handle, filesize($file)); $script = 'function use_cached_code(){ ?'.$script.'?php }'; eval($script); use_cached_code(); Ick! eval() is evil! What you want here is a function. Make a function which does what you need and call it. function doSomething($val) { //This is re-used code echo '$val = '.$val; } Ta-dam! Well, I did not actually tested this code, and it's 2:06 AM here, so I may be wrong, but theoretically it should work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How PHP handles multiple inclusions of the same file?
On Mon, 9 Aug 2004 15:14:57 -0400, John W. Holmes [EMAIL PROTECTED] wrote: From: Justin Patrin [EMAIL PROTECTED] eval($script); use_cached_code(); Ick! eval() is evil! You have benchmarks to back that up or experience? Well, I didn't mean speed-wise necessarily, although it means more parsing. Much better to use a *function* which is parsed once than include()ing or eval()ing the same code over and over to (possibly) be re-parsed. It just makes more sense code structure-wise as well. I did a benchmark between using include(), eval(), smarty, pattemplate, and a few others and include() and eval() are always the fastest. Really depends upon what kind of features you need and what you consider evil. ;) By evil I mean that it's used for the wrong purposes much of the time. People aren't aware of the capabilities of the language or are simply ignorant of good coding style and use eval because it's easy. Heck, I used eval before I knew how to use $$ and arrays effectively. Here's a quote that really says it well: If eval() is the answer, you're almost certainly asking the wrong question. -- Rasmus Lerdorf, BDFL of PHP ---John Holmes... -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to configure sessions
Please don't send the same message twice. Response below. On Mon, 9 Aug 2004 20:32:12 -0300, Naty [EMAIL PROTECTED] wrote: Hi !!! I'm new with php, I just install php and apache, I test with info.php and all it's working. Now I'm trying to install a thirds party webapp that seams to have problems with sessions, I received a warning error like Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\webappphp\index.php:3) in C:\Program Files\Apache Group\Apache2\htdocs\webappphp\functions.php on line 26 Warning: Unknown: open(/C:/php/sessions/\sess_452f0a7e4f766da1ecc65a4eca8d9cb8, O_RDWR) failed: Invalid argument (22) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (N;/C:/php/sessions/) in Unknown on line 0 In the php.ini I have session.save_path = N;/C:/php/sessions/ Why do you have this in your save_path? this is definately not right. Try: session.save_path = C:/php/sessions/ Make sure that the user that PHP is running as has full access to that directory and restart Apache. Then try again. Maybe somebody can help me! Regards Naty -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php !DSPAM:411806e5291851697419290! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How PHP handles multiple inclusions of the same file?
On Mon, 09 Aug 2004 20:04:50 -0400, Gambler ZG [EMAIL PROTECTED] wrote: Much better to use a *function* which is parsed once then include()ing or eval()ing the same code over and over to (possibly) be re-parsed. //I read file once: $handle = fopen($fileName, r); $script = 'function use_cached_code(){ ?'; $script. = fread($handle, filesize($fileName)); $script. = '?php }'; //parse it once: eval($script); //and use the code as much as I want: use_cached_code(); It just makes more sense code structure-wise as well. Not in my case, believe me. Otherwise I would not ask about caching. *Maybe* if you *must* use this around *someone else's* code that you are *not allowed* to change would you use this, but I simply don't understand why you would do such a thing. You could add the function name and the bottom part to the file and just include() it. End of problem. If this is a template that someone else is editing, I would suggest using a templating system already out there to do the caching and such for you. This is really a nasty hack. If you want to use PHP-style syntax, Savant is your friend. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Local version works - production breaks
On Sat, 7 Aug 2004 20:55:44 -0400, Andre Dubuc [EMAIL PROTECTED] wrote: Hi, I have re-written a very basic website to use sessions (switching to https) for login to special areas of a site. After testing the site thoroughly locally, I uploaded the whole shebang to a unix server that runs Apache 1.3.x + PHP 4.3.4 + mysql. Almost all code broke - sessions would load, but almost every page was so messed up that -- well, I'm flabbergasted! Messed up how. This really doens't give us enough to help. I'm wondering, after reading a few threads on my local config whether the problem might lie with the Apache2 server I use locally (Mandrake special with Extranet). I also use an older version of PHP 4.3.1. I've examined both configs for differences, but can see nothing that would account for such an extremely messed up site. It loads locally beautifully (and all admin pages work) in Opera, Galeon, Mozilla, + Konqueror. Loads with errors to mysql db in all others but Konqueror which does not even display the opening page (yet I can view source). Maybe this isn't the forum to ask -- but seeing that all db access is through PHP -- I wonder whether anyone can point where i can start looking for the culprit(s). Any ideas, suggestions, or advice will be greatly appreciated. Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-DB] Eval a file, and it gives parse error because it uses a preg_match statement with \$
On Fri, 6 Aug 2004 11:20:38 -0700, Josh Acecool M [EMAIL PROTECTED] wrote: I dont have magic_quotes etc on, so when I use file_get_contents the EXACT, yes, EXACT file gets placed. 1) This is not a response to the e-mail you're responding to. I see nothing about magic quotes in Curt's e-mail. 2) You're saying the same things over and over. Stop wasting our time on this if you won't use our help. Once more: 1) we know that include won't work for this as you finallty gave us some pseudo-code 2) the error is in your preg_replace call, *not*, I repeat, *NOT* in the file_get_contents'd file. This thread has nothing to do with file-get_contents vs. include, but since you gave such a bad description of your problem, that's what we ended up talking about. You need to read this: http://www.catb.org/~esr/faqs/smart-questions.html Curt Zirzow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] * Thus wrote Josh Acecool M: You dont understan.. Not anymore. Honestly I haven't had a clue what was going on till Justin pushed you into the right direction. Say the template is: Blah {CONTENT} adasdasd I want to preg_replace(/{CONTENT}/, include(blah.php), $text); the example I quoted didn't use include(). Dont use include, use file_get_contents(). Curt Zirzow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] * Thus wrote Josh Acecool M: but, I am doing this. $text = file_get_contents('templateFile.php'); $text = preg_replace('/something/', file_get_contents(something.php), $text); eval(? . $text . ?) This is rather an odd thing to do, kinda like taking an html document converting it to xml, add an element, then turning it back to html. To get around your \$ problem.. see http://php.net/preg_quote Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-DB] Eval a file, and it gives parse error because it uses a preg_match statement with \$
On Thu, 5 Aug 2004 09:51:10 -0700, Josh Acecool M [EMAIL PROTECTED] wrote: The files that are evaled work perfectly without being evaled. I dont think eval was meant for large files etc. Whats on that like: a preg_match that looks for \$variable = something; and thats the like it messes up on. Also, if the file which is evaled includes another file, the variables from the included file wont get parsed or anything, and the variables set to it by the first file, or the class dont work at all. What version of PHP are you using? Are you doing anything to the string before eval-ing it? You say that if you just include() is, it works fine. *Why* not just include it, then? John Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Josh Acecool M wrote: var $The_Template_Sys; $this - The_Template_Sys = file_get_contents($The_Template_File); $this - Sub_Template = TRUE; Any ideas? I have an idea I said in a previous email! you say you're getting a parse error. How could anyone possibly help you troubleshoot that parse error unless they had an example of what was in the file being eval()'d?? What is actually in the file that's failing the eval()??!?!?! What line of the file is failing? What is on that line? What's on the couple of lines before it? What's on the couple of lines after that line that's failing? What does the line with the eval() call look like? Are you doing anything else with $this-The_Template_Sys before it's eval()'d?? -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: str_replace() problem in PHP5 - RESOLVED
On Thu, 05 Aug 2004 07:21:35 -0700, Jon Bertsch [EMAIL PROTECTED] wrote: Curt and Justin, Thanks for the ideas. I resolved this by removing the str_replace() call from within a function that I was calling and running it in-line in the code. Since the html string was less than 500 char it seems unlikely that it was memory but that's also about the only thing that would be different between prod and dev environments so that's the best candidate for causing the problem (php.ini set at default 8M). There were no error messages at all, the script would just end and the logs showed nothing at all, as if it was never even called. Jon Bertsch As I said, that sounds like a threading issue. Another difference between dev and prod is load. Try using prefork apache 2 or apache 1. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Optimizing Tips
On Thu, 5 Aug 2004 14:27:56 +0200, Nicklas Bondesson [EMAIL PROTECTED] wrote: The Zend Optimizer only caches the compiled PHP output (HTML content) that should be sent to your client. You can always try it but I don't think you will gain that much on using it. It's worth trying though. Actually, it caches the parsed PHP files so that you don't have to re-parse the PHP files every time. AFAIK, it doesn't parse HTML output. This is exactly what TurckMMCache does (and it's free :-). Nicke -Original Message- From: Vinayakam Murugan [mailto:[EMAIL PROTECTED] Sent: den 5 augusti 2004 14:09 To: Nicklas Bondesson Subject: Re: [PHP] Optimizing Tips On Thursday 05 Aug 2004 5:29 pm, you wrote: Will the majority of the visitors surf from within India? I think I will experience the site more slow than anyone from India. I'm surfing from Sweden and the Internet connection to India is not that good. I can always take a look inside the server if you give me an account to it. Nicke True. That could be a factor. I'm sorry but I am not authorized to part with my account details. Thanks for asking though. Would trying an optimizer like Zend help? -- Warm Regards ~~~ Vinayakam Murugan Tel: 91-22 - 2288 2163 Ext 105 Fax Number: 91-22 - 2288 2809 Mobile : 91-22-3101 8082 http://www.TheArgonCompany.com Viruses getting you down? Get your virus protected mailbox at http://www.tassm.com Linux. The Choice of the GNU generation -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-DB] Eval a file, and it gives parse error because it uses a preg_match statement with \$
On Thu, 5 Aug 2004 21:42:58 -0700, Josh Acecool M [EMAIL PROTECTED] wrote: 5.0.0 Include WORKS, but using INCLUDE with PREG_REPLACE does NOT work, the text you want to replace gets deleted and the INCLUDE includes on the top of the page... You're not making senseyou're saying that using preg_replace *in* the included code doesn't work? That can't be what you mean. Including a file does *not* include it at the top of the page. It's included wherever you put the include statement. You can put them *anywhere*, not just at the top of the page. See the DB::connect() method in PEAR DB for an example. http://cvs.php.net/co.php/pear/DB/DB.php?r=1.59 If what you're saying is that the output goes to the browser, you can use the output buffering functions to catch the output. http://us3.php.net/manual/en/ref.outcontrol.php If what you're doing is similar to this: $text = file_get_contents('templateFile.php'); $text = preg_replace('/something/', 'something else', $text); eval($text); Then you *are* changing the text before eval-ing it (you never answered the many questions about this). If this is what you are doing, then it sounds like the issue is not in the eval or the included file, but in the preg_replace. Please give us the exact preg_replace line that you are using and what it is supposed to do so we can help with your regex. Justin Patrin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 5 Aug 2004 09:51:10 -0700, Josh Acecool M [EMAIL PROTECTED] wrote: The files that are evaled work perfectly without being evaled. I dont think eval was meant for large files etc. Whats on that like: a preg_match that looks for \$variable = something; and thats the like it messes up on. Also, if the file which is evaled includes another file, the variables from the included file wont get parsed or anything, and the variables set to it by the first file, or the class dont work at all. What version of PHP are you using? Are you doing anything to the string before eval-ing it? You say that if you just include() is, it works fine. *Why* not just include it, then? John Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Josh Acecool M wrote: var $The_Template_Sys; $this - The_Template_Sys = file_get_contents($The_Template_File); $this - Sub_Template = TRUE; Any ideas? I have an idea I said in a previous email! you say you're getting a parse error. How could anyone possibly help you troubleshoot that parse error unless they had an example of what was in the file being eval()'d?? What is actually in the file that's failing the eval()??!?!?! What line of the file is failing? What is on that line? What's on the couple of lines before it? What's on the couple of lines after that line that's failing? What does the line with the eval() call look like? Are you doing anything else with $this-The_Template_Sys before it's eval()'d?? -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing user entered data to DB
On Thu, 05 Aug 2004 12:35:59 +0200, Jordi Canals [EMAIL PROTECTED] wrote: John Holmes wrote: $uservar = htmlspecialchars(strip_tags($uservar)); You don't need to use strip_tags _and_ htmlspecialchars()... unless you want strip_tags to get rid of such malicious and deadly content such as grin and wow. Just use htmlspecialchars(). Well, my idea was to apply both: I do not want to get any tag in the user input and prevent showing the html tags in the later output. For that I've applied strip_tags() To apply htmlspecialchars() after that Is done to convert double quotes, and ampersand to html entities. Not appliying it has two efects: Strings with quotes does not show correct in input boxes. Strings with ampersands do not pass the W3C validator. And just to convert lt and gt signs when used alones like ... 5 2. htmlspecialchars() shoudl be used for *output*, not for *input*. When you store the data, it should be in pristine format. When you display it in the browser, you should use htmlspecialchars() or htmlentities() to make the browser like it. As for quotes, yes, htmlspecialchars() can deal with them, but for SQL, you should use an SQL quoting mechanism (mysql_real_escape_string()). For HTML output, you should use htmlentities(). Just that are my reasons to apply both: Security and get a clean string. $securevar = (magic_quotes_gpc) ? $uservar : addslashes($uservar); $securevar = (get_magic_quotes_gpc()) ? $uservar : addslashes($uservar); $securevar = $intval($uservar); $securevar = intval($uservar); Definetly, I should not code as late as night ;) My Samples where plenty of mistakes :p Thanks for your comments, Jordi -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Location header does not work?
On Thu, 5 Aug 2004 10:35:47 -0500 (CDT), Bing Du [EMAIL PROTECTED] wrote: I really appreciate everyone who responded taking your valuable time looking into my problem. Now back to my problem. Changing the condition to if($_SERVER['HTTPS'] != 'on') did not make any difference unfortunately. So the result was still the URL in the Address box of the browser changed to https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=viewid=159Itemid=162 fine. But instead of showing the page that https address should point to, 'You are in HTTPS mode' was displayed as the else clause specified. So what's the answer? REMOVE THE ELSE. If you want it to run the code following the redirect code in the same script if it's not using those request params or in https mode, do: if ($option == 'content' and $task == 'view' and $id == 159 and $Itemid == 162) { if(isset($_SERVER['HTTPS'])) { header('Location: https://computing.eng.iastate.edu/mambo/index.php'. '?option=contenttask=viewid=159Itemid=162'); } } As simple as that. If that's not the answer, you're asking the wrong question. Bing On Wed, 4 Aug 2004 17:02:30 -0500 (CDT), Bing Du [EMAIL PROTECTED] wrote: Ok, now I'm confused and cannot understand the result of the following code snippet. After click the link that I want to redirect, the URL in the Address box of the browser changed from http to https fine (that's what I expected). But 'hello my friend' was also displayed. How come? if ($option == 'content' and $task == 'view' and $id == 159 and $Itemid = 162) { session_write_close(); if (!isset($_SERVER['HTTPS'])) { header(Location: https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=viewid=159Itemid=162;); } else { echo 'hello my friend'; } =if ($option == 'content' and $task == 'view' and $id == 159 and $Itemid == 162) { if($_SERVER['HTTPS'] != 'on') { header('Location: https://computing.eng.iastate.edu/mambo/index.php'. '?option=contenttask=viewid=159Itemid=162'); } else { echo 'You are in HTTPS mode.'; //do stuff } } Bing On Tue, 3 Aug 2004 15:34:27 -0500 (CDT), Bing Du [EMAIL PROTECTED] wrote: The latest message I got was 'Redirection limit for this URL exceeded. Unable to load the requested page.This may be caused by cookies that are blocked.'. Your page is redirecting you over and over again. Your problem is that you're not checking for https before you redirect! If the user comes in with the https URL, you're still redirecting them. Try checking the value of $_SERVER['HTTPS']. Bing On Tuesday 03 August 2004 15:41, Bing Du offered up the following tid-bit of information : I've been struggling with this redirect thing for a while but still cannot get it work. I'm desperately needing help, please. What I want to do is redirect http://computing.eng.iastate.edu/mambo/index.php?option=contenttask=view id=159Itemid=162 to https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=vie wid=159Itemid=162. The only difference between the above two URLs is one is http and the other is https. = if ($option == 'content' and $task == 'view' and $id = 159 and $Itemid == 162) { session_write_close(); header(Location: https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=vie wid=159Itemid=162); exit; } = Am I doing anything wrong with the Location header? What's the error? Is it just not forwarding? Headers already sent? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-DB] Eval a file, and it gives parse error because it uses a preg_match statement with \$
On Thu, 5 Aug 2004 22:32:54 -0700, Josh Acecool M [EMAIL PROTECTED] wrote: IF I do this: $text = file_get_contents('templateFile.php'); $text = preg_replace('/something/', include(something.php), $text); then it gets put ON TOP of the file, not where something is... see what I am saying? It's still not on top of the page, it's right in that line of code where you asked for it. Include would return true as it included the page and your $text doesn't have what you wanted it to have. This is obvious as include() doesn't return the code, it runs the file. but, I am doing this. $text = file_get_contents('templateFile.php'); $text = preg_replace('/something/', file_get_contents(something.php), $text); eval(? . $text . ?) Ok, finally the real code. So you are doing processing on the file before eval-ing it. Please show us the real regex. Are you actually doing this this way? *WHY*? Likely your problem is that the contents of something.php has a $ in it (duh, it's PHP) and preg_replace is trying to put something there. If you show us the actual code you're using *maybe* we can help. How about something different: $text = file_get_contents('templateFile.php'); $chunks = preg_split('/something/', $text); eval('?'.$chunks[0].'?'); include(something.php); eval('?'.$chunks[1].'?'); Justin Patrin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 5 Aug 2004 21:42:58 -0700, Josh Acecool M [EMAIL PROTECTED] wrote: 5.0.0 Include WORKS, but using INCLUDE with PREG_REPLACE does NOT work, the text you want to replace gets deleted and the INCLUDE includes on the top of the page... You're not making senseyou're saying that using preg_replace *in* the included code doesn't work? That can't be what you mean. Including a file does *not* include it at the top of the page. It's included wherever you put the include statement. You can put them *anywhere*, not just at the top of the page. See the DB::connect() method in PEAR DB for an example. http://cvs.php.net/co.php/pear/DB/DB.php?r=1.59 If what you're saying is that the output goes to the browser, you can use the output buffering functions to catch the output. http://us3.php.net/manual/en/ref.outcontrol.php If what you're doing is similar to this: $text = file_get_contents('templateFile.php'); $text = preg_replace('/something/', 'something else', $text); eval($text); Then you *are* changing the text before eval-ing it (you never answered the many questions about this). If this is what you are doing, then it sounds like the issue is not in the eval or the included file, but in the preg_replace. Please give us the exact preg_replace line that you are using and what it is supposed to do so we can help with your regex. Justin Patrin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 5 Aug 2004 09:51:10 -0700, Josh Acecool M [EMAIL PROTECTED] wrote: The files that are evaled work perfectly without being evaled. I dont think eval was meant for large files etc. Whats on that like: a preg_match that looks for \$variable = something; and thats the like it messes up on. Also, if the file which is evaled includes another file, the variables from the included file wont get parsed or anything, and the variables set to it by the first file, or the class dont work at all. What version of PHP are you using? Are you doing anything to the string before eval-ing it? You say that if you just include() is, it works fine. *Why* not just include it, then? John Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Josh Acecool M wrote: var $The_Template_Sys; $this - The_Template_Sys = file_get_contents($The_Template_File); $this - Sub_Template = TRUE; Any ideas? I have an idea I said in a previous email! you say you're getting a parse error. How could anyone possibly help you troubleshoot that parse error unless they had an example of what was in the file being eval()'d?? What is actually in the file that's failing the eval()??!?!?! What line of the file is failing? What is on that line? What's on the couple of lines before it? What's on the couple of lines after that line that's failing? What does the line with the eval() call look like? Are you doing anything else with $this-The_Template_Sys before it's eval()'d?? -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http
Re: [PHP] Outputting Data
On Thu, 5 Aug 2004 23:13:32 +0100, Harlequin [EMAIL PROTECTED] wrote: It appears that I am unable to output the data to a directory because although my user has sufficient privileges on the database to execute the query the user in question does not have file privileges. As I am reliant on my host I'm looking for other ways to achieve this. Could I possibly set a prompt for downloading the file...? If so, how...? Or could I echo to screen and copy and paste...? I'm looking for a better solution than that last brain fart though. Ideally a download option but although I have scoured the web cannot seem to find anything specifically related to downloading a CSV output from MySQL. Use headers to give the content type and filename. Or you could set the permissions on the dir to 777. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why do I keep getting a 501 mail error?
On Fri, 06 Aug 2004 00:57:32 +0200, Jordi Canals [EMAIL PROTECTED] wrote: Brian Dunning wrote: Developing on a Windows server to be deployed on Linux. I get SMTP server response: 501 Bad address syntax. Here's my code: $mail_to = $first_name $last_name $email; On Windows Platform, You cannot use the TO address in the form Name address As it fails because the mail() function sends incorrect RCPTO headers to the SMTP server. Just send the mail with the TO, CC and BCC adresses in the form [EMAIL PROTECTED]. On Windows, your vars must be: $mailto = $email and nothing more (No name and no less or greather signs, just an email address). Take a look at PHP Bug #28038 http://bugs.php.net/bug.php?id=28038 and make your vote to have it solved in some future version ;) I put a patch in that bug report that *should* fix it. It's not tested at all, though. If someone can test it, please do: http://bugs.php.net/bug.php?id=28038 -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-DB] Eval a file, and it gives parse error because it uses a preg_match statement with \$
On Fri, 6 Aug 2004 04:24:25 -0700, Josh Acecool M [EMAIL PROTECTED] wrote: You dont understan.. Say the template is: Blah {CONTENT} adasdasd I want to preg_replace(/{CONTENT}/, include(blah.php), $text); blah.php contains Hello! This is what appears Hello! Blah adasdasd This is expected. We know that include() won't work for your situation. Please respond to my previous e-mail if you want more help. Curt Zirzow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] * Thus wrote Josh Acecool M: but, I am doing this. $text = file_get_contents('templateFile.php'); $text = preg_replace('/something/', file_get_contents(something.php), $text); eval(? . $text . ?) This is rather an odd thing to do, kinda like taking an html document converting it to xml, add an element, then turning it back to html. To get around your \$ problem.. see http://php.net/preg_quote Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Request for Help/Information
On Wed, 4 Aug 2004 09:04:33 -0500, Andy Baldwin [EMAIL PROTECTED] wrote: Would someone be willing to suggest a solution to a coding problem? After the following code (downloads a text file from the host server to my PC), how can I redirect the script to another one? ?php $user_agent = strtolower($_SERVER[HTTP_USER_AGENT]); header(Content-type: application/force-download ); if((is_integer(strpos($user_agent,msie))) (is_integer(strpos($user_agent,win { header(Content-Disposition: filename= . $filename); } else { header(Content-Disposition: attachment; filename= . $filename); } header(Content-Description: File Transfer); @readfile($filename); ? I have tried without success: header(Location: Echo_UploadBatch.php?filename= . $filename); Any help would be appreciated! Short answerL you can't. If you download a file from a script, you can do only that, you can't output HTML, javascript, or any redirection headers. That being said, it *may* be possible to send a multipart response with a file and redirection, but I'm not sure of this at all. AFAIK, the browser shouldn't display a blank page when you download a file as long as it's in an exising window. It should stay on the page where you clicked the download link. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace() problem in PHP5 - anyone else?
On Wed, 04 Aug 2004 08:14:55 -0700, Jon Bertsch [EMAIL PROTECTED] wrote: Hi all, I have found a problem using the str_replace() function in PHP5. Over this past weekend we switched our production server to php5.0.0 running on apache 1.3.31 on SUSE9.1. Our development environment is identical. I have an application that runs a series of str_replace calls to drop in some document title and link information into an html string before sending it to the browser. Code example: $html_string[0] = lia href=\read_docs.php?file=@@FISCAL_YEAR@@/@@month@@/393_@@TYPE@@.pdftype=pdfaction=read\GEP amp; HIP Balances (GLC393)/a/li ; $html_output_1 .= $html_string[0]; $output = str_replace(@@FISCAL_YEAR@@, $this_year, $html_output_1 ); (I call it three times to do the replacements in the string). This basically produces a list of documents with links to there location from a database call. On our development box this little application runs fine. In production where our server is getting around 1 million hits a day (but the processor is rarely above 1% usage) this function completely fails. The page just doesn't get shown. If I comment out the calls to str_replace the html goes over perfectly with the @@TOKEN@@ instead of the necessary information. If I change the str_replace to say YEAR or FISCAL etc it makes no difference. I dropped the production server to php 4.3.8 and the str_replace() function works exactly as expected and there are no problems loading the page. Bump back to php5.0.0 and it coughs again. Has anyone else seen anything like this or does anyone have an explanation? I can recode the series of str_replace calls but now I'm somewhat worried that other solutions will also fail. It seems to me like there's maybe a load tolerance bug in php5 when running str_replace() since I can't see this on our development box nor in 4.3.8. The only difference in the functions between php4 and 5 is the addition of the count option, could that be the issue? Any help or comments would be greatly appreciated. Sounds like a threading issue to me. PHP and Apache 2 don't always get along unless you're using Apache2 in prefork mode. These things usually don't show up except under heavy load (which it seems you have). Check out the link below for more info: https://www.reversefold.com/tikiwiki/tiki-index.php?page=PHPFAQs#id45260 -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [SPAM] Re: [PHP] Old HTML convert to XHTML Class
On Wed, 04 Aug 2004 19:02:41 +0200, Jay [EMAIL PROTECTED] wrote: Jay Blanchard wrote: [snip] Is there any class, functions etc that will convert old HTML to XHTML. I want to send in some HTML text and get XHTML back. e.g: the following would be converted: in=font face=verdana,arial,helvetica,sans-serif color=#cc size=2hello/font out=span stylefont-family:verdana,arial,helvetica,sans-serif; font-size: 10px; color:#cchello/span [/snip] Have you searched phpclasses.org? Google? Yes i have searched but couldn´t find anything. Hard to search for becuase PHP HTML to XHTML brings up a lot of Tech youself XHTML pages. So i hoped someone knew about a commercial or Free class/functions i could use. Since you can't use the tidy PHP extension, you could always use tidy from the command-line. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: POST superglobal is empty
On Wed, 4 Aug 2004 13:20:00 -0400, John W. Holmes [EMAIL PROTECTED] wrote: From: Dan Phiffer [EMAIL PROTECTED] Jason Davidson wrote: How about print_r($_REQUEST); That also fails to reflect posted data. $_GET is working as expected. There's nothing in PHP that would not let POST values get through. Are you sure this isn't a web server issue only allowing GET requests to pages that it serves? Or possibly a proxy or firewall or your browser stopping it? -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTTP POST then Redirect?
On Wed, 04 Aug 2004 16:01:31 -0500, Jeff Oien [EMAIL PROTECTED] wrote: I'm using the code below to post form data to an ASP script. But I need to redirect to a thank you page when it all done or the person filling out the form sees what they're not supposed to see. Any way I can do this? If take out the last line and print a header(URL) it won't post the data. Thanks Jeff - function http_post($host, $path, $data) { $http_response = ''; $content_length = strlen($data); $fp = fsockopen($host, 80); fputs($fp, POST $path HTTP/1.1\r\n); fputs($fp, Host: $host\r\n); fputs($fp, Content-Type: application/x-www-form-urlencoded\r\n); fputs($fp, Content-Length: $content_length\r\n); fputs($fp, Connection: close\r\n\r\n); fputs($fp, $data); while (!feof($fp)) { $http_response .= fgets($fp, 128); } fclose($fp); return $http_response; } $arr = array(); foreach($_POST as $key = $value) { $arr[] = $key.'='.urlencode($value); } $data = implode('',$arr); $http_response = http_post('www.blah.com', '/test.aspx?', $data); print $http_response; replace the print with: header('Location: http://example.com'); -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable Variables adn Superglobals
On Wed, 04 Aug 2004 23:15:03 +0200, ARico [EMAIL PROTECTED] wrote: Using Variable Variables works fine inside functions for global defined variables if you declare them as global inside the function. Suprinsingly, it does not seem to work with superglobals. Take the following example: // code ?php $glob_var=Var 1; $var_glob_var=glob_var; $var_ENV=_ENV; echo $_ENV[OS],\n; echo $glob_var,\n\n; echo $var_glob_var,\n; echo $var_ENV,\n\n; echo $$var_glob_var,\n; echo ${$var_ENV}[OS],\n\n; foo1($var_glob_var); foo2($var_glob_var); foo3(); foo4(); foo5($var_ENV); foo6($var_ENV); foo7(); foo8(); foo9(); function foo1($arg){ echo --- In foo1 --\n; echo $arg,\n; echo $$arg,\n; echo --\n; } function foo2($arg){ global $glob_var; echo --- In foo2 --\n; echo $arg,\n; echo $$arg,\n; echo --\n; } function foo3(){ $arg=glob_var; echo --- In foo3 --\n; echo $arg,\n; echo $$arg,\n; echo --\n; } function foo4(){ global $glob_var; $arg=glob_var; echo --- In foo4 --\n; echo $arg,\n; echo $$arg,\n; echo --\n; } function foo5($arg){ echo --- In foo5 --\n; echo $arg,\n; echo ${$arg}[OS],\n; echo --\n; } function foo6($arg){ global $_ENV; echo --- In foo6 --\n; echo $arg,\n; echo ${$arg}[OS],\n; echo --\n; } function foo7(){ $arg=_ENV; echo --- In foo7 --\n; echo $arg,\n; echo ${$arg}[OS],\n; echo --\n; } function foo8(){ global $_ENV; $arg=_ENV; echo --- In foo8 --\n; echo $arg,\n; echo ${$arg}[OS],\n; echo --\n; } function foo9(){ echo --- In foo9 --\n; echo $_ENV[OS],\n; echo --\n; } ? // Output / Windows_NT Var 1 glob_var _ENV Var 1 Windows_NT --- In foo1 -- glob_var -- --- In foo2 -- glob_var Var 1 -- --- In foo3 -- glob_var -- --- In foo4 -- glob_var Var 1 -- --- In foo5 -- _ENV -- --- In foo6 -- _ENV -- --- In foo7 -- _ENV -- --- In foo8 -- _ENV -- --- In foo9 -- Windows_NT -- // Version // PHP 4.3.7 (cgi-fcgi) (built: Jun 2 2004 15:49:31) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies // End // I'm doing something wrong? Or this is the expected behavior? I know I could use php references, but linking style does confuse me a bit ( how do you change a reference to point to a new variable if it's allready referencing another one ? ) Thank you in advance Looks right to me. I guess PHP doesn't support it. You may want to file a bug or look for more on superglobals in the manual or bug reports. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: POST superglobal is empty
On Wed, 4 Aug 2004 16:47:45 -0500, AJL [EMAIL PROTECTED] wrote: I'm not sure if it is Apache or not. In fact, I wonder that it might be. However, I do not have any clue as to what it could be. We have 1 apache server running. It currently has php4.1.1 built as apache module. Code works fine for this build. In addition, I have php4.3.8 and php5.0.0 built as cgi. This code fails against both php4.3.8 and php5.0.0. Makes me think it has something to do with CGI in apache. Again, I have no clue what this might be. As I mentioned earlier, I've looked through all the bugs on php.net and other newsgroups, mailing lists, FAQ's. All the solutions posted in the past are not in effect on my server. I can find nothing wrong. I have also tried a copy of the 4.1.1 php.ini file for php5.0.0 with no luck. Hints, suggestions, pointers are all welcome. Apparently this is a common problem. Sounds like Apache just isn't passing in POST data. Are you *sure* there's Apache directive for this? P.S. *Why* do you have PHP 4.1.1 as the default? -- Andy On Wed, Aug 04, 2004 at 01:20:00PM -0400, John W. Holmes wrote: From: Dan Phiffer [EMAIL PROTECTED] Jason Davidson wrote: How about print_r($_REQUEST); That also fails to reflect posted data. $_GET is working as expected. There's nothing in PHP that would not let POST values get through. Are you sure this isn't a web server issue only allowing GET requests to pages that it serves? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [SPAM] Re: [PHP] Old HTML convert to XHTML Class
On Wed, 04 Aug 2004 23:55:12 +0200, Jay [EMAIL PROTECTED] wrote: Justin Patrin wrote: On Wed, 04 Aug 2004 19:02:41 +0200, Jay [EMAIL PROTECTED] wrote: Jay Blanchard wrote: [snip] Is there any class, functions etc that will convert old HTML to XHTML. I want to send in some HTML text and get XHTML back. e.g: the following would be converted: in=font face=verdana,arial,helvetica,sans-serif color=#cc size=2hello/font out=span stylefont-family:verdana,arial,helvetica,sans-serif; font-size: 10px; color:#cchello/span [/snip] Have you searched phpclasses.org? Google? Yes i have searched but couldn´t find anything. Hard to search for becuase PHP HTML to XHTML brings up a lot of Tech youself XHTML pages. So i hoped someone knew about a commercial or Free class/functions i could use. Since you can't use the tidy PHP extension, you could always use tidy from the command-line. Don´t i need good access to my webhost then? I thought Tidy was a error reporting tool, not a HTML to XHTML converter? I have a simple web accountwith PHP and MySQL support. Thanx In Advance If you can upload files and run system commands, you should be able to use it. Tidy actually tidies up your HTML. ;-) -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php