RE: [PHP] About MySQL Tables

2007-08-06 Thread Chris Aitken
 -Original Message-
 From: Kelvin Park [mailto:[EMAIL PROTECTED]

 I have two tables that share product codes to relate data.
 One table is called IMAGE, and another one is called the PRODUCT.
 There are more than one image for every product, for example product
 code 1122 will have 3 images and 4938 will have 5 images within the
 IMAGE table. Since all my product information is stored in PRODUCT table
 except for the image file names (e.g. 1122_1.jpg, 1122_2.jpg or
 4938_1.gif), I have to build the following query: SELECT * FROM PRODUCT,
 IMAGE WHERE PRODUCT.productcode = IMAGE.productcode. However, this
 causes a little problem. When I print out all the product information
 with its images, more than one copy of a product is printed out (because
 of multiple images for each product). I'm still looking for a way to
 build a query string so that I could have only one image displayed per
 product (so that a user can click on the product to view more images).


You could use a Group By to limit each PRODUCT 

SELECT * from PRODUCT, IMAGE where PRODUCT.productcode = IMAGE.produtcode
group by PRODUCT.productcode

You could do it via 2 selects (ie, the first query simply lists all items in
PRODUCT, then within this loop, a second query lists all entries in IMAGES
which have the productcode, with a limit 1 in the query.

Personally, I'd go with the Group By option, and be clever with your ORDER
so the correct image gets selected.



Regards
 
Chris Aitken
The Web Hub Designer and Programmer
Phone : 02 4648 0808
Mobile : 0411 132 075
 
-
 
Making The Web Work The Web Hub
http://www.thewebhub.com.au/
[EMAIL PROTECTED]
 
-
Confidentiality Statement:  
This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEDGED and CONFIDENTIAL.  If you are not the 
intended recipient, dissemination of this communication is prohibited.  
If you have received this communication in error, please erase all 
copies of the message and its attachments and notify us immediately

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Which PHP-Editor to use?

2007-08-02 Thread Chris Aitken
I know I've been away from this list for years and have missed the several
reincarnations of this thread over time, but has anyone ever used a kickass
little program called Notepad2?

I discovered this about 2 years ago and it's the most brilliant little
application I've ever found. Sure, it doesn't have the niceties like
multi-file search  replace (which can be handy when you get a job to fix
someone elses website and they don't use a PHP shell for the HTML code
instead have all the HTML code in every file).

Notepad2 is just this little app which has things like language specific
colour coding, line numbering, tab indentation support, and its just SO
small, memory-unintensive, and a pleasure to use. I have tried so many
different types over the years always get sick of the bloat and the shit
that's put into programs like dreamweaver, smartedit etc that I cant stand
using it.

I love being able to fire off a quick little notepad2 editor from my FTP
program, make the changes, save it, close it and upload it. Brilliant
system.


-Original Message-
From: Al [mailto:[EMAIL PROTECTED] 
Sent: Friday, 3 August 2007 6:56 AM
To: php-general@lists.php.net
Subject: [PHP] Re: Which PHP-Editor to use?

phpEdit  http://www.waterproof.fr/products/PHPEdit/

Merlin wrote:
 Hi there,
 
 I have worked now for several years happily with homesite 4.5, but now 
 it looks like I have to switch to another system as homesite will not 
 run without admin rights on a XP machine.
 
 What editors do you use? Do you have any recomendations on a special 
 one? I have looked into eclipse, but I would hear from your experience 
 which one would you recommend me to switch to?
 
 Thank you for any comment.
 
 Best regards,
 
 Merlin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



__ NOD32 2433 (20070802) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Pirate PHP books online? - ENOUGH ALREADY

2007-07-30 Thread Chris Aitken
Come on folks is this a thread that really needs to be duked out here?

It's a bit ridiculous having legal issues regarding copyright (and whatever
else has been brought up) by a collection of (mostly) legally untrained
computer nerds (I include myself in the nerd category so get off the flame
button).

Let it die already. There's more important things to waste bandwidth on...
like discussing ... I dunno who's hotter... Oprah Winfrey or Roseanne?


Regards
 

Chris Aitken
The Web Hub Designer and Programmer
Phone : 02 4648 0808
Mobile : 0411 132 075
 
-
 
Making The Web Work The Web Hub
http://www.thewebhub.com.au/
[EMAIL PROTECTED]
 
-
 
Confidentiality Statement:  
This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEDGED and CONFIDENTIAL.  If you are not the 
intended recipient, dissemination of this communication is prohibited.  
If you have received this communication in error, please erase all 
copies of the message and its attachments and notify us immediately.
 -Original Message-
 From: Larry Garfield [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, 31 July 2007 10:28 AM
 To: php-general@lists.php.net
 Subject: Re: [PHP] Re: Pirate PHP books online?
 
 On Monday 30 July 2007, tedd wrote:
 
  Our entire legal system is built on allowing (granting permission)
  certain actions and not allowing (not granting permission) other
  actions.
 
  You do not have permission to steal. And if someone has not granted
  you the permission to use their whatever and you do use their
  whatever, then that's stealing.
 
 So jay-walking (illegal, you do not have permission to do it) is now
 stealing,
 because it's something you're not granted permission to do?
 
  A great many people -- myself included but also the Creative Commons
   folks, the FSF, many open source developers, and many others --
 believe
   the current system of copyright law to be fundamentally flawed.
 
  And, I doubt that the organizations you site actually agree with you.
 
 I have personally spoken to both Larry Lessig (Creative Commons) and
 Richard
 Stallman (FSF) on the subject, and feel confident in saying that both
 agree
 with the distinction.  Lessig doesn't feel it's an issue worth pursuing
 when
 there are bigger fish to fry.  I respectfully disagree.
 
  Not that we shouldn't have copyright, but that the current form of
   copyright is broken.  A work restricted for an entire generation after
   the
  original author is
  dead?
 
  What about descendants of the author? When anyone dies, their
  descendants have a rightful claim on their parent's assets -- it been
  that way since the dawn of mankind. Do you think you know better than
  the practice of thousands of generations?
 
 Actually no, property law didn't really come in until civilization, some
 5000
 years ago, which is rather small on the scale of dawn of mankind.  And
 copyright didn't exist until perhaps 5 centuries ago in England, and
 covered
 just publication, and was for less than 20 years.  Copyright being long
 enough term for inheritance to matter is less than a century.  Over the
 scale
 of human history, unrestricted information flow has been the rule, not the
 exception.
 
 But what you're suggesting is that legalized extortion should be
 inheritable.
 Copyright is, fundamentally, legalized extortion as a means of promoting
 the
 progress of Science and the Useful Arts.  Do you keep paying the guy who
 built your TV every time you watch something on it?  Do you keep paying
 the
 company that built your house every time you move?  Do you pay your
 teachers
 from college every time you use something you learned there?  Do you pay
 your
 dentist every time you eat?
 
 
  And for that, I am accused of having no morality and values.
 
  I don't think anyone has accused you of that, but saying what you
  have, leaves us with the obvious conclusion that you don't recognize
  copyright infringement as stealing -- and that does cast a long
  shadow as to morality and values.
 
 I will simply leave the above snippet in place, as I think it speaks for
 itself.
 
  tedd
 
  PS: I said I wouldn't get back into this argument, but your claims
  are just absurd.
 
 This from the man who just claimed that perpetual copyright for all
 decedents
 of an artist was a fundamental part of human existence for as long as
 they've
 been humans.  Can we stick to facts when making logical arguments rather
 than
 completely made up nonsense?
 
 --
 Larry GarfieldAIM: LOLG42
 [EMAIL PROTECTED] ICQ: 6817012
 
 If nature has made any one thing less susceptible than all others of
 exclusive property, it is the action of the thinking power called an idea,
 which an individual may exclusively possess as long as he keeps it to
 himself; but the moment it is divulged, it forces itself

RE: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Chris Aitken
 Solution 1:
 Send a header() that avoids caching (can't remember it exactly)
 Solution 2:
 Call the image like this:
 img src=image.jpg?arandomstringhereeachtime
 Or if you were creating it with a php script:
 img src=image.php?img=image.jpgarandomstringhereeachtime

My preferred way of doing it, and making sure its reloaded each time is to
do it this way... the U variable pretty much guarantees a random string each
time its loaded.

image.jpg?.date(U).




Regards
 

Chris Aitken
The Web Hub Designer and Programmer
Phone : 02 4648 0808
Mobile : 0411 132 075
 
-
 
Making The Web Work The Web Hub
http://www.thewebhub.com.au/
[EMAIL PROTECTED]
 
-
 
Confidentiality Statement:  
This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEDGED and CONFIDENTIAL.  If you are not the 
intended recipient, dissemination of this communication is prohibited.  
If you have received this communication in error, please erase all 
copies of the message and its attachments and notify us immediately.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Malformed Email Date Header

2007-07-26 Thread Chris Aitken

 Most likely it's the server's time/date problem.  Did you check to make 
 sure that the time/date is in the correct timezone, etc?  I know this 
 isn't really the right way to do it, but you could always just move the 
 server's clock back 10 hours if it's really always 10 hours ahead of time.

 You alternatively could also always use a different way of sending your 
 mail for that server.  If you used PHPMailer 
 http://phpmailer.sourceforge.net/ this allows you to connect to SMTP on a 
 different machine to send email from an account.  This one is really 
 tougher than I origionally thought.

The time on the machine is correct, and out of all of the date stamps in the
headers of the email are formed correctly based on the machines time/date,
(ie, everywhere else in the headers it adds the +1000 correctly) except in
the 1 main line

 Date: Day 00th Jan 2999 01:02:03 ?1000

Email programs (Wintendo based, and *nix based alike) generally have a hard
time with this Date header. Outlook and Outlook express just try and
interpret and guess what its supposed to mean (seemingly adding an extra 10
hours to the correct timestamp) and the *nix mail filter I came across
reported it as being a bad header.


Regards
 

Chris Aitken
The Web Hub Designer and Programmer
Phone : 02 4648 0808
Mobile : 0411 132 075
 
-
 
Making The Web Work The Web Hub
http://www.thewebhub.com.au/
[EMAIL PROTECTED]
 
-
 
Confidentiality Statement:  
This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEDGED and CONFIDENTIAL.  If you are not the 
intended recipient, dissemination of this communication is prohibited.  
If you have received this communication in error, please erase all 
copies of the message and its attachments and notify us immediately.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Hide the real URL

2007-07-26 Thread Chris Aitken
  There's a couple of protect your image schemes that will frustrate
  the typical user, but they can be easily broken, like the one I
  created here:
 
  http://www.webbytedd.com/b/protect_image/
 
 
 Firefox - Tools - Page Info - Media - Scroll Till Find - Bingo!
 

Say Firefox to a typical user and they will assume you are swearing at
them in another language.

No different to me saying...

CTRL - SHIFT - Print Screen - Paste into Photoshop.

Typical users don't even KNOW they have a printscreen button just like
most typical users don't know there is ANOTHER kind of browser :)



Regards
 

Chris Aitken
The Web Hub Designer and Programmer
Phone : 02 4648 0808
Mobile : 0411 132 075
 
-
 
Making The Web Work The Web Hub
http://www.thewebhub.com.au/
[EMAIL PROTECTED]
 
-
 
Confidentiality Statement:  
This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEDGED and CONFIDENTIAL.  If you are not the 
intended recipient, dissemination of this communication is prohibited.  
If you have received this communication in error, please erase all 
copies of the message and its attachments and notify us immediately.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Chris Aitken
 header('Cache-Control: no-store, no-cache, must-revalidate,
 Post-Check=0, Pre-Check=0');

 brian

That's HTTP/1.1 only, but this is what I got from PHP site:
?php
header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past
?


But wouldn't that make every image on the page be uncached and reloaded each
time? Not very efficient if the shell of the site keeps getting loaded if
only 1 or 2 images need to be forced.




Regards
 

Chris Aitken
The Web Hub Designer and Programmer
Phone : 02 4648 0808
Mobile : 0411 132 075
 
-
 
Making The Web Work The Web Hub
http://www.thewebhub.com.au/
[EMAIL PROTECTED]
 
-
 
Confidentiality Statement:  
This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEDGED and CONFIDENTIAL.  If you are not the 
intended recipient, dissemination of this communication is prohibited.  
If you have received this communication in error, please erase all 
copies of the message and its attachments and notify us immediately.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Malformed Email Date Header

2007-07-26 Thread Chris Aitken
 Looks to me like the \270 is some kinda Unicode character instead of,
 like, you know ASCII '+'...
 
 Dunno how you managed to convince your mail system that you wanted it
 to convert + to Unicode \270, mind you, but there it is.


Hi Richard,

Odd thing is all of the other headers of the email (see below for a
snippet of the headers) show the date stamp with the correct + and the
actual Date: header shows a ? instead of a +

I assumed that the 270 is a corrupted character that was substituted with a
? because it didn't know what else to put there. 

This error is spread throughout my google searches as some people have had
it happen from versions as old as mid 3 version of PHP through to later
versions of 4.

My only guess is that it seems to be some sort of inbuilt glitch within PHP
that reacts with some common denominator (version of IIS, version of
operating syetem etc) but noones been able to discover a reason.

--
Received: from storm by lightstorm.com.au 
(MDaemon PRO v9.5.6)
with ESMTP id md50002484423.msg
for [EMAIL PROTECTED]; Wed, 04 Jul 2007 10:11:41 +1000
Date: Wed, 04 Jul 2007 10:11:39 ?1000
--

Note the above how it puts the correct +1000 on the internal header, but the
one that becomes more of an external (or visible) header, has the ?1000


Regards
 

Chris Aitken
The Web Hub Designer and Programmer
Phone : 02 4648 0808
Mobile : 0411 132 075
 
-
 
Making The Web Work The Web Hub
http://www.thewebhub.com.au/
[EMAIL PROTECTED]
 
-
 
Confidentiality Statement:  
This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEDGED and CONFIDENTIAL.  If you are not the 
intended recipient, dissemination of this communication is prohibited.  
If you have received this communication in error, please erase all 
copies of the message and its attachments and notify us immediately.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Malformed Email Date Header

2007-07-25 Thread Chris Aitken
Hi All,

 

Just a query I have which by the looks of my research into it online, still
exists on various installations around the world.

 

The websites I build for my clients are scattered over several hosting
servers, and I've noticed that one of them has an issue with the usage of
the mail() function.

 

The sever is running PHP Version 4.4.2 under Windows NT Server 5.2 build
3790.

 

Whenever I use mail() to send an email out via a website, it goes out not a
problem, but in the email program, the date received is around 10 hours
ahead. This causes my clients much grief, especially those who have shopping
carts and large numbers of emails and have the incoming emails listed all
out of order because of the future date stamp.

 

After digging into this somewhat, I had a friend of mine on a freebsd box
got me to email him from one of the scripts, and his *nix mail filtering
software hiccuped on the incoming message complaining that

 

X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char B8 hex): Date: Wed,
04 

Jul 2007 10:11:39 \2701000\n

 

Now, he sent me the headers of the email that he received, and the Date: 
line in the headers was showing up as the following

 

Date: Wed, 04 Jul 2007 10:11:39 ?1000

 

With a ? before the 1000, which, but looking at all the other entries for
the date in the headers, they all appear with the correct +1000 in place.

 

Has anyone come across this or know of a reason why this is happening on
this particular server. I have other hosting accounts on other windows and
linux PHP boxes which do not have this issue. Just one this one server.

 

 

 

Regards

 


Chris Aitken
The Web Hub Designer and Programmer
Phone : 02 4648 0808
Mobile : 0411 132 075

 

-

 

Making The Web Work The Web Hub
 http://www.thewebhub.com.au/ http://www.thewebhub.com.au/
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]

 

-

 

Confidentiality Statement:  
This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEDGED and CONFIDENTIAL.  If you are not the 
intended recipient, dissemination of this communication is prohibited.  
If you have received this communication in error, please erase all 
copies of the message and its attachments and notify us immediately.

 



[PHP] Mozilla/Opera issue

2007-02-20 Thread Chris Aitken
Hi All,

 

I am clutching at straws here, but I have come across an issue that I don't
know whether it's a PHP problem in my coding, or HTML, or something entirely
different but I've never seen this happen before, and this list has always
helped me out in the past with odd problems.

 

I am developing a site at the moment which is causing a very unusual trait
in both mozilla and opera browsers.

 

http://www.reedsandmore.com.au/index2.php

 

For example..

 

*   Click on Clarinet Reeds  More
*   Click on Bb Clarinet Reeds
*   You will see the first page showing the first 12 items (hopefully it
will)
*   Scroll to the bottom and click on Next
*   Look at the page that gets refreshed... it's the first page again.
Yet in the URL it shows the URL for page=2
*   Now to actually bring up page 2, you can click on RELOAD, or simply
click on Next at the bottom of the screen again. This will bring up the
proper page 2.
*   Now do the same to bring up page 3. Same thing occurs. Page 2 is
re-displayed, and page 3 will not come up until you click on Next again, or
click on RELOAD.
*   The same thing happens in reverse back down through the pages.

 

If anyone can point me in the right direction of this or if you have come
across this in the past, please any assistance would be greatly appreciated.
The code is valid to XHTML 1.0 Transitional as my initial thought was that
something wasn't valid.

 

Any help will be appreciated.

 

 

 

Regards

 


Chris Aitken
The Web Hub Designer and Programmer
Phone : 02 4648 0808
Mobile : 0411 132 075

 

-

 

Making The Web Work The Web Hub
 http://www.thewebhub.com.au/ http://www.thewebhub.com.au/
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]

 

-

 

Confidentiality Statement:  
This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEDGED and CONFIDENTIAL.  If you are not the 
intended recipient, dissemination of this communication is prohibited.  
If you have received this communication in error, please erase all 
copies of the message and its attachments and notify us immediately.

 



[PHP] Apache2 and PHP4.2.3 - errors

2002-10-02 Thread Chris Aitken

Hi all,

I have recently upgraded to apache2 on my FreeBSD 4.6 box, and the upgrade 
worked well, the daemon was running and serving pages etc. So I installed 
the latest PHP build in my ports tree (4.2.3) and it compiled no problems, 
but when I added the required lines into my httpd.conf to make it run, I 
get the following error when I try and start apache

# apachectl start
Syntax error on line 273 of /usr/local/etc/apache2/httpd.conf:
Cannot load /usr/local/libexec/apache2/libphp4.so into server: 
/usr/local/libexec/apache2/libphp4.so: Undefined symbol pthread_getspecific


now line 273 of my httpd.conf file is
LoadModule php4_modulelibexec/apache2/libphp4.so

And that file exists, so I really dont know what the problem is.

Any help on this would be greatly appreciated.



Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Compiling PHP with GD2.0 ?

2002-01-07 Thread Chris Aitken

Hi,

I have just upgraded my system (FreeBSD4.4 box with Apache/PHP/MySQL) and I 
want to use GD2.0.1 with PHP.

I have installed GD 2.0.1 from /usr/ports onto the system so the package is 
actually there, but I have no idea how to compile GD2 ability into PHP. If 
anyone can lend some assistance it would be appreciated.

I really want to be able to use the ImageCopyResampled() function.


Thanks


Chris


---
CDR - Crowley Digital Reproductions - Hard Rock  Heavy Metal CD Bootlegs
http://crowley.thegatesofhell.org/cdr/

My ICQ # is 1096929


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] textarea, carriage returns and formatting

2001-11-20 Thread Chris Aitken

Hi,

Something ive been trying to find out but cant seem to get the wording
right to find the answers in the archives.

What I have is a mysql database, and in that DB I have a field which is
just a 'text' field. What I want to be able to do is write whatever text
is typed from the webforms textarea into the 'text' field, formatting in
tact. For example if this was typed into a textarea

--
This is some text ive typed
I have some single and double

carriage returns in there, and I
want it to keep the formatting
--

When I pull it back out of the DB, I want to be able to display it back in
a textarea with the carriage returns in place exactly as it was typed in.

Can anyone point me in the right direction. Is there a php function which
can convert/reconvert on the display from/insert to the database, or am I
missing something totally with this.


Thanks



Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] GD 2.0

