Why doesn't "$_SERVER['PHP_SELF']" in action= work for me.

I'm trying to make a form "self post", and was referred to the explanation at www.html-form-guide.com.  I coded my page exactly as shown there, and even copied/pasted the action= code (simple as it is) to my form tag.
In my XAMPP test environment the submit yields:
     Access forbidden!
          You don't have permission to access the requested object.  It is either read-protected or not readable by the server.
          If you think this is a server error, please contact the webmaster     (who would he be in a localhost environment?)
     Error 403
When I tested on my Yahoo web hosting server, submit yieded:
     The web page cannot be found.
          The most likely causes are:
               etc. etc.
Here's the code;
The following is placed at the top of the page immediately before the <html> tag:
<?php
     // the following was to write the post info to a file to verify that this code was being executed - never happened.
     $out = $_SERVER['PHP_SELF'];
     $fho = fopen(C:\xampp\htdocs\iod\testphpself.txt,wt);
               fwrite($fho,$out);
               fclose($fho);
     if (isset($_POST['submit']))
          $fstname   = $_POST['firstname'];
          $midinit     = $_POST['midinitial'];
          $lastname = $_POST['lastname'];
          $milen       = (strlen($midinit));
          if ($milen == 0)
               {$fullname = $fstname." ".$lastname;}
          else
               {$fullname = $fstname." ".$midinit". ".$lastname;}
          echo "Information has been stored for : $fullname <br /><br />";
The following is the <form> code:
     <form name="form1" method="post" action="<?php echo $SERVER['PHP_SELF']; ?>">
Most of the above I gleaned from www.html-form-guied.com/php-form/php-form-action-self.html.
PLEASE! Can someone tell me where my error(s) is/are?  I feel that I must be doing something wrong, but have no idea what it might be.

creacontech wrote:
          If you think this is a server error, please contact the webmaster     (who would he be in a localhost environment?)
