Re: [PHP] question about php with sql database

2008-03-19 Thread Chris
Sudhakar wrote: instead of using mysql database which is conventionally used as database with php, if sql server database is used with php are there any major differences to keep in mind. In syntax or what? Yes there are differences between the two as far as sql syntax goes. 1. are the

Re: [PHP] Re: MySQL Group?

2008-03-19 Thread Chris
George J wrote: Hi John, John Taylor-Johnston [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Does anyone know of a good MySQL group? I want to make a relational link from `data` to `shopping` so when I insert a new record in `shopping`, I will see the contents of `data`.`name`

Re: [PHP] Re: MySQL Group?

2008-03-19 Thread Chris
John Taylor-Johnston wrote: Thanks for getting me started. (Sorry, I'm a top quoter.) Below is some working code for the archives. What I've learned so far is that : 1) what I'm referring to in `person` has to be a key. It should be a unique item rather than just a 'key' (indexed item). If

Re: [PHP] php_mssql.so

2008-03-27 Thread Chris
Liz Kim wrote: We have a set of PHP files which uses dl() to load the extension php_mssql.so at runtime. These were running on a server with PHP 4.3.9 and have been recently moved to a new server with PHP 5.1.6 (both RedHat). I have tried to simply copy the file php_mssql.so file to the

Re: [PHP] php_mssql.so

2008-03-27 Thread Chris
Liz Kim wrote: Maybe I could just compile it on a test machine and copy the .so file over to the working server. Would there be any incompatibility issues there? If and only if: - They are the same architecture (they both have to be i386 for example, one can't be an amd-64 and the other be

Re: [PHP] LDAP in php

2008-03-30 Thread Chris
[EMAIL PROTECTED] wrote: As LDAP can have SQL back-end (I saw an example with PostgreSQL) - is it a very wild idea to implement (a simple) LDAP server in php? We have all the address data already in PostgreSQL and a php application managing all of it. I am thinking of simple uses, such as

Re: [PHP] Re: Quick email address check

2008-03-30 Thread Chris
I have used this to good effect function isEmail($email) { if (eregi(^[a-z0-9]+([-_\.]?[a-z0-9])[EMAIL PROTECTED]([-_\.]?[a-z0-9])+\.[a-z]{2,4},$email)) { return TRUE; } else { return FALSE; } }//end function I often have a '+' in my email address

Re: [PHP] how to possibly cache something and the theory of better performance / better speed

2008-04-01 Thread Chris
I used to use a script to grab a random image from a folder of images by scanning the folder, returning the list of images, getting one of them randomly and displaying it. Isn't that what the code is doing? Maybe I'm missing something but you've only mentioned one method. What's the second

Re: [PHP] php + copy file

2008-04-02 Thread Chris
$carpeta = subidos; // nombre de la carpeta ya creada. chmool 777 (todos los permisos) copy($_FILES['file']['tmp_name'] , $carpeta . '/' . $_FILE ['file']['name']); copied straight from my reply to the same question on php-db It's $_FILES not $_FILE (an 's' on the

Re: [PHP] require_once dying silently

2008-04-08 Thread Chris
Richard S. Crawford wrote: Hi, everyone. This one's been driving me bonkers for an hour now. Anyone have any idea why require_once would be dying silently in the script below? $CFG-dirroot = /home/rcrawford/public_html/tanktrunk/tanktrunk; $CFG-dataroot

Re: [PHP] Writing MySQL Update Query with NULL value

2008-04-13 Thread Chris
Bill Guion wrote: I'm trying to write a MySQL UPDATE query where one or more variables may be NULL. So, I'm trying something like: $last_name = $_POST['last_name']; $first_name = $_POST['first_name']; $suffix = $_POST['suffix']; $suffix = empty($suffix) ? NULL : $suffix; $phone =

Re: [PHP] PHP with NNTP?

2008-04-16 Thread Chris
vester_s wrote: Hi, Can anybody tell me how can php connect to NNTP to get the list of all users in the newsgroups? http://php.net/imap supports nntp. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Database abstraction?

2008-04-16 Thread Chris
Jason Pruim wrote: Hi Everyone! I'm back with yet another question But getting closer to sounding like I know what I'm talking about and that's all thanks to all of you. A free beer (Or beverage of choice)* for everyone who has helped me over the years! Here's my question... I have a

Re: [PHP] Query in Query problems

2008-04-16 Thread Chris
VamVan wrote: Hello All, We many times encounter the situations of having Queries inside loop of another query. Many times we can solve the issue by query joins but there will be some situations where we cannot do it. For Example: function Change($id){ $qry_reg = SELECT

Re: [PHP] Database abstraction?

2008-04-17 Thread Chris
Jason Pruim wrote: On Apr 16, 2008, at 5:37 PM, Chris wrote: Jason Pruim wrote: Hi Everyone! I'm back with yet another question But getting closer to sounding like I know what I'm talking about and that's all thanks to all of you. A free beer (Or beverage of choice)* for everyone who

Re: [PHP] mysql_connect slowness

2008-04-27 Thread Chris
Waynn Lue wrote: Our site has been slowing down dramatically in the last few days, so I've been trying to figure out why. I ran some profiling scripts on our site and saw that we're spending between 3-9 seconds on mysql_connect. Then I connected to our db and saw that there were over 100

Re: [PHP] Xampp question, pretty much 0T

2008-04-29 Thread Chris
Ryan S wrote: Hello! I have been using XAMPP for quite some time now (thanks to the recommendations from this list) without any real complaints... and the only reason I am writing here is because i am sure a lot of you guys run the same thing considering the amount of people who recommended

Re: [PHP] Xampp question, pretty much 0T

2008-04-29 Thread Chris
After reading a bit I see that if I just copy the data directory in the mySql directory, I can restore it from there? any idea if I have that wrong? Hmm I guess, but I'd take the safer road and open a console and run: mysqldump.exe -u username -p --all-databases --add-drop-database --opt

Re: [PHP] Best practices for using MySQL index

2008-04-30 Thread Chris
Index on most integer fields only. Text fields can be indexed, but is not important when you design your DB well. Don't index just all integer fields. Keep track of the cardinality of a column. If you expect a field to have 100.000 records, but with only 500 distinct values it has no use to

Re: [PHP] problem imap_headerinfo

2008-04-30 Thread Chris
Richard Kurth wrote: I get a *Catchable fatal error*: Object of class stdClass could not be converted to string on this line $mail_head = imap_headerinfo($conn, $i); RTM. http://www.php.net/imap_headerinfo It's an object, not a string. print_r($mail_head); -- PHP General Mailing List

Re: [PHP] Best practices for using MySQL index

2008-05-01 Thread Chris
Point above about spread still applies, but if you can join index to index, the join goes a lot faster. (A primary key in MySQL is always indexed.) How much is the *a lot*? Thanks. :) If it's a unique (including primary) key then orders of magnitude for millions of rows. If it's a

Re: [PHP] equivalent to perl shift function

2008-05-01 Thread Chris
Richard Luckhurst wrote: Hi All I am in the process of porting a perl script and I am trying to fin out if there is a php equivalent to the perl shift function? I have been looking at the php manual and google searching so far with no luck.

Re: [PHP] Categories like wordpress

2008-05-01 Thread Chris
Ryan S wrote: Hey, Am not really used to using the JOIN in SQL so am a bit confused as to what kind of data I need to enter into this table: image_category_mapping table: - image_id - category_id It comes down to database normalization

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-02 Thread Chris
Jim Lucas wrote: Waynn Lue wrote: Wouldn't using LOAD DATA INFILE be better than writing your own script? depends, does the data file match the table column for column? Doesn't have to. http://dev.mysql.com/doc/refman/5.0/en/load-data.html By default, when no column list is provided at

Re: [PHP] PHP Web Apps OpenID

2008-05-06 Thread Chris
Joe Harman wrote: Hey Ya'll! I am curious here if any of you are considering or already using OpenID or Windows CardSpace? Does anyone see this being a big deal??? from a users stand point it seems like a big hassle to get started with it and I'm not sure if it would scare people away or

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-08 Thread Chris
Sanjeev N wrote: Hi Jim Lucas, You are correct... i want to run in the same way. but as my 2 tables, column name are different i cant run the LOAD DATA infile. If you're inserting the same data, then use LOAD DATA INFILE to load it into a temporary table, then use INSERT SELECT's to put

Re: [PHP] mysql_pconnect issue

2008-05-11 Thread Chris
bruce wrote: hi... running into a problem that i can't seem to solve... using mysql_pconnect() and i'm trying to figure out what parameters have to be used in order to connect to a local mysql session, where mysql is accessed using the defaults (ie, no user/passwd/hostIP) Use 'localhost'

Re: [PHP] creating an xls file from mysql data

2008-05-12 Thread Chris
Richard Kurth wrote: This script will create an xls file from the data that is sent to it When I run this it only gets one recored and it is supposet to get all the records that are past by the $_POST[selectedcontactlist] I think I have a } in the wrong place but I can not figure it out

Re: [PHP] creating an xls file from mysql data

2008-05-12 Thread Chris
Or you can do it straight from MySQL, which is a lot faster: With the caveat that you need extra mysql permissions to be able to do that. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] creating an xls file from mysql data

