473,396 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Adding a statement to all pages ?

I have many php files and I would like to simulate
low speed connectivity by adding sleep(5); statement to
all the php pages.
Instead of adding this statement manually to all the php files
is there a way to globally give this statement or any other way to add delay
to all pages
Jul 17 '05 #1
4 1806
dada wrote:
I have many php files and I would like to simulate
low speed connectivity by adding sleep(5); statement to
all the php pages.
Instead of adding this statement manually to all the php files
is there a way to globally give this statement or any other way to add delay
to all pages

Umm, instead of trying to modify all your pages, why not just sign up for
one of those free internet dialup accounts? Or, at the very least, a $4.95
a month deal just for testing purposes. Then you could see what your sites
look like to a dialup user. I have both dialup and broadband, and it's
been a very good thing.
--
Joel Farris | Q: It reverses the logical flow of conversation.
twinkledust Designs | A: Why is top posting frowned upon?
http://twinkledust.com |
AIM chat: FarrisJoel |
| (this fifth line in my sig angers the net kops!)

Jul 17 '05 #2
"dada" <us********@yahoo.com> schrieb im Newsbeitrag
news:f7**************************@posting.google.c om...
I have many php files and I would like to simulate
low speed connectivity by adding sleep(5); statement to
all the php pages.
Instead of adding this statement manually to all the php files
is there a way to globally give this statement or any other way to add delay to all pages


Make it your use to create a head.php file where you write all informations
that are needed on all pages, as db connection, error reporting, functions
you need and so on. Include that file at the top of every page regardless of
if it's really needed. So you always have the possibility to add something
like what you want and remove it again globally for the whole application.

HTH
Markus
Jul 17 '05 #3
Markus Ernst wrote:
"dada" <us********@yahoo.com> schrieb im Newsbeitrag
news:f7**************************@posting.google.c om...
I have many php files and I would like to simulate
low speed connectivity by adding sleep(5); statement to
all the php pages.
Instead of adding this statement manually to all the php files
is there a way to globally give this statement or any other way to add


delay
to all pages

Make it your use to create a head.php file where you write all informations
that are needed on all pages, as db connection, error reporting, functions
you need and so on. Include that file at the top of every page regardless of
if it's really needed. So you always have the possibility to add something
like what you want and remove it again globally for the whole application.


Or even better, if you're using apache put the following in your virtual
host setting:

php_value auto_prepend /var/www/.../global.php

That way it will be prepended to every page automatically.

Cheers,
Andy
Jul 17 '05 #4
"Joel Farris" <th*********@valid.address> wrote in message
news:f8********************@comcast.com...
Umm, instead of trying to modify all your pages, why not just sign up for
one of those free internet dialup accounts? Or, at the very least, a $4.95
a month deal just for testing purposes. Then you could see what your sites
look like to a dialup user. I have both dialup and broadband, and it's
been a very good thing.


Well, usually your development environment is not internet accessible.
Personally I use a null modem cable, which does a reasonable job simulating
a modem connection. You'd need a second computer for that of course.

The easiest way to do this kind of testing is probably through a bandwidth
throttling proxy. The best one I've seen is Proxy Workbench
(http://www.tcpiq.com/tcpiq/pwb/info.asp). It intercepts Internet traffic at
a lower level so you don't need to fiddle with your browser's proxy
settings. Highly recommended.
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul | last post by:
Hi I have a table that currently has 466 columns and about 700,000 records. Adding a new DEFAULT column to this table takes a long time. It it a lot faster to recreate the table with the new...
20
by: David | last post by:
I have a one-line script to add an onunload event handler to the body of the document. The script is as follows: document.getElementsByTagName("BODY").onunload=function s() {alert("s")} Now...
2
by: Viorel | last post by:
Adding new row with default values. In order to insert programmatically a new row into a database table, without direct "INSERT INTO" SQL statement, I use the well-known DataTable.NewRow,...
0
by: Ken Fichthorn | last post by:
I have a very simple website, built in FrontPage 2002, which displays static information only. I would like to add some ASP.NET web forms (providing some event registration web pages). I plan...
3
by: Robin Thomas | last post by:
I am fairly new to ASP.NET so I think I am missing something fundamental. Anyway, quite often I am pulling data from a database, but then I need to use that data to produce more data. A simple...
10
by: Trevor | last post by:
Hey, I am trying to do this tutorial on the microsoft site : http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dndotnet/html/usingadonet.asp I can get everything to work up to...
6
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that value to a table. It's just one value, so the entire...
7
by: Miro | last post by:
Im a VB Newbie so I hope I'm going about this in the right direction. I have a simple DB that has 1 Table called DBVersion and in that table the column is CurVersion ( String ) Im trying to...
2
by: Rob | last post by:
Hi, I am adding Tab pages to a Tab control dynamically via the following statement... Form1.TabControl1.Controls.Add(ThePage) The next 2 statements also work... ThePage.Name = some string
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.