RE: [PHP] Help with new config
hi John You'll probably see whats up if you tell php to spit out error messages - set display_errors = 1 in php.ini hth Rob > -Original Message- > From: John Taylor-Johnston > [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 1 November 2005 12:32 PM > To: PHP-General > Subject: [PHP] Help with new config > > > New server, new config. PHP 4.3.9 and new mysql db. > > phpmyadmin works among other scripts, including: > http://compcanlit.usherbrooke.ca/whovisits.php > > But this bugger won't: > http://testesp.flsh.usherbrooke.ca/testdb.phps http://testesp.flsh.usherbrooke.ca/phpinfo.php I cannot even see the "aa\naa It's mysql related, that is for sure. Any inspiration? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] if string contains
hi John > Me thinks that was what I used. > http://ca.php.net/strstr > http://ca.php.net/stristr > http://ca.php.net/strpos > What's the difference? the ones ending 'pos' just return an integer position. The 'i' in these string manipulation functions generally means that the function is case-insensitive. Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[suspicious - maybe spam] [PHP] [suspicious - maybe spam] RE: [PHP] php search engine
hi Ross > Any alternatives free or paid let me know.. http://www.isearchthenet.com/isearch/ is a good 'un, so long as you don't have thousands of pages. R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Strange behaviour overriding methods in 5.0.4
hi Norbert, Have you tried print_r($_SESSION['view'])? I'm wondering if there's some problem recreating the class instance from the session data... Rob > -Original Message- > From: Norbert Wenzel [mailto:[EMAIL PROTECTED] > Sent: Thursday, 29 September 2005 2:58 AM > To: php-general@lists.php.net > Subject: [PHP] Strange behaviour overriding methods in 5.0.4 > > > Hi, i have a very strange example of code. Maybe you know where my > mistake could be. > > I've got an index.php with a few div's and a short php code, like: > echo $_SESSION['view']->getContent(); > > The view is in every case one of my view objects. And there's > the problem. > > In my specific case $_SESSION['view'] is of class "NoLoggedUserView", > which of course extends "View". The "View" class containts a > few public > methods, namely > > getTitle() > getHeadline() > getSelection() > getSubselection() > getContentHeadline() > getContent() > getFunctions() > > The child class "NoLoggedUserView" contains only the > getContent()-method, which provides a login window. > > But of course I still call all the other methods like getTitle() in my > index.php. > > Until yesterday I encountered no problems with that, but today, if i > call $noLoggedUserView->getTitle() in the index.php i get an empty > document. No error, no warning, no notice ... nothing. The page stays > the same and doesn't change. Even the timestamp I print out > to check if > there has been a change, doesn't change. > > I tested a few things: > The page loads fine and without any problems, if the public method > getTitle() is written in the NoLoggedUserView and the method returns a > stupid string. If getTitle() in NoLoggedUserView looks like this > public function getTitle() { > return parent::getTitle(); > } > there is the same problem as before. I get an empty page, no > changes are > made. > > My current version of getTitle() looks like this: > public function getTitle() { > //return 'NoLoggedTitle'; // works great > //return parent::getTitle(); // no changes are made > > $classname = get_parent_class($this); > $v = new $classname(); > return $v->getTitle(); // works great > } > > And again, this strange thing works. > > So what could cause php to act like this? Any ideas or > suggestions or at > least assumptions? > > Please, I really don't know where to search the mistake.. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [OFF: object oriented question] OO discussion newsgroups?
hi Alex, I don't know of any discussion group, but you may want to check out a book that's just got a very good review on slashdot... http://books.slashdot.org/article.pl?sid=05/08/16/0434205&from=rss Rob > -Original Message- > From: Alex Gemmell [mailto:[EMAIL PROTECTED] > Sent: Friday, 19 August 2005 12:42 AM > To: php-general@lists.php.net > Subject: [PHP] [OFF: object oriented question] OO discussion > newsgroups? > > > Hello, > > I'd like to join a newsgroup that discusses object oriented design > techniques. I'm getting to grips with OO stuff but could do > with some > specific guidance at times, especially while I'm a novice at it. > > I can't see an OO newsgroup here in news.php.net. > > Thanks for any suggestions. > > Alex > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IP & Geographical
PEAR::Net_GeoIP is nice.. $geoip = Net_GeoIP::getInstance('/path/to/geoip.dat', Net_GeoIP::MEMORY_CACHE); $countryName = $geoip->lookupCountryName($ipAddress); http://pear.php.net/package/Net_GeoIP Rob > -Original Message- > From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] > Sent: Friday, 12 August 2005 1:38 AM > To: php-general@lists.php.net > Subject: [PHP] IP & Geographical > > > I have a field in my counter that collects IP addresses. Now > the powers > that be want be to collect that data and sort it geographically etc. > Is there anyone who has done this? Where would I find some OS > code? I've > heard of it done. > John > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Date confusion
hi Linda > I must admit I am surprised at the paucity of date and time > functions in PHP. You may want to check out the PEAR Date class: http://pear.php.net/package/Date Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is there a way to get a variable name as a string?
hi Daevid FWIW, I was trying to do the exact same thing a while back, and came to the conclusion that it wasn't possible. Rob > -Original Message- > From: Daevid Vincent [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 19 July 2005 11:28 AM > To: php-general@lists.php.net > Subject: [PHP] Is there a way to get a variable name as a string? > > > Is there a way to get the name of a variable as a string? For > example... > > Function myname ($foo) > { > echo "the variable name passed in is ".realname($foo); > } > > myname($bar); > > > I want to see printed out: > > "the variable name passed in is bar" > ^^^ > > Dig what I'm trying to do? > > And 'why?' you may ask am I trying to do this... Well, I am > sick of always > putting an "echo 'printing out bar:'; print_r($bar);" all the > time. I want > to make a wrapper function. > > I also have written one for XML that would be nice to make a > NAME='bar' > attribute... > > /** > * Print out an array in XML form (useful for debugging) > * @access public > * @author Daevid Vincent [EMAIL PROTECTED] > * @since 4.0b4 > * @version1.0 > * @date 07/18/05 > */ > function print_r_xml($myArray) > { > print xmltag('ARRAY', array('NAME'=>'myArray'), 1); > foreach($myArray as $k => $v) > { > if (is_array($v)) > print_r_xml($v); > else > print xmltag($k,htmlspecialchars($v)); > } > print xmltag('ARRAY', null, 2); > } > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mime magic & MS word docs
hi all, I was just wondering if anyone has had any success using mime_magic to guess the content type of MS Word documents..? The extension works for gif's & jpeg's, but mime_content_type() returns "text/plain" for Word and Excel docs. I'm using php 5.0.4 on Windows, and the mime.magic file that's bundled with php. I tried switching on the mime_magic debugging. It complained about a lot of entries in the mime.magic file, saying that they weren't proper mime types, but not the MS document type entries AFAICS any help much appreciated Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to submit a form that has a file included ?
hi Mario > And the tag, is it allright like it is ? you'll need to add this: enctype="multipart/form-data" Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Responses in my email.
> From: Rory Browne > This is primarly a mailing list. Not a news group. The whole idea of a > mailing list is that you get every message mailed to you. uh, I think the OP is complaining about the emails that *don't* go via the list, because this list is set up so that hitting reply goes to the poster, not the list. Thought I'd stick my oar in because remembering to hit reply-to-all gets on my nerves too.. Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unknown column 'peterspeters' in 'where clause'
hi Mark > Unknown column 'peterspeters' in 'where clause' you're missing the quotes around (I guess) the password. you can kick yourself now :-p -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] editor that typesets the php code
hi Dasmeet > From: Dasmeet Singh > I have just completed coding for a script... i want to take a > printout > of the code.. but the code is very hotch potch.. > > Is there any software to automatically set the code with proper > spacing/tabs extra..and possibly give colors to it too...?? Check out the PEAR PHP_Beautifier package http://pear.php.net/package/PHP_Beautifier R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problem connecting php and mysql
hi Rahot From: rahot man > I have windows server 2003, PHPv5.0.3, Mysql v4.1 and IIS 6 and i am > working in Macromedia Dreamweaver MX2004 > > i am unable to connect to the mysql server. but my php files > are running > fine and my mysql server is also running fine. > > i) i had changed the php.ini-dist file to php.ini. > ii)i uncommented the extensions of php_mysql.dll in php.ini file > iii)i set the extensions_dir to > extension_dir = "D:\PHP\php-5.0.3\ext\" in php.ini file > iv)i had copied the libmysql.dll in windows\system32 and > windows\system > v)i also copied the php_mysql.dll to D:\PHP\ > > i wrote the following code: > $dbhost = "localhost"; > $dbusername = "root"; > $dbpassword = "admin"; > $dbname = "test"; > $connect = @mysql_connect ( $dbhost,$dbusername,$dbpassword ) or > die ("Could not connect ".mysql_error()); > mysql_select_db($dbname,$connect) or > die("Could not select database".mysql_error()); > ?> > > but after all these i am still getting the error > Fatal error: Call to undefined function mysql_connect() in > D:\PHP\teknohub\new.php on line 14 > > please help me to solve this problem out One thing to check is this: are you sure IIS is reading the php.ini file you think it's reading? You can find out by running . There will also be a mysql section somewhere in the output if the extensions loaded. hth Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Abstract Legacy question
Andy Pieters wrote: > This is kinda hard to say in words, so I'll give a little example > > Class A > function x > calls function guid > function y > function z > function guid > Class B extends A > function y >calls function x > function guid > > So what I'm wondering is when class B calls its function Y, > it will in its > turn call function X (which is not overloaded in class B) and > function X > calls the function GUID from which class? Class A or Class B? class B. Which makes sense if you think about the code, which will look like $this->guid() ... and '$this' is a 'B' Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] script
here's the clue to the other half of the puzzle: you can do this kind of thing in php if (whatever) { include 'something.php'; } else { include 'something else.php'; } hth, Rob > -Original Message- > From: Stephen Johnson [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 20 April 2005 11:53 AM > To: tommy > Cc: php-general@lists.php.net > Subject: Re: [PHP] script > > > http://php.net/time > http://php.net/date > http://php.net/mktime > > > one or a combination of these functions will help you do what > you want. > > HTH > On Apr 19, 2005, at 6:37 PM, tommy wrote: > > > I'm hoping someone on this list can help me with something > I've been > > struggling with lately... > > > > I have a php based web page that I'd like to have load an > include file > > only when it is Tuesday 11pm - Weds 1 am Eastern Standard > time (USA). > > At other times I would like my page to load and alternate include > > file. > > > > If someone could help me with the code or point me in the right > > direction it would be very appreciated. > > > > Thanks. > > > > Tommy. > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > * > Stephen Johnson > [EMAIL PROTECTED] > http://www.thelonecoder.com > > --continuing the struggle against bad code-- > * > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Date class
Matthias wrote: > Have you looked at the PEAR Date class? > > http://pear.php.net/package/Date PEAR Date is good - I use it a lot - but watch out for this bug if you're running on Windows http://pear.php.net/bugs/bug.php?id=2344 basically, there's some getenv/putenv trickery in the Date_Timezone::inDaylightTime method called in Date::before & Date::after which causes access violations. Unfortunately the Date owner's attitude is roughly 'not my problem, windows sucks' (which may be true but doesn't help much :-/ ) R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4 to PHP 5 Migration shortcut
> ...and trying to re-assign $this inside a class. which is perverse and shouldn't have been allowed in the first place =) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4 to PHP 5 Migration shortcut
> From: Rasmus Lerdorf > Chances are pretty good that you won't have to change > anything. Step 1 > would be to simply try running your existing code under PHP5 and see > what breaks. Unless you have complicated OO code or you are > using the > domxml extension, you likely won't need to change anything. FWIW, in my experience the thing most likely to trip you up is this: $a = new C(); $b = $a; ...in php4 $b is a copy of $a, but in php5 it's a reference to the same object. You can use clone() to get the same result. hth Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] booking
hey up all, anyone have a snippet for generating a unique booking reference string, say 6-10 characters long? The kind of thing you get when you book a flight or whatnot online. it's friday afternoon and I'm too dim to figure one out myself :-/ Rob Agar Web Site Consultant Wild Lime Media - [EMAIL PROTECTED] Studio 1, 70 McLeod Street, Cairns 4870 Tel: 07 4081 6677 | Fax: 07 4081 6679 Web and Software Development Services - www.wildlime.com Search Engine Optimisation Services - search.wildlime.com Professional Website Hosting Services -www.hostonlime.com.au Winner 2004 Telstra North QLD Media Awards - Best Website - Online Content & Information -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] access violation
hi Leif, Just thought you'd like to know - I have submitted a bug report, bug #32422. btw, assuming it's the same bug, I can get it to happen during GET requests, just less frequently. Rob > -Original Message- > From: Leif Gregory [mailto:[EMAIL PROTECTED] > Sent: Thursday, 24 March 2005 12:19 AM > To: Rob Agar > Subject: Re: [PHP] access violation > > > Hello Rob, > > Tuesday, March 22, 2005, 4:14:55 PM, you wrote: > R> That's interesting - it also started happening for me after > R> installing PHP 5.0.3. But I have reverted to 4.3.10 for now, and I > R> can't see how installing 5.0.3 into an entirely separate directory > R> can break my old php install. Hmm.. > > R> Incidentally, are you using Pear at all? > > No, I'm not doing anything with Pear (just haven't gotten > around to it). > > I did the same thing you did, installed into a separate > directory and fixed all the references in the webserver, and > have deleted any PHP 4.3 files from the Windows/System folder. > > Luckily it doesn't appear to be a big security problem as it > only displays the access violation in the browser window (no > paths or anything). A reboot fixes it until I do something > like refreshing POST data a few times again. Until I get the > problem resolved, I don't refresh POST data anymore on that server. > > The frustrating thing is that the "crash" doesn't show up in > any logs. Even the Windows system logs. > > I also didn't do any major changes from the default php.ini > except to enable some extensions I needed, set up the SMTP > stuff, and that's really about it. > > I am running 5.0.3 on other servers (various web servers and > MySQL versions, but all Windows), and am not experiencing > this problem. The only difference with those servers is that > 5.0.3 was installed fresh (no previous PHP). I'm wondering if > I missed one of the extension files somewhere from 4.3. > > > > > -- > Leif (TB lists moderator and fellow end user). > > Using The Bat! 3.0.9.9 Return (pre-beta) under Windows XP 5.1 > Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] access violation
hi Leif Glad to know I'm not the only one ;) > The only system stuff we have in common is the OS. The > webserver is Sambar, and PHP is 5.0.3. It didn't start having > this issue till I updated the PHP to 5.0.3, so I'm going to > reinstall it at some point to see if that helps any. That's interesting - it also started happening for me after installing PHP 5.0.3. But I have reverted to 4.3.10 for now, and I can't see how installing 5.0.3 into an entirely separate directory can break my old php install. Hmm.. Incidentally, are you using Pear at all? Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] access violation
hi all All of a sudden, my local install of Apache has started throwing access violation errors. It's happening pretty frequently, particularly when hitting the refresh button on a page generated from POST data, causing a re-POST, but isn't 100% reproducible. Anyone else had a problem like this? I couldn't find anything in the php or apache bug databases that sounded like the same problem. If anyone has debug mapfiles for the php dlls, or even better, win32 debug builds of 4.3.10, would it be possible to send them to me. I don't have access to MSVC here, so I can't build them myself :( Any suggestions welcome! Windows XP pro SP2 Apache/1.3.33 (Win32) PHP/4.3.10 stack trace: 7C910C27 C:\WINDOWS\system32\ntdll.dll 7C910D5C C:\WINDOWS\system32\ntdll.dll 77C2C2DE C:\WINDOWS\system32\msvcrt.dll 77C39AE9 C:\WINDOWS\system32\msvcrt.dll 77C35F5D C:\WINDOWS\system32\msvcrt.dll 77C35FEC C:\WINDOWS\system32\msvcrt.dll 10047D4E c:\php4\php4ts.dll or sometimes: 77C46137 C:\WINDOWS\system32\msvcrt.dll 100CA6AE c:\php4\php4ts.dll 60002E50 c:\php4\php4apache.dll 6000186F c:\php4\php4apache.dll dll base addresses: 0x6000 php4apache.dll 0x1000 php4ts.dll Rob Agar Web Site Consultant Wild Lime Media - [EMAIL PROTECTED] Studio 1, 70 McLeod Street, Cairns 4870 Tel: 07 4081 6677 | Fax: 07 4081 6679 Web and Software Development Services - www.wildlime.com Search Engine Optimisation Services - search.wildlime.com Professional Website Hosting Services -www.hostonlime.com.au Winner 2004 Telstra North QLD Media Awards - Best Website - Online Content & Information -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] showing the decimal places
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > when I define a number as > > $number = 2.00 > > then echo it the number shows as 2. How can I get the two > zeros to show? > > This is not in any of my books but a fairly easy solution I'll bet! the function you want is called sprintf (s for string, f for format) summat like this: echo sprintf('%0.2f', $number); hth, Rob Agar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] odd error
hey all just got this error: Parse error: parse error, expecting `T_PAAMAYIM_NEKUDOTAYIM' The line that caused it was this: $db =& null; (yes I know it's wrong, it's a typo/brain spasm) I'm just curious - what language IS that? finnish? Rob Agar Web Site Consultant Wild Lime Media - [EMAIL PROTECTED] Studio 1, 70 McLeod Street, Cairns 4870 Tel: 07 4081 6677 | Fax: 07 4081 6679 Web and Software Development Services - www.wildlime.com Search Engine Optimisation Services - search.wildlime.com Professional Website Hosting Services -www.hostonlime.com.au Winner 2004 Telstra North QLD Media Awards - Best Website - Online Content & Information -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php