[PHP] file_get_contents works in base script but not in an included script

2009-05-18 Thread LinuxManMikeC
In PHP4, I am using file_get_contents('file.sql',true) to bring in SQL queries from files who's directory is on the include path. It works fine in the main php scripts (ones accessible through URLs), but when done in a php script that is included by one of the main scripts I just get false instead

Re: [PHP] how to delete part of string

2009-05-23 Thread LinuxManMikeC
What are you trying to do that $_POST can't do? With those duplicate 'id' fields, change the input name to 'id[]' in the HTML form and PHP will generate an array for you accessible by $_POST['id'][$index]. If you still have a good reason for working with the raw POST data, just apply the preg_rep

Re: [PHP] Re: Rogue 'if - elseif' code

2009-05-23 Thread LinuxManMikeC
On Fri, May 22, 2009 at 2:50 PM, Nathan Rixham wrote: > Andre Dubuc wrote: >> >> Hi, >> >> I'm having problems with a chunk of 'rogue' code that does not perform as >> expected (it does not pass the expected date, but an empty value). Most of >> the time, it works - so I'm wondering whether it mig

Re: [PHP] urgent CSS question

2009-05-23 Thread LinuxManMikeC
Maybe there is another CSS rule that also matches the same context and overrides parts of the #frame1 rule, but didn't match when using the old #frame rule. Just my two cents. On Fri, May 22, 2009 at 7:15 PM, PJ wrote: > Benjamin Hawkes-Lewis wrote: >> On 22/5/09 20:31, PJ wrote: >>> They may ha

Re: [PHP] templating engine options

2009-05-23 Thread LinuxManMikeC
On Sat, May 23, 2009 at 4:21 PM, Nathan Rixham wrote: > Hi All, > > Just a quick one, can anybody recommend any decent templating engines other > than smarty. > > I've got no problem with smarty and it does the job - but if there is > something newer and lighter out there that I'm missing then I'd

Re: [PHP] Re: Rogue 'if - elseif' code

2009-05-23 Thread LinuxManMikeC
On Sat, May 23, 2009 at 4:36 PM, Andre Dubuc wrote: > On May 23, 2009, you wrote: >> On Fri, May 22, 2009 at 2:50 PM, Nathan Rixham wrote: >> > Andre Dubuc wrote: >> >> Hi, >> >> >> >> I'm having problems with a chunk of 'rogue' code that does not perform >> >> as expected (it does not pass the e

Re: [PHP] conditional classes

2009-05-23 Thread LinuxManMikeC
As long as you design it with a consistent interface I don't see a problem. The whole point of creating abstractions like this is so when you're writing the rest of your code you don't have to think about the gritty details behind the scenes (like PDO or non-PDO). If you design the class so that

Re: [PHP] conditional classes

2009-05-24 Thread LinuxManMikeC
If you do it that way, you will also have to construct an object and return it from that function. By including the class definitions within a function, they will only be available within that function. You will have to use the function as a factory for building objects. In most cases I could only

Re: [PHP] templating engine options

2009-05-24 Thread LinuxManMikeC
On Sun, May 24, 2009 at 11:09 AM, tedd wrote: > At 12:01 AM +0100 5/24/09, Nathan Rixham wrote: >> >> LinuxManMikeC wrote: >>> >>> I was recently researching template engines for a small in-house >>> project, with a bias toward simple and lightweight.  

Re: [PHP] Re: mysql create table with date or timestamp

2009-05-28 Thread LinuxManMikeC
Actually, AUTO_INCREMENT is the correct syntax for MySQL. I think the problem is NOT NULL should come first: iddiary INT NOT NULL AUTO_INCREMENT. 2009/5/28 João Cândido de Souza Neto : > It´s not auto_increment, it´s auto increment. > > -- > João Cândido de Souza Neto > SIENS SOLUÇÕES EM

Re: [PHP] Persistent data between two executions

2009-06-17 Thread LinuxManMikeC
(Man, this reply-all takes some getting used to...) As long as your objects don't contain any reference variables (see manual) you can just assign the object to an element of $_SESSION and leave it at that. The session management code takes care of the serialization. So you're just duplicating w

Re: [PHP] Re: sloppiness & stupidity

