[PHP] login problem

2006-06-23 Thread suresh kumar
Hi,
 I am facing one problem.i previously mailed ,but there is no response,its 
running out of time.i want to implement that logic as soon as possible.This is 
my problem
   
 We are developing an online software for  displaying ads in 
big mall.I want to restrict only one user can login to his own account at that 
particular time.suppose "users1" created a new user "users2" for another 
user.If "user1" login to the  "users2" account  and at that same time i want to 
restrict "user2 " for log in to his account.i want at a time only one user can 
access his account.I am waiting reponse from u
   
   A.suresh


-
 Yahoo! India Answers: Share what you know. Learn something new Click here
Catch all the FIFA World Cup 2006 action on Yahoo! India Click here

Re: [PHP] GD problems

2006-06-23 Thread chris smith

On 6/24/06, Beauford <[EMAIL PROTECTED]> wrote:

Honestly, I've never seen anything so ridiculous. How is one to know that in
order to get one program to work you have to install 28 others. I'm not
trying to be a smart ass here, but seriously - No where in any documentation
I've read does it say I need to install all these other packages. Would it
just not be simpler to add them to the original package, and then check
whether or not it's installed - if not, install it. Or at the very least
include all the packages needed and the user can install them if need be. By
the way, I never saw Marks post - it might have saved me some time if I had
though.


Complain to the author(s) of the scripts. GD doesn't need bcmath, that
script does.
--
Postgresql & php tutorials
http://www.designmagick.com/

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



RE: [PHP] GD problems

2006-06-23 Thread Beauford
Honestly, I've never seen anything so ridiculous. How is one to know that in
order to get one program to work you have to install 28 others. I'm not
trying to be a smart ass here, but seriously - No where in any documentation
I've read does it say I need to install all these other packages. Would it
just not be simpler to add them to the original package, and then check
whether or not it's installed - if not, install it. Or at the very least
include all the packages needed and the user can install them if need be. By
the way, I never saw Marks post - it might have saved me some time if I had
though.

Thanks to everyone.

B

