Can someone tell me why this is not setting the session variable?

first page
<?php
// script1.php
session_start();
echo "<form action=\"script2.php\" method=\"post\"
name=\"name1\">";
echo "Your name: <input name=\"name\" type=\"text\"
size=\"20\" value=\"\">  ";
echo "<input name=\"submit\" type=\"submit\"
value=\"Submit\">";
echo "</form>";
?>
second page
<?php
// script2.php
session_start();
echo('Hello, ' . $_SESSION['name1']);
?>

jlw12689 wrote:
> second page
>
> <?php
> // script2.php
> session_start();
> echo('Hello, ' . $_SESSION['name1']);
> ?>
You need to set the session variable first.
<?php
session_start();
if (isset($_POST['name1'])) $_SESSION['name1'] =
$_POST['name1'];
echo 'Hello, ' . $_SESSION['name1'];
?>
By the way, using echo to create your form on page one is a
complete
waste of time. Just use an ordinary HTML form - a lot less
typing, and a
lot more efficient.
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/

Similar Messages

  • Can someone tell me why this is not working?

    Im playing with a new design, and I have a top line that will
    be for a menu,
    then directly under it an orange line just for effect.
    I have the orange line on the bottom of the top line, but it
    shows on the
    top..
    Im sure it has something to do with the positioning, but I am
    missing it..
    Thanks
    Gary
    http://www.siddonslaw.com/newindexdesign.html

    Much smarter idea...thanks
    Gary
    "Joe Makowiec" <[email protected]> wrote in
    message
    news:[email protected]..
    > On 21 Sep 2008 in macromedia.dreamweaver, GPaul wrote:
    >
    >> Im playing with a new design, and I have a top line
    that will be for
    >> a menu, then directly under it an orange line just
    for effect.
    >>
    >> I have the orange line on the bottom of the top
    line, but it shows
    >> on the top..
    >>
    >> Im sure it has something to do with the positioning,
    but I am
    >> missing it..
    >
    > Don't do it with an empty div. Just make the
    border-bottom of the
    > container the line:
    >
    > #topline {
    > border-bottom : 2px solid #f60 ;
    > ...
    >
    > --
    > Joe Makowiec
    >
    http://makowiec.net/
    > Email:
    http://makowiec.net/contact.php

  • Most of the time I get The Connection Was Reset. Can someone tell me why this happens?

    When I click on Firefox or when browsing or going from one site to the other I get "The connection was reset" then have to click on Try Again.
    Can someone tell me why this is happening?
    Thank you.
    THE CONNECTION WAS RESET again this morning. I even get this message when I click on the Firefox Icon to get on the net. When for example I download something then it returns me to their site I get The Connection Was Reset. When I uninstall a program and it sends to to their site in order to answer as to why I am uninstalling their program then I get The Connection Was Reset.
    Every time this happens I have to click on Try Again and find this to be annoying.
    This does not happen once or twice a week, it happen ALL THE TIME.
    This morning I went to Safe Mode and followed the instructions on INTERRUPTED OR RESET CONNECTION which tells us what to do but this did not work either.
    Would be great if someone was able to let me know what to do in order to prevent this message appearing all the time.

    Do not know how to delete this reply. I replied instead of editing my question. I have edited the above now.

  • Several times I've downloaded albums from iTunes to find that some of the tracks did not get fully downloaded so that the track with skip to the next one. Can someone tell me why this is happening and how I can fix it?

    Several times I've downloaded an album from iTunes to find that not all of the tracks were fully downloaded so that some of the tracks will skip to the next one (instead of finishing the song). Can anyone tell me why this happens and how I can fix it?

    If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copies of the tracks and try redownloading fresh copies.
    Otherwise, I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the items that are not playing properly. If you can't see "Report a Problem" next to the items, click the "Report a problem" button. Now click the "Report a Problem" links next to the items.
    (Not entirely sure what happens after you click that link, but fingers crossed it should be relatively straightforward.)

  • Can someone tell me why this swf is so large? (384kb)

    Hi- I'm trying to get this file smaller so it will load quicker.  Any ideas why it is so large?
    http://www.prodentite.com/flashhelp.htm

    first 384kb is not too terrible, kinda big but not too bad. Second, a good way to see how to get your filesize down is to generate a size report. To do this, go File>Publish Settings, click on the Flash tab and check "Generate size report." Next time you test movie or publish the size report will be created. If you test movie, the size report will open in your Output window. You can scroll through that to see what is taking up file size.
    On a quick look at your swf, I see you have multiple images. Are these JPGs? If not, and since they are rectangle with out transparency, they should be jpgs. If they are, in your library, right click on each of them and click "Properties" see what your compression is. Most likely if you havent set this yet each one will have "Use Imported JPG quality" checked. Uncheck this, and set the percentage yourself. It may take some play to get a good balance between filesize and quality. I stick within the 65 - 80% range, depending what quality I need.
    Other than that, optimization is a learning experience. Different people swear by different methods. But the most important is to make sure your files are clean.

  • Can someone tell me why this isn't working?

    I am trying to upload files to a WebDAV server located at
    https://webdav.buzzsaw.com/jasonpratt/webdav
    uid: webdav
    pwd: Webdav2005 (case sensitive)
    I can download and view files, but can't upload anything. Any ideas why not? Please help, O Mac experts!

    I created a webdav server on my mac. It is working, however when I upload files, (with the finder), the permissions are not set were I can write. So if I try to copy a folder, the contents will not copy. I have learned that umask can overcome this. However I have not found how to enable a umask_module in apache.
    I have tried Transmit 3.2.1 and it is inconvienent, because it does not mount a Volume like the finder would. I coppied the same folder. It shows that it has the same permissions as the folder I uploaded with the finder. drwxr-x--- . However the contents are coppied in the folder.
    Another stange thing, If I try to manually copy the contects after the folder and contents failed, then it works. So it looks like I do have write (w) rights.

  • Pls can someone tell me why I don't have the option to update my software to iOS 7 on my iPad . No update software in general setting.?

    Please can someone help me download ios7 to my iPad when I don't have a software option in my general setting.?

    That started in iOS 5, if you don't have that, you will need to update through iTunes on your computer.

  • TS1702 My applications are not downloading.. All I get is "waiting" can someone tell me why this is happening?

    When I download an app it doesn't download automatically any more.. I've only had my iPad less than a month.
    Just wondering why it has decided to change? X

    Here are a number of things that you can try.
    Make sure that you do not have a stalled download in iTunes - a song or podcast .... if you have a download in there that did not finish, complete that one first. Only one thing can download at a time on the iPad so that could be what is causing the problem.
    If that doesn't work - sign out of your account, restart the iPad and then sign in again.
    Settings>Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>Store>Sign in and then try to update again. Tap one waiting icon only if necessary to start the download stream.
    You can also try deleting the waiting icons - tap and hold down on an icon until it wiggles - the tap the X on the icon to delete it. Then try to download again.
    You can try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your app preferences and device settings again.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons
    And you can always finish the app updates in iTunes on your computer and then sync them to the iPad.

  • Can someone tell me why Apple cannot produce a Scabble game that works on Mountain Lion. So frustrated that this is not happening with all the technology available.

    Can someone tell me why Apple cannot produce a Scabble game that works on Mountain Lion. So frustrated that this is not happening with all the technology available.

    The only companies that can make a Scrabble game are the companies that own the rights to the game; Hasbro owns the rights in the US & Canada, Mattel owns the rights outside of the US & Canada.
    You need to be speaking to those two companies.

  • HT2905 can someone please tell me why I do not get the delete from disk option when trying to delete duplicate items

    can someone please tell me why I do not get the delete from disk option when trying to delete duplicate items

    The content must be in the iTunes directory structure for that option to appear.

  • After i updated my firefox from 3.16 to 4.0.1, have some websites i can't load, and they showed: " database error" but b4 i never got this problem. Can someone tell me why ?

    after i updated my firefox from 3.16 to 4.0.1, have some websites i can't load, and they showed: " database error" but b4 i never got this problem. Can someone tell me why ?

    Nothing is working and I can't find the Roboform toolbar. Your lack of direct support is really irritating- a live chat at least would be helpful.

  • Can someone tell me why the Yahoo mail server (IMAP) keeps requesting my Yahoo email password and says it's incorrect?  Yahoo is my Mac mail server.  This has happened before, but this time I can't get it to 'Cancel'

    Can someone tell me why the Yahoo mail server (IMAP) keeps requesting my Yahoo email password and says it's incorrect?  Yahoo is my Mac mail server. This has happened before, but this time I can't get it to 'Cancel'.

    You will have to contact Yahoo Support.

  • Please can someone tell me why I am getting this error?

    I want to call a method (setSquare()) when a JLabel is clicked by the user, the following code should work:
    *private void grid11MouseClicked(java.awt.event.MouseEvent evt) {*
    setSquare();
    But I get this error, please can someone tell me what this means? The method is already defined in the class and I have imported javax.swing etc
    Frame.java:181: setSquare(javax.swing.JLabel) in p1.Frame cannot be applied to ()

    drew22299 wrote:
    I want to call a method (setSquare()) when a JLabel is clicked by the user, the following code should work:
    *private void grid11MouseClicked(java.awt.event.MouseEvent evt) {*
    setSquare();
    But I get this error, please can someone tell me what this means? The method is already defined in the class and I have imported javax.swing etc
    Frame.java:181: setSquare(javax.swing.JLabel) in p1.Frame cannot be applied to ()
    As i dont know what that method needs i can't help you there but i do know you cannot leave it blank. Try adding a number/text whatever or null and see what it does. or check the api and take a look what it needs.
    Edited by: deAppel on Oct 31, 2007 10:35 PM

  • Can someone tell me why my iMac lighting element is flickering?

    Can someone tell me why my iMac lighting element is flickering and going to sleep mode too quickly?  The guys at Austin MacWorks (official Mac reps) said they could not duplicate the problem in the shop, but I have a feeling thery did not give it a thorough look.  I don't know to whom I should turn on this.

    What model iMac? Do "About the Mac" and report what it says for processor type. That's a good start to figuring out to which of the four families of iMac yours belongs.
    Also, check the OS version in the same window. Only 2002 iMacs with backlit displays can run the ancient 10.1 OS shown in your profile.
    If you are in Auston Tx, I'm pretty sure it has a real Apple Store. That;s an option if you are still under warranty.

  • Impossible to update the softwares from the top CC menu. First the menu does'nt show the software on my computers and after a while of seaching, the icon disapear from the menu and no uptade. Can someone tell me why. Thank you

    Impossible to update the softwares from the top CC menu. First the menu does'nt show the software on my computers and after a while of seaching, the icon disapear from the menu and no uptade. Can someone tell me why. Thank you

    This is an open forum with a mix of other users and Adobe staff, not Adobe support... you need Adobe support
    Adobe contact information - http://helpx.adobe.com/contact.html may help
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

Maybe you are looking for

  • [SOLVED] Delete recursively all files with certain extensions

    Hi all, I am trying to recursively delete files with specific extensions. Many of these files have names containing spaces. The following, that I found googling around, didn't work: find /media/TSUNAMI -name '*out' -or -name '*aux' -or -name '*log' -

  • What message type used by ALE in transactional data

    Hello friends,,,       I wish to know what msg types are used in transactional data like PO, PR, etc in Materail tables??? thanking you

  • Afdrukken naar jpeg in voorvertoning geeft error

    Ik krijg de volgende error bij het afdrukken naar JPEg vanuit de voorvertning, iemand een idee? Er heeft zich een fout voorgedaan bij het uitvoeren van de taak 'Kopieer Finder-onderdelen (Copy Finder Items)'. Controleer de kenmerken. Welke kenmerken

  • Indd - JS: Searching an image in subfolders and relinking

    Hi, Can any one help me.... In an Indesign Document I want to relink all the images to a new path. Please see the below script, it search for the images in a specified path only. But i want to search the images in a particular directory along with it

  • BCC error "Failed to connect to agent"

    Hi , I am trying to start the BCC module with B2B application as the production.I am using the default B2B application Motorprise provided with ATG.The production server is up and running fine. But the when I start the BCC it starts but am not able t