Why does PHP code i wrote in Netbeans not work in Dreamweaver?

Hello i've made some code in Netbeans that worked perfectly there. I tested it on the same server and everything so that can't be the problem it's truely how Dreamweaver handles the code differently from Netbeans. I'd like to know how i can avoid that though cause it's quite annoying.
my code is:
<?php
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
    $name = @$_FILES["myfile"] ["name"];
    $type = @$_FILES["myfile"] ["type"];
    $size = @$_FILES["myfile"] ["size"];
    $temp = @$_FILES["myfile"] ["tmp_name"];
    $error = @$_FILES["myfile"] ["error"];
    $imgdir = @"uploads/";
    $imagearray = array();
    array_push($imagearray, '<td> <img src="' . $imgdir . $name .'" border=0 /> </td>');
    echo "image size:" . sizeof($imagearray);
    echo '<table border="10"> <tr border="10">';
    foreach($imagearray as $image)
        echo $image . "<br/>";
    echo '</tr> <table/>';
?>
<html>
        <form method="POST" enctype="multipart/form-data">
            <input type="file" name="myfile"/>
            <p>click to upload this picture</p>
            <input type="submit" value="Upload"/>
        </form>
</html>
for some reason it starts showing text on the webpage from the place where i've made the text bold
Could someone please enlighten me why this happens cause i honestly have no clue.

