Re: [PHP] php/osx and firebird

2005-05-05 Thread Gabriel Guzman
James wrote:
I've attempted to access a firebird database living on an osx/apache/php 
machine.

How do I enable those functions?  I've looked at the php documentation 
(http://uk2.php.net/manual/en/ref.ibase.php )

"To enable InterBase support configure PHP --with-interbase[=DIR], where 
DIR is the InterBase base install directory, which defaults to 
/usr/interbase."
I've tried to add:
--with-interbase=/Library/Frameworks/Firebird.framework/Resources
to my php.ini and it didn't work.
James... this is talking about configuring the php compile, not a 
setting in php.ini

so, for example if you just downloaded php-4.3.11.tar.bz2 from the 
php.net website, and un zip/tarred it, you would run the configure script:

./configure --with-interbase[=DIR] (plus any other compile time options 
you need)

then compile and install php (make, make install)
Am I pointing to the wrong directory?  What other configuration/setup do 
I have to do to enable php's interbase functions?
this is a "compile time" option, and not a php.ini one.
hth,
gabe.
p.s. you can see what current compile time options are by looking at the 
output of phpinfo()

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


Re: [PHP] if then else statement not working

2005-05-05 Thread Gabriel Guzman
Anasta wrote:
What am i doing wrong here, the output is always 'empty'


  if (seatnum == seat1) {
echo username;
} else {
echo 'empty';
}
?>
mysql_query() returns a resource, not the results themselves.
read: http://us3.php.net/manual/en/function.mysql-query.php especially 
the 2nd example to see what else you need to do to get to your results.

hint:  mysql_fetch_assoc()
have fun,
gabe.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Gabriel Guzman
On Monday 05 April 2004 04:00 pm, Matthew Oatham wrote:

> I don't think the fleet_id example will be a problem
> though as this is retrieved from the database where the field is an int.

google for "SQL injection" and you will see why what you currently have may 
cause you some problems. 

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



Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Gabriel Guzman
On Monday 05 April 2004 04:00 pm, Matthew Oatham wrote:
> Yes I agree I need some validation, dunno whether to do server or client
> side validation.

*both*  :) 
 
you should always do server side validation on any data, especially if you are 
going to be putting it into your database.   Client side validation, can be 
helpful to the user, but is easy to bypass. 

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



Re: [PHP] simple image manager app?

