Re: [PHP] To ? or not to ?

2012-04-03 Thread Mari Masuda
On Apr 3, 2012, at 2:29 PM, Tedd Sperling wrote: Hi gang: Let me start a religious war -- should one end their scripts with ? or not? After years of never having a problem with ending any of my scripts with ?, I found that several students in my class had scripts that did not produce

Re: [PHP] iphone php

2012-03-05 Thread Mari Masuda
On Mar 5, 2012, at 9:52 AM, Jim Giner wrote: Jay Blanchard jay.blanch...@sigmaphinothing.org wrote in message news:4f54faf8.4030...@sigmaphinothing.org... [snip]In the last few mins I re-booted my phone and it is now doing something even worse! [/snip] Have you also cleared the cache

Re: [PHP] Headers on smart phone browsers

2012-02-05 Thread Mari Masuda
On Feb 5, 2012, at 9:58 PM, Paul M Foster wrote: [snip] 3) Bonus question: Is there a preferred method amongst coders to determine what type of environment is being browsed from, so as to serve up the proper type of page (desktop or smart phone version of a webpage)? [snip] You should

[PHP] call_user_func_array and bind_result

2011-12-16 Thread Mari Masuda
Hello, I am having trouble figuring out how to properly bind the results of a mysqli prepared statement using call_user_func_array. I have an AbstractModel abstract class and within the class is a method called load that takes the primary key of the desired item and retrieves and loads the

Re: [PHP] call_user_func_array and bind_result

2011-12-16 Thread Mari Masuda
On Dec 16, 2011, at 4:51 PM, David Harkness wrote: Each *value* in the array must be a reference to an existing variable--they cannot be null or direct values. [snip] Thank you very much for your explanation and example code. I was missing the fact that the *values* in the array must be

[PHP] Re: [SOLVED] [PHP] how to dynamically generate list of arguments to pass to array_diff

2011-02-18 Thread Mari Masuda
On Feb 18, 2011, at 12:03 PM, Simon J Welsh wrote: On 19/02/2011, at 8:07 AM, Mari Masuda wrote: My question is is there a way to call the built-in array_diff with a dynamically generated list of arguments? I was thinking maybe there would be a way to do this with variable variables

Re: [PHP] Stripping carriage returns

2011-01-11 Thread Mari Masuda
On Jan 11, 2011, at 11:34 AM, Richard S. Crawford wrote: Strangely, when I use \n, or nl2br(), or PHP_EOL, or anything like that, it strips out not just line breaks, but most of the rest of the text as well. I suspect an encoding issue at this point. Daniel, you were right when you said

[PHP] mysqli fetch-fields returns blob for text

2011-01-04 Thread Mari Masuda
Hello, On http://www.php.net/manual/en/mysqli.constants.php there are some predefined constants for MYSQLI_TYPE_TINY_BLOB, MYSQLI_TYPE_MEDIUM_BLOB, MYSQLI_TYPE_LONG_BLOB, and MYSQLI_TYPE_BLOB. Through some experimentation I have found that fields in my MySQL database that are declared as

Re: [PHP] Character encoding hell

2010-10-26 Thread Mari Masuda
On Oct 26, 2010, at 10:10 AM, Marc Guay wrote: A windows server, or windows client to the same Linux server? I believe that this issue is starting to get a bit over my head, with the different operating systems involved and such. Windows server. This is over my head, too. I'm guessing

Re: [PHP] mysqldump

2010-08-17 Thread Mari Masuda
On Aug 17, 2010, at 11:40 AM, tedd wrote: At 2:17 PM -0400 8/17/10, Robert Cummings wrote: On 10-08-17 02:08 PM, tedd wrote: Hi gang: At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote: Easiest method, from the command line on the server from which you want to dump the database:

Re: [PHP] Quick session question

2010-06-24 Thread Mari Masuda
On Jun 24, 2010, at 9:09 AM, Danny wrote: Thanks Ashley and Jim, When you say 'sessions did not work' what do you mean? Sessions aren't being created? You can't access session variables? You need to be a bit more specific about the issue. Sorry, here is an explanation: The project

Re: [PHP] What's wrong with this code?

2010-06-05 Thread Mari Masuda
Could it be that you are not using the same variable name? In the if statement you are using $row['EndDate'] and when attempting to print you are using $row['enddate']. I think you need to be consistent about which capitalization you use (and make sure it matches what is in the db). if

