php-general Digest 11 Sep 2007 07:48:17 -0000 Issue 5012
Topics (messages 261910 through 261920):
Re: Public Announcement
261910 by: Stut
261912 by: Sascha Braun - CEO . Braun Networks
261915 by: Gavin M. Roy
Re: 403 Forbiden
261911 by: Jesús de Diego Alarcón
261914 by: Daniel Brown
Re: Buxa Coding Guidelines : This is how we do
261913 by: Daevid Vincent
profiling newb
261916 by: Nathan Nobbe
261918 by: Chris
upd sockets
261917 by: dwa
261920 by: Jim Lucas
remove page referrer
261919 by: Shahrzad
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 ---
tedd wrote:
At 4:39 PM +0100 9/10/07, Stut wrote:
Things to do before spamming a public English mailing list...
-snip-
-Stut
-Stut:
<my opinion>
Your time is far too valuable to be wasted on this.
</my opinion>
Unless you want to pay me to do something else I'll be happy spending my
spare time being sarcastic - it's what I do!
;)
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
hi stut,
thank you for your advices.
- Screentexts are texts shown as link texts or descriptions
in forms and other page elements which remain static in one
language area. The screentexts are getting replaced by they'
re coresponding translations as the user selects a different
language.
- The Google standard, of websites describes, that Query URL's
like ?param1=XYZ¶m2=123 or as in $_SERVER['QUERY_STRING']
are not human readable, which makes them not acceptable as valid
content links.
But as I am pretty familar with search engine optimisation, my
system is creating metatags for every page, h1 tags are used
for headlines, h2 tags for subheads and so on.
If you are a professional in search engine optimisation, you
will not find any weakness in my application anymore.
Its happending absolutely automatically the authors don't have
to do anything, for make it happen. Stopword lists like in my-
sql are removing useless keywords and so on.
- Yes, my system is the only application framework worldwide
with its capabilities. I added a neural networking functionality
which makes it possible to autodecide which contents are inte-
resting for the viewers on a page.
Fx: If a user is allergic, no products containing large amounts
of the alergen are shown in the shop anymore. As well it is possi-
ble to create psychological profiles from the users of the system
during the runtime of the application.
I have read a paper from the department of defence, from year 2004.
I first read it in the early beginning of this year. I figured out,
that my application framework is the perfect psynet application
for performing psychological operations over the internet.
I guess I developed one of the biggest weapon systems available
now a days.
- As a blogging standard I would describe websites which contain
a linklist to the left or the right of the blogs content as well
as a calender and a search field. I guess this makes a blog.
- The shop system is widely using ajax for performing fast shopping
actions, its possible to use videos or audiofiles as product descip-
tion media, as well as soon you change product parameters these me-
dias are getting replaced by different color media or size images
as what ever you could think of.
And as well my system is using XLinks, which means, you add a link
to a document, you are able to select the target document from one
of the content modules, automatically the headline of the target
document is used as link description and as well the link is shown
as a nonquery url, like:
http://www.domain.com/en/magazin/something-new/while-i-wrote-it-here.html
Done without mod_rewrite.
I hope I answered all your questions.
Best Regards,
Sascha
Am Montag, den 10.09.2007, 16:39 +0100 schrieb Stut:
> Things to do before spamming a public English mailing list...
>
> 1) Make sure your email actually says what the product is
> 2) Make sure you have a relevant subject line
> 3) Make sure it's in English
> 4) Run it through a spelling checker, preferably an English one
> 5) Stop and think whether the people you're spamming are really gonna care!
> 6) This one is really important. Make sure you include a URL to the
> product's website. Oh, and make sure that website actually works,
> especially when it says it's powered by your product!
>
> Some additional questions and notes that you may find useful...
>
> * What the heck are "Kategories"? Maybe you mean categories?
> * What the heck are "Screentexts"?
> * As far as I know Google have never published any standards regarding
> URLs. Do you have a reference?
> * Claiming that your product is the only one in the whole wide world to
> do something is very dangerous. Would you bet the farm on it? Because
> what with the numerous highly litigious patent owners out there you
> could well be!
> * "blogging standards"?? Another reference needed please.
> * "The shop system is not containing query urls anymore, without use of
> mod_rewrite." What the heck does that mean? You had SQL in your URLs?
> * It's the best is it? On what do you base that claim?
>
> -Stut
>
--- End Message ---
--- Begin Message ---
On 9/10/07, Sascha Braun - CEO @ Braun Networks
<[EMAIL PROTECTED]> wrote:
> - The Google standard, of websites describes, that Query URL's
> like ?param1=XYZ¶m2=123 or as in $_SERVER['QUERY_STRING']
> are not human readable, which makes them not acceptable as valid
> content links.
Those are indeed SEO friendly, but it by no means is "The Google standard"
> - Yes, my system is the only application framework worldwide
> with its capabilities.
That's a fairly big claim, you've compared other application
frameworks? Everything you've been talking about, btw has hinted
towards it being a CMS, not a framework.
> I hope I answered all your questions.
I think the biggest question is why post an announcement without
linking to that which you are announcing. In addition, seeing a
working site (unlike braun-networks.com) using it would probably be a
good idea before drumming up interest.
Also you mention not using mod_rewrite. If you're using Apache and
mod_php, are you using Error Documents? Auto-generating html pages
(or yuck - php pages) ? Methodology is worth more to the technical
than concepts or bragging rights.
Regards,
Gavin
--- End Message ---
--- Begin Message ---
Hello all
I can call other php files like:
http://www.my3dgis.es/visor/php/municipios.php
without problem (The response is OK so no Provincia parameter is providen ).
Indeed, the php file always work if i simply type :
http://www.my3dgis.es/visor/php/provincias.php
in a navigator.
The problem seems to arise if i use a call from the same domain , so the
call is done against the "php/provincias.php" file.
And... i think there is no rate-limiting ... The problem began as soon as i
uploaded the application...
Thank you anyway
Jesús de Diego
2007/9/10, Chris <[EMAIL PROTECTED]>:
>
> Jesús de Diego Alarcón wrote:
> > Hello
> > I've noticed the problem is not well described:
> >
> > 1º There are some times the correct XML appears. However, these times,
> the
> > call in Firebug comes with "(403)" and highlihted in red color.
>
> Does your host have any rate-limiting? Maybe you're hitting the server
> too much and you're being seen as a denial-of-service attack and being
> denied access.
>
> > About permisions, visor directory has 755 also like php.
> > provincias.php has 777 permisions.
>
> Try what I suggested - access other files in the same folders.
>
> That will tell us whether it's a file specific issue, a folder specific
> issue or something else.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
--- End Message ---
--- Begin Message ---
On 9/10/07, Jesús de Diego Alarcón <[EMAIL PROTECTED]> wrote:
> Daniel
>
> Here is the provincias.php code:
>
> <?php
> header('Content-Type: application/xml');
> //error_reporting(E_ALL);
> $request = '
> https://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC/OVCCallejero.asmx/ConsultaProvincia';
> $xml = file_get_contents($request);
> echo $xml;
> ?>
>
> However, i'm not calling the PHP from another php but for the ExtJS ComboBox
> :
> http://extjs.com/deploy/ext/docs/output/Ext.form.ComboBox.html#properties
>
> http://extjs.com/deploy/ext/examples/form/combos.html
>
> In my case, you can see the Javascript code at:
> http://www.my3dgis.es/visor/scripts/catastro.js
[snip]
Jesus,
On line 52 of visor/scripts/catastro.js, try changing the method
from post to get. If necessary, make those changes in
php/provincias.php.
See if that changes anything for you.
If it doesn't, what have your web logs told you so far?
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Give a man a fish, he'll eat for a day. Then you'll find out he was
allergic and is hospitalized. See? No good deed goes unpunished....
--- End Message ---
--- Begin Message ---
> Just wanted to see what you think of the strictness of Buxa,
> according to
> their PHP guidelines:
> http://www.buxaprojects.com/en/php_coding_guidelines.htm
>
> In their oppinion stuff like the short PHP init "<?" or
> inline echo "<?=
> $var ?>" is forbidden.
> Do you people code that strict?
I like some of their ideas, but I disagree about short tags.
I always use <?php ?> and <?= ?> but never <? ?>
I like the _idea_ of an organized naming convention, etc, but I think theirs
is a bit overkill for example:
Buxa_Db
Buxa_Db_Table
Buxa_Controller
Mapping to directories is silly like that.
\includes\classes\db.class.php
\includes\classes\table.class.php
\includes\classes\controller.class.php
We do a lot with Ruby here for the backend, and PHP for the front. So we
adhere loosely to the Rails/ActiveRecord way of things like:
end_user.class.php
Which directly corresponds to a SQL table of "end_users" (note the plural).
Within there we have $id, $_stamp, and $created_on which are popular in
rails Active Record.
We have a base.class.php containing the above, and everything else extends
from it.
We also are in love with the PHP __call, __set, __get methods to save
thousands of lines of redundant (useless) code.
We try to stick with lowercase filenames.
define's are all capitals, so are class constants.
I dislike their use of the _ char for protected things.
We use ' and " properly... (use ' most of the time as no pre-processing
required)
Uppercase SQL statements I agree. I've been meaning to write a tool that
will go through and fix any lowercase ones, but it's not so trivial ;-p
For long SQL, we just carriage return, none of that . appending crap.
We always try to "LIMIT 1" where possible.
We do the multiple line array thing. Makes it easy to read. In both formats
they show.
We use PHPXRef as our documentor, so we follow those basic @ tags.
We don't pass by reference, as there's no need anymore AFAIK. PHP handles
all that intelligently.
Big fans of the ()?: operator.
Only use { } when there are more than one statement to enclose. Our pages
tend to be in the KLOC range, so pruning out unnessesary white space/lines
helps a lot.
Big fan of the switch statement over multiple if/elseif/else
We tend to do the first { on the next line, rather than the same line.
--- End Message ---
--- Begin Message ---
all,
i am just getting my feet wet w/ profiling.
its nice to see i can invoke a page from the browser then
see an analysis in kcachegrind using xdebug to generate the data.
however, im curious about 'finding the weak spots in an application'.
say for instance i arrive at a new location as a consultant or w/e;
point is assume a totally foreign codebase that needs to be
optimized. theoretically 'profiling' would be a way to analyze the
application and determine where the slow points are, which methods
are getting called repeatedly and so forth. then those areas could be
analyzed for potential gains.
it seems to me though, that since generating a series of cache files
is a manual process and the analysis a manual process it would take
a long time just to profile an application. so someone familiar with
said application could point out the slow spots much more quickly
than a person using a profiling tool.
is there a tool that can analyze a large number of cache files and give
some sort of comprehensive report? it seems very natural to have cache
files get generated in a pre-production site for analysis. if they could be
sent through something that generated a comprehensive report that would
really reduce profiling time rather than having to look through them one at
a time.
or am i missing something because im new to profiling ?
thanks,
-nathan
--- End Message ---
--- Begin Message ---
Nathan Nobbe wrote:
all,
i am just getting my feet wet w/ profiling.
its nice to see i can invoke a page from the browser then
see an analysis in kcachegrind using xdebug to generate the data.
however, im curious about 'finding the weak spots in an application'.
say for instance i arrive at a new location as a consultant or w/e;
point is assume a totally foreign codebase that needs to be
optimized. theoretically 'profiling' would be a way to analyze the
application and determine where the slow points are, which methods
are getting called repeatedly and so forth. then those areas could be
analyzed for potential gains.
it seems to me though, that since generating a series of cache files
is a manual process and the analysis a manual process it would take
a long time just to profile an application. so someone familiar with
said application could point out the slow spots much more quickly
than a person using a profiling tool.
is there a tool that can analyze a large number of cache files and give
some sort of comprehensive report? it seems very natural to have cache
files get generated in a pre-production site for analysis. if they could be
sent through something that generated a comprehensive report that would
really reduce profiling time rather than having to look through them one at
a time.
While code optimization/checking is definitely something that needs
attention, personally I'd look at the database side of things first.
If you're using a database wrapper of some sort, see if there are any
logging options (ideally one that logs both the query & the time it took
to run). Missing indexes or bad queries will slow things down a lot
quicker than changing a foreach loop to a while loop.
Alternatively make sure your database has logging enabled and look at
that instead (hopefully in a limited environment so you don't have 50
people hitting different apps all at the same time).
I'm not sure if xdebug can take that sort of stuff into account when it
generates the times.
After that, definitely look at the code. Write a script to summarize the
xdebug output files and generate a report (I'd do it in perl myself but
YMMV).
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
Hey,
i have got a problem and cannot find answer.
I have got an process which sends real time data per udp. i can catch
this packets and write to a site with php and sockets.
CODE
<?php
define('LISTEN_IP', '0.0.0.0');
define('LISTEN_PORT', 52700);
define('PACKET_SIZE', 1024);
include("common.inc");
if ( $socket =
@stream_socket_server('udp://'.LISTEN_IP.':'.LISTEN_PORT, $errno,
$errstr, STREAM_SERVER_BIND) ) {
?>
<html>
<head>
<title>php-test</title>
<script language=JavaScript>
function alarma() {
alert("ARLAMA: <?php echo getAPaket() ?>");
}
</script>
</head>
<body>
<h2>Welcome to me</h2>
<p>listen to port 52776</p>
<?php
echo 'used socket '.$socket;
$packet = '';
$ilauf = 0;
while ($ilauf < 10) {
//$buff = stream_socket_recvfrom($socket, PACKET_SIZE, 0,
$remote_ip);
$buff = stream_socket_recvfrom($socket, PACKET_SIZE,
STREAM_OOB);
$packet .= $buff.'<br><br>';
$ilauf++;
echo 'current paketnummer is:'.$ilauf.'<br>';
echo 'current paket content:'.$buff.'<br><br>';
}
fclose($socket);echo getAPaket();
}
EDOC
In this example i read ONLY 10 packets BUT i want to read the data
continuous AND write the last received packet into a table. Now,
i write the data among each other. need a good idea! Ajax? js?
i thing, that the biggest prob. is that php is server sided a php
cleint sided...
Any IDEA??? Please answer here AND write an email to me. Because i ve
only an modem ;-( "wanscha @ web.de"
THX
dave
--- End Message ---
--- Begin Message ---
dwa wrote:
Hey,
i have got a problem and cannot find answer.
I have got an process which sends real time data per udp. i can catch
this packets and write to a site with php and sockets.
CODE
<?php
define('LISTEN_IP', '0.0.0.0');
define('LISTEN_PORT', 52700);
define('PACKET_SIZE', 1024);
include("common.inc");
if ( $socket =
@stream_socket_server('udp://'.LISTEN_IP.':'.LISTEN_PORT, $errno,
$errstr, STREAM_SERVER_BIND) ) {
?>
<html>
<head>
<title>php-test</title>
<script language=JavaScript>
function alarma() {
alert("ARLAMA: <?php echo getAPaket() ?>");
}
</script>
</head>
<body>
<h2>Welcome to me</h2>
<p>listen to port 52776</p>
<?php
echo 'used socket '.$socket;
$packet = '';
$ilauf = 0;
while ($ilauf < 10) {
//$buff = stream_socket_recvfrom($socket, PACKET_SIZE, 0,
$remote_ip);
$buff = stream_socket_recvfrom($socket, PACKET_SIZE, STREAM_OOB);
$packet .= $buff.'<br><br>';
$ilauf++;
echo 'current paketnummer is:'.$ilauf.'<br>';
echo 'current paket content:'.$buff.'<br><br>';
}
fclose($socket);echo getAPaket();
}
EDOC
In this example i read ONLY 10 packets BUT i want to read the data
continuous AND write the last received packet into a table. Now,
i write the data among each other. need a good idea! Ajax? js?
i thing, that the biggest prob. is that php is server sided a php
cleint sided...
Any IDEA??? Please answer here AND write an email to me. Because i ve
only an modem ;-( "wanscha @ web.de"
THX
dave
Well, sounds to me what you need to do is setup a PHP CLI daemon, using
inetd or something. Have that running all the time logging the
information it receives to a file.
Then, have a web page that when initially loaded reads a data file that
has been populated by the daemon. Then displays all the initial data.
Then on that web page, have an AJAXy thingy that calls to the server
with a time stamp of the last time the page was loaded or the last time
it asked for an update. If the time of the log file is past that
timestamp, then you can either reload the data, or figure out where in
the data you need to start reading from that point to the end and then
append that to the end of your existing table or data set in the current
web page.
Then wait a given time frame and do it again. This time passing the
updated timestamp.
Just a few ideas...
--
Jim Lucas
"Perseverance is not a long race;
it is many short races one after the other"
Walter Elliot
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--- End Message ---
--- Begin Message ---
Hi all,
I have 2 page ,when I go from first page to second page , I don't want the user
can back to first page where it come from. is there any way to do this in php ?
to remove or disactive $_SERVER["HTTP_REFERER"] in php?
Thanks
--- End Message ---