You must have done something incorrect when adding the if statement:
<?php
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
if (isset($_POST['submit'])) {
    $name = @$_FILES["myfile"] ["name"];
    $type = @$_FILES["myfile"] ["type"];
    $size = @$_FILES["myfile"] ["size"];
    $temp = @$_FILES["myfile"] ["tmp_name"];
    $error = @$_FILES["myfile"] ["error"];
    $imgdir = @"uploads/";
    $imagearray = array();
    array_push($imagearray, '<td> <img src="' . $imgdir . $name .'" border=0 /> </td>');
    echo "image size:" . sizeof($imagearray);
    echo '<table border="10"> <tr border="10">';
    foreach($imagearray as $image)
        echo $image . "<br/>";
    echo '</tr> <table/>';
?>
<!DOCTYPE>
<head>
<meta http-equiv="charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form method="POST" enctype="multipart/form-data">
            <input type="file" name="myfile"/>
            <p>click to upload this picture</p>
            <input type="submit" name="submit" value="Upload"/>
        </form>
</body>
</html>

Similar Messages

  • Why does redemption code for photoshop elements 12 not working ?

    Followed instructions to a t and still can't retrieve serial number. When you purchase with a disc, key should be on disc envelope like most software .I . am ready to return this frustration pretty soon.

    Redemption Code Help
    http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

  • Why does a movie I bought on iTunes not work without internet?

    Why does a movie I bought on iTunes not work without internet?

    As long as the film has been fully downloaded (or synced from your computer's iTunes) then you should be able to watch it in the iPad's Videos app without needing to be online - is that how you are trying to view it ?

  • Why does my phone screen flash red an not work??

    why does my phone not work an keep flashing red??

    Is the computer closing down and restarting whilst left unattended ?
    Is the computer running other tasks in the background eg downloading, security upgrades/scans, or disk indexing ?
    Have a look at
    *[[Firefox hangs##w_hang-after-prolonged-use]] - after prolonged use;
    * and note suggestion to use session restore feature to prevent this

  • Why does email address auto-fill in mail not work?

    When composing a new email, if I understand correctly, as you type the name, a suggestion SHOULD pop up with the address of the person.
    This works perfectly in iOS (iPhone/iPad) but does not work on both my MacBook Pros...
    What is the solution?
    I tried deleting all contacts, export to CSV, re-import etc. but to no avail...
    Thanks for your help
    Michael
    Los Angeles

    HI...I have the same question because in uograding from Mountain Lion to Mavericks, I find I can no longer get addresses to "autofill"...guess what , I did exactly what Linc Davis suggested and there is NO autmatically complete address box...which existed before in M. Lion!!  Any other suggestions...I thought these things were ment to UP grade and not complicate life even more?!!!

  • Why does it show my officejet 4622 as not working with an app when it shows it does in the info.help

    My printer is an hp officejet 4622.  I'm sorry to say I need step to step info as I am self taught 70 yr old trying to move forward. Thanks

    Hi vitamary;
    Hope you are doing well welcome to the HP forums
    can you be more specific in what is the problem that you are having, what app is showing that the printer is not working?
    Is your computer running Windows or is a Apple computer,
    letm e know this information and I will do my best to help you.
    Regards;
    RobertoR

    You can say THANKS by clicking the KUDOS STAR. If my suggestion resolves your issue Mark as a "SOLUTION" this way others can benefit Thanks in Advance!

  • Why does running an applet within a portlet not work?

    Hello,
    I have an applet and I want to run this in a portlet.
    I tried to load this applet into a portlet with SunONE Studio and Portlet Builder, and it works. The applet is running without problems.
    Now I tried to run this applet in a portlet under WebLogic 8.1 SP3. But the applet doesn't load. There ist only a gray rectangle to see. No error message, which would help to find the problem.
    To load the applet I'm using the Applet tag as follows:
    <APPLET archive='"+request.getContextPath()+"/folder/myApplet.jar' code='source/applet/myapp.class' ></APPLET>
    It's the same, I am using with SunOne Studio and there is the same package/directory structure in both.
    Any ideas?
    Is ist possible to run applets within portlets under WL 8.1?
    Thank you!
    Ines

    Hello,
    I have an applet and I want to run this in a portlet.
    I tried to load this applet into a portlet with SunONE Studio and Portlet Builder, and it works. The applet is running without problems.
    Now I tried to run this applet in a portlet under WebLogic 8.1 SP3. But the applet doesn't load. There ist only a gray rectangle to see. No error message, which would help to find the problem.
    To load the applet I'm using the Applet tag as follows:
    <APPLET archive='"+request.getContextPath()+"/folder/myApplet.jar' code='source/applet/myapp.class' ></APPLET>
    It's the same, I am using with SunOne Studio and there is the same package/directory structure in both.
    Any ideas?
    Is ist possible to run applets within portlets under WL 8.1?
    Thank you!
    Ines

  • I just upgraded to ios7 but why does my keyboard on my ipad mini not work now

    Does anyone have an answer for this ?

    Is it the built in keyboard or a bluetooth keyboard? If the restet don't work try to reset all settings from settings > general > reset if its the built in keyboard. If bluetooth keyboard, unpair the device from the settings> Bluetooth> and restore the network settings from settings > general > reset and then re-pair the keyboard and iPad.

  • Why does my DVI to S Video adapter not work on my Macbook Pro since installing Snow Leopard?

    The Apple DVI to S Video Adapter worked before installing Snow Leopard.  Now I just get a blue screen.

    .wpl appears to be a Windows Media Player playlist. I can find no conversion software for that, and Windows Media Player is not available for Mac anymore.
    If you can persuade him to download iTunes and create the playlist as mp3 in a iTunes playlist, or even just burn the base mp3 files to CD as a data disc, that's about the only solutions I can suggest.

  • Why does the earphone jack on the HPdv7 NOT work when on the notebook stand and using replicator?

    My Pavilion dv9815nr let me plug my earphones into the pc while it was on the desk extender or stand, and the sound of the speakers would be cut out -- which was especially a good idea late in the evening and helped keep peace in the family.  I liked this VISTA machine very much and was quite happy with it for not quite 3 years.  Unfortunately, the Optical drive gave out, or at least the BUS died and the techies recommended the purchase of a new machine since a repair was apparently expensive.  In order to stay closely to the concept of a full keyboard laptop using a notebook stand with wireless keyboard and mouse, I bought end March a Paviliion dv7 as a replacement machine.  Other than a series of minor mishaps, most of the problems were encountered with the peripherals and I am on a second wireless keyboard, mouse and replicator.  Also a number of odd occurrences related to audio were fixed by obtaining the proper drivers. but now I have encountered something that appears to be simply sloppy design.  When this laptop is in use on the notebook stand and linked to the replicator, the earphone jack on the left side of the PC is dead.  The jack works fine and cuts out the speakers when the USB lead for the replicator is removed.  There is a very impractical solution to the problem and that consists of plugging the earphone mini-plug into the jack located on the replicator.  Since the replicator has a niche location on the back of the notebook stand, this is not a very practical solution.  Any good ideas to get around this?

    I went through the installation where the bar shows the percentages downloaded and installed. Once it shows 100% it asks me to click Finish. I do. Then I go to yahoo to check and it continues to show that the plugin is missing and that I need to download Adobe Flash which I thought that I just did. Am I missing something in terms of installing??
    Kent M. Farrar

  • Why does my video clip look faded and not work on my timeline?

    I am making a simple short movie on my timeline. In fact, I already made it.
    However, when I added a credits sequence (which used to look fine and worked normally), I ran into a problem.
    Now, on my timeline, the little purple box that indicates the credis sequence is a little faded. Also, the text in the credits is inexplicably invisible, and can't be modified to any form of invisibilty.
    How did I manage to create this mess, and how do I get my credits to look normal again?
    -Jason Luna

    Could it be that you disabled the scrolling title( I assume that is what you mean when you say "Credit sequence"). Hitting the V key when a clip/title is selected will disable it. Select it and hit V and see if it fixes your problem. If it is disabled you won't see the text.

  • Why does error code 4005 pop up when i try to restore my ipod 5?

    why does error code 4005 pop up when i try to restore my ipod 5?

    Have you tried this support article ?      http://support.apple.com/kb/ts3074

  • Why does my ical on my ipod touch not sync with my ical on my desktop if I put in an event on the ipod calendar?

    Why does my ical on my ipod touch not sync with my ical on my desktop imac ical?
    It will if I put it in on my desktop though.
    Please help,
    Brie

    Probably because you did not tell the iPod to sync the calendar in iTunes.

  • Why does Apple iPad Camera Connection Kit no longer work with iOS8

    Why does Apple iPad Camera Connection Kit no longer work with iOS8?

    The kit is firmly inserted in thhe iPad's dock ? You could also try a reset and see if it's recognised after the iPad has restarted : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.
    I haven't had problems using the kit with SD cards from Canon cameras . What capacity is the card, and it's an SD or SDHC card - if it's an SDXC card that's formatted as ExFAT then it won't be recognised

  • Why does my yahoo mail sign in seal not appear while trying to sign-in

    Why does my yahoo mail sign in seal not appear while trying to sign-in when I use firefox only but with MS Internet explorer the sign-in seal appears with yahoo.com

    Many site issues can be caused by corrupt cookies or cache.
    * Clear the Cache
    Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    and
    * Remove Cookies
    '''''Warning ! ! '' This will log you out of all sites you're logged in to.'''
    Press the '''Alt''' or '''F10''' key to bring up the tool bar.
    Followed by;
    Windows; '''Tools > Options'''
    Linux; '''Edit > Preferences'''
    Mac; ''application name'' '''> Preferences'''
    Then '''Privacy.'''
    Under '''History''', select Firefox will '''Use Custom Settings'''.
    There is a button on the right side called '''Show Cookies'''.
    If there is still a problem,
    '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]''' {web link}
    While you are in safe mode;
    Press the '''Alt''' or '''F10''' key to bring up the tool bar.
    Followed by;
    Windows; '''Tools > Options'''
    Linux; '''Edit > Preferences'''
    Mac; ''application name'' '''> Preferences'''
    Then '''Advanced > General.'''
    Look for and turn off '''Use Hardware Acceleration'''.
    Poke around safe web sites. Are there any problems?
    Then restart.

Maybe you are looking for

  • Premiere Pro CC 2014 and Media Encoder CC 2014 Crashing constantly

    Running out of options and ideas... Symptom: Every time I work on any project in Premiere Pro CC 2014 or try to render out in Premiere Pro CC 2014 or Media Encoder CC 2014, the software crashes after 2-3 minutes of use/rendering when the GPU is enabl

  • Lync Online vs Exchange 2013 On Premise

    We have Lync 2013 Online and Exchange 2013 SP1/Outlook 2013 SP1 on premise.   All work well with RPC over HTTP. We are trying to get MAPI over HTTP (Outlook 2013 SP1 / Exchange 2013 SP1).  But it seems that the MAPI over HTTP no longer respects the I

  • G4 internet problems after upgrading to 10.4.11 Tiger

    I have recently upgraded my G4 to OS X 10.4.11, and I'm not sure if this is now causing my internet to not work correctly. I have a third party wireless card, always worked fine, but now the IP address seems to randomly change whenever I turn/restart

  • Alarm clock issue after OS upgrade to 5..0.0.973

    I upgraded to 5.0.0.973 and now I have issues with my alarm clock not displaying the time while charging at my bed side.  I have Verizon and tried using the latest upgrade from Sprint. 5.0.0.1030 but the alarm clock issue remains. Rolling back the up

  • Oracle Business Intelligence Standard Edition 1 download?

    Hi, Apologies in advance if this is a daft question but could someone point me in the direction of the download link for Oracle Business Intelligence Standard Edition 1 11G for Windows 64bit? The white paper below dated 2010 eludes to there being an