2004-04-01 Thread Gabriel Guzman
On Thursday 01 April 2004 09:41 am, Jeff D. Hamann wrote:
> I often travel and would like to be able to upload digital photos to my
> server (either using a simple multiple file upload (one that I can select
> multiple file using the windows file dialog, or some other method that's
> idiot proof) and simply save them to my hard disk, or to a mysql database.
> Is there a simple set of scripts available for that? I've searched the web
> and only found lots of references to "how to build a huge table with a
> bunch of browse... buttons to select single files at a time to upload
> images in an array which doesn't seem like a meaningful solution. I haven't
> been able to figure out how to allow multiple selects in the windows file
> dialog box either. Is that possble using php and the html forms?

especially neat is their Java application for uploading images to your site.  
this soves the "multiple selects" problem.  

gabe. 

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



Re: [PHP] simple image manager app?

2004-04-01 Thread Gabriel Guzman
On Thursday 01 April 2004 09:41 am, Jeff D. Hamann wrote:
> I often travel and would like to be able to upload digital photos to my
> server (either using a simple multiple file upload (one that I can select
> multiple file using the windows file dialog, or some other method that's
> idiot proof) and simply save them to my hard disk, or to a mysql database.
> Is there a simple set of scripts available for that? I've searched the web
> and only found lots of references to "how to build a huge table with a
> bunch of browse... buttons to select single files at a time to upload
> images in an array which doesn't seem like a meaningful solution. I haven't
> been able to figure out how to allow multiple selects in the windows file
> dialog box either. Is that possble using php and the html forms?

check out gallery: 

http://gallery.menalto.com/

it is pretty easy to setup, and works very well, and is very easy to use. 

gabe. 

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



Re: [PHP] Slightly OT! PHP / HTML Editor for Linux

2004-02-04 Thread Gabriel Guzman
On Wednesday 04 February 2004 08:21 am, Burhan Khalid wrote:
> Shaun wrote:
> > Hi,
> >
> > I've just switched from Windows to Linux and don't want to change
> > back!
> > However I used to use Dreamweaver MX for all my PHP / HTML editing,
> > can anyone recommend a good alternative?
> >
> > Many thanks
>
> You could try running Dreamweaver MX under wine [ http://www.winehq.com ]

I would recommend getting comfortable with a nice unix text editor...  vi, for 
example.  

if that is too 'old school' for ya, then try something like jedit

if you are looking for a wysiwyg editor ala dreamweaver mx,  sourceforge.net 
might be a good place to look, that or google:  html editor linux

brings up a few promising links. 

hth, 
gabe. 

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



Re: [PHP] The PHP Problem

2004-01-30 Thread Gabriel Guzman
On Friday 30 January 2004 10:51 am, Ash wrote:

> How can I just write php in a text editor, save it as a .php, and view it
> in internet explorer, offline?

you have to install php.

http://www.php.net/manual/en/installation.php

gabe. 

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



Re: [PHP] Add Reply-To to this list(s)

2003-11-25 Thread Gabriel Guzman
On Tuesday 25 November 2003 09:51 am, Dave G wrote:


>   Telling people that they need to use proper email software and go
> about things in the way they don't expect 

which "they" are you refering to?  i expect my reply button to reply to the 
person who sent the initial message... not everyone subscribed to the list.  
so, luckily for me, does the admin of this list. 

> Computers, machines, systems, should match us, not us
> to them. 

and by not messing with the reply-to header, in this case, the systems does 
match me.  it's really just a difference of opinion, and I'm sure one that 
will always exist. 

> In any case, despite the difficulties, computers are much
> easier to change than people.

true. 

> I remain steadfast in my opinion that automatically replying to the
> list is a much more natural option.

and I remain steadfast in mine that automatically replying to the person who 
sent the message is a much more natural option.  

it's a no win situation, either way someone will be unhappy. 

gabe. 

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



Re: [PHP] looking for some software (helpdesk, intranet)

2003-11-21 Thread Gabriel Guzman
On Friday 21 November 2003 04:01 pm, Richard Baskett wrote:
> on 11/21/03 15:49, Chris W. Parker at [EMAIL PROTECTED] wrote:
> > I'm looking for some helpdesk software and some intranet software with a
> > MySQL backend.

RT...   http://bestpractical.com/

gabe. 

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



Re: [PHP] dir size

2003-10-03 Thread Gabriel Guzman
On Friday 03 October 2003 11:48 am, Robert Cummings wrote:
> On Fri, 2003-10-03 at 14:45, Jay Blanchard wrote:
> > [snip]
> > is it possible to count  a size of a dir and all sub dirs in php ? and
> > if,
> > how?
> > [/snip]
> >
> > $foo = exec("du -h");
>
> Hmmm this solution would appear to include the file sizes :D

man du  :D

gabe.

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



Re: [PHP] How to comment out chunk of html/php mixed code?

2003-09-15 Thread Gabriel Guzman
On Monday 15 September 2003 12:59 pm, Wei Wang wrote:
> hi,
>
> This may sound very newbie. But since html comment uses  which
> doesn't comment out the php code. And the php comment /**/ // apparently
> doesn't work on html. So how do I comment out a chunk of html/php mixed
> code?

probably the easiest way is to just do this: 




that way php will take everything inside the  tags and comment them 
out, regardless of if they are html or php or whatever. 

hth, 
gabe.

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



Re: [PHP] divide

2003-09-09 Thread Gabriel Guzman
On Tuesday 09 September 2003 05:04 pm, phpu wrote:
> yes but if the result is a number like this 34056983 i wanna display this
> number like this 34,056,983 Please help me with this one


that's exactly what number_format() does...  from the example on 
www.php.net/number_format :



that's all there is to it. 

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



Re: [PHP] PHP Interview questions

2003-08-27 Thread Gabriel Guzman
On Tue, 2003-08-26 at 11:35, Curt Zirzow wrote:
> * Thus wrote Richard Baskett ([EMAIL PROTECTED]):
> > on 8/26/03 9:57 AM, Robert Cummings at [EMAIL PROTECTED] wrote:
> > 
> > > This smells like a trick question... Are the switches connected to the
> > > same light bulb? You've only mentioned one light bulb? 8)
> > > 
> > > Cheers,
> > > Rob.
> > > 
> > > 
> > > On Tue, 2003-08-26 at 12:35, Jay Blanchard wrote:
> > >> Also ask a couple of other questions that require thought, but have
> > >> nothing else to do with code. such as...
> > >> 
> > >> In one room you have 3 light switches, each connected to one light bulb
> > >> in another room. How many trips must you make to determine which switch
> > >> is connected to which light bulb?
> > 
> > Only one trip, and Im not sure if I should explain or let you guys figure it
> > out :)
> 
> toggle_light(1);
> sleep(120);
> toggle_light(1);
> 
> toggle_light(2);
> move('self', 'room/');
> 
> if ($lightbulb['temp'] > $room['temp']) {
>   echo "switch #1";
> } elseif ($lightbulb['ison']) {
>   echo "switch #2";
> } else {
>   echo "switch #3";
> }
> 

unfortunately, this won't work... you need to loop through the
lightbulbs...

try something like: 

foreach ($lightbulbs as $bulb){
}

 and your if else logic needs a little tweaking so you don't incorrectly
label the "on" lightbulb as being switch #1 since it is also greater
than $temp['room']

see the following manual pages: 

http://us4.php.net/manual/en/control-structures.foreach.php
http://us4.php.net/manual/en/thelightbulb-determination-problem.php
http://us4.php.net/manual/en/i-have-too-much-time-on-my-hands.php



gabe. 

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



Re: [PHP] PHP Interview questions

2003-08-26 Thread Gabriel Guzman
On Tue, 2003-08-26 at 10:00, CPT John W. Holmes wrote:

> PHP is server side, so it obviously cannot control light bulbs. Use
> javascript.

maybe the lightbulbs are connected to the server :) 

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



Re: [PHP] PHP Interview questions

2003-08-26 Thread Gabriel Guzman
On Tue, 2003-08-26 at 10:36, Ray Hunter wrote:
> Everyone has given some great information. I have some ideas i would
> like to throw into the mix too.
> 
> Here are some topics:
> 
> 1. Questions regarding HTTP protocols. (SSL)

One that was we like to use is:   Describe an HTTP header.  

Most people who work with php/mysql (or any web development really)
should know what http headers are and (one would hope) be able to
describe them in some sort of detail. 


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



Re: [PHP] '&' Sign in _GET Parameter

2003-08-22 Thread Gabriel Guzman
On Fri, 2003-08-22 at 12:05, Pushpinder Singh Garcha wrote:
> Hello All,
> 
>   I am using an application where I retrieve user profile from a MySQL 
> DB using the Company Name .  I pass the name of the company to the PHP 
> script as a '$_GET' parameter. e.g. when the name of the company is 
> 'IBM'. , the URL with the query string would look like :
> http://masterstream.com/CRM/full_profile_1.php?name=IBM
> 
> Now one of the records had a name : PSG & Inc. , in this case the URL 
> with the query string would look like
> http://masterstream.com/CRM/full_profile_1.php?name=PSG%20&%20Inc

no, this is not how it should look... the '&' in the above query string
is saying the variable 'name' ends and a new variable follows.  If you
are submitting this in a form using method=get... it should look
something like:  

?name=PSG+%26+Inc

if you are really passing this in a form using method=get, then this
should be handled automatically. 

how are you accessing the passed variable?  

$_GET['name']  ?? 




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



Re: [PHP] timestamp

2003-08-22 Thread Gabriel Guzman
On Fri, 2003-08-22 at 11:50, John Taylor-Johnston wrote:
> I'm creating a counter.
> 
> I want a timestamp where I can calculate if a time stamp is older than one hour, if 
> so do X, if not do Y.

so, you have the timestamp already correct?  in your mysql db.  all you
should need to do is get the unix timestamp from that field: 

SELECT UNIX_TIMESTAMP(whateveryourtimestampfieldiscalled) from mytable
where foo;

and compare it to the current time from php:

$timeStampTime = value you got from DB;
$currentTime = time();

these are just integers, so you can easily look to see if the timestamp
is over an hour old.  A unix timestamp is simply the number of seconds
that have elapsed since the beginning of the unix epoch, so if you know
how many seconds there are in an hour, you can determine if the
$timeStampTime is over an hour old.

something like: 

if $timeStampTime + 3600 < $currentTime { 
  echo "I'm over an hour old"; 
} else {
  echo "I'm not an hour old";
}

should work. 

hth,
gabe.


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



Re: [PHP] timestamp

2003-08-22 Thread Gabriel Guzman
On Thu, 2003-08-21 at 22:23, John Taylor-Johnston wrote:
> Not teasing, I know I could do this with some ready made script, but I want to make 
> my own.
> 
> I'm making a counter.
> 
> CREATE TABLE `counter` (
>   `IPAddress` VARCHAR NOT NULL ,
>   `RemoteHost` VARCHAR NOT NULL ,
>   `TimeStamp` TIMESTAMP NOT NULL,

try not naming your timestamp column a reserved word...  just a guess

>   `Date` VARCHAR NOT NULL
> )
> 
> 
> Question 1, how do I create a timestamp, (My SQL above does not work.), if this is 
> indeed what I want to do.

see above

> Question 2, how can I read TimeStamp and if the elapsed time between visits is more 
> than 60 minutes, I insert a new record?

umm... look at:

http://us4.php.net/time
and
http://www.mysql.com/doc/en/DATETIME.html

one thing to look out for is php and mysql deal with time in different
ways, so you may have to do some conversion... but this should get you
started. 

> Where do I start?

the above 2 links.



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



RE: [PHP] Stop neurotic posting

2003-08-14 Thread Gabriel Guzman
On Wed, 2003-08-06 at 11:44, Chris W. Parker wrote:

> A bad answer would be:
> 
> "RTFM http://php.net/preg_match";
> 
> A good answer would be:
> 
> "That can be done with a regular expression. The function you're looking
> for is called preg_match. http://php.net/preg_match";

I fail to see the difference.  



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



Re: Fw: [PHP] debuging and getting mor information about failures

2003-07-29 Thread Gabriel Guzman
A tip on avoiding errors cause by not enough }'s is to close any bracket
immediately after you open it, so if I were writing a block of code: 

