Jump to content

lugos

Members
  • Content Count

    61
  • Joined

  • Last visited

Everything posted by lugos

  1. Hello,I'm fairly new to PHP. Is parameter substitution possible/necessary using PHP and MySQL to prevent SQL injection attacks? Are there any other methods that can be used to protect oneself from those types of attacks?Thanks.
  2. I found that this isn't possible. But I may be able accomplish my goal by creating a scheduled task for the executable and then start it through my application.Thanks.
  3. Hello,C# newbie here. I am running an executable on a remote machine with the following code: Process remoteProcess = new Process();ProcessStartInfo remoteProcessStartInfo = new ProcessStartInfo();remoteProcessStartInfo.CreateNoWindow = true;remoteProcessStartInfo.ErrorDialog = false;remoteProcessStartInfo.RedirectStandardError = false;remoteProcessStartInfo.RedirectStandardOutput = false;remoteProcessStartInfo.UseShellExecute = false;remoteProcessStartInfo.FileName = "\\\\<remote_machine>\\winnt\\NOTEPAD.EXE";remoteProcess.StartInfo = remoteProcessStartInfo;remoteProcess.Start();remoteProcess.WaitForExit();remoteProcess.Dispose(); This accomplishes part of what I want to do. However, what I am seeing is that notepad is opening up on my local machine. It almost looks like it's downloading an instance of the notepad exe and running it locally. What I am looking to do is run it on the remote machine and have it open up there.Any assistance/direction would be greatly appreciated.Thanks in advance.
  4. Hopefully you've gotten your answer by now, but if you haven't, you would need to download the JavaMail API and, if you're not using Java SE 6, you will also need to download the JavaBeans Activation Framework. Once you've downloaded and added to your project/classpath, something like this may help:// Send e-mail// Get system propertiesProperties properties = System.getProperties();// Setup mail serverproperties.setProperty("mail.smtp.host", "smtp.mail.yahoo.com");// Get the default Session object.Session session = Session.getDefaultInstance(properties);// Create a default MimeMessage object.MimeMessage message = new MimeMessage(session);// Set the RFC 822 "From" header field using the// value of the InternetAddress.getLocalAddress method.message.setFrom(new InternetAddress("user@yahoo.com"));// Add the given addresses to the specified recipient type.message.addRecipient(Message.RecipientType.TO, new InternetAddress("webmaster@mywebsite.com"));// Set the "Subject" header field.message.setSubject(mySubjVar);// Sets the given String as this part's content,// with a MIME type of "text/plain".message.setText(myMsgVar);// Send messageTransport.send(message); User variables where appropriate.
  5. lugos

    File Watch

    The Java File class is where you'll want to start. I looked around a bit but could only find this and this on what you are specifically trying to accomplish.Hope that can get you started.
  6. I assume you're running it in some kind of servlet container or Java app server like Tomcat, JBoss, GlassFish, etc., correct? If the other pages work it may be a configuration problem. Are you using a framework? Can you post the code?ThanksEDIT: Sorry, didn't realize this post was from 2007. Pls ignore my response as the original poster probably (hopefully) has found the answer to their problem...
  7. For job scheduling, there's the Java Timer API (java.util.Timer) and there is also Quartz, an open source job scheduling system.For the DB connection there's JDBC and there are also open source persistence frameworks out there like iBatis and Hibernate.There's also a framework called Spring (you may have heard of it) that has a scheduling system and JDBC database access built into it. Hibernate and iBatis can also be integrated into a Spring application if you choose to go with either over JDBC. It's one of the more well known and widely used open source J2EE frameworks.As far as exporting the data to an excel file, I've never tried it but it'd be interesting to see how that's done. I'll see if I can look into that a little more.
  8. Try adding the following attribute:session="true" To one of the page directive in both JSPs.It should then look like this: <%@page language="java" import="java.sql.*" session="true" %> Hope that helps.
  9. Try changing the percent sign to a dollar sign.
  10. lugos

    Visual Basic Dataset

    Hello,I have a DataSet object with data organized in a specific way. Is there an easy way to reorganize that data? For instance, I thought maybe I could create an XML schema file to define how I want to see the data and then read that into the DataSet. But as I thought about it some more, I'm not sure that will work.Any assistance would be greatly appreciated.
  11. Does anyone know of a tutorial for creating a VB, C# and/or C++ .NET web application? I'm primarily interested in a VB tutorial, but I would like to look at C++ and C#.Thanks.
  12. lugos

    Simple Query

    It may not be as simple as one would think. You can start here, here, here, and here.
  13. Have you tried the onkeypress event?By the way, what event are you using now to execute the javascript code when the button is clicked?
  14. There's open source forum platforms like phpbb and open source blog platforms like wordpress. You can download and install them on your server and have a community of users like this forum, or a blog where you post messages and people comment and respond like dustin diaz's website.
  15. lugos

    Help

    Did cleaning the project do that?
  16. lugos

    Help

    Have you tried cleaning the project after you changed the name? Project -> Clean...My experience (I also use Eclipse) with changing project names is that it is almost certain to cause problems. I might not be doing it the right way, but I'd much rather create a new project, copy the files over, and then delete the old project.
  17. lugos

    Help

    Hello,I'm not too familiar with Swing, as I am more of a Java web app developer, but my Java book states the following about Menus under a section titled 'Using Menus with Frames':"In Swing GUIs, menus can be attached only to objects of the classes that provide method setJMenuBar. Two such classes are JFrame and JApplet. The classes used to declare menus are JMenuBar, JMenu, JMenuItem, JCheckBoxMenuItem and class JRadioButtonMenuItem."Hope this helps.
  18. lugos

    locale

    Hello,Is it possible to set the locale for the Javascript Date utility? We have offices in the far east, but we need to make sure that the date that is sent to our servers, which reside on the east coast of the U.S., is the date here in the U.S., not the date over there.Thanks in advance for the assistance.
  19. lugos

    Survey app

    Hello,I would like to create a very small and simple PHP app to conduct an anonymous survey. The survey would be about 10 questions max, and there would be 4 or 5 possible answers for each. I would also like to store the results in a table. What would be the best way to set up the table? Should I have a row for each question and then 4 or 5 integer columns that are only updated if the user has selected that specific answer to that question? For instance if the user answers option 2 for question number one, then I would update row one, option_2_column_name. Any thoughts/ideas?Thanks in advance.lugos
  20. lugos

    Sending e-mails

    I'm trying to run it locally using Apache on Win XP . Is there anything I have to do to the php.ini file? Do I have to set the SMTP server? I also read somewhere that PHP does not support SMTP authentication. Is that correct?Also, I am hosting my site using a Linux web server that I set up myself. The distribution of Linux is Ubuntu. It fails to send messages on the web server also.Thanks.
  21. lugos

    Sending e-mails

    Hello,I am fairly new to PHP development and I'm trying to send e-mails using the following code:<?php$to = "myemailaddress@myisp.com";$subject = $_POST['subject'];$body = $_POST['message'];$headers = "From: " . $_POST['emailAddress'] ."\n";if (mail($to,$subject,$body,$headers)) { echo("<p>Message sent</p>");} else { echo("<p>Failed to send message</p>");}?>For some reason it does not work. I keep getting the failure message. I have verified that all of the values are being passed.Any help would be greatly appreciated.Thanks in advance.
  22. lugos

    Floating div

    Simple enough. How easily I forget; I haven't been doing much HTML development lately and put my own website on hold during the school semester. I actually tried going to your website first and saw that it was under construction. I look forward to seeing it once it's done.Thanks for the help.
  23. lugos

    Floating div

    Hello,Here is the code I am having trouble with:<table><tr id="fundingAmount"> <td style="padding-bottom: 0; width: 150px;"><strong>Amount:</strong><div style="float: right; font-size: 12px; margin: 0; display: inline;">$</div></td> <td style="padding-bottom: 0; width: 150px;"><input type="text" name="amount" maxlength="20" /></td></tr></table>I want the $ sign to be on the right side of the first column, on the same line. However, the code above puts it to the right and on the next line. I hope that's not confusing. If you copy and paste it, you'll see what I mean. I've tried a few things but nothing seems to work.Any help would be greatly appreciated.Thanks,lugos
  24. lugos

    Blog-like DB structure

    Hello,I'm relatively new to SQL and databases in general. I am not too familar with the terminology. I want to do a personal website where I can post messages and allow people to respond (similar to a blog). For the database structure/design, I was thinking of having one table for my original message, and in that table including an INT column that the database automatically increments every time a new row is created (it will be a unique field). The number generated by the database will then be used as a key/identifier in another table that contains the responses. That key/identifier will be used to link the responses to my original message. I hope that makes sense.So basically my question is if this sounds like it can work? Also, feedback and/or suggestions will be greatly appreciated. If there is a better way I would gladly consider it.Thanks,lugos
×
×
  • Create New...