Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Echo Submit Button in PHP

Tags:

html

forms

php

I am trying to echo a submit form in my php code:

I am trying the following:

// Display results
foreach ($media->data as $data) {
echo "<a href=\"{$data->link}\"</a>";
echo "<h4>Photo by: {$data->user->username}</h6>";
echo $pictureImage = "<img src=\"{$data->images->thumbnail->url}\">";
echo "<h5>Like Count for Photo: {$data->likes->count}</h5>";
echo "<form>";
echo "<form action='tag.php' method='post'>";
echo "<input type='submit' name='submit'>";
echo "</form>";

}

Then:

if(isset($_POST['submit'])) {
echo "hello";
}

This doesn't seem to echo "hello";

Any help would be appreciated

like image 436
qweqweqwe Avatar asked May 29 '26 03:05

qweqweqwe


1 Answers

You're missing a closing parenthesis:

if(isset($_POST['submit'])) {
                          ^
                          Here
like image 156
nickb Avatar answered May 31 '26 16:05

nickb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!