Re: [PHP] Replacing a special character

2010-04-18 Thread Mari Masuda
Maybe you could try to assign the return value of preg_replace to a variable so you can use it later, like: $name = preg_replace('/#8722;/','-',$name); On Apr 18, 2010, at 11:38 AM, Michael Stroh wrote: Thanks for the advice. I've changed the code to use mysql_real_escape_string. So now

Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Mari Masuda
Also, in PHP you should NOT put the last semi-colon at the end of your SQL statement. http://www.php.net/manual/en/function.mysql-query.php On Feb 11, 2010, at 1:26 PM, Joseph Thayne wrote: Try putting tick marks (`) around the field and table names. So your SQL query would then look like:

[PHP] how do I use php://memory?

2010-01-29 Thread Mari Masuda
Hello, I have a function that uses tidy to attempt to clean up a bunch of crappy HTML that I inherited. In order to use tidy, I write the crappy HTML to a temporary file on disk, run tidy, and extract and return the clean(er) HTML. The program itself works fine but with all of the disk

Re: [PHP] how do I use php://memory?

2010-01-29 Thread Mari Masuda
On Jan 29, 2010, at 4:38 PM, Nathan Nobbe wrote: On Fri, Jan 29, 2010 at 5:35 PM, Mari Masuda mari.mas...@stanford.edu wrote: Hello, I have a function that uses tidy to attempt to clean up a bunch of crappy HTML that I inherited. In order to use tidy, I write the crappy HTML

Re: [PHP] how do I use php://memory?

2010-01-29 Thread Mari Masuda
On Jan 29, 2010, at 10:57 PM, Mari Masuda wrote: On Jan 29, 2010, at 4:38 PM, Nathan Nobbe wrote: On Fri, Jan 29, 2010 at 5:35 PM, Mari Masuda mari.mas...@stanford.edu wrote: Hello, I have a function that uses tidy to attempt to clean up a bunch of crappy HTML that I inherited

[PHP] cannot access SimpleXML object property

2010-01-07 Thread Mari Masuda
Hi, I am working with an XML document and have a SimpleXML object whose var_dump looks like this: --- object(SimpleXMLElement)#2 (10) { [@attributes]= array(1) { [id]= string(7) 3854857 } [type]= string(7) Article [createDate]= string(25) 2006-09-06T16:42:20-07:00

Re: [PHP] cannot access SimpleXML object property

2010-01-07 Thread Mari Masuda
On Jan 7, 2010, at 2:31 PM, Jonathan Tapicer wrote: On Thu, Jan 7, 2010 at 6:56 PM, Mari Masuda mari.mas...@stanford.edu wrote: Hi, I am working with an XML document and have a SimpleXML object whose var_dump looks like this: --- object(SimpleXMLElement)#2 (10) { [@attributes

Re: [PHP] Regexp and Arrays

2010-01-02 Thread Mari Masuda
On a quick glance I don't think you are doing the casting correctly. For example, you have stuff like: (string) $string; and (string) $key; (int) $val; and (int) $length_value = $match[1]; and the casted value is not being saved anywhere. I believe it should be something like $string =

Re: [PHP] Arrays Regexp - Help Requested

