Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6897259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:08:47+00:00 2026-05-27T07:08:47+00:00

I had my code working earlier today, with first asks for your name with

  • 0

I had my code working earlier today, with first asks for your name with html and then generated a “Hello -username- -surname-” message with php. I was trying to adjust the indentation and i think i must have erased something that now makes it simply display the code… Thanks for the help!

The html page:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">

        <title>form 11 29</title> </head>

        <body>

        <form method="post" action="process1.php" name="form1">
        Name : <input name="firstname" value=""><br>
        Surname : <input name="surname"> 
        <input name="s1" value="Submit LoL !" type="submit"><br>

        <br>
        <br>


        </form>

<br>

</body>
</html>

The php page:

<?php

        $name = $_POST[firstname];

        $surname = $_POST[surname];


        echo "Hello "; 

        echo $name;

        echo "&nbsp";

        echo $surname;

        echo "<br />";


?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:08:48+00:00Added an answer on May 27, 2026 at 7:08 am

    It work for me (sort of). It gives this output

    Notice: Use of undefined constant firstname - assumed 'firstname' in F:\Dropbox\htdocs\process1.php on line 3
    
    Notice: Use of undefined constant surname - assumed 'surname' in F:\Dropbox\htdocs\.php on line 5
    Hello Joe Blow
    

    Because you forgot to put quotes around the indices to $_POST, which should be

      $name = $_POST['firstname'];
      $surname = $_POST['surname'];
    

    Btw – now you have leanred the value of backups. Use a VCS (or, use Dropbox whch will keep old vesions for you (hmmm, irrc, if you develop in Netbeans it will also keep old versions and let you diff them with the current version))


    Udate: are you uploading to a website or runing on your own PC? If your own PC then perhaps your web server (Apache or ISS) stopped runing?

    You asked abotu NetBeans: take a look at http://en.wikipedia.org/wiki/NetBeans and http://netbeans.org/features/php/ Netbeans is an excellent free IDE (partly developed and supported by Sun) which is my developmnent platform of choice as a professional PHP developer (and I am not alone). Give it a try; I doubt that you will look back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So basically this code was working fine before. I had some computer issues and
I was working on some code recently and came across a method that had
I had this code working yesterday, but it seems like I edited it a
Relevant things: I had fullscreen code working before I did a security update on
This is one of those cases where I had the code working, tried to
I am pulling my hair out. I had this working earlier. My confirm.php checks
Possible Duplicate: Randomize a List<T> in C# I thought I had my code working
This code was working up until today now I keep getting the buffer exceeded
I've got this code (Java, GAE): // Much earlier: playerKey = KeyFactory.keyToString(somePlayer.key); // Then,
I had the following code working on on OS 3.x NSString *stringDate = @2010-06-21T20:06:36+00:00;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.