You.
I don't really understand what you're trying to do, but there are several mistakes in your PHP code.
<?php
     $out = $_SERVER['PHP_SELF'];
     $fho = fopen('testphpself.txt','wt');
               fwrite($fho,$out);
               fclose($fho);
     if (isset($_POST['submit'])) {
          $fstname   = $_POST['firstname'];
          $midinit     = $_POST['midinitial'];
          $lastname = $_POST['lastname'];
          $milen       = (strlen($midinit));
          if ($milen == 0)
               {$fullname = $fstname." ".$lastname;}
          else
               {$fullname = $fstname." ".$midinit . " ".$lastname;}
          echo "Information has been stored for : $fullname <br /><br />";
?>
What that does is write the name of the current page to the external text file. It does not store the form content.

Similar Messages

  • Why doesn't Skype Click-to-call work on Windows 8.1?

    Why doesn't Skype click-to-call work anymore? I upgraded to Windows 8.1, and now when I click on a highlighted phone number it asks "Which app should I use" or some such microsoft text. But no application is listed. Apparently it does not work from within Firefox (I have the latest version). And I can no longer find a Skype Click to Call application or extension in Firefox. Do I need to use another browser or is there a fix for this?

    Hey ran
    Sorry to hear you are having probloms
    I currently have skype click to call installed with firefox and windows 8.1 up to date. I would advise you to re-install skype and its click to call addon and see where it gets you
    hope this helps
    Brad

  • Why doesn't facetime on iphone 4 work without wifi with straight talk?

    why doesn't facetime on iphone 4 work without wifi with straight talk when other networks can?

    Hardware requirements of the iphone 4 do not meet the specifications needed for FaceTime over cellular data.
    4S and up do not require wifi for FaceTime.
    this is exactly as intended.

  • Why doesn't my iMessage and FaceTime work on my iPod ?

    Why doesn't my iMessage and FaceTime works on my iPod?
    Help

    Withour more information:
    iOS: Troubleshooting Messages
    iOS: Troubleshooting FaceTime        
    iOS: Troubleshooting FaceTime and iMessage activation
    FaceTime, Game Center, Messages: Troubleshooting sign in issues

  • Why doesn't Energy Saver have an option for displaying "Time" in the menu bar?

    Why doesn't Energy Saver have an option for displaying "Time" in the menu bar?

    I'll provide some Proof
    Link 1
    Link 2
    Link 3
    you are not the only person with this problem maybe it will come back in Mountain Lion who knows. 

  • Why doesn't the dynamic zoom tool work in my PDF?

    I have designed an interactive PDF to open in full-screen view only. Of course, when it does so, none of Reader's tool bars are available to the end-user. But as the PDF is meant to be used on screen, I want the recipient to access the dynamic zoom tool. So I have introduced access to it from within the PDF itself.
    This I have done using the Button tool to create a button that appears on each page of the PDF that, when clicked, turns the cursor into the dynamic tool. Another button I created alongside it brings back the cursor.
    However, having done this, some recipients receiving the PDF have been able to access the dynamic zoom tool from within my lovingly crafted PDF but others have not (the dynamic zoom tool worked on a PC machine running XP/Home & Reader 7, but not on PCs running XP/Home & Reader 8 or 9).
    And of course, the tool works fine when the user exits out of full-screen view & accesses the tool via the menu, or the toolbar.
    But we don't want the menu or tool bars to be visible!!
    So my question is, does anyone know why this specific function on the PDF I created is working for some and not for others? Do you know if there is something specific I need to apply within the Button tool's settings or the PDF's settings that once actioned will completely avoid this problem from reoccurring? Or is there a bug in the software that you are aware of that prevents me from creating a PDF that includes access to the dynamic zoom tool from within itself (not via the toolbar) and which works fine in different versions of Reader & across PC/Mac platforms & operating systems?
    (I created the PDF using Acrobat Pro 9 on a Mac running Leopard, 10.5.9).

    To create the interactive button: from the menu bar, go to Tools > Advanced editing > Button tool. Clicking Button tool brings up a cross-hair cursor. Click & drag to marquee the area you want to make interactive (in my case, over the icon I designed & introduced to each page of the PDF to represent the dynamic zoom tool).
    This brings up a dialogue box where you can select the appearance of the button (eg visible or invisible), which trigger is needed to activate it (clicking, hovering, etc), & what action is generated once you've done so (like going to another page in the document, run a javascript, play a sound, or execute any of the menu items).
    So all I did is told it which menu item to activate, by selecting 'execute menu item' in the drop-down menu, going to the menu to select it & clicking okay. Simples!

  • Why doesn't us postal service website work on Lion?

    Since changing to Lion, the postal service website which prints labels just doesn't work. Anybody know why? Any solutions?

    Works for me. Uncheck Block Pop-Up Windows untill after you print your label.

  • Please help why doesn't command s single user work?

    Why doen't my mac command s single users mode not work?? i forgot my admins password and i broke the disc like 3 months ago so im left with no choise
    please help asap

    Single user or verbose mode is for troubleshooting, not changing the admin password.
    According to your profile you are runing Lion so an alternative may work for you.
    OS X Lion: Apple ID can be used to reset your user account password
    Or here >  Reset a Mac OS X 10.7 Lion Password

  • Ps Actions work for all but one person in office. Same Software... Alignment bug/settings?

    I have created two photoshop actions that convert a PDF into jpg pages, and then slices those pages into pre-sized pieces, and saves the pieces out individually. Two versions, for two differently sized PDFs.
    We use this in the office for creating a "book" visual from a tricky indesign file.
    Both actions work fine for me.
    Both actions work fine for coworker#1.
    However, when Coworker #2 uses either of these actions, the chopped up pieces to not align properly in photoshop, and instead leave blank sections where they should have been merged together. (align box A top. Align box A to Shape_gutter. the second step never happens.
    This 'error' occurs on both PDF Styles' actions for cowroker#2, so I'm assuming it has to be a setting? We are all running the same version of photoshop (Up to Date CC 2014), and testing on the same files.
    anyone have any insight?

    Everything is not exactly the same you state one is different. There is something different in the mix.  A broken file a bug in the install in the system there is a difference some place.  You see different results... Perhaps a different level of code are plug-ins involved other actions etc.
    Post the action let us look at it/them.

  • TS2846 Why doesn't apple provide Model info designated for specific country or carrier?

    Why doesn't Apple just reveal the model numbers so the consumers know which carrier the iPhone was originally locked to? Instead of having consumers running around to ask multiple carriers in different countries to find out which country or carrier it was locked to begin with.

    They are good inputs and they do make sense, it's just there are other forum saying differently as well.
    http://gfgsm.blogspot.com/2010/11/iphone-carrier-list-model-numbers.html
    or
    http://www.gsmreloaded.com/f81/iphone-3g-3gs-model-numbers-country-carrier-13076 .html
    Just to name a few.
    Although they are not Apple affiliated but few hundreds is still not a big number and if there are lists then that would be helpful.
    Just a shot in the dark and wonder if I can get more info out from others.
    Thank you all.

  • Why will my HP TrueVision HD webcam work for like 3 minutes in a somewhat dark room?

    When I use skype, the webcam truevision works for only like a minute when using enough of the light source round me.  After that minute is up te screen fades to darkness and I cant see anything.  How can I fix this so that it just stays steady?

    Hello @jobott86,
    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the HP Forums I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More.
    I understand that your notebook computer's webcam works for only 3 minutes, and that it fades to darkness soon afterward. I would be happy to assist you in this matter!
    To return the functionality of your notebook's webcam, I recommend following the steps in this document on Webcam Troubleshooting (Windows 8).
    Please re-post with the results of your troubleshooting, and I look forward to your reply!
    Regards
    MechPilot
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks” for helping!

  • Why doesn't my incoming mail sound work

    I am using Mail 3.3 and in the preferences I have a "new mail" sound .wav file in the general tab
    and the box is checked for the "play sounds for other mail actions". The "other mail actions" sounds are working, and when I recheck the .wav sound it plays fine in the sample mode. However, the sound doesn't play in regular receive mail mode. Anybody have a suggestion?

    http://discussions.apple.com/thread.jspa?threadID=1538808&start=195&tstart=0
    This problem has been had since Tiger came out, there are so many posts about this, the one above is 5 pages long.
    I posted this post below on the 15th September 2007 -
    +At Least I Am Not The Only One+
    +It was good to hear the same problem I've had for ever.+
    +I was listening to Leo LaPorte's radio podcast and a lady rang in said her few months old iMac would only play the email arrive sound occasionally. She rang Apple but they couldn't fix the problem, so she rang Leo.+
    +At least I'm not the only one and Leo did not know how to fix it either, except to say to check System Preferences/Sound, and I know this makes no difference.+
    +I just hope Apple were listening and fix Mail some day.+
    I have asked here several times and on other forums and also reported to Apple, I have tried so many different ways to fix the problem including full format erase and new install, but all to no avail.
    Thunderbird works perfectly and will play any sound format, why not Apple Mail.
    I first thought Leopard would fix this, then the 10.5.5, but no.
    So disappointing.
    Rodney

  • Why doesn't this insert into XMLTYPE work?

    Hi again. Hopefully I'll be answering questions soon, but meanwhile I've got another one.
    I'm working in this environment...
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    The encoding for the database is WE8ISO8859P1.
    in SQL Plus. I created a table with an XMLTYPE column stored as binary. Here's the desc...
    PS: BWDSTG> desc bwddoc;
    Name Null? Type
    SUNAME VARCHAR2(100)
    SOURCE_DOC_TEXT CLOB
    DOC_TEXT SYS.XMLTYPE STORAGE BINARY
    LAST_UPDATE_DATE DATE
    PS: BWDSTG>
    The following error also occurred when I created the same table with a storage type of CLOB for DOC_TEXT. Here's the error I can't figure out...
    PS: BWDSTG> insert into bwddoc (doc_text) values ('<?xml version="1.0" encoding="UTF-8"?>
    2 <a>&#8211;</a>
    3 ');
    insert into bwddoc (doc_text) values ('<?xml version="1.0" encoding="UTF-8"?>
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00217: invalid character 8211 (U+2013)
    Error at line 2
    It accepts the command if I replace the &#8211; with plain text. Why does it care what the character entity reference is? It's changing the encoding pseudoattribute in the xml declaration to US-ASCII anyway, and this character entity should be perfectly acceptable. I'd appreciate it if anyone knows the reason for this (or what I'm not understanding, which as always is a distinct possibility).

    Sorry, let me try again. SQLPlus doesn't have a problem with the multiple lines, so I'm just trying to insert the XML.
    PS: BWDSTG> insert into bwddoc (doc_text) values (xmltype('<?xml version="1.0" encoding="US-ASCII"?>
    2 <a>&#8212;</a>
    3 '));
    insert into bwddoc (doc_text) values (xmltype('<?xml version="1.0" encoding="US-ASCII"?>
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00217: invalid character 8212 (U+2014)
    Error at line 2
    ORA-06512: at "SYS.XMLTYPE", line 310
    ORA-06512: at line 1
    My problem is that...
    <?xml version="1.0" encoding="US-ASCII"?>
    <a>&#8212;</a>
    should be perfectly good HTML. libxml2 and expat both have no problem parsing it. They just leave &#8212; (which is some kind of a dash) alone. But Oracle XMLType doesn't like it for some reason. I need to load a lot of data that has numeric character entities like this but I can't 'til I get this resolved.

  • Why doesn't masking with gradient layer work when regular gradient does?

    If I make a regular gradient over a layer, and make it's opacity 0, and have it on 'shallow knockout', it will knockout the layer below along the 'lines' of the gradient.
    However, when I make a gradient layer to do the same, and set opacity down to zero, it doesn't seem to work.  Why?

    If I was a more advanced artist, then I might know better when I can merge things and not, but right now, I'm a wanna be artist coming from an engineering background, where when I can't grok a whole picture, I break it down in to parts and combine them.
    Like when then hand didn't look right or I needed fingers to be relocated, I brok apart the hand and fingers so could relocate them
    separately then reshade them after they were in place.
    Another set of things i've kept separate (are about 50-80 'hair strands'  most of which have a unique color, then have a another
    layer for texturing -- painting the texture onto the color made it impossible to change the look of the texture when it was wrong -- and I've changed it several times, because it didn't look right or came up with a better process/way of doing it.  Then there's usually an effect layer on top of that to apply shadowing to the strand, give it a bit of 3-dimensionality, and sometimes multiple or add or something with the layers below for emphasis.
    On change I made -- which helped, I started with all 3 layers in a group.  and 'N' groups... (still have manny like that.. but a new section I started putting base strands in 1, group , then a copy of those layers, blanked and then painted with texture (that's usually brushed on )..., And it seem the only way to apply an effect to one set or the other (or both) is to convert them to smart objects, which still allows editing (but, unfortunately, also stores them in the same file)...
    My eye's, have grown.. ll starting out in a few things, then they got more complex... as I didn't know how to really make an eye look good, so I started w/parts...and ended up with 15 layers/eye (not counting groups... things likke eyebase white, irsibase base, iris color, (base is back to pupil layer somewhere above can punch through to a black layer -- at one point (but backed off that approach, even tried to put some nerves and veins on the iris base...)..... then there's the circles of fibers that make up the iris pattern, various
    tints for various fluids and transparent structures, .. YIEKS...
    Not making any claims about this being a best or even good way, but when you are learning, and especially whern you come from
    an engineering background where you are usd to building thigns up out of parts, .. you don't want to weld your parts together before you are at the final product...and even then, ..... what if you want to make a change?!...
    Again, newbie-problem more than likely...with too much software engineering background...
    Adobe should really have doing part-time work doing product usability/abusability/stability evals... I've pressed it over the limites more than once, and had to redo the way I do things to stay with in its relavtively easy (for me) to hit limits...
    Like the one I posted about the layers slowing things down... trivial to rproduce...yet sounds like Adobe never heard of it.
    Another parallel problem I ran into/noticed the other day -- when I MOVED, 90% of the layers (somehow they got out of alignment with 10% that were still in the origninal... could be related to a move/cancel bug I run into too often as well, which, fortunately, has a not too difficult workaround).  But I moved 90% of those layers, and it only used 2 cpu's out of 6 (and no GPU usage).... took about 45 -60 seconds .. it was a *simple* +/- xy, (no rotations).. so it was something that could have been done in parallel, easily and wouldn't have been compute bound...
    The other bug I've run into WAAY too often, is when trying to move an object, if I don't caefully try to nudge it with rotate, or move a
    side, 1st, but instead, just put my pen in the middle of the object, to try to drag it -- it almost ALL the time, selects some base layer and moves some large percentage of the layers -- in a visually corrupting way... since when you hit escape to break out of the 'free movement)., the parts don't go back to where they belong and stay offset and random places...
    But it's a visual problem only...I think (not sure how my 90% got moved),  -- if you SAVE the file, then make a slight change, and then revert to the just saved copy, it cleans all up.  so it's just the display that's messed up.
    Anyway, slowly over time, all the layers that I originally had a paint or gradient layers surrounded with a vector, I slowly (interspersed with other stuff) converting them to fill/gradient layers which take up comparatively no space.  Really speeds up manipulation of those
    objects as well...
    But it's slowgoing and the interface for creating a gradient to match an existing one is very awkward to use...It's too bad when you
    create a gradient or paint layer to BEGIN with, that it's not automatically created as a vector  Then, when you start to paint on it,
    it creates a layers sized to your painting applied on top of the existing fill layer...would save all the space take by the pixels that were formula driven...   Would be so much more powerful -- only storing as bits the things you need to store as bits, rather than defaulting
    to 'bits' for everything (which really consumes resources!)...
    Personally, Another feature but this might be specialty, or not..... but as I designed my things with parts, it would be nice to be
    able to specify XY coordinate tie points between layers -- so if I moved a layer shaped like a stick, attached to another stick,
    by 1 point at each end, changing the angle of the first would change the angle of the 2nd like a 'joint' -- not like a solid rod.... that
    would be VERY cool!..but not holding my breath on that.
    Just getting the current features to work would be nice...like the gradient masking layer... no reason that shouldn't work, but there ya go. 
    Maybe you know this one (unrelated...)... But I've more than once run out of temporary space (even with usually 130-150GB on my temp store.  The thing is, is that adoe doesn't use any of the extra 56GB I have in my Pagefile -- I can't tell it to use more than 100%
    of physical memory -- (i.e. so it would use part of the page file).  I have 48GB mem, and 56GB pagefile, that's on an SSD., I'd
    rather have it page to the SSD before writing temp files to disk...
    If it could force pages out, to the pagefile, before resorting to a spill file, would save on space and possible speed depending on
    the config...  But , eh, C'est la vie.
    Meanwhile, I's still ike to figure out how to solve the orignal problem, but I'm beginning to think it looks like a core bug...so it maybe hard to get around.
    Thanks for your comments!  As usually, appreciated!...

  • Why doesn't my CD (c) key work on my imac g3 ?

    I have a problem on one of my computers that the "c" key won't work before boot. I have to switch hard drives to a different Imac G3, then I can boot to Mac OS Setup. I know that the cd works! But I cannot figure out why it doesn't boot to a cd. Any suggestions??

    Depending on the age of the iMac G3, you may be able to use the Startup Manager instead:
    http://docs.info.apple.com/article.html?artnum=106178

Maybe you are looking for