Jump to content

I have a logon page that I want to greet the user but the username is not showin


cluce

Recommended Posts

<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">

                        <input name="username" type="text" id="username" />

                      </div></td></tr>

                <tr>

                  <td><div align="left">Password:</div></td>

                  <td>

                    <div align="center">

                      <input name="password" type="text" id="password" />

                      </div></td></tr>

              </table>                <p>

                <input type="submit" name="Submit" value="Logon" />

                <input name="Cancel" type="reset" id="Cancel" value="Cancel" />

        </form>

 

page 2 code.......

              <?php  echo( "Welcome ,$_POST[username]!" );  ?> </p>

 

OK, I can pass the data when I uses apache 1.2 version but when I use WAMP and apache 2 it won't pass the data from one page to another. I am puzzled.

 

Can someone see why I can't display the username upon them logon on?

Thanks

Link to comment
Share on other sites

Use [ code ] tags next time.

 

Try this:

 

<?php  
echo "Welcome, " . $_POST['username'] . "!";  
?>

 

It could be the apache settings or the PHP settings, but the index of an array, if it is not an integer should always be encapsulated in " " or ' ' or else the php script takes it as a constant which it isn't and may throw an error.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.