I found some errors in your code:

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

The Main class creates the GUI for the Dorm and
Meal charges.
public class Main extends JFrame
private JPanel dormPanel;
private JComboBox dormBox;
private JPanel mealPanel;
private JComboBox mealBox;
private JPanel totalChargesPanel;
private JPanel selectedMealPanel;
private JPanel buttonPanel;
private JButton calcButton;
private JLabel label1;
private JTextField totalCharges;

private String[] dorm = { "Allen Hall: $1,500 per semester", 
        "Pike Hall: $1,600 per semester", 
        "Farthing Hall: $1,200 per semester", 
"University Suites: $1,800 per semester"};

private String[] meal = { "7 meals per week: $650 per semester", 
        "14 meals per week: $1,095 per semester", 
"Unlimited meals: $1,500 per semester"};

public Main()
    super("Dormitory and Meal Plan");

    // Specify an action for the close button.

    // Create a BorderLayout manager.
    setLayout(new BorderLayout());

    // Create the dorm and meal panel.      

    // Add the components to the content pane.   
    add(dormPanel, BorderLayout.WEST);
    add(mealPanel, BorderLayout.EAST);
    add(totalChargesPanel, BorderLayout.SOUTH);
    add(buttonPanel, BorderLayout.NORTH);

    // Pack the contents of the window and display it.    

// The buildDormPanel method builds the dorm panel. 
private void buildDormPanel()
    // Create the dorm panel.      
    dormPanel = new JPanel();
    dormBox = new JComboBox(dorm);

    // Register the action listener.      
    dormBox.addActionListener(new ComboBoxListener());

    // Add the dorm panel to the panel.

// The buildMealPanel method builds the meal panel. 
private void buildMealPanel()
    // Create the meal panel. ...

Your external IP is not accessible from intranet, it is a common issue. If you did the right steps, try to access to your wan address from an outside location.

This example will show an alert after the end.


You need Flash player 8+ and JavaScript enabled to view this video. var params = { allowScriptAccess: "always" }; var atts = { id: "myytplayer" }; swfobject.embedSWF("http://www.youtube.com/v/App5FjQMpdA?enablejsapi=1&playerapiid=ytplayer", "ytapiplayer", "425", "356", "8", null, null, params, atts); function onYouTubePlayerReady(playerId) { ytplayer = document.getElementById("myytplayer"); ytplayer.addEventListener("onStateChange", "onytplayerStateChange"); } function onytplayerStateChange(newState) { if(newState == 0){ alert("Player is stopped"); } }


The result will be displayed into an array:

[code=php]preg_match_all("/([\s])([_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)([ ]+|)@([ ]+|)([a-zA-Z0-9-]+.)+([a-zA-Z]{2,}))([\s]*)/i", $syntax, $matches);

echo "


I think Zend Framework wins using LiveDocx component: [URL="http://www.phplivedocx.org/downloads/"]http://www.phplivedocx.org/downloads/[/URL]

Antiword would be an alternative, it's a UNIX app, can be executed from PHP using exec()

exec('/usr/local/bin/antiword /opt/lampp/htdocs/example.doc', $output);

The same marketing text found at:


This is a construction company. Websites are managed differently. To maintain a site, first of all, programming tasks differs substantially from design tasks. Programming tools could be mainly editors, IDEs and debuggers. Design tools: image editors like Gimp, Photoshop; multimedia authoring packages like Flash; vector drawing tools like Illustrator. Word for copywriting (or OmegaT for multilingual). Finally, browsers to review and test websites.

Project management and CRM software can make the process 'staged' and organized. ProjectPier (based on activeCollab) is an example of a good website management tool.

peter_budo commented: Thank you for notification on copy rights +17

I'm looking at your code, the method used in your form and mysql variables is ok, but into the form code, the survey code is commented into tags, remove it.

Add [icode]value="<?php echo $_GET['center']?>"[/icode] into the input tags, should be something like:


JRSofty commented: Good post. You could have also mentioned the use of the $_REQUEST since she is mixing both $_POST and $_GET usage in her page. +2