2008-05-13 Thread Chris
This is what the $_POST['selectedcontactlist'] looks like 121,17,97,123,243,52,138,114,172,170,64,49,60,256,176,244,201,42,95,4, First question is why do you need to pass it through like that? it is not coming across as an array so the foreach is throwing an error I assume it always has a

Re: [PHP] tracking Mials Which were bounced.

2008-05-13 Thread Chris
mike wrote: Seems like the general way is to create a mailbox (POP3 or IMAP) to accept the bounces, then check it periodically and mark the emails as invalid in your local database. I would set threshholds so you don't mark something failed that only bounced once - it could have been a mail

Re: [PHP] Can Safari 3 be forced to cache a large jpeg with PHP headers?

2008-05-13 Thread Chris
Rob Gould wrote: I am creating a touch-screen kiosk application, using a full-screen version of Safari 3.1, and was wondering if there's a way I can force Safari to cache a large background image JPEG. What I'm finding is that Safari 3 will sometimes cache my large 1.1 MB background

Re: [PHP] question about validation and sql injection

2008-05-15 Thread Chris
Dmitri wrote: your validation looks good enough to me. If you only allow alphanumerical chars, then your should not be worried about sql injection also use addslashes($username) before you insert into database and you should be fine. Usually addslashes is enough to prevent this, but the

