Re: [PHP] PHP Site with CSS and Internet Explorer

2010-05-15 Thread Mithun Shitole
On Sat, May 15, 2010 at 7:00 PM, Juan Rodriguez Monti <
j...@rodriguezmonti.com.ar> wrote:

> I guys,
> I'm having some problems with the following.
>
> I have a PHP Site working perfectly with HTML and CSS. The CSS runs
> flawlessly in Firefox and Google Chrome. However, I'm having some
> problems with Internet Explorer.
>
> I'm not able to show it centered ( the .css is to show centered
> content ) in any version of Internet Explorer. The CSS's Code is
> available here[0].
>
> Might be this is an Off-Topic question, however is closely related to
> my PHP development.
>
> If you know some hack or modification that I should do to make this
> site compatible with IE, I would appreciate it a lot.
>
> Thanks,
> Juan
>
> [0] http://pastebin.com/eLhz2CzM
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Do you use strict dtd?
I faced similar problems, and realized that using strict dtd is way out for
many annoying things that IE does in quirks mode.

-- 
Mithun


Re: [PHP] PHP Site with CSS and Internet Explorer

2010-05-15 Thread Paulo Carvalho

On 15/05/2010 18:19, Jim Lucas wrote:

Juan Rodriguez Monti wrote:

I guys,
I'm having some problems with the following.

I have a PHP Site working perfectly with HTML and CSS. The CSS runs
flawlessly in Firefox and Google Chrome. However, I'm having some
problems with Internet Explorer.

I'm not able to show it centered ( the .css is to show centered
content ) in any version of Internet Explorer. The CSS's Code is
available here[0].

Might be this is an Off-Topic question, however is closely related to
my PHP development.

If you know some hack or modification that I should do to make this
site compatible with IE, I would appreciate it a lot.

Thanks,
Juan

[0] http://pastebin.com/eLhz2CzM




Using your #container { ... } example.  the only change I would make 
is like this


body
{
text-align: center;
}

#container
{
margin: 0 auto;
width: 600px;
background:#fff;
text-align: left;
}

If you use this:

text-align:center; required for ie 5/6
Margin:0 auto;// center the container margin : 0 = top/bottom 
auto=left/right

 you will get a centered layout.
Paulo Carvalho

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



Re: [PHP] Multiple Login in a single PC should not be possible

2010-05-15 Thread Nathan Nobbe
On Sat, May 15, 2010 at 10:18 AM, Robert Cummings wrote:

> Ashley Sheridan wrote:
>
>> I see exactly the issue you have now, and there's no way round it. You
>> can't identify a single machine in the way you want.
>>
>> Maybe you could restrict access to test answer materials to a user who
>> is logged in, and then lock them out when a test is in progress for
>> their username. That way, you don't have to identify a machine at all
>> (what's to stop someone from opening up a laptop next to their main
>> computer to circumvent your 'security' anyway?) and the only way they
>> can access both course materials and the test is with two sets of login
>> credentials.
>>
>
> Just to follow-up... even if one could identify the machine, someone out
> there would open up a virtual machine :)


or add a second nic .., or a virtual nic, which doesnt even require
additional hardware ;)

-nathan


Re: [PHP] PHP Site with CSS and Internet Explorer

2010-05-15 Thread Jim Lucas

Juan Rodriguez Monti wrote:

I guys,
I'm having some problems with the following.

I have a PHP Site working perfectly with HTML and CSS. The CSS runs
flawlessly in Firefox and Google Chrome. However, I'm having some
problems with Internet Explorer.

I'm not able to show it centered ( the .css is to show centered
content ) in any version of Internet Explorer. The CSS's Code is
available here[0].

Might be this is an Off-Topic question, however is closely related to
my PHP development.

If you know some hack or modification that I should do to make this
site compatible with IE, I would appreciate it a lot.

Thanks,
Juan

[0] http://pastebin.com/eLhz2CzM




Using your #container { ... } example.  the only change I would make is 
like this


body
{
text-align: center;
}

#container
{
margin: 0 auto;
width: 600px;
background:#fff;
text-align: left;
}


--
Jim Lucas

A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

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



Re: [PHP] Email with attachment

2010-05-15 Thread Jim Lucas

Php Developer wrote:

Hi,

I found a good function at php.net that sends email with atachment, but 
unfortunately i still cannot figure out how to send a body of the email too. 
Here is the code:

function sendEmailWithAttachement($to, $subject, $message, $file)
{
  if (strtoupper(substr(PHP_OS,0,3)=='WIN')) {
$eol="\r\n";
  } 
  elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) {

$eol="\r";
  }
  else 
  {

$eol="\n";
  } 
  $filename = basename($file);


What does the following do?  Does it echo something to the screen?


  displaymessage($filename);
  $file_size = filesize($file);
  $file_type = filetype($file);
  displaymessage($file_size);


Shouldn't you be checking to see if the file exists and is readable 
before you try opening it?



  $handle = fopen($file, "rb");
  $content = fread($handle, $file_size);
  $content = chunk_split(base64_encode($content));


You should make sure ( strlen($content) !== 0 ) at this point.


  fclose($handle);
  # Common Headers
$headers = 'From: cont...@example.com'.$eol;
$headers .= 'Reply-To: cont...@example.com'.$eol;
$headers .= 'Return-Path: cont...@example.com'.$eol; // these two to set 
reply address
$headers .= "Message-ID: <".time()." 
TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;   // These two to help 
avoid spam-filters
# Boundry for marking the split & Multitype Headers
$mime_boundary=md5(time());
$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= "Content-Type: multipart/related; 
boundary=\"".$mime_boundary."\"".$eol;
$msg = "";

# Attachment
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: ".$file_type."; name=\"".$filename."\"".$eol;   // 
sometimes i have to send MS Word, use 'msword' instead of 'pdf'
$msg .= "Content-Transfer-Encoding: base64".$eol;
$msg .= $message;


Looks like you are missing some line endings on the above line.

Plus, why do the following lines require two EOL's but the above lines 
only use one EOL?



$msg .= "Content-Disposition: attachment; 
filename=\"".$filename."\"".$eol.$eol; // !! This line needs TWO end of lines !! 
IMPORTANT !!
$msg .= $content.$eol.$eol;
# Setup for text OR html
$msg .= "Content-Type: multipart/alternative".$eol;

# Text Version
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= "This is a multi-part message in MIME format.".$eol;
$msg .= "If you are reading this, please update your 
email-reading-software.".$eol;
$msg .= "+ + Text Only + +".$eol.$eol; 


# Finished
$msg .= "--".$mime_boundary."--".$eol.$eol;   // finish with two eol's for 
better security. see Injection.
mail($to, $subject, $msg, $headers);
}








--
Jim Lucas

A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

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



Re: [PHP] Multiple Login in a single PC should not be possible

2010-05-15 Thread Robert Cummings

Ashley Sheridan wrote:

I see exactly the issue you have now, and there's no way round it. You
can't identify a single machine in the way you want.

Maybe you could restrict access to test answer materials to a user who
is logged in, and then lock them out when a test is in progress for
their username. That way, you don't have to identify a machine at all
(what's to stop someone from opening up a laptop next to their main
computer to circumvent your 'security' anyway?) and the only way they
can access both course materials and the test is with two sets of login
credentials.


Just to follow-up... even if one could identify the machine, someone out 
there would open up a virtual machine :)


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] PHP Site with CSS and Internet Explorer

2010-05-15 Thread Ashley Sheridan
On Sat, 2010-05-15 at 10:30 -0300, Juan Rodriguez Monti wrote:

> I guys,
> I'm having some problems with the following.
> 
> I have a PHP Site working perfectly with HTML and CSS. The CSS runs
> flawlessly in Firefox and Google Chrome. However, I'm having some
> problems with Internet Explorer.
> 
> I'm not able to show it centered ( the .css is to show centered
> content ) in any version of Internet Explorer. The CSS's Code is
> available here[0].
> 
> Might be this is an Off-Topic question, however is closely related to
> my PHP development.
> 
> If you know some hack or modification that I should do to make this
> site compatible with IE, I would appreciate it a lot.
> 
> Thanks,
> Juan
> 
> [0] http://pastebin.com/eLhz2CzM
> 


Well, you haven't given a link to the site or mentioned what CSS you've
used, so I can only guess.

The traditional way to center an item (horizontally only) is to use
'margin: auto;' and give the element a width. This only works when the
parent element is a block level element with a width that is greater
than that of the object you are trying to center.

This will work in all the major browsers that support CSS.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PHP Site with CSS and Internet Explorer

2010-05-15 Thread tedd