2001-10-18 Thread Chris Aitken

Just wondering if anyone has managed to install GD 2 on their system. I
have been trying to play with image manipulation on my FreeBSD4.3 box
using PHP, and it tells me that I need GD 2 installed to use image
resampling, but even after ive updated my ports tree, it still only had GD
1.8


I cannot seem to get to the actual GD site so im not sure whats up there,
but has anyone else installed GD 2 and if so, any suggestions on whats the
best way to go about it would be appreciated.


Cheers


Chris



--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
  # ln -s /dev/null /bin/laden
  If you don't like my typing, all flames to /bin/laden


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Getting an Email into a PHP/pl script

2001-10-04 Thread Chris Aitken

Hi all,

I have looked into the archives but im not sure what im searching for so I 
decided to ask here.

What I want to do is, on my FreeBSD box running PHP and MySQL, to have a 
system which will take any email sent to a specific address, and pipe the 
body of the email to PHP (or even to a perl script). Once I have the body 
of the email as a variable, I can do all my parsing and extracting etc to 
do with it as I need, but im baffled on where to start looking to get this 
done.

Any help would be greatly appreciated.



Cheers


Chris



 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
It is said that if you line up all the cars in the world end to end,
  some moron in a rotary will still to try and pass them


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ereg checking if its only numbers

