|
Thanks for the info...there is definitely endless amounts of info for Perl and scripts on the internet but I seem to learn best when reading from a book. I will give the one you suggested a shot.
|
|
|
|
|
I recently put a PHP poll on my web site with automatically updating results on the homepage from an SQL database. The problem is that the page does not reload when the user clicks the "go back" link:
go back
How do I reload the page without creating an infinite loop? By the way, I run a Unix server with everything but ASP (only for NT servers and I don't have the money for that laying around), so I need a solution for PHP.
-- Steve
|
|
|
|
|
what do u mean when u say you need to "go back" and "infinite loop"? sounds like you're not very exact with the logic/execution sequence. If PAGE_1 updates PAGE_2 and PAGE_2 "go back" to PAGE_1 every update cycle, of course you have an infinite loop.
But if your problem is with loading page variables properly...? Then:
page2.asp:
">
...
...
And if you are simply updating results on a homepage drawing data from a backend data source, the "fininte loop" problem is rather irrelevant. Every time the user load your "homepage", the IIS gets a fresh copy of data from the data source (text file or a SQL server or anything).
Usually, data on the server (perhaps an Access database or SQL server or anything) gets updated thru continously in the event that u have an online system (OLTP) or that updates are done in batches (every nite a DTS package is run). But you have to figure out what exactly you wish to do. If your homepage is just to display information drawn from a backend, you DO NOT have an infinite loop, and you shouldnt.
If your homepage "poll" the backend data source periodically - in which case you dont reload the form - just use a timing loop and periodically draw from the database, but that's a lot of network traffic isnt it? Is there any particular reason you need to "poll" your data source?
norm
|
|
|
|
|
What I mean is that when I hit the back button, I want the page to refresh once. I put the history.go() code into the home.php file and I got an infinite loading loop like I thought. That's what I meant. Is there some way to use my SQL database to solve this problem?
-- Steve
|
|
|
|
|
sorry, not quite sure what u're trying to do here. click back button to refresh? why not click the "refresh" button to refresh?
but in my brief ASP experience, history.go() is somewhat unreliable - depending on browser setting. i prefer to POST hidden form variables.
anywaz...
norm
|
|
|
|
|
Hi friends,
Please give me the source code javascript of counter of visitors on website.(Included its graphic). And then I will add to my webpage.
Any advice or idea appreciated.
Thank you very much in advance.
Email : thuydinh76@yahoo.com
Thuydinh,
|
|
|
|
|
It can't be done in javascript - how would that be possible ? Your web server needs to keep track of visitors and increment a counter. By the time your javascript is running, you're on the client and it's too late to be storing *anything* except a cookie, which is not of much help to you.
Are you running an asp website, or just html ? If asp, then it's something you need to do in your database. If you don't have a database, you've had it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
Hey Thuy Dinh ,
You need server-side intervention to keep track of visitors and clientside JavaScript alone cannot achieve this trick. Perhaps if you do not have access to serverside scripts and can use only static html pages, check out
http://www.thefreesite.com/
(Webmaster Freebies section) and there are lot of cobranded counters/site stat services, that can help you).
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Thank you very much for your help. I'll find what I want now.
Thuydinh,
|
|
|
|
|
I am suffering from a lot of pain doing this. And I have decided to bring this to you genius - with the belief that someone on this planet will safe me further trauma debuggin this script.
Here's what i have on my ASP script:
'Connecting to Microsoft SQL Server:
oConn.ConnectionString = "Provider=sqloledb; Data Source=(local); Initial Catalog='dummyDB'; User ID=sa; Password=sa"
oConn.Open
'Update profile through stored procedure "sproc_ChangeProfile":
Set oCmd = Server.CreateObject("ADODB.Command")
With oCmd
.ActiveConnection = oConn
.CommandText = "dbo.sproc_ChangeProfile"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@old_login", adChar, adParamInput, 15, Request.Form("txtOldLogin") )
.Parameters.Append .CreateParameter("@login", adChar, adParamInput, 15, Request.Form("txtLogin") )
.Parameters.Append .CreateParameter("@password", adChar, adParamInput, 15, Request.Form("txtPasswd") )
.Parameters.Append .CreateParameter("@first_name", adChar, adParamInput, 50, Request.Form("first_name") )
.Parameters.Append .CreateParameter("@middle_name", adChar, adParamInput, 50, Request.Form("middle_name") )
.Parameters.Append .CreateParameter("@last_name", adChar, adParamInput, 50, Request.Form("last_name") )
.Parameters.Append .CreateParameter("@email1", adChar, adParamInput, 50, Request.Form("email1") )
.Parameters.Append .CreateParameter("@email2", adChar, adParamInput, 50, Request.Form("email2") )
.Parameters.Append .CreateParameter("@tel_home", adChar, adParamInput, 30, Request.Form("tel_home") )
.Parameters.Append .CreateParameter("@tel_office", adChar, adParamInput, 30, Request.Form("tel_office") )
.Parameters.Append .CreateParameter("@tel_fax", adChar, adParamInput, 30, Request.Form("tel_fax") )
.Parameters.Append .CreateParameter("@tel_cell", adChar, adParamInput, 30, Request.Form("tel_cell") )
.Parameters.Append .CreateParameter("@tel_pager", adChar, adParamInput, 30, Request.Form("tel_pager") )
.Parameters.Append .CreateParameter("@title", adChar, adParamInput, 100, Request.Form("title") )
.Parameters.Append .CreateParameter("@association", adChar, adParamInput, 50, Request.Form("association") )
.Parameters.Append .CreateParameter("@address_unit_num", adChar, adParamInput, 15, Request.Form("address_unit_num") )
.Parameters.Append .CreateParameter("@address_bldg_name", adChar, adParamInput, 50, Request.Form("address_bldg_name") )
.Parameters.Append .CreateParameter("@address_street_num", adChar, adParamInput, 15, Request.Form("address_street_num") )
.Parameters.Append .CreateParameter("@address_street", adChar, adParamInput, 100, Request.Form("address_street") )
.Parameters.Append .CreateParameter("@address_city", adChar, adParamInput, 100, Request.Form("address_city") )
.Parameters.Append .CreateParameter("@address_province", adChar, adParamInput, 100, Request.Form("address_province") )
.Parameters.Append .CreateParameter("@address_country", adChar, adParamInput, 100, Request.Form("address_country") )
.Parameters.Append .CreateParameter("@address_zipcode", adChar, adParamInput, 100, Request.Form("address_zipcode") )
.Parameters.Append .CreateParameter("@update_target", adInteger, adParamInput, 4, Request.Form("update_target"))
.Parameters.Append .CreateParameter("@error_status", adInteger, adParamOutput, 4, 0) 'OUTPUT: error status.
'Execute the stored procedure:
.Execute
End With
'Check return status:
If oCmd.Parameters("@error_status")=0 Then
'No error.
Else
'exception handling - please refer to stored procedure for error code interpretation.
bstatuscode=oCmd.Parameters("@error_status")
End If
Here's the declaration of the stored procedure in question:
CREATE PROCEDURE dbo.sproc_ChangeProfile(
@old_login char(15) =NULL,
@login char(15) =NULL,
@password char(15) =NULL,
@first_name char(50) =NULL,
@middle_name char(50) =NULL,
@last_name char(50) =NULL,
@email1 char(50) =NULL,
@email2 char(50) =NULL,
@tel_home char(30) =NULL,
@tel_office char(30) =NULL,
@tel_fax char(30) =NULL,
@tel_cell char(30) =NULL,
@tel_pager char(30) =NULL,
@title char(100) =NULL,
@association char(50) =NULL,
@address_unit_num char(15) =NULL,
@address_bldg_name char(50) =NULL,
@address_street_num char(15) =NULL,
@address_street char(100) =NULL,
@address_city char(100) =NULL,
@address_province char(100) =NULL,
@address_country char(100) =NULL,
@address_zipcode char(100) =NULL,
@update_target int=0,
@error_status int OUTPUT
)
I have checked and cross referenced many times. The types and parameters between the ASP and SQL script matches exactly. I have NO idea why I keep getting this following message when this script is executed:
ADODB.Command error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/submit_changed_profile.asp, line 39
Help!
norm
|
|
|
|
|
Line 39 where the error occurs, which one is it?
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Thanks Philips, I've found it!
I fogot to include:
My mistake, and i sufferred from it for the whole nite!
norm
|
|
|
|
|
Lol, happend once to me too Good luck
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Thanks though, I guess the hard work pays off
norm
|
|
|
|
|
How can i make my site to be resizeable depending on the visitors screen size/resolution????
Challenge everything
www.programers-g.tk
|
|
|
|
|
Depends on how complex of a site you have ...
If you want to maximize the browser window and have your content fit it regardless of the size you can use javascript to resize the window:
window.resizeTo(screen.availWidth,screen.availHeight);
window.moveTo(0,0);
And then in you HTML you could use tables that have 100% for the width to take up the entire width of the screen ...
That's just a suggestion ... depends on what you want to do ...
Wally Atkins Newport News, VA, USA
|
|
|
|
|
i have built an html/asp menu:
<table>
<tr OnMouseOver="bgColor='AliceBlue' OnMouseOut="bgColor='White' .... >
<td>menu item 1</td>
<tr>
<tr OnMouseOver="bgColor='AliceBlue' OnMouseOut="bgColor='White' .... >
<td>menu item 2</td>
<tr>
<tr OnMouseOver="bgColor='AliceBlue' OnMouseOut="bgColor='White' .... >
<td>menu item 3</td>
<tr>
<tr OnMouseOver="bgColor='AliceBlue' OnMouseOut="bgColor='White' .... >
<td>menu item 4</td>
<tr>
</table>
Question is, how can you set the icon for the cursor when mouse over?
norm
|
|
|
|
|
<br />
<tr style ="CURSOR: hand"onmouseover="bgColor='AliceBlue' onmouseout=" bgColor='White' ....><br />
<td>menu item 1</td><br />
<tr><br />
|
|
|
|
|
How can I enforce a margin to a web document, I am using CSS for formating documents (I only use XML with a CMS that generates HTML, because I use both Windows and Linux :P). I have tried left-margin ... and it hasn't worked. My teacher is strick about margins. Also how can I prevent a header from being placed on the first page?
-Steven
CP Addict
By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.
For those who were wondering, actual (Linux) Penguins were harmed in creating this message.
|
|
|
|
|
have you tried:
<body topmargin="0" leftmargin="0">
Works in IE ... hope it works in others
Wally Atkins Newport News, VA, USA
|
|
|
|
|
Add this to your CSS page:
body
{
margin-left:5;
margin-top:5;
margin-right:5;
margin-bottom:5;
}
Change the values as per your requirements.
HTH.
Regards,
Rohit Sinha
Character is like a tree, and reputation like its shadow. The shadow is what we think of it; the tree is the real thing. - Abraham Lincoln
The whole world steps aside for the man who knows where he is going. - Anonymous
|
|
|
|
|
Hi all,
I'm not sure if this is the right place to post, but...
Is there any way to control the WSDL produced in a VS.NET C# Web Services Project? I'm guessing it might be something involving attributes.
Basically, I'm using SOAP to return subsets of a database, and I think DataSet et. al. may be a little to heavy-weight for what I need. An example of what I want is a SOAP function GetAuthorInfo( UINT id ) that returns an author's details as XML, conforming to a predefined Schema. I'd like to be able to specify this Schema in my WSDL file.
I'm new to the whole SOAP/XML/Web Service thing, so I'm not sure if this is a really naive way to implemnt this kind of functionality, so any comments and suggestions are most welcome.
TIA,
Pete
|
|
|
|
|
hello,
i'd like to use a file input field where the user can select a
file. if the filename is entered manually or by browsing i
can access the filename by the value property. but i also
like to set the value to different default values by
clicking on different buttons. but setting the value with
File1.value = "TEST"; during runtime does not work. the
field stays empty.
how can i change the value of the file input field?
thanks
enrico
|
|
|
|
|
The MSDN docs state that the file *path* is only available (i.e., can't set but can get) to machines in the Local Machine zone, but only the file *name* is available to machines outside said zone.
This is for security reasons. Computers on the Internet (besides your own) shouldn't be able to know anything about your system other than what you tell them. Knowing your file paths is information no one else really needs to know. Also, imagine what would happen if a web site could *set* the "value" attribute: all I'd have to do is set "style='display:none;'" on the input box and I could upload any of *your* files I wanted to without you knowing, like your personal or machine registry hives or other files for which I know the common paths.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
I have an inline frame on my webpage of which the contents and height change according to different buttons the user might push. The problem is that I that when I use the following code:
<iframe class = "tab" id = "child" FRAMEBORDER = "0" width = "90%" align = "center" onload = "ChangeChild('features.html')">
</iframe>
the web page loads but keeps loading 10 times a second and my computer keeps clicking and clicking as if I was repeatedly clicking on a link. The function ChangeChild is as such:
function ChangeChild(txt)
{
document.getElementById("child").src = txt;
document.getElementById("child").height = (window.screen.availHeight * .7);
}
Does anyone see what might be wrong with my code? I am using Internet Explorer 6.0.
|
|
|
|
|