Facebook and another community sites achieves this optimal capacities performing an image scale reduction and using lossless formats like JPEG for every photo uploaded. Data storage can be a concern on higher web sites, I think CPU usage should be another factor to be considered. You can make a heavy amount of CPU load killing the server resources trying to recompress files that already uses a compression on their data. Also, Lempel-Ziv (.gz .zip) compression will give bigger files as a result (if you're using JPEG images).

The GD library would give the essential functions to do image processing like format conversion and reducing images to the maximum visible dimensions into the website template.

digital-ether commented: great answer +6

To generate a PDF into PHP, there are two techniques: PDFLib or FPDF. PDFLib has some restrictions on licencing (commercial applications), I encourage to use FPDF because is free and Open Source, although PDFLib is rough and more complete (use your criterion). At [URL="http://fpdf.org"]http://fpdf.org[/URL] there are a place to download the class and good tutorials. Use $_GET or $_POST variables to get the form data depending the form method.

To send the email, mail() function or PHPMailer are commons methods to perform these assignments. Please take care to encode the attachment and the headers, set multipart content type first, then the proper content type and encoding in each part, we could send plain or html text and multiple attachments too.

In this example I've used FPDF and mail() techniques. I don't know if it is better move this code to snippets section.

// download fpdf class (http://fpdf.org)

// fpdf object
$pdf=new FPDF();

// generate a simple PDF (for more info, see http://fpdf.org/en/tutorial/)
$pdf->Cell(40,10, "this is a pdf example");

// email stuff
$to = "target@domain.com";
$from = "me@domain.com";
$subject = "send email with pdf attachment";
$message = "Please see the attachment.";

// a random hash will be necessary to send mixed content
$separator = md5(time());

// carriage return type (we use PHP end of line constant)
$eol = PHP_EOL;

// attachment name
$filename = "example.pdf";

// encode data (put attachment in proper format)
$pdfdoc = $pdf->Output("", "S");
$attachment = chunk_split(base64_encode($pdfdoc));

// main header (multipart mandatory)
$headers ...

nav33n commented: good post! +8
Roebuc commented: FPDF is perfect, thanks! +1

It is possible to use fopen() in PHP5 to send a POST request and obtain the content in a variable, check this tutorial:

According to the amount of data, sometimes is more fast and useful to use only string functions, with a combination of strpos() and substr(); other method is using regular expressions.

With larger files or complex patterns is recommended to use SimpleXML functions (PHP5), like is described in the first tutorial suggested by Ezzaral. Xpath would be a good improvement to locate elements easily.

Some sites have clean XML results and search API easily obtainable by public, with some limitations, like the Kayak API to search flights in tourism sites. Really, I don’t know if there is a such solution for your industry, some sites contain manuals and examples to implement search and get results on their sites.

Ezzaral commented: good info +3

You can pass the image id as parameter in functions:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

Dynamically enlarge image on mouseover and mouseout body {margin:64px;} #apDiv1 { position:absolute; left:361px; top:161px; width:186px; height:144px; z-index:1; } #apDiv2 { position:absolute; left:306px; top:127px; width:300px; height:164px; z-index:1; } #apDiv3 { position:absolute; left:188px; top:116px; width:100px; height:75px; z-index:1; } #apDiv4 { position:absolute; left:387px; top:113px; width:100px; height:75px; z-index:2; } // 100) { document.getElementById(id).height -= 30; document.getElementById(id).width -= 40; glbDec = setTimeout("decreaseSizeImage('"+id+"')", 32); }; } function increaseSizeImage(image) { var id = image; if(glbDec != null) {clearTimeout(glbDec); glbDec = null;}; if (document.getElementById(id).height





yes, it's true, but you can use a condition like this to deal with compatibility issues:

<? if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') == true)) { ?>

I'm using z-index and I haven't see strange issues [URL="http://agec.ath.cx/lead"]http://agec.ath.cx/lead[/URL] maybe you could see a solution there

Web developer toolbar in firefox is a great tool to see CSS properties and change values on the fly.