PHP/mySQL code help please

Hi all,
Thanks to David Powers fab tutorial I am now well on my way to competeing my first dynamique website using PHP/mySQL, (thanks David ), however I am stuck on one particular area....can anyone please help?
I know that the mySQL database uses the format YYYY/MM/DD for dates, and that is fine. I've sorted out how to display in a more regular format (eg. 1st September 2011) for my application, but I am stuck on how to convert a more regular formatted date entered by the site user into the mySQL format.
Ideally I would like for the users entry or say either 1/9/11 or 1-9-11 (or something along those lines, to be recognised and displayed on the entry form, but to have a backend function that converts the data to mySQL format. I seem to be reading plenty of forum posts which say this can be done, but unfortunately I can't quite seem to fathom how, or where the code should sit. Would someone mind taking a look at my code page to actually identify what I need to insert, and equally as importantly...where!!!
Along these lines...is it possible to have a mini-calendar date picker that could be embedded next to the date entry field to ensure that a valid date is entered and in the correct format? Where could this be sourced?
Thanks in advance of some much needed help
Mark

This is becoming really frustrating for me (so god knows how I am to you!!!!), but I usually pick things up so fast and yet this whole PHP/SQL thing is eluding me!!
I can see (I think) how the code would work, but am struggling to see where it fits into place with my own Dreamweaver 'Update Record' code, as follows. I have spent a couple of days trawling through PHP.net and various other sites and forums before bringing my stupidity to the public domain, but I just can't seem to crack it.
This one last time then i'll leave you in peace??????
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;   
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  return $theValue;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
    $updateSQL = sprintf("UPDATE gig_guide SET `date`=%s, town=%s, venue=%s, private_or_public=%s, start_time=%s WHERE `index`=%s",
                       GetSQLValueString($_POST['date'], "date"),
                       GetSQLValueString($_POST['town'], "text"),
                       GetSQLValueString($_POST['venue'], "text"),
                       GetSQLValueString($_POST['type'], "text"),
                       GetSQLValueString($_POST['start_time'], "text"),
                       GetSQLValueString($_POST['index'], "int"));
  mysql_select_db($database_online, $online);
  $Result1 = mysql_query($updateSQL, $online) or die(mysql_error());
  $updateGoTo = "index.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $_SERVER['QUERY_STRING'];
  header(sprintf("Location: %s", $updateGoTo));
$colname_updatePost = "-1";
if (isset($_GET['index'])) {
  $colname_updatePost = $_GET['index'];

Similar Messages

  • HT5622 I have set up my ipad but cant remember the 4 digit code I put in . I cloud does not seem to have any record of me and the ipad mini keeps locking me out as i try different codes - help please

    Help please I have just got my Ipad Mini and set it up but cant remember the code I put in. I cant access settings or anything else as it has locked me out. Ive treid Icloud but it doesnt recognise tht I have registered. Can anyone give me straightforward instructions on how to start again please

    This is the guidance from Apple:
    http://support.apple.com/kb/HT1212
    Barry

  • MX / PHP / MySQL results_page help

    Desperately seeking help. I am using dreamweaver, php and
    MySql. I am building my first dynamic web page (so be easy on me, I
    am green:) and I am having troubles with a results page. I got the
    simple SearchString working just fine – but I can't get an
    advanced search page to work.
    On the search page, I have several list boxes (for simplicity
    I will only refer to two of these list boxes). The list boxes are
    in a form named form2. The list boxes allow a user to select one or
    many. Rather than listing the menu structure, I have this set up
    dynamically (pulls the info from the database).
    In the returned_results page, I have a recordset with the SQL
    e.g.: (keep in mind that form2 doesn't appear in the query anywhere
    – this might be the problem?)
    SELECT blah blah
    FROM blah blah
    WHERE RESTAURANTPRICE_ID like 'value1' AND CUISINE_ID like
    'value2'
    ORDER BY REST_NAME ASC
    Variables:
    Name; default value; runtime value
    value1 % $_GET['PRICE_Price']
    value2 % $_GET['CUISINE_Name']
    Now if I test this from the search page, the returned_results
    returns ALL columns of data, regardless of what I selected from the
    list boxes. Tested it again by changing the default variable value1
    and value2 to 1 and it will return ALL columns that meet this
    criteria, but again, this is regardless of what I selected from the
    list box.
    Somehow my returned_results query works fine on its own, but
    its not making the connection from the search page where a user
    would select their criteria.
    I can upload code if needed. What the heck am I doing wrong?

    $query_Recordset1 = sprintf("SELECT * FROM images2 WHERE key_words LIKE '%$keyword%' ORDER BY id DESC", GetSQLValueString($colname_Recordset1, "text")); 
    Why are you using the $keyword variable rather than the sprintf parameter? I don't know php, but it seems like that is your problem. Maybe try something like this:
    $query_Recordset1 = sprintf("SELECT * FROM images2 WHERE key_words LIKE %s ORDER BY id DESC", GetSQLValueString("%" . $colname_Recordset1 . "%",  "text"));

  • Iframe shows only code - Help, please!

    I'm on OS X 10.4.5 and have designed a website that uses iframes (this is a must as there is a lot of content and I do not want the page bigger than the set size, so I need a way to scroll the content within the page size (955x600). I use Firefox for myself (and it looks great) but the person I'm doing the site for uses Safari. When he sees it, needless to say, it isn't going to look right. All it's displaying is the code for the iframe page as if I'm viewing the source for the page (within the iframe on the main page). Have they fixed the problem with iframes in Safari? And if so, what do I need to make it work in both browsers? Or is there another design tactic I can use instead of iframes?
    Any help or suggestions are very appreciated.
    Thanks!
    Mac mini   Mac OS X (10.4.5)  

    I actually found my error. It wasn't code within the file but I had saved it as a .php file (based on a file I found at another website that used it for their iframe) and when I changed it to .html it worked! But thanks, again, for your advice because it caused me to research iframes and I found they were all using .html/.htm files to call on.

  • Passing variable from php into flash, help please

    Here are what I'm having:
    <?PHP
    $testVal = "This is a test";
    $test = urlencode($testVal);
    $out = "test=". $testVal;
    echo $out;
    ?>
    // and this is my flash file
    function getData() {
    // Prepare request
    var urlReq:URLRequest=new URLRequest("http://localhost/test.php");
    urlReq.method=URLRequestMethod.GET;
    var loader:URLLoader = new URLLoader();
    loader.dataFormat=URLLoaderDataFormat.VARIABLES;
    loader.addEventListener(Event.COMPLETE, completeHandler);
    loader.load(urlReq);
    function completeHandler(evt:Event) {
    var vars:URLVariables = URLVariables(evt.target.data);
    trace(" TEST = ", vars.test);
    trace(" TEST = ", unescape(vars.toString()));
    // and below is the ouput
    TEST = undefined
    TEST = test=This is a test
    I've tried with several different ways to get ONLY the value of the variable - that means I only want to have "This is a test" returned, but I either got "undefined" or the whole thing "test=This is a test", instead.
    I'm new to Flash and PHP. Please help.
    Thanks

    There's no need to write any fake variables out, Flash does not need that. OK, here's a simple PHP script like yours - I called it test.php
    <?PHP
         $testVal = "This is a test";
         $out = "test=". $testVal;
         echo $out;
    ?>
    And the AS to call it:
    var myLoader:URLLoader = new URLLoader();
    myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    myLoader.load(new URLRequest("http://www.mydomain.com/test.php"));
    myLoader.addEventListener(Event.COMPLETE, dataLoaded, false, 0, true);
    function dataLoaded(e:Event){  
        trace( e.target.data.test);
    You will see 'This is a test' traced to the output window.
    HTH

  • Bar Codes(Help Please)

    Hi,
    I want my application to read bar codes of items and to store them to my database.Please, can you tell me if it is possible with Forms6 or Forms6; if so, please explain me the procedure even I want to insert records or I want to make updates(for example the quantity of an item with its bar code).
    Thank you to answer me.Regards.

    You mean store the image of the bar code ? Why do you want to do that ? A bar code is just the graphical representation of a number. Use a bar code scanner to translate the bar code to a number and store that. It will be much better. At least then you will be able to search for your product by that number and update the record with the qty as and when you wish.

  • HT4623 icant get ipod touch to turn on. the picture says to connect to itunes. when i connect to computer it says to enter pass code but will not gog to screen to enter code.help please

    i can not get ipod touch to turn on.  it shows picture to  connect to itunes but it says to enter  pass code but will not gogto screen to enter code.  HELP PLEASE

    See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...
    Be sure to Follow ALL the Steps...

  • Need a little code help please

    I am writing a program that shows a house with some clouds moving a the top. I have all the class compiling correctly, when it runs the clouds and background are painted over the house. I think I am just missing something small here. Can someone help me please. Thanks.
    public class BallApp extends javax.swing.JFrame {
      public BallApp (String title) {
        super(title);
        this.setSize(600, 450);
        this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
        this.add(new BallPanel());
        this.setVisible(true);
        this.add(new LinePanel());
        this.setVisible(true);
      public static void main (String [ ] args) {
        BallApp app = new BallApp ("Chapter 7: BallApp");
    public class LinePanel extends javax.swing.JPanel
       private SmartLine _myLine, _myLine2, _myLine3;          //instance variables for lines
       private SmartLine _myLine4, _myLine5;
       public LinePanel()
         super();
         _myLine = new SmartLine(210, 290, 210, 365, java.awt.Color.BLACK);  //creates lines sets position/color
         _myLine2 = new SmartLine(290, 290, 290, 365, java.awt.Color.BLACK);
            _myLine3 = new SmartLine (210, 365, 290, 365, java.awt.Color.BLACK);
         _myLine4 = new SmartLine (200, 300, 250, 245, java.awt.Color.BLACK);     
         _myLine5 = new SmartLine (250, 245, 300, 300, java.awt.Color.BLACK);
         this.setBackground(java.awt.Color.BLUE);     //sets background color
       public void paintComponent (java.awt.Graphics aBrush)
         super.paintComponent(aBrush);          //method paints lines on to panel
         java.awt.Graphics2D betterBrush = (java.awt.Graphics2D) aBrush;
         _myLine.draw(betterBrush);
         _myLine2.draw(betterBrush);
         _myLine3.draw(betterBrush);
         _myLine4.draw(betterBrush);
         _myLine5.draw(betterBrush);
    } //end of class
    public class BallPanel extends javax.swing.JPanel implements Mover {
        private final int INIT_X = 75; // attributes
        private final int INIT_Y = 75;
        private final int INIT_X1 = 0;
        private final int INIT_Y1 = 0;
        private final int DIAMETER = 60;
        private final int INTERVAL = 100;
        private BouncingBall _ball, _ball2; // components
        private MoveTimer _timer;
        public BallPanel () {
         super();
         _ball = new BouncingBall (java.awt.Color.white, this); 
         _ball2 = new BouncingBall (java.awt.Color.white, this);
         _timer = new MoveTimer(INTERVAL, this);
         //this.setBackground(java.awt.Color.blue);
         _ball.setLocation(INIT_X, INIT_Y);
         _ball.setSize(DIAMETER, DIAMETER);
         _ball2.setLocation(INIT_X1, INIT_Y1);
         _ball2.setSize(DIAMETER, DIAMETER);
         _timer.start();
        public void move() {
         _ball.move();
         _ball2.move();
         this.repaint();
        public void paintComponent (java.awt.Graphics aBrush) {
         super.paintComponent(aBrush);
         java.awt.Graphics2D betterBrush =
             (java.awt.Graphics2D) aBrush;
         _ball.fill(betterBrush);
         _ball2.fill(betterBrush);
    }

    ok.
    public interface Mover {
        public void move();
    public class BouncingBall extends SmartEllipse implements Mover {
        private int _changeX, _changeY; // attributes
        private final int MOVE_LEN = 5;
        private javax.swing.JPanel _panel; // peer object (and container)
        private javax.swing.Timer _timer;
        private double nextY;
        public BouncingBall (java.awt.Color aColor,
                             javax.swing.JPanel aPanel){
         super(aColor);
         _changeX = MOVE_LEN;
         _changeY = MOVE_LEN;
         _panel = aPanel; nextY=75;
        public void move() {
         int nextX = (int)this.getX() + _changeX;
         if (nextX <= this.getMinBoundX()) {
             _changeX *= -1;
             nextX = this.getMinBoundX();
         else if (nextX >= this.getMaxBoundX()) {
             _changeX *= -1;
             nextX = this.getMaxBoundX();
         this.setLocation(nextX, nextY);
        public int getMinBoundX() {
         return (int) _panel.getX();
        public int getMaxBoundX() {
              return (int) (_panel.getX() + _panel.getWidth()
                    - this.getWidth());
    public class MoveTimer extends javax.swing.Timer {
        private Mover _mover; // peer object
       public MoveTimer (int anInterval, Mover aMover) {
          super(anInterval, null);
          _mover = aMover;
          this.addActionListener(new MoveListener());
       private class MoveListener implements java.awt.event.ActionListener {
         public void actionPerformed(java.awt.event.ActionEvent e){
            _mover.move();
    public class SmartLine extends java.awt.geom.Line2D.Double
       private java.awt.Color _lineColor;
       private final int STROKE_WIDTH = 2;          //makes width of line constant
       private double X1, Y1, X2, Y2;          //set as instance variables that are doubles
       public SmartLine (double X1, double Y1, double X2, double Y2, java.awt.Color aColor)
         _lineColor = aColor;          //constructor
         setLine(X1,Y1,X2,Y2);
         X1 = 0;                    //sets intial positions to 0
         Y1 = 0;
         X2 = 0;
         Y2 = 0;
       public void setLineColor (java.awt.Color aColor)
         _lineColor = aColor;          //method for setting the color of the lines
       public void setLocation (double X1, double X2, double Y1, double Y2)
         this.setLine (getP1(), getP2()); //method for setting location of lines             
       public void draw (java.awt.Graphics2D aBrush)
         java.awt.Color savedColor = aBrush.getColor();        //method draws the line with color set
         aBrush.setColor(_lineColor);
         java.awt.Stroke savedStroke = aBrush.getStroke();
         aBrush.setStroke(new java.awt.BasicStroke(STROKE_WIDTH));
         aBrush.draw(this);
         aBrush.setStroke(savedStroke);
         aBrush.setColor(savedColor);
    } //end of class

  • Code Help Please.

    I am havong trouble getting equations to work on my calculator.
    I have the basic going, but as soon as I try to add any more to it at this point it will not compute.
    I need to add commission to the 20% and 5% based on the T1 and T2 x $25.00.
    Can a figure only be used once in any equations?
    I need to use the input for T1 to generate different #'s in 2 other fields.
    Here is a link to it,
    www.thepowderzone.com/Calculator.htm
    Could someone please help?

    Bump!!

  • Trouble with some code  help please

    i need help with this program i have to do a webclient in java i will put here the instructions that were given to me and then the work i have been doing so you can have an idea of what i'm doing any help you give me i will be very thankful thanks.
    Here are the instructions
    The class WebClient will represent a simple web client. This class must provide the following functions:
    1. connect to a web page using a URL
    2. obtain or get the response from a server
    This funcionality will be provided by the public interface of the class:
    - WebClient( )
    Creates a new object of the class
    - void setURL(String url)
    Used to indicate the URL of the web page
    - String getResponse()
    Gets the response of the server to the page who's URL was indicated(Example of a response: HTTP/1.0 200 OK)
    You have to implement the following:
    1. The class WebClient with an public interface that Includes the methods specified upwards, in a file called WebClient.java
    2.A class WebClientTester, in a file called WebClientTester.java, with a main program that minimun have to:
    a) Create a instance of WebClient
    b) Using 3 valid URL's
    - Invoque setURL to indicate the URL of the server
    - Invoque getResponse to get the response of the server
    - display in the console the response of the server
    c) Using 3 invalid URL's (this is the correct server but the page does not are on the server)
    - Invoque setURL to indicate the URL of the server
    - Invoque getResponse to get the response of the server
    - display in the console the response of the server
    As a tip they give me that i can use the clases HttpURLConnection and URL to implement WebClient. It is recommended to save the URL in an instance field of WebClient.
    Those are the instructions now i will write here what i have do until now
    This is the WebClient Class:
    public class WebClient
         public String Wecli;
         public WebClient()
              Wecli = new String();
         public void setURL(String url)
         /** need code here */     
         public String getResponse()
         /** need code here */     
         public void display()
              System.out.println(Wecli);
    what i need there is the methods constructors or whatever are so that setURL and getResponse work and do what are suposed to do.
    Here is The WebClientTester class
    public class WebClientTester
         public static void main(String[] args)
              WebClient wbcl = new WebClient();
              wbcl.setURL(http://www.nba.com);
              wbcl.getResponse();
              wbcl.display();
              wbcl.setURL(http://www.mlb.com);
              wbcl.getResponse();
              wbcl.display();
              wbcl.setURL(http://www.msn.com);
              wbcl.getResponse();
              wbcl.display();
         wbcl.setURL(http://www.nba.com/baseball.html);
              wbcl.getResponse();
              wbcl.display();
         wbcl.setURL(http://www.mlb.com/basketball.html);
              wbcl.getResponse();
              wbcl.display();
         wbcl.setURL(http://www.msn.com/practice.html);
              wbcl.getResponse();
              wbcl.display();
    that is basically what i think i need so that the program works any other help you can give me will be very useful thanks for reding it and give your opinions.

    Those are the instructions now i will write here what i have do until nowLooks like you've posted your homework instructions, done less than the bare minimum to make it look like you thought about this problem, and now you want strangers to help you cheat by giving you the code that does the work so you can hand it in as your own.
    %

  • Need code help, please

    I am making a program where there are 3 ellipses. For two of the ellipses I want they to be able to be dragged across the screen when the mouse is pressed on them, they will also change color. For the third ellipse I want all three ellipses to move and change color when I click on it. I have the two ellipses doing what I want but I cant get a third move them all. Thanks.
    public interface Draggable
       public void setColor      (java.awt.Color aColor);
       public void setLocation   (int x, int y);
       public void mousePressed  (java.awt.event.MouseEvent XX);
       public void mouseDragged  (java.awt.event.MouseEvent XY);
       public void mouseReleased (java.awt.event.MouseEvent XZ);
    import wheels.users.*;
    public class DraggableSun extends Ellipse implements Draggable
       private java.awt.Point _lastMousePosition;
       public DraggableSun (int x, int y)
          super (java.awt.Color.YELLOW);
          _lastMousePosition = new java.awt.Point ();
          this.setLocation (x, y);
       public void mousePressed  (java.awt.event.MouseEvent mouseEvent)
          _lastMousePosition = mouseEvent.getPoint ();
          this.setColor (java.awt.Color.BLUE);
       public void mouseDragged  (java.awt.event.MouseEvent me)
          java.awt.Point currentPoint;
          int diffX, diffY;
          currentPoint = me.getPoint ();
          diffX = currentPoint.x - _lastMousePosition.x;
          diffY = currentPoint.y - _lastMousePosition.y;
          this.setLocation
             this.getXLocation() + diffX,
             this.getYLocation() + diffY
          _lastMousePosition = currentPoint;
       public void mouseReleased (java.awt.event.MouseEvent me)
          this.setColor (java.awt.Color.YELLOW);
    import wheels.users.*;
    public class Leader extends DraggableSun
       private MovableSun follower1;
       private MovableSun follower2;
       public Leader(int x, int y, MovableSun follower1, MovableSun follower2)
         super(x,y);
         this.follower1 = follower1;
         this.follower2 = follower2;
       public void mousePressed (java.awt.event.MouseEvent e)
         super.mousePressed (e);
         this.setFillColor (java.awt.Color.BLUE);
         //follower1.setFillColor (java.awt.Color.BLUE);
         //follower2.setFillColor (java.awt.Color.BLUE);
      // public void mouseDragged (java.awt.event.MouseEvent e)
         //super.mouseDragged(e);
       }Not sure if mouseDragged method in last class should be the same as the 2nd class, last class isnt finished, got lost.

    sorry, but I have gotten this far in the Leader class. It complies but all three don't move when drag the one. Any help would and I would be grateful.
    import wheels.users.*;
    public class Leader extends DraggableSun
       private DraggableSun _sun;
       private DraggableSun _sun1;
       private java.awt.Point _lastMousePosition;
       public Leader(int x, int y, MovableSun follower1, MovableSun follower2)
         super(x,y);
         this._sun = _sun;
         this._sun1 = _sun1;
       public void mousePressed (java.awt.event.MouseEvent e)
         super.mousePressed (e);
         this.setFillColor (java.awt.Color.BLUE);
         _sun.setFillColor (java.awt.Color.BLUE);
         _sun1.setFillColor (java.awt.Color.BLUE);
       public void mouseDragged (java.awt.event.MouseEvent e)
         super.mouseDragged(e);
         java.awt.Point currentPoint;
            int diffX, diffY;
            currentPoint = e.getPoint ();
            diffX = currentPoint.x - _lastMousePosition.x;
            diffY = currentPoint.y - _lastMousePosition.y;
            this.setLocation
             this.getXLocation() + diffX,
             this.getYLocation() + diffY
         _sun.setLocation
               _sun.getXLocation() + diffX,
            _sun.getYLocation() + diffY
            _sun1.setLocation
               _sun1.getXLocation() + diffX,
               _sun1.getYLocation() + diffY
         _lastMousePosition = currentPoint;
       }

  • Cryptography: strange msdn sample code, help please....

    Apparently that line of code does nothing, to continue the discussion
    I would like to know your guys opinion of MS and the level of security they provide, I assumed everything was top-notch, but looking through their usage of their own libraries it appears they are incompetent.
    Can I get some opinions on this, I have updated the question to a discussion
    ORIGINAL QUESTION - EVERYTHING BELOW (irrelevant):
    I have been able to create a complete class for network server and client TCP/IP unlimited secure data transmission using RSA/AES (.NET framework cryptography only), and am implementing an EC/DH version  (.NET framework cryptography only). Everything
    is working ok, I was just curious: on the VB example on this page:
    https://msdn.microsoft.com/en-us/library/system.security.cryptography.ecdiffiehellmancng.aspx
    What is the purpose of this line:
    Dim k As CngKey = CngKey.Import(bob.bobPublicKey, CngKeyBlobFormat.EccPublicBlob)
    On this page in the VB example??
    EDIT reason: forum bug correction
    EDIT2: I have noticed that the people writing the msdn samples do not understand the underlying cryptography, mostly based on their naming of variables. For the most part their usage follows the federal standards. Should I be worried that MS might not be
    properly implementing the .NET cryptography algorithms?

    You have completed the class and everything seems fine, you sent several GB of data through the class and it appears to be as secure as the RSA version. However, you found a line in a sample that isn't needed so you are concerned that they may be incompetent
    and the .NET crypto libraries may not be secure. Is that an accurate description ?
    I listed a single example, I have found dozens of them - including many examples which break the security rules and no information is given that it is doing such.
    Did you have any opinion or you just want to stir up arguments???
    I think the code is fine. I programmed a windows phone application myself and the samples are okay but most of the Microsoft samples are starter points and in some they clearly state that and not to use the code in production machines (if you have not noticed
    that in the MSDN programmer documentation you probably are new to Microsoft programming or have only been programming a few years on their platforms). This excludes the GUI controls included with some of the samples for windows application which
    are expected to work. They are one of the few and only rare exceptions to this rule. vb.NET 0.0 is right Microsoft is slow sometimes to stay modern but the libraries are effective.
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering
    - Yoda. Blog - http://www.computerprofessions.co.nr
    BTW, COM is still a pain and the device drivers/kernel components are becoming better in Microsoft software but its a good progression right now.
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to
    suffering - Yoda. Blog - http://www.computerprofessions.co.nr

  • Need some code help please

    I am trying to make a sun and planet with the planet orbiting the sun. It is all working but the complier is having a problem with the instance variable _ball in the programs.  Can anyone help me fix this, I think I'm almost there.
    public class MovingBall extends javax.swing.JPanel
        int X0 = 100, Y0 = 100;
        double X2, Y2;
        double r = 10;
        double a = 0;
        double da = .04;
        double ecc = 1;
        double TWOPI = 2 * Math.PI;
        private javax.swing.JPanel _panel;
        public MovingBall (java.awt.Color aColor, javax.swing.JPanel aPanel)
         super();
         _panel = aPanel;
         X2 = X0 + r * Math.cos(a);
         Y2 = Y0 + r * Math.sin(a);
         //this.setLocation(X2, Y2);
        public void move()
         a = a + da;
         a = a % TWOPI;
         X2 = X0 + r * ecc * Math.sin(a);
         Y2 = Y0 + r * ecc * Math.sin(a);
         //this.setLocation (X2, Y2);
        public boolean inFront()
         return (a <= Math.PI);
        public void SetCircle(int x, int y)
         X0 = x;
         Y0 = y;
         //ecc = 1.0 - (double)pct/100;
    public class MovingBallPanel extends javax.swing.JPanel implements Mover, Controller
        private final int INIT_X = 250;
        private final int INIT_Y = 200;
        private SmartEllipse _sun;
        private Sky _sky;
        private final int SUN_DIAMETER = 60;
        //private MovingBall _ball;
        private final int PLANET_DIAMETER = 35;
        private final int ORBIT_DIAMETER = 185;
        int _da = 1;
        int _ecc = 1;
        private final int INTERVAL = 100;
        private MoveTimer _timer;
        public MovingBallPanel()
         super();
         this.setBackground(java.awt.Color.BLACK);
         _sun = new SmartEllipse(java.awt.Color.YELLOW);
         _sun.setSize(SUN_DIAMETER, SUN_DIAMETER);
         _sun.setLocation(INIT_X - SUN_DIAMETER/2, INIT_Y - SUN_DIAMETER/2);
         //_ball = new MovingBall();
         //_ball.setCenter((INIT_X - PLANET_DIAMETER)/2, (INIT_Y - PLANET_DIAMETER)/2);
         //_ball.setAngleIncrement(_da);
         _sky = new Sky();
         _timer = new MoveTimer(INTERVAL, this);
         _timer.start();
        public void move()
            //_ball.move();
            this.repaint();
        public void go (boolean g)
         //if (g) _ball.setAngleIncrement(_da);
            //else _ball.setAngleIncrement(0);
        public void setSpeed(int degrees)
         _da = 2 * degrees;
         //_ball.setAngleIncrement(_da);
        public void setEccentricity(int pct)
         _ecc = pct;
         //_ball.setEccentricity(_ecc);
        public void paintComponent(java.awt.Graphics aBrush)
         super.paintComponent (aBrush);
         java.awt.Graphics2D betterBrush = (java.awt.Graphics2D) aBrush;
         _sky.paintSky(betterBrush);
         _sun.draw(betterBrush);
         _sun.fill(betterBrush);
         //_ball.fill(betterBrush);
    }I think only those classes affect the problem. Thanks.

    They all complie separately, but when I complie PlanetApp which creates the frame it has the problem. It says it can't find the symbol for ball for all the methods that I call with it, such as ball.setEccentricity(...) or _ball.fill(...).  Here is the PlanetApp class.  Thanks.
    public class PlanetApp extends javax.swing.JFrame
        ControlPanel _controlPanel;
        MovingBallPanel _movingBallPanel;
        public PlanetApp (String title)
         super(title);
         this.setSize(600,500);
         this.setBackground(java.awt.Color.BLACK);
         this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
         _movingBallPanel = new MovingBallPanel();
         _controlPanel = new ControlPanel(_movingBallPanel);
         this.add(_movingBallPanel, java.awt.BorderLayout.CENTER);
         this.add(_controlPanel, java.awt.BorderLayout.SOUTH);
         this.setVisible(true);
        public static void main (String [] args)
         PlanetApp app =  new PlanetApp("Lab 7");
    }

  • Need a little beginner code help, please

    How do I modify the following code so that a different button
    (like btnAbout) can use the same function?
    btnHome.addEventListener(MouseEvent.ROLL_OVER, over);
    btnHome.addEventListener(MouseEvent.ROLL_OUT, out);
    function over(event:MouseEvent)):void {
    btnHome.gotoAndPlay(2);
    function out(event:MouseEvent):void {
    btnHome.gotoAndPlay(7);
    }

    use the attach code option to display code in this forum:

  • How to use spry in the dreamweaver with the php/mysql

    hello,
    Iam new to the spry framework
    and i want to know can we use the spry in the dreamweaver
    along with php / mysql code
    if so please tell how to do this
    thanks in advance

    swetha123 wrote:
    > but when i complie this page it is not showing the
    preiew or any thing in the
    > browser i saved this page with the extension .php if i
    run the same page with
    > .html then i can see the design but it is not being
    executed
    The reason you get nothing when you save the page with a .php
    extension
    is because you have display_errors turned off, so you can't
    see the
    error message telling you there's a syntax error. The
    semicolon is
    missing at the end of this line:
    > echo "<font color='white'>Hello
    Swetha</font>"
    The reason it doesn't work with an .html extension is
    probably because
    you haven't uploaded SpryAssets/SpryTabbedPanels.js. I have
    copied your
    page and tested it locally with the correct JavaScript file,
    and the
    tabbed panels work as expected.
    There are lots of other mistakes in your page. You can't use
    float and
    position:absolute on the same element. In at least one place,
    you have
    used </br> instead of <br />. You have also got
    an closing paragraph tag
    after the paragraph that contains abc.jpg.
    Getting Spry or any other JavaScript library to work
    correctly relies on
    good, clean code. Your mixture of inline styles and font tags
    is going
    to make it difficult to incorporate Spry into your pages. I
    suggest you
    improve your HTML and CSS before bringing Spry into the mix.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

Maybe you are looking for

  • 3 Questions- Two about text boxes and one about something else! (10 Points)

    Hi, I'm doing a large project in java and have ran into several issues. These are summed up in these three questions: 1. How would I make certain words certain colours/formats? I have been told I should a JTextPane, but all my text is currently in a

  • JavaHelp server side search engine

    I'm trying to use a server side search engine with JavaHelp 1.1.3. In the Moment all Helpsets are located on a Server. The viewer like a bowser and on server side a selfmade servlet answered the request. Now the searchengine should used like written

  • How to uninstall and reinstall iTunes

    Moved all music and audiobooks to external drive to free space on Mac AirBook ll as required.  Now all audible.com books download but "Cannot write to this file."  iTune audiobooks are also not recognized in iTune section for transfer to iPod 7.  A r

  • Ideapad Yoga sent in two months ago and still no return OR repair

    My beloved Ideapad fell down the staircase drom a bag and required majpr surgery. Thankfully,  the warranty on it had not expired so I sent it in for repair in the second half of September. It is now end of November and no repair or udate has been pr

  • Auto Approval By Manager

    Question: I am implement 2 level approval work flow. first approver is "Manager" and second approve is "Group". If admin rasied a request for new user. First it will go for Manager Approval and then Group approval. This is done. But I am facing probl