-Original Message-
From: chris smith [mailto:[EMAIL PROTECTED]
Sent: June 23, 2006 6:11 PM
To: Beauford
Cc: php-general@lists.php.net
Subject: Re: [PHP] GD problems

On 6/24/06, Beauford <[EMAIL PROTECTED]> wrote:
>
> Here's something else I just noticed. When I run the script below in 
> Windows it works fine, in Linux I get this error:
>
> Fatal error: Call to undefined function bcmod() in 
> /usr/local/apache/htdocs/home/cap.php on line 62

David told you about this 3-4 replies ago.

http://marc.theaimsgroup.com/?l=php-general&m=115095875203362&w=2

bcmod is a bcmath function, if you don't have bcmath installed you can't use
that function.

http://www.php.net/manual/en/ref.bc.php

--
Postgresql & php tutorials
http://www.designmagick.com/

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

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



Re: [PHP] Extracting XMP tags from pictures

2006-06-23 Thread chris smith

On 6/24/06, Dotan Cohen <[EMAIL PROTECTED]> wrote:

I have successfully extracted IPTC tags from jpegs, but now that I've
switched to F-spot I need to extract XMP data. I have found this:
http://www.ozhiker.com/electronics/pjmt/library/documentation/

But I have been so far unable to extract the tags. I have an example image here:
http://dotancohen.com/xmp_test.jpg
This image has the comment "This is a comment" and two tags:
"People->Yehuda" and "Place->Sarid".

Has anybody invented a wheel to extract these tags and comment as
strings? I'd love to see it if so.


This link:
http://www.photography-on-the.net/ee/beta/cs_xmp_to_exif.php

was on this page:
http://www.php.net/manual/en/function.exif-read-data.php

The manual usually has something useful.
--
Postgresql & php tutorials
http://www.designmagick.com/

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



[PHP] Extracting XMP tags from pictures

2006-06-23 Thread Dotan Cohen

I have successfully extracted IPTC tags from jpegs, but now that I've
switched to F-spot I need to extract XMP data. I have found this:
http://www.ozhiker.com/electronics/pjmt/library/documentation/

But I have been so far unable to extract the tags. I have an example image here:
http://dotancohen.com/xmp_test.jpg
This image has the comment "This is a comment" and two tags:
"People->Yehuda" and "Place->Sarid".

Has anybody invented a wheel to extract these tags and comment as
strings? I'd love to see it if so.

Thanks in advance.

Dotan Cohen
http://what-is-what.com

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



Re: [PHP] detect user click "stop" button in browser

2006-06-23 Thread Ahmed Saad

On 23/06/06, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Thu, June 22, 2006 4:16 am, weetat wrote:



An javascript thingie for "onStop" if it exists might help.



window.onunload


/ahmed

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



[PHP] Cookie Question

2006-06-23 Thread Tom Ray [Lists]
I've run into something rather odd with cookies today. I'm working with 
this admin section on a site and I'm setting a cookie that is supposed 
to be good for one hour. So in the cookie I have time()+3600 and all was 
well or that was until someone fired up IE. It seems that IE refused to 
set the cookie. After much swearing at IE, I found that if I set it to 
time()+7200 the cookie would be set.


Not if that wasn't odd enough, in Firefox if I logged in at 6PM the 
cookie said it would expire at 8PM which is correct. However, when I 
logged in via IE at 6PM it said the cookie would expire at 23:00 hours 
(11PM for those who don't know)...so my question is...why is this 
happening and why does IE do this? I checked in Opera, Mozilla and 
Netscape and they all work the same as Firefox.


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



Re: [PHP] STRING TO ASCII CHARACTERS

2006-06-23 Thread Ahmed Saad

On 23/06/06, cajbecu <[EMAIL PROTECTED]> wrote:


  $data .= "&#".ord(substr($string,$i,1)).";";


and I think there's no need for substr.. just

$data .= "&#".$string[$i].";";


/ahmed

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



Re: [PHP] xmldoc

2006-06-23 Thread Ahmed Saad

On 23/06/06, weetat <[EMAIL PROTECTED]> wrote:

  Anybody have any ideas what happening here ?


Try this as the first line



You can remove it later, of course, but it would enable displaying php
errors as it's commonly disabled in production systems, AFAIK..


/ahmed

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



Re: [PHP] GD problems

2006-06-23 Thread chris smith

On 6/24/06, Beauford <[EMAIL PROTECTED]> wrote:


Here's something else I just noticed. When I run the script below in Windows
it works fine, in Linux I get this error:

Fatal error: Call to undefined function bcmod() in
/usr/local/apache/htdocs/home/cap.php on line 62


David told you about this 3-4 replies ago.

http://marc.theaimsgroup.com/?l=php-general&m=115095875203362&w=2

bcmod is a bcmath function, if you don't have bcmath installed you
can't use that function.

http://www.php.net/manual/en/ref.bc.php

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] templating

2006-06-23 Thread Ryan A
Hey Tedd,


> >
> >> > He just needs maybe 5 template
> >> > pages, same pages, different color.
> >>
> >> For something THIS simple, I truly believe you
> are
> >> Better Off (tm)
> >> with a simple head() and foot() function in a
> >> globals.inc file:
> >
> >Sorry, dont know where my brain was that day, what
> I
> >meant was he needs like 5 template pages, with 5
> >"dynamic" spots on them (meaning that php will
> >generate the content for these 5 spots and they are
> >the parts that will be constantly changing
> depending
> >on the page), and identical pages will be used to
> >serve people with other languages except with a
> color
> >difference (meaning different colored graphics, not
> >just css)




> Then within each of the "dynamic" spots run your
> php.
> 
> 
> 


That would work of course, but the guys he is working
with know pretty much zero about programming and are
mostly designers, by having a "template tag"
eg:
{{left_menu}} {{right_menu}} {{content_here}}
{{head_img}}

in a plain html page, they will get the idea much
better and they can move the menu around or whatever
if for whatever reason my pal is no longer with the
company.

Thats why was thinking of a simple
str_replace(array,array)

Cheers!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] xmldoc

2006-06-23 Thread Michael Rasmussen
On Fri, 23 Jun 2006 16:12:56 -0300, Mariano Guadagnini wrote:

xmldoc, which is found in the extension DOM XML is no longer part of
PHP as of PHP >= 5.0. It has been replaced by DOM. See
http://dk2.php.net/manual/en/ref.dom.php
http://dk2.php.net/manual/en/ref.domxml.php

> Maybe when parsing the xml, the function throws an exception. That
> happened to me with PHP 5 xml builtin support, which uses libxml to
> process xml's, it can be that your document is malformed, you could try
> with a php debugger (like zend debugger).

There is really no need for debugger. Simple use the build-in exception
handler. The most sane advise would be this:

getMessage();
}
echo "done parsing xml";
?>

-- 
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917

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



RE: [PHP] GD problems

2006-06-23 Thread Beauford
OK, so that works. So is gd (or one of the required programs) wonky then - I
mean 4 out of 5 scripts I downloaded didn't work. I can't see all of these
people being bad programmers.., but the funny thing is they all work on
Windows. So that can't be it - is there still something I'm missing in Linux
that is required by these scripts? This is what I've been fighting with the
last two weeks.

Thanks for all the help.

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: June 23, 2006 2:20 AM
To: Beauford
Cc: php-general@lists.php.net
Subject: Re: [PHP] GD problems

Beauford wrote:
> Since I know nothing of how this works, does this actually create a 
> physical image, and if it does I'm assuming it would be in the 
> originating directory from where the script was run  - if this is the
case, I got nothing.
> 
> This is a moot point now as I have done what I need without using gd, 
> but it would be nice to find out what the problem is.
> 
> Thanks.
> 
>> Anyone know of a way I can test this further. A small script perhaps.
> 
>$image = imagecreatetruecolor(50, 50);
>   imagefilledrectangle($image, 0, 0, 50, 50, 0xff);
>   imagejpeg($image);
> ?>

It creates it in memory and it's a 50 x 50 white square.

Change the 0xff to 0xFF6600 and it should be a red square.

--
Postgresql & php tutorials
http://www.designmagick.com/

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

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



Re: [PHP] Problem displaying a mysql database field

2006-06-23 Thread Jochem Maas
Don wrote:
> Hi,
>  
> I have a varchar field in a MySQL database that contains a line of text like
> so:
>  
> "This is a line if text"
>  
> The double quotes are included in the database field.
>  
> I cannot seem to display it on my HTML page, it always shows as blank.  I
> have tried using both the stripslashes() and the html_entity_decode() but it
> still shows as blank.
>  
> How can I display this please???

post some code and maybe someone can help.

also use var_dump() et al to dump the contents of the vars/vals you
retrieve from the DB - that might give you a clue.

and lastly have you tried do 'view source' in order to try and understand
what might be going on?

>  
> Tks,
> Don
> 

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



RE: [PHP] GD problems

2006-06-23 Thread Beauford
 
Here's something else I just noticed. When I run the script below in Windows
it works fine, in Linux I get this error:

Fatal error: Call to undefined function bcmod() in
/usr/local/apache/htdocs/home/cap.php on line 62

This is line 62: $pos_x = bcmod($code,$size_x-60) +3;

Linux is running PHP 5.0, Windows 4.4.

Thanks

---



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



[PHP] Re: comparing a string

2006-06-23 Thread Bill Guion

At 9:28 PM -0500 6/21/06, Rafael wrote:

snip

The only possible values of strcmp() are: 1, 0 & -1.


Hmmm. My manual says: "Compares two strings; returns a number less 
than 0 if the first string is less than the second, 0 if the two 
strings are equal, and a number greater than 0 if the first string is 
greater than the second." Sounds like values other than -1, 0, and +1 
are possible.


 -= Bill =-
--

You never know who's right, but you always know who's in charge.
  


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



Re: [PHP] GET, POST, REQUEST

2006-06-23 Thread Manuel Lemos
Hello,

