Jump to content

shaffiq_fiq88

Members
  • Content Count

    37
  • Joined

  • Last visited

Everything posted by shaffiq_fiq88

  1. <!doctype html><html><head><meta charset="utf-8"><title>Untitled Document</title><style type="text/css">.sectionseparator { background-image:url(/asset/image/accordion_icon_sprite.png); background-position:0px 0px;}.sectionseparator:hover { background-image:url(/asset/image/accordion_icon_sprite.png); background-position:0px 101px;}.sectionseparator.open { background-image:url(/asset/image/accordion_icon_sprite.png); background-position:0px 27px;}.sectionseparator.open:hover { background-image:url(/asset/image/accordion_icon_sprite.png); background-position:0px 64px;}</style><script language="javascript" type="text/javascript">function imgHover(o){ //what script shoud I put here??};function showHideInfo(o){ //Don't worry about this. Already done.};</script></head><body><a id="section-spg" href="#" onClick="showHideInfo(this);" onMouseOver="imgHover(this);"><img id="section-spg-img" src="/asset/image/invis.gif" width="27" height="27" class="sectionseparator" style=" position:absolute;margin-top:5px;"> <div style="display:inline-block; position: relative; top:6px; left:35px;">SPG</div></a><div id="spg-info">SPG Info</div></body></html> I want background image of 'section-spg-img' changed as 'sectionseparator:hover' when I hover mouse in any region within 'section-spg'. I've searching and try every event method. Either I'm stupid enough and failed or I'm not understand anything about event. Image sprite contain {+,hovered +, -, hovered -}. showHideInfo() change either + or - of the image and show or hide 'spg-info'. (success) imgHover() change either hovered + or hovered - of the image. (failed) Example : http://www.microsoft.com/en-us/download/details.aspx?id=30653 (Detail, System Requirement, etc...) I don't wanna use jQuery. Thank you.
  2. I want to capture keypress event while passing other value in function. I've already and still googling but still not found the answer.Here is the coding : function inputkeyup(i){if (event.keyCode!==13){// do something like thisalert(i.value)};};<input name="myipt" type="text" id="myipt" size="15" maxlength="12" onKeyUp="inputkeyup(this)"><input name="myipt2" type="text" id="myipt2" size="15" maxlength="12" onKeyUp="inputkeyup(this)"> Latest Firefox console tell "ReferenceError: event is not defined" and the code is not functioning How to make it working? No jQuery please because I will learn nothing. Thanks for any help.
  3. function keyE(e,n,v) {// some function here}; function editProp(n) {// the caller is a button with function onClick="editProp('userID')"// n = 'userID'var dStr = document.getElementById(n).innerHTML;document.getElementById('f_' + n).innerHTML = '<input type="text" name="i_' + n + '" id="i_userID" value="' + dStr+ '" onkeypress="keyE(event,' + n + ',this.value)" />'; //error heredocument.getElementById('i_' + n).focus();document.getElementById('i_' + n).setSelectionRange(0,dStr.length);} // debug with Mozilla Firefox 15.0.1 Developer Tools The editProp(n) function generate error and I don't know how to fix it. The error is at document.getElementById('f_' + n).innerHTML = '<input type="text" name="i_' + n + '" id="i_userID" value="' + dStr+ '" onkeypress="keyE(event,' + n + ',this.value)" />'; The phrase onkeypress="keyE(event,' + n + ',this.value)" generate error "userID is not defined". userID is a string defined in n variable but it detect it as a variable. How to fix it? Thanks for any help provided.
  4. What happen?The page generate an error. The server can't tell the real error to the client/remote computer for security reason (to protect your source code). I'm the client and I can't see the real error. Only testing server can tell the error. The testing server is your computer. So you must run the page from your localhost.How to solve?The error generated is not the real error. To view the real error, run the page on localhost and it will show your real error (not the error that you see on ns-llc.com). After that, you can solve your problem.I hope this will solve your problem.
  5. Dim MyCommand As New SqlCommand("Select * From MyTable Where MyField = @MyQString", MyConnection)MyCommand.Parameters.Add("@MyQString", SqlDbType.VarChar)MyCommand.Parameters("@MyQString").value = Request.QueryString("courseID") I'm not really sure about those script because I'm using ADO.NET (OleDbCommand, OleDbConnection, OleDbParameter). You are using MySQL and I think those script should work. Give a try.
  6. I have a problem. How to know which button is clicked by the user and how to do it across a frame?PAGE.HTML <html><head><script type="text/javascript" src="pathToModalScript/dhtmlModal.js"><script type="text/javascript">function OpenModal(){var MyModal=dhtmlModal(ModalData)MyModal.onClose=function(){// When button click, the modal will close and before close, all code is processed here.// My problem start here. I don't know to replace ButtonA clicked, ButtonB clicked with what conditional syntax.if (ButtonA clicked) {// Button A code. I don't have problem here.} elseif (ButtonB clicked) {// Button B code. I don't have problem here.} else {// Other button code. I don't have problem here.}// My problem end.return true //close modal after process data from modal.}}</script><body><a onClick="OpenModal()">Open My Modal</a>/* This iframe is generated on-the-fly automatically by the dhtmlModal.js when Open My Modal link is click. So the iframe is the modal window.<iframe width="100%" height="150" src="modal.html"></iframe>*/</body></html> MODAL.HTML <html><head></head><body><form name="MyForm" id="MyForm"><input type="Button" id="ButtonA" name="ButtonA" value="Yes" onClick="parent.MyModal.hide()" /><input type="Button" id="ButtonB" name="ButtonB" value="No" onClick="parent.MyModal.hide()" /><input type="Button" id="ButtonC" name="ButtonC" value="Cancel" onClick="parent.MyModal.hide()" /></form></body></html> How to know which button is clicked? The problem is, Modal.html is in iframe and I don't know how to create function to detect which button is clicked.I got the script here http://www.dynamicdrive.com/dynamicindex8/.../dhtmlmodal.htmAny help is really appreciated. Thanks.
  7. Thanks. Now, I understand it. Thanks so much.
  8. Hello.I'm new to PHP, a beginner. I downloaded a text editor and the only server scripting use by the text editor is PHP. I want to rewrite the script to ASP server scripting. However, I found a syntax that I don't understand. I'd tried searching in google and W3Schools.com but didn't find its function. $_GET['dir'] = $_POST['dir'] ? $_POST['dir'] : $_GET['dir']; What is the function of that syntax?
  9. I'll try my best to answer the problem.First correction :You use a function within a function. It is like a wheel. There is no ending. This is your code. Function A(ByVal vA As String, ByVal vB As String) As String Dim ReturnVal As String = Nothing A("Data for vA","Data for vB") Return ReturnValEnd Function You make function A but you call function A in function A. You make function login and you call function login in function login. There is no ending. So when you execute the script it will be like this :Step 1 :Execute login function.Step 2 :Execute login function while the current login function is running.Step 3 :Execute login function within the login function while the login function is running withing a running login function.Step 4 :Step 3 + Step 2Step 5 :Step 4 + Step 2Step 6 :.......................Second Correction :Avoid use button to call a function. Use button to call a method sub. It is a little complicated to call a function with a button because you have to add event handler by using AddHandler method. If you using sub procedure, it is more simple. Public Sub DoLogin() Handles ButtonId.Click If Login(UserID.text,Password.text) = True Then LoginMsg.text = "Your ID is true" Else LoginMsg.text = "Try again." End IfEnd SubPrivate Function Login(ByVal fUserID As String, ByVal fPassword As String) As Boolean Dim ReturnVal As Boolean = False 'Some code for login Return ReturnValEnd Function One more thing, this is .NET programing. You should transfer this post in .NET room so there will be more people can help you.
  10. You use ASP, meaning that you use code block that need to be processed by the server. So there is no any chance that the visitor can download the .asp page even if they know where it is.<%@Language="VBScript"%> directive will make sure and always make sure that the .asp page is processed before it can be viewed. If you .asp form handler just contain code block, it mean nothing to be viewed. If the visitor load the page by typing the URL ie:http://yourdomain.com/process.asp, it will only show a blank page with blank page source unless there is coding error made by yourself.Anyway, it is about form processing. You may put conditional variable to make it safer.If request.form("dataA") = "" ThenResponse.Redirect("/error.asp")Else'ContinueEnd IfOr you may create a session variable.Also try to avoid using On Error Resume Next.The main thing is, turn off directory listing.That is all I can give. Hope others can give you more satisfy solution.Happy scripting.
  11. *.dbf extension is DBase type database. The provider for this type of database is Microsoft.Jet.OleDb.4.0 (Microsoft Jet OLEDB Provider). Meaning that it can make database connection to the DBase file.You also have second choice. You may use Access 2007 application to convert from DBase to Microsoft Access Database. Make sure to create a backup copy of the original DBase file before making any conversion.
  12. I'm using Windows 7 too. Of course .NET Framework can be turn on from Windows Features On/Off but if some error happen, you can try to download the redistributable package of .NET Framework from Microsoft.com. Just download version 3.5 and 4.0. 3.5 contain full distribution of 2.0 and 3.0.If the error involving IIS, it mean that your installation sources is missing something. IIS come with Windows installation so you may have to repair your system or in worst case you have to reformat your system.One more thing, if post this thread in .NET forum room, I think you will get more help. This is ASP forum room.Happy learning.
  13. Try using ASCII Character. <input type="text" name="uid" value="fr" & Chr(232) & "d" & Chr(232) & "ric" /> or <input type="text" name="uid" value="frèdèric" /> or <input type="text" name="uid" value="fr&#232;d&#232;ric" />
  14. Try import and use System.Windows.Forms.DataVisualization.Charting namespace. Must have .NET 4.0.
  15. I'm sure it is about Administrative Permission. Check the setting. Hope you already find the solution.
  16. I'd try it. It works fine. Dim NumValNumVal = Int([i]from database[/i])If Not isNumeric(NumVal) ThenResponse.Write "Not a set of number."ElseResponse.Write "A set of number is processed." ' This line is returned in my browser. Please check your script and database once again.End If
  17. ASP does not support including file dynamically but you can execute it dynamicly by using Server.execute(file).Please try.
  18. No really understand with your demand. If you have install IIS, just placed you page into "C:\inetpub\wwwroot" and run "http://localhost/yourpage.asp".There is no much for the setting unless the security and read/write permission.
  19. VBScript is better. JScript also better. VBScript and JScript both Microsoft Technologies and for server side scripting.Javascript is a browser language. Too dangerous for security application but reliable to perform a graphic interface of website.Class can be made by using VBScript and JScript, not JavaScript. Class make your script much simple.I prefer VBScript. I am a website and application designer and developer. My clients majority are schools. Lots of client want to integrate their website with internal application. VBScript better run on windows and give more better synchronization with the website implemented in ASP or ASPX.
  20. It is quite a long script to do that. In VBScript, it is long but simple than VBScript.NET.To add, just use addition operator (+). ' This is VBScriptSub Calc()Box1 = document.getElementByID(txtBox1).valueBox2 = document.getElementByID(txtBox2).valueBox3 = document.getElementByID(txtBox3).valuedocument.getElementByID(txtBox2).value = Box2+Box1document.getElementByID(txtBox3).value = Box3+Box1End Sub Above script is VBScript but what you implement is VBScript.NET ' This is VBScript.NET' Not a true code. Just give you an idea.Sub Calc(ByVal s As Object, ByVal e As EventArgs) Handles.Button1Box1 As Integer = dtxtBox1.textBox2 As Integer = dtxtBox2.textBox3 As Integer = dtxtBox3.textdtxtBox2.text = Box2+Box1dtxtBox3.text = Box3+Box1End Sub To make it simple, make a class library. Public Class Calculation Public Property Data(MyData As Something) Get End Get Set End Set End Property Public Sub Calc() End SubEnd Class This post should be moved to .NET forum. Not to post here. Good luck.
  21. Sub test()Dim strSelFile As StringDim strNewLoc As StringMsgBox ("Select file to copy")With Application.FileDialog(msoFileDialogFilePicker)If .Show = False Then EndstrSelFile = .SelectedItems(1).AllowMultiSelect = False.Title = "Location to output new file to"End WithMsgBox ("Select location to output file to")With Application.FileDialog(msoFileDialogFolderPicker)If .Show = False Then EndstrNewLoc = .SelectedItems(1).AllowMultiSelect = False.Title = "Location to output new file to"End WithFileCopy strSelFile, strNewLocIf MsgBox("Do you want to delete the source file?", vbYesNo) = vbNo Then Kill (strSelFile)MsgBox ("Done!")End Sub Quite a mess. Try make it simple. Here a sample. Try to evaluate it.Regarding the "don't want delete." part, I'm quite sure that the problem is within FileCopy function. Try to re-check. Avoid using "With" procedure. Try using only "If...[ElseIf]....End If". Use MsgBox and Exit.... function. Option ExplicitDim GDlg, GPathDim .............Sub GetFileFr()Set GDlg = WScript.CreateObject("Shell.Application")Set GPath = GDlg.BrowseForFolder(&H0, "Select file:", &H4000, 17)If GPath Is Nothing ThenMsgBox "No file selected.", vbOK, "Error"Exit SubEnd IfGetFileFr = GPath.ParentFolder.ParseName(GPath.Title).PathEnd SubSub FileGoTo()'Your codeFileGoTo = FPath.ParentFolder.ParseName(FPath.Title).PathEnd SubSub CopyFileTo(StrFile, StrPastePath)' You CodeEnd SubSub StartCopy() CopyFileTo GetFileFr, FileGoToEnd SubStartCopy() ' or attach to object event as you wish ie:<input value="Copy" type="button" onClick="StartCopy()" />
  22. Welcome. Good decision. It is better to play it safe because if the session is always altered it will give a problem to the users.OK. Here the situation.The IIS is a platform or a web server application and set of feature extension modules created by Microsoft for use with Microsoft Windows. In IIS, you can create a lot of domain, mainly in website hosting package industry. The IIS will set the default setting for all domain in the server.If you own a server, you can set all the applicable setting insted using Global.asa.If you use a hosting package, there is no way you can change that setting. So the only way to change those settings by using Global.asa.Some example here. You own server A. You have somesiteA.com, somesiteB.com and somesiteC.com in the server A. You can set the timeout in IIS because you want all domain have the same timeout=30. But somesiteC.com need more timeout where timeout=40 while somesiteA.com and somesiteB.com use the same timeout as set in the IIS which is timeout=30. So you use Global.asa, set the timeout=40 and place it in somesiteC.com So there is nothing override nothing. The flow is simple.If no Global.asa.User start browse (start application) >> Request Procedure occur >> Request IIS >> Registry - Global.asa enable >> Request Global.asa >> No Gobal.asa >> Request IIS >> Send to User.If Global.asa exist.User start browse (start application) >> Request Procedure occur >> Request IIS >> Registry - Global.asa enable >> Request Global.asa >> Send to User.In hosting plan or package, a lot of provider disable the registry of global.asa to avoid network attack such as hacker and virus.Actually, the question that you asked is about server. I'm not standard qualifiable to advice you with this problem. So make sure you ask someone professional about this, after this.About the session.timeout, the session is mainly used in an internal website system or application such as registering a user or logging in a user. It is best to look in from the base of the security purpose.As an example. A visitor fill a registration form. The visitor click the submit button and the information is sent to the script to be added to the database. A form that have a lot of information may need a long period to complete the AddNew procedure depend on the network traffic and the user connection So you already set the timeout in the script where the timeout=10 for idle. So if the procedure of adding to the database is exceed the limit of the timeout, you will get the session expired page. This method is to prevent the network attacker from altering the data that being processed while submitting the data. In other view, the session may be needed to be added in the upload form. Big data to be uploaded need a lot of time. So make sure to set the timeout as needed. If you use the timeout, make sure to set it to the default timeout after every procedure. If your global.asa set timeout=20, the set it back to 20 after completing any procedure that you use timeout.If there is no other session object to be use or you want to ignore others session object, you can use the session.abandon() property that will burn all the session and set any applicable default session to the default state.That all that I have and the best that I can give you.
  23. Is it an ASP.Net script? Why posted here? Hope you already solve it. If not, please move here (.NET Forum). It is more easier to find the answer of ASP.Net there. Just try to help. Thanks.
  24. Welcome :)About the altered session, I'm not really sure but I already test it 10 minutes ago. Here some workflow. If Global.asa is set with Session.Timeout = 20If PageA.asp is set with Session.Timeout = 25If PageB.asp is set with Session.Timeout = 30If PageC.asp is not set.If only PageA.asp executed, the session will be 25 minutes.If only PageB.asp executed, the session will be 30 minutes.If only PageC.asp executed, the session will be 20 minutes.But If PageB is executed first, the session will be 30 minutes.Then you execute PageC.asp, the session will be also 30 minutes.Thus I think that even you change a session at a page, other page that doest't set with session.timeout will follow the session state of the previous page. You can use session.abandon() to restore to the default timeout state before procede to other page. The session.timeout itself is a property. It differ from the response.cookies that had path and domain as it properties. So the session.timeout is a global method. W3Schools Reference Microsoft Reference
×
×
  • Create New...