Re: [PHP] $_SESSION lost

2008-05-15 Thread Chris
$ php -v PHP 5.2.4 (cli) (built: Sep 18 2007 08:50:58) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies This shows the php command line version, not the webserver php version. To do that, look at a phpinfo() page. They may indeed be the same

Re: [PHP] problem with htmlspecialchars in version5.2.5

2008-05-18 Thread Chris
It flance wrote: Hi, this statement: echo nl2br(htmlspecialchars($row['jobdescription'], ENT_QUOTES, 'UTF-8')); works for php4.3.10 but not for php5.2.5 What doesn't work exactly? What's the output in php4 compared to php5? -- Postgresql php tutorials http://www.designmagick.com/ --

Re: [PHP] Trying to install imagick PECL module

2008-05-19 Thread Chris
mike wrote: It doesn't appear to -need- this MagickWand stuff, yet configure keeps failing on it. I guess it really does need the api stuff then ;) Which parts of imagemagick have you got installed or how did you install imagemagick? for configuring php (and other software) you need the

Re: [PHP] reretrieve header from email

2008-05-20 Thread Chris
Richard Heyes wrote: Yui Hiroaki wrote: Does anyone knows how to retrieve Header from email? Depends how you have your email. For example you could use Mail_mimeDecode, optionally in combination with Net_POP3. If it's an IMAP account you're checking, you could use the IMAP extension

Re: [PHP] syntax of sprintf

2008-05-20 Thread Chris
the select query is $selectqueryusername = sprintf(Select username from individuals where username='%s', mysql_real_escape_string($username)); The syntax is fine. $result = mysql_query($selectqueryusername); if (!$result) { echo Error! *** . mysql_error(); } also for insert query if