2010-01-01 Thread Mari Masuda
I think the problem is here: echo 'input type=' . $input_type . ' '; [...snip...] elseif ($input_type == 'textarea') { echo 'rows=7 cols=30 '; echo 'value='; if ($field['null'] == 'YES') // CAN BE NULL? { echo 'NULL'; } echo ' '; } because to

Re: [PHP] Emergency! Performance downloading big files

2009-12-01 Thread Mari Masuda
On Dec 1, 2009, at 2:48 PM, Brian Dunning wrote: This is a holiday-crunch emergency. [snip] Is there a SUBSTANTIALLY faster way to download and save these files? Keep in mind the client's requirements cannot be changed. Thanks for any suggestions. Could you just put the URLs of the files

Re: [PHP] Change styling depending on var value

2009-11-20 Thread Mari Masuda
On Nov 20, 2009, at 2:29 PM, Ashley Sheridan wrote: On Fri, 2009-11-20 at 17:23 -0500, Phil Matt wrote: Ashley Sheridan wrote: put var_dump($row); I inserted this line in the script at the end of the html table, still inside the PHP echo statement. This yields: bool(false)

Re: [PHP] [php] INSERT and immediately UPDATE

2009-10-28 Thread Mari Masuda
Maybe you could use http://us.php.net/manual/en/function.mysql-insert-id.php to get the inserted id. On Oct 28, 2009, at 12:21 PM, Allen McCabe wrote: Hey everyone, I have an issue. I need my (employee) users to be able to insert shows into the our MySQL database and simultaneously upload

[PHP] [SOLVED] Re: [PHP] cannot compile PHP 5.2.11 on Mac OS X 10.6.1

2009-10-25 Thread Mari Masuda
of the instructions on http://www.php.net/manual/en/install.unix.apache2.php to get your PHP 5.2.11 up and running. Mari On Oct 24, 2009, at 15:33, Mari Masuda wrote: Hi, I am setting up my Mac Book Pro running Mac OS X 10.6.1 as a development environment for Drupal. I already successfully have

[PHP] cannot compile PHP 5.2.11 on Mac OS X 10.6.1

2009-10-24 Thread Mari Masuda
Hi, I am setting up my Mac Book Pro running Mac OS X 10.6.1 as a development environment for Drupal. I already successfully have MySQL 5.1.40 and Apache 2.2.11 up and running. I tried to compile PHP 5.2.11 in the following manner and keep getting an error. Any help would be great!

[PHP] XML parsing with PHP

2009-10-22 Thread Mari Masuda
Hi, I need to transform some XML files and have not really done much XSLT. I am looking for recommendations on ways to parse XML via PHP. The XML files I have contain the content from our website CMS. We are switching from a proprietary CMS to Drupal and I need to transform the XML

Re: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-02 Thread Mari Masuda
On Oct 2, 2009, at 15:22, Daevid Vincent wrote: -Original Message- From: Ben Dunlap [mailto:bdun...@agentintellect.com] Sent: Friday, October 02, 2009 2:58 PM To: php-general@lists.php.net; Daevid Vincent Subject: Re: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

Re: [PHP] reason for a Notice:.. on one site but not another? (Same code.)

2009-08-09 Thread Mari Masuda
On Aug 9, 2009, at 16:43, John Butler wrote: Hi sunday coders, I've been using this kind of logic on one PHP site I work on to display one thing or another depending on whether the form was submitted or not: if($_POST['UserWishesDateRange']) { //--line 79

Re: [PHP] Single Quotes in Form Inputs

2009-07-27 Thread Mari Masuda
You need to sanitize and escape the input before inserting it into the db. You can use http://us.php.net/mysql_real_escape_string to escape the input. On Jul 27, 2009, at 09:35, Ben Miller wrote: Hi, I have a form in which my sales reps can add new clients into the database, but I'm

Re: [PHP] Re: PHP as Language

2009-07-24 Thread Mari Masuda
On Jul 24, 2009, at 11:30, Shawn McKenzie wrote: Martin Scotta wrote: Hi all Is there a formal definition for the php language? Where I can found it? I've STW with no results. What is a definition? Do you mean specification like ECMA or ANSI? I think he meant Backus Naur, but I could

Re: [PHP] cannot figure out permissions for fopen/fwrite

2009-07-02 Thread Mari Masuda
if the script was running on a production server, but I wasn't sure if that was a good or bad idea. On Jul 2, 2009, at 17:59, Waynn Lue wrote: The tmp folder isn't accessible from the web though, right? Someone would first have to get access to your server for that. On 7/1/09, Mari Masuda mbmas

Re: [PHP] Re: cannot figure out permissions for fopen/fwrite

2009-07-01 Thread Mari Masuda
On Jul 1, 2009, at 12:20, Shawn McKenzie wrote: Shawn McKenzie wrote: Mari Masuda wrote: Hello, This is probably a dumb newbie question. I am running PHP 5.2.5 and Apache 2.2.8 on my Mac Book Pro OS X 10.4.11. I compiled PHP and Apache from source a while ago (as opposed to using

Re: [PHP] Re: cannot figure out permissions for fopen/fwrite

2009-07-01 Thread Mari Masuda
On Jul 1, 2009, at 12:54, Shawn McKenzie wrote: Mari Masuda wrote: On Jul 1, 2009, at 12:20, Shawn McKenzie wrote: Shawn McKenzie wrote: Mari Masuda wrote: Hello, This is probably a dumb newbie question. I am running PHP 5.2.5 and Apache 2.2.8 on my Mac Book Pro OS X 10.4.11. I