on 06/23/2006 09:46 AM John Nichel said the following:
>>> I come from languages
>>> where
>>> you not only have to initialize a variable but have to declare it as
>>> well so
>>> initializing comes natural, I feel wrong if I don't do it, even if the
>>> interpreter does not care.
>>
>> Just to be pedantic...
>>
>> The interpreter actually DOES care, but you have to be wise enough to
>> enable E_NOTICE messages for the interpreter to tell you that it does
>> care.
>>
>> You may want to get in the habit of using .htaccess to do that, as you
>> will be more comfy with PHP helping you catch any typos in failing to
>> initialize vars.
>>
>> :-)
> 
> I do that hereour development and staging servers have all errors
> turned on whereas on our production server, pretty much everything is
> turned off.  In a /perfect/ world, you would never see an error in my
> code, as I _try_ to write clean code, and trap all the errors before
> they get to the screen (no, not by the use of '@').  Since this is not a
> perfect world, and I don't always write clean code, it's nice to see
> those notices/errors pop up on the screen before the code gets live.  ;)

You should also leave all error flags on (except maybe for E_STRICT),
precisely because the world is not perfect. In the real world some bugs
may still escape when you ship the code to production. So you will want
to know of any notices caused by missed bugs, so you can fixed them
sooner rather than later.

What you should not do in production is to show error messages on the
page. I recommend the following php.ini settings:

http://www.phpclasses.org/browse/file/5051.html

What I do is to make PHP generate an error log and then can keep
monitoring it. If there are any log lines get added, the monitoring
script that is run regularly from cron, sends the added lines by urgent
mail to me so I can act promptly and fix any bugs before it is to late
to avoid major damage.

I use this class to watch PHP error log.

http://www.phpclasses.org/logwatcher

For sending really urgent mail, I use this class. It comes with a
wrapper function named urgent_mail(). It emulates the mail() function
but it attempts to inject the message directly in recipient SMTP server,
thus bypassing the local mail server, which is a good thing as the local
mail server may be too busy or not working at all (think of a disk full
or exhausted RAM).

http://www.phpclasses.org/mimemessage


I lost count of how many hours these small scripts save me of major
headaches and greater damages that could have been caused by often
subtil bugs.

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] xmldoc

2006-06-23 Thread Mariano Guadagnini

Brad Bonkoski wrote:



weetat wrote:


Hi all,

  I have simple code below :
  It run ok in one of my test server (Red Hat Enterprise) , PHP 4.3.2.

  However in the one of production server which have same OS and PHP 
version , the code did not  display "done parsing xml" in log file. 
It just display  "starting parsing xml" only.
 I have check all setting in php.ini , however cannot found any 
different between 2 server.


 Anybody have any ideas what happening here ? Thanks

  logdebug("starting parsing xml");
 $doc = xmldoc($xmlfile);

 $_logger->logdebug("done parsing xml");


  ?>

What does xmldoc() do?  Perhaps it reaches some critical error within 
that segment and causes the script to never complete?


Maybe when parsing the xml, the function throws an exception. That 
happened to me with PHP 5 xml builtin support, which uses libxml to 
process xml's, it can be that your document is malformed, you could try 
with a php debugger (like zend debugger).



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.2/373 - Release Date: 22/06/2006

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



Re: [PHP] Equivelant to mysql_fetch_row for normal array

2006-06-23 Thread Jochem Maas
Dave M G wrote:
> Nicolas, Jochem, Tul,
> 
> I have been going mental, reading the online manual and trying different
> things. I can not get this loop to work.
> 
> Please understand that I have endeavored to read up on list(), each(),
> foreach(), while(). key(), and everything else I can. I've even looked
> at online tutorials and I have to PHP books here. I'm asking on list not
> because I come here before searching for existing help, it's because I
> don't understand the help that I've found.
> 
> In fact, I've tried lifting code directly from a book I recently bought
> on PHP, called "All In One: PHP, MySQL and Apache".
> foreach($elements as $e){
>while(list($key, $value) = each($e)){
>echo "key = " . $key . "";
>echo "value = " . $value . "";
>}
> }

don't fix list()+each() with foreach() ...

// things to do when your stuck:
echo '';
var_dump($elements);
print_r($elements);
foreach($elements as $e) {
var_dump($e);
print_r($e);
}
echo '';

// example 1
foreach($elements as $e) {
echo "value= ",$e,"";
}

// example 2
foreach($elements as $key => $value) {
echo "value= ",$value,"";
echo "key= ",$key,"";
}