Re: [PHP] strip_tags and nl2br

2008-05-21 Thread Chris
James Colannino wrote: Hey everyone, I have a little bit of a quandry. I need to strip HTML tags from user input, but I also need to convert \n's from the textarea elements to br tags so it will display properly in a browser. RTM. Supply the tags you want to keep when you call strip_tags.

Re: [PHP] strip_tags and nl2br

2008-05-21 Thread Chris
James Colannino wrote: Chris wrote: RTM. Supply the tags you want to keep when you call strip_tags. $stripped = strip_tags($data, 'br/br'); I can do that, but my question had to do with strip_tags seeming to get rid of \n's, not br tags. This is why I was concerned. If I run

Re: [PHP] PHP + MySQL transactions

2008-05-22 Thread Chris
Philip Thompson wrote: Hi all. I'm currently working on a project that's in its beta stage. Due to time restraints, we were unable to build in transactions from the beginning. Well, we're getting to the point where we can now put in transactions. Basically, I'm curious to find out your

Re: [PHP] PHP + MySQL transactions

2008-05-25 Thread Chris
See http://dev.mysql.com/doc/refman/5.0/en/savepoints.html The situation might not come up but it can't hurt to have it already built in just in case. This doesn't appear deal with *nested transactions.* It appears that it will use a single transaction and you can just save up to a

Re: [PHP] Still need help with some kind of memory leak in my php database program. General hints for php would help

2008-05-25 Thread Chris
// IF I RUN THIS THROUGH A LOOP: // for($j=0;$j20, $j++){ $many_selected[$jj] = fu_bar($pg, $BIG_SELECT_cmd)} THE TEST PROGRAM CRASHES so I think I have more copies of the result of this query than I need. This is just going to create a multi-dimensional array - with each element being one

Re: [PHP] Still need help with some kind of memory leak in my php database program. General hints for php would help

2008-05-25 Thread Chris
Mary Anderson wrote: Thanks for responding. I hadn't realized memory_get_usage was available. That will be an enormous help. And I wasn't too clear in my note. Actually, it did not surprise me that the loop crashed the test code. I expected it to. What does surprise me is that the

Re: [PHP] Weird update problem..