At 10:30 AM -0300 5/15/10, Juan Rodriguez Monti wrote:

I guys,
I'm having some problems with the following.

I have a PHP Site working perfectly with HTML and CSS. The CSS runs
flawlessly in Firefox and Google Chrome. However, I'm having some
problems with Internet Explorer.

I'm not able to show it centered ( the .css is to show centered
content ) in any version of Internet Explorer. The CSS's Code is
available here[0].

Might be this is an Off-Topic question, however is closely related to
my PHP development.

If you know some hack or modification that I should do to make this
site compatible with IE, I would appreciate it a lot.

Thanks,
Juan



Juan:

Subscribe to the CSS discus list 
() and post your 
css questions there.


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



[PHP] Advice needed - general (GPS, databases, webs etc.)

2010-05-15 Thread SED
Hi,

 

I'm in the search for resources for the next step in the information's age.
I think smartphones with GPS and the internet will be THE BIG BUSINESS next
years.

 

Because this is hard business I'm not able to get overview and resources
handly, except by selling my soul to the big companies. There is so much
information on the internet that one person can not find what out what is
real and what is not.

 

Can you send me links regarding GPS, maps, smartphones that PHP programmers
focus on? I'm asking for useful information at advanced level, even though
it links to other programming languages, graphics or big companies.

 

Regards, 

Summi

from Iceland (...where the volcano stopped the world) J



[PHP] PHP Site with CSS and Internet Explorer

2010-05-15 Thread Juan Rodriguez Monti
I guys,
I'm having some problems with the following.

I have a PHP Site working perfectly with HTML and CSS. The CSS runs
flawlessly in Firefox and Google Chrome. However, I'm having some
problems with Internet Explorer.

I'm not able to show it centered ( the .css is to show centered
content ) in any version of Internet Explorer. The CSS's Code is
available here[0].

Might be this is an Off-Topic question, however is closely related to
my PHP development.

If you know some hack or modification that I should do to make this
site compatible with IE, I would appreciate it a lot.

Thanks,
Juan

[0] http://pastebin.com/eLhz2CzM

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



[PHP] Ruben Knol has invited you to open a Google mail account

2010-05-15 Thread Ruben Knol
I've been using Gmail and thought you might like to try it out. Here's
an invitation to create an account.

---

Ruben Knol has invited you to open a free Gmail account.

To accept this invitation and register for your account, visit
http://mail.google.com/mail/a-aa11bd36fb-302f6744ca-s4UI_b6q4PMLn9Ns0oJf_P55xNo

Once you create your account, Ruben Knol will be notified with
your new email address so you can stay in touch with Gmail!

If you haven't already heard about Gmail, it's a new search-based webmail
service that offers:

- Over 2,700 megabytes (two gigabytes) of free storage
- Built-in Google search that instantly finds any message you want
- Automatic arrangement of messages and related replies into
  "conversations"
- Powerful spam protection using innovative Google technology
- No large, annoying ads--just small text ads and related pages that are
  relevant to the content of your messages

To learn more about Gmail before registering, visit:
http://mail.google.com/mail/help/benefits.html

And, to see how easy it can be to switch to a new email service, check
out our new switch guide: http://mail.google.com/mail/help/switch/

We're still working every day to improve Gmail, so we might ask for your
comments and suggestions periodically.  We hope you'll like Gmail.  We
do.  And, it's only going to get better.

Thanks,

The Gmail Team

(If clicking the URLs in this message does not work, copy and paste them
into the address bar of your browser).

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



Re: [PHP] Multiple Login in a single PC should not be possible

2010-05-15 Thread Ashley Sheridan
On Sat, 2010-05-15 at 11:50 +0100, Lester Caine wrote:

> This was bounced back to the list because of the php crap of needing to use 
> 'reply all' - I SHOULD have used 'reply' in this case as jagdeep's email was 
> to 
> ME, but I automatically 'reply all' and replace return address with the list 
> email to kill off all the extras!
> 
> Ashley Sheridan wrote:
> > On Sat, 2010-05-15 at 08:18 +0100, Lester Caine wrote:
> >> Jagdeep Singh wrote:
> >> >  How can I define"Machine"?
> >>
> >> That IS the problem. As with a lot of this stuff - nothing was ever 
> >> actually
> >> DESIGNED to work :( So $_SERVER["REMOTE_ADDR"] will block multiple 
> >> machines if
> >> they are sharing the one connection. I've been lucky so far in that
> >> 'REMOTE_ADDR' CAN be resolved to a machine in my own case.
> >>
> >> This like 'tzoffset' is an area where the simplest basic functions 
> >> actually need
> >> to be fixed. If you are working cross timezones have you considered the 
> >> problem
> >> of knowing the right time where daylight saving is important. My users 
> >> have to
> >> set their correct daylight saving zone in their profile. 'tzoffset' is no 
> >> use.
> >>
> >> Both of these are areas that need fixing?
> >>
> >> ( As an aside ... some schools are now using 'virtual' desktops, so several
> >> pupils may WELL be working on the one 'virtual server' but each in their 
> >> own
> >> sessions. This makes it impossible to identify the individual users as 
> >> well )
> 
> > I explained off-list how you could do this. Create a hash of the
> > machines IP and browser with the username of the logged in user:
> >
> > md5($ip . $browser . $username);
> >
> > And store that in the database when they log in. Now each time they
> > perform an action, create a hash from those same bits of information
> > again and check it against the one created when they logged in.
> 
> We have already identified that THIS will not work is this case. It is not 
> unreasonable to want to restrict the number of users on a single machine. So 
> you 
> keep the machine use separate to the user login ... AS STATED the problem is 
> identifying a machine in the first place.
> 
> > You can't access their Mac address. Many people on the list have
> > explained that to you now. I'm not sure why an e-learning module needs
> > such strict requirements, as it's perfectly valid that a user might want
> > to use more than one browser at a time.
> 
> It is also not unreasonable that one may want to restrict access to something 
> in 
> the way specified. If one is RUNNING on-line testing, then having the answers 
> open in another browser is something that it might be nice to block ;) 
> Because 
> the simple matter of uniquely identifying a machine on the internet IS 
> impossible currently then we have to come up with some other way of blocking 
> things, but to be honest. On-line testing is a silly idea anyway since there 
> are 
> many ways of cheating that even these locks would not prevent ;) In my own 
> case, 
> restricting a machine to a single user is essential and I simply need to 
> block 
> other users when the machine is 'in use'. $_SERVER["REMOTE_ADDR"] is internal 
> to 
> the intranet so no problem.
> 
> Personally I think the demands from the 'privacy' camp is simply playing into 
> the hands of the criminals. EVERY machine should report it's ID and this can 
> then be used to kill off the con men. Perhaps when IPv6 is in full use then 
> every computer can be uniquely identified? THEN $_SERVER["REMOTE_ADDR"] will 
> work properly  we just have to ensure that 'cloaning' of ID's is always 
> flagged in transit.
> 
> -- 
> Lester Caine - G8HFL
> -
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk//
> Firebird - http://www.firebirdsql.org/index.php
> 


I see exactly the issue you have now, and there's no way round it. You
can't identify a single machine in the way you want.

Maybe you could restrict access to test answer materials to a user who
is logged in, and then lock them out when a test is in progress for
their username. That way, you don't have to identify a machine at all
(what's to stop someone from opening up a laptop next to their main
computer to circumvent your 'security' anyway?) and the only way they
can access both course materials and the test is with two sets of login
credentials.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Multiple Login in a single PC should not be possible

2010-05-15 Thread Lester Caine
This was bounced back to the list because of the php crap of needing to use 
'reply all' - I SHOULD have used 'reply' in this case as jagdeep's email was to 
ME, but I automatically 'reply all' and replace return address with the list 
email to kill off all the extras!


Ashley Sheridan wrote:

On Sat, 2010-05-15 at 08:18 +0100, Lester Caine wrote:

Jagdeep Singh wrote:
>  How can I define"Machine"?