2009-06-17 Thread LinuxManMikeC
I don't know what validator you're using, but according to http://validator.w3.org/ (as official as it gets) the following fragment is correct in HTML 4.01, HTML 5, XHTML 1.0 Strict, and XHTML 1.1: test Thus sayeth the W3C, so let it be written, so let it be done. Go read a tutorial on the t

Re: [PHP] phpscriptor.com

2009-07-14 Thread LinuxManMikeC
On Mon, Jul 13, 2009 at 2:39 AM, Reese wrote: > Paul M Foster wrote: >> >> On Sat, Jul 11, 2009 at 08:14:35AM -0700, PHPScriptor wrote: >> >>> Ok this may look like spam but what the hell... >>> >>> I'm the owner of phpscriptor.com, I had bigg plans with this domainname >>> but... well yes, no time

Re: [PHP] Back from the dead with a racing question!

2009-07-18 Thread LinuxManMikeC
On Fri, Jul 17, 2009 at 11:54 AM, Jason Pruim wrote: > > On Jul 17, 2009, at 11:56 AM, Bastien Koert wrote: > >> On Fri, Jul 17, 2009 at 11:51 AM, tedd wrote: >>> >>> At 11:12 AM -0400 7/17/09, Jason Pruim wrote: Hi everyone! So some of you may have noticed that I have been away

Re: [PHP] another pagination problem

2009-07-18 Thread LinuxManMikeC
On Fri, Jul 17, 2009 at 9:35 AM, PJ wrote: > 4. when ordering by title, results are totally different for ASC & DESC; > not the same data at all (Is the ordering done on the entire db? ) Yes, sort of. ORDER BY is applied to the results of the entire query. Then LIMIT takes a slice out of the res

Re: [PHP] parallel execution

2009-07-18 Thread LinuxManMikeC
On Sat, Jul 18, 2009 at 8:15 AM, kranthi wrote: > Code: > > passthru('firefox &'); > echo '1'; > > I am expecting 1 to be echoed while firefox is running. but that is > not the case. ny ideas how i can make this work ? > > Kranthi. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubs

Re: [PHP] prepending concatenating assignment operator

2009-07-25 Thread LinuxManMikeC
On Fri, Jul 24, 2009 at 8:53 PM, Daniel Kolbo wrote: > Hello, > > I know the appending concatenating assignment operator: > $str_name = "Foobar"; > $str_name .= " Sr"; > echo $str_name;//Foobar Sr > > But is there a shortcut assignment operator for prepending concatenation? > > $str_name = "Foobar"

Re: [PHP] JS alert that links to a file

2009-07-26 Thread LinuxManMikeC
On Sun, Jul 26, 2009 at 8:55 PM, Skip Evans wrote: > Okay, I know I've done this before, but now I'm blanking out. > > I have code that creates a CSV file, and when it's done I want a JS alert to > pop up and let them save the file. > > Isn't this some kind of alert() type call on the JS side??? >

Re: [PHP] str_replace

2009-08-08 Thread LinuxManMikeC
On Sat, Aug 8, 2009 at 2:08 AM, Ron Piggott wrote: > Am I understanding str_replace correctly?  Do I have this correct or are ' > needed? > > $bible_verse_ref is what I want to change to (AKA replace) > bible_verse_ref is what I change to change from (AKA search) > $text_message_template is the st

Re: [PHP] use preg_replace to nix and line with "display: none"

2009-08-08 Thread LinuxManMikeC
On Sat, Aug 8, 2009 at 11:14 PM, Rob Gould wrote: > I have a bunch of bullets in a list coming from a previous post, and I need > to eliminate any line from this string that contains "display: none" > > > Reserved Frontstretch > Tower Ticket to the Camping World 300 on Saturday > Reserved Frontstr

Re: [PHP] use preg_replace to nix and line with "display: none"

2009-08-08 Thread LinuxManMikeC
On Sun, Aug 9, 2009 at 12:17 AM, Rob Gould wrote: > I wish I could say this works, but I'm not having success with this pattern. >  All the lines with display: none are still in the $bl string. > > On Aug 9, 2009, at 1:50 AM, LinuxManMikeC wrote: > > Reserved Frontstretch

[PHP] Submit login form using HTTP AUTH

2009-08-20 Thread LinuxManMikeC
Anybody know of any tricks to make an HTML login form that sends the credentials via HTTP AUTH? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] wierd behavior on parsing css with no php included