// example 3
reset($elements);
while(list(, $value) = each($elements)) {
echo "value = " . $value . "";
}

// example 4
reset($elements);
while(list($key, $value) = each($elements)) {
echo "key = " . $key . "";
echo "value = " . $value . "";
}

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



Re: [PHP] xmldoc

2006-06-23 Thread Brad Bonkoski



weetat wrote:


Hi all,

  I have simple code below :
  It run ok in one of my test server (Red Hat Enterprise) , PHP 4.3.2.

  However in the one of production server which have same OS and PHP 
version , the code did not  display "done parsing xml" in log file. It 
just display  "starting parsing xml" only.
 I have check all setting in php.ini , however cannot found any 
different between 2 server.


 Anybody have any ideas what happening here ? Thanks

  logdebug("starting parsing xml");
 $doc = xmldoc($xmlfile);

 $_logger->logdebug("done parsing xml");


  ?>

What does xmldoc() do?  Perhaps it reaches some critical error within 
that segment and causes the script to never complete?


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



[PHP] xmldoc

2006-06-23 Thread weetat

Hi all,

  I have simple code below :
  It run ok in one of my test server (Red Hat Enterprise) , PHP 4.3.2.

  However in the one of production server which have same OS and PHP 
version , the code did not  display "done parsing xml" in log file. It 
just display  "starting parsing xml" only.
 I have check all setting in php.ini , however cannot found any 
different between 2 server.


 Anybody have any ideas what happening here ? Thanks

  logdebug("starting parsing xml");
 $doc = xmldoc($xmlfile);

 $_logger->logdebug("done parsing xml");


  ?>

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



Re: [PHP] Equivelant to mysql_fetch_row for normal array

2006-06-23 Thread Dave M G

Nicolas, Jochem, Tul,

I have been going mental, reading the online manual and trying different 
things. I can not get this loop to work.


Please understand that I have endeavored to read up on list(), each(), 
foreach(), while(). key(), and everything else I can. I've even looked 
at online tutorials and I have to PHP books here. I'm asking on list not 
because I come here before searching for existing help, it's because I 
don't understand the help that I've found.


In fact, I've tried lifting code directly from a book I recently bought 
on PHP, called "All In One: PHP, MySQL and Apache".

foreach($elements as $e){
   while(list($key, $value) = each($e)){
   echo "key = " . $key . "";
   echo "value = " . $value . "";
   }
}

But it still doesn't work. It says:
Warning: Variable passed to each() is not an array or object in 
/home/dave/web_sites/thinkingworks.com/web/Article.class on line 60


I tested my code upstream to make sure my array does have the correct 
values in it:

echo "This is the id for elements : " . $elements['id'] . "";
echo "This is the type for elements : " . $elements['type'] . "";
echo "This is the resource for elements : " . $elements['resource'] . 
"";

echo "This is the parent for elements : " . $elements['parent'] . "";

This outputs:
This is the id for elements : 2
This is the type for elements : Text
This is the resource for elements : 1
This is the parent for elements : 1

Which is all I really want to do, but since it's a multidimensional 
array, I can't get at the next set of values that follows the first.


Part of what I don't get, and part of what led me to the first question, 
is that I don't get why a while() loop is so easy with 
mysql_fetch_array, and yet to act on a multidemensional array in any 
other way seems to be so complicated, with so many ways to skin a cat.


I tried what was suggested here on this list, by Tul, too:
foreach($elements as $e){
   echo "e[type] = " . $e['type'] . "";
   echo "e[resource] = " . $e['resource'] . "";
}

Which produced really weird results:
e[type] = 2
e[resource] = 2
e[type] = 2
e[resource] = 2
e[type] = T
e[resource] = T
e[type] = T
e[resource] = T
e[type] = 1
e[resource] = 1
e[type] = 1
e[resource] = 1
e[type] = 1
e[resource] = 1
e[type] = 1
e[resource] = 1

I could cycle through the other variants I've tried, but the bottom line 
remains the same - it ain't working, the results don't match what I'm 
seeing in the references, and I don't understand what's going on.


It would be really great if someone could lead me out of the darkness.

Thank you for your advice.

--
Dave M G

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