2001-10-04 Thread Chris Aitken


Ive been playing around with ereg for about half an hour and having no joy 
because I dont really understand the medhod behind it and how it all works. 
But what im trying to do is check to see if a 9 digit string is all numbers 
and nothing else

$string1 = 123456789
$string2 = 123456abc


how would I check either string with an IF statement and make it continue 
on string 1 (ie, all numbers) and error on string 2 (not all numbers).


Any suggestions ?



Thanks


Chris

--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
It is said that if you line up all the cars in the world end to end,
  some moron in a rotary will still to try and pass them


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Spawning an Expect Script

2001-09-23 Thread Chris Aitken

Hi all,

Is there any tips you can point me at on spawning off an Expect script with 
agruments. Here is a sample of the command I want to be spawned.

/usr/local/bin/expect /location/of/script.exp arg1 Arg Number 2

I would also like it to be able to report the output of the expect script 
back to the browser when its called.


Any suggestions ?



Thanks


Chris

--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] script waiting for an output

2001-09-09 Thread Chris Aitken

Hey all,

Ive got a bit of a curly one I haven't been able to work out yet... Here is 
the scenareo

I have a GSM Modem sitting on the serial port of a FreeBSD 4.0 box. It has 
some software running which basically conrols the GSM modem.

When I use it command line, I issue it the command and it does its stuff 
and outputs me some data so I know its outcome (whether it was successful 
or not depends on what is output).

