Fetch value of a input type and store in variable

I have following input type

<input id="crp-project-title" class="crp-project-title" type="text" placeholder="Enter project title" value="EXTERIOR" name="project.title">

Its value is value="EXTERIOR". I want to fetch the value and store in a variable. I am not getting any idea regarding this. I am trying to modify plugin (career portfolio) according to my project and its part of that.

Related posts

2 comments

  1. Your html form:

    <form method="POST" action="process.php">
        <input type="text" name="foo">
        <input type="submit">
    </form>
    

    Your Php form processing page (process.php):

    <?php
        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
            $foo = filter_input(INPUT_POST, 'foo', FILTER_SANITIZE_STRING);
        }
    ?>
    
  2. This is front end code, if you are trying to move front end data to server side it must pass through the server. i.e. $_POST…

    now you can either do this with AJAX / PHP or PHP / HTML only

    <?php
     if(isset($_POST[project.title])
        $var = $_POST[project.title]; //its now in a varible
    ?>
    <form method="POST" action="thispage.php">
    <input id="crp-project-title" class="crp-project-title" type="text" placeholder="Enter project title" value="EXTERIOR" name="project.title">
    <input type=submit value="PRESS ME TO SUBMIT VALUE TO VAR">
    </form>
    

Comments are closed.