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

  • SEARCH
  • Home
  • 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 8026541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:31:36+00:00 2026-06-04T23:31:36+00:00

i want to know how to send value form my_name in index.php below to

  • 0

i want to know how to send value form my_name in index.php below to result.php.

below is the php code to check for errors after the input form.
and how to send form results that there is no error to result.php

here is index.php

<?php 
if ($_POST["_submit_check"]) {
    if ($form_errors = validate_form()) {
    show_form($form_errors);
    } else {
process_form();
}
} else {
show_form();
}

function process_form() {
//if doesnt makes error
//i want to send result "my_name" to result.php
header('Location: result.php');
}

function show_form($errors = '') {
    if ($errors) {
    print implode('</li><li><br>', $errors);
    print '</li></ul>';
}
print<<<_HTML_
<form method="POST" action="$_SERVER[PHP_SELF]">
Your name: <input type="text" name="my_name">$errors[0];
<br/>
<input type="submit" value="Submit">
<input type="hidden" name="_submit_check" value="1">
</form>
_HTML_;
}

function validate_form() {
    $errors = array();
    if (strlen($_POST['my_name']) < 3) {
    $errors[] = "Your name must be at least 3 letters long.";
    }
    return $errors;
}

?>

here is result.php

<?php
//prints result form from index.php
?>
  • 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-06-04T23:31:38+00:00Added an answer on June 4, 2026 at 11:31 pm

    you can do it with HTTP GET variables

    header('Location: result.php?name='.$_POST['my_name']);
    

    in result.php

    you can see the value

    echo $_GET['name'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a sample form and code below to illustrate. I know i can
i want know if is possible, to get a specific element value of a
want to know why String behaves like value type while using ==. String s1
I want to know how to capitalize in PHP
I want send an array to my codeigniter app for deleted. I know i
I use $.get(... syntax to send my form data with Jquery Ajax. I want
I want to know a method how can I send 1 specified item for
I just want to send the value of my dropdownlist with a requestparameter. In
I'm making a chat responder for a game and i want know if there
Want to know what is the difference between ipv4 and ipv6 and how does

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.