This is fine because I can make the script wait for the output from the 
spawned command when I do it via PHP.

The question is, whenever an SMS message comes into the GSM modem, it 
outputs some more text. Now.. if in sitting in console on the box, it comes 
up on my screen. What I want to be able to do is, whenever a message comes 
into the GSM modem, somehow detect it, fire off a PHP script I will write, 
and do whatever it needs to do with it.

I just dont know how to go about waiting for some form of output in 
FreeBSD, when it happens fire off a script.



I dont know if what im talking about makes sense, or is even doable, but if 
anyone has any ideas or suggestions it'd be appreciated.



Thanks

Chris


--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] newbie : how to access functions in seperate files???

2001-09-02 Thread Chris Aitken

At 10:15 PM 2/09/2001, Aaron Moore wrote:
Its obviously not finding it... my question is why the includes don't
work???

Thanks


Are you 100% positive that the get_total() function is defined in your 
functions.php file ?

Check it, make sure there is no typos because this seems synonymous with a 
function not being in an included file anywhere, or having a typo in the 
function name defined.



Chris


--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP / MySQL Hosting Charges

2001-08-23 Thread Chris Aitken

Hi All,


Just a quick non-technical question.

I live in Australia and a friend of mine has a website hosted here in Oz, 
and he pays his set amount per month which simply is for Hosting, cgi-bin 
and log file access for his website.

Hes wanting to have the ability to use PHP and MySQL on his site and his 
provider has quoted him the cost to add to his current monthly charges to 
give him a MySQL username/password/database and PHP ability.