Re: [PHP] templating

2006-06-23 Thread tedd
At 3:37 AM -0700 6/23/06, Ryan A wrote:
>Hi Rich,
>Thanks for replying.
>
>
>> > He just needs maybe 5 template
>> > pages, same pages, different color.
>>
>> For something THIS simple, I truly believe you are
>> Better Off (tm)
>> with a simple head() and foot() function in a
>> globals.inc file:
>
>Sorry, dont know where my brain was that day, what I
>meant was he needs like 5 template pages, with 5
>"dynamic" spots on them (meaning that php will
>generate the content for these 5 spots and they are
>the parts that will be constantly changing depending
>on the page), and identical pages will be used to
>serve people with other languages except with a color
>difference (meaning different colored graphics, not
>just css)
>
>My fault for not explaining it better, sorry.
>
>Thanks,
>Ryan

Then within each of the "dynamic" spots run your php.



tedd
-- 

http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] templating

2006-06-23 Thread tedd
At 9:57 PM -0500 6/22/06, Richard Lynch wrote:
>On Thu, June 22, 2006 7:23 pm, tedd wrote:
>-snip-
> >>  
>
>> Well... I prefer to separate the header and footer into two files and
>> load them as needed in my web page. In addition, I would most
>> certainly remove ALL attribute stuff that could/should be controlled
>> by css out of html and php and into a css file.
>
>Putting the stuff into CSS is fine with what I did -- I do that all
>the time.

I'm not criticizing. You may do whatever is your custom, but the attribute 
"bgcolor" for the body tag is better served in a css format. The whole point of 
css is to remove attributes from markup.

I realize that people have their own ways that work better for them -- nothing 
wrong with that. And, if you need (for whatever reason) to change the 
background color of a body tag programmatically, then your way works for you.

But for me, I would move it to embedded css -- that way I know where all 
attributes are (embedded or in a css file) and don't have to go through my 
markup trying to find why some presentational element isn't working correctly.

> > In between the two  tags it's pretty simple to manage the
>> html and keep track of div's. I never have a header or footer that
>> goes beyond the body tags -- so even if there is NO html in between, I
>> still have a valid page.
>
>The header and footer frequently contain the logo, site nav, possibly
>a site-wide context-sensitive nav, maybe a mailing list signup, and
>then copyright and so on.
>
>There's no need to be doing a bunch of include files to hit the HD
>(expensive) separately for each.

The need is in organization.

We don't write code in machine language, which would be faster. We write it in 
whatever language (organization) is our custom, which is expensive. Everything 
has a price. But, I would guess that the hit to the HD for loading a few extra, 
but shorter, files would be very minimal as compared to loading one larger file 
per page.

After all, we use includes in php the same way and I don't hear people saying 
"Don't use includes because of the extra hits to the HD" -- do we? We do it for 
organization.

>It's also all too easy to forget one of the include files on one of
>the pages and never even notice it... I've done it too many times when
>I went back to add some fluff page to some ancient site. :-(

That's the housekeeping I spoke of. We all have different techniques and 
manners of organization. Mine works for me. If I forget an include, then that 
page would simply be missing that feature, but the page would still work and 
validate.

>A reasonable amount of the "all the same" stuff in head() handles all
>that, and the footer, in one HD seek, with matching tags between
>head() and foot() in a single file.
>
>It's also very easy to call foot() in an error condition to be sure
>all tags balance.

The tags in my "includes" always balance because I design them that way -- 
again, that's my organizational manner. The only includes that don't balance 
are my header and footer includes -- but the header ends, and the footer 
starts, with a body tag.

In short, my organization technique works and I don't have the problems you 
describe.

Cheers,

tedd
-- 

http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] GET, POST, REQUEST

2006-06-23 Thread John Nichel

Richard Lynch wrote:

On Tue, June 20, 2006 2:38 am, Satyam wrote:

I come from languages
where
you not only have to initialize a variable but have to declare it as
well so
initializing comes natural, I feel wrong if I don't do it, even if the
interpreter does not care.


Just to be pedantic...

The interpreter actually DOES care, but you have to be wise enough to
enable E_NOTICE messages for the interpreter to tell you that it does
care.