function foo(){
}

I would write the above first, and then fill in between the {}'s.  This
way, when I get to the end of my script, I know I'm at least not missing
any curly braces.  You can do this with others, but these are usually
the hardest to track down once you have a large amount of code (with a
large number of {}).  

I know this is painfully obvious, but it does help. 

gabe. 

On Tue, 2003-07-29 at 09:33, Peter James wrote:
> Just forwarding this reply back to the list.
> 
> - Original Message - 
> From: "Chris W. Parker" <[EMAIL PROTECTED]>
> To: "Peter James" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 29, 2003 10:26 AM
> Subject: RE: [PHP] debuging and getting mor information about failures
> 
> 
> Peter James 
> on Tuesday, July 29, 2003 9:18 AM said:
> 
> > These errors are usually caused by an extra or missing brace or
> > quote/apostrophe/backtick.  The best way to find where this is
> > happening is to use another error.
> [snip]
> > This is a very frustrating error message[snip]
> 
> It also helps to learn what to look out for. Not to say that I won't
> ever have the need, but I've never needed to deliberately introduce one
> error just to find another one, especially when it's a syntax error.
> 
> The best thing to do is just get used to scanning your lines of code for
> proper syntax. Make sure you always have a ; at the end of each
> statement, make sure your curly braces line up, etc.
> 
> Another thing that be making this error difficult for you to find is
> because of your coding style. Your code could possibly be written in
> such a way that it doesn't make scanning it too easy therefore making it
> hard to find such tiny errors.
> 
> 
> hth,
> chris.


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