Both he and I feel its a bit pricey for what they want to charge so I 
figured I would ask the list to see what other people consider a reasonable 
price to add PHP and MySQL access to his current www/cgi-bin/logs website.

I wont mention the prices hes been quoted yet because I want to see some 
uninfluenced posts.


Cheers in advance.



Chris


--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Sorting IP Address Data

2001-08-22 Thread Chris Aitken

Hi all,

Just a quick one,

I am pulling a whole Class C list of IP addresses, and im trying to sort 
them in order, but im getting it displayed

127.0.0.1
127.0.0.10
127.0.0.100
127.0.0.101
127.0.0.102

etc. Is there any other way to sort this thinking they are numbers, rather 
than text ?


Thanks


Chris

--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Strings with Spaces in URLS

2001-08-21 Thread Chris Aitken

I have come up with a bit of a problem

I have a little funky search form on a page, and when I send the search 
data on as a URL, anything with a space is screwed up example

 $search = This is a test;
 echo a href=http://www.blah.com/foo.php?search=$search;

and when the link is clicked (or even when the mouse is put over the link), 
the URL in the browser is -

 http://www.blah.com/foo.php?search=This

leaving out all words after the first space.


If I simply throw the while thing using the following header statement
 header(Location: http://www.blah.com/foo.php?search=$search;);
then it brings it up properly in the browser.


Any suggestions ?


Cheers


Chris


--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Directory Listing in an Array

2001-08-20 Thread Chris Aitken

Hey all,

Just something I havent been able to sort out in the archives, but what im 
wanting to do it this. Do a listing of all files in a directory, and load 
up an array with each returned filename.

Am I pissing into a windy pipe dream or is there a simple solution for this ?



Cheers


Chris


--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Compiling with Imlib2

2001-08-15 Thread Chris Aitken


Hey all,

Just a quick one which is driving me a tad mad at the moment Im trying 
to compile PHP 4.0.6 to have imlib2 in it, and in the php_imlib doco, it 
tells me to add the following flag to it the ./configure

--with-imlib[=/path/to/Imlib2]

Now the problem is, I dont know what to put in as the path to Imlib2 here. 
Im installing it on a FreeBSD 4.3 box, with apache 1.3.20

can anyone point me in the right direction ?


Thanks


Chris



--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Compiling with Imlib2

2001-08-15 Thread Chris Aitken

At 11:49 AM 16/08/2001, David Robley wrote:

Presumably you'll need to install inmlib then point to where-ever you
installed it?

Okay... my bad... I probably should have mentioned ive already installed 
imlib2 from ports and after rebuilding the locate database, shows the 
entries for imlib2 as follows

/usr/X11R6/bin/imlib2-config
/usr/X11R6/include/Imlib2.h
/usr/X11R6/lib/libImlib2.a
/usr/X11R6/lib/libImlib2.so
/usr/X11R6/lib/libImlib2.so.1

And thats it as far as files with 'imlib2' or 'Imlib2'

Which is why im confused about the location of imlib2 for the compile of php.



Chris


--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Imlib Errors Still

2001-08-15 Thread Chris Aitken

Okay,

Im really having a hard time with imlib2 and php. There is so little 
documentation on this so I dont know what im doing

Firstly When Imlib2 is compiled into PHP, how do I know (like should 
there be an entry in phpinfo() )

Secondly Whats the easiest way people have installed imlib2 into PHP. 
Im trying the way the (very small) INSTALL file says that comes with 
php_imlib but doesnt seem to want to make it work.


Any help would be greatly appreciated.



Chris



--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Weekly Separation

2001-07-18 Thread Chris Aitken

Hey all,


Im working on a system to be able to take a big list of entries that is 
sorted by a date field, and be able to identify them into weekly groups 
(monday to monday or sunday to sunday etc).

So basically, for the example here, say I had 100 entries over a 1 month 
period. What I want to be able to do is, as the 'while' loop is running, 
every time a weeks worth of entries passes it does some defined task 
(alternate colour, insert a line break or whatever).

Ive been working on a way but it seems a very long and involved method. Has 
anyone got any pointers or ideas they might be able to throw at me so I can 
make this a more simple method.



Thanks


Chris


--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP based statistics/Graphs

2001-07-17 Thread Chris Aitken

Hi everyone..

Just wondering if anyone can suggest any methods, or even pre-made packages 
which can be manipulated to show various statistics, charts, graphs etc on 
a whole range of things.

What im looking to do is run a whole bunch of statistics pages for where I 
work. Client stats, plan popularity, monthly income etc etc.

Just doing some research and figured you guys are the best place to get 
some info.



Cheers


Chris



--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] .htaccess logout sequence

2001-06-20 Thread Chris Aitken

Hi All.


I have a query which has confused me a bit. I have a database setup where I 
use htaccess (using apache/php/mysql on a freebsd 3.4 box) to grant access, 
then it grabs the users info from the database, sets a cookie and pretty 
much lets the system know whos doing what on the db.

What I do want to do however is have the facility to have a logout option 
where it ditches all info about the current logged in user, fires them back 
to the start of the system and re-requests the htaccess login window.

My past attempts have failed miserably so I thought I would ask around and 
see if anyone else has had any success (without changing to a different 
method of auth :)


Cheers


Chris



   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

 If the foo shits, call your sysadmin




Re: [PHP] Multipe Tables, Single Query Problem

2001-06-19 Thread Chris Aitken

At 01:57 PM 6/06/2001, you wrote:
Hi all,

I have three tables in my (mysql) database:

videos - ID, title, description, etc..
links - ID, videoID, actorID
actors - ID, name, dateofbirth, gender, etc...

what i need to do is return a particular video and all it's staring actors
with just one query returning just one row, ie. with all the actor names in
one field... is this possible? or do i have to get the video data first and
then the actors separately?


$count=0;
$query = select actors.*, videos.* from actors, videos where videos.ID = 
'$ID' and videos.ID=actors.actorID order by actors.name;
$result=mysql_query($query);
while (mysql_fetch_array($result)) {
if ($count0) echo Movie Title: $display[title] - $display[desc]P;
echo Actor: $display[name] - DOB: $display[dateofbirth] etc etcBR;
$count++;
}



