-1

Is there a way to replicate this in <a href="blah.php">?

<form action="http://localhost/php/suburb_added.php" method="post">
<b>Add a New Suburb</b>
<p>Name:
<input type="text" name="suburb" size="30" value="" />
<input type="submit" id="submit" value="Submit" name="submit" />
</p>
</form>

in suburb_added.php... i have this to capture

if (!empty($_POST['suburb']))

To a table form....

<td align="left"><a href="suburb_added.php"><?php echo $row['id'];?></td>

how to create the items below from a table? The goal is when I click the result from <?php echo $row['id'];?>, I should be able to get the value of "id" and process it in suburb_added.php using similar to if (!empty($_POST['suburb']))

<form action="http://localhost/php/suburb_added.php" method="post">
<input type="text" name="suburb" size="30" value="" />
d0nut
  • 2,835
  • 1
  • 18
  • 23
vileharp
  • 1
  • 1
  • 3

3 Answers3

0

what do you whant i don't understand?? I can help you

 <?php
 if(!isset($_POST['submit'])){
 ?>
 <form action="" method="post" name="submit">
 <b>Add a New Suburb</b>
 <p>Name:
 <input type="text" name="suburb" size="30" value="" />
 <input type="submit" id="submit" value="Submit" name="submit" />
 </p>
 </form>
<?php
} else {
//paste here your code from http://localhost/php/suburb_added.php
echo "you doing post in this page.";
}
?>
  • Basically I have a working php query which displays the basic information in a table (below)... > ID number Item Name Category Brand > 1 Iphone Electronics Generic I am trying to create a link using html and php to extract more detailed information from mysql when the user clicks "1". – vileharp Jan 14 '16 at 01:01
0

<!--Try using header

like this:-->

if($_POST)  
{  
  header('location:login-form.php');  
}
else
{
  echo "";
}
newby
  • 19
  • 1
  • 8
0

Change the PHP script so it uses $_REQUEST instead of $_POST. This variable combines the contents of $_POST and $_GET. Then you can have a link like

<a href="suburb_added.php?suburb=<?php echo urlencode($row['name']) ?>"><?php echo $row['id'] ?></a>
Barmar
  • 741,623
  • 53
  • 500
  • 612