php-general Digest 7 Jan 2008 13:36:10 -0000 Issue 5221
Topics (messages 266828 through 266836):
Re: website tree
266828 by: Breno
Re: login and read ad email
266829 by: Manuel Lemos
how can i use zend framework view helper in smarty?
266830 by: Wan Chaowei
266832 by: Wan Chaowei
Byte Size of an array
266831 by: Sancar Saran
Re: Delete rows from database
266833 by: Jim Lucas
Re: First stupid post of the year. [SOLVED]
266834 by: Nisse Engström
Float Value Parse Problem
266835 by: Cyril Chacko
Re: DOMDocument->getElementById() isn't working
266836 by: Christoph Boget
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Alain Roger escreveu:
Hi,
let's imaging we have the following thing :
www.mywebsite.com/company/index.php
www.mywebsite.com/company/profile.php
www.mywebsite.com/services/index.php
how can i detect in which address am i ?
for example how to retrieve www.mywebsite.com/services or
www.mywebsite.com/company
There are many methods like using the $_SERVER variable (auto generated)
$_SERVER['REQUEST_URI'] or $_SERVER['SCRIPT_NAME']
Try this and tell us :)
Breno
--- End Message ---
--- Begin Message ---
Hello,
on 01/05/2008 07:06 PM Yui Hiroaki said the following:
> HI!
>
> I try to login and read ad email in server.
> Does any one know how to do this?
> Below does not run correctly.
>
> Regards,
> Yui
>
> p.s
> I try to see pop3 email.
> I can not find the example!
As I mentioned before POP3 is more complex than that. You are just
authenticating. You need to list the messages in the mailbox and
retrieve them.
I suggest that you use this popular PHP POP3 client class.
It works so elegantly that you can even access messages in your mailbox
as if they were files, with a single line like this:
$message = file_get_contents('pop3://user:[EMAIL PROTECTED]/1');
This gets you the whole message with headers into the $message variable.
If you want to analyze the message to extract the relevant information,
you can use the MIME parser class and with just a few more lines it will
tell you if it is a text message, HTML message, extract any
attachments, etc.
http://www.phpclasses.org/mimeparser
--
Regards,
Manuel Lemos
PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
hello all:
my boss want use zend framework with smarty. if i don't use view helper
in smarty, it's easy to do it, but how can i use zend framework view
helper in smarty?
thanks All!
--- End Message ---
--- Begin Message ---
hello all:
my boss want use zend framework with smarty. if i don't use view helper
in smarty, it's easy to do it, but how can i use zend framework view
helper in smarty?
thanks All!
--- End Message ---
--- Begin Message ---
Hello,
I just wonder to how can I find a memory size of an array.
Regards
Sancar
--- End Message ---
--- Begin Message ---
Balasubramanyam A wrote:
Hi all,
I'm searching names from MySQL and printing it on a browser. Also, I've
provided checkbox for all the rows and a delete button for a page. I want to
delete the selected rows from MySQL when I click on the "Delete" button. How
do I do that?
Here is the code which I used to print the rows after fetching the same from
MySQL
while ($line = mysql_fetch_array($resultset, MYSQL_ASSOC)) {
echo "\t<tr>\n";
echo "<td><input type=checkbox name=index /></ td>";
In the above line you need to have the row ID as the value of your check
box. Also, you should probably use and array in your form. See below
for example and explanation.
echo "<td><input type=checkbox name=delete[] value={$line['id']} /></ td>";
Ok, broken down...
nothing special about this, pretty standard
echo "<td><input type=checkbox
This, when submitted to PHP, will create an array in the POST/GET array
name=delete[]
This will assign the value of ID to the checkbox array
value={$line['id']}
etc...
Now, this is assuming that your id column is called ID and that you will
be wanting to delete more then one at a time.
on the process page, do a print_r($_POST)
You will see what you get
foreach ($line as $col_value) {
echo "\t\t<td> $col_value</td>\n";
}
//echo "<td><input type=button name=vcancel value=Cancel /></td>";
echo "\t</tr>\n";
}
--- End Message ---
--- Begin Message ---
On Sun, 6 Jan 2008 11:28:55 -0500, tedd wrote:
> At 11:04 PM +0100 1/5/08, Nisse Engström wrote:
>>
>> The page encoding is determined by the HTTP
>>`Content-Type:´ header. Period. A <meta> element
>>may provide hints to a browser if the HTTP header
>>is missing (eg. when saving a page to disc). In the
>>presence of a `Content-Type:´ header, the <meta>
>>element should be completely ignored.
>
> So, if one uses this --
>
> <?php header('Content-Type: text/css; charset=UTF-8'); ?>
[text/html ?]
> -- preceding everything else on a web page, and
> also saves that page using UTF-8 encoding, then
> it's certain that the page will be recognized as
> UTF-8 across all modern browsers?
I don't know if there is any certainty. If you want
absolute certainty, plain ASCII with character references
(`Ä´, `”´ and so on) may be the way to go.
And even then, all character references might not be
supported by the browser...
>> > And lastly, what's the best encoding to set your
>>> browser? I have clients who are all over the
>>> place with special windoze characters that appear
>>> like garbage in my browser.
>>
>> Set it to detect automatically, with a preference
>>for cp1252 (or windows-1252) which covers a lot of
>>western characters. cp1252 also has the nice property
>>of being compatible with ISO-8859-1, except that it
>>has some extra real characters where 8859-1 has control
>>characters.
>
> Interesting that my browser (Safari) doesn't even
> offer that choice, at least under that name. It
> does offer ISO Latin, Mac OS Roman, UTF-8, and 34
> other language-specific text encodings -- but not
> 1252.
[The proper name is `windows-1252´.]
How does the following pages compare? The display
should be identical:
<http://luden.se/test/t-1252.html>
<http://luden.se/test/t-utf8.html>
/Nisse
--- End Message ---
--- Begin Message ---
Hi,
I have created a class and passing a float value to a method in it. I
have checked the the argument values in the method. The passed
argument has the proper value. However, on any arithmetic operation
the float as a whole is rounded off.
System Information :
Operating System : Windows
PHP Version : PHP Version 5.2.4
Web Server : Microsoft-IIS/5.0
Code Snippet :
<?php
class Order extends JObject {
var $_name = 'Order';
var $id = null;
var $ord_desc = null;
var $date = null;
var $total_amt = 0;
var $scheme = null;
var $shipping = 0.00;
var $service_tax = 0.00;
var $other = 0.00;
var $discount = 0.00;
var $discount_percentage = 0.00;
var $qty = 0;
var $uid = 0;
var $payment_mode = 0;
var $deliverydt = null;
var $paymentstatus = 0;
var $_amount = 0.00;
var $recordstatus = 0;
function addItem( $qty, $price, $discount = 0 ) {
$this->qty += $qty;
$this->total_amt += ( $price * $qty )- $discount;
return true;
}
}
?>
-----
On Caliing the function as
$order->addItem( 1, 2555.00, 0 );
$price = 2555.00, String Data Type
$price * $qty = 3000, Double Data Type
$order->addItem( 1, 3005.00, 0 );
$price = 3005.00, String Data Type
$price * $qty = 3000, Double Data Type
Please let me know if anything else is required. Thanks for the help.
Regards.
Cyril Chacko
--
Beauty lies in the eye of the beholder. Make sure they are on you.
--- End Message ---
--- Begin Message ---
>
> > that one of the nodes has an id of 'custom'. However, when I try to get
> the
> > element directly using getElementById(), it doesn't return the node
> > properly. Am I doing something wrong?
>
> A common problem. See here:
> http://wiki.flux-cms.org/display/BLOG/GetElementById+Pitfalls
>
> Probably easiest to use XPath. Otherwise you have to slightly modify
> your HTML...
Thanks for the link. It was very informative. I've switched to using XPath
and that seems to have solved my problems. Thanks for the help!
thnx,
Christoph
--- End Message ---