This is how I do it anyway. Make an incrementing value, and the if 
($count0) line basically says to display the title once, and skip it for 
every other entry. Chances are the query would need tweaking but the 
principle is there to get data from all needed tables in 1 query, then set 
the loop to display the needed data from the 1 query.

There is probebly a more efficient way of doing it, but thats how I do it 
anyway.



Chris




[PHP] Funky PHP Stuff

2001-05-23 Thread Chris Aitken

Just wondering if anyone has come across a collection of weird and 
wonderful stuff done with PHP. I have a site which people have the option 
to display strange things whenever they log in, and currently I have a 
random quote generated from the fortune script on FreeBSD, plus a weird 
script which tells the time in plain engligh (It's almost half past eight) 
etc. But im looking for some other bizarre things which really dont do much 
except entertain and make people wonder but why ? :)


Cheers


Chris


--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

 If the foo shits, call your sysadmin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Something like, but not Webexplorer

2001-05-09 Thread Chris Aitken

Hi guys,

Just a quick question.

Has anyone found an alternative to the Webexplorer system that works well ?

Im just looking to have a system which will allow me to control files from 
within a directory, and all subsequent subdirectories. There are issues and 
bugs ive come across with webexplorer that it isnt a viable option.

Any suggestions ?



Chris





--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP based Reminder System

2001-05-06 Thread Chris Aitken

Hey all,

Im just wondering if anyone has come across a PHP based system which allows 
people to log in, and set reminders for themselves, and at the time 
specified, emails them the reminder ?

I know a system could be written utilising cron/php/sendmail etc but I was 
thinking that maybe a system has already been written doing this.


Cheers


Chris





--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Keyboard Hotkeys

2001-05-03 Thread Chris Aitken

Hey guys,

Just a quick quesiton I was asked by someone here at work for a database im 
working on. Is there any system which people have been able to utilise 
Javascript or another method to map out a keyboard shortcut to do 
something. Either making it process a submit button to a PHP script, or 
simulate a click to a link which is on the page.

Im not confident of a yes response, but I figured I would ask just incase.


Cheers


Chris



--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Incrementing a String Name

2001-04-22 Thread Chris Aitken

Hi

Just a quick puzzle I cant seem to get around at the moment...

Im trying to create a loop that increments the string name by a digit. For 
example, if I had the following 4 strings submitted to a script.

$name1
$name2
$name3
$name4

What I want to do is create a while loop that will print out the above 4 
strings, incrementing the number part of string automatically.

while($count4) {
 $count=$count+1;
 echo"$increased_string_name\n";
}

But I just cant seem to work out how to increment the string name to 
display it.

Any assistance on this would be great. I have a feeling that there is a 
better method of attacking this but im only new to PHP and dont know it yet.



Thanks


Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] redirection to another page function

2001-04-22 Thread Chris Aitken

At 11:15 PM 22/04/2001, Christian Dechery wrote:

Yeah... I know that... but, c'mon... a browser that doesn't support 
Javascript can't surf trough at least 30% of all websites... it's the 
absolute minority. Netscape itself is a minority.

While its true Netscape is a minority, and browsers not allowing Javascript 
are an even bigger minority (Bigger Minority. Military Intelligence 
Microsoft Works ?), I think Jasons point was more to show that its best to 
use an option which will work on all environments if possible. Sure, the 
Javascript system will work, but the header() function works better.

Surely its better to write your code trying not to exclude any user if at 
all possible.



Chris




--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Lynx, Cron and PHP

2001-04-19 Thread Chris Aitken

I have a PHP script which runs a query, and emails the results to me. I am 
trying to make Cron run this script.

I can get it to launch my PHP script and it emails me fine, but the problem 
is  lynx gets caught up in a loop and it doesnt kill off after running the 
script.

Is there something I need to add to my cron entry, or do I need to force 
some sort of death via the php script ?


Thanks


Chris




--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Importing Data from Text File

2001-04-17 Thread Chris Aitken

Hi Everyone,

Ive been asked to do a task here at my work and its something ive never 
done before. I was hoping you guys could point me in the right direction so 
I can research some more and discover how in the hell im gonna do this :)

Basically, I have been issued a TAB delimited text file which I need to 
process and insert all the data into a table. Here is a basic example of 
what I need to do..

Say the text file had the following lines (thousands of them, 1 record per 
line)

Screw   Big 12  200 1.99
Screw   Big 10  400 1.50