2009-08-23 Thread LinuxManMikeC
Try this at the beginning of each css file? On Sun, Aug 23, 2009 at 5:49 AM, Ralph Deffke wrote: > Hi folks, i did post this also on the Wamp page but maybe someone out there > had to solve that problem as well. > > systems involved > > Firefox 3.0.13 > Firefox 3.5.2 > IE 6 > > Wamp: > apache 2.

Re: [PHP] Converting URL's to hyperlinks.

2009-08-28 Thread LinuxManMikeC
If you have short php tags enabled, assuming you put the url in a variable called $url... click here otherwise... click here or a myriad of other ways... Depending if there are any special characters involved, there are a couple functions that would be useful for preparing the url before outpu

Re: [PHP] Converting URL's to hyperlinks.

2009-08-29 Thread LinuxManMikeC
2009/8/29 Nisse Engström : > On Fri, 28 Aug 2009 17:22:20 -0600, LinuxManMikeC wrote: > >> click here > > *Groan* > > Throw any random web site to an HTML validator > and you're likely to see this kind of slop all > over. > > The correct solution is of

Re: [PHP] What is the best way to process live data?

2009-08-29 Thread LinuxManMikeC
On Sat, Aug 29, 2009 at 3:31 PM, Paul Halliday wrote: > For those of you that remember (not likely but anyway) I am working on > some code that splits CLF records and feeds them into a database. > > What I need to do now is automate it. > > So what I have is a program (urlsnarf) that redirects its

Re: [PHP] Converting URL's to hyperlinks.

2009-08-29 Thread LinuxManMikeC
2009/8/29 Nisse Engström : > On Sat, 29 Aug 2009 16:19:05 -0600, LinuxManMikeC wrote: > >> As for your "more elaborate example", I'm sure that heredoc will >> validate nicely. > > It does. > Perhaps you haven't met a few good friends of mine.

Re: [PHP] PHP GURU NEEDED

2009-09-14 Thread LinuxManMikeC
On Mon, Sep 14, 2009 at 1:56 PM, mm w <0xcafef...@gmail.com> wrote: > you can be a good coder but you cannot > be without a minimum of social skills and education You'd be surprised... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP GURU NEEDED

2009-09-14 Thread LinuxManMikeC
troll, I don't want to be the > "moral warrior guy" there, but when you are clever there is a time and > a place to troll not when people offers job, developers like to argue > this is a fact, but you have to know when it's to right time. > > Best, > > On M

Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread LinuxManMikeC
On Fri, Oct 16, 2009 at 10:07 AM, Bob McConnell wrote: > From: Ashley Sheridan >> On Fri, 2009-10-16 at 18:01 +0200, Dotan Cohen wrote: >>> > Wow! Here goes: >>> > >>> > Open-bracket, dollar item hypen greater-than, get service id, no > all one word but with a capital S and I. Open and close brack

Re: [PHP] How to pronounce PHP code over the phone?

