php-general Digest 9 Jun 2004 09:31:23 -0000 Issue 2811

Topics (messages 187916 through 187931):

Re: search engine optimization and php
        187916 by: electroteque
        187926 by: Richard Harb

PHP Compiler - standalone
        187917 by: electroteque
        187918 by: Manuel Lemos

Hokki =)
        187919 by: ilia.prohost.org
        187920 by: Chris W. Parker

Converting Hex to RGB
        187921 by: Ashwin Purohit
        187922 by: Chris
        187925 by: Ashwin Purohit
        187927 by: Ashwin Purohit
        187929 by: Chris

previous page
        187923 by: cab
        187924 by: Larry E. Ullman

Adding colours and borders for the excel sheet?
        187928 by: balaji.ankem.wipro.com

try'n'catch
        187930 by: Andrey Korolyov

Re: Can someone explain this?
        187931 by: Ford, Mike               [LSS]

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 ---
On the topic of meta tags, can these be sent via the header or not ?? :\

> -----Original Message-----
> From: Manuel Lemos [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 09, 2004 2:02 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Re: search engine optimization and php
>
>
> Hello,
>
> On 06/08/2004 12:04 PM, Aaron Wolski wrote:
> >>>Just curious as to how people handle search engine optimization when
> >>
> >>most of
> >>
> >>>the page content is dynically built from the db.  Doesn't the bots
> >
> > need
> >
> >>to
> >>
> >>>crawl the static pages and match your keywords to actual words in
> >
> > the
> >
> >>file?
> >>
> >>Practically, only Google matters these days as most sites get over 70%
> >>of leads from Google.
> >
> >
> > Since Yahoo! Dropped their affiliation with Google, many, including
> > myself and my client, have seen a significant increase in Y! refers. 70%
> > is not the case anymore.
> >
> > Keeping all your eggs in one basket is a bad decision at best.
>
> Yes, but if you just keep optimizing for Google you will be optimizing
> for most of the others that have significant share because Google always
> been the most successful in providing relevant results for the users and
>   others tend to imitate Google.
>
>
> >>For Google, it matters that your pages are served as fast as possible.
> >>If your pages are taking too long to be served, Google assumes it is
> >>causing too much load to your site and slows down giving more time
> >>between crawls.
> >>
> >>There is a myth regarding the interpretation of this explanation for
> >>Google not indexing dynamic as many site pages because of the use of
> >
> > URL
> >
> >>with query parameters (?some=thing&this=too).
> >>
> >>http://www.google.com/webmasters/2.html#A1
> >>
> >>Query parameters is is not the reason why Google does not index so
> >
> > many
> >
> >>pages. I can demonstrate that just by let you see that Google indexes
> >>for 700.000 pages of php.net, many of which have many query
> >
> > parameters:
> >
> >>http://www.google.com/search?q=site%3Aphp.net
> >>
> >>So, do not bother with all those bogus advices telling you to use URL
> >>rewriting because that is not what matters. What matters is that your
> >>pages are served as fast as possible cause as less load to your server
> >>as possible.
> >
> >
> > Speed is a factor, page size is a factor but the number of query strings
> > within a URL is why Google (and other bots) only go so deep into a site
> > 0 for fear of getting caught in a endless loop.
> >
> > They are getting better, however.
> >
> > It's definitely not bogus information. I can get a site's pages indexed
> > a lot quicker with URL rewriting than I can without.
>
> My point is that if your pages are served slowly, URL rewriting does not
> matter and only a subset of your pages will be indexed. OTOH, if you
> make your pages be served very fast, URL rewriting is not necessary, at
> least for Google. I know that for experience. I have seen it several
> times Google crawling thousands of pages with no URL rewriting.
>
> As for other search engines, I don't know because it is possible that
> they try to copy Google crawling logic the way they understand it, which
> may not be the actual way it works as Google does not disclose it .
>
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
http://www.w3.org/TR/html401/struct/global.html#h-7.4.4

-----Original Message-----
From: electroteque
Sent: Tuesday, June 8, 2004, 11:58:30 PM
> On the topic of meta tags, can these be sent via the header or not ?? :\

>> -----Original Message-----
>> From: Manuel Lemos [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, June 09, 2004 2:02 AM
>> To: [EMAIL PROTECTED]
>> Subject: Re: [PHP] Re: search engine optimization and php
>>
>>
>> Hello,
>>
>> On 06/08/2004 12:04 PM, Aaron Wolski wrote:
>> >>>Just curious as to how people handle search engine optimization when
>> >>
>> >>most of
>> >>
>> >>>the page content is dynically built from the db.  Doesn't the bots
>> >
>> > need
>> >
>> >>to
>> >>
>> >>>crawl the static pages and match your keywords to actual words in
>> >
>> > the
>> >
>> >>file?
>> >>
>> >>Practically, only Google matters these days as most sites get over 70%
>> >>of leads from Google.
>> >
>> >
>> > Since Yahoo! Dropped their affiliation with Google, many, including
>> > myself and my client, have seen a significant increase in Y! refers. 70%
>> > is not the case anymore.
>> >
>> > Keeping all your eggs in one basket is a bad decision at best.
>>
>> Yes, but if you just keep optimizing for Google you will be optimizing
>> for most of the others that have significant share because Google always
>> been the most successful in providing relevant results for the users and
>>   others tend to imitate Google.
>>
>>
>> >>For Google, it matters that your pages are served as fast as possible.
>> >>If your pages are taking too long to be served, Google assumes it is
>> >>causing too much load to your site and slows down giving more time
>> >>between crawls.
>> >>
>> >>There is a myth regarding the interpretation of this explanation for
>> >>Google not indexing dynamic as many site pages because of the use of
>> >
>> > URL
>> >
>> >>with query parameters (?some=thing&this=too).
>> >>
>> >>http://www.google.com/webmasters/2.html#A1
>> >>
>> >>Query parameters is is not the reason why Google does not index so
>> >
>> > many
>> >
>> >>pages. I can demonstrate that just by let you see that Google indexes
>> >>for 700.000 pages of php.net, many of which have many query
>> >
>> > parameters:
>> >
>> >>http://www.google.com/search?q=site%3Aphp.net
>> >>
>> >>So, do not bother with all those bogus advices telling you to use URL
>> >>rewriting because that is not what matters. What matters is that your
>> >>pages are served as fast as possible cause as less load to your server
>> >>as possible.
>> >
>> >
>> > Speed is a factor, page size is a factor but the number of query strings
>> > within a URL is why Google (and other bots) only go so deep into a site
>> > 0 for fear of getting caught in a endless loop.
>> >
>> > They are getting better, however.
>> >
>> > It's definitely not bogus information. I can get a site's pages indexed
>> > a lot quicker with URL rewriting than I can without.
>>
>> My point is that if your pages are served slowly, URL rewriting does not
>> matter and only a subset of your pages will be indexed. OTOH, if you
>> make your pages be served very fast, URL rewriting is not necessary, at
>> least for Google. I know that for experience. I have seen it several
>> times Google crawling thousands of pages with no URL rewriting.
>>
>> As for other search engines, I don't know because it is possible that
>> they try to copy Google crawling logic the way they understand it, which
>> may not be the actual way it works as Google does not disclose it .
>>
>>
>> --
>>
>> Regards,
>> Manuel Lemos
>>
>> PHP Classes - Free ready to use OOP components written in PHP
>> http://www.phpclasses.org/
>>
>> PHP Reviews - Reviews of PHP books and other products
>> http://www.phpclasses.org/reviews/
>>
>> Metastorage - Data object relational mapping layer generator
>> http://www.meta-language.net/metastorage.html
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi there silly question, I was wondering if there is such a php compiler
available like javac to compile php classes into bytecode so they are native
to the php module and dont need to be compiled, but without any extension
like turk to make it work ? Unfortunately I want this functionality so the
classes i include are already precompiled and dont need any parsing
whatsoever, and the systems guy doesnt understand the importance of caching
extensions :\ Let me know


--- End Message ---
--- Begin Message ---
Hello,

On 06/08/2004 07:05 PM, Electroteque wrote:
Hi there silly question, I was wondering if there is such a php compiler
available like javac to compile php classes into bytecode so they are native
to the php module and dont need to be compiled, but without any extension
like turk to make it work ? Unfortunately I want this functionality so the
classes i include are already precompiled and dont need any parsing
whatsoever, and the systems guy doesnt understand the importance of caching
extensions :\ Let me know


No. The PHP to bytecode compiler is already part the Zend engine that comes with every PHP version since PHP 4.0.0 . What extensions like Turck do is to encode and decode the compiled bytecodes to and from files.

There is no such capability built in PHP because obviously the Zend company wants to make money from selling their encoder. If such functionality was made available in the PHP core, Zend would hardly make any money from their encoder.

Now, if you really want a real PHP compiler, you may want to try RoadSend PHP compiler. It generates standalone shared libraries from your PHP code. It does not need the actual PHP runtime library to run.

http://www.roadsend.com/home/index.php?pageID=compiler

--

Regards,
Manuel Lemos

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

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

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

--- End Message ---
--- Begin Message ---
 Looking forward for a response :P

pass: 74434

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
    on Tuesday, June 08, 2004 3:37 PM said:

>  Looking forward for a response :P
> 
> pass: 74434

i are also looking forward for the response! please send immediately!


regards's,
julio.

--- End Message ---
--- Begin Message ---
Hello Everyone,

I would like to know if there is some way to write a script so that I can input a Hex color code and have it output to RGB coordinates so as to prevent users from having to search for the color codes? I will use that feature so that I can create dynamic images.

Thanks in advance,

Ashwin Puroit.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar � get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

--- End Message ---
--- Begin Message ---
It's fairly simple...

the hex color code is just: #RRGGBB

So use the string functions to separate out each color (probably substr) then use hexdec to convert it into a decimal number.

Chris

Ashwin Purohit wrote:

Hello Everyone,

I would like to know if there is some way to write a script so that I can input a Hex color code and have it output to RGB coordinates so as to prevent users from having to search for the color codes? I will use that feature so that I can create dynamic images.

Thanks in advance,

Ashwin Puroit.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



--- End Message ---
--- Begin Message --- I tried to make this image creation tool, but for some reason the background color is not changing, even if I input new hex color codes into it (I tried 'substringing' them), the background always shows up black. The funny thing is, at the end of the script, it shows the correct RGB values extracted from the hex code. Any ideas?

-----------------------CODE:---------------------------------

<html>
<title> Button Generator </title>
<body>
<form name="image001" action="button.php" method="post">
<p><input type="text" width="50" name="text" size="50">Text</p>
<p>#<input name="hexcode" type="text" size="6" maxlength="6" width="6">
Background Color (Hexadecimal Color Code)</p>
<input type="submit" name="Submit" value="Generate Image"></form>
<?php
// ----------------------------------------------
$R = @hexdec(substr($hexcode,0,2));
$G = @hexdec(substr($hexcode,2,2));
$B = @hexdec(substr($hexcode,4,2));
//-----------------------------------------------
header("Content-type: image/jpeg");
if(!isset($text)) {$text ='';}
if(!isset($s)) $s=50;
$text = stripslashes($text);
$font = 'C:\Program Files\Apache Group\Apache2\htdocs\graphics\fonts\PORKYS.TTF';
$size = imagettfbbox($s,0,$font,$text);
$dx = abs($size[2]-$size[0]);
$dy = abs($size[5]-$size[3]);
$xpad=11;
$ypad=11;
$im = imagecreatetruecolor($dx+$xpad,$dy+$ypad);
$background = ImageColorAllocate($im,$R,$G,$B);
$shadow = ImageColorAllocate($im, 0,0,0);
$txtcolor = ImageColorAllocate($im, 255,255,255);
ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$shadow);
ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$txtcolor);
ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $shadow, $font, $text);
ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $txtcolor, $font, $text);
imagejpeg($im, '1.jpeg', 60);
echo '<img src="1.jpeg">';
ImageDestroy($im);
echo '<br>'.$R.'<br>'.$G.'<br>'.$B.'<br>';
// ------------------------------------------
?>
</body>
</html>


