Coding optimizations...

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Sacapuss
Forum Commoner
Posts: 40
Joined: Mon May 16, 2005 9:46 pm
Location: Earth...

Coding optimizations...

Post by Sacapuss »

Hi !

I invite you to let me know if you think to any coding or ergonomics optimization on my 2x2 pages at :
http://d.braschi-blondeau.chez.tiscali. ... bj=tableau
and :
http://d.braschi-blondeau.chez.tiscali. ... bj=tableau

Thanx for your help !
theda
Forum Contributor
Posts: 332
Joined: Sat Feb 19, 2005 8:35 am
Location: USA

Post by theda »

As I don't understand French, and probably will never learn French... Might I suggest you posting the php source code so we may do ask you were asking (optimising your code?)
User avatar
Sacapuss
Forum Commoner
Posts: 40
Joined: Mon May 16, 2005 9:46 pm
Location: Earth...

As far as...

Post by Sacapuss »

Thanx, theda, for your answer !

As far as the site is made out of 42 files, i think i can't post you all of them.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

How are we expected to point out any possible optmization points if we cannot see the source :\
User avatar
Sacapuss
Forum Commoner
Posts: 40
Joined: Mon May 16, 2005 9:46 pm
Location: Earth...

Post by Sacapuss »

Thank you, Jcart, for wanting to help !

You can see the html, javascript, and css...

Let i show you the leader file :

Code: Select all

<?php // Récupérables.index
if($QUERY_STRING == &quote;phpinfo&quote;)
{phpinfo(); exit;}

if($QUERY_STRING)
$questring = &quote;?$QUERY_STRING&quote;;

echo &quote;<!-- $SCRIPT_URI$questring -->
<html>&quote;;

include &quote;Site/data.html&quote;;
include &quote;$Obj/data.html&quote;;
include &quote;Site/header.html&quote;;

echo &quote;<body id=\&quote;$obj\&quote;>&quote;;

include &quote;Site/zentete.html&quote;;
INCLUDE &quote;$Obj/$obj.html&quote;;
include &quote;Site/pied.html&quote;;
include &quote;Site/javascript.html&quote;;

echo &quote;
</body></html>
<!-- fin $SCRIPT_URI -->
&quote;;
?>
theda
Forum Contributor
Posts: 332
Joined: Sat Feb 19, 2005 8:35 am
Location: USA

Post by theda »

You have a slight goof in your coding... "INCLUDE"(Line 18) need to be "include"

Also, when viewing the website underneath your post (where it says "www"), your website shows a Javascript Error... You might want to fix that.

Edit: By the way, I've read in a few PHP-Tutorials that every time you use "include," it forces the script to recompile, increasing load time. If you can, try to limit or lower your useage of "include"
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

You need to compile the included page. For stuff like HTML, I'm not sure, but maybe file_get_contents() and then echo or something would be faster. It'd be quite neglible though.
theda
Forum Contributor
Posts: 332
Joined: Sat Feb 19, 2005 8:35 am
Location: USA

Post by theda »

Ambush Commander wrote:You need to compile the included page. For stuff like HTML, I'm not sure, but maybe file_get_contents() and then echo or something would be faster. It'd be quite neglible though.
Hmm, okay.
User avatar
Sacapuss
Forum Commoner
Posts: 40
Joined: Mon May 16, 2005 9:46 pm
Location: Earth...

Hi, and thank you for your answers !

Post by Sacapuss »

Hi, and thank you for your answers !
You have a slight goof in your coding... "INCLUDE"(Line 1Cool need to be "include"
What is wrong with INCLUDE ?

Could you tell me if you see the table body at http://d.braschi-blondeau.chez.tiscali. ... obj=global ?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: Hi, and thank you for your answers !

Post by Roja »

Sacapuss wrote:What is wrong with INCLUDE ?
He means it shouldn't be captialized.
User avatar
Sacapuss
Forum Commoner
Posts: 40
Joined: Mon May 16, 2005 9:46 pm
Location: Earth...

Post by Sacapuss »

Thanx for your answer, Roja !

1.
He means it shouldn't be captialized.
That's what i understood.
The question is : why is it wrong (as far as it works) ?

2. I gave a value to aout (August) and changed document.getElementById('xxx').innerHTML='yyy' in document.write('yyy') inside xxx.

My questions are :
- do you see the table body now;
- can you sort the table body while clicking on each header;
- why does the table crunch when sorted;
- is the last line red for you ?

Thanx for your contribution !
theda
Forum Contributor
Posts: 332
Joined: Sat Feb 19, 2005 8:35 am
Location: USA

Post by theda »

Actually, when I click your links, they go instantly to a 404-Error page in Francois. :)

And about the other question "include" isntead of "INCLUDE":
There are different types of data in PHP that you could end up incorrectly displaying if you capitalize it. It's just a wise thing to not capitalize things as much as possible (Unless you use $_GET, $_SESSION...etc).
User avatar
Sacapuss
Forum Commoner
Posts: 40
Joined: Mon May 16, 2005 9:46 pm
Location: Earth...

Post by Sacapuss »

Thanx for answering, theda !

The pages are now at http://d.braschi-blondeau.chez.tiscali. ... dest=malik
Click on one of the 2 first buttons; you should see the tables... Then, let me know.
Post Reply