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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.