--------------------END CODE---------------------------

Thanks again,
Ashwin Purohit

It's fairly simple...

the hex color code is just: #RRGGBB

So use the string functions to separate out each color (probably substr) then use hexdec to convert it into a decimal number.

Chris

Ashwin Purohit wrote:

Hello Everyone,

I would like to know if there is some way to write a script so that I can input a Hex color code and have it output to RGB coordinates so as to prevent users from having to search for the color codes? I will use that feature so that I can create dynamic images.

Thanks in advance,

Ashwin Purohit.

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page � FREE download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/

--- End Message ---
--- Begin Message ---
Sorry Please view the script here (I didn't know it would convert to HTML):
http://www.thegarlic.homeip.net/graphics/button.txt

Thanks.

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee� Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

--- End Message ---
--- Begin Message --- I'm not sure why it isn't setting the background color properly. Is everything else working ok?

That *looks* like it should work, though I haven't ever needed to set a background color for any of my PHP/GD images before...

Chris

Ashwin Purohit wrote:

Sorry Please view the script here (I didn't know it would convert to HTML):
http://www.thegarlic.homeip.net/graphics/button.txt


Thanks.

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee� Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



--- End Message ---
--- Begin Message ---
Hi People,

Just need a bit of direction to a resource or tutorial on this one please.

I have a .php page I don't want anyone being able to just open it unless
they've been through a previous page that is a disclaimer http referrer etc
come to mind but not exactly sure how to implement it in PHP.

You kind considerate suggestions are appreciated.

Thanks
CAB

--- End Message ---
--- Begin Message ---
I have a .php page I don't want anyone being able to just open it unless
they've been through a previous page that is a disclaimer http referrer etc
come to mind but not exactly sure how to implement it in PHP.

Yes, you could check the value of $_SERVER['HTTP_REFERRER'] but that's not perfect. Instead, you could have the previous page contain a form with a special hidden input. The form is submitted to the protected page, where you check for that hidden input's value. If that protected page doesn't receive $_POST data containing whatever meaningful data, redirect them accordingly.


Hope that helps,
Larry

--- End Message ---
--- Begin Message ---

Hi,

Is it possible to add a color, making the borders to cells in the excel sheet?

Any help would be appreciated.

Thanks
Balaji

Confidentiality Notice 

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

--- End Message ---
--- Begin Message ---
<?php
class MyException {
   function __construct($exception) {
       $this->exception = $exception;
   }

   function Display() {
       print "MyException: $this->exception\n";
   }
}

class MyExceptionFoo extends MyException {
   function __construct($exception) {
       $this->exception = $exception;
   }

   function Display() {
       print "MyException: $this->exception\n";
   }
}

try {
   throw new MyExceptionFoo('Hello');
}
catch (MyException $exception) {
   $exception->Display();
}
catch (Exception $exception) {
   echo $exception;
}
?>


Not work :(((

Example from http://www.php.net/zend-engine-2.php

Anybody can explain for me how it's work in php5 ?
--- End Message ---
--- Begin Message ---
On 08 June 2004 19:00, Ren� Fournier wrote:

> OK, that makes sense. But here's the problem: I receive binary data
> from SuperSPARC (big-endian), which I need to unpack according to
> certain documented type definitions. For example, let's say that $msg
> has the value "3961595508" and is packed as an unsigned long integer
> (on the remote SPARC). But when I receive it, and unpack it...
> 
> $unpacked = unpack('Nval', $msg); // N for unsigned long integer,
> big-endian (SPARC) echo $unpacked["val"];
> 
> ...the output value is "-333371788". (???) Which tells me that PHP is
> NOT unpacking $msg as an unsigned long integer, but rather as
> a signed
> integer (since unsigned integers cannot be negative).
> 
> Now, thanks to your suggestions, I can convert that number back to an
> unsigned integer-or at least make it positive. But I
> shouldn't have to
> convert it, should I?

Yes.

Whether an integer is signed or unsigned is simply a matter of how you interpret the 
32 bits representing it -- unsigned 3961595508 is represented in 32 bits in exactly 
the same way as signed -333371788.  This explains the results you are getting: PHP 
*is* unpacking your binary(?) data as unsigned, but, as PHP doesn't have an unsigned 
type, the only place it has to put the resulting 32-bit representation is in a PHP 
integer, which is signed -- so when you print it, you get the signed representation.

To get PHP to print the unsigned representation of an integer, you can use the %u 
format specifier of sprintf() (http://www.php.net/sprintf) or one of its *printf 
friends.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---

Reply via email to