Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. jesh

    JSP with MYSQL

    When I was programming in Java with MySQL and Tomcat, it seemed like 95% of the problems I ran into were because I forgot to add some path to my CLASSPATH environment variable. Are you referencing the MySQL driver in your CLASSPATH?
  2. Maybe you could post the answer here in case someone else has a similar problem.
  3. Just to be clear, is the record being added as a new record rather than updating the existing record?
  4. I couldn't get your code to run either. I'm not sure if it's because of the way this forum handled your text or if it's the language setting on your computer, but it looks like rather than putting hyphens where you want to subtract, there are emdashes.Instead of:return strPennies.substring(0, len — 2) + "." + strPennies.substring(len — 2, len);You might try:return strPennies.substring(0, len - 2) + "." + strPennies.substring(len - 2, len);If this doesn't help, please post any error messages you are getting and describe in more detail what about this code isn't working.
  5. You might also think about looking into VBScript. I would normally not recommend VBScript because it doesn't work in all web browsers, but it sounds like you are trying to write a script that runs on your own computer to search for files in your computer rather than over the web.Besides, VBScript is pretty similar to VBA (at least in 1998 it was) which you can use to automate tasks in Microsoft Office applications.VBScript and Excel:http://support.microsoft.com/kb/198703http://www.activexperts.com/activmonitor/w...msoffice/excel/VBScript and the FileSystemObject:http://www.computerperformance.co.uk/Logon...Windows_fso.htmhttp://www.planet-source-code.com/vb/scrip...mp;txtCodeId=44VBA:http://www.mindspring.com/~tflynn/excelvba.htmlhttp://www.vba-programmer.com/
  6. How about something like this:HTML <table cellspacing="0" cellpadding="0" border="0"> <tr><td><div id="WinnerCell" /></td></tr></table> Javascript var winner = "You!";var cell = document.getElementById("WinnerCell");cell.innerHTML = winner; Your attempt #3 might have worked if you'd tried: var Winner = document.getElementById('Winner);Winner.innerHTML = "You!"; Hope this helps!
  7. Check out the HTML DOM tutorials if you haven't already. They help explain what properties you can access/modify. Rather than getting rid of the links, you might try hiding them. Check out this google search for some examples of what I think you are trying to accomplish.
  8. And what is the purpose of that SQL query? UPDATE categorylist SET categorylist = @categorylist WHERE categorylist = @categorylist; Set categorylist = @categorylist WHERE categorylist = @categorylist? That's like set 5 = 5 WHERE 5 = 5, isn't it?
  9. jesh

    Mail

    I believe you may be missing quote marks around the value of the username. The final SQL query should look something like: SELECT act_num FROM unactivated_users WHERE username = 'duncan' Try changing your code to: $rand = mysql_query("SELECT act_num FROM unactivated_users WHERE username = '".$_POST['uname']."'") or die("Find act_num Error");
  10. jesh

    Mail

    I think I saw someone else post about this recently and I believe the answer was in the headers that get sent in the email. This link may help: http://www.sitepoint.com/article/advanced-email-php/3EDIT: I found the post - http://w3schools.invisionzone.com/index.ph...94&hl=email
  11. In Firefox, when you click on Tools -> JavaScript Console, do any errors appear when you attempt to fetch and read the XML?When you set: var doc = req.responseXML; Has "doc" been assigned any data in Firefox? Is it that the data is not there? Or is the data there and you aren't able to read/parse it?I think we're going to need more information.
  12. jesh

    Mail

    I don't know if it's just the way it is posted on this forum, but it looks like your $mailMessage string spans multiple lines. I've seen many people here post about this, so you might try changing it to something like this: $mailMessage = "<html><body>".$_POST['uname']$mailMessage .= <<<HERE<br />Thank you for registering an account with World War 6.<br /><br />To activate your account please click this address or copy it to your browser:<br /><a href='http:\\www.wasper-rocker.co.uk/activate.php?act_num=$random'title='http:\\www.wasper-rocker.co.uk/activate.php?act_num=$random'></a>.<br /><br />If you have any problems activating your account please reply to <a href='mailto:activation@wasper-rocker.co.uk?subject=Activation Problems'>this email address</a>.</body></html>HERE; Check out the manual and scroll down to the Heredoc section.If this doesn't fix it, perhaps you can let us know what error message(s) you are getting.
  13. Oh, it's just easier. I don't know whether it's more efficient.In seriousness, though, .NET seems to have done a few things right and one of them is cross browser javascript validation that is generated by the .NET validation controls. However, with that being said, I have written my own validation scripts in certain situations and in these cases I've generally used the <asp:CustomValidator /> control.Check out this link: http://aspnet.4guysfromrolla.com/articles/073102-1.aspxBasically, the gist of it is that you create a javascript function similar to the following: <script type="text/javascript">function validateForm(sender, args){ bool isValid = false; // do the typical validation here. // if it turns out that the form validates, // set isValid to true; // then, simply set the value of the IsValid property // of args to your isValid boolean. args.IsValid = isValid;}</script> Check out that article for more information. And look at W3 Schools tutorial if you need some advice on validating forms in general using javascript. In the tutorial, rather than returning true or false, you'll want to set the args.IsValid property to true or false.Good luck!
  14. I'd honestly recommend running through the tutorials here at W3 Schools. I'm a programmer today in large part because of what I've learned on this site.Once through the tutorials, you might look into the O'Reilly books. I've always found them to be extremely informative and well written.
  15. I'm not aware of any client-side (i.e. javascript) method of connecting to a database on a server. I believe you're going to have to use a server-side script (i.e. php, asp, etc.) to accomplish this. Maybe this page'll help: http://builder.com.com/5100-6371-5160904.html
  16. Thanks for all the input, everyone. Yeah, I think you're right. I've mostly always used px sizes, but I was working on a theme editor for our site and one of the guys here suggested changing the sizes to "x-small", "small", etc. It seems to be working well, but I haven't tried it on the mac yet, nor in Opera. I've got my fingers crossed!
  17. Haven't used PHP in awhile, but this should pull the file from the parent directory: include('../library.php'); And this should pull it from the root directory: include('/library.php');
  18. Also, you should probably close the connection before you redirect the user to another page. Response .Redirect ("registrationcompleate.aspx");conn.Close(); Should probably be: conn.Close();Response.Redirect ("registrationcompleate.aspx"); And watch out for SQL Injection. You might consider changing your SqlCommand text to something like this: cmd.CommandText = "INSERT INTO Login (Username, Password) VALUES (@Username, @Password)"cmd.Parameters.AddWithValue("@Username", tb1.Text);cmd.Parameters.AddWithValue("@Password", tb2.Text);
  19. If you are using Visual Studio and ASP.NET, have you considered using the <asp:RequiredFieldValidator /> controls? They render javascript to the client so that you don't have to write it yourself.
  20. What's the best way to declare font-sizes? Should I use the relative "xx-small", "small" sizes? Should I specify them in pixels? ems?I want the text to be the same size in all browsers (when browsers are set to default text size) while still allowing visitors to increase the text size (e.g. CTRL + + and CTRL + - in firefox allows you to change the font size).I seem to remember that "small", "medium", etc. were introduced to allow people to change the font-sizes in their browsers, but I also seem to remember that different browsers treated these sizes differently.Any ideas?
  21. http://www.w3schools.com/asp/showfile.asp?...etextensionname
  22. You might try these links:http://www.dynamicdrive.com/dynamicindex17/floatbar.htmhttp://www.cssplay.co.uk/layouts/basics2.html
  23. I have a couple suggestions.To help ease the amount of processing the client computer will need to do, you might consider changing your code to something like this: var date = x[j].childNodes[1].getAttribute('date');if ((date>=thisday) && (date<=tomday)) As to why it's not working in IE, my guess is that perhaps IE treats javascript dates a little differently. You might want to temporarily add an alert in there for debugging purposes to see if this is the case. Something like: alert("attribute: " + date + "\nthisday: " + thisday + "\ntomday: " + tomday);
  24. I agree. Reading about coding online has one major advantage, however, in that there are usually links to examples and a lot of times you can try out the product of the code right there. But online stuff just never goes into the level of detail that is available in books.Plus, it's hard to lug around my monitor and CPU whereas I can throw a book in my bike bag.
  25. Speaking of this (and I think it's because I brought up the possibility), is there a way to set up a table so that a specific column has as its default value an arithmetic calculation of two (or more) other columns? Or is this only possible in the INSERT query.To further this, does it make sense to have a column in a table which is a calculation of other columns in the same table? Would it make more sense to perform the calculations in the application code rather than storing it in the database?
×
×
  • Create New...