That IS the problem. As with a lot of this stuff - nothing was ever actually
DESIGNED to work :( So $_SERVER["REMOTE_ADDR"] will block multiple machines if
they are sharing the one connection. I've been lucky so far in that
'REMOTE_ADDR' CAN be resolved to a machine in my own case.

This like 'tzoffset' is an area where the simplest basic functions actually need
to be fixed. If you are working cross timezones have you considered the problem
of knowing the right time where daylight saving is important. My users have to
set their correct daylight saving zone in their profile. 'tzoffset' is no use.

Both of these are areas that need fixing?

( As an aside ... some schools are now using 'virtual' desktops, so several
pupils may WELL be working on the one 'virtual server' but each in their own
sessions. This makes it impossible to identify the individual users as well )



I explained off-list how you could do this. Create a hash of the
machines IP and browser with the username of the logged in user:

md5($ip . $browser . $username);

And store that in the database when they log in. Now each time they
perform an action, create a hash from those same bits of information
again and check it against the one created when they logged in.


We have already identified that THIS will not work is this case. It is not 
unreasonable to want to restrict the number of users on a single machine. So you 
keep the machine use separate to the user login ... AS STATED the problem is 
identifying a machine in the first place.



You can't access their Mac address. Many people on the list have
explained that to you now. I'm not sure why an e-learning module needs
such strict requirements, as it's perfectly valid that a user might want
to use more than one browser at a time.


It is also not unreasonable that one may want to restrict access to something in 
the way specified. If one is RUNNING on-line testing, then having the answers 
open in another browser is something that it might be nice to block ;) Because 
the simple matter of uniquely identifying a machine on the internet IS 
impossible currently then we have to come up with some other way of blocking 
things, but to be honest. On-line testing is a silly idea anyway since there are 
many ways of cheating that even these locks would not prevent ;) In my own case, 
restricting a machine to a single user is essential and I simply need to block 
other users when the machine is 'in use'. $_SERVER["REMOTE_ADDR"] is internal to 
the intranet so no problem.


Personally I think the demands from the 'privacy' camp is simply playing into 
the hands of the criminals. EVERY machine should report it's ID and this can 
then be used to kill off the con men. Perhaps when IPv6 is in full use then 
every computer can be uniquely identified? THEN $_SERVER["REMOTE_ADDR"] will 
work properly  we just have to ensure that 'cloaning' of ID's is always 
flagged in transit.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] Multiple Login in a single PC should not be possible

2010-05-15 Thread Ashley Sheridan
On Sat, 2010-05-15 at 08:18 +0100, Lester Caine wrote:

> Jagdeep Singh wrote:
> > How can I define "Machine"?
> 
> That IS the problem. As with a lot of this stuff - nothing was ever actually 
> DESIGNED to work :( So $_SERVER["REMOTE_ADDR"] will block multiple machines 
> if 
> they are sharing the one connection. I've been lucky so far in that 
> 'REMOTE_ADDR' CAN be resolved to a machine in my own case.
> 
> This like 'tzoffset' is an area where the simplest basic functions actually 
> need 
> to be fixed. If you are working cross timezones have you considered the 
> problem 
> of knowing the right time where daylight saving is important. My users have 
> to 
> set their correct daylight saving zone in their profile. 'tzoffset' is no use.
> 
> Both of these are areas that need fixing?
> 
> ( As an aside ... some schools are now using 'virtual' desktops, so several 
> pupils may WELL be working on the one 'virtual server' but each in their own 
> sessions. This makes it impossible to identify the individual users as well )
> 
> -- 
> Lester Caine - G8HFL
> -
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk//
> Firebird - http://www.firebirdsql.org/index.php
> 


I explained off-list how you could do this. Create a hash of the
machines IP and browser with the username of the logged in user:

md5($ip . $browser . $username);

And store that in the database when they log in. Now each time they
perform an action, create a hash from those same bits of information
again and check it against the one created when they logged in.

You can't access their Mac address. Many people on the list have
explained that to you now. I'm not sure why an e-learning module needs
such strict requirements, as it's perfectly valid that a user might want
to use more than one browser at a time.

Thanks,
Ash
http://www.ashleysheridan.co.uk




[PHP] Email with attachment

2010-05-15 Thread Php Developer
Hi,

I found a good function at php.net that sends email with atachment, but 
unfortunately i still cannot figure out how to send a body of the email too. 
Here is the code:

function sendEmailWithAttachement($to, $subject, $message, $file)
{
  if (strtoupper(substr(PHP_OS,0,3)=='WIN')) {
$eol="\r\n";
  } 
  elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) {
$eol="\r";
  }
  else 
  {
$eol="\n";
  } 
  $filename = basename($file);
  displaymessage($filename);
  $file_size = filesize($file);
  $file_type = filetype($file);
  displaymessage($file_size);
  $handle = fopen($file, "rb");
  $content = fread($handle, $file_size);
  $content = chunk_split(base64_encode($content));
  fclose($handle);
  # Common Headers
$headers = 'From: cont...@example.com'.$eol;
$headers .= 'Reply-To: cont...@example.com'.$eol;
$headers .= 'Return-Path: cont...@example.com'.$eol; // these two to set 
reply address
$headers .= "Message-ID: <".time()." 
TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;   // These two to help 
avoid spam-filters
# Boundry for marking the split & Multitype Headers
$mime_boundary=md5(time());
$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= "Content-Type: multipart/related; 
boundary=\"".$mime_boundary."\"".$eol;
$msg = "";

# Attachment
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: ".$file_type."; name=\"".$filename."\"".$eol;   // 
sometimes i have to send MS Word, use 'msword' instead of 'pdf'
$msg .= "Content-Transfer-Encoding: base64".$eol;
$msg .= $message;
$msg .= "Content-Disposition: attachment; 
filename=\"".$filename."\"".$eol.$eol; // !! This line needs TWO end of lines 
!! IMPORTANT !!
$msg .= $content.$eol.$eol;
# Setup for text OR html
$msg .= "Content-Type: multipart/alternative".$eol;

# Text Version
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= "This is a multi-part message in MIME format.".$eol;
$msg .= "If you are reading this, please update your 
email-reading-software.".$eol;
$msg .= "+ + Text Only + +".$eol.$eol; 

# Finished
$msg .= "--".$mime_boundary."--".$eol.$eol;   // finish with two eol's for 
better security. see Injection.
mail($to, $subject, $msg, $headers);
}




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