You may want to get in the habit of using .htaccess to do that, as you
will be more comfy with PHP helping you catch any typos in failing to
initialize vars.

:-)



I do that hereour development and staging servers have all errors
turned on whereas on our production server, pretty much everything is
turned off.  In a /perfect/ world, you would never see an error in my
code, as I _try_ to write clean code, and trap all the errors before
they get to the screen (no, not by the use of '@').  Since this is not a
perfect world, and I don't always write clean code, it's nice to see
those notices/errors pop up on the screen before the code gets live.  ;)

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] templating

2006-06-23 Thread Ryan A
Hi Rich,
Thanks for replying.


> > He just needs maybe 5 template
> > pages, same pages, different color.
> 
> For something THIS simple, I truly believe you are
> Better Off (tm)
> with a simple head() and foot() function in a
> globals.inc file:

Sorry, dont know where my brain was that day, what I
meant was he needs like 5 template pages, with 5
"dynamic" spots on them (meaning that php will
generate the content for these 5 spots and they are
the parts that will be constantly changing depending
on the page), and identical pages will be used to
serve people with other languages except with a color
difference (meaning different colored graphics, not
just css)

My fault for not explaining it better, sorry.

Thanks,
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] STRING TO ASCII CHARACTERS

2006-06-23 Thread cajbecu
That`s true, my mistake.. (length is in pascal)

cheers,

Juanjo Pascual wrote:
> Ok. Thanks.
> 
> You only have to change the function *length() *by the function *strlen()*
> 
> 
> cajbecu escribió:
>> function stransform($string) {
>>  for ($i=0;$i>  $data .= "&#".ord(substr($string,$i,1)).";";
>>  }
>> return $data;
>> }
>>
>>
>> Juanjo Pascual wrote:
>>   
>>> Do you know any way to convert any string to ascii characters??
>>>
>>> I mean:
>>>
>>>
>>> *"abcdefgh"*
>>>
>>> to
>>>
>>> *"abcdefgh"*
>>>
>>>
>>> Juanjo.
>>>
>>> 
>>
>>
>>   

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



Re: [PHP] STRING TO ASCII CHARACTERS

2006-06-23 Thread Juanjo Pascual

Ok. Thanks.

You only have to change the function *length() *by the function *strlen()*


cajbecu escribió:

function stransform($string) {
for ($i=0;$i  

Do you know any way to convert any string to ascii characters??

I mean:


*"abcdefgh"*

to

*"abcdefgh"*


Juanjo.





  


Re: [PHP] STRING TO ASCII CHARACTERS

2006-06-23 Thread cajbecu
function stransform($string) {
for ($i=0;$i Do you know any way to convert any string to ascii characters??
> 
> I mean:
> 
> 
> *"abcdefgh"*
> 
> to
> 
> *"abcdefgh"*
> 
> 
> Juanjo.
> 

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



[PHP] STRING TO ASCII CHARACTERS

2006-06-23 Thread Juanjo Pascual

Do you know any way to convert any string to ascii characters??

I mean:


*"abcdefgh"*

to

*"abcdefgh"*


Juanjo.


Re: [PHP] Finding out the upload date of the file

2006-06-23 Thread Aaron Koning

http://ca.php.net/stat

Might do it for you. Maybe check access time, although if you access the
file at after its uploaded, the access time is changed. Maybe mtime?

Aaron

On 6/23/06, Ko Ko <[EMAIL PROTECTED]> wrote:


Hi,

  How can I find out the upload date of the file to the server using PHP
function?

  Regards,
  Ko Ko



Reality starts with Dream


-
How low will we go? Check out Yahoo! Messenger's low  PC-to-Phone call
rates.





--
+
|  Aaron Koning
|  Information Technologist
|  Prince George, BC, Canada.
+
|  http://datashare.gis.unbc.ca/fist/
|  http://datashare.gis.unbc.ca/gctp-js/
+


[PHP] Finding out the upload date of the file

2006-06-23 Thread Ko Ko
Hi,
   
  How can I find out the upload date of the file to the server using PHP 
function? 
   
  Regards,
  Ko Ko



Reality starts with Dream 


-
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.