And I wanted to import each line into a table (Mysql DB) that had 6 fields 
(5 for each of the above plus an autoincremented ID field

stock_id
stock_name
stock_desc
stock_length
stock_qty
stock_price


Any suggestions and direction pointing will be greatly appreciated.




--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Weird Messages upon install upgrade

2001-04-13 Thread Chris Aitken

Hi All,

Ive just run into some bizarre problem. I upgraded to a more recent
version of PHP and have run into some bizarre problem.

We were running version 4.0bsomething on a FreeBSD box with Apache and ive
just installed 4.0.3pl1 and ive managed to get pretty much everything
working, except for a couple of sites ive designed im coming up with some
weird errors on functions which  otherwise have been working fine. They
only started appearing when I upgraded the version of PHP.

Here is the errors im getting when I call the page.

---

Warning: Missing argument 2 for stripe() in /location/to/included/file.php on line 257
Warning: Missing argument 3 for stripe() in /location/to/included/file.php on line 257

---

Now, line 257 looks like this (ive included the rest of the function, but
the first line is line 257)

---

function stripe($title,$bgcolor,$fgcolor) {
global $darkcolor, $lightcolor;
if (!$bgcolor  !$fgcolor) {
$bgcolor="$darkcolor";
$fgcolor="$lightcolor";
}
?
table BORDER=0 WIDTH="100%" BGCOLOR=?echo($bgcolor)?trtd
bfont color=?echo($fgcolor)? size=+1 FACE="helvetica,arial"nbsp;
? echo($title) ?/font/b/td/tr/table
?

}

-

This isnt the only function which is causing me problems but this is the
smallest one for an example.

Is there something I havent compiled into PHP properly? or can there be
something else?

Any help on this would be greatly appreciated.



Thanks


Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Calling Functions without all the arguments

2001-04-13 Thread Chris Aitken

On Fri, 13 Apr 2001, Chris Aitken wrote:

---

Warning: Missing argument 2 for stripe() in /location/to/included/file.php on line 257
Warning: Missing argument 3 for stripe() in /location/to/included/file.php on line 257

---


Okay, ive managed to do some more playing, and come up with some more
info.

The above error only shows up when I have a function being called without
all the arguments filled in.  For example, if I have a function as
"function blah($foo,$bar)" and call the function with both $foo and $bar
set, it will run just fine. But if I call it with only $foo it comes up
with these errors.

The thing is, the previous version of PHP must have alowed me to call
functions without all the arguments and it never batted an eyelid or gave 
an error.

My question is, is there something I didnt compile into the new PHP, or is
there a line in php.ini file I need to modify so that it doesnt show these
errors up (or should I adjust my code so that I dont call functions
without all the arguments) ?



Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Calling Functions without all the arguments

2001-04-13 Thread Chris Aitken

On Fri, 13 Apr 2001, Hardy Merrill wrote:

I found the same problem - when we upgraded to PHP4, function calls
that used to work and NOT provide all the parameters, started failing.

The way I fixed it was to give each parameter a default value *IN*
the function definition, like:

function abc($a='', $b='') // assigns null as parameter defaults

that way, every parameter gets a value, even if all the parameters
were not supplied in the call.


This works great (thanks for that :). However my question now is, what is
the general opinion about how to handle this. 

Is it better to call functions giving all arguments values (even if its an
empty "" value) or is it fine to assign values from within the function as
described above ?



Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Calling Functions without all the arguments

2001-04-13 Thread Chris Aitken

On Fri, 13 Apr 2001, Rasmus Lerdorf wrote:

If a function has not been defined to take optional arguments, then you
*must* provide these arguments when you call the function.  The fact that
previous versions of PHP incorrectly let you do this was at best an
undocumented misfeature, but more likely a bug.


Yeah, I kinda figured it would have been some sort of oversite with the
beta version we were running. I pretty much started learning PHP using
this install of PHP4 so I guess I picked up some bad habits learning along
the way becase the install of PHP never stopped me, so I never  knew there
was a problem and never investigated my code.


Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] page counter

2001-04-10 Thread Chris Aitken

At 12:28 PM 10/04/2001, you wrote:
Hi wen,

Make sure that the counter file is readable by the user apache or user
nobody which ever is your default webserver user. If it is not then just
chown it to nobody or chmod it to 777 and you are done.


The catch 22 is..

If you want security then its best to change the ownership to be the same 
as the webserver. But the problem is, if you dont have root permissions on 
the box, you cant change the ownership (or if you can, you cant change it 
back once its done).

I have root access on the machines I work on so its not a problem, but a 
regular user may not have this ability to change it.


Chris



--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Curious

2001-03-27 Thread Chris Aitken

At 06:04 PM 28/03/2001, you wrote:
Hi,

I am curious to know why you need to use the /n, and what it actually does,
because I had a page that used them, and i removed them all and it still
works fine.

As far as the HTML output, it wont affect how it shows up on the screen, 
but if you look at the HTML code, you will notice everything is on 1 
big-ass long line.

Using a /n at the end of an echo or print statement will put a carriage 
return at the end so your HTML code is more pleasant to view and makes it 
alot easier to view when you are trying to work out any problems in HTML 
layouts.


Also, is it seen as good or bad practive to use \" only when required or all
the time.


My general rule of thumb is to use \" whenever I need a "

in general, I avoid using quotes where possible (such as in the following)
font size=3 face=Arial (instead of font size=\"3\" face=\"Arial\")

But for things like ALT tags, I use \" because spaces are required in the 
value of the ALT tag.



Chris




--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] parse error on line after last one???

2001-02-27 Thread Chris Aitken

At 06:31 PM 27/02/2001, Jaxon wrote:
Hi all,

Can anyone tell me why Im getting an unhelpful error when trying to pull up
a file?

The index.php Im calling is including a functions file  functions.inc.php

Im getting a parse error on line 144  but functions.inc.php only has 143
lines...!

does this actually mean anything, or is it just poor error reporting??


Chances are, you are missing a } closing off something in that file, and 
its assuming that  "well, if you havent closed it off yet, you need to 
do it at least by the last line" so its assuming that you need to add in a 
line 144 with a closing }

in reality, it means you have to go back into your functions.inc.php and 
see where you are missing the } and the error should go away.



Chris


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Forcing htaccess login again

2001-02-26 Thread Chris Aitken

Now im even getting more confused. Ive been doing some more research into 
the subject, and cant seem to find any answers.

All of the PHP documentation about headers() talks about auth via PHP, but 
doesnt mention anything about htaccess as the auth system.

On my main.php screen, this is where the cookie gets set once the user logs 
in with htaccess. What im trying to do is incorporate a section into 
(possibly) main.php which forces the htaccess to rerequest login again 
using my .htpasswd password file as the criteria.

Is there some sort of header information which will make the webserver turn 
around and say. "Hey, you shouldnt be here anymore, login again and I 
might think about letting you in"

Because once I can get the user logging in again, it will go to the rest of 
main.php and unset/reset the cookie with the new user.


Scratching my head.



Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Forcing htaccess login again

2001-02-26 Thread Chris Aitken

At 12:26 AM 27/02/2001, Sander Pilon wrote:
The request for a password is usually generated by a 401 header. Just do
this -

Header("WWW-authenticate: basic realm=\"Some realm\"");
Header("HTTP/1.1 401 Unauthorized");
exit;

That should pop up a box. Just make sure you check the values of
$PHP_AUTH_USER/PW first before presenting those headers.


I have tried this, and all it keeps doing is reasking for the U/P until the 
3rd time and errors me out. I checked the $PHP_AUTH_USER/PW and both 
display my own username and password, but when I enable the above lines it 
just keeps asking for a u/p

where does the above try and verify the password from ?
The initial .htaccess request authenticates from a htpasswd file held in 
the root dir of the user on the server. How can I make the above lines read 
from this htpasswd file to authenticate a new user/pass ?



Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Logging out a user

2001-02-25 Thread Chris Aitken

Okay, I got a bit of a curley one that I havent been able to solve by 
looking at the archives and in the manual. Its kind of a PHP/Apache question.