2008-05-25 Thread Chris
Ryan S wrote: This is really weird... i have tried the same exact code in phpmyadmin and it works like a charm, but when i run the script... no errors then i go to phpmyadmin and nothing has changed :( this is the code:

Re: [PHP] Image modifications

2008-05-25 Thread Chris
Ronald Wiplinger wrote: I would like to find some samples to start with. We want to upload a picture and the user may apply some filters or instructions to create a new picture, based on the uploaded picture and the available filters and instructions. The idea of it is not really mature,

Re: [PHP] PEAR_Exception PEAR_Error

2008-05-28 Thread Chris
Al wrote: I'm using the pear class Mail_RFC822::parseAddressList() which apparently only throws an error_object for PEAR_Error. The manual says that PEAR_Error is deprecated, so I'd like to use PEAR_Exception; but; am having trouble getting it to recognize the error. Probably better to ask

Re: [PHP] Query refuses to recurse all rows

2008-05-28 Thread Chris
$numrows1 = pg_numrows($result1); $row = 0; do { $myrow = pg_fetch_array($result1, $row); snip $numrows2 = pg_numrows($result2);

Re: [PHP] A problem with fgets()

2008-05-29 Thread Chris
Usamah M. Ali wrote: Hello, I have a function that picks up a random entry from a file consisting of city names, each name on a separate line. The random value is generated by rand() before fseek()ing to the position determined by it. The problem is that when using fgets() to get a random

Re: [PHP] A problem with fgets()

2008-05-29 Thread Chris
I just need to figure out why when using fgets() with fseek() rand(), the script returns partial strings form the city names. Because fseek doesn't necessarily put you at the start of a line. It puts you anywhere (which could be the start, middle, 3 chars from the end) according to the

Re: [PHP] PHP Extensions as Shared Objects?

2008-05-29 Thread Chris
Weston C wrote: This might be a dumb question with an obvious answer somewhere, but I'm wondering if it's possible to build php extensions as shared objects that plug into the PHP binary much like an apache shared module plugs into apache. Yes. See http://www.php.net/dl (though a lot of

Re: [PHP] A bit 0T - WAMPSERVER

2008-05-29 Thread Chris
Ryan S wrote: Hello all! Had some big problems with XAMPP crashing my windows (Vista) laptop 8 times out or 10 (actual figures) as I started XAMPP so have shifted over to WAMPSERVER2 So far so good, no crash... but their website seems to be down and need one small tidbit... if anyone of

Re: [PHP] Embed images in emails

2008-05-30 Thread Chris
Iñigo Medina García wrote: Hi Bastien, thanks for the tip. I've already done it and it didn't run. But I'll check it again. iñigo On Thu, May 29, 2008 at 6:11 AM, Iñigo Medina García [EMAIL PROTECTED] wrote: Hi, I'm trying to send emails with embed and dynamic images: a normal

Re: [PHP] Embed images in emails

2008-05-30 Thread Chris
Iñigo Medina García wrote: Hi Chris, yep, phpmailer is a good work too. But it works the same i said about htmlMimeMail5. So use either package to figure out what it does and how it does it - you can learn a lot from other peoples code. -- Postgresql php tutorials http

Re: [PHP] Imagick installation issue

2008-06-09 Thread Chris
This is the output for ldd -r for imagick.so. There are a number of dependencies that I don't recognize and I think there may be other packages that need to be installed. undefined symbol: zend_ce_iterator (/usr/local/lib/php/extensions/no-debug-non-zts-20060613//imagick.so)

Re: [PHP] PHP Runs But Does Not Display on Linux

2008-06-11 Thread Chris
Wei, Alice J. wrote: Hi, I am currently using a Linux box with Fedora to run my PHP scripts, which I have seen in the download page at http://www.php.net/downloads.php that We do not distribute UNIX/Linux binaries. Most Linux distributions come with PHP these days. What I am

Re: [PHP] unlink oddity

2008-06-12 Thread Chris
function saveRecord ($db,$POST) { $bd = /absolute_path_to_document_root; $fp = /path_to_files_from_document_root/; $ud = $bd . $fp; snip $path = $ud.$file; // absolute path to newly named file if ($fail || !$name || !$temp) continue; //

Re: [PHP] a questoin about the # char

2008-06-12 Thread Chris
Sebastian Camino wrote: Hello, I want to know what the # char does. In a url it's an anchor tag (http://www.w3schools.com/HTML/html_links.asp). In php it's used to mark a comment. ?php # this is a comment and not executed. ? It means nothing specific in a filename. -- Postgresql php

Re: [PHP] Does PHP support utf16 encode / decode

2008-06-16 Thread Chris
hce wrote: Hi, I know PHP supports utf8 encode/decode, but does it support utf16 encode/decode? If yes, would you please point me a php manual URL? It's listed as supported under the mbstring functions here: http://www.php.net/manual/en/mbstring.supported-encodings.php -- Postgresql php

Re: [PHP] mysqliconnect issue

2008-06-16 Thread Chris
Jason Pruim wrote: Okay, So I'm going to just assume that my issue is the fact that I'm tired... and my mind won't work properly. [Mon Jun 16 22:27:58 2008] [error] PHP Warning: mysqli_connect() expects parameter 5 to be long, string given Now parameter 5 is the database name, I echoed

Re: [PHP] Case sensitive password

2008-06-18 Thread Chris
R.C. wrote: I have coded a php page that accepts a password. What is the code to make sure the password entered is NOT case-sensitive? Before you store the password, make it all lowercase (or uppercase, whatever you prefer). $password = strtolower($password); When you compare the passwords,

Re: [PHP] Case sensitive password

2008-06-18 Thread Chris
R.C. wrote: Thank you for your reply. The password is not stored, actually, like in a databse. We're only dealing with one password. When the user inputs the password, he/she should be able to input either in lower or upper case or both abd they should have access to the protected file in

Re: [PHP] losing mysql connection during cron job

2008-06-18 Thread Chris
Thanks for the suggestion. I am currently successfully working around this error by another method, although your suggestion is probably better. The reason I posted this problem, though, is that I want to understand *why* I'm getting the Lost connection to MySQL server during query error.

Re: [PHP] Associative Arrays

2008-06-19 Thread Chris
Paul Novitski wrote: At 6/19/2008 05:55 PM, VamVan wrote: How to create an associative array of this kind in PHP? return array( 12345 = array( 'mail' = '[EMAIL PROTECTED]', 'companyName' = 'Asdf Inc.', ), 54321 = array( 'mail' = '[EMAIL PROTECTED]',

Re: [PHP] 5.3 Timeline and Features(true anon functions? shorter array syntax?)

2008-06-22 Thread Chris
Weston C wrote: Just curious if anyone knows the rough timeline for PHP 5.3. Also curious if anyone knows whether anon functions/closures or a shorter JSON-ish array syntax are being considered for inclusion. I know there were two patches announced in December/January: Ask the -internals

Re: [PHP] Memory profiling tools

2008-06-23 Thread Chris
Larry Garfield wrote: Hi all. I have a rather large application on which I need to do some memory performance profiling and optimization. Basically it's eating up more RAM than it should and I'm not sure why. I have some suspects, but nothing concrete. Are there any (open source)

Re: [PHP] prepared statement

2008-06-25 Thread Chris
ctx2002 wrote: Hi all: We are use PHP PDO's Prepared statement to send SQL query to Mysql server. According to PHP PDO doc, Prepared statement are fast for executing multiple SQL queries with same parameters. by using prepared statement you avoid repeating the analyze/compile/optimize cycle

Re: [PHP] prepared statement

2008-06-25 Thread Chris
ctx2002 wrote: I mean for each different requests/connection how can i use same prepared statements object that was generated by PDO lib/mysql Server. You can't. Resources/connections are done per request and can't be shared - it's done that way by design. -- Postgresql php tutorials

Re: [PHP] prepared statement

2008-06-26 Thread Chris
ctx2002 wrote: thanks for answering my question. I have checked PHP PDO doc. PDO:: query() can send a query to server. my question is, does PDO:: query() generates prepared statement automatically? or I have to explicitly call PDO:: prepare() to use prepared statement? You have to use

Re: [PHP] can you give me example of website using postgresql database?

2008-06-30 Thread Chris
I'm not sure what you're looking for in a RDMS, but the simple fact that you are having a hard time finding a robust, live site that uses PostgreSQL should scare you more than Sun's purchase of MySQL. Just because you don't know any doesn't mean there aren't any. Someone else pointed out

Re: FW: [PHP] REALLY NEWB QUESTION - include issue

2008-07-01 Thread Chris
-Original Message- From: Thijs Lensselink [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 01, 2008 1:58 AM To: php-general@lists.php.net Subject: RE: [PHP] REALLY NEWB QUESTION - include issue Quoting TS [EMAIL PROTECTED]: Code segment? Exact error message? (Is there more

Re: [PHP] Re: V4 Vs V5 Issue

2008-07-01 Thread Chris
Neil wrote: Hi Unfortunately this editor does not run in any other browsers. however I do not believe that it is the java script that is the problem because it runs and works and has done so for years on the current and earlier V4 servers.

Re: [PHP] CURL de-bugging: So why am I not getting the results page on the target site?

2008-07-01 Thread Chris
ioannes wrote: I didn't get any brave response on this, but given the other thread on 'encription' I was wondering could anyone decrypt the __VIEWSTATE string at the end of this message. It is part of the input page whose results page I am trying to retrieve back onto my server for further

Re: [PHP] CURL de-bugging: So why am I not getting the results page on the target site?

2008-07-01 Thread Chris
Chris wrote: ioannes wrote: I didn't get any brave response on this, but given the other thread on 'encription' I was wondering could anyone decrypt the __VIEWSTATE string at the end of this message. It is part of the input page whose results page I am trying to retrieve back onto my server

Re: [PHP] Log files

2008-07-02 Thread Chris
Mark Bomgardner wrote: I am writing an application in which I want to create log files. I am weighing the difference between using text files and using a database to house the data. It appears to me that there is really no advantage either way or is there? There are pros and cons to both

Re: [PHP] Re: Session variables disappear (some of them only)

2008-07-07 Thread Chris
Then the errors sometimes occur in my apache2/ssl_error_log (undefined index in $_SESSION variable). When I check the sess_12345789... file, some of the variables are missing : $_SESSION[a] and [b] are there, but not $_SESSION[c], even an empty one, it is just gone. That's all I know. Sounds

Re: [PHP] PHP's mail(): proper way to send a 'From' header

2008-07-07 Thread Chris
?php $to = [EMAIL PROTECTED]; $from = [EMAIL PROTECTED]; $subject = This is a test!; $body = \tThis is a test email.\n; $body .= That is all.; $headers = From: .$from.\r\n; $headers .= Reply-To: .$from.\r\n; $headers .= X-Mailer: .basename(__FILE__).-PHP/.phpversion().\r\n;

Re: [PHP] Question before I end up writing alot of extra code...

2008-07-07 Thread Chris
Here is a VERY simplified test :) MAIN PAGE: ?PHP if($row['Tab'] == done){ $Tchecked1 = CHECKED; $Tchecked2 = NULL; }else{ $Tchecked1 = NULL; $Tchecked2 = CHECKED; } echo fieldsetTabBR input type=radio name=rdoTab value=done $Tchecked1Done BR input type=radio

Re: [PHP] Should I go with the Singleton Pattern or wait for 5.3?

2008-07-14 Thread Chris
Luigi Perroti wrote: Hello, I'm planning out a simple project and most probably I will need the functionality provided by the Singleton pattern. However with the next 5.3 release I would be able to conveniently use classes directly without instancing them. This would be a comparable option

Re: [PHP] DB search and case sensitive comparison

2008-07-15 Thread Chris
Now what I need to do is to ensure that the lookup_string is in the useragent string and the CASE is the same: IE: Mozilla and not MOZILLA or mozilla etc... Make the database do the work if possible. mysql select * from a where a like '%MOZILLA%'; +-+ | a | +-+ |

Re: [PHP] How can i get the location of an exit()/die() from within register_shutdown_function()?

2008-07-16 Thread Chris
Mathijs van Veluw wrote: Hello there, I have an shutdown function to catch fatal-errors etc.. Now when there is an exit() somewhere i get an empty message from get_last_error(). I want to know the location of this exit() or die(). Is there a way to get the file and line-number from where

Re: [PHP] accessing variable value

2008-07-20 Thread Chris
Sudhakar wrote: i need help with accessing the value of a variable from a different page. i have an index.php file which has 2 files included to display header and footer and the center portion changes based on the link clicked on the footer. header.php ?php echo h2 Text from

Re: [PHP] Apache blocking certain requests instead of php

2008-07-24 Thread Chris
Børge Holen wrote: On Thursday 24 July 2008 09:14:55 Chris wrote: I was hoping there's a way to tell apache to block requests where id=non_numeric. It's trying to do a remote inclusion. It's easy for you to fix in php: if (isset($_GET['id'])) { if (!is_numeric($_GET['id

Re: [PHP] Apache blocking certain requests instead of php

2008-07-24 Thread Chris
Thanks, I'm already doing something like that, but I want to stop it getting to php. http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html Ask on an apache list how to use it. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Apache blocking certain requests instead of php

2008-07-24 Thread Chris
I was hoping there's a way to tell apache to block requests where id=non_numeric. It's trying to do a remote inclusion. It's easy for you to fix in php: if (isset($_GET['id'])) { if (!is_numeric($_GET['id'])) { die(Die hacker die!); } } I'm sure there would

Re: [PHP] storing and then displaying HTML for update

2008-07-24 Thread Chris
Rod Clay wrote: I'm writing a php application which includes accepting and storing HTML for routine display by the application. All of this seems to be working fine. However, I also want to display the raw HTML for administrators of the system to update as necessary. I just discovered

Re: [PHP] PHP4 vs PHP5 classes

2008-07-28 Thread Chris
I have run through the script with a debugger, and sure enough, we only enter function Players once. Is this normal behaviour for PHP5 vs PHP4? Is there a way for me to force $this-max to be calculated each time function max is called? Since the Players method is a constructor, it's more

Re: [PHP] Problem with using array_diff and array_combine

2008-07-29 Thread Chris
Richard Kurth wrote: I hope I can explain what I am trying to do. I have two tables the first one has the custom form elements elements_id elements_field_type elements_field_caption members_id 35 text test8 36 text

Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread Chris
[EMAIL PROTECTED] wrote: Since the Players method is a constructor, it's more about how you set the object(s) up. What does the loop look like before you create a new object? Well see here is where it gets messy! This is not my code - I've ported a phpnuke module over to dragonflycms.

Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread Chris
in fetchSelectData since that's what is causing/creating your loop. Thanks Chris, I will give that a shot. Just to confirm, this script works just fine in php4, so do we put that down to pure luck, or has there been a change in php5 that will be causing it? No idea why it works in php4

Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread Chris
Don't forget that in PHP5, the constructor named has changed. In PHP4 it called a method with the same name as the class. But, in PHP5, it looks for __construct() instead. If __construct doesn't exist then it falls back to the php4 way - makes it backwards compatible :) -- Postgresql php

Re: [PHP] limiting the amount of emails sent at a time in a batch send

2008-07-29 Thread Chris
I've done something very similar. I have a delivery timestamp column in the table that is initially NULL, and I set it to UTC_TIMESTAMP() for each row as I send the message. My query looks like this then: SELECT * FROM mail_queue WHERE delivery_timestamp IS NULL LIMIT 100. Andrew

Re: [PHP] Why PHP4?

2008-07-30 Thread Chris
Per Jessen wrote: Lester Caine wrote: Some ISP's are still only supporting rather ancient versions of PHP4. They should simply be warned of the security risks. Some ISP's have a PHP5 offering, but again an older version simply because it causes less problems when converting from PHP4.

Re: [PHP] limiting the amount of emails sent at a time in a batch send

2008-07-31 Thread Chris
brian wrote: Richard Kurth wrote: I want to limit these script two send 100 email and then pause for a few seconds and then send another 100 emails and repeat this tell it has sent all the emails that are dated for today. This script is runs by cron so it is running in the background. How

Re: [PHP] Kill Magic Quotes

2008-08-07 Thread Chris
public static function restoreSlashes($string) { // Check if Magic Quotes is turned on. if (get_magic_quotes_gpc()) { // Add escape slashes. return addslashes($string); } // Return a string that has escape slashes. return $string; } Wrong way around. If gpc is enabled,

Re: [PHP] Re: Kill Magic Quotes

2008-08-07 Thread Chris
Roger Bigras wrote: you may try the ini_set('magic_quotes_gpc',0); RTM. http://www.php.net/get_magic_quotes_gpc It cannot be enabled/disabled at run time. It has to either be done in a .htaccess or through apache/php.ini changes. See this page for how to disable it:

Re: [PHP] A dumb question regarding sending email

2008-08-12 Thread Chris
tedd wrote: Hi gang: I wish I had another identify for asking dumb questions, but it's late and I'm tried -- so here goes. I have a herdoc that I send out as an email -- no problems there. However, how do I include a link within it? If I use http://example.com, it's just a string but not

Re: [PHP] parsing form with a website question...

2008-08-14 Thread Chris
bruce wrote: rob, i'm fully aware of the issues, and for the targeted sites that i'm focusing on, i can employ strategies to prune the tree... but the overall issue is that i'm looking for a tool/app/process that does what i've described. the basic logic is that the app needs to use a config

Re: [PHP] On one of my computers, php can't see an external javascript I included

2008-08-14 Thread Chris
googling1000 wrote: Edit: I don't think Javascript is disabled on my computer. When I tried posting the code online, I see that my js functions are executed just fine on this one particular machine. Hit the file directly in your browser: http://example.com/path/to/javascript.js what do you

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-24 Thread Chris
But two of those entries are apparently named . and ... Right. That's linux doing that, not php. If you jump into a ssh connection and do an $ ls -la you will see . and .. at the top. if ($filename == '.' || $filename == '..') { continue; } I haven't yet found the

<    2   3   4   5   6   7   8   9   10   11   >