Re: [PHP] looking for some kind of CMS breakthough (slightly OT)

2003-07-29 Thread Gabriel Guzman
On Mon, 2003-07-28 at 19:04, Justin French wrote:
> Hi all,
> 
> But, it still requires the writer to know a little mark-up 
> (p,b,h1,h2,i,a,img,etc) in order to create an article with multiple 
> paragraphs, sections, headings, images, etc, with well structured, 
> valid mark-up.
> 
> I'd be really interested in hearing how any one else is tackling this 
> stuff, even if it is only remotely related to PHP.

you are going to get me in trouble Justin... check out "Structured Text"

http://www.zope.org/Documentation/Articles/STX

it's pretty simple to use as a formatting tool without having to know
any markup... granted you do have to learn structured text, but it's
pretty straightforward.Might be a helpful idea.

gabe... i promise, no more zope out of me.


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



Re: [PHP] open source content management systems?

2003-07-29 Thread Gabriel Guzman
this will probably get me into trouble on this list, but...
I'm a big fan of zope.  It's not written in php, but I have found it to
be very robust and easy to work with.  Opensource.

www.zope.org
Make sure you also check out the Content Management Framework for Zope.
(cmf.zope.org - i think)

gabe.


On Mon, 2003-07-28 at 17:39, [EMAIL PROTECTED] wrote:
> hi all
> 
> does anyone have any recommendations for good open source content
> management systems for
> websites? - preferably, written in php...
> 
> i have about a 5 page site running on a freebsd/apache server.  it
> gets a fair number of hits a day.
> right now, the great majority of my pages are statically generated by my
> 30+ ftp users.  there is no
> consistency of layout between sections of the site.
> 
> i wanted to investigate open source content management systems in order
> to make our pages easier to
> create and update (preferably so i can do away with the majority of my
> ftp accounts and have my users
> create and update pages from a webbrowser), and maintain a consistent
> layout scheme across the site.
> 
> i'd also be into investigating commercial cms's, although i'd like to
> stick with open source if possible...
> 
> 
> thanks
> redmond
> 
> 


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