I have a system where a user logs in through .htaccess, it queries my mysql 
database, sets a cookie which logs their username and access level number.

What I want to be able to do it this.. Give the option to "Log Out" 
which will clear the cookie, and also make htaccess re-request a login. 
Once it logs in again, the current scripts do their thang and log the new 
user in.


Is there any direction anyone can point me to start looking cause I have a 
feeling im off the track on what im searching for in TFM and in TFA.



Chris


--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Mathematical prob

2001-02-12 Thread Chris Aitken

Okay, im a little stumped. I have been asked to use a formula which 
calculates Monthly Repayments on a mortgage loan. The formula I have been 
given is

M = P * ( J / (1 - (1 + J) ** -N))

My problem is, the last part. It explains it in english as "then take that 
to the -N (minus N) power"

My problem is, I have no idea how to put this into a PHP script so that it 
can calculate it out. I have a feeling im falling short at the "to the 
power of" part. I tried to do a 3 to the power of 3 calculation and I cant 
get it to spit out 27 like I know it should.

Any suggestions ?


Thanks


Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Directory Listing with PHP

2001-02-01 Thread Chris Aitken



(Damn I hate it when I forget to change the subject)


Does anyone have, or know of a script which simulates what Apache gives out 
when it shows the entire contents of a directory ?

I find it very handy to use the directory listing of say graphics 
directories and the like, but I dont want others looking into them.

What I thought would be a good system is to have an index.php file which 
asks for a password. If the password is accepted, it shoots them off to a 
php script which displays the contents of the DIR just as apache would.

This way I can bar viewing of the directories contents, only viewable to 
the owners of the password.


Ive seen a couple of scripts which claim to show the directory listing, but 
none of them seem to work any good with a decent layout and amount of file 
info. So im looking for a script which can display the listing properly. 
Does one exist, or am I just relieving myself into the wind ?


Thanks

Chris

--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] E-mail valid

2001-02-01 Thread Chris Aitken



Does anyone have, or know of a script which simulates what Apache gives out 
when it shows the entire contents of a directory ?

I find it very handy to use the directory listing of say graphics 
directories and the like, but I dont want others looking into them.

What I thought would be a good system is to have an index.php file which 
asks for a password. If the password is accepted, it shoots them off to a 
php script which displays the contents of the DIR just as apache would.

This way I can bar viewing of the directories contents, only viewable to 
the owners of the password.


Ive seen a couple of scripts which claim to show the directory listing, but 
none of them seem to work any good with a decent layout and amount of file 
info. So im looking for a script which can display the listing properly. 
Does one exist, or am I just relieving myself into the wind ?


Thanks

Chris

--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Levels of Access

2001-01-17 Thread Chris Aitken

At 10:36 PM 17/01/2001, you wrote:
Hey Guys,

I wonder if anyone can shed light...
I have a system that internal users access -

I have separated access levels into 1, 2, 3 etc.  So if you have access 1
you can view certain things - If you are 2 then you can view more or other
things.

However the problem arises when someone in access level 1 wants to access a
level 2 function.  I then manually specify that:

if (access = 2 or user=joe) {
Allow the functions ...
}

This can get messy - as individuals will be specified all over the place on
a large system to override levels of access.

Is there a sensible standard that is used to have levels of access but
special people can access certain higher level functions.?


Why not have a database with all usernames/passwords/access levels in 
there, and when the user logs in (either with htpasswd or a form login 
script system) that info is recorded by a cookie.

Than have a function which is at the start of every page which passes the 
access level of the user, and which levels can access the page. Say there 
was 5 levels, you could call the function this way

auth_user("$access_level","N","N","Y","N","Y");

The function just needs to grab the first variable as the users given 
access level, then the next 5 variables state whether levels 1 thru 5 are 
allowed to view the page (only level 3 and 5 can view it in the above 
example). If the users access level returns a Y for its corresponding 
level, then its allowed to proceed, otherwise they are shuffled off to a 
page telling them to (nicely) go away.

I dunno if this is a clutzy way of doing it (chances are it is) but thats 
how I would try and implement it, and you can also create a nice simple 
admin screen system to maintain all users and access levels. Change it in 
the DB and its instant on all pages.




Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Extracting Data from a URL output

2001-01-17 Thread Chris Aitken

I have a bit of a question which ive tried to look into, but I cant seem to 
find the right commands to check into or what the best method of attack it.

Basically, I want to grab a URLs data, make the data a string (which im 
doing with fopen and fread).

But now I have the entire html as a string, Im confused as to how I best 
attack stripping just the data I need out of it. There is alot of stuff at 
the top of this particular page before the actual content starts.

Is there anyone who has some examples of how they have attacked this type 
of task, or even just point me in the direction of how to start ?

I have tried to utilise strstr() but because there is no real comon thread 
starting off the data I need, I cant really use it properly.


There is always a common word in the data (its a local weather output).

For example, today it was -

...size=4 color=whiteTodays weather will be 28 degrees in Sydney/font..

with a whole bunch of other site crap up the top. What im trying to do is 
simple extract everything between the  and the  wherever the word weather 
appears (its the common word) and its totally baffling me.



Any help would be great.



Chers


Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] I love/hate FrontPage - need another HTML editor.

2001-01-16 Thread Chris Aitken

At 09:06 PM 16/01/2001, Kath wrote:
Hey,

To get Frontpage to recognize PHP files (at least to let you edit them), do
the following (I'm assuming FP2000):

1 - Open FP
2 - Click on Tools
3 - Click on Options
4 - Click on the Configure Editors tab
5 - Hit Add
6 - Make file type "php"
7 - Make editor name "FrontPage"
8 - Make command "frontpg.exe"
9 - Hit ok
10 - It should work :D


There is a much easier and simpler way to handle Frontpage and PHP than this ..

1 - Open Control Panel
2 - Open Add/Remove Programs
3 - Click on Frontpage 2000
4 - Click on Uninstall
5 - Uninstall
6 - Click on Start
7 - Click on Run
8 - Type 'Notepad'
9 - Press Enter
10 - It DOES work :)


A much more realistic windows solution in half the time (and about a 
thousandth of the HD space :) You can add in a Step 11 if needed which is 
to Slap yourself over the wrist 5 times for wanting to use Frontpage in the 
first place.




Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]