|
If you don't want the whole page to refresh when you update, then you probably need to use AJAX with a timer event to call the PHP code that returns the updated record count. On the PHP side it could be as simple as doing a select query and returning a count. On the Javascript side you'll need to provide a call to your PHP using AJAX and if all you want back is a record count, you can get that with the text property rather than doing a whole XML transfer. Without writing the whole thing, your PHP could be as simple as:
$sql= "SELECT COUNT(*) FROM mytable WHERE Whatever = 'What Im looking for'";
$result = mysql_query($sql) or die("Sorry, you screwed up!");
echo mysql_num_rows($result);
Here's an example of doing the stuff based on a timer event in Javascript[^]. You'd put your function to do the update call as the argument to the timer.
To handle the AJAX, take a look at this PHP AJAX tutorial[^]. You put your own Javascript code to handle the return and update your label as required.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Hello.
I have a web application which is based on JAVA/JSP, Apache Tomcat Server and this application is working fine.
Now I have to test this for when many users visit this web site.
There is no complex test condition,
and I just need to open many web browsers(IE) and access this site at the same time.
At the first time,
I tried to do this test manually(using mouse and enter key), and soon found it's not a good idea.
So I searched for hours and found some utility programs.
But they are only for .NET project or too difficult and complex to use.
I read some manuals but I couldn't find out how to solve my problem.
Is there a tool for simple multi user access test?
Or could you please tell me how I can use these tool programs for this case?
Or please let me know the keyword I need to search / where I can visit.
(I visited the site : http://www.softwareqatest.com/qatweb1.html#FUNC and if you know one of the list is suit for my case, please let me know.)
Thank you for reading this.
May the sky bring you a full measure of health and prosperity.
|
|
|
|
|
I found the tool program I needed, and it's name was "Jmeter"
http://jakarta.apache.org/jmeter/
I could get multi access performance result report easily by using this.
Thanks!
May the sky bring you a full measure of health and prosperity.
|
|
|
|
|
How did the page suddenly display ads to the clothing sites I'd visited the previous day??
Is it done through cookies? Through I.P address.
I would like to know how this functionality is achieved!
|
|
|
|
|
Probably a cookie tracker like doubleclick. Basically, it tracks which websites you visit and then based on that history it predicts what sort of advertising is likely to be of interest to you.
Some people like this because it delivers advertising tailored to your likes and needs (in theory). Others see it as a breach of privacy. Others don't care one way or the other. There are various solutions for blocking this if it bothers you, just search on Google for "cookie tracker".
|
|
|
|
|
Ah! Thanks for that. so it is probably to do with cookies eh!
I'm studying ASP.NET 3.5 and I guess this sort of thing is more web design stuff than development?
Do you reckon studying ASP.NET technology is the way to go if you want to learn about how this sort of thing works? or is it more the preserve of web designers?
The trouble with learning Microsoft stuff and passing the MCP's is it doesn't teach you the creative flair! and seems mostly concerned with business apps!
|
|
|
|
|
I need help with this javascript - ajax code and I'm new to both js and ajax. I have this code that the onClick function is not working. I'm not receiving any errors. I'm expecting the code to return the value for var str within the function getForm(fobj) to to equate to " name = value" when the onclick function executes. Instead I'm getting empty string. Thanks for your help.
<script>
var req = createXMLHttpRequest();
function createXMLHttpRequest() {
var ua;
if(window.XMLHttpRequest) {
try {
ua = new XMLHttpRequest();
} catch(e) {
ua = false;
}
} else if(window.ActiveXObject) {
try {
ua = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
ua = false;
}
}
return ua;
}
function sendRequest(frm, file) {
var rnd982g = Math.random();
var str = "";
if(str = getForm(frm)) {
req.open(
req.onreadystatechange = handleResponse;
req.send(null);
}
return false;
}
function handleResponse() {
if(req.readyState == 4){
var response = req.responseText;
document.getElementById("results").innerHTML = response;
}
}
function getForm(fobj) {
var str = "";
var ft = "";
var fv = "";
var fn = "";
var els = "";
for(var i = 0;i < fobj.elements.length;i++) {
els = fobj.elements[i];
ft = els.title;
fv = els.value;
fn = els.name;
switch(els.type) {
case "image":
str += fn + "=" + encodeURI(fv) + "&";
alert ("string is" + str);
break;
} // switch
} // for
str = str.substr(0,(str.length - 1));
alert ("string -1 is: " + str );
return str;
}
<script>
<html>
<head>
<head>
<body>
<table border=1 cellspacing=0 cellpadding=0 width=850 height=550>
<tr>
<td width=660 valign=top> <div id="results" /> </td>
<td width=190 valign=top>
<FORM NAME ="form1" METHOD ="POST">
<INPUT type="image" src="2.gif" name ="mod1" value="webmenu1" onclick="sendRequest(this.form, 'test.php' )"
onmouseover="this.src='1.gif'" onmouseout="this.src='2.gif'"><br><br>
<tr>
<table>
</FORM>
</body>
</html>
modified on Tuesday, May 18, 2010 9:25 PM
|
|
|
|
|
You don't need to post everything in your app and although formatting it is more than most even attempt, you are screwing up the entire forum.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Dear all,
I have a dedicated server where I used to publish the project developed in asp.net.
Somebody deletes all source code from server. I cound not find any information of them either in IIS log or FTP log.
Any body can help me please how I can detect who is doing this hell.
I am very disappointed with such activity.
Thanks
Rohit
|
|
|
|
|
Do not cross-post. You've already got this posted in the ASP.Net forum.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
|
I apologize if this is a repost but I searched for something similar and came up with nothing. I have a couple of questions I'd like to ask some of the more informed web gurus out there. I have Adobe Dreamweaver, Microsoft Expressions Web, Microsoft Expressions Blend, Visual Studio 2008, 2010. I'm not savvy when it comes to web development but I am looking to better myself in this field over the summer. Out of the above mentioned web dev IDE's what (or what combination) would be the best to learn?
|
|
|
|
|
If you are looking to develop web applications that need to interface with a database, I would start with VS 2008.
|
|
|
|
|
I all depends on what you want to do. If you have VS2010 then VS2008 isn't necessary at all. IMO Dreamweaver is more for designers, if you really want to dig in to web development then use VS. Of course Dreamweaver also doesn't do ASP.NET, so if you want to learn that, then there is no choice, only VS. Expression will help with good graphics and layout support and integrates with VS. So my recommendation would be VS2010 and Expression.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I want to take MCTS certification on .Net Framework 3.5. for this which exams i need to take?
i think first i should take 70-528 after that 70-562. am i right? i didn't done any certification previously and this is first one. Again 70-536(.Net framework 2.0) is mandatory to take before this?
please suggest me how to take this exam?
fttyhtrhyfytrytrysetyetytesystryrty
|
|
|
|
|
70-536 (Application Development Foundation) is first.
After that just do 70-562 (for ASP.Net 3.5) you don't need the 2.0 one first.
Microsoft Learning[^] lists the various tracks.
Good luck with the exams.
|
|
|
|
|
Hi,
I try to execute a php code that stop when find a ">" char.
I new in web developing and i think that my feel experiencie is the real problem.
some one can help me ?
The messege i received on top of the page in preview is
setQuery("*", "people"); // If were called using ajax, only display the table, not the page body if > (EyeDataGrid::isAjaxUsed()) { $x->printTable(); exit; } ?>
The code i wish to execute is:
<?php
require 'class.eyemysqladap.inc.php';
require 'class.eyedatagrid.inc.php';
// Load the database adapter
$db = new EyeMySQLAdap('localhost', 'root', '', 'codes');
// Load the datagrid class
$x = new EyeDataGrid($db);
// Set the query
$x->setQuery("*", "people");
// If were called using ajax, only display the table, not the page body
if (EyeDataGrid::isAjaxUsed())
{
$x->printTable();
exit;
}
?><HTML><HEAD><TITLE>EyeDataGrid Example 1</TITLE><LINK href="table.css" type=text/css rel=stylesheet><META content="MSHTML 6.00.6002.18130" name=GENERATOR></HEAD><BODY>
<H1>Basic Datagrid</H1>
<P>This is a basic example of the datagrid</P>
<?php$x->printTable();
?>
</BODY></HTML>
|
|
|
|
|
I recently looked at websites selling clothing.
Today when I logged on to my Orange webmail, the ads on the page miraculously displayed links to the sites I'd visited.
As a web developer, I'm intriqued to know how this is done.
|
|
|
|
|
Lots of large sites (including code project) use Ad networks like doubleclick.net to handle ads. That banner at the top is actually delivered from a doubleclick.net server. Because it is delivered from their server, they can set a cookie for their domain on your machine. They also know which site you were on when the ad was delivered based on the URL. http://ad.doubleclick.net/adi/N5072.CodeProject/B4526008;sz=728x90;ord=634098885627770045?
The next time you go to a site with a doubleclick ad they can look you up based on your cookie, see what other doubleclick sites you have visited and deliver appropriate ads. If you use an Anti-Virus scanner one category of "threat" is a "tracking cookie". If you delete all of those you won't get targeted ads (until you visit enough sites again).
|
|
|
|
|
I have a client-based application in which I am trying to display and use data that is stored on the client's computer in an INI file.
I have been reading on this and still have not the javascript snytax to do this.
The INI will exist on the client's system. In order to find it requires reading the client system variables to get the path for the file.
Having diffculty with the best syntax to accomplish this.
Thank you.
|
|
|
|
|
Perhaps this[^] will help?
|
|
|
|
|
I have this code snippet from Weather.com that displays local weather.
In the script portion of code is the var wx_locID which is the zip code of the hosted site.
I am trying to enhance this functionality by allowing the client to enter their own zip code, have it saved, then retreived using a cookie, then pass the value to the var in the script when the client clicks on the weather icon.
I am having difficulty passing the value to the var.
Any perspective would be appreciated.
Here is the script:
<div id="wx_module_7847" style="padding-left: 225px;" >
<a href="http://www.weather.com/weather/local/34979">Your City's Weather Forecast, AA (11111)</a>
</div>
<script type="text/javascript">
/* Locations can be edited manually by updating 'wx_locID' below. Please also update */
/* the location name and link in the above div (wx_module) to reflect any changes made. */
var wx_locID = '08043';
/* If you are editing locations manually and are adding multiple modules to one page, each */
/* module must have a unique div id. Please append a unique # to the div above, as well */
/* as the one referenced just below. If you use the builder to create individual modules */
/* you will not need to edit these parameters. */
var wx_targetDiv = 'wx_module_7847';
/* Please do not change the configuration value [wx_config] manually - your module */
/* will no longer function if you do. If at any time you wish to modify this */
/* configuration please use the graphical configuration tool found at */
/* https://registration.weather.com/ursa/wow/step2 */
var wx_config = 'SZ=300x250*WX=FHW*LNK=SSNL*UNT=F*BGI=spring*MAP=null|null*DN=askbillbradley.com*TIER=0*PID=1177763389*MD5=be2899d91f6feddef8216cd03ec459a7';
document.write('<scr' + 'ipt src="' + document.location.protocol + '//wow.weather.com/weather/wow/module/' + wx_locID + '?config=' + wx_config + '&proto=' + document.location.protocol + '&target=' + wx_targetDiv + '"></scr' + 'ipt>');
</script>
</div>
|
|
|
|
|
Writing a controlled program which, in turn, calls a client located HTML page which feeds additional content to the program.
I modified a function that checks internet status when the client-side html page (main.html) is accessed:
/* window.onload = checkOnline();*/
var netStatus=""
function checkOnline() {
if (navigator.onLine) {
netStatus = document.createTextNode("Internet is UP");
}
else {
netStatus = document.createTextNode("Internet is DOWN");
}
netstatusSpan = document.getElementById("mynetstatus");
netstatusSpan.replaceChild(netStatus, netstatusSpan.firstChild);
setTimeout("checkOnline()", 3000);
}
The script is intended to check there is an active internet connection.
If there is, it calls the hosted web page.
If there is not, it calls html content (either within the same Main.html or a second client-side html) that displays reduced content and the message that the internet is off-line. In addition, this client-side html continues to periodically test for internet connectivity every xxx seconds. When internets test positive, it launches the hosted html page.
What I am having difficulty with is the syntax to do this. (My example above simply displays a message)
I think I am trying to do a windows.open(http...) command in an If ELSE structure.
How to I issue the command to open the client-side html page when the internet is off-line. Complicating matters is I need to read a Windows system var which will have the path where the html file is located.
Thank you in advance for your assistance.
|
|
|
|
|
|
This is a strange problem that just started happening on one (and only one) of my computers, and I'm wondering if anyone has any insights.
I have a Website with hundreds of small jpeg files that I download into a Web page and display in a mosaic, a new image every second or so. This suddenly stopped working on one of my machines a few hours ago. I have no idea what I might have done or how to fix the problem. I rebooted my machine and I still get the error. The text that the exception handler returns is the following: "The Website may not be granting access to its files from your computer."
Not that it matters, but this is a Silverlight application that is reporting the error. I do have another application on the same machine (a WPF application) that accesses files from another folder on the same Website with no problem. And the Silverlight application displays my images just fine from another computer I have available.
I'm using the System.Net.WebClient class to download the images. In case you want to test whether this happens on your own machine, I'd be grateful if you tried it. As mentioned above, the downloads work fine on my other machine. The Website is here:
http://parisphototools.com
This is a Website that is under construction and is not yet fully functional, in case you try to Register on the Website for example.
|
|
|
|