The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Form Post Method, $_Get in Form Post Action
post Dec 19 2018, 08:54 AM
Post #1


Group: Members
Posts: 12
Joined: 19-December 18
Member No.: 26,776

Hi all,

I'm very new to HTML and PhP but learning as I go.
In code below I would like to 'insert' the id (from the URL) to the Action in the Form Post method.
As you will see I tried to pass the $id value into the Action but it is not working.
If I hardcode the correct value then all my following code work 100%

URL would be something like:


//getting id from URL
$id = $_GET['id'];

    <title>Add Data</title>


    <form method="post" name="form1" action="addrec.php?id="&<?php echo $id;?>>
        <table width="25%" border="0">
                <td>Day <?php echo $id;?> N </td>
                <td><input type="text" name="HDay"></td>
                <td><input type="text" name="HMonth"></td>
                <td><input type="text" name="Relation"></td>
                <td><input type="submit" name="Submit" value="Add"></td>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


- Lo-Fi Version Time is now: 17th November 2019 - 03:42 PM