Re: [PHP] unique id

2003-07-28 Thread Gabriel Guzman
On Sat, 2003-07-26 at 07:11, Curt Zirzow wrote:
> * Thus wrote jan ([EMAIL PROTECTED]):
> > Hi there!
> > 
> > What's the best way to create uids (unique ids) even when runnig at
> > exactly same time (microseconds)?
> > 
> > is this enough ???
> > 
> > $r = mt_rand();
> > $uid = uniqid(getmypid() . $r);
> 
> If you're running a cluster of machines I would include information
> on the machine that is generating the uid.
> 
> $uid = uniqid(getmypid() . $r . '_MACHINE_NAME_');
> 
> Curt

this is similar to what we do as well: 

hexadecimal timestamp + hexadecimal pid + hexadecimal randomvalue + hex
ip address of server (only used if using multiple machines, otherwise
this part is left off).  

I've also considered using semaphores in my id generation function to
insure only one counter can be created at a time, but am worried that
this might cause a bit of a performance hit.  Anyone tried this? 

gabe. 


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



RE: [PHP] I'm really getting annoyed with PHP

2003-07-23 Thread Gabriel Guzman
On Thu, 2003-07-24 at 15:12, Beauford.2005 wrote:
> FYI. I did this login page for another website last month and I used the
> code from it to do this one. The other one works perfectly. I checked
> that code again today and there is ABSOLUTELY no differnce. I even used
> the same variables and session names. The only difference between the
> two sites is that the one that works is running IIS on Windows 2000
> Server. The broken one is on a Linux box running Apache. Both PHP and
> MySQL are the same versions. Remember also that the Header redirect is
> working in the redirect.inc page, which is even more confusing.

just a thought, but if you copied the code from a windows box to a unix
box... there may be some extra line breaks in the php code on the unix
side.  \r's or some such that might not be showing up in your editor. 

> I have really given up on it. It just ain't gonna work - no matter what
> I do. I thought I finally had it working again, but of course - another
> f*** up.

i know the feeling... sucks.

> Can you explain this? Along with my other code I used a little piece of
> javascript to do the redirect, and lo and behold it worked. But now my
> paths are all screwed up. I just don't get it.
> 
> In the example I tried, the page I am redirected to has a form on it.
> When I click submit it should go to the page specified in the action,
> which is season_write.php.
> 
>  action="post" name="seasons">

don't you mean -- method="post" -- instead of a second -- action="post"
--

sorry things aren't working out for ya...

gabe. 


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



RE: [PHP] can't restart session

2003-07-21 Thread Gabriel Guzman
> p.s. I'm new to this list as you may have noticed and so far this is the
> only list that I've been on that doesn't use the list's address as the
> return address. Do I have to manually put it in the To box each time?

not at all, just use the "reply-all" feature of your mail client.

gabe. 


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