|
Hey thanks for your help, but this looks like it won't log the time if a user exits out of the browser, or if their computer shuts off due to a power failure. It looks like it will post the variables to the database when the submit button is pressed.
What I did was make a JavaScript applet that calls a PHP script every minute. The PHP updates a single record with the current time.
On entrance to the webcam page, their TIME USED is automatically increase by one minute to prevent people from reloading the page every 59 seconds.
A PHP script makes sure the Javascript is loaded. If it is not loaded, the page displays an error.
I also added a safeguard to prevent people from reloading the page every 1:59 seconds (which will equal one minute).
A PHP script will flag a user who reloads the page more than three times. If this occurs, a customer representive can inspect the usage log, manually bill the customer for the time used, and also terminate the customer account.
Thanks for the help, though!
|
|
|
|
|
You can capture unload event like this:
<body onload='foo1()' onUnload="alert('Hi')">
|
|
|
|
|
Anonymous wrote:
You are kidding, aren't you? IMHO that msgbox is very, very annoying... bad example...
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
dnh wrote:
You are kidding, aren't you? IMHO that msgbox is very, very annoying... bad example...
Frankly speaking,I am serious about what I have written and am not kidding.
I seriously feel that solution is, what I have written.
If u think that I am wrong then Please Guide.
Ranjan Goyal
|
|
|
|
|
rgoyal wrote:
I seriously feel that solution is, what I have written.
Do we both mean that alert() ? Yes, trapping onunload is good idea... Bt displaying messagebox (that's what alert do, yes?) after user closes browser ... arrg Probably you only showed example of handling onunload and I only say it's bad example.
Did you mean something like <body onload="foo();" onunload="form.myform.submit();"> ?
You are not wrong, your solution is ok You must only delete that alert and swear that you'll never ever display messagebox after user closes browser window
do you agree?
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
yes, following was my intention that you guessed.
<body onload="foo();" onunload="form.myform.submit();">?
Of course I never use alert after browser window is closed.
and I really like following sentence on ur every post:
Never forget: "Stay kul and happy" (I.A.)
Regards,
rgoyal
|
|
|
|
|
Anonymous wrote:
Of course I never use alert after browser window is closed.
Sorry, one never knows...
Anonymous wrote:
and I really like following sentence on ur every post:
Never forget: "Stay kul and happy" (I.A.)
yeah, I wish it was as easy as it's written. This quote comes from one very special girl's email.
whole dam*ed story[^]
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Hi,
i have two web servers running on my machine.
1)IIS on port 80.
2)WebMail on port 8080. have its own web server, and can not run under iis.
i want to access my webmail through IIS.
i was thinking about writing a very simple proxy which will redirect my requests from the iis to the the webmail and its responses back to me.
can it be done? i think that it can, aren't proxies doing that very thing?
please help.
thanks
|
|
|
|
|
Why not set up an HTML page with an IFRAME with its SRC property set to your mail app?
<IFRAME SRC="http://myWebMail:8080/default.asp"></IFRAME>
Or if you could use server-side redirection to accomplish the same.
No, you're not accessing it directly from IIS and from the setup you described it never will. There is a way to set up IIS to forward requests on with a specific signature (ie. ALL requests ending in JSP get forwarded to a J2EE server), but I'm not certain on how to do it. You'd be accomplishing the same task with an HTML page or server-side redirection.
-John
|
|
|
|
|
If your iis box supports cgi, use a cgi proxy such as nph-proxy.cgi. Make a form with hidden fields which post the address of your webmail server to the proxy file.
|
|
|
|
|
Hi.
It sounds like this is want i needed.
could you point me to a nph-proxy's website?
or some place which i can download the cgi code and find some HOW-TO docs.
thanks
|
|
|
|
|
Hi,
I have a poll on my website. I'm looking for someone that can help guide me to complete the poll. I'm stuck at the moment. I have a couple of options to choose from, then the user can submit the form to a WebsitePoll.asp page. Here it increments the poll count in the database and displays the results. But, bext to the submit button is a view results button. If the user clicks on this, it also goes to the WebsitePoll.asp page, but doesn't increment the database table.
I need to do a test to see if the submit button or preview button was clicked on. Remember that they both go to the same page, and I need to when to increment and when not to. I have named the name attributes of all the option buttons name="poll". I can do a test like
If Not IsEmpty(Request.Form("poll")) Then
' Add code to add to database
End If
But this won't work because the user can select an option, and not click on submit, but on to view the results. And because Request.Form("poll") is not empty, it will still increment the database. And I don't want this to happen.
Thanks
Brendan
|
|
|
|
|
Option 1:
Give the submit button a name (e.g. "btnSubmit"), and either give the view button a different name, or no name. Check for Request.Form("btnSubmit") to see if the user clicked submit.
Option 2:
Give all of the buttons the same name, and each button a unique value. Test the value of Request.Form("btnSubmit") against the button values to see which one the user clicked.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
hello
i am trying to create a website that will automatically search a list of websites for a specific keyword every hour
i then need the website to display a link to any new pages that contain the keyword.
if this isn't clear then please visit http://www.newsnow.co.uk
as my intended site is very similar to that.
my problem is that i do not understand quite how to do this.
should i use a spider
or a database
or both
or something completely different
i am quite a newbie and any help would be greatly appreciated.
thank you
paul
|
|
|
|
|
ulikechicken wrote:
if this isn't clear then please visit http://www.newsnow.co.uk
as my intended site is very similar to that.
hmmm... if websites on your list have RSS feed, it should be simple... search in rss feeds, no need for spiders. In case that websites don't have rss feeds, you can try "google hack" (send google request in background, than do something with results and display them to user). Hmm... bt you need it as up-to-date as possible, right? So spider is not a bad idea, bt it's so slow I don't know how you want to use a database. Maybe I missed something?
hope I helped a little bt I am not sure I 100% understand what u need
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
hey.
thanks for answering;
what i want to do is create roughly an exact replica of:
http://www.newsnow.co.uk/newsfeed/?name=Tottenham+Hotspur
the website would feature tottenham hotspur as its keywords and search sites like skysports.com and soccernet.com etc.
if you take a look at that site do you think you could tell the method that newsnow employ because i've contacted them and can't get no help.
thank you for your time
paul
|
|
|
|
|
hi Paul,
I don't know how they do it I even do not understand why they don't redirect me to another site directly, they use cgi script instead... so they may do some computing or something before they redirect me. They claim to search about 20000 sites every 5 minutes... so they must be searching like 60sites/second. Quite fast for spidering... Some sites use RSS, some don't... so they don't check (only) RSS feeds... It takes some time for Google to find new pages, so they don't use "google hack"... They really must search all 20k sites with spider. I can't tell you how they do it so fast... I doubt you will be able to search in 60sites/second with ordinary HW/i-net connection
If you plan to support only sites with RSS feeds in your app, it should be done by checking all feeds in list. Everytime there is new feed, you can index it (write into db words and links where these words occur). When user type in a keyword, you search ur database for this keyword and u will have list of links pointing to text containing the keyword. That should be fast enought, bt I never tried something like this. It's quite interesting application, so plz let me know after u will solve this problem
hope I helped a little,
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Hi,
This is what i would like to happen!
1.
I have a web service and a consuming web application.
From within the web app i want to record the round trip time from invoking to getting the data returned. What is the best way to do this? Is there a class i can use?
2.
when VS creates the XML file from my request and then the responce, i want to be able to save the XML file so i can see what size it is? and is there anyway to save the data in binary form to see the difference in size?
All this is coming from part of my uni thesis!
I want to analyse the cost of using XML and web services compared to having common functionality built into every application!
I realise this is a lot to ask but any comments, suggestions, CODE is greatly appreciated.
Thanks
Colin
|
|
|
|
|
On the client side within the web service proxy class you can override the WebRequest() method to get the returned data size. No need to save the contents to disk.
1) Before the client invokes, save the time.
2) In public override WebRequest(..) save the data size (on request and response)
3) When the invoke returns save the time and calc the differences.
Good Luck.
-John
|
|
|
|
|
Thanks
where can override this method?
i have the web service as a web reference (visual studio) within my client
thanks again for your help
Colin
|
|
|
|
|
One approach:
Right-click on the reference to the web service.
View in Object Browser
Browse to the class object for the web service.
Right-click Go To Definition
type:
protected override System.Net.WebResponse GetWebResponse(System.Net.WebRequest request)<br />
{<br />
return base.GetWebResponse (request);<br />
}
Just remember, if you "Update Web Reference" any code you've created will be overwritten.
-John
|
|
|
|
|
Thanks John, im learning a lot here!
as im overriding this method do i have to explicitly call it, or would i have to do this anyway?
For my problem where/how do i call this and what type do i save the return as?
Thanks
Colin
|
|
|
|
|
Colin,
Here's the basic override code. I write a static function called Logger() to write the info to a textbox; you'd want to probably write to a text file or database. For some reason the response length is -1 if you get it off the object itself. You can get the response length if you read the entire stream like I've done. This is all BEFORE deserialization so you're timing will be off a bit.
You don't have to explicitly call anything. These are base methods you're overriding and the proxy is taking care of calling them for you.
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
PersonClient.Form1.Logger("startTime=" + System.DateTime.Now);
return base.GetWebRequest (uri);
}
protected override System.Net.WebResponse GetWebResponse(System.Net.WebRequest request)
{
System.IO.StreamReader sr = new System.IO.StreamReader(request.GetResponse().GetResponseStream());
string buffer = sr.ReadToEnd();
sr.Close();
PersonClient.Form1.Logger("ReqLen=" + request.ContentLength);
//request.GetResponse().GetResponseStream().Length;
PersonClient.Form1.Logger("ResLen=" + buffer.Length );
PersonClient.Form1.Logger("endTime=" + System.DateTime.Now);
return base.GetWebResponse (request);
}
-John
|
|
|
|
|
thanks John ill give it a try
Colin
|
|
|
|
|
John
I created a public Void Logger(string strIn)
which saves the string to a database
How can i get access to this from the GetWebResponse method?
I tried WebForm1.Logger("Length" + request.ContentLength)
but i get an error
would it be possible to e-mail your sample application to me?
cm@gowcity.fsnet.co.uk
Thanks a lot
Colin
|
|
|
|