2009-10-17 Thread LinuxManMikeC
On Fri, Oct 16, 2009 at 10:09 AM, Jim Lucas wrote: > Dotan Cohen wrote: >> How would you read this out loud if you were to read it to someone >> over  the phone? >> >> ($item->getServiceId() ? $item->getServiceId() : $item->getId(; >> >> Thanks! >> > > FATAL ERROR: Non matching parenthesis. >

Re: [PHP] How to pronounce PHP code over the phone?

2009-10-17 Thread LinuxManMikeC
On Sat, Oct 17, 2009 at 11:42 AM, Dotan Cohen wrote: >> As for following a convention, just >> get the PHP terminology right, > > That is what I was hoping to learn! > http://www.php.net/manual/en/langref.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.ph

Re: [PHP] php mail() function

2009-10-22 Thread LinuxManMikeC
The problem is you won't be trusted to deliver mail directly to most mail servers unless you have a static IP. Even then thats no guarantee. What you have to do is relay through your ISP's SMTP server where you're "trusted". You should also be able to setup PHP to use your ISP's SMTP server and

Re: [PHP] CSS and variables

2009-11-20 Thread LinuxManMikeC
On Fri, Nov 20, 2009 at 9:12 AM, Phil Matt wrote: > De-lurking here. > > I'm trying, with no success, to use some CSS styling on my PHP output. > > Here's the code I want to style: > > echo ''.$row[0].''.$row[1].' > > I want to use a CSS style for the second cell, picking up the style > from the

Re: [PHP] securing php pages

2009-11-20 Thread LinuxManMikeC
On Fri, Nov 20, 2009 at 8:56 AM, nitin reddy wrote: > Hi I am a new user of PHP..in my project i have put login forms and i am > able to login successful but the pages after the login can be accessed > directly by typing the address so if any one can help in this matter. > > > Thank you, > > -- >

[PHP] My experience with the "Forms Generation and Validation" class

2009-11-22 Thread LinuxManMikeC
Just like to share my real world experience with Manuel Lemos' "formsgeneration" library. http://www.phpclasses.org/formsgeneration At work early this summer we had a project under a tight deadline that needed unified form creation, processing, and error reporting. I had seen Manuel promoting his

Re: [PHP] Which query is more correct?

2009-11-22 Thread LinuxManMikeC
On Sat, Nov 21, 2009 at 2:52 PM, Nathan Rixham wrote: > Rick Pasotto wrote: >> On Fri, Nov 20, 2009 at 04:41:58PM -0600, LAMP wrote: >>> Hi, >>> I need to pull all records from the table Registrants they are NOT >>> in the table ToBeRecleared >>> >>> Registrants.Reg_ID is PK >>> ToBeRecleared.tbrc

Re: [PHP] Creating users and generating privileges for users

2009-11-22 Thread LinuxManMikeC
On Sat, Nov 21, 2009 at 7:05 AM, tedd wrote: > At 6:36 PM -0600 11/20/09, nitin reddy wrote: >> >> Hey can one help me in creating different users using mysql for php and >> assigning different privileges for them ..any sample code available? >> -- >> PASULA NITIN REDDY >> Graduate Student in Comp

Re: [PHP] Using $$

2009-11-22 Thread LinuxManMikeC
On Fri, Nov 20, 2009 at 12:28 AM, Arno Kuhl wrote: > -Original Message- > From: Ford, Mike [mailto:m.f...@leedsmet.ac.uk] > Sent: 19 November 2009 07:06 PM > To: php-general@lists.php.net > Subject: RE: [PHP] Using $$ > >> -Original Message- >> From: Arno Kuhl [mailto:ak...@telkoms

Re: [PHP] how to prevent a mild DOSS attack?

2009-11-25 Thread LinuxManMikeC
Or DoS back at em. :-D On Wed, Nov 25, 2009 at 3:57 PM, Ashley Sheridan wrote: > On Wed, 2009-11-25 at 16:38 -0600, LAMP wrote: > >> hi guys, >> this morning I got complains from website owner and tons of visitors - >> nobody was able to access the website. it will just timeout. >> I contacted ho

Re: [PHP] how to prevent a mild DOSS attack?

2009-11-25 Thread LinuxManMikeC
On Wed, Nov 25, 2009 at 3:57 PM, Ashley Sheridan wrote: > On Wed, 2009-11-25 at 16:38 -0600, LAMP wrote: > >> hi guys, >> this morning I got complains from website owner and tons of visitors - >> nobody was able to access the website. it will just timeout. >> I contacted hosting company  for more

Re: [PHP] how to prevent a mild DOSS attack?

2009-11-28 Thread LinuxManMikeC
On Sat, Nov 28, 2009 at 10:24 AM, LAMP wrote: > LinuxManMikeC wrote: > > On Wed, Nov 25, 2009 at 3:57 PM, Ashley Sheridan > wrote: > > > On Wed, 2009-11-25 at 16:38 -0600, LAMP wrote: > > > > hi guys, > this morning I got complains from website owner and ton

Re: [PHP] Storing (html and php) Content in MySQL - help

2009-11-30 Thread LinuxManMikeC
On Mon, Nov 30, 2009 at 5:52 PM, Allen McCabe wrote: > I have been trying to wrap my mind around how to accomplish this for a few > days, and done estensive searching on Google. > > I know there are free CMS systems available for download, but I want to > write my own code so I can maintain it and

Re: [PHP] Object of class stdClass could not be converted to string

2009-11-30 Thread LinuxManMikeC
On Mon, Nov 30, 2009 at 10:27 PM, John Taylor-Johnston wrote: > Good grief. It doesn't like printing an INT field like as if it were a > string?? > > I looked at: http://php.ca/manual-lookup.php?pattern=stringtoint like I > might of in Delphi :)p > >    echo " $mydata->2010\n"; >    echo " $mydata

Re: [PHP] Emergency! Performance downloading big files

2009-12-01 Thread LinuxManMikeC
On Tue, Dec 1, 2009 at 3:48 PM, Brian Dunning wrote: > > This is a holiday-crunch emergency. > > I'm dealing with a client from whom we need to download many large PDF docs > 24x7, several thousand per hour, all between a few hundred K and about 50 MB. > Their security process requires the files

Re: [PHP] mysterious include problem

2009-12-07 Thread LinuxManMikeC
Instead of hard coding cases you can validate and constrain the input with a regex. Much more flexible when adding content. I would also add code to make sure the file exists, otherwise fall through to the default. On Mon, Dec 7, 2009 at 1:14 PM, Kim Madsen wrote: > Hi Allen > > Allen McCabe wr

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-09 Thread LinuxManMikeC
On Wed, Dec 9, 2009 at 6:45 AM, René Fournier wrote: > Strange problem I'm having on Mac OS X Server 10.6 running PHP 5.3. Any call > of file_get_contents() on a local file works fine -- the file is read and > returned. But any call of file_get_contents on a url -- any url, local or > remote --

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-09 Thread LinuxManMikeC
On Wed, Dec 9, 2009 at 8:02 AM, LinuxManMikeC wrote: > On Wed, Dec 9, 2009 at 6:45 AM, René Fournier wrote: >> Strange problem I'm having on Mac OS X Server 10.6 running PHP 5.3. Any call >> of file_get_contents() on a local file works fine -- the file is read and >>

Re: [PHP] Fixe Point Decimal Data type

2009-12-17 Thread LinuxManMikeC
On Thu, Dec 17, 2009 at 7:49 AM, Floyd Resler wrote: > I may be over-simplifying or not completely understanding fixed point > decimals, but would number_format work? > > Take care, > Floyd > Over-simplifying just a touch... http://en.wikipedia.org/wiki/Floating_point_error#Accuracy_problems --

Re: [PHP] Fixe Point Decimal Data type

2009-12-17 Thread LinuxManMikeC
On Thu, Dec 17, 2009 at 7:21 AM, Raymond Irving wrote: > Hello, > > Is there a way to represent numeric values as fixed point decimals in PHP? If > not, why was this datatype not added? > > I think is very important to have fixed point decimals when working with > money values. This would make i

Re: [PHP] Checking for internet connection.

2009-12-20 Thread LinuxManMikeC
On Sun, Dec 20, 2009 at 2:32 AM, Andy Shellam wrote: >> >> I think the only way to detect if it can connect to the Internet is to >> see if you can grab a file from somewhere on the Internet. I'd hazard a >> guess that when operating systems are able to tell you they can "connect >> to the Interne

Re: [PHP] mod rewrite

2010-01-02 Thread LinuxManMikeC
On Sat, Jan 2, 2010 at 12:52 AM, Sudhakar wrote: > hi > > i am using a cms which requires mod_rewrite to be enabled for seo urls > > in the wamp that i use in my local machine in the httpd.conf file i have > this line and removed the comment > LoadModule rewrite_module modules/mod_rewrite.so > > w

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread LinuxManMikeC
http://framework.zend.com/manual/en/coding-standard.html#coding-standard.overview.scope "This document provides guidelines for code formatting and documentation to individuals and teams contributing to Zend Framework." So as far as anything other than code being contributed to Zend Framework, its

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread LinuxManMikeC
On Fri, Jan 8, 2010 at 1:24 PM, Daevid Vincent wrote: > > I'm having a debate with a co-worker about adding the final ?> on a PHP > page... > So everybody, when do we get to the real discussion? Which end of an egg do we break? -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] mysql_real_escape_string(0xffffffff) yields -1

2010-01-16 Thread LinuxManMikeC
On Fri, Jan 15, 2010 at 3:22 PM, Richard Lynch wrote: > The subject line says it all: > > mysql_real_escape_string(0x) yields -1 > > What's up with that? > > Is there some way to convince mysql_real_escape_string to use BIGINT? > > I guess I'll just PCRE for digits and then pass it in and.