Re: [PHP] create tree from arrays

2010-05-15 Thread shahrzad khorrami
Thanks to all, it works now:

function mktree_array(&$arr, $id = 0)
{
   $result = array();
   foreach ($arr as $a) {
   if ($id == $a['parentID']) {
   $a['children']  = $this->mktree_array($arr, $a['nid']);
   $result[] = $a;
   }
   }
   return $result;
}


merci

Shahrzad ;)


RE: [PHP] Question about creating php files from a form

2010-05-15 Thread Lawrance Shepstone
Kevin wrote:
>>> I am having some issues with connecting to a SQLite database right now
>>> ... I'm getting the following error "Fatal Error: 'sqlite_open' is an
>>> unknown function"
>>> But I'm putting that on the side right now.
>>
>> I think the docs are still screwed up. Try sqlite3_open() instead and
>> see if that works. Also, check phpinfo() to see if the SQLite/SQLite3
>> modules are loaded.
>>
> I tried with sqlite3_open() and it gave the same error.

  THEN ... 'check phpinfo()'
Obviously sqlite extension is not actually loaded.
You don't aey which OS ... On windows there are a list of extensions in the 
php.ini file, just 'uncomment' the one(s) you need ...

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

__

There is no sqlite3_open() - there is only an OOP interface for php_sqlite3.

I wrote to the list in frustration about this choice not too long ago, and
concluded that the only way to accomplish this is to:

1.) Use php-sqlite3 extension (not to be confused with the php_sqlite3 -
dash vs underscore) - but this isn't a great solution because it would mean
you would need to ask your host to enable a custom extension, which they
usually don't do. If you're hosting this app on your own server, then give
it a bash.

2.) Otherwise, get involved in PECL development and help give php_sqlite3 a
procedural interface.

Of course, if you're looking for basic database storage, then SQLite2
(php_sqlite) would work fine.

Best of luck,
Lawrance


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



Re: [PHP] Multiple Login in a single PC should not be possible

2010-05-15 Thread Lester Caine

Jagdeep Singh wrote:

How can I define "Machine"?


That IS the problem. As with a lot of this stuff - nothing was ever actually 
DESIGNED to work :( So $_SERVER["REMOTE_ADDR"] will block multiple machines if 
they are sharing the one connection. I've been lucky so far in that 
'REMOTE_ADDR' CAN be resolved to a machine in my own case.


This like 'tzoffset' is an area where the simplest basic functions actually need 
to be fixed. If you are working cross timezones have you considered the problem 
of knowing the right time where daylight saving is important. My users have to 
set their correct daylight saving zone in their profile. 'tzoffset' is no use.


Both of these are areas that need fixing?

( As an aside ... some schools are now using 'virtual' desktops, so several 
pupils may WELL be working on the one 'virtual server' but each in their own 
sessions. This makes it impossible to identify the individual users as well )


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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